bacgkroudns of views now watch for the background file to change... if it

does.. the background changes - hand for setting your own root bg.. just use
ebony.. save it and:

cp file.bg.db ~/.e.desktop/default/.e_background.bg.db


SVN revision: 5708
This commit is contained in:
Carsten Haitzler 2001-11-17 02:45:43 +00:00
parent 03b6b2eb69
commit febd6d0d43
4 changed files with 84 additions and 16 deletions

View File

@ -112,6 +112,7 @@ e_background_load(char *file)
sprintf(buf, "/layers/%i/bg.b", i); e_db_int_get(db, buf, &(bl->bg.b)); 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)); sprintf(buf, "/layers/%i/bg.a", i); e_db_int_get(db, buf, &(bl->bg.a));
} }
e_db_close(db);
D_RETURN_(bg); D_RETURN_(bg);
} }

View File

@ -133,12 +133,15 @@ e_iconbar_new(E_View *v)
/* structs and lists and stuff for us... we told it how to in init */ /* structs and lists and stuff for us... we told it how to in init */
ib = e_config_load(buf, "", cf_iconbar); ib = e_config_load(buf, "", cf_iconbar);
/* flush image cache */ /* flush image cache */
{
if (v->evas)
{ {
int size; int size;
size = imlib_get_cache_size(); size = evas_get_image_cache(v->evas);
imlib_set_cache_size(0); evas_set_image_cache(v->evas, 0);
imlib_set_cache_size(size); evas_set_image_cache(v->evas, size);
}
} }
/* flush edb cached handled */ /* flush edb cached handled */
e_db_flush(); e_db_flush();

View File

@ -42,6 +42,7 @@ static void e_view_geometry_record_timeout(int val, void *data);
static void e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar *sb, double val); static void e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar *sb, double val);
static void e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar *sb, double val); static void e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar *sb, double val);
static void e_view_write_icon_xy_timeout(int val, void *data); static void e_view_write_icon_xy_timeout(int val, void *data);
static void e_view_bg_reload_timeout(int val, void *data);
static void static void
e_view_write_icon_xy_timeout(int val, void *data) e_view_write_icon_xy_timeout(int val, void *data)
@ -864,10 +865,7 @@ e_configure(Ecore_Event * ev)
ecore_window_set_background_pixmap(v->win.main, v->pmap); ecore_window_set_background_pixmap(v->win.main, v->pmap);
ecore_window_clear(v->win.main); ecore_window_clear(v->win.main);
} }
if (v->bg) if (v->bg) e_background_set_size(v->bg, v->size.w, v->size.h);
{
e_background_set_size(v->bg, v->size.w, v->size.h);
}
D("evas_set_output_viewpor(%p)\n", v->evas); D("evas_set_output_viewpor(%p)\n", v->evas);
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);
@ -1574,9 +1572,11 @@ e_view_file_changed(int id, char *file)
if (!file) D_RETURN; if (!file) D_RETURN;
if (file[0] == '/') D_RETURN; if (file[0] == '/') D_RETURN;
v = e_view_find_by_monitor_id(id); v = e_view_find_by_monitor_id(id);
e_iconbar_file_change(v, file);
if (!v) D_RETURN; if (!v) D_RETURN;
e_iconbar_file_change(v, file);
e_view_bg_change(v, file);
{ {
E_Icon *ic; E_Icon *ic;
@ -2218,12 +2218,15 @@ e_view_handle_fs(EfsdEvent *ev)
{ {
D("Attempted to set background for: %s\n", v->dir); D("Attempted to set background for: %s\n", v->dir);
v->bg = e_background_load(efsd_metadata_get_str(ev)); v->bg = e_background_load(efsd_metadata_get_str(ev));
if ((v->bg) && (v->evas))
{
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); e_background_set_size(v->bg, v->size.w, v->size.h);
} }
} }
} }
} }
}
if (ok) if (ok)
{ {
if ((!v->geom_get.x) && if ((!v->geom_get.x) &&
@ -2269,6 +2272,65 @@ e_view_handle_fs(EfsdEvent *ev)
D_RETURN; D_RETURN;
} }
static void
e_view_bg_reload_timeout(int val, void *data)
{
E_View *v;
E_Background *bg;
char buf[PATH_MAX];
D_ENTER;
v = data;
sprintf(buf, "%s/.e_background.bg.db", v->dir);
if (v->bg)
{
int size;
e_object_unref(E_OBJECT(v->bg));
v->bg = NULL;
if (v->evas)
{
size = evas_get_image_cache(v->evas);
evas_set_image_cache(v->evas, 0);
evas_set_image_cache(v->evas, size);
}
e_db_flush();
}
bg = e_background_load(buf);
if (!bg)
{
sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
bg = e_background_load(buf);
}
if (bg)
{
v->bg = bg;
if (v->evas)
{
e_background_realize(v->bg, v->evas);
e_background_set_scroll(v->bg, v->scroll.x, v->scroll.y);
e_background_set_size(v->bg, v->size.w, v->size.h);
}
}
D_RETURN;
}
void
e_view_bg_change(E_View *v, char *file)
{
char buf[PATH_MAX];
D_ENTER;
if (!(!strcmp(file, ".e_background.bg.db"))) return;
sprintf(buf, "background_reload:%s", v->dir);
ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
D_RETURN;
}
void void
e_view_init(void) e_view_init(void)
{ {

View File

@ -222,4 +222,6 @@ void e_view_realize(E_View *v);
void e_view_update(E_View *v); void e_view_update(E_View *v);
void e_view_bg_change(E_View *v, char *file);
#endif #endif