--- /dev/null
+#include "e.h"
+#include "e_mod_main.h"
+#include "e_mod_config.h"
+
+/* local variables */
+EAPI Il_Sft_Config *il_sft_cfg = NULL;
+static E_Config_DD *conf_edd = NULL;
+
+int
+il_sft_config_init(void)
+{
+ conf_edd = E_CONFIG_DD_NEW("Illume-Softkey_Cfg", Il_Sft_Config);
+ #undef T
+ #undef D
+ #define T Il_Sft_Config
+ #define D conf_edd
+ E_CONFIG_VAL(D, T, version, INT);
+ E_CONFIG_VAL(D, T, height, INT);
+
+ il_sft_cfg = e_config_domain_load("module.illume-softkey", conf_edd);
+ if ((il_sft_cfg) &&
+ ((il_sft_cfg->version >> 16) < IL_CONFIG_MAJ))
+ {
+ E_FREE(il_sft_cfg);
+ }
+ if (!il_sft_cfg)
+ {
+ il_sft_cfg = E_NEW(Il_Sft_Config, 1);
+ il_sft_cfg->version = 0;
+ il_sft_cfg->height = 32;
+ }
+ if (il_sft_cfg)
+ il_sft_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN;
+
+ return 1;
+}
+
+int
+il_sft_config_shutdown(void)
+{
+ E_FREE(il_sft_cfg);
+ E_CONFIG_DD_FREE(conf_edd);
+
+ return 1;
+}
+
+int
+il_sft_config_save(void)
+{
+ return e_config_domain_save("module.illume-softkey", conf_edd, il_sft_cfg);
+}
#include "e.h"
#include "e_mod_main.h"
+#include "e_mod_config.h"
#include "e_mod_sft_win.h"
/* local variables */
/* set module directory variable */
_sft_mod_dir = eina_stringshare_add(m->dir);
+ /* init config subsystem */
+ if (!il_sft_config_init())
+ {
+ /* clear module directory variable */
+ if (_sft_mod_dir) eina_stringshare_del(_sft_mod_dir);
+ _sft_mod_dir = NULL;
+ return NULL;
+ }
+
/* loop through the managers (root windows) */
EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
ecore_x_e_illume_softkey_geometry_set(ecore_x_window_root_first_get(),
0, 0, 0, 0);
+ /* shutdown config */
+ il_sft_config_shutdown();
+
/* clear module directory variable */
if (_sft_mod_dir) eina_stringshare_del(_sft_mod_dir);
_sft_mod_dir = NULL;
EAPI int
e_modapi_save(E_Module *m)
{
- return 1;
+ return il_sft_config_save();
}
#include "e.h"
#include "e_mod_main.h"
+#include "e_mod_config.h"
#include "e_mod_sft_win.h"
/* local function prototypes */
_e_mod_sft_win_create_default_buttons(swin);
/* set minimum size of this window */
- e_win_size_min_set(swin->win, zone->w, (32 * e_scale));
+ e_win_size_min_set(swin->win, zone->w, (il_sft_cfg->height * e_scale));
/* position and resize this window */
e_win_move_resize(swin->win, zone->x, (zone->y + zone->h - (32 * e_scale)),
- zone->w, (32 * e_scale));
+ zone->w, (il_sft_cfg->height * e_scale));
/* show the window */
e_win_show(swin->win);
/* tell conformant apps our position and size */
ecore_x_e_illume_softkey_geometry_set(zone->black_win,
- zone->x, (zone->h - (32 * e_scale)),
- zone->w, (32 * e_scale));
+ zone->x, (zone->h - (il_sft_cfg->height * e_scale)),
+ zone->w, (il_sft_cfg->height * e_scale));
return swin;
}
if (ev->atom != ATM_ENLIGHTENMENT_SCALE) return 1;
/* set minimum size of this window */
- e_win_size_min_set(swin->win, swin->zone->w, (32 * e_scale));
+ e_win_size_min_set(swin->win, swin->zone->w, (il_sft_cfg->height * e_scale));
/* NB: Not sure why, but we need to tell this border to fetch icccm
* size position hints now :( (NOTE: This was not needed a few days ago)
swin->win->border->client.icccm.fetch.size_pos_hints = 1;
/* resize this window */
- e_win_resize(swin->win, swin->zone->w, (32 * e_scale));
+ e_win_resize(swin->win, swin->zone->w, (il_sft_cfg->height * e_scale));
/* tell conformant apps our position and size */
ecore_x_e_illume_softkey_geometry_set(swin->zone->black_win,
swin->win->x, swin->win->y,
- swin->win->w, (32 * e_scale));
+ swin->win->w, (il_sft_cfg->height * e_scale));
return 1;
}
if (ev->zone != swin->zone) return 1;
/* set minimum size of this window */
- e_win_size_min_set(swin->win, ev->zone->w, (32 * e_scale));
+ e_win_size_min_set(swin->win, ev->zone->w, (il_sft_cfg->height * e_scale));
return 1;
}