From 871d94d493c6a56934247f9a75b02550382450ab Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Mon, 8 Apr 2024 19:10:58 +0900 Subject: [PATCH] e_bg: remove e_bg It is not used anymore Change-Id: I4ac4d6a39e7bd26ef28a188fa9560e42f625dbdd --- src/bin/Makefile.mk | 1 - src/bin/e_bg.c | 313 ------------------------------------------------ src/bin/e_bg_intern.h | 40 ------- src/bin/e_comp.c | 13 -- src/bin/e_comp_canvas.c | 3 - src/bin/e_desk.c | 13 -- src/bin/e_zone.c | 19 --- src/bin/e_zone_intern.h | 1 - src/include/e_desk.h | 2 +- src/include/e_zone.h | 4 +- 10 files changed, 3 insertions(+), 406 deletions(-) delete mode 100644 src/bin/e_bg.c delete mode 100644 src/bin/e_bg_intern.h diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk index 41b34b5..b4774ab 100644 --- a/src/bin/Makefile.mk +++ b/src/bin/Makefile.mk @@ -108,7 +108,6 @@ src/include/e_input_thread_client.h enlightenment_src = \ src/bin/e_actions.c \ -src/bin/e_bg.c \ src/bin/e_bindings.c \ src/bin/e_client.c \ src/bin/e_comp.c \ diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c deleted file mode 100644 index 45c54fb..0000000 --- a/src/bin/e_bg.c +++ /dev/null @@ -1,313 +0,0 @@ -#include "e_bg_intern.h" -#include "e_utils_intern.h" -#include "e_theme_intern.h" -#include "e_comp_canvas_intern.h" -#include "e_zone_intern.h" - -/* local subsystem functions */ -static void _e_bg_event_bg_update_free(void *data, void *event); - -/* local subsystem globals */ -EINTERN int E_EVENT_BG_UPDATE = 0; -//static E_Fm2_Mime_Handler *bg_hdl = NULL; - -/* externally accessible functions */ -EINTERN int -e_bg_init(void) -{ - E_EVENT_BG_UPDATE = ecore_event_type_new(); - - return 1; -} - -EINTERN int -e_bg_shutdown(void) -{ - return 1; -} - -/** - * Find the configuration for a given desktop background - * Use -1 as a wild card for each parameter. - * The most specific match will be returned - */ -EINTERN const E_Config_Desktop_Background * -e_bg_config_get(int zone_num, int desk_x, int desk_y) -{ - Eina_List *l, *entries; - E_Config_Desktop_Background *bg = NULL, *cfbg = NULL; - const char *bgfile = ""; - char *entry; - int current_spec = 0; /* how specific the setting is - we want the least general one that applies */ - - /* look for desk specific background. */ - if (zone_num >= 0 || desk_x >= 0 || desk_y >= 0) - { - EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg) - { - int spec; - - if (!cfbg) continue; - spec = 0; - if (cfbg->zone == zone_num) spec++; - else if (cfbg->zone >= 0) - continue; - if (cfbg->desk_x == desk_x) spec++; - else if (cfbg->desk_x >= 0) - continue; - if (cfbg->desk_y == desk_y) spec++; - else if (cfbg->desk_y >= 0) - continue; - - if (spec <= current_spec) continue; - bgfile = cfbg->file; - if (bgfile) - { - if (bgfile[0] != '/') - { - const char *bf; - - bf = e_path_find(path_backgrounds, bgfile); - if (bf) bgfile = bf; - } - } - if (eina_str_has_extension(bgfile, ".edj")) - { - entries = edje_file_collection_list(bgfile); - EINA_LIST_FREE(entries, entry) - { - if (!strcmp(entry, "e/desktop/background")) - { - bg = cfbg; - current_spec = spec; - break; - } - eina_stringshare_del(entry); - } - E_FREE_LIST(entries, eina_stringshare_del); - } - else - { - bg = cfbg; - current_spec = spec; - } - } - } - return bg; -} - -EINTERN Eina_Stringshare * -e_bg_file_get(int zone_num, int desk_x, int desk_y) -{ - const E_Config_Desktop_Background *cfbg; - const char *bgfile = NULL; - int ok = 0; - - cfbg = e_bg_config_get(zone_num, desk_x, desk_y); - - /* fall back to default */ - if (cfbg) - { - const char *bf; - - bgfile = eina_stringshare_ref(cfbg->file); - if (!bgfile) return NULL; - if (bgfile[0] == '/') return bgfile; - bf = e_path_find(path_backgrounds, bgfile); - if (!bf) return bgfile; - eina_stringshare_del(bgfile); - return bf; - } - bgfile = e_config->desktop_default_background; - if (bgfile) - { - if (bgfile[0] != '/') - { - const char *bf; - - bf = e_path_find(path_backgrounds, bgfile); - if (bf) bgfile = bf; - } - else - eina_stringshare_ref(bgfile); - } - if (bgfile && eina_str_has_extension(bgfile, ".edj")) - { - ok = edje_file_group_exists(bgfile, "e/desktop/background"); - } - else if ((bgfile) && (bgfile[0])) - ok = 1; - if (!ok) - eina_stringshare_replace(&bgfile, e_theme_edje_file_get("base/theme/background", - "e/desktop/background")); - - return bgfile; -} - -EINTERN void -e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition) -{ - Evas_Object *o; - const char *bgfile = ""; - E_Desk *desk; - - desk = e_desk_current_get(zone); - if (desk) - bgfile = e_bg_file_get(zone->num, desk->x, desk->y); - else - bgfile = e_bg_file_get(zone->num, -1, -1); - - if (zone->bg_object) - { - const char *pfile = ""; - - edje_object_file_get(zone->bg_object, &pfile, NULL); - if (!e_util_strcmp(pfile, bgfile)) goto end; - } - - if (eina_str_has_extension(bgfile, ".edj")) - { - o = edje_object_add(e_comp->evas); - edje_object_file_set(o, bgfile, "e/desktop/background"); - if (edje_object_data_get(o, "noanimation")) - edje_object_animation_set(o, EINA_FALSE); - } - else - { - // Only support edj bg right now - goto end; - } - evas_object_data_set(o, "e_zone", zone); - evas_object_repeat_events_set(o, 1); - zone->bg_object = o; - evas_object_name_set(zone->bg_object, "zone->bg_object"); - evas_object_move(o, zone->x, zone->y); - evas_object_resize(o, zone->w, zone->h); - evas_object_layer_set(o, E_LAYER_BG); - evas_object_clip_set(o, zone->bg_clip_object); - evas_object_show(o); - - if (zone->bg_object) evas_object_name_set(zone->bg_object, "zone->bg_object"); - if (zone->prev_bg_object) evas_object_name_set(zone->prev_bg_object, "zone->prev_bg_object"); - e_comp_canvas_zone_update(zone); -end: - eina_stringshare_del(bgfile); -} - -EINTERN void -e_bg_default_set(const char *file) -{ - E_Event_Bg_Update *ev; - Eina_Bool changed; - - file = eina_stringshare_add(file); - changed = file != e_config->desktop_default_background; - - if (!changed) - { - eina_stringshare_del(file); - return; - } - - if (e_config->desktop_default_background) - { - eina_stringshare_del(e_config->desktop_default_background); - } - - if (file) - { - e_config->desktop_default_background = file; - } - else - e_config->desktop_default_background = NULL; - - ev = E_NEW(E_Event_Bg_Update, 1); - if (!ev) return; - ev->zone = -1; - ev->desk_x = -1; - ev->desk_y = -1; - ecore_event_add(E_EVENT_BG_UPDATE, ev, _e_bg_event_bg_update_free, NULL); -} - -EINTERN void -e_bg_add(int zone, int desk_x, int desk_y, const char *file) -{ - const Eina_List *l; - E_Config_Desktop_Background *cfbg; - E_Event_Bg_Update *ev; - - file = eina_stringshare_add(file); - - EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg) - { - if ((cfbg) && - (cfbg->zone == zone) && - (cfbg->desk_x == desk_x) && - (cfbg->desk_y == desk_y) && - (cfbg->file == file)) - { - eina_stringshare_del(file); - return; - } - } - - e_bg_del(zone, desk_x, desk_y); - cfbg = E_NEW(E_Config_Desktop_Background, 1); - if (!cfbg) return; - cfbg->zone = zone; - cfbg->desk_x = desk_x; - cfbg->desk_y = desk_y; - cfbg->file = file; - e_config->desktop_backgrounds = eina_list_append(e_config->desktop_backgrounds, cfbg); - - ev = E_NEW(E_Event_Bg_Update, 1); - if (!ev) return; - ev->zone = zone; - ev->desk_x = desk_x; - ev->desk_y = desk_y; - ecore_event_add(E_EVENT_BG_UPDATE, ev, _e_bg_event_bg_update_free, NULL); -} - -EINTERN void -e_bg_del(int zone, int desk_x, int desk_y) -{ - Eina_List *l; - E_Config_Desktop_Background *cfbg; - E_Event_Bg_Update *ev; - - EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg) - { - if (!cfbg) continue; - if ((cfbg->zone == zone) && (cfbg->desk_x == desk_x) && (cfbg->desk_y == desk_y)) - { - e_config->desktop_backgrounds = eina_list_remove_list(e_config->desktop_backgrounds, l); - if (cfbg->file) eina_stringshare_del(cfbg->file); - free(cfbg); - break; - } - } - - ev = E_NEW(E_Event_Bg_Update, 1); - if (!ev) return; - ev->zone = zone; - ev->desk_x = desk_x; - ev->desk_y = desk_y; - ecore_event_add(E_EVENT_BG_UPDATE, ev, _e_bg_event_bg_update_free, NULL); -} - -EINTERN void -e_bg_update(void) -{ - const Eina_List *l; - E_Zone *zone; - - EINA_LIST_FOREACH(e_comp->zones, l, zone) - e_zone_bg_reconfigure(zone); -} - -/* local subsystem functions */ -static void -_e_bg_event_bg_update_free(void *data EINA_UNUSED, void *event) -{ - free(event); -} diff --git a/src/bin/e_bg_intern.h b/src/bin/e_bg_intern.h deleted file mode 100644 index 1c99b37..0000000 --- a/src/bin/e_bg_intern.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef E_BG_INTERN_H -#define E_BG_INTERN_H - -#include "e_intern.h" -#include "e_config_intern.h" - -typedef enum { - E_BG_TRANSITION_NONE, - E_BG_TRANSITION_START, - E_BG_TRANSITION_DESK, - E_BG_TRANSITION_CHANGE -} E_Bg_Transition; - -typedef struct _E_Event_Bg_Update E_Event_Bg_Update; -typedef struct _E_Bg_Image_Import_Handle E_Bg_Image_Import_Handle; - -extern EINTERN int E_EVENT_BG_UPDATE; - -struct _E_Event_Bg_Update -{ - int zone; - int desk_x; - int desk_y; -}; - -EINTERN int e_bg_init(void); -EINTERN int e_bg_shutdown(void); - -EINTERN const E_Config_Desktop_Background *e_bg_config_get(int zone_num, int desk_x, int desk_y); -EINTERN Eina_Stringshare *e_bg_file_get(int zone_num, int desk_x, int desk_y); -EINTERN void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition); -EINTERN void e_bg_add(int zone, int desk_x, int desk_y, const char *file); -EINTERN void e_bg_del(int zone, int desk_x, int desk_y); -EINTERN void e_bg_default_set(const char *file); -EINTERN void e_bg_update(void); - -EINTERN E_Bg_Image_Import_Handle *e_bg_image_import_new(const char *image_file, void (*cb)(void *data, const char *edje_file), const void *data); -EINTERN void e_bg_image_import_cancel(E_Bg_Image_Import_Handle *handle); - -#endif diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 174862d..3107aef 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1,5 +1,4 @@ #include "e_comp_intern.h" -#include "e_bg_intern.h" #include "e_utils_intern.h" #include "e_comp_canvas_intern.h" #include "e_comp_cfdata_intern.h" @@ -441,18 +440,6 @@ e_comp_shutdown(void) EINTERN void e_comp_deferred_job(void) { - /* Bg update */ - e_main_ts_begin("\tE_BG_Zone Update"); - E_Zone *zone = NULL; - zone = e_zone_current_get(); - EINA_SAFETY_ON_NULL_GOTO(zone, comp_wl_job); - if (zone->bg_object) - e_bg_zone_update(zone, E_BG_TRANSITION_DESK); - else - e_bg_zone_update(zone, E_BG_TRANSITION_START); - e_main_ts_end("\tE_BG_Zone Update Done"); - -comp_wl_job: e_main_ts_begin("\tE_Comp_Wl_Deferred"); e_comp_wl_deferred_job(); e_main_ts_end("\tE_Comp_Wl_Deferred Done"); diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c index 9b52898..adbefc8 100644 --- a/src/bin/e_comp_canvas.c +++ b/src/bin/e_comp_canvas.c @@ -283,8 +283,6 @@ e_comp_canvas_zone_update(E_Zone *zone) { e_theme_edje_object_set(zone->base, "base/theme/comp", under_styles[conf->disable_screen_effects]); - edje_object_part_swallow(zone->base, "e.swallow.background", - zone->bg_object); e_theme_edje_object_set(zone->over, "base/theme/comp", over_styles[conf->disable_screen_effects]); return; @@ -295,7 +293,6 @@ e_comp_canvas_zone_update(E_Zone *zone) evas_object_repeat_events_set(o, 1); evas_object_name_set(zone->base, "zone->base"); e_theme_edje_object_set(o, "base/theme/comp", under_styles[conf->disable_screen_effects]); - edje_object_part_swallow(zone->base, "e.swallow.background", zone->bg_object); evas_object_move(o, zone->x, zone->y); evas_object_resize(o, zone->w, zone->h); evas_object_layer_set(o, E_LAYER_BG); diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 8a2138f..3725ac8 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -459,24 +459,11 @@ e_desk_show(E_Desk *desk) msg->val[2] = desk->zone->desk_x_count; msg->val[3] = desk->y; msg->val[4] = desk->zone->desk_y_count; - if (desk->zone->bg_object) - edje_object_message_send(desk->zone->bg_object, EDJE_MESSAGE_FLOAT_SET, 0, msg); -#ifndef ENABLE_QUICK_INIT - int was_zone = 0; - if (desk->zone->bg_object) was_zone = 1; -#endif _e_desk_show_begin(desk, dx, dy); if (desk->smart_obj) evas_object_show(desk->smart_obj); -#ifndef ENABLE_QUICK_INIT - if (was_zone) - e_bg_zone_update(desk->zone, E_BG_TRANSITION_DESK); - else - e_bg_zone_update(desk->zone, E_BG_TRANSITION_START); -#endif - ev = E_NEW(E_Event_Desk_Show, 1); if (!ev) goto error; ev->desk = desk; diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index 23f9542..0e512dd 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -3,7 +3,6 @@ #include "e_desk_intern.h" #include "e_actions_intern.h" #include "e_appinfo_intern.h" -#include "e_bg_intern.h" #include "e_bindings_intern.h" #include "e_comp_wl_rsm_intern.h" #include "e_comp_wl_subsurface_intern.h" @@ -1357,7 +1356,6 @@ e_zone_move(E_Zone *zone, dy = y - zone->y; zone->x = x; zone->y = y; - evas_object_move(zone->bg_object, x, y); evas_object_move(zone->bg_event_object, x, y); evas_object_move(zone->bg_clip_object, x, y); @@ -1369,7 +1367,6 @@ e_zone_move(E_Zone *zone, ecore_event_add(E_EVENT_ZONE_MOVE_RESIZE, ev, _e_zone_event_generic_free, NULL); } - e_zone_bg_reconfigure(zone); e_zone_reconfigure_clients(zone, dx, dy, 0, 0); } @@ -1390,7 +1387,6 @@ e_zone_resize(E_Zone *zone, dh = h - zone->h; zone->w = w; zone->h = h; - evas_object_resize(zone->bg_object, w, h); evas_object_resize(zone->bg_event_object, w, h); evas_object_resize(zone->bg_clip_object, w, h); @@ -1403,7 +1399,6 @@ e_zone_resize(E_Zone *zone, _e_zone_event_generic_free, NULL); } - e_zone_bg_reconfigure(zone); e_zone_reconfigure_clients(zone, 0, 0, dw, dh); } @@ -1432,10 +1427,8 @@ e_zone_move_resize(E_Zone *zone, zone->w = w; zone->h = h; - evas_object_move(zone->bg_object, x, y); evas_object_move(zone->bg_event_object, x, y); evas_object_move(zone->bg_clip_object, x, y); - evas_object_resize(zone->bg_object, w, h); evas_object_resize(zone->bg_event_object, w, h); evas_object_resize(zone->bg_clip_object, w, h); @@ -1448,7 +1441,6 @@ e_zone_move_resize(E_Zone *zone, _e_zone_event_generic_free, NULL); } - e_zone_bg_reconfigure(zone); e_zone_reconfigure_clients(zone, dx, dy, dw, dh); return EINA_TRUE; } @@ -1512,15 +1504,6 @@ e_zone_get_by_position(int x, int y) } EINTERN void -e_zone_bg_reconfigure(E_Zone *zone) -{ - E_OBJECT_CHECK(zone); - E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); - - e_bg_zone_update(zone, E_BG_TRANSITION_CHANGE); -} - -EINTERN void e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count) @@ -1979,8 +1962,6 @@ _e_zone_free(E_Zone *zone) e_comp->zones = eina_list_remove(e_comp->zones, zone); evas_object_del(zone->bg_event_object); evas_object_del(zone->bg_clip_object); - evas_object_del(zone->bg_object); - if (zone->prev_bg_object) evas_object_del(zone->prev_bg_object); evas_object_del(zone->base); evas_object_del(zone->over); diff --git a/src/bin/e_zone_intern.h b/src/bin/e_zone_intern.h index c2efb72..4ad4ff4 100644 --- a/src/bin/e_zone_intern.h +++ b/src/bin/e_zone_intern.h @@ -23,7 +23,6 @@ EINTERN Eina_Bool e_zone_move_resize(E_Zone *zone, int x, int y, int EINTERN void e_zone_resize(E_Zone *zone, int w, int h); EINTERN E_Zone *e_zone_get_by_id(int id); EINTERN E_Zone *e_zone_get_by_position(int x, int y); -EINTERN void e_zone_bg_reconfigure(E_Zone *zone); EINTERN void e_zone_useful_geometry_dirty(E_Zone *zone); EINTERN void e_zone_client_add(E_Zone *zone, E_Client *ec); EINTERN Eina_Bool e_zone_has_ec(E_Zone *zone, E_Client *ec); diff --git a/src/include/e_desk.h b/src/include/e_desk.h index 2437948..7730e11 100644 --- a/src/include/e_desk.h +++ b/src/include/e_desk.h @@ -58,7 +58,7 @@ struct _E_Desk //#else Eina_List *fullscreen_clients; //#endif - Evas_Object *bg_object; + EINA_DEPRECATED Evas_Object *bg_object; Evas_Object *smart_obj; Eina_Rectangle geom; diff --git a/src/include/e_zone.h b/src/include/e_zone.h index 7b733fa..fd1688b 100644 --- a/src/include/e_zone.h +++ b/src/include/e_zone.h @@ -69,10 +69,10 @@ struct _E_Zone * this zone belongs to. */ unsigned int num; - Evas_Object *bg_object; + EINA_DEPRECATED Evas_Object *bg_object; Evas_Object *bg_event_object; Evas_Object *bg_clip_object; - Evas_Object *prev_bg_object; + EINA_DEPRECATED Evas_Object *prev_bg_object; int desk_x_count, desk_y_count; int desk_x_current, desk_y_current; -- 2.7.4