forked from enlightenment/enlightenment
parent
b4e713d4b7
commit
27e182fb59
|
@ -49,7 +49,7 @@ static void _dlg_add_cb_del(void *obj);
|
|||
static Eina_Bool _cb_dlg_fill_delay(void *data);
|
||||
|
||||
static void _cb_layout_select(void *data);
|
||||
static void _cb_used_select (void *data);
|
||||
static void _cb_used_select(void *data);
|
||||
|
||||
static Eina_Bool _cb_fill_delay(void *data);
|
||||
|
||||
|
@ -570,7 +570,7 @@ _dlg_add_cb_ok(void *data __UNUSED__, E_Dialog *dlg)
|
|||
_cb_used_select, cfdata, NULL);
|
||||
}
|
||||
|
||||
e_widget_ilist_go (cfdata->used_list);
|
||||
e_widget_ilist_go(cfdata->used_list);
|
||||
e_widget_ilist_thaw(cfdata->used_list);
|
||||
edje_thaw();
|
||||
evas_event_thaw(cfdata->evas);
|
||||
|
@ -611,7 +611,7 @@ _cb_dlg_fill_delay(void *data)
|
|||
edje_freeze();
|
||||
|
||||
e_widget_ilist_freeze(cfdata->layout_list);
|
||||
e_widget_ilist_clear (cfdata->layout_list);
|
||||
e_widget_ilist_clear(cfdata->layout_list);
|
||||
|
||||
EINA_LIST_FOREACH(layouts, l, layout)
|
||||
{
|
||||
|
@ -625,7 +625,7 @@ _cb_dlg_fill_delay(void *data)
|
|||
_cb_layout_select, cfdata, layout->name);
|
||||
}
|
||||
|
||||
e_widget_ilist_go (cfdata->layout_list);
|
||||
e_widget_ilist_go(cfdata->layout_list);
|
||||
e_widget_ilist_thaw(cfdata->layout_list);
|
||||
|
||||
edje_thaw();
|
||||
|
@ -772,11 +772,11 @@ _cb_used_select(void *data)
|
|||
if (n == (c - 1))
|
||||
{
|
||||
e_widget_disabled_set(cfdata->btn_up, EINA_FALSE);
|
||||
e_widget_disabled_set(cfdata->btn_down, EINA_TRUE );
|
||||
e_widget_disabled_set(cfdata->btn_down, EINA_TRUE);
|
||||
}
|
||||
else if (n == 0)
|
||||
{
|
||||
e_widget_disabled_set(cfdata->btn_up, EINA_TRUE );
|
||||
e_widget_disabled_set(cfdata->btn_up, EINA_TRUE);
|
||||
e_widget_disabled_set(cfdata->btn_down, EINA_FALSE);
|
||||
}
|
||||
else
|
||||
|
@ -785,3 +785,4 @@ _cb_used_select(void *data)
|
|||
e_widget_disabled_set(cfdata->btn_down, EINA_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include "e_mod_main.h"
|
||||
#include "e_mod_parse.h"
|
||||
|
||||
|
||||
/* GADCON */
|
||||
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
|
||||
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
||||
|
@ -13,7 +12,7 @@ static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *ev
|
|||
|
||||
/* EVENTS */
|
||||
static Eina_Bool _xkb_changed(void *data, int type, void *event_info);
|
||||
static Eina_Bool _xkb_changed_state(void *data __UNUSED__,int type __UNUSED__, void *event);
|
||||
static Eina_Bool _xkb_changed_state(void *data __UNUSED__, int type __UNUSED__, void *event);
|
||||
static void _e_xkb_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
|
||||
static void _e_xkb_cb_menu_configure(void *data, E_Menu *mn, E_Menu_Item *mi __UNUSED__);
|
||||
static void _e_xkb_cb_lmenu_post(void *data, E_Menu *menu __UNUSED__);
|
||||
|
@ -120,11 +119,11 @@ _xkb_update_icon(int cur_group)
|
|||
Instance *inst;
|
||||
Eina_List *l;
|
||||
E_Config_XKB_Layout *layout;
|
||||
const char *name=NULL;
|
||||
const char *name = NULL;
|
||||
int grp = -1;
|
||||
|
||||
if (!e_config->xkb.used_layouts) return;
|
||||
INF("ui: %d",cur_group);
|
||||
INF("ui: %d", cur_group);
|
||||
EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, layout)
|
||||
{
|
||||
grp++;
|
||||
|
@ -176,7 +175,7 @@ _gc_init(E_Gadcon *gc, const char *gcname, const char *id, const char *style)
|
|||
const char *name;
|
||||
|
||||
if (e_config->xkb.used_layouts)
|
||||
name = ((E_Config_XKB_Layout*)
|
||||
name = ((E_Config_XKB_Layout *)
|
||||
eina_list_data_get(e_config->xkb.used_layouts))->name;
|
||||
else name = NULL;
|
||||
|
||||
|
@ -283,16 +282,18 @@ _xkb_changed(void *data __UNUSED__, int type __UNUSED__, void *event_info __UNUS
|
|||
_xkb_update_icon((int)(intptr_t)data);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
static Eina_Bool
|
||||
_xkb_changed_state(void *data __UNUSED__,int type __UNUSED__,void *event __UNUSED__)
|
||||
{
|
||||
Ecore_X_Event_Xkb *ev=(Ecore_X_Event_Xkb *)event;
|
||||
|
||||
INF("xkb group %d",ev->group);
|
||||
static Eina_Bool
|
||||
_xkb_changed_state(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
|
||||
{
|
||||
Ecore_X_Event_Xkb *ev = (Ecore_X_Event_Xkb *)event;
|
||||
|
||||
INF("xkb group %d", ev->group);
|
||||
e_config->xkb.cur_group = ev->group;
|
||||
_xkb_update_icon(ev->group);
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
_xkb_menu_items_sort(const void *data1, const void *data2)
|
||||
|
@ -306,6 +307,7 @@ _xkb_menu_items_sort(const void *data1, const void *data2)
|
|||
if (!v) v = strcmp(cl1->variant, cl2->variant);
|
||||
return v;
|
||||
}
|
||||
|
||||
#endif
|
||||
static void
|
||||
_e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
|
||||
|
@ -394,7 +396,6 @@ _e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
e_menu_item_callback_set(mi, _e_xkb_cb_lmenu_set, cl);
|
||||
}
|
||||
|
||||
|
||||
/* Deactivate callback */
|
||||
e_menu_post_deactivate_callback_set(inst->lmenu,
|
||||
_e_xkb_cb_lmenu_post, inst);
|
||||
|
@ -404,39 +405,51 @@ _e_xkb_cb_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSE
|
|||
case E_GADCON_ORIENT_TOP:
|
||||
dir = E_MENU_POP_DIRECTION_DOWN;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_BOTTOM:
|
||||
dir = E_MENU_POP_DIRECTION_UP;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_LEFT:
|
||||
dir = E_MENU_POP_DIRECTION_RIGHT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_RIGHT:
|
||||
dir = E_MENU_POP_DIRECTION_LEFT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_TL:
|
||||
dir = E_MENU_POP_DIRECTION_DOWN;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_TR:
|
||||
dir = E_MENU_POP_DIRECTION_DOWN;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_BL:
|
||||
dir = E_MENU_POP_DIRECTION_UP;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_BR:
|
||||
dir = E_MENU_POP_DIRECTION_UP;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_LT:
|
||||
dir = E_MENU_POP_DIRECTION_RIGHT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_RT:
|
||||
dir = E_MENU_POP_DIRECTION_LEFT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_LB:
|
||||
dir = E_MENU_POP_DIRECTION_RIGHT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_CORNER_RB:
|
||||
dir = E_MENU_POP_DIRECTION_LEFT;
|
||||
break;
|
||||
|
||||
case E_GADCON_ORIENT_FLOAT:
|
||||
case E_GADCON_ORIENT_HORIZ:
|
||||
case E_GADCON_ORIENT_VERT:
|
||||
|
@ -496,3 +509,4 @@ _e_xkb_cb_lmenu_set(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED_
|
|||
_xkb_update_icon(cur_group);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ typedef struct _Xkb
|
|||
|
||||
EAPI extern E_Module_Api e_modapi;
|
||||
|
||||
EAPI void *e_modapi_init (E_Module *m);
|
||||
EAPI void *e_modapi_init(E_Module *m);
|
||||
EAPI int e_modapi_shutdown(E_Module *m);
|
||||
EAPI int e_modapi_save (E_Module *m);
|
||||
EAPI int e_modapi_save(E_Module *m);
|
||||
|
||||
void _xkb_update_icon(int);
|
||||
E_Config_Dialog *_xkb_cfg_dialog(E_Container *con, const char *params);
|
||||
|
|
|
@ -68,7 +68,7 @@ parse_rules(void)
|
|||
models = eina_list_append(models, model);
|
||||
|
||||
/* read models here */
|
||||
for (;;)
|
||||
for (;; )
|
||||
{
|
||||
if (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
|
@ -91,7 +91,8 @@ parse_rules(void)
|
|||
free(tmp);
|
||||
|
||||
p += strlen(model->name);
|
||||
while (p[0] == ' ') ++p;
|
||||
while (p[0] == ' ')
|
||||
++p;
|
||||
|
||||
model->description = eina_stringshare_add(p);
|
||||
|
||||
|
@ -105,7 +106,7 @@ parse_rules(void)
|
|||
if (!fgets(buf, sizeof(buf), f)) goto err;
|
||||
|
||||
/* read layouts here */
|
||||
for (;;)
|
||||
for (;; )
|
||||
{
|
||||
if (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
|
@ -127,7 +128,8 @@ parse_rules(void)
|
|||
free(tmp);
|
||||
|
||||
p += strlen(layout->name);
|
||||
while (p[0] == ' ') ++p;
|
||||
while (p[0] == ' ')
|
||||
++p;
|
||||
|
||||
variant = E_NEW(E_XKB_Variant, 1);
|
||||
variant->name = eina_stringshare_add("basic");
|
||||
|
@ -146,7 +148,7 @@ parse_rules(void)
|
|||
if (!fgets(buf, sizeof(buf), f)) goto err;
|
||||
|
||||
/* read variants here */
|
||||
for (;;)
|
||||
for (;; )
|
||||
{
|
||||
if (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
|
@ -173,7 +175,8 @@ parse_rules(void)
|
|||
layout->variants = eina_list_append(layout->variants, variant);
|
||||
|
||||
p += strlen(variant->name);
|
||||
while (p[0] == ' ') ++p;
|
||||
while (p[0] == ' ')
|
||||
++p;
|
||||
p += strlen(tok);
|
||||
p += 2;
|
||||
|
||||
|
@ -189,7 +192,7 @@ parse_rules(void)
|
|||
if (!fgets(buf, sizeof(buf), f)) goto err;
|
||||
|
||||
/* read options here */
|
||||
for (;;)
|
||||
for (;; )
|
||||
{
|
||||
if (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
|
@ -208,7 +211,8 @@ parse_rules(void)
|
|||
name = strtok(tmp, " ");
|
||||
|
||||
p += strlen(name);
|
||||
while (p[0] == ' ') ++p;
|
||||
while (p[0] == ' ')
|
||||
++p;
|
||||
|
||||
/* skip "grp" options for switching kbd layouts */
|
||||
//if (strncmp(name, "grp", 3))
|
||||
|
@ -223,7 +227,8 @@ parse_rules(void)
|
|||
if (strstr(p, " "))
|
||||
{
|
||||
p = strstr(p, " ");
|
||||
while (p[0] == ' ') ++p;
|
||||
while (p[0] == ' ')
|
||||
++p;
|
||||
}
|
||||
|
||||
group->description = eina_stringshare_add(p);
|
||||
|
@ -333,3 +338,4 @@ layout_sort_by_name_cb(const void *data1, const void *data2)
|
|||
|
||||
return strcmp(l1->name, l2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue