elm_access: override elm_interface_atspi_widget_action_elm_actions_get 77/78877/3
authorShinwoo Kim <cinoo.kim@samsung.com>
Thu, 7 Jul 2016 08:05:15 +0000 (17:05 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Fri, 5 Aug 2016 05:44:19 +0000 (14:44 +0900)
Change-Id: Ic23428f794b1fca8612cd13d6e9e6d56439a7e4f

src/lib/elm_access.c
src/lib/elm_access.eo

index 7866154..9b7d757 100644 (file)
@@ -4,7 +4,7 @@
 
 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
 #define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
-#define ELM_INTERFACE_ATSPI_ACTION_PROTECTED
+#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
 
 #include <Elementary.h>
 #include "elm_priv.h"
@@ -1502,32 +1502,47 @@ _elm_access_elm_interface_atspi_component_highlight_clear(Eo *obj, void *pd EINA
    return EINA_TRUE;
 }
 
-EOLIAN static Eina_Bool
-_elm_access_elm_interface_atspi_action_action_do(Eo *obj, void *pd EINA_UNUSED, int id)
+static Eina_Bool
+_access_atspi_action_do(Evas_Object *obj, const char *params)
 {
-   if (id != 0)
-     return EINA_FALSE;
+   Eina_Bool ret;
 
-   return _access_action_callback_call(obj, ELM_ACCESS_ACTION_ACTIVATE, NULL);
-}
+   ret = EINA_FALSE;
+   if (!strcmp(params, "highlight"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT, NULL);
+   else if (!strcmp(params, "unhighlight"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_UNHIGHLIGHT, NULL);
+   else if (!strcmp(params, "highlight,next"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT_NEXT, NULL);
+   else if (!strcmp(params, "highlight,prev"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT_PREV, NULL);
+   else if (!strcmp(params, "activate"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_ACTIVATE, NULL);
+   else if (!strcmp(params, "value,up"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_UP, NULL);
+   else if (!strcmp(params, "value,down"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_DOWN, NULL);
+   else if (!strcmp(params, "read"))
+      ret = _access_action_callback_call(obj, ELM_ACCESS_ACTION_READ, NULL);
 
-EOLIAN static const char *
-_elm_access_elm_interface_atspi_action_name_get(Eo *obj, void *pd EINA_UNUSED, int id)
-{
-   if ((id != 0) || !_access_action_callback_have(obj, ELM_ACCESS_ACTION_ACTIVATE))
-     return NULL;
-   return "activate";
+   return ret;
 }
 
-EOLIAN static Eina_List*
-_elm_access_elm_interface_atspi_action_actions_get(Eo *obj, void *pd EINA_UNUSED)
-{
-   Eina_List *ret = NULL;
-
-   if (_access_action_callback_have(obj, ELM_ACCESS_ACTION_ACTIVATE))
-      ret = eina_list_append(ret, &("activate"));
-
-   return ret;
+EOLIAN const Elm_Atspi_Action *
+_elm_access_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+{
+   static Elm_Atspi_Action atspi_actions[] = {
+          { "highlight", NULL, "highlight", _access_atspi_action_do},
+          { "unhighlight", NULL, "unhighlight", _access_atspi_action_do},
+          { "highlight,next", NULL, "highlight,next", _access_atspi_action_do},
+          { "highlight,prev", NULL, "highlight,prev", _access_atspi_action_do},
+          { "activate", NULL, "activate", _access_atspi_action_do},
+          { "value,up", NULL, "value,up", _access_atspi_action_do},
+          { "value,down", NULL, "value,down", _access_atspi_action_do},
+          { "read", NULL, "read", _access_atspi_action_do},
+          { NULL, NULL, NULL, NULL }
+   };
+   return &atspi_actions[0];
 }
 
 #include "elm_access.eo.c"
index 1f820dd..6214acc 100644 (file)
@@ -1,4 +1,4 @@
-class Elm.Access (Elm.Widget, Elm_Interface_Atspi_Action)
+class Elm.Access (Elm.Widget, Elm_Interface_Atspi_Widget_Action)
 {
 eo_prefix: elm_obj_access;
    data: null;
@@ -12,8 +12,6 @@ eo_prefix: elm_obj_access;
       Elm_Interface_Atspi_Accessible.description.get;
       Elm_Interface_Atspi_Component.highlight_grab;
       Elm_Interface_Atspi_Component.highlight_clear;
-      Elm_Interface_Atspi_Action.action_do;
-      Elm_Interface_Atspi_Action.name.get;
-      Elm_Interface_Atspi_Action.actions.get;
+      Elm_Interface_Atspi_Widget_Action.elm_actions.get;
    }
 }