forked from enlightenment/enlightenment
use the new background code & system.... yay yay :)
SVN revision: 5006
This commit is contained in:
parent
78bb51a943
commit
fb16d6bf5d
Binary file not shown.
238
src/background.c
238
src/background.c
|
@ -3,9 +3,24 @@
|
||||||
void
|
void
|
||||||
e_background_free(E_Background *bg)
|
e_background_free(E_Background *bg)
|
||||||
{
|
{
|
||||||
IF_FREE(bg->image);
|
Evas_List l;
|
||||||
if ((bg->evas) && (bg->obj))
|
|
||||||
evas_del_object(bg->evas, bg->obj);
|
if (bg->layers)
|
||||||
|
{
|
||||||
|
for (l = bg->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Background_Layer *bl;
|
||||||
|
|
||||||
|
bl = l->data;
|
||||||
|
if (bl->color_class) FREE(bl->color_class);
|
||||||
|
if (bl->file) FREE(bl->file);
|
||||||
|
if (bl->obj) evas_del_object(bg->evas, bl->obj);
|
||||||
|
FREE(bl);
|
||||||
|
}
|
||||||
|
evas_list_free(bg->layers);
|
||||||
|
}
|
||||||
|
if (bg->file) FREE (bg->file);
|
||||||
|
if (bg->base_obj) evas_del_object(bg->evas, bg->base_obj);
|
||||||
FREE(bg);
|
FREE(bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,23 +36,214 @@ e_background_new(void)
|
||||||
return bg;
|
return bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
E_Background *
|
||||||
|
e_background_load(char *file)
|
||||||
|
{
|
||||||
|
E_Background *bg;
|
||||||
|
E_DB_File *db;
|
||||||
|
int i, num;
|
||||||
|
|
||||||
|
db = e_db_open_read(file);
|
||||||
|
if (!db) return NULL;
|
||||||
|
num = 0;
|
||||||
|
e_db_int_get(db, "/type/bg", &num);
|
||||||
|
if (num != 1)
|
||||||
|
{
|
||||||
|
e_db_close(db);
|
||||||
|
e_db_flush();
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
e_db_int_get(db, "/layers/count", &num);
|
||||||
|
|
||||||
|
bg = e_background_new();
|
||||||
|
bg->file = strdup(file);
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
E_Background_Layer *bl;
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
bl = NEW(E_Background_Layer, 1);
|
||||||
|
ZERO(bl, E_Background_Layer, 1);
|
||||||
|
bg->layers = evas_list_append(bg->layers, bl);
|
||||||
|
|
||||||
|
sprintf(buf, "/layers/%i/type", i); e_db_int_get(db, buf, &(bl->type));
|
||||||
|
sprintf(buf, "/layers/%i/inlined", i); e_db_int_get(db, buf, &(bl->inlined));
|
||||||
|
sprintf(buf, "/layers/%i/color_class", i); bl->color_class = e_db_str_get(db, buf);
|
||||||
|
if (bl->inlined)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%s:/layers/%i/image", file, i); bl->file = strdup(buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(buf, "/layers/%i/file", i); bl->file = e_db_str_get(db, buf);
|
||||||
|
}
|
||||||
|
sprintf(buf, "/layers/%i/scroll.x", i); e_db_float_get(db, buf, &(bl->scroll.x));
|
||||||
|
sprintf(buf, "/layers/%i/scroll.y", i); e_db_float_get(db, buf, &(bl->scroll.y));
|
||||||
|
sprintf(buf, "/layers/%i/pos.x", i); e_db_float_get(db, buf, &(bl->pos.x));
|
||||||
|
sprintf(buf, "/layers/%i/pos.y", i); e_db_float_get(db, buf, &(bl->pos.y));
|
||||||
|
sprintf(buf, "/layers/%i/size.w", i); e_db_float_get(db, buf, &(bl->size.w));
|
||||||
|
sprintf(buf, "/layers/%i/size.h", i); e_db_float_get(db, buf, &(bl->size.h));
|
||||||
|
sprintf(buf, "/layers/%i/size.orig.w", i); e_db_int_get(db, buf, &(bl->size.orig.w));
|
||||||
|
sprintf(buf, "/layers/%i/size.orig.h", i); e_db_int_get(db, buf, &(bl->size.orig.h));
|
||||||
|
sprintf(buf, "/layers/%i/fill.w", i); e_db_float_get(db, buf, &(bl->fill.w));
|
||||||
|
sprintf(buf, "/layers/%i/fill.h", i); e_db_float_get(db, buf, &(bl->fill.h));
|
||||||
|
sprintf(buf, "/layers/%i/fill.orig.w", i); e_db_int_get(db, buf, &(bl->fill.orig.w));
|
||||||
|
sprintf(buf, "/layers/%i/fill.orig.h", i); e_db_int_get(db, buf, &(bl->fill.orig.h));
|
||||||
|
sprintf(buf, "/layers/%i/angle", i); e_db_float_get(db, buf, &(bl->angle));
|
||||||
|
sprintf(buf, "/layers/%i/fg.r", i); e_db_int_get(db, buf, &(bl->fg.r));
|
||||||
|
sprintf(buf, "/layers/%i/fg.g", i); e_db_int_get(db, buf, &(bl->fg.g));
|
||||||
|
sprintf(buf, "/layers/%i/fg.b", i); e_db_int_get(db, buf, &(bl->fg.b));
|
||||||
|
sprintf(buf, "/layers/%i/fg.a", i); e_db_int_get(db, buf, &(bl->fg.a));
|
||||||
|
sprintf(buf, "/layers/%i/bg.r", i); e_db_int_get(db, buf, &(bl->bg.r));
|
||||||
|
sprintf(buf, "/layers/%i/bg.g", i); e_db_int_get(db, buf, &(bl->bg.g));
|
||||||
|
sprintf(buf, "/layers/%i/bg.b", i); e_db_int_get(db, buf, &(bl->bg.b));
|
||||||
|
sprintf(buf, "/layers/%i/bg.a", i); e_db_int_get(db, buf, &(bl->bg.a));
|
||||||
|
}
|
||||||
|
return bg;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
e_background_realize(E_Background *bg, Evas evas)
|
e_background_realize(E_Background *bg, Evas evas)
|
||||||
{
|
{
|
||||||
Evas_Object o;
|
Evas_List l;
|
||||||
int iw, ih;
|
int ww, hh, count;
|
||||||
|
|
||||||
if (bg->evas) return;
|
if (bg->evas) return;
|
||||||
/* FIXME: boring for now - just a scaled image */
|
|
||||||
bg->evas = evas;
|
bg->evas = evas;
|
||||||
bg->obj = evas_add_image_from_file(bg->evas, bg->image);
|
if (!bg->evas) return;
|
||||||
evas_set_layer(bg->evas, bg->obj, 0);
|
for (count = 0, l = bg->layers; l; l = l->next, count++)
|
||||||
evas_move(bg->evas, bg->obj, 0, 0);
|
{
|
||||||
evas_resize(bg->evas, bg->obj, bg->geom.w, bg->geom.h);
|
E_Background_Layer *bl;
|
||||||
evas_set_image_fill(bg->evas, bg->obj, 0, 0, bg->geom.w, bg->geom.h);
|
|
||||||
evas_show(bg->evas, bg->obj);
|
bl = l->data;
|
||||||
o = evas_add_image_from_file(bg->evas, PACKAGE_DATA_DIR"/data/images/e_logo.png");
|
if (bl->type == 0) /* 0 == image */
|
||||||
evas_get_image_size(bg->evas, o, &iw, &ih);
|
{
|
||||||
evas_move(bg->evas, o, (bg->geom.w - iw) / 2, (bg->geom.h - ih) / 2);
|
bl->obj = evas_add_image_from_file(bg->evas, bl->file);
|
||||||
evas_show(bg->evas, o);
|
evas_set_layer(bg->evas, bl->obj, 0);
|
||||||
|
evas_show(bg->evas, bl->obj);
|
||||||
|
if (evas_get_image_alpha(bg->evas, bl->obj))
|
||||||
|
{
|
||||||
|
bg->base_obj = evas_add_rectangle(bg->evas);
|
||||||
|
evas_lower(bg->evas, bg->base_obj);
|
||||||
|
evas_move(bg->evas, bg->base_obj, 0, 0);
|
||||||
|
evas_resize(bg->evas, bg->base_obj, 999999999, 999999999);
|
||||||
|
evas_set_color(bg->evas, bg->base_obj, 255, 255, 255, 255);
|
||||||
|
evas_show(bg->evas, bg->base_obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (bl->type == 1) /* 1 == gradient */
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if (bl->type == 2) /* 2 == solid */
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ww = bg->geom.w;
|
||||||
|
hh = bg->geom.h;
|
||||||
|
bg->geom.w = 0;
|
||||||
|
bg->geom.h = 0;
|
||||||
|
e_background_set_size(bg, ww, hh);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
e_background_set_scroll(E_Background *bg, int sx, int sy)
|
||||||
|
{
|
||||||
|
Evas_List l;
|
||||||
|
|
||||||
|
if ((bg->geom.sx == sx) && (bg->geom.sy == sy)) return;
|
||||||
|
bg->geom.sx = sx;
|
||||||
|
bg->geom.sy = sy;
|
||||||
|
if (!bg->evas) return;
|
||||||
|
for (l = bg->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Background_Layer *bl;
|
||||||
|
|
||||||
|
bl = l->data;
|
||||||
|
if (bl->type == 0) /* 0 == image */
|
||||||
|
{
|
||||||
|
evas_set_image_fill(bg->evas, bl->obj,
|
||||||
|
(double)bg->geom.sx * bl->scroll.x,
|
||||||
|
(double)bg->geom.sy * bl->scroll.y,
|
||||||
|
bl->fw, bl->fh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
e_background_set_size(E_Background *bg, int w, int h)
|
||||||
|
{
|
||||||
|
Evas_List l;
|
||||||
|
|
||||||
|
if ((bg->geom.w == w) && (bg->geom.h == h)) return;
|
||||||
|
bg->geom.w = w;
|
||||||
|
bg->geom.h = h;
|
||||||
|
for (l = bg->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Background_Layer *bl;
|
||||||
|
double x, y, w, h, fw, fh;
|
||||||
|
int iw, ih;
|
||||||
|
|
||||||
|
bl = l->data;
|
||||||
|
iw = 0;
|
||||||
|
ih = 0;
|
||||||
|
if (bg->evas) evas_get_image_size(bg->evas, bl->obj, &iw, &ih);
|
||||||
|
w = bl->size.w * (double)bg->geom.w;
|
||||||
|
h = bl->size.h * (double)bg->geom.h;
|
||||||
|
if (bl->size.orig.w) w = (double)iw * bl->size.w;
|
||||||
|
if (bl->size.orig.h) h = (double)ih * bl->size.h;
|
||||||
|
fw = bl->fill.w * w;
|
||||||
|
fh = bl->fill.h * h;
|
||||||
|
if (bl->fill.orig.w) fw = (double)iw * bl->fill.w;
|
||||||
|
if (bl->fill.orig.h) fh = (double)ih * bl->fill.h;
|
||||||
|
x = ((double)bg->geom.w - w + 1) * bl->pos.x;
|
||||||
|
y = ((double)bg->geom.h - h + 1) * bl->pos.y;
|
||||||
|
bl->x = x;
|
||||||
|
bl->y = y;
|
||||||
|
bl->w = w;
|
||||||
|
bl->h = h;
|
||||||
|
bl->fw = fw;
|
||||||
|
bl->fh = fh;
|
||||||
|
if (bg->evas)
|
||||||
|
{
|
||||||
|
evas_move(bg->evas, bl->obj, bl->x, bl->y);
|
||||||
|
evas_resize(bg->evas, bl->obj, bl->w, bl->h);
|
||||||
|
if (bl->type == 0) /* 0 == image */
|
||||||
|
{
|
||||||
|
evas_set_image_fill(bg->evas, bl->obj,
|
||||||
|
(double)bg->geom.sx * bl->scroll.x,
|
||||||
|
(double)bg->geom.sy * bl->scroll.y,
|
||||||
|
bl->fw, bl->fh);
|
||||||
|
}
|
||||||
|
else if (bl->type == 1) /* 1 == gradient */
|
||||||
|
{
|
||||||
|
evas_set_angle(bg->evas, bl->obj, bl->angle);
|
||||||
|
}
|
||||||
|
else if (bl->type == 2) /* 2 == solid */
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
e_background_set_color_class(E_Background *bg, char *cc, int r, int g, int b, int a)
|
||||||
|
{
|
||||||
|
Evas_List l;
|
||||||
|
|
||||||
|
for (l = bg->layers; l; l = l->next)
|
||||||
|
{
|
||||||
|
E_Background_Layer *bl;
|
||||||
|
|
||||||
|
bl = l->data;
|
||||||
|
if ((bl->color_class) && (cc) && (!strcmp(bl->color_class, cc)))
|
||||||
|
{
|
||||||
|
if (bg->evas)
|
||||||
|
{
|
||||||
|
if ((l == bg->layers) && (bg->base_obj))
|
||||||
|
evas_set_color(bg->evas, bl->obj, r, g, b, 255);
|
||||||
|
else
|
||||||
|
evas_set_color(bg->evas, bl->obj, r, g, b, a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ static char cfg_entries_dir[4096] = "";
|
||||||
static char cfg_selections_dir[4096] = "";
|
static char cfg_selections_dir[4096] = "";
|
||||||
static char cfg_user_dir[4096] = "";
|
static char cfg_user_dir[4096] = "";
|
||||||
static char cfg_images_dir[4096] = "";
|
static char cfg_images_dir[4096] = "";
|
||||||
|
static char cfg_backgrounds_dir[4096] = "";
|
||||||
static char cfg_fonts_dir[4096] = "";
|
static char cfg_fonts_dir[4096] = "";
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -60,6 +61,8 @@ e_config_get(char *type)
|
||||||
PACKAGE_DATA_DIR"/data/config/appearance/default/selections/");
|
PACKAGE_DATA_DIR"/data/config/appearance/default/selections/");
|
||||||
E_CONF("images", cfg_images_dir,
|
E_CONF("images", cfg_images_dir,
|
||||||
PACKAGE_DATA_DIR"/data/images/");
|
PACKAGE_DATA_DIR"/data/images/");
|
||||||
|
E_CONF("backgrounds", cfg_backgrounds_dir,
|
||||||
|
PACKAGE_DATA_DIR"/data/backgrounds/");
|
||||||
E_CONF("fonts", cfg_fonts_dir,
|
E_CONF("fonts", cfg_fonts_dir,
|
||||||
PACKAGE_DATA_DIR"/data/fonts/");
|
PACKAGE_DATA_DIR"/data/fonts/");
|
||||||
return "";
|
return "";
|
||||||
|
@ -118,6 +121,7 @@ e_config_set_user_dir(char *dir)
|
||||||
cfg_entries_dir[0] = 0;
|
cfg_entries_dir[0] = 0;
|
||||||
cfg_user_dir[0] = 0;
|
cfg_user_dir[0] = 0;
|
||||||
cfg_images_dir[0] = 0;
|
cfg_images_dir[0] = 0;
|
||||||
|
cfg_backgrounds_dir[0] = 0;
|
||||||
cfg_fonts_dir[0] = 0;
|
cfg_fonts_dir[0] = 0;
|
||||||
/* init again - if the user hasnt got all the data */
|
/* init again - if the user hasnt got all the data */
|
||||||
e_config_init();
|
e_config_init();
|
||||||
|
|
|
@ -164,9 +164,15 @@ e_desktops_init_file_display(E_Desktop *desk)
|
||||||
desk->view->size.w = desk->real.w;
|
desk->view->size.w = desk->real.w;
|
||||||
desk->view->size.h = desk->real.h;
|
desk->view->size.h = desk->real.h;
|
||||||
desk->view->is_desktop = 1;
|
desk->view->is_desktop = 1;
|
||||||
desk->view->bg = e_background_new();
|
/* FIXME: load bg here */
|
||||||
desk->view->bg->image = strdup(PACKAGE_DATA_DIR"/data/images/bg.jpg");
|
{
|
||||||
/* fixme later */
|
char buf[4096];
|
||||||
|
|
||||||
|
sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
|
||||||
|
desk->view->bg = e_background_load(buf);
|
||||||
|
printf("**** load %s = %p\n", buf, desk->view->bg);
|
||||||
|
}
|
||||||
|
/* fixme: later */
|
||||||
/* uncomment this and comment out the next line for some tress testing */
|
/* uncomment this and comment out the next line for some tress testing */
|
||||||
/* desk->view->dir = strdup("/dev"); */
|
/* desk->view->dir = strdup("/dev"); */
|
||||||
desk->view->dir = strdup(e_file_home());
|
desk->view->dir = strdup(e_file_home());
|
||||||
|
|
62
src/e.h
62
src/e.h
|
@ -139,6 +139,7 @@ typedef struct _E_View E_View;
|
||||||
typedef struct _E_Icon E_Icon;
|
typedef struct _E_Icon E_Icon;
|
||||||
typedef struct _E_Shelf E_Shelf;
|
typedef struct _E_Shelf E_Shelf;
|
||||||
typedef struct _E_Background E_Background;
|
typedef struct _E_Background E_Background;
|
||||||
|
typedef struct _E_Background_Layer E_Background_Layer;
|
||||||
typedef struct _E_Menu E_Menu;
|
typedef struct _E_Menu E_Menu;
|
||||||
typedef struct _E_Menu_Item E_Menu_Item;
|
typedef struct _E_Menu_Item E_Menu_Item;
|
||||||
typedef struct _E_Build_Menu E_Build_Menu;
|
typedef struct _E_Build_Menu E_Build_Menu;
|
||||||
|
@ -458,6 +459,7 @@ struct _E_Icon
|
||||||
int disabled;
|
int disabled;
|
||||||
int visible;
|
int visible;
|
||||||
int just_selected;
|
int just_selected;
|
||||||
|
int just_executed;
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
@ -495,19 +497,50 @@ struct _E_Shelf
|
||||||
} state;
|
} state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _E_Background_Layer
|
||||||
|
{
|
||||||
|
int mode;
|
||||||
|
int type;
|
||||||
|
int inlined;
|
||||||
|
struct {
|
||||||
|
float x, y;
|
||||||
|
} scroll;
|
||||||
|
struct {
|
||||||
|
float x, y;
|
||||||
|
} pos;
|
||||||
|
struct {
|
||||||
|
float w, h;
|
||||||
|
struct {
|
||||||
|
int w, h;
|
||||||
|
} orig;
|
||||||
|
} size, fill;
|
||||||
|
char *color_class;
|
||||||
|
char *file;
|
||||||
|
double angle;
|
||||||
|
struct {
|
||||||
|
int r, g, b, a;
|
||||||
|
} fg, bg;
|
||||||
|
|
||||||
|
double x, y, w, h, fw, fh;
|
||||||
|
|
||||||
|
Evas_Object obj;
|
||||||
|
};
|
||||||
|
|
||||||
struct _E_Background
|
struct _E_Background
|
||||||
{
|
{
|
||||||
OBJ_PROPERTIES;
|
OBJ_PROPERTIES;
|
||||||
|
|
||||||
Evas evas;
|
Evas evas;
|
||||||
|
char *file;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
int w, h;
|
int w, h;
|
||||||
} geom;
|
} geom;
|
||||||
|
|
||||||
/* FIXME: REALLY boring for now - just a scaled image - temporoary */
|
Evas_List layers;
|
||||||
char *image;
|
|
||||||
Evas_Object obj;
|
Evas_Object base_obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Menu
|
struct _E_Menu
|
||||||
|
@ -1020,28 +1053,13 @@ EfsdConnection *e_fs_get_connection(void);
|
||||||
void e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
|
void e_keys_grab(char *key, Ev_Key_Modifiers mods, int anymod);
|
||||||
void e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
|
void e_keys_ungrab(char *key, Ev_Key_Modifiers mods, int anymod);
|
||||||
void e_keys_init(void);
|
void e_keys_init(void);
|
||||||
|
|
||||||
E_Background *e_background_new(void);
|
E_Background *e_background_new(void);
|
||||||
void e_background_realize(E_Background *bg, Evas evas);
|
void e_background_realize(E_Background *bg, Evas evas);
|
||||||
void e_background_free(E_Background *bg);
|
void e_background_free(E_Background *bg);
|
||||||
|
|
||||||
void e_view_realize(E_View *v);
|
void e_view_realize(E_View *v);
|
||||||
void e_view_update(E_View *v);
|
void e_view_update(E_View *v);
|
||||||
void e_icon_set_xy(E_Icon *icon, int x, int y);
|
|
||||||
void e_icon_update(E_Icon *icon);
|
|
||||||
void e_icon_show(E_Icon *icon);
|
|
||||||
void e_icon_get_xy(E_Icon *icon, int *x, int *y);
|
|
||||||
void e_icon_set_xy(E_Icon *icon, int x, int y);
|
|
||||||
E_Icon *e_icon_new(void);
|
|
||||||
void e_icon_set_filename(E_Icon *icon, char *file);
|
|
||||||
void e_icon_pre_show(E_Icon *icon);
|
|
||||||
void e_icon_realize(E_Icon *icon);
|
|
||||||
void e_icon_unrealize(E_Icon *icon);
|
|
||||||
void e_shelf_del_icon(E_Shelf *sh, E_Icon *icon);
|
|
||||||
void e_shelf_add_icon(E_Shelf *sh, E_Icon *icon);
|
|
||||||
void e_shelf_move_by(E_Shelf *sh, int dx, int dy);
|
|
||||||
void e_shelf_resize_by(E_Shelf *sh, int dw, int dh);
|
|
||||||
void e_shelf_realize(E_Shelf *sh);
|
|
||||||
void e_ipc_init(void);
|
|
||||||
void e_pack_object_init(void);
|
|
||||||
void e_view_update_selection(E_View *v, int x, int y);
|
void e_view_update_selection(E_View *v, int x, int y);
|
||||||
void e_view_update(E_View *v);
|
void e_view_update(E_View *v);
|
||||||
void e_view_scroll(E_View *v, int dx, int dy);
|
void e_view_scroll(E_View *v, int dx, int dy);
|
||||||
|
@ -1049,3 +1067,7 @@ E_View *e_view_find_by_monitor_id(int id);
|
||||||
void e_view_add_icon(E_View *v, E_Icon *icon);
|
void e_view_add_icon(E_View *v, E_Icon *icon);
|
||||||
E_Icon *e_view_find_icon_by_file(E_View *v, char *file);
|
E_Icon *e_view_find_icon_by_file(E_View *v, char *file);
|
||||||
void e_view_del_icon(E_View *v, E_Icon *icon);
|
void e_view_del_icon(E_View *v, E_Icon *icon);
|
||||||
|
|
||||||
|
void e_ipc_init(void);
|
||||||
|
|
||||||
|
void e_pack_object_init(void);
|
||||||
|
|
39
src/view.c
39
src/view.c
|
@ -502,8 +502,13 @@ e_view_icon_exec(E_Icon *ic)
|
||||||
v->size.w = 400;
|
v->size.w = 400;
|
||||||
v->size.h = 300;
|
v->size.h = 300;
|
||||||
v->options.back_pixmap = 0;
|
v->options.back_pixmap = 0;
|
||||||
v->bg = e_background_new();
|
/* FIXME: load bg here */
|
||||||
v->bg->image = strdup(PACKAGE_DATA_DIR"/data/images/bg.jpg");
|
{
|
||||||
|
char buf[4096];
|
||||||
|
|
||||||
|
sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
|
||||||
|
v->bg = e_background_load(buf);
|
||||||
|
}
|
||||||
sprintf(buf, "%s/%s", ic->view->dir, ic->file);
|
sprintf(buf, "%s/%s", ic->view->dir, ic->file);
|
||||||
printf("new dir >%s<\n", buf);
|
printf("new dir >%s<\n", buf);
|
||||||
v->dir = strdup(buf);
|
v->dir = strdup(buf);
|
||||||
|
@ -511,6 +516,7 @@ e_view_icon_exec(E_Icon *ic)
|
||||||
if (v->options.back_pixmap) e_view_update(v);
|
if (v->options.back_pixmap) e_view_update(v);
|
||||||
b = e_border_adopt(v->win.base, 1);
|
b = e_border_adopt(v->win.base, 1);
|
||||||
}
|
}
|
||||||
|
e_view_icon_deselect(ic);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -532,6 +538,7 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||||
if (e->double_click)
|
if (e->double_click)
|
||||||
{
|
{
|
||||||
e_view_icon_exec(ic);
|
e_view_icon_exec(ic);
|
||||||
|
ic->state.just_executed = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -578,6 +585,12 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_b == 1)
|
if (_b == 1)
|
||||||
|
{
|
||||||
|
if (ic->state.just_executed)
|
||||||
|
{
|
||||||
|
ic->state.just_executed = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if ((e->mods & mulit_select_mod))
|
if ((e->mods & mulit_select_mod))
|
||||||
{
|
{
|
||||||
|
@ -590,6 +603,7 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
|
||||||
e_view_deselect_all_except(ic);
|
e_view_deselect_all_except(ic);
|
||||||
e_view_icon_select(ic);
|
e_view_icon_select(ic);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ic->state.just_selected = 0;
|
ic->state.just_selected = 0;
|
||||||
}
|
}
|
||||||
ic->state.clicked = 0;
|
ic->state.clicked = 0;
|
||||||
|
@ -895,13 +909,11 @@ void e_configure(Eevent * ev)
|
||||||
}
|
}
|
||||||
if (v->bg)
|
if (v->bg)
|
||||||
{
|
{
|
||||||
v->bg->geom.w = v->size.w;
|
e_background_set_size(v->bg, v->size.w, v->size.h);
|
||||||
v->bg->geom.h = v->size.h;
|
|
||||||
evas_resize(v->bg->evas, v->bg->obj, v->bg->geom.w, v->bg->geom.h);
|
|
||||||
evas_set_image_fill(v->bg->evas, v->bg->obj, 0, 0, v->bg->geom.w, v->bg->geom.h);
|
|
||||||
}
|
}
|
||||||
evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h);
|
evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h);
|
||||||
evas_set_output_size(v->evas, v->size.w, v->size.h);
|
evas_set_output_size(v->evas, v->size.w, v->size.h);
|
||||||
|
e_view_arrange(v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1002,7 +1014,6 @@ e_delete(Eevent * ev)
|
||||||
{
|
{
|
||||||
Ev_Window_Delete *e;
|
Ev_Window_Delete *e;
|
||||||
Evas_List l;
|
Evas_List l;
|
||||||
Evas_List to_free = NULL;
|
|
||||||
|
|
||||||
e = ev->event;
|
e = ev->event;
|
||||||
for (l = views; l; l = l->next)
|
for (l = views; l; l = l->next)
|
||||||
|
@ -1012,17 +1023,10 @@ e_delete(Eevent * ev)
|
||||||
v = l->data;
|
v = l->data;
|
||||||
if (e->win == v->win.base)
|
if (e->win == v->win.base)
|
||||||
{
|
{
|
||||||
to_free = evas_list_append(to_free, v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (l = to_free; l; l = l->next)
|
|
||||||
{
|
|
||||||
E_View *v;
|
|
||||||
|
|
||||||
v = l->data;
|
|
||||||
OBJ_DO_FREE(v);
|
OBJ_DO_FREE(v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (to_free) evas_list_free(to_free);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1855,9 +1859,8 @@ e_view_realize(E_View *v)
|
||||||
}
|
}
|
||||||
if (v->bg)
|
if (v->bg)
|
||||||
{
|
{
|
||||||
v->bg->geom.w = v->size.w;
|
|
||||||
v->bg->geom.h = v->size.h;
|
|
||||||
e_background_realize(v->bg, v->evas);
|
e_background_realize(v->bg, v->evas);
|
||||||
|
e_background_set_size(v->bg, v->size.w, v->size.h);
|
||||||
}
|
}
|
||||||
v->obj_bg = evas_add_rectangle(v->evas);
|
v->obj_bg = evas_add_rectangle(v->evas);
|
||||||
evas_callback_add(v->evas, v->obj_bg, CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
|
evas_callback_add(v->evas, v->obj_bg, CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
|
||||||
|
|
Loading…
Reference in New Issue