On Fri, Aug 3, 2012 at 4:00 AM, Enlightenment SVN
<[email protected]> wrote:
> Log:
> elementary: add smart callback "focus-in" and "focus-out".
>
> NOTE: Glima could you review this, I am really not sure I should
> have implemented it this way.
I'm not glima, but it's wrong :-D
See:
> static Eina_Bool
> +_elm_widget_focus_call(Elm_Widget_Smart_Data *sd, Evas_Object *obj)
> +{
> + Eina_Bool r = EINA_FALSE;
> +
> + sd->api->on_focus(obj);
> + if (_elm_legacy_is(obj) && COMPAT_SMART_DATA(sd)->focus)
> + {
> + COMPAT_SMART_DATA(sd)->focus(obj);
> + r = EINA_TRUE;
> + }
here, you should not need COMPAT_SMART_DATA(sd)->focus(obj), you
should just call:
sd->api->on_focus()
and the compat's on_focus() implementation should call sd->focus(obj).
effectively you just call sd->api->on_focus(), always. The
compatibility layer will convert the class method to an instance hook.
But:
> +static Eina_Bool
> _elm_widget_sub_object_add_func(Evas_Object *obj,
> Evas_Object *sobj)
> {
> @@ -831,9 +850,7 @@
> if (sd->top_win_focused)
> {
> sd->focused = EINA_TRUE;
> - sd->api->on_focus(obj);
> - if (_elm_legacy_is(obj) && COMPAT_SMART_DATA(sd)->focus)
> - COMPAT_SMART_DATA(sd)->focus(obj);
I really don't know why glima left this here, it makes no sense! See above :-)
--
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel