From: Enlightenment S. <no-...@en...> - 2011-08-29 09:30:25
|
Log: e17/illume-keyboard: add option for default keyboard layout. - resize window to zone->useful_geometry to make it work with shelves Author: jeffdameth Date: 2011-08-29 02:30:18 -0700 (Mon, 29 Aug 2011) New Revision: 62938 Trac: http://trac.enlightenment.org/e/changeset/62938 Modified: trunk/e/src/modules/illume-keyboard/e_kbd_int.c trunk/e/src/modules/illume-keyboard/e_mod_config.c trunk/e/src/modules/illume-keyboard/e_mod_config.h trunk/e/src/modules/illume-keyboard/e_mod_main.c Modified: trunk/e/src/modules/illume-keyboard/e_kbd_int.c =================================================================== --- trunk/e/src/modules/illume-keyboard/e_kbd_int.c 2011-08-29 09:28:40 UTC (rev 62937) +++ trunk/e/src/modules/illume-keyboard/e_kbd_int.c 2011-08-29 09:30:18 UTC (rev 62938) @@ -899,6 +899,10 @@ Eina_List *l; EINA_LIST_FOREACH(ki->layouts, l, kil) + if (kil->type == il_kbd_cfg->layout) + return kil; + + EINA_LIST_FOREACH(ki->layouts, l, kil) if ((!strcmp(ecore_file_file_get(kil->path), "Default.kbd"))) return kil; return NULL; @@ -1729,10 +1733,14 @@ ecore_x_icccm_hints_set(ki->win->evas_win, 0, 0, 0, 0, 0, 0, 0); e_win_no_remember_set(ki->win, 1); - if (zone->w > zone->h) - e_win_resize(ki->win, zone->w, (zone->h / 2)); + mw = zone->useful_geometry.w; + if (mw < 100) mw = zone->w; + mh = zone->useful_geometry.h; + if (mh < 100) mh = zone->h; + if (mw > mh) + e_win_resize(ki->win, mw, (mh / 2)); else - e_win_resize(ki->win, zone->w, zone->h); + e_win_resize(ki->win, mw, mh); e_win_resize_callback_set(ki->win, _e_kbd_int_cb_resize); e_win_borderless_set(ki->win, 1); @@ -1789,7 +1797,7 @@ evas_object_resize(ki->base_obj, mw, mh); evas_object_show(ki->base_obj); - e_win_size_min_set(ki->win, zone->w, mh); + e_win_size_min_set(ki->win, zone->useful_geometry.w, mh); ecore_x_e_virtual_keyboard_set(ki->win->evas_win, 1); ki->client_message_handler = Modified: trunk/e/src/modules/illume-keyboard/e_mod_config.c =================================================================== --- trunk/e/src/modules/illume-keyboard/e_mod_config.c 2011-08-29 09:28:40 UTC (rev 62937) +++ trunk/e/src/modules/illume-keyboard/e_mod_config.c 2011-08-29 09:30:18 UTC (rev 62938) @@ -1,6 +1,7 @@ #include "e.h" #include "e_mod_main.h" #include "e_mod_config.h" +#include "e_kbd_int.h" /* local function prototypes */ static void *_il_kbd_config_create(E_Config_Dialog *cfd); @@ -33,7 +34,7 @@ E_CONFIG_VAL(D, T, hold_timer, DOUBLE); E_CONFIG_VAL(D, T, slide_dim, INT); E_CONFIG_VAL(D, T, scale_height, DOUBLE); - + E_CONFIG_VAL(D, T, layout, INT); il_kbd_cfg = e_config_domain_load("module.illume-keyboard", conf_edd); if ((il_kbd_cfg) && ((il_kbd_cfg->version >> 16) < IL_CONFIG_MAJ)) @@ -56,13 +57,18 @@ { /* Add new config variables here */ /* if ((il_kbd_cfg->version & 0xffff) < 1) */ - if ((il_kbd_cfg->version & 0xffff) < IL_CONFIG_MIN) + if ((il_kbd_cfg->version & 0xffff) < 2) { il_kbd_cfg->zoom_level = 4; il_kbd_cfg->slide_dim = 4; il_kbd_cfg->hold_timer = 0.25; il_kbd_cfg->scale_height = 1.0; } + if ((il_kbd_cfg->version & 0xffff) < IL_CONFIG_MIN) + { + il_kbd_cfg->layout = E_KBD_INT_TYPE_ALPHA; + } + il_kbd_cfg->version = (IL_CONFIG_MAJ << 16) | IL_CONFIG_MIN; } @@ -207,7 +213,7 @@ nn++; } } - + ol = e_widget_label_add(evas, _("Displacement ratio")); e_widget_framelist_object_append(of, ol); sl = e_widget_slider_add(evas, EINA_TRUE, 0, "1/%.0f", 1.0, 10.0, 1.0, 0, @@ -236,6 +242,17 @@ e_widget_framelist_object_append(of, sl); e_widget_list_object_append(list, of, 1, 0, 0.0); + + of = e_widget_framelist_add(evas, _("Layout"), 0); + rg = e_widget_radio_group_new(&(il_kbd_cfg->layout)); + ow = e_widget_radio_add(evas, _("Default"), E_KBD_INT_TYPE_ALPHA, rg); + e_widget_framelist_object_append(of, ow); + evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL); + ow = e_widget_radio_add(evas, _("Terminal"), E_KBD_INT_TYPE_TERMINAL, rg); + e_widget_framelist_object_append(of, ow); + evas_object_smart_callback_add(ow, "changed", _il_kbd_config_changed, NULL); + e_widget_list_object_append(list, of, 1, 0, 0.0); + return list; } Modified: trunk/e/src/modules/illume-keyboard/e_mod_config.h =================================================================== --- trunk/e/src/modules/illume-keyboard/e_mod_config.h 2011-08-29 09:28:40 UTC (rev 62937) +++ trunk/e/src/modules/illume-keyboard/e_mod_config.h 2011-08-29 09:30:18 UTC (rev 62938) @@ -1,7 +1,7 @@ #ifndef E_MOD_CONFIG_H #define E_MOD_CONFIG_H -#define IL_CONFIG_MIN 2 +#define IL_CONFIG_MIN 3 #define IL_CONFIG_MAJ 1 typedef struct _Il_Kbd_Config Il_Kbd_Config; @@ -19,6 +19,8 @@ int slide_dim; double hold_timer; double scale_height; + int layout; + E_Config_Dialog *cfd; }; Modified: trunk/e/src/modules/illume-keyboard/e_mod_main.c =================================================================== --- trunk/e/src/modules/illume-keyboard/e_mod_main.c 2011-08-29 09:28:40 UTC (rev 62937) +++ trunk/e/src/modules/illume-keyboard/e_mod_main.c 2011-08-29 09:30:18 UTC (rev 62938) @@ -20,6 +20,7 @@ { if (!il_kbd_config_init(m)) return NULL; _il_kbd_start(); + e_module_delayed_set(m, 1); return m; } |