summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/e_mod_main.c47
1 files changed, 43 insertions, 4 deletions
diff --git a/src/e_mod_main.c b/src/e_mod_main.c
index 4147fd8..72490d7 100644
--- a/src/e_mod_main.c
+++ b/src/e_mod_main.c
@@ -18,6 +18,13 @@ typedef struct {
18 Ecore_Timer *timer; 18 Ecore_Timer *timer;
19} Entry; 19} Entry;
20 20
21typedef struct {
22 float scale;
23} Presentator_Config;
24
25static E_Config_DD *dd_config;
26static Presentator_Config *config;
27
21static void _del_key(const char *name); 28static void _del_key(const char *name);
22 29
23static Eina_Bool 30static Eina_Bool
@@ -75,6 +82,14 @@ _update_place(void)
75} 82}
76 83
77static void 84static void
85_flush_config(void)
86{
87 e_config_domain_save("presentator", dd_config, config);
88 elm_object_scale_set(lb, config->scale);
89 _update_place();
90}
91
92static void
78_del_key(const char *name) 93_del_key(const char *name)
79{ 94{
80 Entry *e = eina_hash_find(string_hash, name); 95 Entry *e = eina_hash_find(string_hash, name);
@@ -185,6 +200,8 @@ _start_logging(void)
185 elm_object_content_set(notify, lb); 200 elm_object_content_set(notify, lb);
186 evas_object_show(lb); 201 evas_object_show(lb);
187 202
203
204 _flush_config();
188 /* FIXME this is only on x11 need a different solution for wl */ 205 /* FIXME this is only on x11 need a different solution for wl */
189 { 206 {
190 keylogger = ecore_exe_pipe_run(MODULE_DIR"/keylogger", ECORE_EXE_PIPE_WRITE | 207 keylogger = ecore_exe_pipe_run(MODULE_DIR"/keylogger", ECORE_EXE_PIPE_WRITE |
@@ -227,22 +244,41 @@ static void
227_decrease_fontsize(E_Object *e, const char *name) 244_decrease_fontsize(E_Object *e, const char *name)
228{ 245{
229 float scale = elm_object_scale_get(lb); 246 float scale = elm_object_scale_get(lb);
230 elm_object_scale_set(lb, scale - 0.1); 247
231 _update_place(); 248 config->scale = scale + 0.1;
249 _flush_config();
232} 250}
233 251
234static void 252static void
235_increase_fontsize(E_Object *e, const char *name) 253_increase_fontsize(E_Object *e, const char *name)
236{ 254{
237 float scale = elm_object_scale_get(lb); 255 float scale = elm_object_scale_get(lb);
238 elm_object_scale_set(lb, scale + 0.1); 256
239 _update_place(); 257 config->scale = scale + 0.1;
258 _flush_config();
259}
260
261
262static void
263_config_init(void)
264{
265 E_Config_DD *result = E_CONFIG_DD_NEW("presentator", Presentator_Config);
266
267 E_CONFIG_VAL(result, Presentator_Config, scale, FLOAT);
268
269 dd_config = result;
240} 270}
241 271
242E_API void * 272E_API void *
243e_modapi_init(E_Module *m) 273e_modapi_init(E_Module *m)
244{ 274{
245 ecore_init(); 275 ecore_init();
276 _config_init();
277
278 config = e_config_domain_load("presentator", dd_config);
279
280 if (!config)
281 config = calloc(1, sizeof(Presentator_Config));
246 282
247#define ACTION_ADD(_action, _cb, _title, _value, _params, _example, _editable) \ 283#define ACTION_ADD(_action, _cb, _title, _value, _params, _example, _editable) \
248 { \ 284 { \
@@ -264,6 +300,9 @@ e_modapi_init(E_Module *m)
264E_API int 300E_API int
265e_modapi_shutdown(E_Module *m EINA_UNUSED) 301e_modapi_shutdown(E_Module *m EINA_UNUSED)
266{ 302{
303 E_CONFIG_DD_FREE(dd_config);
304 free(config);
305 config = NULL;
267 306
268 ecore_shutdown(); 307 ecore_shutdown();
269 return 1; 308 return 1;