elm: all the focusable widget now emits "focused" and "unfocused" smart callbacks.

1. documentations, NEWS, and ChangeLog will be updated later after some more test.
2. need to check entry.
This commit is contained in:
Daniel Juyung Seo 2013-06-07 01:13:37 +09:00
parent 93fb6bcde9
commit 8bfdbd2ba6
9 changed files with 46 additions and 11 deletions

View File

@ -452,6 +452,12 @@ static void
_elm_datetime_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (!elm_widget_focus_get(obj))
{
Elm_Datetime_Smart_Data *sd = _pd;

View File

@ -39,17 +39,15 @@ _elm_glview_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (elm_widget_focus_get(obj))
{
evas_object_focus_set(wd->resize_obj, EINA_TRUE);
evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
}
evas_object_focus_set(wd->resize_obj, EINA_TRUE);
else
{
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
evas_object_focus_set(wd->resize_obj, EINA_FALSE);
if (ret) *ret = EINA_TRUE;
}

View File

@ -370,9 +370,12 @@ static void
_elm_layout_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (elm_widget_focus_get(obj))
{

View File

@ -3804,6 +3804,10 @@ _elm_map_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (elm_widget_focus_get(obj))
{

View File

@ -863,6 +863,10 @@ _elm_photocam_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (elm_widget_focus_get(obj))
{

View File

@ -571,6 +571,10 @@ _elm_toolbar_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
ELM_TOOLBAR_DATA_GET(obj, sd);
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (elm_widget_focus_get(obj))
evas_object_focus_set(wd->resize_obj, EINA_TRUE);

View File

@ -154,6 +154,10 @@ _elm_web_smart_on_focus(Eo *obj, void *_pd, va_list *list)
Elm_Web_Smart_Data *sd = _pd;
Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
top = elm_widget_top_get(obj);

View File

@ -5852,7 +5852,16 @@ static void
_elm_widget_on_focus(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
if (elm_widget_can_focus_get(obj))
{
if (elm_widget_focus_get(obj))
evas_object_smart_callback_call(obj, "focused", NULL);
else
evas_object_smart_callback_call(obj, "unfocused", NULL);
}
if (ret) *ret = EINA_TRUE;
}
static void

View File

@ -1128,8 +1128,11 @@ _elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_TRUE;
Elm_Win_Smart_Data *sd = _pd;
Eina_Bool int_ret = EINA_FALSE;
eo_do_super(obj, MY_CLASS, elm_wdg_on_focus(&int_ret));
if (!int_ret) return;
if (sd->img_obj)
evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));