* Kim Shinwoo <kimcinoo....@gmail.com> [2012-06-04 15:01:39 +0900]:

> Dear all, hello.

Hi.

> 
> To read TEXTBLOCK (especially, TEXTBLOCKs in layout object) in the
> accessibility environment, the TEXTBLOCK should be focusable.
> Because the accessibility uses the elementary focus to change
> highlight object, when user gives specific gesture such as flicking.
> The elm_access(accessibility) gives an object which inherits
> Elm_Layout_Smart_Class. This object is in charge of accessibility task
> for the TEXTBLOCK.
> You can test the TEXTBLOCK working with elementary focus in the
> accessibility environment by using following environment variables.
> 
>    $ export ELM_MODULES="access_output>access/api:$ELM_MODULES"
>    $ export ELM_ACCESS_MODE=1
>    $ elementary_test
> 
> This would be "ONE SMALL STEP" for the accessibility to shake hands
> with the elementary focus.
> 
> Thanks a lot.
> Shinwoo Kim.

Just from examining your patch, I'd say you want something here in the
lines of the Elementary tooltip -- not a widget, but supporting infra
for some actions.

Making this access thing a layout is just nonsense, sorry. Layouts are
for widgets having an Edje object as resize object, which is far from
true here (no layout, no presentation, just logic).

Here's your code:

 > +
 >  /* And now the basic layout widget itself */
 >  EAPI Evas_Object *
 >  elm_layout_add(Evas_Object *parent)
 > Index: src/lib/elm_access.c
 > ===================================================================
 > --- src/lib/elm_access.c     (리비전 71672)
 > +++ src/lib/elm_access.c     (작업 사본)
 > @@ -1,6 +1,36 @@
 >  #include <Elementary.h>
 >  #include "elm_priv.h"
 > +#include "elm_widget_layout.h"

I'd NOT make a widget at all here. Look at tooltips, for example.

 >  
 > +static const char ACCESS_SMART_NAME[] = "elm_access";
 > +
 > +EVAS_SMART_SUBCLASS_NEW
 > +  (ACCESS_SMART_NAME, _elm_access, Elm_Layout_Smart_Class,
 > +  Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
 > +
 > +static Evas_Object * _elm_access_add(Evas_Object *parent);
 > +
 > +static void
 > +_elm_access_smart_add(Evas_Object *obj)
 > +{
 > +   EVAS_SMART_DATA_ALLOC(obj, Elm_Widget_Smart_Data);
 > +   ELM_WIDGET_CLASS(_elm_access_parent_sc)->base.add(obj);
 > +
 > +   elm_widget_can_focus_set(obj, EINA_TRUE);
 > +}
 > +
 > +static void
 > +_elm_access_smart_set_user(Elm_Layout_Smart_Class *sc)
 > +{
 > +   ELM_WIDGET_CLASS(sc)->base.add = _elm_access_smart_add;
 > +
 > +   /* not a 'focus chain manager' */
 > +   ELM_WIDGET_CLASS(sc)->focus_next = NULL;
 > +   ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
 > +
 > +   return;
 > +}
 > +
 >  typedef struct _Mod_Api Mod_Api;
 >  
 >  struct _Mod_Api
 > @@ -194,9 +224,12 @@ _access_obj_hilight_resize_cb(void *data __UNUSED_
 >     evas_object_resize(o, w, h);
 >  }
 >  
 > -
 > -
 >  
 > //-------------------------------------------------------------------------//
 > +EAPI void
 > +_elm_access_highlight_set(Evas_Object* obj)
 > +{
 > +   _access_obj_over_timeout_cb(obj);
 > +}
 >  
 >  EAPI void
 >  _elm_access_clear(Elm_Access_Info *ac)
 > @@ -383,6 +416,71 @@ _elm_access_object_unhilight(Evas_Object *obj)
 >       }
 >  }
 >  
 > +static void
 > +_content_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
 > +                void *event_info __UNUSED__)
 > +{
 > +   Evas_Object *accessobj;
 > +   Evas_Coord w, h;
 > +
 > +   accessobj = data;
 > +   if (!accessobj) return;
 > +
 > +   evas_object_geometry_get(obj, NULL, NULL, &w, &h);

I've seen lots of other __UNUSED__ declarations with use afterwards:
caution.

 > +   evas_object_resize(accessobj, w, h);
 > +}
 > +
 > +static void
 > +_content_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
 > +              void *event_info __UNUSED__)
 > +{
 > +   Evas_Object *accessobj;
 > +   Evas_Coord x, y;
 > +
 > +   accessobj = data;
 > +   if (!accessobj) return;
 > +
 > +   evas_object_geometry_get(obj, &x, &y, NULL, NULL);
 > +   evas_object_move(accessobj, x, y);
 > +}
 > +
 > +static char *
 > +_access_info_cb(void *data __UNUSED__, Evas_Object *obj,
 > +                Elm_Widget_Item *item __UNUSED__)
 > +{
 > +   const char *txt = elm_widget_access_info_get(obj);
 > +   if (txt) return strdup(txt);
 > +   return NULL;
 > +}
 > +
 > +EAPI Evas_Object *
 > +_elm_access_textblock_register(Evas_Object* obj, const Evas_Object 
 > *textblock,
 > +                               const char* text)
 > +{

It's ok to have such internal functions, but they are definetely not
EAPI. Remove it.

 > +   Evas_Object *ao;
 > +   Evas_Object *tb = (Evas_Object *)textblock;
 > +
 > +   if (!obj || !tb) return NULL;
 > +
 > +   // create access object
 > +   ao = _elm_access_add(obj);
 > +   evas_object_event_callback_add(tb, EVAS_CALLBACK_RESIZE,
 > +                                  _content_resize, ao);
 > +   evas_object_event_callback_add(tb, EVAS_CALLBACK_MOVE,
 > +                                  _content_move, ao);
 > +   evas_object_show(ao);
 > +
 > +   // register access object
 > +   _elm_access_object_register(ao, tb);
 > +   _elm_access_text_set(_elm_access_object_get(ao),
 > +                        ELM_ACCESS_TYPE, evas_object_type_get(tb));
 > +   _elm_access_callback_set(_elm_access_object_get(ao),
 > +                            ELM_ACCESS_INFO,
 > +                            _access_info_cb, NULL);
 > +   elm_widget_access_info_set(ao, text);
 > +
 > +   return ao;
 > +}
 >  EAPI void
 >  _elm_access_object_hilight_disable(Evas *e)
 >  {
 > @@ -534,3 +632,22 @@ _elm_access_2nd_click_timeout(Evas_Object *obj)
 >                                    _access_2nd_click_del_cb, NULL);
 >     return EINA_FALSE;
 >  }
 > +
 > +static Evas_Object *
 > +_elm_access_add(Evas_Object *parent)
 > +{
 > +   Evas *e;
 > +   Evas_Object *obj;
 > +
 > +   EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
 > +
 > +   e = evas_object_evas_get(parent);
 > +   if (!e) return NULL;
 > +
 > +   obj = evas_object_smart_add(e, _elm_access_smart_class_new());
 > +
 > +   if (!elm_widget_sub_object_add(parent, obj))
 > +     ERR("could not add %p as sub object of %p", obj, parent);
 > +
 > +   return obj;
 > +}

Please think on the issue -- you do not need a widget here :)

Best regards,

> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
Gustavo Lima Chaves
Computer Engineer @ ProFUSION Embedded Systems

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to