Eolian: Integration of Access

This commit is contained in:
Daniel Zaoui 2014-03-18 13:47:23 +02:00
parent b364f7d9ba
commit cbae1d7cba
11 changed files with 49 additions and 54 deletions

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_grid_text_get(void *data EINA_UNUSED, _grid_text_get(void *data EINA_UNUSED,

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_text_get(void *data EINA_UNUSED, _text_get(void *data EINA_UNUSED,

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_text_get(void *data EINA_UNUSED, _text_get(void *data EINA_UNUSED,

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_text_get(void *data EINA_UNUSED, _text_get(void *data EINA_UNUSED,

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_text_get(void *data EINA_UNUSED, _text_get(void *data EINA_UNUSED,

View File

@ -1,9 +1,9 @@
#include <Elementary.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "elementary_config.h" # include "elementary_config.h"
#else #else
# define EINA_UNUSED # define EINA_UNUSED
#endif #endif
#include <Elementary.h>
static char * static char *
_text_get(void *data EINA_UNUSED, _text_get(void *data EINA_UNUSED,

View File

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h> #include <Elementary.h>
/* get our images to make slideshow items */ /* get our images to make slideshow items */

View File

@ -537,7 +537,9 @@ BUILT_SOURCES = \
elm_frame.eo.c \ elm_frame.eo.c \
elm_frame.eo.h \ elm_frame.eo.h \
elm_hover.eo.c \ elm_hover.eo.c \
elm_hover.eo.h elm_hover.eo.h \
elm_access.eo.c \
elm_access.eo.h
EXTRA_DIST += \ EXTRA_DIST += \
elm_widget.eo \ elm_widget.eo \
@ -546,7 +548,8 @@ EXTRA_DIST += \
elm_interface_scrollable.eo \ elm_interface_scrollable.eo \
elm_pan.eo \ elm_pan.eo \
elm_frame.eo \ elm_frame.eo \
elm_hover.eo elm_hover.eo \
elm_access.eo
nodist_includesunstable_HEADERS = \ nodist_includesunstable_HEADERS = \
elm_widget.eo.h \ elm_widget.eo.h \
@ -555,5 +558,6 @@ nodist_includesunstable_HEADERS = \
elm_interface_scrollable.eo.h \ elm_interface_scrollable.eo.h \
elm_pan.eo.h \ elm_pan.eo.h \
elm_frame.eo.h \ elm_frame.eo.h \
elm_access.eo.h \
elm_hover.eo.h elm_hover.eo.h

View File

@ -34,8 +34,8 @@ static Evas_Object * _elm_access_add(Evas_Object *parent);
static void _access_object_unregister(Evas_Object *obj); static void _access_object_unregister(Evas_Object *obj);
static void EOLIAN static void
_elm_access_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) _elm_access_evas_smart_add(Eo *obj, void *_pd EINA_UNUSED)
{ {
eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj); elm_widget_sub_object_parent_add(obj);
@ -73,13 +73,9 @@ _access_action_callback_call(Evas_Object *obj,
return ret; return ret;
} }
static void EOLIAN static Eina_Bool
_elm_access_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list) _elm_access_elm_widget_activate(Eo *obj, void *_pd EINA_UNUSED, Elm_Activate act)
{ {
Elm_Activate act = va_arg(*list, Elm_Activate);
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
int type = ELM_ACCESS_ACTION_FIRST; int type = ELM_ACCESS_ACTION_FIRST;
Action_Info *a; Action_Info *a;
@ -113,7 +109,7 @@ _elm_access_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
break; break;
} }
if (type == ELM_ACCESS_ACTION_FIRST) return; if (type == ELM_ACCESS_ACTION_FIRST) return EINA_FALSE;
/* if an access object has a callback, it would have the intention to do /* if an access object has a callback, it would have the intention to do
something. so, check here and return EINA_TRUE. */ something. so, check here and return EINA_TRUE. */
@ -122,30 +118,28 @@ _elm_access_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
(a->fn[type].cb)) (a->fn[type].cb))
{ {
_access_action_callback_call(obj, type, NULL); _access_action_callback_call(obj, type, NULL);
if (ret) *ret = EINA_TRUE; return EINA_TRUE;
return;
} }
/* TODO: deprecate below? */ /* TODO: deprecate below? */
if (act != ELM_ACTIVATE_DEFAULT) return; if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
Elm_Access_Info *ac = evas_object_data_get(obj, "_elm_access"); Elm_Access_Info *ac = evas_object_data_get(obj, "_elm_access");
if (!ac) return; if (!ac) return EINA_FALSE;
if (ac->activate) if (ac->activate)
ac->activate(ac->activate_data, ac->part_object, ac->activate(ac->activate_data, ac->part_object,
(Elm_Object_Item *)ac->widget_item); (Elm_Object_Item *)ac->widget_item);
if (ret) *ret = EINA_TRUE; return EINA_TRUE;
} }
static void EOLIAN static Eina_Bool
_elm_access_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list) _elm_access_elm_widget_on_focus(Eo *obj, void *_pd EINA_UNUSED)
{ {
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_focus_set(obj, elm_widget_focus_get(obj)); evas_object_focus_set(obj, elm_widget_focus_get(obj));
if (ret) *ret = EINA_TRUE; return EINA_TRUE;
} }
typedef struct _Mod_Api Mod_Api; typedef struct _Mod_Api Mod_Api;
@ -1246,8 +1240,8 @@ _elm_access_add(Evas_Object *parent)
return obj; return obj;
} }
static void EOLIAN static void
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) _elm_access_constructor(Eo *obj, void *_pd EINA_UNUSED)
{ {
eo_do_super(obj, MY_CLASS, eo_constructor()); eo_do_super(obj, MY_CLASS, eo_constructor());
eo_do(obj, eo_do(obj,
@ -1450,33 +1444,10 @@ elm_access_highlight_next_set(Evas_Object *obj, Elm_Highlight_Direction dir, Eva
ERR("Not supported focus direction for access highlight [%d]", dir); ERR("Not supported focus direction for access highlight [%d]", dir);
} }
static void EOLIAN static void
_class_constructor(Eo_Class *klass) _elm_access_class_constructor(Eo_Class *klass)
{ {
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_access_smart_add),
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ON_FOCUS), _elm_access_smart_on_focus),
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_ACTIVATE), _elm_access_smart_activate),
EO_OP_FUNC_SENTINEL
};
eo_class_funcs_set(klass, func_desc);
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
} }
static const Eo_Class_Description class_desc = { #include "elm_access.eo.c"
EO_VERSION,
MY_CLASS_NAME,
EO_CLASS_TYPE_REGULAR,
EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
NULL,
0,
_class_constructor,
NULL
};
EO_DEFINE_CLASS(elm_obj_access_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);

View File

@ -0,0 +1,13 @@
class Elm_Access (Elm_Widget)
{
eo_prefix: elm_obj_access;
data: null;
implements {
class::constructor;
Eo_Base::constructor;
Evas_Smart::add;
Elm_Widget::activate;
Elm_Widget::on_focus;
}
}

View File

@ -9,9 +9,13 @@
* *
*/ */
#if 0
#define ELM_OBJ_ACCESS_CLASS elm_obj_access_class_get() #define ELM_OBJ_ACCESS_CLASS elm_obj_access_class_get()
const Eo_Class *elm_obj_access_class_get(void) EINA_CONST; const Eo_Class *elm_obj_access_class_get(void) EINA_CONST;
#endif
#include "elm_access.eo.h"
enum _Elm_Access_Info_Type enum _Elm_Access_Info_Type
{ {