project).
SVN revision: 47709
module_la_SOURCES = \
e_mod_ind_win.c \
e_mod_ind_win.h \
+ e_mod_config.c \
+ e_mod_config.h \
e_mod_main.c \
e_mod_main.h
--- /dev/null
+#include "e.h"
+#include "e_mod_main.h"
+#include "e_mod_config.h"
+
+/* local variables */
+EAPI Il_Ind_Config *il_ind_cfg = NULL;
+static E_Config_DD *conf_edd = NULL;
+
+int
+il_ind_config_init(void)
+{
+ conf_edd = E_CONFIG_DD_NEW("Illume-Indicator_Cfg", Il_Ind_Config);
+ #undef T
+ #undef D
+ #define T Il_Ind_Config
+ #define D conf_edd
+ E_CONFIG_VAL(D, T, version, INT);
+ E_CONFIG_VAL(D, T, height, INT);
+
+ il_ind_cfg = e_config_domain_load("module.illume-indicator", conf_edd);
+ if ((il_ind_cfg) &&
+ ((il_ind_cfg->version >> 16) < IL_CONFIG_MAJ))
+ {
+ E_FREE(il_ind_cfg);
+ }
+ if (!il_ind_cfg)
+ {
+ il_ind_cfg = E_NEW(Il_Ind_Config, 1);
+ il_ind_cfg->version = 0;
+ il_ind_cfg->height = 32;
+ }
+ if (il_ind_cfg)
+ il_ind_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
+
+ return 1;
+}
+
+int
+il_ind_config_shutdown(void)
+{
+ E_FREE(il_ind_cfg);
+ E_CONFIG_DD_FREE(conf_edd);
+
+ return 1;
+}
+
+int
+il_ind_config_save(void)
+{
+ return e_config_domain_save("module.illume-indicator", conf_edd, il_ind_cfg);
+}
--- /dev/null
+#ifndef E_MOD_CONFIG_H
+#define E_MOD_CONFIG_H
+
+#define IL_CONFIG_MIN 0
+#define IL_CONFIG_MAJ 0
+
+typedef struct _Il_Ind_Config Il_Ind_Config;
+
+struct _Il_Ind_Config
+{
+ int version, height;
+};
+
+int il_ind_config_init(void);
+int il_ind_config_shutdown(void);
+int il_ind_config_save(void);
+
+extern EAPI Il_Ind_Config *il_ind_cfg;
+
+#endif
#include "e.h"
#include "e_mod_main.h"
+#include "e_mod_config.h"
#include "e_mod_ind_win.h"
/* local function prototypes */
iwin->o_base, "e.swallow.content");
// iwin->gadcon->instant_edit = 1;
edje_extern_object_min_size_set(iwin->gadcon->o_container, zone->w,
- (32 * e_scale));
+ (il_ind_cfg->height * e_scale));
edje_object_part_swallow(iwin->o_base, "e.swallow.container",
iwin->gadcon->o_container);
e_gadcon_min_size_request_callback_set(iwin->gadcon,
iwin));
/* set minimum size of this window */
- e_win_size_min_set(iwin->win, zone->w, (32 * e_scale));
+ e_win_size_min_set(iwin->win, zone->w, (il_ind_cfg->height * e_scale));
/* position and resize this window */
- e_win_move_resize(iwin->win, zone->x, zone->y, zone->w, (32 * e_scale));
+ e_win_move_resize(iwin->win, zone->x, zone->y, zone->w,
+ (il_ind_cfg->height * e_scale));
/* show the window */
e_win_show(iwin->win);
/* tell conformant apps our position and size */
ecore_x_e_illume_indicator_geometry_set(zone->black_win, zone->x, zone->y,
- zone->w, (32 * e_scale));
+ zone->w,
+ (il_ind_cfg->height * e_scale));
return iwin;
}
#include "e.h"
#include "e_mod_main.h"
+#include "e_mod_config.h"
#include "e_mod_ind_win.h"
/* local variables */
/* set module directory variable */
_ind_mod_dir = eina_stringshare_add(m->dir);
+ /* init config subsystem */
+ if (!il_ind_config_init())
+ {
+ /* clear module directory variable */
+ if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
+ _ind_mod_dir = NULL;
+ return NULL;
+ }
+
/* loop through the managers (root windows) */
EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
EINA_LIST_FREE(iwins, iwin)
e_object_del(E_OBJECT(iwin));
+ /* shutdown config */
+ il_ind_config_shutdown();
+
/* clear module directory variable */
if (_ind_mod_dir) eina_stringshare_del(_ind_mod_dir);
_ind_mod_dir = NULL;
EAPI int
e_modapi_save(E_Module *m)
{
- return 1;
+ return il_ind_config_save();
}