group "E_Config" struct {
+ group "syscon.actions" list {
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "halt";
+ value "params" string: "now";
+ value "button" string: "button";
+ value "icon" string: "system-shutdown";
+ value "is_main" int: 1;
+ }
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "suspend";
+ value "params" string: "now";
+ value "button" string: "button";
+ value "icon" string: "system-suspend";
+ value "is_main" int: 2;
+ }
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "desk_lock";
+ value "button" string: "button";
+ value "icon" string: "system-lock-screen";
+ value "is_main" int: 1;
+ }
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "reboot";
+ value "params" string: "now";
+ value "button" string: "button";
+ value "icon" string: "system-restart";
+ value "is_main" int: 0;
+ }
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "hibernate";
+ value "params" string: "now";
+ value "button" string: "button";
+ value "icon" string: "system-suspend-hibernate";
+ value "is_main" int: 0;
+ }
+ group "E_Config_Syscon_Action" struct {
+ value "action" string: "logout";
+ value "params" string: "now";
+ value "button" string: "button";
+ value "icon" string: "system-log-out";
+ value "is_main" int: 0;
+ }
+ }
group "modules" list {
group "E_Config_Module" struct {
value "name" string: "comp";
value "icon" string: "DESKTOP";
}
}
- group "syscon.actions" list {
- group "E_Config_Syscon_Action" struct {
- value "action" string: "halt";
- value "params" string: "now";
- value "button" string: "button";
- value "icon" string: "system-shutdown";
- value "is_main" int: 1;
- }
- group "E_Config_Syscon_Action" struct {
- value "action" string: "suspend";
- value "params" string: "now";
- value "button" string: "button";
- value "icon" string: "system-suspend";
- value "is_main" int: 1;
- }
- group "E_Config_Syscon_Action" struct {
- value "action" string: "desk_lock";
- value "button" string: "button";
- value "icon" string: "system-lock-screen";
- value "is_main" int: 1;
- }
- group "E_Config_Syscon_Action" struct {
- value "action" string: "reboot";
- value "params" string: "now";
- value "button" string: "button";
- value "icon" string: "system-restart";
- value "is_main" int: 0;
- }
- group "E_Config_Syscon_Action" struct {
- value "action" string: "hibernate";
- value "params" string: "now";
- value "button" string: "button";
- value "icon" string: "system-suspend-hibernate";
- value "is_main" int: 0;
- }
- group "E_Config_Syscon_Action" struct {
- value "action" string: "logout";
- value "params" string: "now";
- value "button" string: "button";
- value "icon" string: "system-log-out";
- value "is_main" int: 0;
- }
- }
value "config_version" int: 65847;
value "show_splash" int: 1;
value "init_default_theme" string: "default.edj";
value "params" string: "now";
value "button" string: "button";
value "icon" string: "system-shutdown";
- value "is_main" int: 1;
+ value "is_main" int: 2;
}
group "E_Config_Syscon_Action" struct {
value "action" string: "suspend";
if (_e_bindings_context_match(bind->ctxt, ctxt))
{
E_Action *act;
-
+
act = e_action_find(bind->action);
if (act)
{
return NULL;
}
+EAPI E_Action *
+e_bindings_key_down_event_find(E_Binding_Context ctxt, Ecore_Event_Key *ev)
+{
+ E_Binding_Modifier mod = 0;
+ E_Binding_Key *bind;
+ Eina_List *l;
+
+ mod = _e_bindings_modifiers(ev->modifiers);
+ EINA_LIST_FOREACH(key_bindings, l, bind)
+ {
+ if ((bind->key) && (!strcmp(bind->key, ev->keyname)) &&
+ ((bind->any_mod) || (bind->mod == mod)))
+ {
+ if (_e_bindings_context_match(bind->ctxt, ctxt))
+ {
+ E_Action *act;
+
+ act = e_action_find(bind->action);
+ return act;
+ }
+ }
+ }
+ return NULL;
+}
+
+EAPI E_Action *
+e_bindings_key_up_event_find(E_Binding_Context ctxt, Ecore_Event_Key *ev)
+{
+ E_Binding_Modifier mod = 0;
+ E_Binding_Key *bind;
+ Eina_List *l;
+
+ mod = _e_bindings_modifiers(ev->modifiers);
+ EINA_LIST_FOREACH(key_bindings, l, bind)
+ {
+ if ((bind->key) && (!strcmp(bind->key, ev->keyname)) &&
+ ((bind->any_mod) || (bind->mod == mod)))
+ {
+ if (_e_bindings_context_match(bind->ctxt, ctxt))
+ {
+ E_Action *act;
+
+ act = e_action_find(bind->action);
+ return act;
+ }
+ }
+ }
+ return NULL;
+}
+
EAPI void
e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay)
{
EAPI void e_bindings_key_ungrab(E_Binding_Context ctxt, Ecore_X_Window win);
EAPI E_Action *e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev);
EAPI E_Action *e_bindings_key_up_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_Event_Key *ev);
+EAPI E_Action *e_bindings_key_down_event_find(E_Binding_Context ctxt, Ecore_Event_Key *ev);
+EAPI E_Action *e_bindings_key_up_event_find(E_Binding_Context ctxt, Ecore_Event_Key *ev);
EAPI void e_bindings_edge_add(E_Binding_Context ctxt, E_Zone_Edge edge, E_Binding_Modifier mod, int any_mod, const char *action, const char *params, float delay);
EAPI E_Binding_Edge *e_bindings_edge_get(const char *action, E_Zone_Edge edge, Eina_Bool click);
static Evas_Object *o_flow_extra = NULL;
static int inevas = 0;
static Ecore_Timer *deftimer = NULL;
+static double show_time = 0.0;
+static int act_count = 0;
/* externally accessible functions */
int
int x, y, w, h, zx, zy, zw, zh;
int iw, ih;
Eina_List *l;
+ double t;
- if (popup) return 0;
+ t = ecore_loop_time_get();
+ if (popup)
+ {
+ if ((t - show_time) > 0.5)
+ {
+ for (l = e_config->syscon.actions; l; l = l->next)
+ {
+ E_Config_Syscon_Action *sca;
+ E_Action *a;
+
+ if (!(sca = l->data)) continue;
+ if (!sca->action) continue;
+ a = e_action_find(sca->action);
+ if (!a) continue;
+ if (sca->is_main == 2)
+ {
+ a->func.go(NULL, sca->params);
+ }
+ }
+ }
+ return 0;
+ }
input_window = ecore_x_window_input_new(zone->container->win, zone->x,
zone->y, zone->w, zone->h);
edje_object_signal_callback_add(o, "e,action,syscon", "*",
_cb_signal_syscon, NULL);
+ act_count = 0;
+ show_time = t;
+
// main (default):
// halt | suspend | desk_lock
// secondary (default):
{
// FIXME: implement focus and key control... eventually
}
+ else if (!strcmp(ev->key, "Down"))
+ {
+ // FIXME: implement focus and key control... eventually
+ }
+ else if (!strcmp(ev->key, "Left"))
+ {
+ // FIXME: implement focus and key control... eventually
+ }
+ else if (!strcmp(ev->key, "Right"))
+ {
+ // FIXME: implement focus and key control... eventually
+ }
+ else if (!strcmp(ev->key, "Tab"))
+ {
+ // FIXME: implement focus and key control... eventually
+ }
+ else if (!strcmp(ev->key, "Enter"))
+ {
+ // FIXME: implement focus and key control... eventually
+ }
+ else
+ {
+ E_Action *act;
+ double t;
+
+ t = ecore_loop_time_get();
+ if (t - show_time > 0.5)
+ {
+ act = e_bindings_key_down_event_find(E_BINDING_CONTEXT_ANY, ev);
+ printf("%p\n", act);
+ if ((act) && (act->name))
+ {
+ printf("%s\n", act->name);
+ if (!strcmp(act->name, "syscon"))
+ {
+ if (popup)
+ {
+ printf("sy show again\n");
+ e_syscon_show(popup->zone, do_defact);
+ }
+ }
+ else
+ {
+ Eina_List *l;
+
+ for (l = e_config->syscon.actions; l; l = l->next)
+ {
+ E_Config_Syscon_Action *sca;
+
+ if (!(sca = l->data)) continue;
+ if (!sca->action) continue;
+ if (!strcmp(sca->action, act->name))
+ {
+ act_count++;
+ if (act_count > 2)
+ {
+ act->func.go(NULL, sca->params);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
return ECORE_CALLBACK_PASS_ON;
}