aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/pager/e_mod_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/pager/e_mod_main.c')
-rw-r--r--src/modules/pager/e_mod_main.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c
index 3bde8977b..4e4b21d67 100644
--- a/src/modules/pager/e_mod_main.c
+++ b/src/modules/pager/e_mod_main.c
@@ -167,8 +167,9 @@ static E_Desk *current_desk = NULL;
static E_Config_DD *conf_edd = NULL;
static Eina_List *pagers = NULL;
-Config *pager_config = NULL;
-
+EINTERN E_Module *module;
+EINTERN E_Config_Dialog *config_dialog;
+EINTERN Eina_List *instances, *shandlers;
static Pager_Win *
_pager_desk_window_find(Pager_Desk *pd, E_Client *client)
@@ -240,7 +241,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
_pager_cb_obj_show, inst);
evas_object_event_callback_add(o, EVAS_CALLBACK_HIDE,
_pager_cb_obj_hide, inst);
- pager_config->instances = eina_list_append(pager_config->instances, inst);
+ instances = eina_list_append(instances, inst);
return gcc;
}
@@ -251,7 +252,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
inst = gcc->data;
if (pager_config)
- pager_config->instances = eina_list_remove(pager_config->instances, inst);
+ instances = eina_list_remove(instances, inst);
e_drop_handler_del(inst->pager->drop_handler);
_pager_free(inst->pager);
free(inst);
@@ -299,7 +300,7 @@ _gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas)
o = edje_object_add(evas);
snprintf(buf, sizeof(buf), "%s/e-module-pager.edj",
- e_module_dir_get(pager_config->module));
+ e_module_dir_get(module));
edje_object_file_set(o, buf, "icon");
return o;
}
@@ -310,7 +311,7 @@ _gc_id_new(const E_Gadcon_Client_Class *client_class)
static char buf[4096];
snprintf(buf, sizeof(buf), "%s.%d", client_class->name,
- eina_list_count(pager_config->instances) + 1);
+ eina_list_count(instances) + 1);
return buf;
}
@@ -908,7 +909,7 @@ static void
_pager_inst_cb_menu_configure(void *data EINA_UNUSED, E_Menu *m EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
{
if (!pager_config) return;
- if (pager_config->config_dialog) return;
+ if (config_dialog) return;
/* FIXME: pass zone config item */
_config_pager_module(NULL);
}
@@ -917,10 +918,10 @@ static E_Config_Dialog *
_pager_config_dialog(Evas_Object *parent EINA_UNUSED, const char *params EINA_UNUSED)
{
if (!pager_config) return NULL;
- if (pager_config->config_dialog) return NULL;
+ if (config_dialog) return NULL;
/* FIXME: pass zone config item */
_config_pager_module(NULL);
- return pager_config->config_dialog;
+ return config_dialog;
}
static void
@@ -2040,6 +2041,7 @@ e_modapi_init(E_Module *m)
{
E_Module *p;
+ e_modapi_gadget_init(m);
p = e_module_find("pager_plain");
if (p && p->enabled)
{
@@ -2098,13 +2100,13 @@ e_modapi_init(E_Module *m)
E_CONFIG_LIMIT(pager_config->btn_noplace, 0, 32);
E_CONFIG_LIMIT(pager_config->btn_desk, 0, 32);
- E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_ZONE_DESK_COUNT_SET, _pager_cb_event_zone_desk_count_set, NULL);
- E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_DESK_SHOW, _pager_cb_event_desk_show, NULL);
- E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_DESK_NAME_CHANGE, _pager_cb_event_desk_name_change, NULL);
- E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_COMPOSITOR_RESIZE, _pager_cb_event_compositor_resize, NULL);
- E_LIST_HANDLER_APPEND(pager_config->handlers, E_EVENT_CLIENT_PROPERTY, _pager_cb_event_client_urgent_change, NULL);
+ E_LIST_HANDLER_APPEND(shandlers, E_EVENT_ZONE_DESK_COUNT_SET, _pager_cb_event_zone_desk_count_set, NULL);
+ E_LIST_HANDLER_APPEND(shandlers, E_EVENT_DESK_SHOW, _pager_cb_event_desk_show, NULL);
+ E_LIST_HANDLER_APPEND(shandlers, E_EVENT_DESK_NAME_CHANGE, _pager_cb_event_desk_name_change, NULL);
+ E_LIST_HANDLER_APPEND(shandlers, E_EVENT_COMPOSITOR_RESIZE, _pager_cb_event_compositor_resize, NULL);
+ E_LIST_HANDLER_APPEND(shandlers, E_EVENT_CLIENT_PROPERTY, _pager_cb_event_client_urgent_change, NULL);
- pager_config->module = m;
+ module = m;
e_gadcon_provider_register(&_gadcon_class);
@@ -2140,13 +2142,14 @@ e_modapi_init(E_Module *m)
}
E_API int
-e_modapi_shutdown(E_Module *m EINA_UNUSED)
+e_modapi_shutdown(E_Module *m)
{
+ e_modapi_gadget_shutdown(m);
e_gadcon_provider_unregister(&_gadcon_class);
- if (pager_config->config_dialog)
- e_object_del(E_OBJECT(pager_config->config_dialog));
- E_FREE_LIST(pager_config->handlers, ecore_event_handler_del);
+ if (config_dialog)
+ e_object_del(E_OBJECT(config_dialog));
+ E_FREE_LIST(shandlers, ecore_event_handler_del);
e_configure_registry_item_del("extensions/pager");
@@ -2166,8 +2169,9 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
}
E_API int
-e_modapi_save(E_Module *m EINA_UNUSED)
+e_modapi_save(E_Module *m)
{
+ e_modapi_gadget_save(m);
e_config_domain_save("module.pager", conf_edd, pager_config);
return 1;
}