this commit completely breaks compile with 1.7 branch. On Wed, Dec 5, 2012 at 6:51 AM, Enlightenment SVN < [email protected]> wrote:
> Log: > From: Gwanglim Lee <[email protected]> > Subject: Re: Re: Re: [E-devel] [RFC] Virtual desktop window profile > > I've attached 4th patch. May the 4th be with you. > > ecore patch has been merged with efl and all files are based on r80123. > > Thanks & Regards, > Gwanglim > > ------- Original Message ------- > Sender : Daniel Juyung Seo<[email protected]> > Date : 2012-12-04 01:55 (GMT+09:00) > Title : Re: Re: [E-devel] [RFC] Virtual desktop window profile > > It looks ok to me. > Sorry but can you re-generate the patch according to the recent ecore > merge to efl single tree? > > Daniel Juyung Seo (SeoZ) > > > On Thu, Nov 29, 2012 at 12:29 AM, Gwanglim Lee <[email protected]> > wrote: > > Dear Raster and Daniel Juyung Seo, > > I've attached 3rd patches and test_config according to your reviews. > These are based on r79782. > > [elementary & ecore] > 1. "profile,set" -> "profile,changed" - done > 2. spaces after EINA_LIST_FOREACH - done > 3. variable type - keep > 4. author - done > 5. removing deprecated marking in patch - done > 6. add elm_win_available_profiles_get to test_config for the debugging > purpose - done > > 7. check whether a given profile is present in an available profiles. > otherwise window profile will be one of the item > in available profiles. - newly added thing to the elm_win > 8. merge with EO - done. :( > > > Any comments would be appreciated. > > > > Author: raster > Date: 2012-12-04 22:51:16 -0800 (Tue, 04 Dec 2012) > New Revision: 80216 > Trac: http://trac.enlightenment.org/e/changeset/80216 > > Modified: > trunk/e/config/default/e.src trunk/e/config/mobile/e.src > trunk/e/config/standard/e.src trunk/e/src/bin/e_border.c > trunk/e/src/bin/e_border.h trunk/e/src/bin/e_config.c > trunk/e/src/bin/e_config.h trunk/e/src/bin/e_container.c > trunk/e/src/bin/e_container.h trunk/e/src/bin/e_desk.c > trunk/e/src/bin/e_desk.h trunk/e/src/bin/e_main.c > trunk/e/src/modules/conf_display/e_int_config_desk.c > trunk/e/src/modules/conf_display/e_int_config_desks.c > > Modified: trunk/e/config/default/e.src > =================================================================== > --- trunk/e/config/default/e.src 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/config/default/e.src 2012-12-05 06:51:16 UTC (rev 80216) > @@ -3,6 +3,7 @@ > value "show_splash" int: 0; > value "init_default_theme" string: "default.edj"; > value "desktop_default_name" string: "%i-%i"; > + value "desktop_default_window_profile" string: ""; > value "menus_scroll_speed" double: 1000.0; > value "menus_fast_mouse_move_threshhold" double: 300.0; > value "menus_click_drag_timeout" double: 0.25; > @@ -527,6 +528,7 @@ > value "xkb.only_label" int: 0; > value "xkb.default_model" string: "default"; > value "exe_always_single_instance" uchar: 0; > + value "use_desktop_window_profile" int: 0; > value "powersave.none" double: 0.25; > value "powersave.low" double: 5.0; > value "powersave.medium" double: 60.0; > > Modified: trunk/e/config/mobile/e.src > =================================================================== > --- trunk/e/config/mobile/e.src 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/config/mobile/e.src 2012-12-05 06:51:16 UTC (rev 80216) > @@ -3,6 +3,7 @@ > value "show_splash" int: 1; > value "init_default_theme" string: "default.edj"; > value "desktop_default_name" string: "%i-%i"; > + value "desktop_default_window_profile" string: "mobile"; > value "menus_scroll_speed" double: 1000.0000000000000000000000000; > value "menus_fast_mouse_move_threshhold" double: > 300.0000000000000000000000000; > value "menus_click_drag_timeout" double: 0.2500000000000000000000000; > @@ -1778,4 +1779,5 @@ > value "xkb.only_label" int: 0; > value "xkb.default_model" string: "default"; > value "exe_always_single_instance" uchar: 1; > + value "use_desktop_window_profile" int: 0; > } > > Modified: trunk/e/config/standard/e.src > =================================================================== > --- trunk/e/config/standard/e.src 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/config/standard/e.src 2012-12-05 06:51:16 UTC (rev 80216) > @@ -3,6 +3,7 @@ > value "show_splash" int: 1; > value "init_default_theme" string: "default.edj"; > value "desktop_default_name" string: "%i-%i"; > + value "desktop_default_window_profile" string: "standard"; > value "menus_scroll_speed" double: 1000.0; > value "menus_fast_mouse_move_threshhold" double: 300.0; > value "menus_click_drag_timeout" double: 0.25; > @@ -2021,4 +2022,5 @@ > value "xkb.only_label" int: 0; > value "xkb.default_model" string: "default"; > value "exe_always_single_instance" uchar: 0; > + value "use_desktop_window_profile" int: 0; > } > > Modified: trunk/e/src/bin/e_border.c > =================================================================== > --- trunk/e/src/bin/e_border.c 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_border.c 2012-12-05 06:51:16 UTC (rev 80216) > @@ -127,6 +127,9 @@ > void *event); > static void _e_border_cb_drag_finished(E_Drag *drag, > int dropped); > +static Eina_Bool _e_border_cb_desk_window_profile_change(void *data, > + int ev_type, > + void *ev); > > static void _e_border_eval(E_Border *bd); > static void _e_border_eval0(E_Border *bd); > @@ -339,6 +342,8 @@ > _e_border_cb_config_icon_theme, NULL); > E_LIST_HANDLER_APPEND(handlers, E_EVENT_CONFIG_MODE_CHANGED, > _e_border_cb_config_mode, NULL); > + E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_WINDOW_PROFILE_CHANGE, > + _e_border_cb_desk_window_profile_change, NULL); > > if (!borders_hash) borders_hash = eina_hash_string_superfast_new(NULL); > > @@ -662,6 +667,9 @@ > video_parent = EINA_TRUE; > else if (atoms[i] == ECORE_X_ATOM_E_VIDEO_POSITION) > video_position = EINA_TRUE; > + /* loop to check for window profile list atom */ > + else if (atoms[i] == > ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED) > + bd->client.e.fetch.profile = 1; > } > if (video_position && video_parent) > { > @@ -934,6 +942,18 @@ > E_OBJECT_CHECK(desk); > E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE); > if (bd->desk == desk) return; > + if ((e_config->use_desktop_window_profile) && > + (bd->client.e.state.profile.use)) > + { > + if (bd->client.e.state.profile.wait_for_done) return; > + if (strcmp(bd->client.e.state.profile.name, > desk->window_profile) != 0) > + { > + ecore_x_e_window_profile_change_request_send(bd->client.win, > + > desk->window_profile); > + bd->client.e.state.profile.wait_for_done = 1; > + return; > + } > + } > ecore_x_window_shadow_tree_flush(); > if (bd->fullscreen) > { > @@ -4812,6 +4832,34 @@ > static void > _e_border_free(E_Border *bd) > { > + if (bd->client.e.state.profile.use) > + { > + if (bd->client.e.state.profile.available_list) > + { > + int i; > + for (i = 0; i < bd->client.e.state.profile.num; i++) > + { > + if (bd->client.e.state.profile.available_list[i]) > + { > + > eina_stringshare_del(bd->client.e.state.profile.available_list[i]); > + bd->client.e.state.profile.available_list[i] = > NULL; > + } > + } > + E_FREE(bd->client.e.state.profile.available_list); > + bd->client.e.state.profile.available_list = NULL; > + } > + > + bd->client.e.state.profile.num = 0; > + > + if (bd->client.e.state.profile.name) > + { > + eina_stringshare_del(bd->client.e.state.profile.name); > + bd->client.e.state.profile.name = NULL; > + } > + > + bd->client.e.state.profile.wait_for_done = 0; > + bd->client.e.state.profile.use = 0; > + } > if (bd->client.e.state.video_parent && > bd->client.e.state.video_parent_border) > { > > bd->client.e.state.video_parent_border->client.e.state.video_child = > @@ -5826,6 +5874,16 @@ > bd->client.netwm.fetch.state = 1; > bd->changed = 1; > } > + else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED) > + { > + bd->client.e.fetch.profile = 1; > + bd->changed = 1; > + } > + else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST) > + { > + bd->client.e.fetch.profile = 1; > + bd->changed = 1; > + } > > return ECORE_CALLBACK_PASS_ON; > } > @@ -6053,17 +6111,54 @@ > static Eina_Bool > _e_border_cb_client_message(void *data __UNUSED__, > int ev_type __UNUSED__, > - void *ev __UNUSED__) > + void *ev) > { > - /* > - E_Border *bd; > - Ecore_X_Event_Client_Message *e; > + E_Border *bd; > + Ecore_X_Event_Client_Message *e; > + char *profile = NULL; > > - e = ev; > - bd = e_border_find_by_client_window(e->win); > - if (!bd) return 1; > - */ > - return 1; > + e = (Ecore_X_Event_Client_Message *)ev; > + bd = e_border_find_by_client_window(e->win); > + if (!bd) return ECORE_CALLBACK_PASS_ON; > + > + if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE) > + { > + if (bd->client.e.state.profile.use) > + { > + profile = ecore_x_atom_name_get(e->data.l[1]); > + ecore_x_e_window_profile_change_request_send(bd->client.win, > + profile); > + bd->client.e.state.profile.wait_for_done = 1; > + } > + } > + else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE_DONE) > + { > + if ((bd->client.e.state.profile.use) && > + (bd->client.e.state.profile.wait_for_done)) > + { > + E_Container *con = bd->zone->container; > + E_Desk *desk = NULL; > + > + profile = ecore_x_atom_name_get(e->data.l[1]); > + if (profile) > + { > + if (bd->client.e.state.profile.name) > + eina_stringshare_del(bd->client.e.state.profile.name > ); > + bd->client.e.state.profile.name = > eina_stringshare_add(profile); > + } > + > + bd->client.e.state.profile.wait_for_done = 0; > + > + desk = e_container_desk_window_profile_get(con, profile); > + if ((desk) && (bd->desk != desk)) > + e_border_desk_set(bd, desk); > + } > + } > + > + if (profile) > + free(profile); > + > + return ECORE_CALLBACK_PASS_ON; > } > > static Eina_Bool > @@ -6967,6 +7062,27 @@ > } > > static Eina_Bool > +_e_border_cb_desk_window_profile_change(void *data __UNUSED__, > + int ev_type __UNUSED__, > + void *ev) > +{ > + E_Event_Desk_Window_Profile_Change *e; > + Eina_List *l = NULL; > + E_Border *bd; > + > + e = (E_Event_Desk_Window_Profile_Change *)ev; > + EINA_LIST_FOREACH(borders, l, bd) > + { > + if (!e_object_is_del(E_OBJECT(bd))) > + { > + bd->client.e.fetch.profile = 1; > + bd->changed = 1; > + } > + } > + return ECORE_CALLBACK_PASS_ON; > +} > + > +static Eina_Bool > _e_border_post_move_resize_job(void *data) > { > E_Border *bd; > @@ -7060,6 +7176,7 @@ > { > int change_urgent = 0; > int rem_change = 0; > + Eina_Bool need_desk_set = EINA_FALSE; > > if (e_object_is_del(E_OBJECT(bd))) > { > @@ -7188,6 +7305,69 @@ > bd->client.e.fetch.state = 0; > rem_change = 1; > } > + if (bd->client.e.fetch.profile) > + { > + const char **list = NULL; > + int n, i, res; > + unsigned int use; > + > + if (bd->client.e.state.profile.name) > + { > + eina_stringshare_del(bd->client.e.state.profile.name); > + bd->client.e.state.profile.name = NULL; > + } > + > + if (bd->client.e.state.profile.available_list) > + { > + for (i = 0; i < bd->client.e.state.profile.num; i++) > + { > + if (bd->client.e.state.profile.available_list[i]) > + { > + > eina_stringshare_del(bd->client.e.state.profile.available_list[i]); > + bd->client.e.state.profile.available_list[i] = > NULL; > + } > + } > + E_FREE(bd->client.e.state.profile.available_list); > + bd->client.e.state.profile.available_list = NULL; > + } > + bd->client.e.state.profile.num = 0; > + > + res = ecore_x_window_prop_card32_get(bd->client.win, > + > ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED, > + &use, > + 1); > + if ((res == 1) && (use == 1)) > + { > + Ecore_X_Atom val; > + res = ecore_x_window_prop_atom_get(bd->client.win, > + > ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE, > + &val, 1); > + if (res == 1) > + { > + char *name = ecore_x_atom_name_get(val); > + if (name) > + { > + bd->client.e.state.profile.name = > eina_stringshare_add(name); > + free(name); > + } > + } > + > + if (ecore_x_e_window_available_profiles_get(bd->client.win, > &list, &n)) > + { > + bd->client.e.state.profile.available_list = E_NEW(const > char *, n); > + for (i = 0; i < n; i++) > + bd->client.e.state.profile.available_list[i] = > eina_stringshare_add(list[i]); > + bd->client.e.state.profile.num = n; > + } > + need_desk_set = EINA_TRUE; > + bd->client.e.state.profile.use = 1; > + > + if (list) > + free(list); > + } > + > + bd->client.e.fetch.profile = 0; > + } > if (bd->client.netwm.fetch.type) > { > e_hints_window_type_get(bd); > @@ -7813,6 +7993,55 @@ > bd->client.netwm.update.state = 0; > } > > + if ((e_config->use_desktop_window_profile) && (need_desk_set)) > + { > + if (!(bd->client.e.state.profile.name) && > + (bd->client.e.state.profile.num >= 1)) > + { > + const char *p = NULL; > + int i; > + for (i = 0; i < bd->client.e.state.profile.num; i++) > + { > + if (!bd->client.e.state.profile.available_list[i]) > + continue; > + p = bd->client.e.state.profile.available_list[i]; > + if (strcmp(bd->desk->window_profile, p) == 0) > + { > + bd->client.e.state.profile.name = > eina_stringshare_add(bd->desk->window_profile); > + break; > + } > + } > + > + if (!bd->client.e.state.profile.name) > + { > + E_Container *con = bd->zone->container; > + E_Desk *desk = NULL; > + > + for (i = 0; i < bd->client.e.state.profile.num; i++) > + { > + if (!bd->client.e.state.profile.available_list[i]) > + continue; > + p = bd->client.e.state.profile.available_list[i]; > + desk = e_container_desk_window_profile_get(con, p); > + if ((desk) && (bd->desk != desk)) > + { > + bd->client.e.state.profile.name = > eina_stringshare_add(p); > + break; > + } > + } > + } > + } > + > + if (!bd->client.e.state.profile.name) > + { > + bd->client.e.state.profile.name = > eina_stringshare_add(bd->desk->window_profile); > + } > + > + ecore_x_e_window_profile_change_request_send(bd->client.win, > + bd-> > client.e.state.profile.name); > + bd->client.e.state.profile.wait_for_done = 1; > + } > + > if (bd->new_client) > { > E_Event_Border_Add *ev; > > Modified: trunk/e/src/bin/e_border.h > =================================================================== > --- trunk/e/src/bin/e_border.h 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_border.h 2012-12-05 06:51:16 UTC (rev 80216) > @@ -393,6 +393,14 @@ > Ecore_X_Window video_parent; > E_Border *video_parent_border; > Eina_List *video_child; > + struct > + { > + const char *name; > + const char **available_list; > + int num; > + unsigned char wait_for_done : 1; > + unsigned char use : 1; > + } profile; > > unsigned char centered : 1; > unsigned char video : 1; > @@ -403,6 +411,7 @@ > unsigned char state : 1; > unsigned char video_parent : 1; > unsigned char video_position : 1; > + unsigned char profile : 1; > } fetch; > } e; > > > Modified: trunk/e/src/bin/e_config.c > =================================================================== > --- trunk/e/src/bin/e_config.c 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_config.c 2012-12-05 06:51:16 UTC (rev 80216) > @@ -41,6 +41,7 @@ > static E_Config_DD *_e_config_desktop_bg_edd = NULL; > static E_Config_DD *_e_config_desklock_bg_edd = NULL; > static E_Config_DD *_e_config_desktop_name_edd = NULL; > +static E_Config_DD *_e_config_desktop_window_profile_edd = NULL; > static E_Config_DD *_e_config_remember_edd = NULL; > static E_Config_DD *_e_config_color_class_edd = NULL; > static E_Config_DD *_e_config_gadcon_edd = NULL; > @@ -274,6 +275,17 @@ > E_CONFIG_VAL(D, T, desk_y, INT); > E_CONFIG_VAL(D, T, name, STR); > > + _e_config_desktop_window_profile_edd = > E_CONFIG_DD_NEW("E_Config_Desktop_Window_Profile", > E_Config_Desktop_Window_Profile); > +#undef T > +#undef D > +#define T E_Config_Desktop_Window_Profile > +#define D _e_config_desktop_window_profile_edd > + E_CONFIG_VAL(D, T, container, INT); > + E_CONFIG_VAL(D, T, zone, INT); > + E_CONFIG_VAL(D, T, desk_x, INT); > + E_CONFIG_VAL(D, T, desk_y, INT); > + E_CONFIG_VAL(D, T, profile, STR); > + > _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir); > #undef T > #undef D > @@ -638,8 +650,10 @@ > E_CONFIG_VAL(D, T, init_default_theme, STR); /**/ > E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/ > E_CONFIG_VAL(D, T, desktop_default_name, STR); /**/ > + E_CONFIG_VAL(D, T, desktop_default_window_profile, STR); /**/ > E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd); > /**/ > E_CONFIG_LIST(D, T, desktop_names, _e_config_desktop_name_edd); /**/ > + E_CONFIG_LIST(D, T, desktop_window_profiles, > _e_config_desktop_window_profile_edd); > E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/ > E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/ > E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/ > @@ -945,6 +959,8 @@ > //E_CONFIG_VAL(D, T, xkb.cur_group, INT); > > E_CONFIG_VAL(D, T, exe_always_single_instance, UCHAR); > + > + E_CONFIG_VAL(D, T, use_desktop_window_profile, INT); > e_config_load(); > > e_config_save_queue(); > @@ -970,6 +986,7 @@ > E_CONFIG_DD_FREE(_e_config_desktop_bg_edd); > E_CONFIG_DD_FREE(_e_config_desklock_bg_edd); > E_CONFIG_DD_FREE(_e_config_desktop_name_edd); > + E_CONFIG_DD_FREE(_e_config_desktop_window_profile_edd); > E_CONFIG_DD_FREE(_e_config_remember_edd); > E_CONFIG_DD_FREE(_e_config_gadcon_edd); > E_CONFIG_DD_FREE(_e_config_gadcon_client_edd); > @@ -1259,6 +1276,11 @@ > e_config->window_activehint_policy = 2; > IFCFGEND; > > + IFCFG(0x0162); > + COPYSTR(desktop_default_window_profile); > + COPYVAL(use_desktop_window_profile); > + IFCFGEND; > + > e_config->config_version = E_CONFIG_FILE_VERSION; > _e_config_free(tcfg); > } > @@ -2005,9 +2027,16 @@ > E_Config_Env_Var *evr; > E_Config_XKB_Layout *cl; > E_Config_XKB_Option *op; > + E_Config_Desktop_Window_Profile *wp; > > if (!ecf) return; > > + EINA_LIST_FREE(ecf->desktop_window_profiles, wp) > + { > + eina_stringshare_del(wp->profile); > + E_FREE(wp); > + } > + > eina_stringshare_del(ecf->xkb.default_model); > > EINA_LIST_FREE(ecf->xkb.used_layouts, cl) > @@ -2148,6 +2177,7 @@ > if (ecf->init_default_theme) > eina_stringshare_del(ecf->init_default_theme); > if (ecf->desktop_default_background) > eina_stringshare_del(ecf->desktop_default_background); > if (ecf->desktop_default_name) > eina_stringshare_del(ecf->desktop_default_name); > + if (ecf->desktop_default_window_profile) > eina_stringshare_del(ecf->desktop_default_window_profile); > if (ecf->language) eina_stringshare_del(ecf->language); > eina_stringshare_del(ecf->desklock_language); > eina_stringshare_del(ecf->xkb.selected_layout); > > Modified: trunk/e/src/bin/e_config.h > =================================================================== > --- trunk/e/src/bin/e_config.h 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_config.h 2012-12-05 06:51:16 UTC (rev 80216) > @@ -14,6 +14,7 @@ > typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background; > typedef struct _E_Config_Desklock_Background E_Config_Desklock_Background; > typedef struct _E_Config_Desktop_Name E_Config_Desktop_Name; > +typedef struct _E_Config_Desktop_Window_Profile > E_Config_Desktop_Window_Profile; > typedef struct _E_Config_Gadcon E_Config_Gadcon; > typedef struct _E_Config_Gadcon_Client E_Config_Gadcon_Client; > typedef struct _E_Config_Shelf E_Config_Shelf; > @@ -37,7 +38,7 @@ > /* increment this whenever a new set of config values are added but the > users > * config doesn't need to be wiped - simply new values need to be put in > */ > -#define E_CONFIG_FILE_GENERATION 0x0161 > +#define E_CONFIG_FILE_GENERATION 0x0162 > #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | > E_CONFIG_FILE_GENERATION) > > struct _E_Config > @@ -48,7 +49,9 @@ > const char *desktop_default_background; // GUI > Eina_List *desktop_backgrounds; // GUI > const char *desktop_default_name; > + const char *desktop_default_window_profile; > Eina_List *desktop_names; // GUI > + Eina_List *desktop_window_profiles; // GUI > double menus_scroll_speed; // GUI > double menus_fast_mouse_move_threshhold; // GUI > double menus_click_drag_timeout; // GUI > @@ -398,6 +401,7 @@ > } xkb; > > unsigned char exe_always_single_instance; > + int use_desktop_window_profile; // GUI > }; > > struct _E_Config_Desklock_Background > @@ -512,6 +516,15 @@ > const char *name; > }; > > +struct _E_Config_Desktop_Window_Profile > +{ > + int container; > + int zone; > + int desk_x; > + int desk_y; > + const char *profile; > +}; > + > struct _E_Config_Gadcon > { > const char *name; > > Modified: trunk/e/src/bin/e_container.c > =================================================================== > --- trunk/e/src/bin/e_container.c 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_container.c 2012-12-05 06:51:16 UTC (rev 80216) > @@ -360,6 +360,36 @@ > return NULL; > } > > +EAPI E_Desk * > +e_container_desk_window_profile_get(E_Container *con, > + const char *profile) > +{ > + Eina_List *l = NULL; > + E_Zone *zone = NULL; > + int x, y; > + > + E_OBJECT_CHECK_RETURN(con, NULL); > + E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL); > + > + EINA_LIST_FOREACH(con->zones, l, zone) > + { > + for (x = 0; x < zone->desk_x_count; x++) > + { > + for (y = 0; y < zone->desk_y_count; y++) > + { > + E_Desk *desk = e_desk_at_xy_get(zone, x, y); > + if ((desk->window_profile) && > + strcmp(desk->window_profile, profile) == 0) > + { > + return desk; > + } > + } > + } > + } > + > + return NULL; > +} > + > EAPI E_Container_Shape * > e_container_shape_add(E_Container *con) > { > > Modified: trunk/e/src/bin/e_container.h > =================================================================== > --- trunk/e/src/bin/e_container.h 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_container.h 2012-12-05 06:51:16 UTC (rev 80216) > @@ -125,6 +125,8 @@ > EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num); > EAPI E_Zone *e_container_zone_id_get(E_Container *con, int id); > > +EAPI E_Desk *e_container_desk_window_profile_get(E_Container > *con, const char *profile); > + > EAPI E_Container_Shape *e_container_shape_add(E_Container *con); > EAPI void e_container_shape_show(E_Container_Shape *es); > EAPI void e_container_shape_hide(E_Container_Shape *es); > > Modified: trunk/e/src/bin/e_desk.c > =================================================================== > --- trunk/e/src/bin/e_desk.c 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_desk.c 2012-12-05 06:51:16 UTC (rev 80216) > @@ -11,18 +11,21 @@ > static void _e_desk_event_desk_after_show_free(void *data, void *ev); > static void _e_desk_event_desk_deskshow_free(void *data, void *ev); > static void _e_desk_event_desk_name_change_free(void *data, void > *ev); > +static void _e_desk_event_desk_window_profile_change_free(void > *data, void *ev); > static void _e_desk_show_begin(E_Desk *desk, int mode, int x, int > dy); > static void _e_desk_show_end(E_Desk *desk); > static Eina_Bool _e_desk_show_animator(void *data); > static void _e_desk_hide_begin(E_Desk *desk, int mode, int dx, int > dy); > static void _e_desk_hide_end(E_Desk *desk); > static Eina_Bool _e_desk_hide_animator(void *data); > +static void _e_desk_window_profile_change_protocol_set(void); > > EAPI int E_EVENT_DESK_SHOW = 0; > EAPI int E_EVENT_DESK_BEFORE_SHOW = 0; > EAPI int E_EVENT_DESK_AFTER_SHOW = 0; > EAPI int E_EVENT_DESK_DESKSHOW = 0; > EAPI int E_EVENT_DESK_NAME_CHANGE = 0; > +EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE = 0; > > EINTERN int > e_desk_init(void) > @@ -32,6 +35,7 @@ > E_EVENT_DESK_AFTER_SHOW = ecore_event_type_new(); > E_EVENT_DESK_DESKSHOW = ecore_event_type_new(); > E_EVENT_DESK_NAME_CHANGE = ecore_event_type_new(); > + E_EVENT_DESK_WINDOW_PROFILE_CHANGE = ecore_event_type_new(); > return 1; > } > > @@ -47,6 +51,7 @@ > E_Desk *desk; > Eina_List *l; > E_Config_Desktop_Name *cfname; > + E_Config_Desktop_Window_Profile *cfprof; > char name[40]; > int ok = 0; > > @@ -80,6 +85,27 @@ > desk->name = eina_stringshare_add(name); > } > > + /* Get window profile name for current desktop */ > + ok = 0; > + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) > + { > + if ((cfprof->container >= 0) && > + ((int)zone->container->num != cfprof->container)) continue; > + if ((cfprof->zone >= 0) && > + ((int)zone->num != cfprof->zone)) continue; > + if ((cfprof->desk_x != desk->x) || (cfprof->desk_y != desk->y)) > + continue; > + desk->window_profile = eina_stringshare_add(cfprof->profile); > + ok = 1; > + break; > + } > + > + if (!ok) > + { > + desk->window_profile = eina_stringshare_add > + (e_config->desktop_default_window_profile); > + } > + > return desk; > } > > @@ -515,6 +541,124 @@ > e_desk_show(e_desk_at_xy_get(zone, x, y)); > } > > +EAPI void > +e_desk_window_profile_set(E_Desk *desk, > + const char *profile) > +{ > + E_Event_Desk_Window_Profile_Change *ev; > + > + E_OBJECT_CHECK(desk); > + E_OBJECT_TYPE_CHECK(desk, E_DESK_TYPE); > + > + eina_stringshare_replace(&desk->window_profile, profile); > + > + ev = E_NEW(E_Event_Desk_Window_Profile_Change, 1); > + ev->desk = desk; > + e_object_ref(E_OBJECT(desk)); > + ecore_event_add(E_EVENT_DESK_WINDOW_PROFILE_CHANGE, ev, > + _e_desk_event_desk_window_profile_change_free, NULL); > +} > + > +EAPI void > +e_desk_window_profile_add(int container, > + int zone, > + int desk_x, > + int desk_y, > + const char *profile) > +{ > + E_Config_Desktop_Window_Profile *cfprof; > + > + e_desk_window_profile_del(container, zone, desk_x, desk_y); > + > + cfprof = E_NEW(E_Config_Desktop_Window_Profile, 1); > + cfprof->container = container; > + cfprof->zone = zone; > + cfprof->desk_x = desk_x; > + cfprof->desk_y = desk_y; > + if (profile) cfprof->profile = eina_stringshare_add(profile); > + else cfprof->profile = NULL; > + e_config->desktop_window_profiles = > eina_list_append(e_config->desktop_window_profiles, cfprof); > +} > + > +EAPI void > +e_desk_window_profile_del(int container, > + int zone, > + int desk_x, > + int desk_y) > +{ > + Eina_List *l = NULL; > + E_Config_Desktop_Window_Profile *cfprof = NULL; > + > + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) > + { > + if (!((cfprof->container == container) && > + (cfprof->zone == zone) && > + (cfprof->desk_x == desk_x) && > + (cfprof->desk_y == desk_y))) > + continue; > + > + e_config->desktop_window_profiles = > + eina_list_remove_list(e_config->desktop_window_profiles, l); > + if (cfprof->profile) eina_stringshare_del(cfprof->profile); > + E_FREE(cfprof); > + break; > + } > +} > + > +EAPI void > +e_desk_window_profile_update(void) > +{ > + Eina_List *m, *c, *z, *l; > + E_Manager *man; > + E_Container *con; > + E_Zone *zone; > + E_Desk *desk; > + E_Config_Desktop_Window_Profile *cfprof; > + int d_x, d_y, ok; > + > + _e_desk_window_profile_change_protocol_set(); > + > + if (!(e_config->use_desktop_window_profile)) > + return; > + > + EINA_LIST_FOREACH(e_manager_list(), m, man) > + { > + EINA_LIST_FOREACH(man->containers, c, con) > + { > + EINA_LIST_FOREACH(con->zones, z, zone) > + { > + for (d_x = 0; d_x < zone->desk_x_count; d_x++) > + { > + for (d_y = 0; d_y < zone->desk_y_count; d_y++) > + { > + desk = zone->desks[d_x + zone->desk_x_count * > d_y]; > + ok = 0; > + > + > EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) > + { > + if ((cfprof->container >= 0) && > + ((int)con->num != > cfprof->container)) continue; > + if ((cfprof->zone >= 0) && > + ((int)zone->num != cfprof->zone)) > continue; > + if ((cfprof->desk_x != d_x) || > + (cfprof->desk_y != d_y)) continue; > + e_desk_window_profile_set(desk, > cfprof->profile); > + ok = 1; > + break; > + } > + > + if (!ok) > + { > + e_desk_window_profile_set > + (desk, > e_config->desktop_default_window_profile); > + } > + } > + } > + } > + } > + } > +} > + > static void > _e_desk_free(E_Desk *desk) > { > @@ -576,6 +720,15 @@ > } > > static void > +_e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void > *event) > +{ > + E_Event_Desk_Window_Profile_Change *ev; > + ev = event; > + e_object_unref(E_OBJECT(ev->desk)); > + E_FREE(ev); > +} > + > +static void > _e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy) > { > E_Border_List *bl; > @@ -903,3 +1056,16 @@ > > return ECORE_CALLBACK_RENEW; > } > + > +static void > +_e_desk_window_profile_change_protocol_set(void) > +{ > + Eina_List *l = NULL; > + E_Manager *man; > + > + EINA_LIST_FOREACH(e_manager_list(), l, man) > + { > + ecore_x_e_window_profile_supported_set > + (man->root, e_config->use_desktop_window_profile); > + } > +} > > Modified: trunk/e/src/bin/e_desk.h > =================================================================== > --- trunk/e/src/bin/e_desk.h 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_desk.h 2012-12-05 06:51:16 UTC (rev 80216) > @@ -5,6 +5,7 @@ > typedef struct _E_Event_Desk_Before_Show E_Event_Desk_Before_Show; > typedef struct _E_Event_Desk_After_Show E_Event_Desk_After_Show; > typedef struct _E_Event_Desk_Name_Change E_Event_Desk_Name_Change; > +typedef struct _E_Event_Desk_Window_Profile_Change > E_Event_Desk_Window_Profile_Change; > > #else > #ifndef E_DESK_H > @@ -18,6 +19,7 @@ > > E_Zone *zone; > const char *name; > + const char *window_profile; > int x, y; > unsigned char visible : 1; > unsigned int deskshow_toggle : 1; > @@ -49,6 +51,11 @@ > E_Desk *desk; > }; > > +struct _E_Event_Desk_Window_Profile_Change > +{ > + E_Desk *desk; > +}; > + > EINTERN int e_desk_init(void); > EINTERN int e_desk_shutdown(void); > EAPI E_Desk *e_desk_new(E_Zone *zone, int x, int y); > @@ -69,12 +76,17 @@ > EAPI void e_desk_row_remove(E_Zone *zone); > EAPI void e_desk_col_add(E_Zone *zone); > EAPI void e_desk_col_remove(E_Zone *zone); > +EAPI void e_desk_window_profile_set(E_Desk *desk, const char > *profile); > +EAPI void e_desk_window_profile_add(int container, int zone, int > desk_x, int desk_y, const char *profile); > +EAPI void e_desk_window_profile_del(int container, int zone, int > desk_x, int desk_y); > +EAPI void e_desk_window_profile_update(void); > > extern EAPI int E_EVENT_DESK_SHOW; > extern EAPI int E_EVENT_DESK_BEFORE_SHOW; > extern EAPI int E_EVENT_DESK_AFTER_SHOW; > extern EAPI int E_EVENT_DESK_DESKSHOW; > extern EAPI int E_EVENT_DESK_NAME_CHANGE; > +extern EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE; > > #endif > #endif > > Modified: trunk/e/src/bin/e_main.c > =================================================================== > --- trunk/e/src/bin/e_main.c 2012-12-05 06:50:27 UTC (rev 80215) > +++ trunk/e/src/bin/e_main.c 2012-12-05 06:51:16 UTC (rev 80216) > @@ -1680,6 +1680,8 @@ > free(roots); > return 0; > } > + ecore_x_e_window_profile_supported_set(roots[i], > + > e_config->use_desktop_window_profile); > } > free(roots); > > > Modified: trunk/e/src/modules/conf_display/e_int_config_desk.c > =================================================================== > --- trunk/e/src/modules/conf_display/e_int_config_desk.c 2012-12-05 > 06:50:27 UTC (rev 80215) > +++ trunk/e/src/modules/conf_display/e_int_config_desk.c 2012-12-05 > 06:51:16 UTC (rev 80216) > @@ -15,6 +15,7 @@ > int desk_y; > char *bg; > char *name; > + char *profile; > > Evas_Object *preview; > Ecore_Event_Handler *hdl; > @@ -61,6 +62,7 @@ > const char *bg; > char name[40]; > int ok = 0; > + E_Config_Desktop_Window_Profile *prof; > > bg = e_bg_file_get(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, > cfdata->desk_y); > if (!bg) > @@ -88,6 +90,24 @@ > snprintf(name, sizeof(name), _(e_config->desktop_default_name), > cfdata->desk_x, cfdata->desk_y); > cfdata->name = strdup(name); > } > + > + ok = 0; > + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, prof) > + { > + if (!((prof->container == cfdata->con_num) && > + (prof->zone == cfdata->zone_num) && > + (prof->desk_x == cfdata->desk_x) && > + (prof->desk_y == cfdata->desk_y))) > + continue; > + > + if (prof->profile) > + cfdata->profile = strdup(prof->profile); > + ok = 1; > + break; > + } > + > + if (!ok) > + cfdata->profile = strdup(e_config->desktop_default_window_profile); > } > > static void * > @@ -110,6 +130,8 @@ > E_FREE(cfdata->bg); > if (cfdata->name) > E_FREE(cfdata->name); > + if (cfdata->profile) > + E_FREE(cfdata->profile); > E_FREE(cfdata); > } > > @@ -125,11 +147,20 @@ > cfdata->name = strdup(name); > } > > + if (!cfdata->profile[0]) > + cfdata->profile = strdup(e_config->desktop_default_window_profile); > + > e_desk_name_del(cfdata->con_num, cfdata->zone_num, > cfdata->desk_x, cfdata->desk_y); > e_desk_name_add(cfdata->con_num, cfdata->zone_num, > cfdata->desk_x, cfdata->desk_y, cfdata->name); > e_desk_name_update(); > + > + e_desk_window_profile_del(cfdata->con_num, cfdata->zone_num, > + cfdata->desk_x, cfdata->desk_y); > + e_desk_window_profile_add(cfdata->con_num, cfdata->zone_num, > + cfdata->desk_x, cfdata->desk_y, > cfdata->profile); > + e_desk_window_profile_update(); > > e_bg_del(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, > cfdata->desk_y); > e_bg_add(cfdata->con_num, cfdata->zone_num, > @@ -156,6 +187,14 @@ > ob = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL); > e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0); > e_widget_list_object_append(o, of, 1, 1, 0.5); > + > + of = e_widget_frametable_add(evas, _("Desktop Window Profile"), 0); > + ob = e_widget_label_add(evas, _("Profile Name:")); > + e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0); > + ob = e_widget_entry_add(evas, &(cfdata->profile), NULL, NULL, NULL); > + e_widget_entry_readonly_set(ob, > !(e_config->use_desktop_window_profile)); > + e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0); > + e_widget_list_object_append(o, of, 1, 1, 0.5); > > of = e_widget_frametable_add(evas, _("Desktop Wallpaper"), 0); > ob = e_widget_preview_add(evas, 240, (240 * zone->h) / zone->w); > > Modified: trunk/e/src/modules/conf_display/e_int_config_desks.c > =================================================================== > --- trunk/e/src/modules/conf_display/e_int_config_desks.c 2012-12-05 > 06:50:27 UTC (rev 80215) > +++ trunk/e/src/modules/conf_display/e_int_config_desks.c 2012-12-05 > 06:51:16 UTC (rev 80216) > @@ -17,6 +17,7 @@ > int y; > int edge_flip_dragging; > int flip_wrap; > + int use_desktop_window_profile; > int flip_mode; > int flip_interp; > double flip_speed; > @@ -60,6 +61,7 @@ > cfdata->y = e_config->zone_desks_y_count; > cfdata->edge_flip_dragging = e_config->edge_flip_dragging; > cfdata->flip_wrap = e_config->desk_flip_wrap; > + cfdata->use_desktop_window_profile = > e_config->use_desktop_window_profile; > cfdata->flip_mode = e_config->desk_flip_animate_mode; > cfdata->flip_interp = e_config->desk_flip_animate_interpolation; > cfdata->flip_speed = e_config->desk_flip_animate_time; > @@ -105,6 +107,12 @@ > e_config->edge_flip_dragging = cfdata->edge_flip_dragging; > e_config->desk_flip_wrap = cfdata->flip_wrap; > > + if (e_config->use_desktop_window_profile != > cfdata->use_desktop_window_profile) > + { > + e_config->use_desktop_window_profile = > cfdata->use_desktop_window_profile; > + e_desk_window_profile_update(); > + } > + > e_config_save_queue(); > return 1; /* Apply was OK */ > } > @@ -132,7 +140,8 @@ > (e_config->desk_flip_animate_interpolation != > cfdata->flip_interp) || > (e_config->desk_flip_animate_time != cfdata->flip_speed) || > (e_config->edge_flip_dragging != cfdata->edge_flip_dragging) || > - (e_config->desk_flip_wrap != cfdata->flip_wrap)); > + (e_config->desk_flip_wrap != cfdata->flip_wrap) || > + (e_config->use_desktop_window_profile != > cfdata->use_desktop_window_profile)); > } > > /**--GUI--**/ > @@ -178,6 +187,14 @@ > e_widget_framelist_object_append(of, ob); > > e_widget_list_object_append(o, of, 1, 0, 0.5); > + > + of = e_widget_framelist_add(evas, _("Desktop Window Profile"), 0); > + > + ob = e_widget_check_add(evas, _("Use desktop window profile"), > + &(cfdata->use_desktop_window_profile)); > + e_widget_framelist_object_append(of, ob); > + > + e_widget_list_object_append(o, of, 1, 0, 0.5); > > e_widget_toolbook_page_append(otb, NULL, _("Desktops"), o, 1, 1, 1, 1, > 0.5, 0.0); > > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > enlightenment-svn mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn > ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
