2014-04-20 23:04:25 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ELM_INTERFACE_ATSPI_ACTION_PROTECTED
|
|
|
|
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
|
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_widget.h"
|
|
|
|
#include "elm_priv.h"
|
2014-04-20 23:04:25 -07:00
|
|
|
|
|
|
|
extern Eina_Hash *_elm_key_bindings;
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_action_do(Eo *obj, void *pd EINA_UNUSED, int id)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
const Elm_Atspi_Action *actions = NULL;
|
|
|
|
const char *param;
|
2014-04-20 23:04:25 -07:00
|
|
|
Eina_Bool (*func)(Eo *eo, const char *params) = NULL;
|
|
|
|
int tmp = 0;
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
actions = elm_interface_atspi_widget_action_elm_actions_get(obj);
|
2014-04-20 23:04:25 -07:00
|
|
|
if (!actions) return EINA_FALSE;
|
|
|
|
|
|
|
|
while (actions[tmp].name)
|
|
|
|
{
|
|
|
|
if (tmp == id)
|
|
|
|
{
|
|
|
|
func = actions[tmp].func;
|
2014-07-25 01:33:19 -07:00
|
|
|
param = actions[tmp].param;
|
2014-04-20 23:04:25 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
tmp++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!func)
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
2014-07-25 01:33:19 -07:00
|
|
|
return func(obj, param);
|
2014-04-20 23:04:25 -07:00
|
|
|
}
|
|
|
|
|
2014-07-25 01:33:19 -07:00
|
|
|
EOLIAN static char*
|
2014-04-20 23:04:25 -07:00
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_keybinding_get(Eo *obj, void *pd EINA_UNUSED, int id)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
const Elm_Atspi_Action *actions = NULL;
|
|
|
|
Eina_List *l1, *binding_list;
|
|
|
|
const char *action = NULL, *param = NULL;
|
2014-04-20 23:04:25 -07:00
|
|
|
Elm_Config_Binding_Key *binding;
|
|
|
|
int tmp = 0;
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
if (!efl_isa(obj, ELM_WIDGET_CLASS))
|
2014-04-20 23:04:25 -07:00
|
|
|
return NULL;
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
actions = elm_interface_atspi_widget_action_elm_actions_get(obj);
|
2014-04-20 23:04:25 -07:00
|
|
|
if (!actions) return NULL;
|
|
|
|
|
|
|
|
while (actions[tmp].name)
|
|
|
|
{
|
|
|
|
if (tmp == id)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
action = actions[tmp].action;
|
|
|
|
param = actions[tmp].param;
|
2014-04-20 23:04:25 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
tmp++;
|
|
|
|
}
|
|
|
|
if (!action) return NULL;
|
|
|
|
|
|
|
|
binding_list = eina_hash_find(_elm_key_bindings, elm_widget_type_get(obj));
|
|
|
|
|
|
|
|
if (binding_list)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
EINA_LIST_FOREACH(binding_list, l1, binding)
|
2014-04-20 23:04:25 -07:00
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
if (!strcmp(binding->action, action) && (!param ||
|
|
|
|
!strcmp(binding->params, param)))
|
|
|
|
{
|
|
|
|
Eina_List *l2;
|
|
|
|
Elm_Config_Binding_Modifier *bm;
|
|
|
|
char *ret;
|
|
|
|
Eina_Strbuf *buf = eina_strbuf_new();
|
|
|
|
eina_strbuf_append_printf(buf, "%s", binding->key);
|
|
|
|
EINA_LIST_FOREACH(binding->modifiers, l2, bm)
|
|
|
|
if (bm->flag) eina_strbuf_append_printf(buf, "+%s", bm->mod);
|
|
|
|
ret = eina_strbuf_string_steal(buf);
|
|
|
|
eina_strbuf_free(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
2014-04-20 23:04:25 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char *
|
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_name_get(Eo *obj, void *pd EINA_UNUSED, int id)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
const Elm_Atspi_Action *actions = NULL;
|
2014-04-20 23:04:25 -07:00
|
|
|
int tmp = 0;
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
actions = elm_interface_atspi_widget_action_elm_actions_get(obj);
|
2014-08-22 01:20:57 -07:00
|
|
|
if (!actions) return NULL;
|
2014-04-20 23:04:25 -07:00
|
|
|
|
|
|
|
while (actions[tmp].name)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
if (tmp == id) return actions[tmp].name;
|
2014-04-20 23:04:25 -07:00
|
|
|
tmp++;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_description_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int id EINA_UNUSED, const char *description EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static const char *
|
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_description_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int id EINA_UNUSED)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_List*
|
|
|
|
_elm_interface_atspi_widget_action_elm_interface_atspi_action_actions_get(Eo *obj, void *pd EINA_UNUSED)
|
|
|
|
{
|
2014-07-25 01:33:19 -07:00
|
|
|
const Elm_Atspi_Action *actions = NULL;
|
2014-04-20 23:04:25 -07:00
|
|
|
Eina_List *ret = NULL;
|
|
|
|
int tmp = 0;
|
|
|
|
|
2016-03-02 04:10:48 -08:00
|
|
|
actions = elm_interface_atspi_widget_action_elm_actions_get(obj);
|
2014-04-20 23:04:25 -07:00
|
|
|
if (!actions) return NULL;
|
|
|
|
|
|
|
|
while (actions[tmp].name)
|
|
|
|
{
|
|
|
|
ret = eina_list_append(ret, actions[tmp].name);
|
|
|
|
tmp++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "elm_interface_atspi_widget_action.eo.c"
|