summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-06-09 16:21:46 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commit238ab8355f37a46db184861d7b82e6b5f32916e1 (patch)
tree420446b114f1dc6794a191026d7f3dca74b803ca
parentfc753552ec87d3a6773a961537a7010dc0ae1af0 (diff)
elm_toolbar: porting evas smart callbacks to eo
-rw-r--r--src/lib/elm_toolbar.c123
-rw-r--r--src/lib/elm_toolbar.eo12
2 files changed, 17 insertions, 118 deletions
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index d03b587cd..960902fbb 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -3,7 +3,6 @@
3#endif 3#endif
4 4
5#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED 5#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
6#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
7#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED 6#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
8#define ELM_WIDGET_ITEM_PROTECTED 7#define ELM_WIDGET_ITEM_PROTECTED
9 8
@@ -159,7 +158,7 @@ _item_unselect(Elm_Toolbar_Item_Data *item)
159 edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm"); 158 edje_object_signal_emit(VIEW(item), "elm,state,unselected", "elm");
160 if (item->icon) 159 if (item->icon)
161 elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm"); 160 elm_widget_signal_emit(item->icon, "elm,state,unselected", "elm");
162 evas_object_smart_callback_call(WIDGET(item), SIG_UNSELECTED, EO_OBJ(item)); 161 eo_do(WIDGET(item), eo_event_callback_call(ELM_TOOLBAR_EVENT_UNSELECTED, EO_OBJ(item)));
163} 162}
164 163
165static void 164static void
@@ -632,8 +631,8 @@ _elm_toolbar_item_focused(Elm_Object_Item *eo_it)
632 focus_raise = edje_object_data_get(VIEW(it), "focusraise"); 631 focus_raise = edje_object_data_get(VIEW(it), "focusraise");
633 if ((focus_raise) && (!strcmp(focus_raise, "on"))) 632 if ((focus_raise) && (!strcmp(focus_raise, "on")))
634 evas_object_raise(VIEW(it)); 633 evas_object_raise(VIEW(it));
635 evas_object_smart_callback_call 634 eo_do(obj, eo_event_callback_call
636 (obj, SIG_ITEM_FOCUSED, EO_OBJ(it)); 635 (ELM_TOOLBAR_EVENT_ITEM_FOCUSED, EO_OBJ(it)));
637 if (_elm_config->atspi_mode) 636 if (_elm_config->atspi_mode)
638 elm_interface_atspi_accessible_state_changed_signal_emit(EO_OBJ(it), ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 637 elm_interface_atspi_accessible_state_changed_signal_emit(EO_OBJ(it), ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
639} 638}
@@ -659,8 +658,8 @@ _elm_toolbar_item_unfocused(Elm_Object_Item *eo_it)
659 edje_object_signal_emit 658 edje_object_signal_emit
660 (VIEW(it), "elm,highlight,off", "elm"); 659 (VIEW(it), "elm,highlight,off", "elm");
661 sd->focused_item = NULL; 660 sd->focused_item = NULL;
662 evas_object_smart_callback_call 661 eo_do(obj, eo_event_callback_call
663 (obj, SIG_ITEM_UNFOCUSED, eo_it); 662 (ELM_TOOLBAR_EVENT_ITEM_UNFOCUSED, eo_it));
664 if (_elm_config->atspi_mode) 663 if (_elm_config->atspi_mode)
665 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE); 664 elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
666} 665}
@@ -1159,8 +1158,8 @@ _item_select(Elm_Toolbar_Item_Data *it)
1159 { 1158 {
1160 if (it->func) it->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(it))), WIDGET(it), EO_OBJ(it)); 1159 if (it->func) it->func((void *)(WIDGET_ITEM_DATA_GET(EO_OBJ(it))), WIDGET(it), EO_OBJ(it));
1161 } 1160 }
1162 evas_object_smart_callback_call(obj, SIG_CLICKED, EO_OBJ(it)); 1161 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_CLICKED, EO_OBJ(it)));
1163 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it)); 1162 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SELECTED, EO_OBJ(it)));
1164} 1163}
1165 1164
1166static void 1165static void
@@ -2057,7 +2056,7 @@ _long_press_cb(void *data)
2057 if (sd->reorder_mode) 2056 if (sd->reorder_mode)
2058 _item_reorder_start(it); 2057 _item_reorder_start(it);
2059 2058
2060 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, EO_OBJ(it)); 2059 eo_do(WIDGET(it), eo_event_callback_call(ELM_TOOLBAR_EVENT_LONGPRESSED, EO_OBJ(it)));
2061 2060
2062 return ECORE_CALLBACK_CANCEL; 2061 return ECORE_CALLBACK_CANCEL;
2063} 2062}
@@ -2090,7 +2089,7 @@ _mouse_down_cb(Elm_Toolbar_Item_Data *it,
2090 2089
2091 if (ev->button != 1) return; 2090 if (ev->button != 1) return;
2092 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 2091 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
2093 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, EO_OBJ(it)); 2092 eo_do(WIDGET(it), eo_event_callback_call(ELM_TOOLBAR_EVENT_CLICKED_DOUBLE, EO_OBJ(it)));
2094 sd->mouse_down = EINA_TRUE; 2093 sd->mouse_down = EINA_TRUE;
2095 sd->long_press = EINA_FALSE; 2094 sd->long_press = EINA_FALSE;
2096 if (sd->long_timer) 2095 if (sd->long_timer)
@@ -2157,21 +2156,21 @@ static void
2157_scroll_cb(Evas_Object *obj, 2156_scroll_cb(Evas_Object *obj,
2158 void *data EINA_UNUSED) 2157 void *data EINA_UNUSED)
2159{ 2158{
2160 evas_object_smart_callback_call(obj, SIG_SCROLL, NULL); 2159 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SCROLL, NULL));
2161} 2160}
2162 2161
2163static void 2162static void
2164_scroll_anim_start_cb(Evas_Object *obj, 2163_scroll_anim_start_cb(Evas_Object *obj,
2165 void *data EINA_UNUSED) 2164 void *data EINA_UNUSED)
2166{ 2165{
2167 evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_START, NULL); 2166 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SCROLL_ANIM_START, NULL));
2168} 2167}
2169 2168
2170static void 2169static void
2171_scroll_anim_stop_cb(Evas_Object *obj, 2170_scroll_anim_stop_cb(Evas_Object *obj,
2172 void *data EINA_UNUSED) 2171 void *data EINA_UNUSED)
2173{ 2172{
2174 evas_object_smart_callback_call(obj, SIG_SCROLL_ANIM_STOP, NULL); 2173 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SCROLL_ANIM_STOP, NULL));
2175} 2174}
2176 2175
2177static void 2176static void
@@ -2181,14 +2180,14 @@ _scroll_drag_start_cb(Evas_Object *obj,
2181 ELM_TOOLBAR_DATA_GET(obj, sd); 2180 ELM_TOOLBAR_DATA_GET(obj, sd);
2182 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del); 2181 ELM_SAFE_FREE(sd->long_timer, ecore_timer_del);
2183 2182
2184 evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_START, NULL); 2183 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SCROLL_DRAG_START, NULL));
2185} 2184}
2186 2185
2187static void 2186static void
2188_scroll_drag_stop_cb(Evas_Object *obj, 2187_scroll_drag_stop_cb(Evas_Object *obj,
2189 void *data EINA_UNUSED) 2188 void *data EINA_UNUSED)
2190{ 2189{
2191 evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_STOP, NULL); 2190 eo_do(obj, eo_event_callback_call(ELM_TOOLBAR_EVENT_SCROLL_DRAG_STOP, NULL));
2192} 2191}
2193 2192
2194static void 2193static void
@@ -3828,99 +3827,5 @@ _elm_toolbar_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Toolbar_D
3828 return ret; 3827 return ret;
3829} 3828}
3830 3829
3831EOLIAN int
3832_elm_toolbar_elm_interface_atspi_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
3833{
3834 return pd->selected_item ? 1 : 0;
3835}
3836
3837EOLIAN Eo*
3838_elm_toolbar_elm_interface_atspi_selection_selected_child_get(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_idx)
3839{
3840 if (child_idx != 0)
3841 return NULL;
3842
3843 return pd->selected_item;
3844}
3845
3846EOLIAN Eina_Bool
3847_elm_toolbar_elm_interface_atspi_selection_child_select(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_index)
3848{
3849 Elm_Toolbar_Item_Data *item;
3850 if (pd->select_mode != ELM_OBJECT_SELECT_MODE_NONE)
3851 {
3852 EINA_INLIST_FOREACH(pd->items, item)
3853 {
3854 if (child_index-- == 0)
3855 {
3856 elm_toolbar_item_selected_set(EO_OBJ(item), EINA_TRUE);
3857 return EINA_TRUE;
3858 }
3859 }
3860 }
3861 return EINA_FALSE;
3862}
3863
3864EOLIAN Eina_Bool
3865_elm_toolbar_elm_interface_atspi_selection_selected_child_deselect(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_index)
3866{
3867 if (child_index != 0)
3868 return EINA_FALSE;
3869
3870 if (!pd->selected_item)
3871 return EINA_FALSE;
3872
3873 elm_toolbar_item_selected_set(pd->selected_item, EINA_FALSE);
3874
3875 return EINA_TRUE;
3876}
3877
3878EOLIAN Eina_Bool
3879_elm_toolbar_elm_interface_atspi_selection_is_child_selected(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_index)
3880{
3881 Elm_Toolbar_Item_Data *item;
3882
3883 EINA_INLIST_FOREACH(pd->items, item)
3884 {
3885 if (child_index-- == 0)
3886 {
3887 return elm_toolbar_item_selected_get(EO_OBJ(item));
3888 }
3889 }
3890 return EINA_FALSE;
3891}
3892
3893EOLIAN Eina_Bool
3894_elm_toolbar_elm_interface_atspi_selection_all_children_select(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd EINA_UNUSED)
3895{
3896 return EINA_FALSE;
3897}
3898
3899EOLIAN Eina_Bool
3900_elm_toolbar_elm_interface_atspi_selection_clear(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd)
3901{
3902 if (pd->selected_item)
3903 elm_toolbar_item_selected_set(pd->selected_item, EINA_FALSE);
3904 return EINA_TRUE;
3905}
3906
3907EOLIAN Eina_Bool
3908_elm_toolbar_elm_interface_atspi_selection_child_deselect(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *pd, int child_index)
3909{
3910 Elm_Toolbar_Item_Data *item;
3911 if (pd->select_mode != ELM_OBJECT_SELECT_MODE_NONE)
3912 {
3913 EINA_INLIST_FOREACH(pd->items, item)
3914 {
3915 if (child_index-- == 0)
3916 {
3917 elm_toolbar_item_selected_set(EO_OBJ(item), EINA_FALSE);
3918 return EINA_TRUE;
3919 }
3920 }
3921 }
3922 return EINA_FALSE;
3923}
3924
3925#include "elm_toolbar.eo.c" 3830#include "elm_toolbar.eo.c"
3926#include "elm_toolbar_item.eo.c" 3831#include "elm_toolbar_item.eo.c"
diff --git a/src/lib/elm_toolbar.eo b/src/lib/elm_toolbar.eo
index c3be0b48c..51fb78639 100644
--- a/src/lib/elm_toolbar.eo
+++ b/src/lib/elm_toolbar.eo
@@ -24,7 +24,7 @@ enum Elm.Toolbar.Shrink_Mode
24} 24}
25 25
26class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable, 26class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable,
27 Elm_Interface_Atspi_Widget_Action, Elm_Interface_Atspi_Selection) 27 Elm_Interface_Atspi_Widget_Action)
28{ 28{
29 eo_prefix: elm_obj_toolbar; 29 eo_prefix: elm_obj_toolbar;
30 methods { 30 methods {
@@ -539,14 +539,6 @@ class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable,
539 Elm_Interface_Atspi_Widget_Action.elm_actions.get; 539 Elm_Interface_Atspi_Widget_Action.elm_actions.get;
540 Elm_Interface_Atspi_Accessible.children.get; 540 Elm_Interface_Atspi_Accessible.children.get;
541 Elm_Interface_Atspi_Accessible.state_set.get; 541 Elm_Interface_Atspi_Accessible.state_set.get;
542 Elm_Interface_Atspi_Selection.selected_children_count.get;
543 Elm_Interface_Atspi_Selection.selected_child.get;
544 Elm_Interface_Atspi_Selection.selected_child_deselect;
545 Elm_Interface_Atspi_Selection.child_select;
546 Elm_Interface_Atspi_Selection.child_deselect;
547 Elm_Interface_Atspi_Selection.is_child_selected;
548 Elm_Interface_Atspi_Selection.all_children_select;
549 Elm_Interface_Atspi_Selection.clear;
550 } 542 }
551 events { 543 events {
552 scroll; 544 scroll;
@@ -563,6 +555,8 @@ class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable,
563 access,changed; 555 access,changed;
564 focused; 556 focused;
565 unfocused; 557 unfocused;
558 item,focused;
559 item,unfocused;
566 } 560 }
567 561
568} 562}