diff --git a/TODO b/TODO index eb994e5a2..1870a13f4 100644 --- a/TODO +++ b/TODO @@ -10,7 +10,9 @@ Some of the things (in very short form) that need to be done to E17... * BUG: when fullscreen should put up big black window above all windows EXCEPT the fullscreen one (no need to hide other windows). in general fullscreen - needs work, cleaning and testing + needs work, cleaning and testing. dont allow desktop switches for the desk + a fullscreened window is on, nor allow windows to be raised above the fs win + etc. ie the app must seem to be entirely fs for that zone. * BUG: on font apply borders need to be adjusted for size changes * BUG: font apply doesnt seem to keep working (edje problem?) unless you restart @@ -74,10 +76,11 @@ Some of the things (in very short form) that need to be done to E17... to properly choose the border based on client window properties. * do something with the icccm urgency field hint * different borders for non-resizable windows, shaped windows etc. -* break out ipc to set names for desktops and zones +* break out ipc to set names for desktops (and get names/list them) +* some sort of gui display of a desktop name (in the pager?) * window icons should be able to be chosen if e eapp icon overrides netwm icon or the other way around. -* eapps need to provide title matching too as well as name and class +* eaps need to provide title matching too as well as name and class * add locale and encoding fields to eapp files (to launch eapp in that locale+encoding) * add input method selector stuff to eapp - same as locale @@ -101,7 +104,7 @@ Some of the things (in very short form) that need to be done to E17... * add key input focus control for desktop modules * finish off icccm support * finish complete netwm support -* make the cursors an edje buffer canvas for changinig cursor depending on +* make the cursors an edje buffer canvas for changing cursor depending on context * different cursors for different parts of the screen * add a "taskbar" module @@ -113,13 +116,10 @@ Some of the things (in very short form) that need to be done to E17... new bars to be created or bars to be deleted * ibar need to support label pop-ups * ibar should support subdirs with pop-up icons... -* ibar needs lamp follower to be optional in ibar config (for the user) * borders need to be able to change border theme on the fly by menu or app properties * add window glueing -* add setup/install wizard to seed eapp files etc. etc. -* make ipc try open on other ports numbers if current is taken -* make ipc try re-open if connection dies +* add setup/install wizard to seed eap files etc. etc. * support text and color classes * add clientinfo pane/popdown for borders * add sliders, radio and check buttons for clientinfo pane @@ -143,7 +143,6 @@ Some of the things (in very short form) that need to be done to E17... radio etc. not massive menus) * remove module config menus (make them part of the module control panel and as separate executables) -* actuallly break out ipc and config to set bg per desktop (per zone) ]]] [[[ diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c index a14a9132a..c849a59ed 100644 --- a/src/bin/e_bg.c +++ b/src/bin/e_bg.c @@ -13,6 +13,8 @@ void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition) { Evas_Object *o; + Evas_List *l; + int ok; if (transition == E_BG_TRANSITION_START) { @@ -65,14 +67,32 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition) evas_object_data_set(o, "e_zone", zone); evas_object_move(o, zone->x, zone->y); evas_object_resize(o, zone->w, zone->h); - - /* FIXME: check config and look for a special bg for the current desk */ - if (!edje_object_file_set(o, - e_config->desktop_default_background, - "desktop/background")) + + ok = 0; + for (l = e_config->desktop_backgrounds; l; l = l->next) { - e_theme_edje_object_set(o, "base/theme/background", - "desktop/background"); + E_Config_Desktop_Background *cfbg; + E_Desk *desk; + + cfbg = l->data; + if ((cfbg->container >= 0) && + (zone->container->num != cfbg->container)) continue; + if ((cfbg->zone >= 0) && + (zone->num != cfbg->zone)) continue; + if ((!cfbg->desk) || (strlen(cfbg->desk) == 0)) continue; + desk = e_desk_current_get(zone); + if (!desk) continue; + if (strcmp(cfbg->desk, desk->name)) continue; + ok = edje_object_file_set(o, cfbg->file, + "desktop/background"); + break; + } + if (!ok) + { + if (!edje_object_file_set(o, e_config->desktop_default_background, + "desktop/background")) + e_theme_edje_object_set(o, "base/theme/background", + "desktop/background"); } evas_object_layer_set(o, -1); evas_object_lower(o); @@ -103,6 +123,62 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition) } } +void +e_bg_add(int container, int zone, char *desk, char *file) +{ + E_Config_Desktop_Background *cfbg; + + e_bg_del(container, zone, desk); + cfbg = E_NEW(E_Config_Desktop_Background, 1); + cfbg->container = container; + cfbg->zone = zone; + cfbg->desk = strdup(desk); + cfbg->file = strdup(file); + e_config->desktop_backgrounds = evas_list_append(e_config->desktop_backgrounds, cfbg); +} + +void +e_bg_del(int container, int zone, char *desk) +{ + Evas_List *l; + + for (l = e_config->desktop_backgrounds; l; l = l->next) + { + E_Config_Desktop_Background *cfbg; + + cfbg = l->data; + if ((cfbg->container == container) && (cfbg->zone == zone) && + (!strcmp(cfbg->desk, desk))) + { + e_config->desktop_backgrounds = evas_list_remove_list(e_config->desktop_backgrounds, l); + IF_FREE(cfbg->desk); + IF_FREE(cfbg->file); + free(cfbg); + break; + } + } +} + +void +e_bg_update(void) +{ + Evas_List *l, *ll; + E_Manager *man; + E_Container *con; + E_Zone *zone; + + for (l = e_manager_list(); l; l = l->next) + { + man = l->data; + for (ll = man->containers; ll; ll = ll->next) + { + con = ll->data; + zone = e_zone_current_get(con); + e_zone_bg_reconfigure(zone); + } + } +} + /* local subsystem functions */ static int diff --git a/src/bin/e_bg.h b/src/bin/e_bg.h index 1ab0f93e3..0db7c0cf2 100644 --- a/src/bin/e_bg.h +++ b/src/bin/e_bg.h @@ -21,7 +21,10 @@ typedef enum { #ifndef E_BG_H #define E_BG_H -void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition); +EAPI void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition); +EAPI void e_bg_add(int container, int zone, char *desk, char *file); +EAPI void e_bg_del(int container, int zone, char *desk); +EAPI void e_bg_update(void); #endif #endif diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 99eadc75a..5bc49a6e5 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -32,11 +32,22 @@ static E_Config_DD *_e_config_theme_edd = NULL; static E_Config_DD *_e_config_bindings_mouse_edd = NULL; static E_Config_DD *_e_config_bindings_key_edd = NULL; static E_Config_DD *_e_config_path_append_edd = NULL; +static E_Config_DD *_e_config_desktop_bg_edd = NULL; /* externally accessible functions */ int e_config_init(void) { + _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background); +#undef T +#undef D +#define T E_Config_Desktop_Background +#define D _e_config_desktop_bg_edd + E_CONFIG_VAL(D, T, container, INT); + E_CONFIG_VAL(D, T, zone, INT); + E_CONFIG_VAL(D, T, desk, STR); + E_CONFIG_VAL(D, T, file, STR); + _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir); #undef T #undef D @@ -111,6 +122,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, config_version, INT); /**/ E_CONFIG_VAL(D, T, show_splash, INT); /**/ E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/ + E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_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); /**/ @@ -836,6 +848,11 @@ e_config_shutdown(void) E_CONFIG_DD_FREE(_e_config_module_edd); E_CONFIG_DD_FREE(_e_config_font_default_edd); E_CONFIG_DD_FREE(_e_config_font_fallback_edd); + E_CONFIG_DD_FREE(_e_config_theme_edd); + E_CONFIG_DD_FREE(_e_config_bindings_mouse_edd); + E_CONFIG_DD_FREE(_e_config_bindings_key_edd); + E_CONFIG_DD_FREE(_e_config_path_append_edd); + E_CONFIG_DD_FREE(_e_config_desktop_bg_edd); return 1; } diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 7c7feaeb5..18e75aad1 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -31,12 +31,13 @@ #define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v = min;} -typedef struct _E_Config E_Config; -typedef struct _E_Config_Module E_Config_Module; -typedef struct _E_Config_Theme E_Config_Theme; -typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; -typedef struct _E_Config_Binding_Key E_Config_Binding_Key; -typedef Eet_Data_Descriptor E_Config_DD; +typedef struct _E_Config E_Config; +typedef struct _E_Config_Module E_Config_Module; +typedef struct _E_Config_Theme E_Config_Theme; +typedef struct _E_Config_Binding_Mouse E_Config_Binding_Mouse; +typedef struct _E_Config_Binding_Key E_Config_Binding_Key; +typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background; +typedef Eet_Data_Descriptor E_Config_DD; #else #ifndef E_CONFIG_H @@ -57,6 +58,7 @@ struct _E_Config int config_version; int show_splash; char *desktop_default_background; + Evas_List *desktop_backgrounds; double menus_scroll_speed; double menus_fast_mouse_move_threshhold; double menus_click_drag_timeout; @@ -169,6 +171,14 @@ struct _E_Config_Binding_Key unsigned char any_mod; }; +struct _E_Config_Desktop_Background +{ + int container; + int zone; + char *desk; + char *file; +}; + EAPI int e_config_init(void); EAPI int e_config_shutdown(void); diff --git a/src/bin/e_container.h b/src/bin/e_container.h index ae4a84a03..e6c3ec646 100644 --- a/src/bin/e_container.h +++ b/src/bin/e_container.h @@ -50,8 +50,8 @@ struct _E_Container Evas_List *zones; struct { - Ecore_X_Window win; - Evas_List *clients; + Ecore_X_Window win; + Evas_List *clients; } layers[7]; }; diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index 8d3f443ab..7be1f27d1 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -709,20 +709,9 @@ break; REQ_STRING(params[0], HDL); #elif (TYPE == E_WM_IN) STRING(s, HDL); - Evas_List *l, *ll; - E_Manager *man; - E_Container *con; - E_Zone *zone; E_FREE(e_config->desktop_default_background); e_config->desktop_default_background = strdup(s); - for (l = e_manager_list(); l; l = l->next) { - man = l->data; - for (ll = man->containers; ll; ll = ll->next) { - con = ll->data; - zone = e_zone_current_get(con); - e_zone_bg_reconfigure(zone); - } - } + e_bg_update(); SAVE; END_STRING(s); #elif (TYPE == E_REMOTE_IN) @@ -2852,6 +2841,72 @@ break; #endif #undef HDL +/****************************************************************************/ +#define HDL E_IPC_OP_DESKTOP_BG_ADD +#if (TYPE == E_REMOTE_OPTIONS) + OP("-desktop-bg-add", 4, "Add a desktop bg definition. OPT1 = container no. OPT2 = zone no. OPT3 = desktop name OPT4 = bg file path", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_3INT_3STRING_START(HDL); + REQ_3INT_3STRING_END(atoi(params[0]), atoi(params[1]), 0, params[2], params[3], "", HDL); +#elif (TYPE == E_WM_IN) + INT3_STRING3(v, HDL); + e_bg_add(v->val1, v->val2, v->str1, v->str2); + e_bg_update(); + SAVE; + END_INT3_STRING3(v); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_DESKTOP_BG_DEL +#if (TYPE == E_REMOTE_OPTIONS) + OP("-desktop-bg-del", 3, "Delete a desktop bg definition. OPT1 = container no. OPT2 = zone no. OPT3 = desktop name", 0, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_3INT_3STRING_START(HDL); + REQ_3INT_3STRING_END(atoi(params[0]), atoi(params[1]), 0, params[2], "", "", HDL); +#elif (TYPE == E_WM_IN) + INT3_STRING3(v, HDL); + e_bg_del(v->val1, v->val2, v->str1); + e_bg_update(); + SAVE; + END_INT3_STRING3(v); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_DESKTOP_BG_LIST +#if (TYPE == E_REMOTE_OPTIONS) + OP("-desktop-bg-list", 0, "List all current desktop bg definitions", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HDL); +#elif (TYPE == E_WM_IN) + SEND_INT3_STRING3_LIST(e_config->desktop_backgrounds, E_Config_Desktop_Background, cfbg, v, HDL); + v->val1 = cfbg->container; + v->val2 = cfbg->zone; + v->val3 = 0; + v->str1 = cfbg->desk; + v->str2 = cfbg->file; + v->str3 = ""; + END_SEND_INT3_STRING3_LIST(v, E_IPC_OP_DESKTOP_BG_LIST_REPLY); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_DESKTOP_BG_LIST_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + INT3_STRING3_LIST(v, HDL); + printf("REPLY: BG CONTAINER=%i ZONE=%i DESK=\"%s\" FILE=\"%s\"\n", + v->val1, v->val2, v->str1, v->str2); + END_INT3_STRING3_LIST(v); +#endif +#undef HDL + /****************************************************************************/ #if 0 diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h index 82eaee95d..f8ca459ea 100644 --- a/src/bin/e_ipc_handlers_list.h +++ b/src/bin/e_ipc_handlers_list.h @@ -111,4 +111,7 @@ #define E_IPC_OP_GADGET_RESIST_SET 111 #define E_IPC_OP_GADGET_RESIST_GET 112 #define E_IPC_OP_GADGET_RESIST_GET_REPLY 113 - +#define E_IPC_OP_DESKTOP_BG_ADD 114 +#define E_IPC_OP_DESKTOP_BG_DEL 115 +#define E_IPC_OP_DESKTOP_BG_LIST 116 +#define E_IPC_OP_DESKTOP_BG_LIST_REPLY 117