summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2012-11-26 06:32:53 +0000
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2012-11-26 06:32:53 +0000
commitdc95ebf215507dbd00827ec839f531a5c4ef84d2 (patch)
tree40045f518375665f2c3cc0ea66073d680ac76465
parent48a8540724f5a76cebede524a8f37fc412c0ed1a (diff)
downloadelementary-dc95ebf215507dbd00827ec839f531a5c4ef84d2.tar.gz
We have ported to Eo all the widgets of elementary. We didn't change the inheritance itself, only the mechanism, as done previously in Evas, Ecore and Edje. We removed totally the previous inheritance mechanism.
Signed-off-by: Yakov Goldberg <yakov.g@samsung.com> Signed-off-by: Daniel Zaoui <daniel.zaoui@samsung.com> SVN revision: 79668
-rw-r--r--AUTHORS2
-rw-r--r--NEWS1
-rw-r--r--src/lib/elc_ctxpopup.c499
-rw-r--r--src/lib/elc_ctxpopup.h153
-rw-r--r--src/lib/elc_fileselector.c363
-rw-r--r--src/lib/elc_fileselector.h206
-rw-r--r--src/lib/elc_fileselector_button.c319
-rw-r--r--src/lib/elc_fileselector_button.h209
-rw-r--r--src/lib/elc_fileselector_entry.c524
-rw-r--r--src/lib/elc_fileselector_entry.h233
-rw-r--r--src/lib/elc_hoversel.c275
-rw-r--r--src/lib/elc_hoversel.h148
-rw-r--r--src/lib/elc_multibuttonentry.c554
-rw-r--r--src/lib/elc_multibuttonentry.h250
-rw-r--r--src/lib/elc_naviframe.c520
-rw-r--r--src/lib/elc_naviframe.h213
-rw-r--r--src/lib/elc_player.c199
-rw-r--r--src/lib/elc_popup.c508
-rw-r--r--src/lib/elc_popup.h135
-rw-r--r--src/lib/elm_access.c95
-rw-r--r--src/lib/elm_actionslider.c312
-rw-r--r--src/lib/elm_actionslider.h109
-rw-r--r--src/lib/elm_bg.c215
-rw-r--r--src/lib/elm_bg.h115
-rw-r--r--src/lib/elm_box.c495
-rw-r--r--src/lib/elm_box.h254
-rw-r--r--src/lib/elm_bubble.c245
-rw-r--r--src/lib/elm_bubble.h41
-rw-r--r--src/lib/elm_button.c343
-rw-r--r--src/lib/elm_button.h94
-rw-r--r--src/lib/elm_calendar.c509
-rw-r--r--src/lib/elm_calendar.h283
-rw-r--r--src/lib/elm_check.c285
-rw-r--r--src/lib/elm_check.h53
-rw-r--r--src/lib/elm_clock.c357
-rw-r--r--src/lib/elm_clock.h179
-rw-r--r--src/lib/elm_colorselector.c369
-rw-r--r--src/lib/elm_colorselector.h127
-rw-r--r--src/lib/elm_conform.c131
-rw-r--r--src/lib/elm_conform.h11
-rw-r--r--src/lib/elm_container.c78
-rw-r--r--src/lib/elm_datetime.c409
-rw-r--r--src/lib/elm_datetime.h181
-rw-r--r--src/lib/elm_dayselector.c328
-rw-r--r--src/lib/elm_dayselector.h120
-rw-r--r--src/lib/elm_diskselector.c579
-rw-r--r--src/lib/elm_diskselector.h173
-rw-r--r--src/lib/elm_entry.c1613
-rw-r--r--src/lib/elm_entry.h1124
-rw-r--r--src/lib/elm_flip.c436
-rw-r--r--src/lib/elm_flip.h139
-rw-r--r--src/lib/elm_flipselector.c375
-rw-r--r--src/lib/elm_flipselector.h151
-rw-r--r--src/lib/elm_frame.c261
-rw-r--r--src/lib/elm_frame.h79
-rw-r--r--src/lib/elm_gengrid.c1133
-rw-r--r--src/lib/elm_gengrid.h601
-rw-r--r--src/lib/elm_genlist.c1340
-rw-r--r--src/lib/elm_genlist.h507
-rw-r--r--src/lib/elm_gesture_layer.c214
-rw-r--r--src/lib/elm_gesture_layer.h124
-rw-r--r--src/lib/elm_glview.c316
-rw-r--r--src/lib/elm_glview.h161
-rw-r--r--src/lib/elm_grid.c303
-rw-r--r--src/lib/elm_grid.h100
-rw-r--r--src/lib/elm_hover.c415
-rw-r--r--src/lib/elm_hover.h67
-rw-r--r--src/lib/elm_icon.c361
-rw-r--r--src/lib/elm_icon.h82
-rw-r--r--src/lib/elm_image.c878
-rw-r--r--src/lib/elm_image.h392
-rw-r--r--src/lib/elm_index.c529
-rw-r--r--src/lib/elm_index.h254
-rw-r--r--src/lib/elm_interface_scrollable.c1112
-rw-r--r--src/lib/elm_interface_scrollable.h457
-rw-r--r--src/lib/elm_inwin.c163
-rw-r--r--src/lib/elm_inwin.h16
-rw-r--r--src/lib/elm_label.c348
-rw-r--r--src/lib/elm_label.h143
-rw-r--r--src/lib/elm_layout.c1402
-rw-r--r--src/lib/elm_layout.h439
-rw-r--r--src/lib/elm_list.c784
-rw-r--r--src/lib/elm_list.h330
-rw-r--r--src/lib/elm_map.c1411
-rw-r--r--src/lib/elm_map.h557
-rw-r--r--src/lib/elm_mapbuf.c303
-rw-r--r--src/lib/elm_mapbuf.h91
-rw-r--r--src/lib/elm_menu.c333
-rw-r--r--src/lib/elm_menu.h124
-rw-r--r--src/lib/elm_notify.c403
-rw-r--r--src/lib/elm_notify.h70
-rw-r--r--src/lib/elm_panel.c346
-rw-r--r--src/lib/elm_panel.h81
-rw-r--r--src/lib/elm_panes.c290
-rw-r--r--src/lib/elm_panes.h117
-rw-r--r--src/lib/elm_photo.c236
-rw-r--r--src/lib/elm_photo.h119
-rw-r--r--src/lib/elm_photocam.c732
-rw-r--r--src/lib/elm_photocam.h208
-rw-r--r--src/lib/elm_plug.c149
-rw-r--r--src/lib/elm_plug.h42
-rw-r--r--src/lib/elm_progressbar.c398
-rw-r--r--src/lib/elm_progressbar.h204
-rw-r--r--src/lib/elm_radio.c334
-rw-r--r--src/lib/elm_radio.h105
-rw-r--r--src/lib/elm_route.c162
-rw-r--r--src/lib/elm_route.h44
-rw-r--r--src/lib/elm_scroller.c585
-rw-r--r--src/lib/elm_scroller.h98
-rw-r--r--src/lib/elm_segment_control.c396
-rw-r--r--src/lib/elm_segment_control.h126
-rw-r--r--src/lib/elm_separator.c166
-rw-r--r--src/lib/elm_separator.h40
-rw-r--r--src/lib/elm_slider.c478
-rw-r--r--src/lib/elm_slider.h257
-rw-r--r--src/lib/elm_slideshow.c492
-rw-r--r--src/lib/elm_slideshow.h329
-rw-r--r--src/lib/elm_spinner.c490
-rw-r--r--src/lib/elm_spinner.h263
-rw-r--r--src/lib/elm_table.c360
-rw-r--r--src/lib/elm_table.h146
-rw-r--r--src/lib/elm_thumb.c280
-rw-r--r--src/lib/elm_thumb.h121
-rw-r--r--src/lib/elm_toolbar.c802
-rw-r--r--src/lib/elm_toolbar.h378
-rw-r--r--src/lib/elm_video.c488
-rw-r--r--src/lib/elm_video.h254
-rw-r--r--src/lib/elm_web.c1008
-rw-r--r--src/lib/elm_web.h617
-rw-r--r--src/lib/elm_web2.c869
-rw-r--r--src/lib/elm_widget.c2115
-rw-r--r--src/lib/elm_widget.h387
-rw-r--r--src/lib/elm_widget_actionslider.h115
-rw-r--r--src/lib/elm_widget_bg.h115
-rw-r--r--src/lib/elm_widget_box.h115
-rw-r--r--src/lib/elm_widget_bubble.h113
-rw-r--r--src/lib/elm_widget_button.h115
-rw-r--r--src/lib/elm_widget_calendar.h134
-rw-r--r--src/lib/elm_widget_check.h115
-rw-r--r--src/lib/elm_widget_clock.h115
-rw-r--r--src/lib/elm_widget_colorselector.h114
-rw-r--r--src/lib/elm_widget_conform.h114
-rw-r--r--src/lib/elm_widget_container.h108
-rw-r--r--src/lib/elm_widget_ctxpopup.h111
-rw-r--r--src/lib/elm_widget_datetime.h113
-rw-r--r--src/lib/elm_widget_dayselector.h116
-rw-r--r--src/lib/elm_widget_diskselector.h122
-rw-r--r--src/lib/elm_widget_entry.h114
-rw-r--r--src/lib/elm_widget_fileselector.h114
-rw-r--r--src/lib/elm_widget_fileselector_button.h120
-rw-r--r--src/lib/elm_widget_fileselector_entry.h116
-rw-r--r--src/lib/elm_widget_flip.h114
-rw-r--r--src/lib/elm_widget_flipselector.h116
-rw-r--r--src/lib/elm_widget_frame.h115
-rw-r--r--src/lib/elm_widget_gengrid.h133
-rw-r--r--src/lib/elm_widget_genlist.h133
-rw-r--r--src/lib/elm_widget_glview.h115
-rw-r--r--src/lib/elm_widget_grid.h142
-rw-r--r--src/lib/elm_widget_hover.h113
-rw-r--r--src/lib/elm_widget_hoversel.h113
-rw-r--r--src/lib/elm_widget_icon.h109
-rw-r--r--src/lib/elm_widget_image.h166
-rw-r--r--src/lib/elm_widget_index.h113
-rw-r--r--src/lib/elm_widget_inwin.h114
-rw-r--r--src/lib/elm_widget_label.h128
-rw-r--r--src/lib/elm_widget_layout.h190
-rw-r--r--src/lib/elm_widget_list.h115
-rw-r--r--src/lib/elm_widget_map.h126
-rw-r--r--src/lib/elm_widget_mapbuf.h112
-rw-r--r--src/lib/elm_widget_menu.h113
-rw-r--r--src/lib/elm_widget_multibuttonentry.h114
-rw-r--r--src/lib/elm_widget_naviframe.h113
-rw-r--r--src/lib/elm_widget_notify.h110
-rw-r--r--src/lib/elm_widget_panel.h113
-rw-r--r--src/lib/elm_widget_panes.h114
-rw-r--r--src/lib/elm_widget_photo.h111
-rw-r--r--src/lib/elm_widget_photocam.h127
-rw-r--r--src/lib/elm_widget_player.h113
-rw-r--r--src/lib/elm_widget_plug.h120
-rw-r--r--src/lib/elm_widget_popup.h111
-rw-r--r--src/lib/elm_widget_progressbar.h113
-rw-r--r--src/lib/elm_widget_radio.h113
-rw-r--r--src/lib/elm_widget_route.h111
-rw-r--r--src/lib/elm_widget_scroller.h118
-rw-r--r--src/lib/elm_widget_segment_control.h118
-rw-r--r--src/lib/elm_widget_separator.h113
-rw-r--r--src/lib/elm_widget_slider.h113
-rw-r--r--src/lib/elm_widget_slideshow.h113
-rw-r--r--src/lib/elm_widget_spinner.h113
-rw-r--r--src/lib/elm_widget_table.h141
-rw-r--r--src/lib/elm_widget_thumb.h112
-rw-r--r--src/lib/elm_widget_toolbar.h117
-rw-r--r--src/lib/elm_widget_video.h113
-rw-r--r--src/lib/elm_widget_web.h112
-rw-r--r--src/lib/elm_win.c1436
-rw-r--r--src/lib/elm_win.h1133
-rw-r--r--src/modules/datetime_input_ctxpopup/Makefile.am1
197 files changed, 39101 insertions, 18168 deletions
diff --git a/AUTHORS b/AUTHORS
index 0d8381a5c..04be50a2c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -67,3 +67,5 @@ Flavio Ceolin <flavio.ceolin@profusion.mobi>
Igor Murzov <e-mail@date.by>
Jiyoun Park <jy0703.park@samsung.com>
KoziarekBeata <b.koziarek@samsung.com>
+Daniel Zaoui <daniel.zaoui@samsung.com>
+Yakov Goldberg <yakov.g@samsung.com>
diff --git a/NEWS b/NEWS
index 3a08f278a..ecd4e9a48 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes since Elementary 1.7.0:
Additions:
+ * Porting to Eo
* Add ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN.
* Add elementary_codegen
* Add window floating mode api's
diff --git a/src/lib/elc_ctxpopup.c b/src/lib/elc_ctxpopup.c
index 1dae7ee6e..c72381495 100644
--- a/src/lib/elc_ctxpopup.c
+++ b/src/lib/elc_ctxpopup.c
@@ -2,6 +2,14 @@
#include "elm_priv.h"
#include "elm_widget_ctxpopup.h"
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_CTXPOPUP_CLASS
+
+#define MY_CLASS_NAME "elm_ctxpopup"
+
EAPI const char ELM_CTXPOPUP_SMART_NAME[] = "elm_ctxpopup";
static const char SIG_DISMISSED[] = "dismissed";
@@ -10,18 +18,33 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_CTXPOPUP_SMART_NAME, _elm_ctxpopup, Elm_Ctxpopup_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-static Eina_Bool
-_elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+
+static void
+_elm_ctxpopup_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_ctxpopup_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_ctxpopup_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
if (!sd)
- return EINA_FALSE;
+ return;
if (!elm_widget_focus_next_get(sd->box, dir, next))
{
@@ -29,22 +52,26 @@ _elm_ctxpopup_smart_focus_next(const Evas_Object *obj,
elm_widget_focus_next_get(sd->box, dir, next);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_ctxpopup_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_ctxpopup_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void)src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (!strcmp(ev->keyname, "Tab"))
{
@@ -52,14 +79,15 @@ _elm_ctxpopup_smart_event(Evas_Object *obj,
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
else
elm_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- if (strcmp(ev->keyname, "Escape")) return EINA_FALSE;
+ if (strcmp(ev->keyname, "Escape")) return;
evas_object_hide(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -115,6 +143,7 @@ _base_geometry_calc(Evas_Object *obj,
int idx;
ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!rect) return ELM_CTXPOPUP_DIRECTION_DOWN;
@@ -131,8 +160,8 @@ _base_geometry_calc(Evas_Object *obj,
//recalc the edje
edje_object_size_min_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &base_size.x, &base_size.y);
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ (wd->resize_obj, &base_size.x, &base_size.y);
+ evas_object_smart_calculate(wd->resize_obj);
//Limit to Max Size
evas_object_size_hint_max_get(obj, &max_size.x, &max_size.y);
@@ -288,6 +317,7 @@ _arrow_update(Evas_Object *obj,
double drag;
ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
evas_object_geometry_get
@@ -301,7 +331,7 @@ _arrow_update(Evas_Object *obj,
case ELM_CTXPOPUP_DIRECTION_RIGHT:
edje_object_signal_emit(sd->arrow, "elm,state,left", "elm");
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
"elm.swallow.arrow_left"), sd->arrow);
@@ -315,7 +345,7 @@ _arrow_update(Evas_Object *obj,
y = y - base_size.y - (arrow_size.h * 0.5);
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_right" :
"elm.swallow.arrow_left"), 1, drag);
}
@@ -324,7 +354,7 @@ _arrow_update(Evas_Object *obj,
case ELM_CTXPOPUP_DIRECTION_LEFT:
edje_object_signal_emit(sd->arrow, "elm,state,right", "elm");
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
"elm.swallow.arrow_right"), sd->arrow);
@@ -338,7 +368,7 @@ _arrow_update(Evas_Object *obj,
y = y - base_size.y - (arrow_size.h * 0.5);
drag = (double)(y) / (double)(base_size.h - arrow_size.h);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
(elm_widget_mirrored_get(obj) ? "elm.swallow.arrow_left" :
"elm.swallow.arrow_right"), 0, drag);
}
@@ -347,7 +377,7 @@ _arrow_update(Evas_Object *obj,
case ELM_CTXPOPUP_DIRECTION_DOWN:
edje_object_signal_emit(sd->arrow, "elm,state,top", "elm");
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up",
+ (wd->resize_obj, "elm.swallow.arrow_up",
sd->arrow);
if (base_size.w > 0)
@@ -360,7 +390,7 @@ _arrow_update(Evas_Object *obj,
x = x - base_size.x - (arrow_size.w * 0.5);
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_up", drag,
+ (wd->resize_obj, "elm.swallow.arrow_up", drag,
1);
}
break;
@@ -368,7 +398,7 @@ _arrow_update(Evas_Object *obj,
case ELM_CTXPOPUP_DIRECTION_UP:
edje_object_signal_emit(sd->arrow, "elm,state,bottom", "elm");
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down",
+ (wd->resize_obj, "elm.swallow.arrow_down",
sd->arrow);
if (base_size.w > 0)
@@ -380,7 +410,7 @@ _arrow_update(Evas_Object *obj,
else x = x - base_size.x - (arrow_size.w * 0.5);
drag = (double)(x) / (double)(base_size.w - arrow_size.w);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.arrow_down",
+ (wd->resize_obj, "elm.swallow.arrow_down",
drag, 0);
}
break;
@@ -390,7 +420,7 @@ _arrow_update(Evas_Object *obj,
}
//should be here for getting accurate geometry value
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_calculate(wd->resize_obj);
}
static void
@@ -500,32 +530,33 @@ _base_shift_by_arrow(Evas_Object *arrow,
}
}
-static Eina_Bool
-_elm_ctxpopup_smart_sub_object_add(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_ctxpopup_smart_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- Elm_Widget_Smart_Class *parent_parent;
+ Eina_Bool *enable = va_arg(*list, Eina_Bool *);
+ *enable = EINA_FALSE;
+}
- parent_parent = (Elm_Widget_Smart_Class *)((Evas_Smart_Class *)
- _elm_ctxpopup_parent_sc)->parent;
+static void
+_elm_ctxpopup_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
- /* skipping layout's code, which registers size hint changing
- * callback on sub objects. a hack to make ctxpopup live, as it is,
- * on the new classing schema. this widget needs a total
- * rewrite. */
- if (!parent_parent->sub_object_add(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
- return EINA_TRUE;
+ if (ret) *ret = int_ret;
}
static void
-_elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
+_elm_ctxpopup_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord_Rectangle rect = { 0, 0, 1, 1 };
Evas_Coord_Point list_size = { 0, 0 };
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->arrow) return; /* simple way to flag "under deletion" */
@@ -547,8 +578,8 @@ _elm_ctxpopup_smart_sizing_eval(Evas_Object *obj)
}
}
- evas_object_move(ELM_WIDGET_DATA(sd)->resize_obj, rect.x, rect.y);
- evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, rect.w, rect.h);
+ evas_object_move(wd->resize_obj, rect.x, rect.y);
+ evas_object_resize(wd->resize_obj, rect.w, rect.h);
_show_signals_emit(obj, sd->dir);
}
@@ -616,13 +647,17 @@ _on_content_resized(void *data,
}
//FIXME: lost the content size when theme hook is called.
-static Eina_Bool
-_elm_ctxpopup_smart_theme(Evas_Object *obj)
+static void
+_elm_ctxpopup_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool int_ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
elm_widget_theme_object_set
(obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));
@@ -641,27 +676,35 @@ _elm_ctxpopup_smart_theme(Evas_Object *obj)
if (sd->visible) elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* kind of a big and tricky override here: an internal box will hold
* the actual content. content aliases won't be of much help here */
-static Eina_Bool
-_elm_ctxpopup_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_ctxpopup_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord min_w = -1, min_h = -1;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_TRUE;
if ((part) && (strcmp(part, "default")))
- return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set
- (obj, part, content);
+ {
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ goto end;
+ }
- if (!content) return EINA_FALSE;
+ if (!content)
+ {
+ int_ret = EINA_FALSE;
+ goto end;
+ }
- if (content == sd->content) return EINA_TRUE;
+ if (content == sd->content) goto end;
if (sd->content) evas_object_del(sd->content);
if (sd->content == sd->list) sd->list = NULL;
@@ -683,43 +726,53 @@ _elm_ctxpopup_smart_content_set(Evas_Object *obj,
if (sd->visible) elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+end:
+ if (ret) *ret = int_ret;
}
-static Evas_Object *
-_elm_ctxpopup_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_ctxpopup_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
if ((part) && (strcmp(part, "default")))
- return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_get
- (obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_get(part, ret));
+ return;
+ }
- return sd->content;
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+
+ *ret = sd->content;
}
-static Evas_Object *
-_elm_ctxpopup_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_ctxpopup_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *content;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
if ((part) && (strcmp(part, "default")))
- return ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_unset
- (obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_unset(part, &content));
+ goto end;
+ }
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
content = sd->content;
- if (!content) return NULL;
+ if (!content) goto end;
sd->content = NULL;
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
if (sd->visible) elm_layout_sizing_eval(obj);
- return content;
+end:
+ if (ret) *ret = content;
}
static void
@@ -962,25 +1015,29 @@ _item_del_pre_hook(Elm_Object_Item *it)
return EINA_TRUE;
}
-static Eina_Bool
-_elm_ctxpopup_smart_disable(Evas_Object *obj)
+static void
+_elm_ctxpopup_smart_disable(Eo *obj, void *_pd, va_list *list)
{
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->disable(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_disable(&int_ret));
+ if (!int_ret) return;
elm_object_disabled_set(sd->list, elm_widget_disabled_get(obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_ctxpopup_smart_add(Evas_Object *obj)
+_elm_ctxpopup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Ctxpopup_Smart_Data);
+ Elm_Ctxpopup_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "ctxpopup", "base", elm_widget_style_get(obj));
elm_layout_signal_callback_add
@@ -1016,8 +1073,8 @@ _elm_ctxpopup_smart_add(Evas_Object *obj)
(priv->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
/* box will be our content placeholder, thus the parent's version call */
- ELM_CONTAINER_CLASS(_elm_ctxpopup_parent_sc)->content_set
- (obj, "elm.swallow.content", priv->box);
+ Eina_Bool ret;
+ eo_do_super(obj, elm_obj_container_content_set("elm.swallow.content", priv->box, &ret));
evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
@@ -1027,9 +1084,9 @@ _elm_ctxpopup_smart_add(Evas_Object *obj)
}
static void
-_elm_ctxpopup_smart_del(Evas_Object *obj)
+_elm_ctxpopup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
evas_object_event_callback_del_full
(sd->box, EVAS_CALLBACK_RESIZE, _on_content_resized, obj);
@@ -1042,80 +1099,53 @@ _elm_ctxpopup_smart_del(Evas_Object *obj)
evas_object_del(sd->bg);
sd->bg = NULL;
- ELM_WIDGET_CLASS(_elm_ctxpopup_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_ctxpopup_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_ctxpopup_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
//default parent is to be hover parent
elm_ctxpopup_hover_parent_set(obj, parent);
}
-static void
-_elm_ctxpopup_smart_set_user(Elm_Ctxpopup_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_ctxpopup_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_ctxpopup_smart_del;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_ctxpopup_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->disable = _elm_ctxpopup_smart_disable;
- ELM_WIDGET_CLASS(sc)->event = _elm_ctxpopup_smart_event;
- ELM_WIDGET_CLASS(sc)->theme = _elm_ctxpopup_smart_theme;
- ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_ctxpopup_smart_sub_object_add;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_ctxpopup_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_ctxpopup_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_ctxpopup_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_ctxpopup_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_ctxpopup_smart_sizing_eval;
-}
-
-EAPI const Elm_Ctxpopup_Smart_Class *
-elm_ctxpopup_smart_class_get(void)
-{
- static Elm_Ctxpopup_Smart_Class _sc =
- ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION(ELM_CTXPOPUP_SMART_NAME);
- static const Elm_Ctxpopup_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_ctxpopup_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_ctxpopup_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_ctxpopup_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
elm_ctxpopup_hover_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
+ ELM_CTXPOPUP_CHECK(obj);
+ eo_do(obj, elm_obj_ctxpopup_hover_parent_set(parent));
+}
+
+static void
+_hover_parent_set(Eo *obj, void *_pd, va_list *list)
+{
Evas_Coord x, y, w, h;
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
- ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
if (!parent) return;
@@ -1142,16 +1172,30 @@ EAPI Evas_Object *
elm_ctxpopup_hover_parent_get(const Evas_Object *obj)
{
ELM_CTXPOPUP_CHECK(obj) NULL;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_ctxpopup_hover_parent_get(&ret));
+ return ret;
+}
- return sd->parent;
+static void
+_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+ *ret = sd->parent;
}
EAPI void
elm_ctxpopup_clear(Evas_Object *obj)
{
ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_ctxpopup_clear());
+}
+
+static void
+_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
_list_del(sd);
sd->dir = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
@@ -1162,7 +1206,14 @@ elm_ctxpopup_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_ctxpopup_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
sd->horizontal = !!horizontal;
@@ -1179,9 +1230,18 @@ EAPI Eina_Bool
elm_ctxpopup_horizontal_get(const Evas_Object *obj)
{
ELM_CTXPOPUP_CHECK(obj) EINA_FALSE;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_ctxpopup_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+
+ *ret = sd->horizontal;
}
EAPI Elm_Object_Item *
@@ -1191,13 +1251,29 @@ elm_ctxpopup_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
- Elm_Ctxpopup_Item *item;
ELM_CTXPOPUP_CHECK(obj) NULL;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_ctxpopup_item_append(label, icon, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ Elm_Ctxpopup_Item *item;
+
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
item = elm_widget_item_new(obj, Elm_Ctxpopup_Item);
- if (!item) return NULL;
+ if (!item) return;
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
elm_widget_item_disable_hook_set(item, _item_disable_hook);
@@ -1225,7 +1301,7 @@ elm_ctxpopup_item_append(Evas_Object *obj,
if (sd->visible) elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
@@ -1236,7 +1312,18 @@ elm_ctxpopup_direction_priority_set(Evas_Object *obj,
Elm_Ctxpopup_Direction fourth)
{
ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_ctxpopup_direction_priority_set(first, second, third, fourth));
+}
+
+static void
+_direction_priority_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Ctxpopup_Direction first = va_arg(*list, Elm_Ctxpopup_Direction);
+ Elm_Ctxpopup_Direction second = va_arg(*list, Elm_Ctxpopup_Direction);
+ Elm_Ctxpopup_Direction third = va_arg(*list, Elm_Ctxpopup_Direction);
+ Elm_Ctxpopup_Direction fourth = va_arg(*list, Elm_Ctxpopup_Direction);
+
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
sd->dir_priority[0] = first;
sd->dir_priority[1] = second;
@@ -1254,7 +1341,18 @@ elm_ctxpopup_direction_priority_get(Evas_Object *obj,
Elm_Ctxpopup_Direction *fourth)
{
ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_ctxpopup_direction_priority_get(first, second, third, fourth));
+}
+
+static void
+_direction_priority_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Ctxpopup_Direction *first = va_arg(*list, Elm_Ctxpopup_Direction *);
+ Elm_Ctxpopup_Direction *second = va_arg(*list, Elm_Ctxpopup_Direction *);
+ Elm_Ctxpopup_Direction *third = va_arg(*list, Elm_Ctxpopup_Direction *);
+ Elm_Ctxpopup_Direction *fourth = va_arg(*list, Elm_Ctxpopup_Direction *);
+
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
if (first) *first = sd->dir_priority[0];
if (second) *second = sd->dir_priority[1];
@@ -1266,16 +1364,95 @@ EAPI Elm_Ctxpopup_Direction
elm_ctxpopup_direction_get(const Evas_Object *obj)
{
ELM_CTXPOPUP_CHECK(obj) ELM_CTXPOPUP_DIRECTION_UNKNOWN;
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ Elm_Ctxpopup_Direction ret = ELM_CTXPOPUP_DIRECTION_UNKNOWN;
+ eo_do((Eo *) obj, elm_obj_ctxpopup_direction_get(&ret));
+ return ret;
+}
- return sd->dir;
+static void
+_direction_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Ctxpopup_Direction *ret = va_arg(*list, Elm_Ctxpopup_Direction *);
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
+
+ *ret = sd->dir;
}
EAPI void
elm_ctxpopup_dismiss(Evas_Object *obj)
{
ELM_CTXPOPUP_CHECK(obj);
- ELM_CTXPOPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_ctxpopup_dismiss());
+}
+
+static void
+_dismiss(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Ctxpopup_Smart_Data *sd = _pd;
_hide_signals_emit(obj, sd->dir);
}
+
+static void
+_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_ctxpopup_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_ctxpopup_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_ctxpopup_smart_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_ctxpopup_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_ctxpopup_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_ctxpopup_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_ctxpopup_smart_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_ctxpopup_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_ctxpopup_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_ctxpopup_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_ctxpopup_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_ctxpopup_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_ctxpopup_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_ctxpopup_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), _elm_ctxpopup_smart_layout_sub_object_add_enable),
+
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET), _hover_parent_set),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET), _hover_parent_get),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET), _direction_priority_set),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET), _direction_priority_get),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET), _direction_get),
+ EO_OP_FUNC(ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS), _dismiss),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET, "Set the Ctxpopup's parent."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET, "Get the Ctxpopup's parent."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR, "Clear all items in the given ctxpopup object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET, "Change the ctxpopup's orientation to horizontal or vertical."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET, "Get the value of current ctxpopup object's orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND, "Add a new item to a ctxpopup object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET, "Set the direction priority of a ctxpopup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET, "Get the direction priority of a ctxpopup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET, "Get the current direction of a ctxpopup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS, "Dismiss a ctxpopup object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CTXPOPUP_BASE_ID, op_desc, ELM_OBJ_CTXPOPUP_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Ctxpopup_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_ctxpopup_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_ctxpopup.h b/src/lib/elc_ctxpopup.h
index ce6cc7c59..fb1e5028a 100644
--- a/src/lib/elc_ctxpopup.h
+++ b/src/lib/elc_ctxpopup.h
@@ -18,7 +18,7 @@
* items have a label and/or an icon. It is intended for a small
* number of items (hence the use of list, not genlist).
*
- * This widget inherits from the @ref Layout one, so that all the
+ * This widget inherits from the Layout one, so that all the
* functions acting on it also work for context popup objects
* (@since 1.8).
*
@@ -52,6 +52,157 @@
* @{
*/
+#define ELM_OBJ_CTXPOPUP_CLASS elm_obj_ctxpopup_class_get()
+
+const Eo_Class *elm_obj_ctxpopup_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_CTXPOPUP_BASE_ID;
+
+enum
+{
+ ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR,
+ ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET,
+ ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS,
+ ELM_OBJ_CTXPOPUP_SUB_ID_LAST
+};
+
+#define ELM_OBJ_CTXPOPUP_ID(sub_id) (ELM_OBJ_CTXPOPUP_BASE_ID + sub_id)
+
+
+/**
+ * @def ctxpopup_hover_parent_set
+ * @since 1.8
+ *
+ * @brief Set the Ctxpopup's parent
+ *
+ * @param[in] parent
+ *
+ * @see elm_ctxpopup_hover_parent_set
+ */
+#define elm_obj_ctxpopup_hover_parent_set(parent) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+
+/**
+ * @def ctxpopup_hover_parent_get
+ * @since 1.8
+ *
+ * @brief Get the Ctxpopup's parent
+ *
+ * @param[out] ret
+ *
+ * @see elm_ctxpopup_hover_parent_get
+ */
+#define elm_obj_ctxpopup_hover_parent_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def ctxpopup_clear
+ * @since 1.8
+ *
+ * @brief Clear all items in the given ctxpopup object.
+ *
+ *
+ * @see elm_ctxpopup_clear
+ */
+#define elm_obj_ctxpopup_clear() ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_CLEAR)
+
+/**
+ * @def ctxpopup_horizontal_set
+ * @since 1.8
+ *
+ * @brief Change the ctxpopup's orientation to horizontal or vertical.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_ctxpopup_horizontal_set
+ */
+#define elm_obj_ctxpopup_horizontal_set(horizontal) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def ctxpopup_horizontal_get
+ * @since 1.8
+ *
+ * @brief Get the value of current ctxpopup object's orientation.
+ *
+ * @param[out] ret
+ *
+ * @see elm_ctxpopup_horizontal_get
+ */
+#define elm_obj_ctxpopup_horizontal_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def ctxpopup_item_append
+ * @since 1.8
+ *
+ * @brief Add a new item to a ctxpopup object.
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_ctxpopup_item_append
+ */
+#define elm_obj_ctxpopup_item_append(label, icon, func, data, ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def ctxpopup_direction_priority_set
+ * @since 1.8
+ *
+ * @brief Set the direction priority of a ctxpopup.
+ *
+ * @param[in] first
+ * @param[in] second
+ * @param[in] third
+ * @param[in] fourth
+ *
+ * @see elm_ctxpopup_direction_priority_set
+ */
+#define elm_obj_ctxpopup_direction_priority_set(first, second, third, fourth) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_SET), EO_TYPECHECK(Elm_Ctxpopup_Direction, first), EO_TYPECHECK(Elm_Ctxpopup_Direction, second), EO_TYPECHECK(Elm_Ctxpopup_Direction, third), EO_TYPECHECK(Elm_Ctxpopup_Direction, fourth)
+
+/**
+ * @def ctxpopup_direction_priority_get
+ * @since 1.8
+ *
+ * @brief Get the direction priority of a ctxpopup.
+ *
+ * @param[out] first
+ * @param[out] second
+ * @param[out] third
+ * @param[out] fourth
+ *
+ * @see elm_ctxpopup_direction_priority_get
+ */
+#define elm_obj_ctxpopup_direction_priority_get(first, second, third, fourth) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_PRIORITY_GET), EO_TYPECHECK(Elm_Ctxpopup_Direction *, first), EO_TYPECHECK(Elm_Ctxpopup_Direction *, second), EO_TYPECHECK(Elm_Ctxpopup_Direction *, third), EO_TYPECHECK(Elm_Ctxpopup_Direction *, fourth)
+
+/**
+ * @def ctxpopup_direction_get
+ * @since 1.8
+ *
+ * @brief Get the current direction of a ctxpopup.
+ *
+ * @param[out] ret
+ *
+ * @see elm_ctxpopup_direction_get
+ */
+#define elm_obj_ctxpopup_direction_get(ret) ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DIRECTION_GET), EO_TYPECHECK(Elm_Ctxpopup_Direction *, ret)
+
+/**
+ * @def ctxpopup_dismiss
+ * @since 1.8
+ *
+ * @brief Dismiss a ctxpopup object
+ *
+ *
+ * @see elm_ctxpopup_dismiss
+ */
+#define elm_obj_ctxpopup_dismiss() ELM_OBJ_CTXPOPUP_ID(ELM_OBJ_CTXPOPUP_SUB_ID_DISMISS)
typedef enum
{
ELM_CTXPOPUP_DIRECTION_DOWN, /**< ctxpopup show appear below clicked area */
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index bbbec7e71..2b002f249 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -14,7 +14,13 @@
#include "elm_priv.h"
#include "elm_widget_fileselector.h"
-EAPI const char ELM_FILESELECTOR_SMART_NAME[] = "elm_fileselector";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FILESELECTOR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FILESELECTOR_CLASS
+
+#define MY_CLASS_NAME "elm_fileselector"
static Elm_Genlist_Item_Class *list_itc[ELM_FILE_LAST];
static Elm_Gengrid_Item_Class *grid_itc[ELM_FILE_LAST];
@@ -29,11 +35,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FILESELECTOR_SMART_NAME, _elm_fileselector,
- Elm_Fileselector_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
/* final routine on deletion */
static void
_elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd)
@@ -42,20 +43,19 @@ _elm_fileselector_smart_del_do(Elm_Fileselector_Smart_Data *sd)
if (sd->selection) eina_stringshare_del(sd->selection);
if (sd->sel_idler) free(ecore_idler_del(sd->sel_idler));
- ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->base.del
- (ELM_WIDGET_DATA(sd)->obj);
+ eo_do_super(sd->obj, evas_obj_smart_del());
}
static void
-_elm_fileselector_smart_sizing_eval(Evas_Object *obj)
+_elm_fileselector_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
}
@@ -71,23 +71,27 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
elm_widget_mirrored_set(sd->home_button, rtl);
}
-static Eina_Bool
-_elm_fileselector_smart_theme(Evas_Object *obj)
+static void
+_elm_fileselector_smart_theme(Eo *obj, void *_pd, va_list *list)
{
const char *style;
const char *data;
char buf[1024];
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
- if (!ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
style = elm_widget_style_get(obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
data = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "path_separator");
+ (wd->resize_obj, "path_separator");
if (data) sd->path_separator = data;
else sd->path_separator = "/";
@@ -128,11 +132,11 @@ _elm_fileselector_smart_theme(Evas_Object *obj)
#undef SWALLOW
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/*** GENLIST/GENGRID "MODEL" ***/
@@ -721,16 +725,17 @@ _anchor_clicked(void *data,
}
static void
-_elm_fileselector_smart_add(Evas_Object *obj)
+_elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *ic, *bt, *li, *en, *grid, *pb;
unsigned int i;
int s;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Smart_Data);
+ Elm_Fileselector_Smart_Data *priv = _pd;
+
EINA_REFCOUNT_INIT(priv);
- ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -854,15 +859,15 @@ _elm_fileselector_smart_add(Evas_Object *obj)
elm_fileselector_buttons_ok_cancel_set(obj, EINA_TRUE);
elm_fileselector_is_save_set(obj, EINA_FALSE);
- _elm_fileselector_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
static void
-_elm_fileselector_smart_del(Evas_Object *obj)
+_elm_fileselector_smart_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
{
int i;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Fileselector_Smart_Data *sd = _pd;
for (i = 0; i < ELM_FILE_LAST; ++i)
{
@@ -881,54 +886,28 @@ _elm_fileselector_smart_del(Evas_Object *obj)
EINA_REFCOUNT_UNREF(sd) _elm_fileselector_smart_del_do(sd);
}
-static void
-_elm_fileselector_smart_set_user(Elm_Fileselector_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_smart_theme;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_fileselector_smart_sizing_eval;
-}
-
-EAPI const Elm_Fileselector_Smart_Class *
-elm_fileselector_smart_class_get(void)
-{
- static Elm_Fileselector_Smart_Class _sc =
- ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION
- (ELM_FILESELECTOR_SMART_NAME);
- static const Elm_Fileselector_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_fileselector_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_fileselector_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_fileselector_smart_class_new(), parent);
- if (!obj) return NULL;
-
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -936,7 +915,14 @@ elm_fileselector_is_save_set(Evas_Object *obj,
Eina_Bool is_save)
{
ELM_FILESELECTOR_CHECK(obj);
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_is_save_set(is_save));
+}
+
+static void
+_is_save_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool is_save = va_arg(*list, int);
+ Elm_Fileselector_Smart_Data *sd = _pd;
elm_object_disabled_set(sd->filename_entry, !is_save);
@@ -948,9 +934,17 @@ EAPI Eina_Bool
elm_fileselector_is_save_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_is_save_get(&ret));
+ return ret;
+}
- return !elm_object_disabled_get(sd->filename_entry);
+static void
+_is_save_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = !elm_object_disabled_get(sd->filename_entry);
}
EAPI void
@@ -958,7 +952,14 @@ elm_fileselector_folder_only_set(Evas_Object *obj,
Eina_Bool only)
{
ELM_FILESELECTOR_CHECK(obj);
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_folder_only_set(only));
+}
+
+static void
+_folder_only_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool only = va_arg(*list, int);
+ Elm_Fileselector_Smart_Data *sd = _pd;
if (sd->only_folder == only) return;
@@ -970,19 +971,35 @@ EAPI Eina_Bool
elm_fileselector_folder_only_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_folder_only_get(&ret));
+ return ret;
+}
- return sd->only_folder;
+static void
+_folder_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = sd->only_folder;
}
EAPI void
elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj,
Eina_Bool visible)
{
+ ELM_FILESELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_fileselector_buttons_ok_cancel_set(visible));
+}
+
+static void
+_buttons_ok_cancel_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool visible = va_arg(*list, int);
+
Evas_Object *bt;
- ELM_FILESELECTOR_CHECK(obj);
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Fileselector_Smart_Data *sd = _pd;
if (visible)
{
@@ -1004,7 +1021,7 @@ elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj,
sd->ok_button = bt;
- _elm_fileselector_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
else
{
@@ -1019,9 +1036,17 @@ EAPI Eina_Bool
elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_buttons_ok_cancel_get(&ret));
+ return ret;
+}
- return sd->ok_button ? EINA_TRUE : EINA_FALSE;
+static void
+_buttons_ok_cancel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = sd->ok_button ? EINA_TRUE : EINA_FALSE;
}
EAPI void
@@ -1029,7 +1054,14 @@ elm_fileselector_expandable_set(Evas_Object *obj,
Eina_Bool expand)
{
ELM_FILESELECTOR_CHECK(obj);
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_expandable_set(expand));
+}
+
+static void
+_expandable_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool expand = va_arg(*list, int);
+ Elm_Fileselector_Smart_Data *sd = _pd;
sd->expand = !!expand;
@@ -1040,18 +1072,32 @@ EAPI Eina_Bool
elm_fileselector_expandable_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_expandable_get(&ret));
+ return ret;
+}
- return sd->expand;
+static void
+_expandable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = sd->expand;
}
EAPI void
elm_fileselector_path_set(Evas_Object *obj,
const char *_path)
{
- char *path;
-
ELM_FILESELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_fileselector_path_set(_path));
+}
+
+static void
+_path_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *_path = va_arg(*list, const char *);
+ char *path;
path = ecore_file_realpath(_path);
_populate(obj, path, NULL);
@@ -1062,9 +1108,17 @@ EAPI const char *
elm_fileselector_path_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) NULL;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_path_get(&ret));
+ return ret;
+}
- return sd->path;
+static void
+_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = sd->path;
}
EAPI void
@@ -1072,8 +1126,15 @@ elm_fileselector_mode_set(Evas_Object *obj,
Elm_Fileselector_Mode mode)
{
ELM_FILESELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_fileselector_mode_set(mode));
+}
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+static void
+_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Fileselector_Mode mode = va_arg(*list, Elm_Fileselector_Mode);
+
+ Elm_Fileselector_Smart_Data *sd = _pd;
if (mode == sd->mode) return;
@@ -1092,18 +1153,36 @@ EAPI Elm_Fileselector_Mode
elm_fileselector_mode_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) ELM_FILESELECTOR_LAST;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Fileselector_Mode ret = ELM_FILESELECTOR_LAST;
+ eo_do((Eo *) obj, elm_obj_fileselector_mode_get(&ret));
+ return ret;
+}
- return sd->mode;
+static void
+_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Fileselector_Mode *ret = va_arg(*list, Elm_Fileselector_Mode *);
+ Elm_Fileselector_Smart_Data *sd = _pd;
+ *ret = sd->mode;
}
EAPI const char *
elm_fileselector_selected_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_CHECK(obj) NULL;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_selected_get(&ret));
+ return ret;
+}
+
+static void
+_selected_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+ Elm_Fileselector_Smart_Data *sd = _pd;
- if (!sd->path) return NULL;
+ if (!sd->path) return;
if (sd->filename_entry)
{
@@ -1131,34 +1210,47 @@ elm_fileselector_selected_get(const Evas_Object *obj)
eina_stringshare_replace(&sd->selection, buf);
if (dir) free(dir);
- return sd->selection;
+ *ret = sd->selection;
+ return;
}
+ *ret = sd->path;
+
if (sd->mode == ELM_FILESELECTOR_LIST)
{
Elm_Object_Item *gl_it = elm_genlist_selected_item_get(sd->files_list);
- if (gl_it) return elm_object_item_data_get(gl_it);
+ if (gl_it) *ret = elm_object_item_data_get(gl_it);
}
else
{
Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(sd->files_grid);
- if (gg_it) return elm_object_item_data_get(gg_it);
+ if (gg_it) *ret = elm_object_item_data_get(gg_it);
}
- return sd->path;
}
EAPI Eina_Bool
elm_fileselector_selected_set(Evas_Object *obj,
const char *_path)
{
- Eina_Bool ret = EINA_TRUE;
+ ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_fileselector_selected_set(_path, &ret));
+ return ret;
+}
+
+static void
+_selected_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *_path = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
+ if (ret) *ret = EINA_TRUE;
char *path;
- ELM_FILESELECTOR_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_DATA_GET(obj, sd);
+ Elm_Fileselector_Smart_Data *sd = _pd;
path = ecore_file_realpath(_path);
@@ -1167,7 +1259,7 @@ elm_fileselector_selected_set(Evas_Object *obj,
{
if (!ecore_file_exists(path))
{
- ret = EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
goto clean_up;
}
@@ -1190,5 +1282,80 @@ elm_fileselector_selected_set(Evas_Object *obj,
clean_up:
free(path);
- return ret;
}
+
+static void
+_elm_fileselector_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_fileselector_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_fileselector_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_fileselector_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_fileselector_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_fileselector_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET), _is_save_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET), _is_save_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET), _folder_only_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET), _folder_only_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET), _buttons_ok_cancel_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET), _buttons_ok_cancel_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET), _expandable_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET), _expandable_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET), _path_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET), _path_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET), _mode_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET), _mode_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET), _selected_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET), _selected_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET, "Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET, "Get whether the given file selector is in 'saving dialog' mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET, "Enable/disable folder-only view for a given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET, "Get whether folder-only view is set for a given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET, "Enable/disable the 'ok' and 'cancel' buttons on a given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET, "Get whether the 'ok' and 'cancel' buttons on a given file selector widget are being shown."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET, "Enable/disable a tree view in the given file selector widget, if it's in #ELM_FILESELECTOR_LIST mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET, "Get whether tree view is enabled for the given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET, "Set, programmatically, the directory that a given file selector widget will display contents from."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET, "Get the parent directory's path that a given file selector widget is displaying."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET, "Set the mode in which a given file selector widget will display (layout) file system entries in its view."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET, "Get the mode in which a given file selector widget is displaying (layouting) file system entries in its view."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET, "Get the currently selected item's (full) path, in the given file selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET, "Set, programmatically, the currently selected file/directory in the given file selector widget."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FILESELECTOR_BASE_ID, op_desc, ELM_OBJ_FILESELECTOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Fileselector_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_fileselector_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_fileselector.h b/src/lib/elc_fileselector.h
index 7bf905463..24d37e163 100644
--- a/src/lib/elc_fileselector.h
+++ b/src/lib/elc_fileselector.h
@@ -34,7 +34,7 @@
* library, the second form of view will display preview thumbnails
* of files which it supports.
*
- * This widget inherits from the @ref Layout one, so that all the
+ * This widget inherits from the Layout one, so that all the
* functions acting on it also work for file selector objects.
*
* This widget emits the following signals, besides the ones sent from
@@ -52,6 +52,210 @@
* @li @ref fileselector_example
*/
+#define ELM_OBJ_FILESELECTOR_CLASS elm_obj_fileselector_class_get()
+
+const Eo_Class *elm_obj_fileselector_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET,
+ ELM_OBJ_FILESELECTOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FILESELECTOR_ID(sub_id) (ELM_OBJ_FILESELECTOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_fileselector_is_save_set
+ * @since 1.8
+ *
+ * Enable/disable the file name entry box where the user can type
+ * in a name for a file, in a given file selector widget
+ *
+ * @param[in] is_save
+ *
+ * @see elm_fileselector_is_save_set
+ */
+#define elm_obj_fileselector_is_save_set(is_save) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, is_save)
+
+/**
+ * @def elm_obj_fileselector_is_save_get
+ * @since 1.8
+ *
+ * Get whether the given file selector is in "saving dialog" mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_is_save_get
+ */
+#define elm_obj_fileselector_is_save_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_folder_only_set
+ * @since 1.8
+ *
+ * Enable/disable folder-only view for a given file selector widget
+ *
+ * @param[in] only
+ *
+ * @see elm_fileselector_folder_only_set
+ */
+#define elm_obj_fileselector_folder_only_set(only) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, only)
+
+/**
+ * @def elm_obj_fileselector_folder_only_get
+ * @since 1.8
+ *
+ * Get whether folder-only view is set for a given file selector
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_folder_only_get
+ */
+#define elm_obj_fileselector_folder_only_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_buttons_ok_cancel_set
+ * @since 1.8
+ *
+ * Enable/disable the "ok" and "cancel" buttons on a given file
+ *
+ * @param[in] visible
+ *
+ * @see elm_fileselector_buttons_ok_cancel_set
+ */
+#define elm_obj_fileselector_buttons_ok_cancel_set(visible) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_SET), EO_TYPECHECK(Eina_Bool, visible)
+
+/**
+ * @def elm_obj_fileselector_buttons_ok_cancel_get
+ * @since 1.8
+ *
+ * Get whether the "ok" and "cancel" buttons on a given file
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_buttons_ok_cancel_get
+ */
+#define elm_obj_fileselector_buttons_ok_cancel_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_BUTTONS_OK_CANCEL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_expandable_set
+ * @since 1.8
+ *
+ * Enable/disable a tree view in the given file selector widget,
+ * <b>if it's in @c #ELM_FILESELECTOR_LIST mode</b>
+ *
+ * @param[in] expand
+ *
+ * @see elm_fileselector_expandable_set
+ */
+#define elm_obj_fileselector_expandable_set(expand) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, expand)
+
+/**
+ * @def elm_obj_fileselector_expandable_get
+ * @since 1.8
+ *
+ * Get whether tree view is enabled for the given file selector
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_expandable_get
+ */
+#define elm_obj_fileselector_expandable_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_path_set
+ * @since 1.8
+ *
+ * Set, programmatically, the directory that a given file
+ * selector widget will display contents from
+ *
+ * @param[in] _path
+ *
+ * @see elm_fileselector_path_set
+ */
+#define elm_obj_fileselector_path_set(_path) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, _path)
+
+/**
+ * @def elm_obj_fileselector_path_get
+ * @since 1.8
+ *
+ * Get the parent directory's path that a given file selector
+ * selector widget will display contents from
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_path_get
+ */
+#define elm_obj_fileselector_path_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_mode_set
+ * @since 1.8
+ *
+ * Set the mode in which a given file selector widget will display
+ * (layout) file system entries in its view
+ *
+ * @param[in] mode
+ *
+ * @see elm_fileselector_mode_set
+ */
+#define elm_obj_fileselector_mode_set(mode) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_Fileselector_Mode, mode)
+
+/**
+ * @def elm_obj_fileselector_mode_get
+ * @since 1.8
+ *
+ * Get the mode in which a given file selector widget is displaying
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_mode_get
+ */
+#define elm_obj_fileselector_mode_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_Fileselector_Mode *, ret)
+
+/**
+ * @def elm_obj_fileselector_selected_get
+ * @since 1.8
+ *
+ * Get the currently selected item's (full) path, in the given file
+ * the given file selector widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_selected_get
+ */
+#define elm_obj_fileselector_selected_get(ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_selected_set
+ * @since 1.8
+ *
+ * Set, programmatically, the currently selected file/directory in
+ * the given file selector widget
+ *
+ * @param[in] _path
+ * @param[out] ret
+ *
+ * @see elm_fileselector_selected_set
+ */
+#define elm_obj_fileselector_selected_set(_path, ret) ELM_OBJ_FILESELECTOR_ID(ELM_OBJ_FILESELECTOR_SUB_ID_SELECTED_SET), EO_TYPECHECK(const char *, _path), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @addtogroup Fileselector
* @{
diff --git a/src/lib/elc_fileselector_button.c b/src/lib/elc_fileselector_button.c
index 1b114761c..2b76a14e0 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -2,8 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_fileselector_button.h"
-EAPI const char ELM_FILESELECTOR_BUTTON_SMART_NAME[] =
- "elm_fileselector_button";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FILESELECTOR_BUTTON_CLASS
+
+#define MY_CLASS_NAME "elm_fileselector_button"
#define DEFAULT_WINDOW_TITLE "Select a file"
@@ -13,34 +18,33 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FILESELECTOR_BUTTON_SMART_NAME, _elm_fileselector_button,
- Elm_Fileselector_Button_Smart_Class, Elm_Button_Smart_Class,
- elm_button_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_fileselector_button_smart_theme(Evas_Object *obj)
+static void
+_elm_fileselector_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
char buf[4096];
const char *style;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
style = eina_stringshare_add(elm_widget_style_get(obj));
snprintf(buf, sizeof(buf), "fileselector_button/%s", style);
/* file selector button's style has an extra bit */
- eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), buf);
+ eina_stringshare_replace(&(wd->style), buf);
- if (!ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), style);
+ eina_stringshare_replace(&(wd->style), style);
eina_stringshare_del(style);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -60,7 +64,7 @@ _selection_done(void *data,
evas_object_del(del);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_FILE_CHOSEN, (void *)file);
+ (sd->obj, SIG_FILE_CHOSEN, (void *)file);
}
static Evas_Object *
@@ -100,7 +104,7 @@ _activate(Elm_Fileselector_Button_Smart_Data *sd)
if (sd->inwin_mode)
{
- sd->fsw = _parent_win_get(ELM_WIDGET_DATA(sd)->obj);
+ sd->fsw = _parent_win_get(sd->obj);
if (!sd->fsw)
sd->fsw = _new_window_add(sd);
@@ -115,7 +119,7 @@ _activate(Elm_Fileselector_Button_Smart_Data *sd)
sd->fs = elm_fileselector_add(sd->fsw);
elm_widget_mirrored_set
- (sd->fs, elm_widget_mirrored_get(ELM_WIDGET_DATA(sd)->obj));
+ (sd->fs, elm_widget_mirrored_get(sd->obj));
elm_widget_mirrored_automatic_set(sd->fs, EINA_FALSE);
elm_fileselector_expandable_set(sd->fs, sd->fsd.expandable);
elm_fileselector_folder_only_set(sd->fs, sd->fsd.folder_only);
@@ -148,11 +152,11 @@ _button_clicked(void *data,
}
static void
-_elm_fileselector_button_smart_add(Evas_Object *obj)
+_elm_fileselector_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Button_Smart_Data);
+ Elm_Fileselector_Button_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE);
if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME"));
@@ -167,16 +171,16 @@ _elm_fileselector_button_smart_add(Evas_Object *obj)
evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv);
- _elm_fileselector_button_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
elm_widget_can_focus_set(obj, EINA_TRUE);
}
static void
-_elm_fileselector_button_smart_del(Evas_Object *obj)
+_elm_fileselector_button_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *win;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
if (sd->window_title) eina_stringshare_del(sd->window_title);
if (sd->fsd.path) eina_stringshare_del(sd->fsd.path);
@@ -186,53 +190,39 @@ _elm_fileselector_button_smart_del(Evas_Object *obj)
evas_object_del(win);
}
- ELM_WIDGET_CLASS(_elm_fileselector_button_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_fileselector_button_smart_set_user(
- Elm_Fileselector_Button_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_button_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_button_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_button_smart_theme;
-
- ELM_BUTTON_CLASS(sc)->admits_autorepeat = EINA_FALSE;
-}
-
-EAPI const Elm_Fileselector_Button_Smart_Class *
-elm_fileselector_button_smart_class_get(void)
+_elm_fileselector_button_smart_admits_autorepeat_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Fileselector_Button_Smart_Class _sc =
- ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- (ELM_FILESELECTOR_BUTTON_SMART_NAME);
- static const Elm_Fileselector_Button_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_fileselector_button_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
EAPI Evas_Object *
elm_fileselector_button_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_fileselector_button_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
+ sd->obj = obj;
+
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -240,7 +230,14 @@ elm_fileselector_button_window_title_set(Evas_Object *obj,
const char *title)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_window_title_set(title));
+}
+
+static void
+_window_title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *title = va_arg(*list, const char *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->window_title, title);
@@ -251,9 +248,18 @@ EAPI const char *
elm_fileselector_button_window_title_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_window_title_get(&ret));
+ return ret;
+}
- return sd->window_title;
+static void
+_window_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
+
+ *ret = sd->window_title;
}
EAPI void
@@ -262,7 +268,15 @@ elm_fileselector_button_window_size_set(Evas_Object *obj,
Evas_Coord height)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_window_size_set(width, height));
+}
+
+static void
+_window_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord width = va_arg(*list, Evas_Coord);
+ Evas_Coord height = va_arg(*list, Evas_Coord);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
sd->w = width;
sd->h = height;
@@ -276,7 +290,15 @@ elm_fileselector_button_window_size_get(const Evas_Object *obj,
Evas_Coord *height)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_fileselector_button_window_size_get(width, height));
+}
+
+static void
+_window_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *width = va_arg(*list, Evas_Coord *);
+ Evas_Coord *height = va_arg(*list, Evas_Coord *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
if (width) *width = sd->w;
if (height) *height = sd->h;
@@ -287,7 +309,14 @@ elm_fileselector_button_path_set(Evas_Object *obj,
const char *path)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_path_set(path));
+}
+
+static void
+_path_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *path = va_arg(*list, const char *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->fsd.path, path);
@@ -298,9 +327,18 @@ EAPI const char *
elm_fileselector_button_path_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) NULL;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_path_get(&ret));
+ return ret;
+}
+
+static void
+_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
- return sd->fsd.path;
+ *ret = sd->fsd.path;
}
EAPI void
@@ -308,7 +346,14 @@ elm_fileselector_button_expandable_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_expandable_set(value));
+}
+
+static void
+_expandable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
sd->fsd.expandable = value;
@@ -319,9 +364,18 @@ EAPI Eina_Bool
elm_fileselector_button_expandable_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_expandable_get(&ret));
+ return ret;
+}
- return sd->fsd.expandable;
+static void
+_expandable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
+
+ *ret = sd->fsd.expandable;
}
EAPI void
@@ -329,7 +383,14 @@ elm_fileselector_button_folder_only_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_folder_only_set(value));
+}
+
+static void
+_folder_only_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
sd->fsd.folder_only = value;
@@ -340,9 +401,18 @@ EAPI Eina_Bool
elm_fileselector_button_folder_only_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_folder_only_get(&ret));
+ return ret;
+}
- return sd->fsd.folder_only;
+static void
+_folder_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
+
+ *ret = sd->fsd.folder_only;
}
EAPI void
@@ -350,7 +420,14 @@ elm_fileselector_button_is_save_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_is_save_set(value));
+}
+
+static void
+_is_save_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
sd->fsd.is_save = value;
@@ -361,9 +438,18 @@ EAPI Eina_Bool
elm_fileselector_button_is_save_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_is_save_get(&ret));
+ return ret;
+}
+
+static void
+_is_save_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
- return sd->fsd.is_save;
+ *ret = sd->fsd.is_save;
}
EAPI void
@@ -371,7 +457,14 @@ elm_fileselector_button_inwin_mode_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj);
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_button_inwin_mode_set(value));
+}
+
+static void
+_inwin_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
sd->inwin_mode = value;
}
@@ -380,7 +473,79 @@ EAPI Eina_Bool
elm_fileselector_button_inwin_mode_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_BUTTON_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_BUTTON_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_button_inwin_mode_get(&ret));
+ return ret;
+}
+
+static void
+_inwin_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Button_Smart_Data *sd = _pd;
+
+ *ret = sd->inwin_mode;
+}
- return sd->inwin_mode;
+static void
+_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_fileselector_button_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_button_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_button_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_fileselector_button_smart_admits_autorepeat_get),
+
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET), _window_title_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET), _window_title_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET), _window_size_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET), _window_size_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET), _path_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET), _path_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET), _expandable_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET), _expandable_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET), _folder_only_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET), _folder_only_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET), _is_save_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET), _is_save_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET), _inwin_mode_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET), _inwin_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET, "Set the title for a given file selector button widget's window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET, "Get the title for a given file selector button widget's window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET, "Set the size of a given file selector button widget's window, holding the file selector itself."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET, "Get the size of a given file selector button widget's window, holding the file selector itself."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET, "Set the initial file system path for a given file selector button widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET, "Get the initial file system path set for a given file selector button widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET, "Enable/disable a tree view in the given file selector button widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET, "Get whether tree view is enabled for the given file selector button widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET, "Set whether a given file selector button widget's internal file selector is to display folders only or the directory contents, as well."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET, "Get whether a given file selector button widget's internal file selector is displaying folders only or the directory contents, as well."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET, "Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector button widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET, "Get whether the given file selector button widget's internal file selector is in 'saving dialog' mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET, "Set whether a given file selector button widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET, "Get whether a given file selector button widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID, op_desc, ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Fileselector_Button_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_fileselector_button_class_get, &class_desc, ELM_OBJ_BUTTON_CLASS, NULL);
+
diff --git a/src/lib/elc_fileselector_button.h b/src/lib/elc_fileselector_button.h
index 57afad3cf..741925976 100644
--- a/src/lib/elc_fileselector_button.h
+++ b/src/lib/elc_fileselector_button.h
@@ -61,6 +61,215 @@
* @{
*/
+#define ELM_OBJ_FILESELECTOR_BUTTON_CLASS elm_obj_fileselector_button_class_get()
+
+const Eo_Class *elm_obj_fileselector_button_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID;
+
+enum
+{
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET,
+ ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FILESELECTOR_BUTTON_ID(sub_id) (ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_fileselector_button_window_title_set
+ * @since 1.8
+ *
+ * Set the title for a given file selector button widget's window
+ *
+ * @param[in] title
+ *
+ * @see elm_fileselector_button_window_title_set
+ */
+#define elm_obj_fileselector_button_window_title_set(title) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_SET), EO_TYPECHECK(const char *, title)
+
+/**
+ * @def elm_obj_fileselector_button_window_title_get
+ * @since 1.8
+ *
+ * Get the title for a given file selector button widget's
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_window_title_get
+ */
+#define elm_obj_fileselector_button_window_title_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_TITLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_button_window_size_set
+ * @since 1.8
+ *
+ * Set the size of a given file selector button widget's window,
+ * holding the file selector itself.
+ *
+ * @param[in] width
+ * @param[in] height
+ *
+ * @see elm_fileselector_button_window_size_set
+ */
+#define elm_obj_fileselector_button_window_size_set(width, height) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_SET), EO_TYPECHECK(Evas_Coord, width), EO_TYPECHECK(Evas_Coord, height)
+
+/**
+ * @def elm_obj_fileselector_button_window_size_get
+ * @since 1.8
+ *
+ * Get the size of a given file selector button widget's window,
+ * holding the file selector itself.
+ *
+ * @param[out] width
+ * @param[out] height
+ *
+ * @see elm_fileselector_button_window_size_get
+ */
+#define elm_obj_fileselector_button_window_size_get(width, height) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_WINDOW_SIZE_GET), EO_TYPECHECK(Evas_Coord *, width), EO_TYPECHECK(Evas_Coord *, height)
+
+/**
+ * @def elm_obj_fileselector_button_path_set
+ * @since 1.8
+ *
+ * Set the initial file system path for a given file selector
+ *
+ * @param[in] path
+ *
+ * @see elm_fileselector_button_path_set
+ */
+#define elm_obj_fileselector_button_path_set(path) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, path)
+
+/**
+ * @def elm_obj_fileselector_button_path_get
+ * @since 1.8
+ *
+ * Get the initial file system path set for a given file selector
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_path_get
+ */
+#define elm_obj_fileselector_button_path_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_button_expandable_set
+ * @since 1.8
+ *
+ * Enable/disable a tree view in the given file selector button
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_button_expandable_set
+ */
+#define elm_obj_fileselector_button_expandable_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_button_expandable_get
+ * @since 1.8
+ *
+ * Get whether tree view is enabled for the given file selector
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_expandable_get
+ */
+#define elm_obj_fileselector_button_expandable_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_button_folder_only_set
+ * @since 1.8
+ *
+ * Set whether a given file selector button widget's internal file
+ * selector is to display folders only or the directory contents,
+ * as well.
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_button_folder_only_set
+ */
+#define elm_obj_fileselector_button_folder_only_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_button_folder_only_get
+ * @since 1.8
+ *
+ * Get whether a given file selector button widget's internal file
+ * selector is displaying folders only or the directory contents,
+ * as well.
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_folder_only_get
+ */
+#define elm_obj_fileselector_button_folder_only_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_button_is_save_set
+ * @since 1.8
+ *
+ * Enable/disable the file name entry box where the user can type
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_button_is_save_set
+ */
+#define elm_obj_fileselector_button_is_save_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_button_is_save_get
+ * @since 1.8
+ *
+ * Get whether the given file selector button widget's internal
+ * file selector is in "saving dialog" mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_is_save_get
+ */
+#define elm_obj_fileselector_button_is_save_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_button_inwin_mode_set
+ * @since 1.8
+ *
+ * Set whether a given file selector button widget's internal file
+ * selector will raise an Elementary "inner window", instead of a
+ * dedicated Elementary window. By default, it won't.
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_button_inwin_mode_set
+ */
+#define elm_obj_fileselector_button_inwin_mode_set(value) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_button_inwin_mode_get
+ * @since 1.8
+ *
+ * Get whether a given file selector button widget's internal file
+ * selector will raise an Elementary "inner window", instead of a
+ * dedicated Elementary window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_button_inwin_mode_get
+ */
+#define elm_obj_fileselector_button_inwin_mode_get(ret) ELM_OBJ_FILESELECTOR_BUTTON_ID(ELM_OBJ_FILESELECTOR_BUTTON_SUB_ID_INWIN_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* Add a new file selector button widget to the given parent
* Elementary (container) object
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index fbc100919..7fd1bd689 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -4,6 +4,14 @@
#include "elm_priv.h"
#include "elm_widget_fileselector_entry.h"
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FILESELECTOR_ENTRY_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FILESELECTOR_ENTRY_CLASS
+
+#define MY_CLASS_NAME "elm_fileselector_entry"
+
EAPI const char ELM_FILESELECTOR_ENTRY_SMART_NAME[] = "elm_fileselector_entry";
static const char SIG_CHANGED[] = "changed";
@@ -56,11 +64,6 @@ SIG_FWD(SELECTION_CUT)
SIG_FWD(UNPRESSED)
#undef SIG_FWD
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FILESELECTOR_ENTRY_SMART_NAME, _elm_fileselector_entry,
- Elm_Fileselector_Entry_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
static void
_FILE_CHOSEN_fwd(void *data,
Evas_Object *obj __UNUSED__,
@@ -93,27 +96,44 @@ _ACTIVATED_fwd(void *data,
}
static void
-_elm_fileselector_entry_smart_sizing_eval(Evas_Object *obj)
+_elm_fileselector_entry_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
-static Eina_Bool
-_elm_fileselector_entry_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_fileselector_entry_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_fileselector_entry_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_fileselector_entry_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
Evas_Object *chain[2];
Evas_Object *to_focus;
unsigned char i;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
/* Direction */
if (dir == ELM_FOCUS_PREVIOUS)
@@ -127,22 +147,27 @@ _elm_fileselector_entry_smart_focus_next(const Evas_Object *obj,
chain[1] = sd->button;
}
else
- return EINA_FALSE;
+ goto end;
i = elm_widget_focus_get(chain[1]);
if (elm_widget_focus_next_get(chain[i], dir, next))
- return EINA_TRUE;
+ {
+ int_ret = EINA_TRUE;
+ goto end;
+ }
i = !i;
if (elm_widget_focus_next_get(chain[i], dir, &to_focus))
{
*next = to_focus;
- return !!i;
+ int_ret = !!i;
+ goto end;
}
- return EINA_FALSE;
+end:
+ if (ret) *ret = int_ret;
}
static void
@@ -154,16 +179,21 @@ _mirrored_set(Evas_Object *obj,
elm_widget_mirrored_set(sd->button, rtl);
}
-static Eina_Bool
-_elm_fileselector_entry_smart_theme(Evas_Object *obj)
+static void
+_elm_fileselector_entry_smart_theme(Eo *obj, void *_pd, va_list *list)
{
const char *style;
char buf[1024];
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ Eina_Bool int_ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
style = elm_widget_style_get(obj);
@@ -177,105 +207,142 @@ _elm_fileselector_entry_smart_theme(Evas_Object *obj)
elm_widget_style_set(sd->button, buf);
elm_widget_style_set(sd->entry, buf);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_fileselector_entry_smart_disable(Evas_Object *obj)
+static void
+_elm_fileselector_entry_smart_disable(Eo *obj, void *_pd, va_list *list)
{
Eina_Bool val;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
- if (!ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->disable(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_disable(&int_ret));
+ if (!int_ret) return;
val = elm_widget_disabled_get(obj);
elm_widget_disabled_set(sd->button, val);
elm_widget_disabled_set(sd->entry, val);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_fileselector_entry_smart_text_set(Evas_Object *obj,
- const char *item,
- const char *label)
+static void
+_elm_fileselector_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ const char *item = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
if (item && strcmp(item, "default"))
- return _elm_fileselector_entry_parent_sc->text_set(obj, item, label);
+ {
+ eo_do_super(obj, elm_obj_layout_text_set(item, label, &int_ret));
+ goto end;
+ }
elm_object_text_set(sd->button, label);
- return EINA_TRUE;
+ int_ret = EINA_TRUE;
+end:
+ if (ret) *ret = int_ret;
}
-static const char *
-_elm_fileselector_entry_smart_text_get(const Evas_Object *obj,
- const char *item)
+static void
+_elm_fileselector_entry_smart_text_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ const char *item = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
if (item && strcmp(item, "default"))
- return _elm_fileselector_entry_parent_sc->text_get(obj, item);
+ {
+ eo_do_super(obj, elm_obj_layout_text_get(item, text));
+ return;
+ }
- return elm_object_text_get(sd->button);
+ *text = elm_object_text_get(sd->button);
}
-static Eina_Bool
-_elm_fileselector_entry_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_fileselector_entry_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
if (part && strcmp(part, "button icon"))
- return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)->content_set
- (obj, part, content);
+ {
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ goto end;
+ }
elm_layout_content_set(sd->button, NULL, content);
- return EINA_TRUE;
+ int_ret = EINA_TRUE;
+end:
+ if (ret) *ret = int_ret;
}
-static Evas_Object *
-_elm_fileselector_entry_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_fileselector_entry_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
if (part && strcmp(part, "button icon"))
- return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)->
- content_get(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_get(part, ret));
+ return;
+ }
- return elm_layout_content_get(sd->button, NULL);
+ *ret = elm_layout_content_get(sd->button, NULL);
}
-static Evas_Object *
-_elm_fileselector_entry_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_fileselector_entry_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Evas_Object *int_ret;
+
if (part && strcmp(part, "button icon"))
- return ELM_CONTAINER_CLASS(_elm_fileselector_entry_parent_sc)->
- content_unset(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_unset(part, &int_ret));
+ goto end;
+ }
- return elm_layout_content_unset(sd->button, NULL);
+ int_ret = elm_layout_content_unset(sd->button, NULL);
+end:
+ if (ret) *ret = int_ret;
}
static void
-_elm_fileselector_entry_smart_add(Evas_Object *obj)
+_elm_fileselector_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Fileselector_Entry_Smart_Data);
+ Elm_Fileselector_Entry_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set
(obj, "fileselector_entry", "base", elm_widget_style_get(obj));
@@ -325,73 +392,34 @@ _elm_fileselector_entry_smart_add(Evas_Object *obj)
}
static void
-_elm_fileselector_entry_smart_del(Evas_Object *obj)
+_elm_fileselector_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
if (sd->path) free(sd->path);
- ELM_WIDGET_CLASS(_elm_fileselector_entry_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_fileselector_entry_smart_set_user(Elm_Fileselector_Entry_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_fileselector_entry_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_fileselector_entry_smart_del;
-
- ELM_WIDGET_CLASS(sc)->disable = _elm_fileselector_entry_smart_disable;
- ELM_WIDGET_CLASS(sc)->theme = _elm_fileselector_entry_smart_theme;
-
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_fileselector_entry_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set =
- _elm_fileselector_entry_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get =
- _elm_fileselector_entry_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset =
- _elm_fileselector_entry_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_fileselector_entry_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_fileselector_entry_smart_text_get;
- ELM_LAYOUT_CLASS(sc)->sizing_eval =
- _elm_fileselector_entry_smart_sizing_eval;
-}
-
-EAPI const Elm_Fileselector_Entry_Smart_Class *
-elm_fileselector_entry_smart_class_get(void)
-{
- static Elm_Fileselector_Entry_Smart_Class _sc =
- ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- (ELM_FILESELECTOR_ENTRY_SMART_NAME);
- static const Elm_Fileselector_Entry_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_fileselector_entry_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_fileselector_entry_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_fileselector_entry_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -399,7 +427,14 @@ elm_fileselector_entry_selected_set(Evas_Object *obj,
const char *path)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_selected_set(path));
+}
+
+static void
+_selected_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *path = va_arg(*list, const char *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_path_set(sd->button, path);
}
@@ -408,9 +443,18 @@ EAPI const char *
elm_fileselector_entry_selected_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_selected_get(&ret));
+ return ret;
+}
- return elm_fileselector_button_path_get(sd->button);
+static void
+_selected_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ *ret = elm_fileselector_button_path_get(sd->button);
}
EAPI void
@@ -418,7 +462,14 @@ elm_fileselector_entry_window_title_set(Evas_Object *obj,
const char *title)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_window_title_set(title));
+}
+
+static void
+_window_title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *title = va_arg(*list, const char *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_window_title_set(sd->button, title);
}
@@ -427,9 +478,18 @@ EAPI const char *
elm_fileselector_entry_window_title_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_window_title_get(&ret));
+ return ret;
+}
- return elm_fileselector_button_window_title_get(sd->button);
+static void
+_window_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+
+ *ret = elm_fileselector_button_window_title_get(sd->button);
}
EAPI void
@@ -438,7 +498,15 @@ elm_fileselector_entry_window_size_set(Evas_Object *obj,
Evas_Coord height)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_window_size_set(width, height));
+}
+
+static void
+_window_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord width = va_arg(*list, Evas_Coord);
+ Evas_Coord height = va_arg(*list, Evas_Coord);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_window_size_set(sd->button, width, height);
}
@@ -449,7 +517,15 @@ elm_fileselector_entry_window_size_get(const Evas_Object *obj,
Evas_Coord *height)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_window_size_get(width, height));
+}
+
+static void
+_window_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *width = va_arg(*list, Evas_Coord *);
+ Evas_Coord *height = va_arg(*list, Evas_Coord *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_window_size_get(sd->button, width, height);
}
@@ -458,10 +534,17 @@ EAPI void
elm_fileselector_entry_path_set(Evas_Object *obj,
const char *path)
{
+ ELM_FILESELECTOR_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_fileselector_entry_path_set(path));
+}
+
+static void
+_path_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
char *s;
- ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
+ const char *path = va_arg(*list, const char *);
elm_fileselector_button_path_set(sd->button, path);
s = elm_entry_utf8_to_markup(path);
@@ -476,11 +559,20 @@ EAPI const char *
elm_fileselector_entry_path_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_path_get(&ret));
+ return ret;
+}
+
+static void
+_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
if (sd->path) free(sd->path);
sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
- return sd->path;
+ *ret = sd->path;
}
EAPI void
@@ -488,7 +580,14 @@ elm_fileselector_entry_expandable_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_expandable_set(value));
+}
+
+static void
+_expandable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_expandable_set(sd->button, value);
}
@@ -497,9 +596,18 @@ EAPI Eina_Bool
elm_fileselector_entry_expandable_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_expandable_get(&ret));
+ return ret;
+}
+
+static void
+_expandable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
- return elm_fileselector_button_expandable_get(sd->button);
+ *ret = elm_fileselector_button_expandable_get(sd->button);
}
EAPI void
@@ -507,7 +615,14 @@ elm_fileselector_entry_folder_only_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_folder_only_set(value));
+}
+
+static void
+_folder_only_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_folder_only_set(sd->button, value);
}
@@ -516,9 +631,18 @@ EAPI Eina_Bool
elm_fileselector_entry_folder_only_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_folder_only_get(&ret));
+ return ret;
+}
+
+static void
+_folder_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
- return elm_fileselector_button_folder_only_get(sd->button);
+ *ret = elm_fileselector_button_folder_only_get(sd->button);
}
EAPI void
@@ -526,7 +650,14 @@ elm_fileselector_entry_is_save_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_is_save_set(value));
+}
+
+static void
+_is_save_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_is_save_set(sd->button, value);
}
@@ -535,9 +666,18 @@ EAPI Eina_Bool
elm_fileselector_entry_is_save_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_is_save_get(&ret));
+ return ret;
+}
+
+static void
+_is_save_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
- return elm_fileselector_button_is_save_get(sd->button);
+ *ret = elm_fileselector_button_is_save_get(sd->button);
}
EAPI void
@@ -545,7 +685,14 @@ elm_fileselector_entry_inwin_mode_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj);
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_fileselector_entry_inwin_mode_set(value));
+}
+
+static void
+_inwin_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
elm_fileselector_button_inwin_mode_set(sd->button, value);
}
@@ -554,7 +701,90 @@ EAPI Eina_Bool
elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj)
{
ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_FILESELECTOR_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_fileselector_entry_inwin_mode_get(&ret));
+ return ret;
+}
+
+static void
+_inwin_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Fileselector_Entry_Smart_Data *sd = _pd;
- return elm_fileselector_button_inwin_mode_get(sd->button);
+ *ret = elm_fileselector_button_inwin_mode_get(sd->button);
}
+
+static void
+_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_fileselector_entry_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_entry_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_fileselector_entry_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_entry_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_fileselector_entry_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_fileselector_entry_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_fileselector_entry_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_fileselector_entry_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_fileselector_entry_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_fileselector_entry_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_fileselector_entry_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_fileselector_entry_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_fileselector_entry_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_SET), _selected_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_GET), _selected_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_SET), _window_title_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_GET), _window_title_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_SET), _window_size_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_GET), _window_size_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_SET), _path_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_GET), _path_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_SET), _expandable_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_GET), _expandable_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_SET), _folder_only_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_GET), _folder_only_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_SET), _is_save_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_GET), _is_save_get),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_SET), _inwin_mode_set),
+ EO_OP_FUNC(ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_GET), _inwin_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_SET, "Set the initial file system path for a given file selector entry widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_GET, "Get the parent directory's path to the latest file selection on a given filer selector entry widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_SET, "Set the title for a given file selector entry widget's window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_GET, "Get the title set for a given file selector entry widget's window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_SET, "Set the size of a given file selector entry widget's window, holding the file selector itself."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_GET, "Get the size of a given file selector entry widget's window, holding the file selector itself."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_SET, "Set the initial file system path and the entry's path string for a given file selector entry widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_GET, "Get the entry's path string for a given file selector entry widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_SET, "Enable/disable a tree view in the given file selector entry widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_GET, "Get whether tree view is enabled for the given file selector entry widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_SET, "Set whether a given file selector entry widget's internal file selector is to display folders only or the directory contents, as well."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_GET, "Get whether a given file selector entry widget's internal file selector is to display folders only or the directory contents, as well."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_SET, "Enable/disable the file name entry box where the user can type in a name for a file, in a given file selector entry widget's internal file selector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_GET, "Get whether the given file selector entry widget's internal file selector is in 'saving dialog' mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_SET, "Set whether a given file selector entry widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_GET, "Get whether a given file selector entry widget's internal file selector will raise an Elementary 'inner window', instead of a dedicated Elementary window."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FILESELECTOR_ENTRY_BASE_ID, op_desc, ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Fileselector_Entry_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_fileselector_entry_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_fileselector_entry.h b/src/lib/elc_fileselector_entry.h
index 6b8267fe3..6e55fa761 100644
--- a/src/lib/elc_fileselector_entry.h
+++ b/src/lib/elc_fileselector_entry.h
@@ -73,6 +73,239 @@
* @{
*/
+#define ELM_OBJ_FILESELECTOR_ENTRY_CLASS elm_obj_fileselector_entry_class_get()
+
+const Eo_Class *elm_obj_fileselector_entry_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FILESELECTOR_ENTRY_BASE_ID;
+
+enum
+{
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_SET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_GET,
+ ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FILESELECTOR_ENTRY_ID(sub_id) (ELM_OBJ_FILESELECTOR_ENTRY_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_fileselector_entry_selected_set
+ * @since 1.8
+ *
+ * Set the initial file system path for a given file selector entry
+ *
+ * @param[in] path
+ *
+ * @see elm_fileselector_entry_selected_set
+ */
+#define elm_obj_fileselector_entry_selected_set(path) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_SET), EO_TYPECHECK(const char *, path)
+
+/**
+ * @def elm_obj_fileselector_entry_selected_get
+ * @since 1.8
+ *
+ * Get the parent directory's path to the latest file selection on
+ * a given filer selector entry widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_selected_get
+ */
+#define elm_obj_fileselector_entry_selected_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_SELECTED_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_window_title_set
+ * @since 1.8
+ *
+ * Set the title for a given file selector entry widget's window
+ *
+ * @param[in] title
+ *
+ * @see elm_fileselector_entry_window_title_set
+ */
+#define elm_obj_fileselector_entry_window_title_set(title) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_SET), EO_TYPECHECK(const char *, title)
+
+/**
+ * @def elm_obj_fileselector_entry_window_title_get
+ * @since 1.8
+ *
+ * Get the title set for a given file selector entry widget's
+ * window
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_window_title_get
+ */
+#define elm_obj_fileselector_entry_window_title_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_TITLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_window_size_set
+ * @since 1.8
+ *
+ * Set the size of a given file selector entry widget's window,
+ * holding the file selector itself.
+ *
+ * @param[in] width
+ * @param[in] height
+ *
+ * @see elm_fileselector_entry_window_size_set
+ */
+#define elm_obj_fileselector_entry_window_size_set(width, height) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_SET), EO_TYPECHECK(Evas_Coord, width), EO_TYPECHECK(Evas_Coord, height)
+
+/**
+ * @def elm_obj_fileselector_entry_window_size_get
+ * @since 1.8
+ *
+ * Get the size of a given file selector entry widget's window,
+ * holding the file selector itself.
+ *
+ * @param[out] width
+ * @param[out] height
+ *
+ * @see elm_fileselector_entry_window_size_get
+ */
+#define elm_obj_fileselector_entry_window_size_get(width, height) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_WINDOW_SIZE_GET), EO_TYPECHECK(Evas_Coord *, width), EO_TYPECHECK(Evas_Coord *, height)
+
+/**
+ * @def elm_obj_fileselector_entry_path_set
+ * @since 1.8
+ *
+ * Set the initial file system path and the entry's path string for
+ * a given file selector entry widget
+ *
+ * @param[in] path
+ *
+ * @see elm_fileselector_entry_path_set
+ */
+#define elm_obj_fileselector_entry_path_set(path) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_SET), EO_TYPECHECK(const char *, path)
+
+/**
+ * @def elm_obj_fileselector_entry_path_get
+ * @since 1.8
+ *
+ * Get the entry's path string for a given file selector entry
+ * widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_path_get
+ */
+#define elm_obj_fileselector_entry_path_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_expandable_set
+ * @since 1.8
+ *
+ * Enable/disable a tree view in the given file selector entry
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_entry_expandable_set
+ */
+#define elm_obj_fileselector_entry_expandable_set(value) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_entry_expandable_get
+ * @since 1.8
+ *
+ * Get whether tree view is enabled for the given file selector
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_expandable_get
+ */
+#define elm_obj_fileselector_entry_expandable_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_EXPANDABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_folder_only_set
+ * @since 1.8
+ *
+ * Set whether a given file selector entry widget's internal file
+ * selector is to display folders only or the directory contents,
+ * as well.
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_entry_folder_only_set
+ */
+#define elm_obj_fileselector_entry_folder_only_set(value) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_entry_folder_only_get
+ * @since 1.8
+ *
+ * Get whether a given file selector entry widget's internal file
+ * selector is displaying folders only or the directory contents,
+ * as well.
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_folder_only_get
+ */
+#define elm_obj_fileselector_entry_folder_only_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_FOLDER_ONLY_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_is_save_set
+ * @since 1.8
+ *
+ * Enable/disable the file name entry box where the user can type
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_entry_is_save_set
+ */
+#define elm_obj_fileselector_entry_is_save_set(value) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_entry_is_save_get
+ * @since 1.8
+ *
+ * Get whether the given file selector entry widget's internal
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_is_save_get
+ */
+#define elm_obj_fileselector_entry_is_save_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_IS_SAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_fileselector_entry_inwin_mode_set
+ * @since 1.8
+ *
+ * Set whether a given file selector entry widget's internal file
+ *
+ * @param[in] value
+ *
+ * @see elm_fileselector_entry_inwin_mode_set
+ */
+#define elm_obj_fileselector_entry_inwin_mode_set(value) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_fileselector_entry_inwin_mode_get
+ * @since 1.8
+ *
+ * Get whether a given file selector entry widget's internal file
+ *
+ * @param[out] ret
+ *
+ * @see elm_fileselector_entry_inwin_mode_get
+ */
+#define elm_obj_fileselector_entry_inwin_mode_get(ret) ELM_OBJ_FILESELECTOR_ENTRY_ID(ELM_OBJ_FILESELECTOR_ENTRY_SUB_ID_INWIN_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
* Add a new file selector entry widget to the given parent
* Elementary (container) object
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 3a2cf11a6..316a7d57e 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_hoversel.h"
-EAPI const char ELM_HOVERSEL_SMART_NAME[] = "elm_hoversel";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_HOVERSEL_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_HOVERSEL_CLASS
+
+#define MY_CLASS_NAME "elm_hoversel"
static const char SIG_SELECTED[] = "selected";
static const char SIG_DISMISSED[] = "dismissed";
@@ -12,18 +18,19 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_HOVERSEL_SMART_NAME, _elm_hoversel, Elm_Hoversel_Smart_Class,
- Elm_Button_Smart_Class, elm_button_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_hoversel_smart_theme(Evas_Object *obj)
+static void
+_elm_hoversel_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ Elm_Hoversel_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
char buf[4096];
const char *style;
- ELM_HOVERSEL_DATA_GET(obj, sd);
-
style = eina_stringshare_add(elm_widget_style_get(obj));
if (sd->horizontal)
@@ -32,12 +39,12 @@ _elm_hoversel_smart_theme(Evas_Object *obj)
snprintf(buf, sizeof(buf), "hoversel_vertical/%s", style);
/* hoversel's style has an extra bit: orientation */
- eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), buf);
+ eina_stringshare_replace(&(wd->style), buf);
- if (!ELM_WIDGET_CLASS(_elm_hoversel_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), style);
+ eina_stringshare_replace(&(wd->style), style);
eina_stringshare_del(style);
@@ -46,7 +53,7 @@ _elm_hoversel_smart_theme(Evas_Object *obj)
elm_hoversel_hover_end(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -196,11 +203,11 @@ _item_del_pre_hook(Elm_Object_Item *it)
}
static void
-_elm_hoversel_smart_add(Evas_Object *obj)
+_elm_hoversel_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Hoversel_Smart_Data);
+ Elm_Hoversel_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_hoversel_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
@@ -208,15 +215,15 @@ _elm_hoversel_smart_add(Evas_Object *obj)
evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj);
- _elm_hoversel_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
static void
-_elm_hoversel_smart_del(Evas_Object *obj)
+_elm_hoversel_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Hoversel_Item *item;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Elm_Hoversel_Smart_Data *sd = _pd;
EINA_LIST_FREE (sd->items, item)
{
@@ -227,59 +234,43 @@ _elm_hoversel_smart_del(Evas_Object *obj)
}
elm_hoversel_hover_parent_set(obj, NULL);
- ELM_WIDGET_CLASS(_elm_hoversel_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_hoversel_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_hoversel_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
elm_hoversel_hover_parent_set(obj, parent);
}
static void
-_elm_hoversel_smart_set_user(Elm_Hoversel_Smart_Class *sc)
+_elm_hoversel_smart_admits_autorepeat_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_hoversel_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_hoversel_smart_del;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_hoversel_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->theme = _elm_hoversel_smart_theme;
-
- ELM_BUTTON_CLASS(sc)->admits_autorepeat = EINA_FALSE;
-}
-
-EAPI const Elm_Hoversel_Smart_Class *
-elm_hoversel_smart_class_get(void)
-{
- static Elm_Hoversel_Smart_Class _sc =
- ELM_HOVERSEL_SMART_CLASS_INIT_NAME_VERSION(ELM_HOVERSEL_SMART_NAME);
- static const Elm_Hoversel_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_hoversel_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
EAPI Evas_Object *
elm_hoversel_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_hoversel_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -287,7 +278,14 @@ elm_hoversel_hover_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
ELM_HOVERSEL_CHECK(obj);
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_hoversel_hover_parent_set(parent));
+}
+
+static void
+_hover_parent_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Hoversel_Smart_Data *sd = _pd;
if (sd->hover_parent)
evas_object_event_callback_del_full
@@ -303,9 +301,18 @@ EAPI Evas_Object *
elm_hoversel_hover_parent_get(const Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj) NULL;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_hoversel_hover_parent_get(&ret));
+ return ret;
+}
- return sd->hover_parent;
+static void
+_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Hoversel_Smart_Data *sd = _pd;
+
+ *ret = sd->hover_parent;
}
EAPI void
@@ -313,27 +320,49 @@ elm_hoversel_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_HOVERSEL_CHECK(obj);
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_hoversel_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Hoversel_Smart_Data *sd = _pd;
sd->horizontal = !!horizontal;
- _elm_hoversel_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_hoversel_horizontal_get(const Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj) EINA_FALSE;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_hoversel_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Hoversel_Smart_Data *sd = _pd;
+
+ *ret = sd->horizontal;
}
EAPI void
elm_hoversel_hover_begin(Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj);
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_hoversel_hover_begin());
+}
+
+static void
+_hover_begin(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Hoversel_Smart_Data *sd = _pd;
if (sd->hover) return;
@@ -344,7 +373,13 @@ EAPI void
elm_hoversel_hover_end(Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj);
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_hoversel_hover_end());
+}
+
+static void
+_hover_end(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Hoversel_Smart_Data *sd = _pd;
if (!sd->hover) return;
@@ -360,19 +395,34 @@ EAPI Eina_Bool
elm_hoversel_expanded_get(const Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj) EINA_FALSE;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_hoversel_expanded_get(&ret));
+ return ret;
+}
+
+static void
+_expanded_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Hoversel_Smart_Data *sd = _pd;
- return (sd->hover) ? EINA_TRUE : EINA_FALSE;
+ *ret = (sd->hover) ? EINA_TRUE : EINA_FALSE;
}
EAPI void
elm_hoversel_clear(Evas_Object *obj)
{
+ ELM_HOVERSEL_CHECK(obj);
+ eo_do(obj, elm_obj_hoversel_clear());
+}
+
+static void
+_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_Object_Item *it;
Eina_List *l, *ll;
- ELM_HOVERSEL_CHECK(obj);
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Elm_Hoversel_Smart_Data *sd = _pd;
EINA_LIST_FOREACH_SAFE(sd->items, l, ll, it)
{
@@ -384,9 +434,18 @@ EAPI const Eina_List *
elm_hoversel_items_get(const Evas_Object *obj)
{
ELM_HOVERSEL_CHECK(obj) NULL;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_hoversel_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Hoversel_Smart_Data *sd = _pd;
+
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
@@ -398,10 +457,25 @@ elm_hoversel_item_add(Evas_Object *obj,
const void *data)
{
ELM_HOVERSEL_CHECK(obj) NULL;
- ELM_HOVERSEL_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_hoversel_item_add(label, icon_file, icon_type, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_add(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ const char *icon_file = va_arg(*list, const char *);
+ Elm_Icon_Type icon_type = va_arg(*list, Elm_Icon_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Hoversel_Smart_Data *sd = _pd;
+ *ret = NULL;
Elm_Hoversel_Item *item = elm_widget_item_new(obj, Elm_Hoversel_Item);
- if (!item) return NULL;
+ if (!item) return;
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
@@ -414,7 +488,7 @@ elm_hoversel_item_add(Evas_Object *obj,
sd->items = eina_list_append(sd->items, item);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
@@ -447,3 +521,60 @@ elm_hoversel_item_icon_get(const Elm_Object_Item *it,
if (icon_group) *icon_group = item->icon_group;
if (icon_type) *icon_type = item->icon_type;
}
+
+static void
+_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_hoversel_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_hoversel_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_hoversel_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_hoversel_smart_parent_set),
+
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_hoversel_smart_admits_autorepeat_get),
+
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_SET), _hover_parent_set),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET), _hover_parent_get),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN), _hover_begin),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END), _hover_end),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET), _expanded_get),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD), _item_add),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_SET, "Set the Hover parent."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET, "Get the Hover parent."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET, "This sets the hoversel to expand horizontally."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET, "This returns whether the hoversel is set to expand horizontally."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN, "This triggers the hoversel popup from code, the same as if the user had clicked the button."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END, "This dismisses the hoversel popup as if the user had clicked outside the hover."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET, "Returns whether the hoversel is expanded."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_CLEAR, "This will remove all the children items from the hoversel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET, "Get the list of items within the given hoversel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD, "Add an item to the hoversel button."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_HOVERSEL_BASE_ID, op_desc, ELM_OBJ_HOVERSEL_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Hoversel_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_hoversel_class_get, &class_desc, ELM_OBJ_BUTTON_CLASS, EVAS_SMART_SELECTABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elc_hoversel.h b/src/lib/elc_hoversel.h
index 9c911f122..d74d7cc99 100644
--- a/src/lib/elc_hoversel.h
+++ b/src/lib/elc_hoversel.h
@@ -47,6 +47,154 @@
* @{
*/
+#define ELM_OBJ_HOVERSEL_CLASS elm_obj_hoversel_class_get()
+
+const Eo_Class *elm_obj_hoversel_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_HOVERSEL_BASE_ID;
+
+enum
+{
+ ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_SET,
+ ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET,
+ ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN,
+ ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END,
+ ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET,
+ ELM_OBJ_HOVERSEL_SUB_ID_CLEAR,
+ ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET,
+ ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD,
+ ELM_OBJ_HOVERSEL_SUB_ID_LAST
+};
+
+#define ELM_OBJ_HOVERSEL_ID(sub_id) (ELM_OBJ_HOVERSEL_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_hoversel_hover_parent_set
+ * @since 1.8
+ *
+ * @brief Set the Hover parent
+ *
+ * @param[in] parent
+ *
+ * @see elm_hoversel_hover_parent_set
+ */
+#define elm_obj_hoversel_hover_parent_set(parent) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+
+/**
+ * @def elm_obj_hoversel_hover_parent_get
+ * @since 1.8
+ *
+ * @brief Get the Hover parent
+ *
+ * @param[out] ret
+ *
+ * @see elm_hoversel_hover_parent_get
+ */
+#define elm_obj_hoversel_hover_parent_get(ret) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_hoversel_horizontal_set
+ * @since 1.8
+ *
+ * @brief This sets the hoversel to expand horizontally.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_hoversel_horizontal_set
+ */
+#define elm_obj_hoversel_horizontal_set(horizontal) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_hoversel_horizontal_get
+ * @since 1.8
+ *
+ * @brief This returns whether the hoversel is set to expand horizontally.
+ *
+ * @param[out] ret
+ *
+ * @see elm_hoversel_horizontal_get
+ */
+#define elm_obj_hoversel_horizontal_get(ret) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_hoversel_hover_begin
+ * @since 1.8
+ *
+ * @brief This triggers the hoversel popup from code, the same as if the user
+ * had clicked the button.
+ *
+ *
+ * @see elm_hoversel_hover_begin
+ */
+#define elm_obj_hoversel_hover_begin() ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_BEGIN)
+
+/**
+ * @def elm_obj_hoversel_hover_end
+ * @since 1.8
+ *
+ * @brief This dismisses the hoversel popup as if the user had clicked
+ * outside the hover.
+ *
+ *
+ * @see elm_hoversel_hover_end
+ */
+#define elm_obj_hoversel_hover_end() ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_HOVER_END)
+
+/**
+ * @def elm_obj_hoversel_expanded_get
+ * @since 1.8
+ *
+ * @brief Returns whether the hoversel is expanded.
+ *
+ * @param[out] ret
+ *
+ * @see elm_hoversel_expanded_get
+ */
+#define elm_obj_hoversel_expanded_get(ret) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_EXPANDED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_hoversel_clear
+ * @since 1.8
+ *
+ * @brief This will remove all the children items from the hoversel.
+ *
+ *
+ * @see elm_hoversel_clear
+ */
+#define elm_obj_hoversel_clear() ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_hoversel_items_get
+ * @since 1.8
+ *
+ * @brief Get the list of items within the given hoversel.
+ *
+ * @param[out] ret
+ *
+ * @see elm_hoversel_items_get
+ */
+#define elm_obj_hoversel_items_get(ret) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_hoversel_item_add
+ * @since 1.8
+ *
+ * @brief Add an item to the hoversel button
+ *
+ * @param[in] label
+ * @param[in] icon_file
+ * @param[in] icon_type
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_hoversel_item_add
+ */
+#define elm_obj_hoversel_item_add(label, icon_file, icon_type, func, data, ret) ELM_OBJ_HOVERSEL_ID(ELM_OBJ_HOVERSEL_SUB_ID_ITEM_ADD), EO_TYPECHECK(const char *, label), EO_TYPECHECK(const char *, icon_file), EO_TYPECHECK(Elm_Icon_Type, icon_type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
/**
* @brief Add a new Hoversel object
*
diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c
index 5efcc46ca..410f2ed1c 100644
--- a/src/lib/elc_multibuttonentry.c
+++ b/src/lib/elc_multibuttonentry.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_multibuttonentry.h"
-EAPI const char ELM_MULTIBUTTONENTRY_SMART_NAME[] = "elm_multibuttonentry";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_MULTIBUTTONENTRY_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_MULTIBUTTONENTRY_CLASS
+
+#define MY_CLASS_NAME "elm_multibuttonentry"
#define MAX_STR 256
#define MIN_W_ENTRY 10
@@ -32,21 +38,20 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_MULTIBUTTONENTRY_SMART_NAME, _elm_multibuttonentry,
- Elm_Multibuttonentry_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_multibuttonentry_smart_theme(Evas_Object *obj)
+static void
+_elm_multibuttonentry_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Eina_List *l;
Elm_Multibuttonentry_Item *item;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
+
+ Eina_Bool int_ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
EINA_LIST_FOREACH(sd->items, l, item)
{
@@ -60,7 +65,7 @@ _elm_multibuttonentry_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -111,6 +116,7 @@ _shrink_mode_set(Evas_Object *obj,
Evas_Coord button_min_width = 0;
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->view_state == MULTIBUTTONENTRY_VIEW_ENTRY)
evas_object_hide(sd->entry);
@@ -216,7 +222,7 @@ _shrink_mode_set(Evas_Object *obj,
Evas_Coord closed_height = 0;
const char *height_str =
edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "closed_height");
+ (wd->resize_obj, "closed_height");
if (height_str)
closed_height =
@@ -318,18 +324,22 @@ _view_update(Evas_Object *obj)
_visual_guide_text_set(obj);
}
-static Eina_Bool
-_elm_multibuttonentry_smart_on_focus(Evas_Object *obj)
+static void
+_elm_multibuttonentry_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->on_focus(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (elm_widget_focus_get(obj))
{
// ACCESS
- if ((_elm_config->access_mode == ELM_ACCESS_MODE_ON)) return EINA_TRUE;
+ if ((_elm_config->access_mode == ELM_ACCESS_MODE_ON)) goto end;
if (sd->editable)
{
@@ -354,7 +364,8 @@ _elm_multibuttonentry_smart_on_focus(Evas_Object *obj)
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -825,33 +836,38 @@ _button_item_add(Evas_Object *obj,
//FIXME: having an empty event handling function and reacting on Evas
//events on specific objects is crazy, someone should fix that.
-static Eina_Bool
-_elm_multibuttonentry_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type __UNUSED__,
- void *event_info __UNUSED__)
+static void
+_elm_multibuttonentry_smart_event(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void)src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ (void)type;
+ void *event_info = va_arg(*list, void *);
+ (void)event_info;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
// ACCESS
- if ((_elm_config->access_mode == ELM_ACCESS_MODE_ON)) return EINA_FALSE;
+ if ((_elm_config->access_mode == ELM_ACCESS_MODE_ON)) return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_multibuttonentry_smart_sizing_eval(Evas_Object *obj)
+_elm_multibuttonentry_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
Evas_Coord left, right, top, bottom;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_size_hint_min_get(sd->box, &minw, &minh);
edje_object_part_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "top.left.pad", NULL, NULL, &left, &top);
+ (wd->resize_obj, "top.left.pad", NULL, NULL, &left, &top);
edje_object_part_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "bottom.right.pad", NULL, NULL, &right,
+ (wd->resize_obj, "bottom.right.pad", NULL, NULL, &right,
&bottom);
minw += (left + right);
@@ -1055,12 +1071,13 @@ static void
_callbacks_register(Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_layout_signal_callback_add
(obj, "mouse,clicked,1", "*", _mouse_clicked_signal_cb, obj);
evas_object_event_callback_add
- (ELM_WIDGET_DATA(sd)->resize_obj, EVAS_CALLBACK_KEY_UP,
+ (wd->resize_obj, EVAS_CALLBACK_KEY_UP,
_layout_key_up_cb, obj);
evas_object_event_callback_add
@@ -1353,6 +1370,7 @@ _view_init(Evas_Object *obj)
const char *end_type;
ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->box = elm_box_add(obj);
@@ -1388,7 +1406,7 @@ _view_init(Evas_Object *obj)
sd->view_state = MULTIBUTTONENTRY_VIEW_ENTRY;
end_type = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "closed_button_type");
+ (wd->resize_obj, "closed_button_type");
if (!end_type || !strcmp(end_type, "label"))
{
sd->end = elm_label_add(obj);
@@ -1421,39 +1439,47 @@ _view_init(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_multibuttonentry_smart_text_set(Evas_Object *obj,
- const char *part,
- const char *label)
+static void
+_elm_multibuttonentry_smart_text_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+
if (!part || !strcmp(part, "default"))
{
if (label) _label_set(obj, label);
- return EINA_TRUE;
+ int_ret = EINA_TRUE;
}
else if (!strcmp(part, "guide"))
{
if (label) _guide_text_set(obj, label);
- return EINA_TRUE;
+ int_ret = EINA_TRUE;
}
- else return _elm_multibuttonentry_parent_sc->text_set(obj, part, label);
+ else eo_do_super(obj, elm_obj_layout_text_set(part, label, &int_ret));
+
+ if (ret) *ret = int_ret;
}
-static const char *
-_elm_multibuttonentry_smart_text_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_multibuttonentry_smart_text_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
if (!part || !strcmp(part, "default"))
{
- return sd->label_str;
+ *text = sd->label_str;
}
else if (!strcmp(part, "guide"))
{
- return sd->guide_text_str;
+ *text = sd->guide_text_str;
}
- else return _elm_multibuttonentry_parent_sc->text_get(obj, part);
+ else
+ eo_do_super(obj, elm_obj_layout_text_get(part, text));
}
static char *
@@ -1497,11 +1523,12 @@ _access_info_cb(void *data __UNUSED__,
}
static void
-_elm_multibuttonentry_smart_add(Evas_Object *obj)
+_elm_multibuttonentry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Multibuttonentry_Smart_Data);
+ Elm_Multibuttonentry_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set
(obj, "multibuttonentry", "base", elm_widget_style_get(obj));
@@ -1520,7 +1547,7 @@ _elm_multibuttonentry_smart_add(Evas_Object *obj)
_callbacks_register(obj);
// ACCESS
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("multi button entry"));
_elm_access_callback_set
@@ -1528,11 +1555,11 @@ _elm_multibuttonentry_smart_add(Evas_Object *obj)
}
static void
-_elm_multibuttonentry_smart_del(Evas_Object *obj)
+_elm_multibuttonentry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Multibuttonentry_Item *item;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
EINA_LIST_FREE (sd->items, item)
{
@@ -1551,34 +1578,54 @@ _elm_multibuttonentry_smart_del(Evas_Object *obj)
if (sd->end) evas_object_del(sd->end);
if (sd->rect_for_end) evas_object_del(sd->rect_for_end);
- ELM_WIDGET_CLASS(_elm_multibuttonentry_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_multibuttonentry_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_multibuttonentry_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_multibuttonentry_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_multibuttonentry_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_multibuttonentry_smart_focus_next_enable;
+}
+
+static void
+_elm_multibuttonentry_smart_focus_next(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
Eina_List *items = NULL;
Eina_List *l = NULL;
Elm_Multibuttonentry_Item *it;
Evas_Object *ao;
Evas_Object *po;
- Eina_Bool ret = EINA_FALSE;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
if (!elm_widget_focus_get(obj))
{
*next = (Evas_Object *)obj;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if (sd->label)
{
po = (Evas_Object *)edje_object_part_object_get(sd->label, "mbe.label");
ao = evas_object_data_get(po, "_part_access_obj");
- ret = elm_widget_focus_get(ao);
+ int_ret = elm_widget_focus_get(ao);
items = eina_list_append(items, ao);
}
@@ -1587,24 +1634,22 @@ _elm_multibuttonentry_smart_focus_next(const Evas_Object *obj,
po = (Evas_Object *)edje_object_part_object_get
(it->button, "elm.btn.text");
ao = evas_object_data_get(po, "_part_access_obj");
- ret = ret || elm_widget_focus_get(ao);
+ int_ret = int_ret || elm_widget_focus_get(ao);
items = eina_list_append(items, ao);
}
if (sd->entry)
{
- ret = ret || elm_widget_focus_get(sd->entry);
+ int_ret = int_ret || elm_widget_focus_get(sd->entry);
/* elm_widget_list_focus_liset_next_get() check parent of item
because parent sd->entry is not multibuttnentry but sd->box
so append sd->box instead of sd->entry, is this proper? */
items = eina_list_append(items, sd->box);
}
- if (ret)
- return elm_widget_focus_list_next_get
+ if (int_ret)
+ *ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
-
- return EINA_FALSE;
}
static void
@@ -1624,94 +1669,67 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
static void
-_elm_multibuttonentry_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_MULTIBUTTONENTRY_CHECK(obj);
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_multibuttonentry_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(obj, is_access);
-}
-
-static void
-_elm_multibuttonentry_smart_set_user(Elm_Multibuttonentry_Smart_Class *sc)
+_elm_multibuttonentry_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_multibuttonentry_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_multibuttonentry_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_multibuttonentry_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_multibuttonentry_smart_event;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_multibuttonentry_smart_on_focus;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_multibuttonentry_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_multibuttonentry_smart_text_get;
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_multibuttonentry_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_multibuttonentry_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_multibuttonentry_smart_access;
-}
-
-EAPI const Elm_Multibuttonentry_Smart_Class *
-elm_multibuttonentry_smart_class_get(void)
-{
- static Elm_Multibuttonentry_Smart_Class _sc =
- ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NAME_VERSION
- (ELM_MULTIBUTTONENTRY_SMART_NAME);
- static const Elm_Multibuttonentry_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_multibuttonentry_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_multibuttonentry_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(obj, _elm_multibuttonentry_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_multibuttonentry_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_multibuttonentry_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Evas_Object *
elm_multibuttonentry_entry_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_entry_get(&ret));
+ return ret;
+}
+
+static void
+_entry_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return sd->entry;
+ *ret = sd->entry;
}
EAPI Eina_Bool
elm_multibuttonentry_expanded_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) EINA_FALSE;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_expanded_get(&ret));
+ return ret;
+}
+
+static void
+_expanded_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK ?
+ *ret = sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK ?
EINA_FALSE : EINA_TRUE;
}
@@ -1720,7 +1738,14 @@ elm_multibuttonentry_expanded_set(Evas_Object *obj,
Eina_Bool expanded)
{
ELM_MULTIBUTTONENTRY_CHECK(obj);
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_multibuttonentry_expanded_set(expanded));
+}
+
+static void
+_expanded_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool expanded = va_arg(*list, int);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
if (((sd->view_state == MULTIBUTTONENTRY_VIEW_SHRINK) ?
EINA_FALSE : EINA_TRUE) == expanded) return;
@@ -1736,7 +1761,14 @@ elm_multibuttonentry_editable_set(Evas_Object *obj,
Eina_Bool editable)
{
ELM_MULTIBUTTONENTRY_CHECK(obj);
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_multibuttonentry_editable_set(editable));
+}
+
+static void
+_editable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool editable = va_arg(*list, int);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
editable = !!editable;
if (sd->editable == editable) return;
@@ -1755,9 +1787,18 @@ EAPI Eina_Bool
elm_multibuttonentry_editable_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) - 1;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_editable_get(&ret));
+ return ret;
+}
+
+static void
+_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return sd->editable;
+ *ret = sd->editable;
}
EAPI Elm_Object_Item *
@@ -1766,7 +1807,19 @@ elm_multibuttonentry_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
void *data)
{
- return _button_item_add
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_multibuttonentry_item_prepend(label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = _button_item_add
(obj, label, MULTIBUTTONENTRY_POS_START, NULL, func, data);
}
@@ -1776,7 +1829,19 @@ elm_multibuttonentry_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
void *data)
{
- return _button_item_add
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_multibuttonentry_item_append(label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = _button_item_add
(obj, label, MULTIBUTTONENTRY_POS_END, NULL, func, data);
}
@@ -1787,7 +1852,20 @@ elm_multibuttonentry_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
void *data)
{
- return _button_item_add
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_multibuttonentry_item_insert_before(before, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Object_Item *before = va_arg(*list, Elm_Object_Item *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = _button_item_add
(obj, label, MULTIBUTTONENTRY_POS_BEFORE, before, func, data);
}
@@ -1798,7 +1876,20 @@ elm_multibuttonentry_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
void *data)
{
- return _button_item_add
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_multibuttonentry_item_insert_after(after, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Object_Item *after = va_arg(*list, Elm_Object_Item *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = _button_item_add
(obj, label, MULTIBUTTONENTRY_POS_AFTER, after, func, data);
}
@@ -1806,36 +1897,72 @@ EAPI const Eina_List *
elm_multibuttonentry_items_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_items_get(&ret));
+ return ret;
+}
+
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return sd->items;
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
elm_multibuttonentry_first_item_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_first_item_get(&ret));
+ return ret;
+}
+
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return eina_list_data_get(sd->items);
+ *ret = eina_list_data_get(sd->items);
}
EAPI Elm_Object_Item *
elm_multibuttonentry_last_item_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_last_item_get(&ret));
+ return ret;
+}
- return eina_list_data_get(eina_list_last(sd->items));
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
+
+ *ret = eina_list_data_get(eina_list_last(sd->items));
}
EAPI Elm_Object_Item *
elm_multibuttonentry_selected_item_get(const Evas_Object *obj)
{
ELM_MULTIBUTTONENTRY_CHECK(obj) NULL;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_multibuttonentry_selected_item_get(&ret));
+ return ret;
+}
+
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- return sd->selected_it;
+ *ret = sd->selected_it;
}
EAPI void
@@ -1862,10 +1989,15 @@ elm_multibuttonentry_item_selected_get(const Elm_Object_Item *it)
EAPI void
elm_multibuttonentry_clear(Evas_Object *obj)
{
- Elm_Multibuttonentry_Item *item;
-
ELM_MULTIBUTTONENTRY_CHECK(obj);
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_multibuttonentry_clear());
+}
+
+static void
+_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Multibuttonentry_Item *item;
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
if (sd->items)
{
@@ -1941,13 +2073,23 @@ elm_multibuttonentry_item_filter_append(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func,
void *data)
{
+
+ ELM_MULTIBUTTONENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_multibuttonentry_item_filter_append(func, data));
+}
+
+static void
+_item_filter_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Multibuttonentry_Item_Filter_Cb func = va_arg(*list, Elm_Multibuttonentry_Item_Filter_Cb);
+ void *data = va_arg(*list, void *);
+
Elm_Multibuttonentry_Item_Filter *new_item_filter = NULL;
Elm_Multibuttonentry_Item_Filter *_item_filter = NULL;
Eina_List *l;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
- ELM_MULTIBUTTONENTRY_CHECK(obj);
EINA_SAFETY_ON_NULL_RETURN(func);
new_item_filter = _filter_new(func, data);
@@ -1970,12 +2112,21 @@ elm_multibuttonentry_item_filter_prepend(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func,
void *data)
{
+ ELM_MULTIBUTTONENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_multibuttonentry_item_filter_prepend(func, data));
+}
+
+static void
+_item_filter_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Multibuttonentry_Item_Filter_Cb func = va_arg(*list, Elm_Multibuttonentry_Item_Filter_Cb);
+ void *data = va_arg(*list, void *);
+
Elm_Multibuttonentry_Item_Filter *new_item_filter = NULL;
Elm_Multibuttonentry_Item_Filter *_item_filter = NULL;
Eina_List *l;
- ELM_MULTIBUTTONENTRY_CHECK(obj);
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
new_item_filter = _filter_new(func, data);
@@ -1998,10 +2149,20 @@ elm_multibuttonentry_item_filter_remove(Evas_Object *obj,
Elm_Multibuttonentry_Item_Filter_Cb func,
void *data)
{
+ ELM_MULTIBUTTONENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_multibuttonentry_item_filter_remove(func, data));
+}
+
+static void
+_item_filter_remove(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Multibuttonentry_Item_Filter_Cb func = va_arg(*list, Elm_Multibuttonentry_Item_Filter_Cb);
+ void *data = va_arg(*list, void *);
+
Eina_List *l;
Elm_Multibuttonentry_Item_Filter *item_filter;
- ELM_MULTIBUTTONENTRY_DATA_GET(obj, sd);
+ Elm_Multibuttonentry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
@@ -2016,3 +2177,80 @@ elm_multibuttonentry_item_filter_remove(Evas_Object *obj,
}
}
}
+
+static void
+_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_multibuttonentry_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_multibuttonentry_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_multibuttonentry_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_multibuttonentry_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_multibuttonentry_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_multibuttonentry_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_multibuttonentry_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_multibuttonentry_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_multibuttonentry_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_multibuttonentry_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_multibuttonentry_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_multibuttonentry_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ENTRY_GET), _entry_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_GET), _expanded_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_SET), _expanded_set),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_SET), _editable_set),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_GET), _editable_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_APPEND), _item_filter_append),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_PREPEND), _item_filter_prepend),
+ EO_OP_FUNC(ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_REMOVE), _item_filter_remove),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
+ _elm_multibuttonentry_smart_focus_next_enable = EINA_TRUE;
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ENTRY_GET, "Get the entry of the multibuttonentry object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_GET, "Get the value of expanded state."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_SET, "Set/Unset the multibuttonentry to expanded state."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_SET, "Sets if the multibuttonentry is to be editable or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_GET, "Gets whether the multibuttonentry is editable or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_PREPEND, "Prepend a new item to the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_APPEND, "Append a new item to the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_BEFORE, "Add a new item to the multibuttonentry before the indicated object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_AFTER, "Add a new item to the multibuttonentry after the indicated object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEMS_GET, "Get a list of items in the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_FIRST_ITEM_GET, "Get the first item in the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST_ITEM_GET, "Get the last item in the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_SELECTED_ITEM_GET, "Get the selected item in the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_CLEAR, "Remove all items in the multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_APPEND, "Append an item filter function for text inserted in the Multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_PREPEND, "Prepend a filter function for text inserted in the Multibuttonentry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_REMOVE, "Remove a filter from the list."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_MULTIBUTTONENTRY_BASE_ID, op_desc, ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Multibuttonentry_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_multibuttonentry_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_multibuttonentry.h b/src/lib/elc_multibuttonentry.h
index 219fb9d80..a1c359e8d 100644
--- a/src/lib/elc_multibuttonentry.h
+++ b/src/lib/elc_multibuttonentry.h
@@ -50,6 +50,256 @@
* @li @ref elm_object_item_part_text_get
*/
+#define ELM_OBJ_MULTIBUTTONENTRY_CLASS elm_obj_multibuttonentry_class_get()
+
+const Eo_Class *elm_obj_multibuttonentry_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_MULTIBUTTONENTRY_BASE_ID;
+
+enum
+{
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ENTRY_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_SET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEMS_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_CLEAR,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_APPEND,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_PREPEND,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_REMOVE,
+ ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST
+};
+
+#define ELM_OBJ_MULTIBUTTONENTRY_ID(sub_id) (ELM_OBJ_MULTIBUTTONENTRY_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_multibuttonentry_entry_get
+ * @since 1.8
+ *
+ * Get the entry of the multibuttonentry object
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_entry_get
+ */
+#define elm_obj_multibuttonentry_entry_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ENTRY_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_expanded_get
+ * @since 1.8
+ *
+ * Get the value of expanded state.
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_expanded_get
+ */
+#define elm_obj_multibuttonentry_expanded_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_expanded_set
+ * @since 1.8
+ *
+ * Set/Unset the multibuttonentry to expanded state.
+ *
+ * @param[in] expanded
+ *
+ * @see elm_multibuttonentry_expanded_set
+ */
+#define elm_obj_multibuttonentry_expanded_set(expanded) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EXPANDED_SET), EO_TYPECHECK(Eina_Bool, expanded)
+
+/**
+ * @def elm_obj_multibuttonentry_editable_set
+ * @since 1.8
+ *
+ * Sets if the multibuttonentry is to be editable or not.
+ *
+ * @param[in] editable
+ *
+ * @see elm_multibuttonentry_editable_set
+ */
+#define elm_obj_multibuttonentry_editable_set(editable) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, editable)
+
+/**
+ * @def elm_obj_multibuttonentry_editable_get
+ * @since 1.8
+ *
+ * Gets whether the multibuttonentry is editable or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_editable_get
+ */
+#define elm_obj_multibuttonentry_editable_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_item_prepend
+ * @since 1.8
+ *
+ * Prepend a new item to the multibuttonentry
+ *
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_item_prepend
+ */
+#define elm_obj_multibuttonentry_item_prepend(label, func, data, ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_item_append
+ * @since 1.8
+ *
+ * Append a new item to the multibuttonentry
+ *
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_item_append
+ */
+#define elm_obj_multibuttonentry_item_append(label, func, data, ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_item_insert_before
+ * @since 1.8
+ *
+ * Add a new item to the multibuttonentry before the indicated object
+ *
+ * @param[in] before
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_item_insert_before
+ */
+#define elm_obj_multibuttonentry_item_insert_before(before, label, func, data, ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_item_insert_after
+ * @since 1.8
+ *
+ * Add a new item to the multibuttonentry after the indicated object
+ *
+ * @param[in] after
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_item_insert_after
+ */
+#define elm_obj_multibuttonentry_item_insert_after(after, label, func, data, ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_items_get
+ * @since 1.8
+ *
+ * Get a list of items in the multibuttonentry
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_items_get
+ */
+#define elm_obj_multibuttonentry_items_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in the multibuttonentry
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_first_item_get
+ */
+#define elm_obj_multibuttonentry_first_item_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in the multibuttonentry
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_last_item_get
+ */
+#define elm_obj_multibuttonentry_last_item_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item in the multibuttonentry
+ *
+ * @param[out] ret
+ *
+ * @see elm_multibuttonentry_selected_item_get
+ */
+#define elm_obj_multibuttonentry_selected_item_get(ret) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_multibuttonentry_clear
+ * @since 1.8
+ *
+ * Remove all items in the multibuttonentry.
+ *
+ *
+ * @see elm_multibuttonentry_clear
+ */
+#define elm_obj_multibuttonentry_clear() ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_multibuttonentry_item_filter_append
+ * @since 1.8
+ *
+ * Append an item filter function for text inserted in the Multibuttonentry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_multibuttonentry_item_filter_append
+ */
+#define elm_obj_multibuttonentry_item_filter_append(func, data) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_APPEND), EO_TYPECHECK(Elm_Multibuttonentry_Item_Filter_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_multibuttonentry_item_filter_prepend
+ * @since 1.8
+ *
+ * Prepend a filter function for text inserted in the Multibuttonentry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_multibuttonentry_item_filter_prepend
+ */
+#define elm_obj_multibuttonentry_item_filter_prepend(func, data) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_PREPEND), EO_TYPECHECK(Elm_Multibuttonentry_Item_Filter_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_multibuttonentry_item_filter_remove
+ * @since 1.8
+ *
+ * Remove a filter from the list
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_multibuttonentry_item_filter_remove
+ */
+#define elm_obj_multibuttonentry_item_filter_remove(func, data) ELM_OBJ_MULTIBUTTONENTRY_ID(ELM_OBJ_MULTIBUTTONENTRY_SUB_ID_ITEM_FILTER_REMOVE), EO_TYPECHECK(Elm_Multibuttonentry_Item_Filter_Cb, func), EO_TYPECHECK(void *, data)
/**
* @addtogroup Multibuttonentry
* @{
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 39f0dd734..c73e550de 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_naviframe.h"
+#include "elm_widget_container.h"
-EAPI const char ELM_NAVIFRAME_SMART_NAME[] = "elm_naviframe";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_NAVIFRAME_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_NAVIFRAME_CLASS
+
+#define MY_CLASS_NAME "elm_naviframe"
static const char CONTENT_PART[] = "elm.swallow.content";
static const char PREV_BTN_PART[] = "elm.swallow.prev_btn";
@@ -17,10 +24,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_NAVIFRAME_SMART_NAME, _elm_naviframe, Elm_Naviframe_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_item_content_del_cb(void *data,
Evas *e __UNUSED__,
@@ -291,15 +294,16 @@ _item_title_visible_update(Elm_Naviframe_Item *nit)
}
-static Eina_Bool
-_elm_naviframe_smart_theme(Evas_Object *obj)
+static void
+_elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Elm_Naviframe_Item *it;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Naviframe_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_naviframe_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ eo_do_super(obj, elm_wdg_theme(ret));
+ if (*ret == EINA_FALSE) return;
EINA_INLIST_FOREACH(sd->stack, it)
{
@@ -309,7 +313,7 @@ _elm_naviframe_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
static void
@@ -790,13 +794,13 @@ _item_signal_emit_hook(Elm_Object_Item *it,
}
static void
-_elm_naviframe_smart_sizing_eval(Evas_Object *obj)
+_elm_naviframe_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
Elm_Naviframe_Item *it;
Evas_Coord x, y, w, h;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Naviframe_Smart_Data *sd = _pd;
evas_object_geometry_get(obj, &x, &y, &w, &h);
EINA_INLIST_FOREACH(sd->stack, it)
@@ -866,82 +870,98 @@ _back_btn_new(Evas_Object *obj, const char *title_label)
}
static void
-_elm_naviframe_smart_signal(Evas_Object *obj,
- const char *emission,
- const char *source)
+_elm_naviframe_smart_signal_emit(Eo *obj, void *_pd, va_list *list)
{
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Naviframe_Smart_Data *sd = _pd;
+
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
if (!sd->stack) return;
- _elm_naviframe_parent_sc->signal(obj, emission, source);
+ eo_do_super(obj, elm_obj_layout_signal_emit(emission, source));
}
/* content/text smart functions proxying things to the top item, which
* is the resize object of the layout */
-static Eina_Bool
-_elm_naviframe_smart_text_set(Evas_Object *obj,
- const char *part,
- const char *label)
+static void
+_elm_naviframe_smart_text_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Object_Item *it;
+ const char *part = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
it = elm_naviframe_top_item_get(obj);
- if (!it) return EINA_FALSE;
+ if (!it) return;
elm_object_item_part_text_set(it, part, label);
- return !strcmp(elm_object_item_part_text_get(it, part), label);
+ Eina_Bool int_ret = !strcmp(elm_object_item_part_text_get(it, part), label);
+ if (ret) *ret = int_ret;
}
-static const char *
-_elm_naviframe_smart_text_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_naviframe_smart_text_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
+ const char *part = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
+ *text = NULL;
- if (!it) return NULL;
+ if (!it) return;
- return elm_object_item_part_text_get(it, part);
+ *text = elm_object_item_part_text_get(it, part);
}
/* we have to keep a "manual" set here because of the callbacks on the
* children */
-static Eina_Bool
-_elm_naviframe_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_naviframe_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Object_Item *it;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
it = elm_naviframe_top_item_get(obj);
- if (!it) return EINA_FALSE;
+ if (!it) return;
elm_object_item_part_content_set(it, part, content);
- return content == elm_object_item_part_content_get(it, part);
+ if(content == elm_object_item_part_content_get(it, part))
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_naviframe_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_naviframe_smart_content_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
- if (!it) return NULL;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **content = va_arg(*list, Evas_Object **);
+ *content = NULL;
+
+ if (!it) return;
- return elm_object_item_part_content_get(it, part);
+ *content = elm_object_item_part_content_get(it, part);
}
-static Evas_Object *
-_elm_naviframe_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_naviframe_smart_content_unset(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
- if (!it) return NULL;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **content = va_arg(*list, Evas_Object **);
+ *content = NULL;
+ if (!it) return;
- return elm_object_item_part_content_unset(it, part);
+ *content = elm_object_item_part_content_unset(it, part);
}
static void
@@ -1099,7 +1119,6 @@ _item_new(Evas_Object *obj,
return it;
}
-
static void
_on_obj_size_hints_changed(void *data __UNUSED__, Evas *e __UNUSED__,
Evas_Object *obj, void *event_info __UNUSED__)
@@ -1128,25 +1147,31 @@ _on_obj_size_hints_changed(void *data __UNUSED__, Evas *e __UNUSED__,
}
}
-static Eina_Bool
-_elm_naviframe_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_naviframe_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Object *ao;
- Eina_Bool ret;
+
Eina_List *l = NULL;
Elm_Naviframe_Item *top_it;
Elm_Naviframe_Content_Item_Pair *content_pair = NULL;
Elm_Naviframe_Text_Item_Pair *text_pair = NULL;
void *(*list_data_get)(const Eina_List *list);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
- if (!top_it) return EINA_FALSE;
+ if (!top_it) return;
if (!top_it->title_visible)
{
- return elm_widget_focus_next_get(top_it->content, dir, next);
+ int_ret = elm_widget_focus_next_get(top_it->content, dir, next);
+ if (ret) *ret = int_ret;
+ return;
}
list_data_get = eina_list_data_get;
@@ -1188,21 +1213,21 @@ _elm_naviframe_smart_focus_next(const Evas_Object *obj,
}
l = eina_list_append(l, VIEW(top_it));
- ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next);
+ if (ret) *ret = int_ret;
eina_list_free(l);
-
- return ret;
}
static void
-_elm_naviframe_smart_add(Evas_Object *obj)
+_elm_naviframe_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Naviframe_Smart_Data);
+ Elm_Naviframe_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- priv->dummy_edje = ELM_WIDGET_DATA(priv)->resize_obj =
+ priv->dummy_edje = wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_naviframe_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->auto_pushed = EINA_TRUE;
priv->freeze_events = EINA_TRUE;
@@ -1213,11 +1238,11 @@ _elm_naviframe_smart_add(Evas_Object *obj)
}
static void
-_elm_naviframe_smart_del(Evas_Object *obj)
+_elm_naviframe_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Naviframe_Item *it;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Naviframe_Smart_Data *sd = _pd;
sd->on_deletion = EINA_TRUE;
@@ -1233,41 +1258,20 @@ _elm_naviframe_smart_del(Evas_Object *obj)
if (sd->animator) ecore_animator_del(sd->animator);
- ELM_WIDGET_CLASS(_elm_naviframe_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_naviframe_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_naviframe_smart_access(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Naviframe_Smart_Data *sd = _pd;
Elm_Naviframe_Item *it;
- ELM_NAVIFRAME_CHECK(obj);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
-
+ Eina_Bool is_access = va_arg(*list, int);
EINA_INLIST_FOREACH(sd->stack, it)
_access_obj_process(it, is_access);
}
-static void
-_elm_naviframe_smart_set_user(Elm_Naviframe_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_naviframe_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_naviframe_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_naviframe_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_naviframe_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->access = _elm_naviframe_smart_access;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_naviframe_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_naviframe_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_naviframe_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->signal = _elm_naviframe_smart_signal;
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_naviframe_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_naviframe_smart_text_get;
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_naviframe_smart_sizing_eval;
-}
-
static Eina_Bool
_push_transition_cb(void *data)
{
@@ -1312,39 +1316,26 @@ _pop_transition_cb(void *data)
return ECORE_CALLBACK_CANCEL;
}
-EAPI const Elm_Naviframe_Smart_Class *
-elm_naviframe_smart_class_get(void)
-{
- static Elm_Naviframe_Smart_Class _sc =
- ELM_NAVIFRAME_SMART_CLASS_INIT_NAME_VERSION
- (ELM_NAVIFRAME_SMART_NAME);
- static const Elm_Naviframe_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_naviframe_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_naviframe_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_naviframe_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Elm_Object_Item *
@@ -1355,16 +1346,31 @@ elm_naviframe_item_push(Evas_Object *obj,
Evas_Object *content,
const char *item_style)
{
+ ELM_NAVIFRAME_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_naviframe_item_push(title_label, prev_btn, next_btn, content, item_style, &ret));
+ return ret;
+}
+
+static void
+_item_push(Eo *obj, void *_pd, va_list *list)
+{
Elm_Naviframe_Item *prev_it, *it;
- ELM_NAVIFRAME_CHECK(obj) NULL;
+ Elm_Naviframe_Smart_Data *sd = _pd;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ const char *title_label = va_arg(*list, const char *);
+ Evas_Object *prev_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *next_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ const char *item_style = va_arg(*list, const char *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
prev_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
it = _item_new(obj, prev_it,
title_label, prev_btn, next_btn, content, item_style);
- if (!it) return NULL;
+ if (!it) return;
evas_object_show(VIEW(it));
elm_widget_resize_object_set(obj, VIEW(it));
@@ -1407,7 +1413,7 @@ elm_naviframe_item_push(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1419,11 +1425,28 @@ elm_naviframe_item_insert_before(Evas_Object *obj,
Evas_Object *content,
const char *item_style)
{
+ ELM_NAVIFRAME_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_naviframe_item_insert_before(before, title_label, prev_btn, next_btn, content, item_style, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj, void *_pd, va_list *list)
+{
Elm_Naviframe_Item *it, *prev_it = NULL;
- ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(before, NULL);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Object_Item *before = va_arg(*list, Elm_Object_Item *);
+ const char *title_label = va_arg(*list, const char *);
+ Evas_Object *prev_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *next_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ const char *item_style = va_arg(*list, const char *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ ELM_NAVIFRAME_ITEM_CHECK(before);
+ Elm_Naviframe_Smart_Data *sd = _pd;
it = (Elm_Naviframe_Item *)before;
if (EINA_INLIST_GET(it)->prev)
@@ -1432,7 +1455,7 @@ elm_naviframe_item_insert_before(Evas_Object *obj,
it = _item_new(obj, prev_it,
title_label, prev_btn, next_btn, content, item_style);
- if (!it) return NULL;
+ if (!it) return;
sd->stack = eina_inlist_prepend_relative
(sd->stack, EINA_INLIST_GET(it),
@@ -1440,7 +1463,7 @@ elm_naviframe_item_insert_before(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1452,16 +1475,33 @@ elm_naviframe_item_insert_after(Evas_Object *obj,
Evas_Object *content,
const char *item_style)
{
+ ELM_NAVIFRAME_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_naviframe_item_insert_after(after, title_label, prev_btn, next_btn, content, item_style, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj, void *_pd, va_list *list)
+{
Elm_Naviframe_Item *it;
Eina_Bool top_inserted = EINA_FALSE;
- ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_ITEM_CHECK_OR_RETURN(after, NULL);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Object_Item *after = va_arg(*list, Elm_Object_Item *);
+ const char *title_label = va_arg(*list, const char *);
+ Evas_Object *prev_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *next_btn = va_arg(*list, Evas_Object *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ const char *item_style = va_arg(*list, const char *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ ELM_NAVIFRAME_ITEM_CHECK(after);
+ Elm_Naviframe_Smart_Data *sd = _pd;
it = _item_new(obj, (Elm_Naviframe_Item *)after,
title_label, prev_btn, next_btn, content, item_style);
- if (!it) return NULL;
+ if (!it) return;
if (elm_naviframe_top_item_get(obj) == after) top_inserted = EINA_TRUE;
@@ -1480,20 +1520,31 @@ elm_naviframe_item_insert_after(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Evas_Object *
elm_naviframe_item_pop(Evas_Object *obj)
{
+ ELM_NAVIFRAME_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_naviframe_item_pop(&ret));
+ return ret;
+}
+
+static void
+_item_pop(Eo *obj, void *_pd, va_list *list)
+{
Elm_Naviframe_Item *it, *prev_it = NULL;
Evas_Object *content = NULL;
- ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+
+ Elm_Naviframe_Smart_Data *sd = _pd;
it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
- if (!it) return NULL;
+ if (!it) return;
if (sd->preserve)
content = it->content;
@@ -1541,7 +1592,7 @@ elm_naviframe_item_pop(Evas_Object *obj)
else
elm_widget_item_del(it);
- return content;
+ *ret = content;
}
EAPI void
@@ -1639,10 +1690,18 @@ EAPI void
elm_naviframe_item_simple_promote(Evas_Object *obj,
Evas_Object *content)
{
+ ELM_NAVIFRAME_CHECK(obj);
+ eo_do(obj, elm_obj_naviframe_item_simple_promote(content));
+}
+
+static void
+_item_simple_promote(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Naviframe_Item *itr;
- ELM_NAVIFRAME_CHECK(obj);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+
+ Elm_Naviframe_Smart_Data *sd = _pd;
EINA_INLIST_FOREACH(sd->stack, itr)
{
@@ -1659,7 +1718,14 @@ elm_naviframe_content_preserve_on_pop_set(Evas_Object *obj,
Eina_Bool preserve)
{
ELM_NAVIFRAME_CHECK(obj);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_naviframe_content_preserve_on_pop_set(preserve));
+}
+
+static void
+_content_preserve_on_pop_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool preserve = va_arg(*list, int);
+ Elm_Naviframe_Smart_Data *sd = _pd;
sd->preserve = !!preserve;
}
@@ -1668,19 +1734,38 @@ EAPI Eina_Bool
elm_naviframe_content_preserve_on_pop_get(const Evas_Object *obj)
{
ELM_NAVIFRAME_CHECK(obj) EINA_FALSE;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_naviframe_content_preserve_on_pop_get(&ret));
+ return ret;
+}
- return sd->preserve;
+static void
+_content_preserve_on_pop_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Naviframe_Smart_Data *sd = _pd;
+
+ *ret = sd->preserve;
}
EAPI Elm_Object_Item *
elm_naviframe_top_item_get(const Evas_Object *obj)
{
ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_naviframe_top_item_get(&ret));
+ return ret;
+}
+
+static void
+_top_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Naviframe_Smart_Data *sd = _pd;
- if (!sd->stack) return NULL;
- return (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET
+ if (!sd->stack) return;
+ *ret = (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET
(sd->stack->last, Elm_Naviframe_Item));
}
@@ -1688,10 +1773,20 @@ EAPI Elm_Object_Item *
elm_naviframe_bottom_item_get(const Evas_Object *obj)
{
ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_naviframe_bottom_item_get(&ret));
+ return ret;
+}
- if (!sd->stack) return NULL;
- return (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET
+static void
+_bottom_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Naviframe_Smart_Data *sd = _pd;
+
+ if (!sd->stack) return;
+ *ret = (Elm_Object_Item *)(EINA_INLIST_CONTAINER_GET
(sd->stack, Elm_Naviframe_Item));
}
@@ -1752,7 +1847,14 @@ elm_naviframe_prev_btn_auto_pushed_set(Evas_Object *obj,
Eina_Bool auto_pushed)
{
ELM_NAVIFRAME_CHECK(obj);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_naviframe_prev_btn_auto_pushed_set(auto_pushed));
+}
+
+static void
+_prev_btn_auto_pushed_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool auto_pushed = va_arg(*list, int);
+ Elm_Naviframe_Smart_Data *sd = _pd;
sd->auto_pushed = !!auto_pushed;
}
@@ -1761,24 +1863,40 @@ EAPI Eina_Bool
elm_naviframe_prev_btn_auto_pushed_get(const Evas_Object *obj)
{
ELM_NAVIFRAME_CHECK(obj) EINA_FALSE;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_naviframe_prev_btn_auto_pushed_get(&ret));
+ return ret;
+}
+
+static void
+_prev_btn_auto_pushed_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Naviframe_Smart_Data *sd = _pd;
- return sd->auto_pushed;
+ *ret = sd->auto_pushed;
}
EAPI Eina_List *
elm_naviframe_items_get(const Evas_Object *obj)
{
- Eina_List *ret = NULL;
+ ELM_NAVIFRAME_CHECK(obj) NULL;
+ Eina_List *ret;
+ eo_do((Eo *) obj, elm_obj_naviframe_items_get(&ret));
+ return ret;
+}
+
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ *ret = NULL;
Elm_Naviframe_Item *itr;
- ELM_NAVIFRAME_CHECK(obj) NULL;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Elm_Naviframe_Smart_Data *sd = _pd;
EINA_INLIST_FOREACH(sd->stack, itr)
- ret = eina_list_append(ret, itr);
-
- return ret;
+ *ret = eina_list_append(*ret, itr);
}
EAPI void
@@ -1786,7 +1904,14 @@ elm_naviframe_event_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_NAVIFRAME_CHECK(obj);
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_naviframe_event_enabled_set(enabled));
+}
+
+static void
+_event_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Naviframe_Smart_Data *sd = _pd;
enabled = !!enabled;
if (sd->freeze_events == !enabled) return;
@@ -1797,7 +1922,96 @@ EAPI Eina_Bool
elm_naviframe_event_enabled_get(const Evas_Object *obj)
{
ELM_NAVIFRAME_CHECK(obj) EINA_FALSE;
- ELM_NAVIFRAME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_naviframe_event_enabled_get(&ret));
+ return ret;
+}
- return !sd->freeze_events;
+static void
+_event_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Naviframe_Smart_Data *sd = _pd;
+
+ *ret = !sd->freeze_events;
+}
+
+static void
+_elm_naviframe_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
+
+static void
+_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_naviframe_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_naviframe_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_naviframe_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_naviframe_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_naviframe_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_naviframe_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_naviframe_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_naviframe_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_naviframe_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT), _elm_naviframe_smart_signal_emit),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_naviframe_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_naviframe_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_naviframe_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_PUSH), _item_push),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_POP), _item_pop),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_SIMPLE_PROMOTE), _item_simple_promote),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_SET), _content_preserve_on_pop_set),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_GET), _content_preserve_on_pop_get),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_TOP_ITEM_GET), _top_item_get),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_BOTTOM_ITEM_GET), _bottom_item_get),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_SET), _prev_btn_auto_pushed_set),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_GET), _prev_btn_auto_pushed_get),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_SET), _event_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_GET), _event_enabled_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const
+Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_PUSH, "Push a new item to the top of the naviframe stack (and show it)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_BEFORE, "Insert a new item into the naviframe before item before."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_AFTER, "Insert a new item into the naviframe after item after."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_POP, "Pop an item that is on top of the stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_SIMPLE_PROMOTE, "Simple version of item_promote."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_SET, "preserve the content objects when items are popped."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_GET, "Get a value whether preserve mode is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_TOP_ITEM_GET, "Get a top item on the naviframe stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_BOTTOM_ITEM_GET, "Get a bottom item on the naviframe stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_SET, "Set creating prev button automatically or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_GET, "Get a value whether prev button(back button) will be auto pushed or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_ITEMS_GET, "Get a list of all the naviframe items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_SET, "Set the event enabled when pushing/popping items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_GET, "Get the value of event enabled status."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_NAVIFRAME_BASE_ID, op_desc, ELM_OBJ_NAVIFRAME_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Naviframe_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_naviframe_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_naviframe.h b/src/lib/elc_naviframe.h
index 3f59328e6..1e8a5dab8 100644
--- a/src/lib/elc_naviframe.h
+++ b/src/lib/elc_naviframe.h
@@ -73,6 +73,219 @@
* the top one can be interacted with this way.
*/
+#define ELM_OBJ_NAVIFRAME_CLASS elm_obj_naviframe_class_get()
+
+const Eo_Class *elm_obj_naviframe_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_NAVIFRAME_BASE_ID;
+
+enum
+{
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_PUSH,
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_POP,
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_SIMPLE_PROMOTE,
+ ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_SET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_TOP_ITEM_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_BOTTOM_ITEM_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_SET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_ITEMS_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_SET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_GET,
+ ELM_OBJ_NAVIFRAME_SUB_ID_LAST
+};
+
+#define ELM_OBJ_NAVIFRAME_ID(sub_id) (ELM_OBJ_NAVIFRAME_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_naviframe_item_push
+ * @since 1.8
+ *
+ * @brief Push a new item to the top of the naviframe stack (and show it).
+ *
+ * @param[in] title_label
+ * @param[in] prev_btn
+ * @param[in] next_btn
+ * @param[in] content
+ * @param[in] item_style
+ * @param[out] ret
+ *
+ * @see elm_naviframe_item_push
+ */
+#define elm_obj_naviframe_item_push(title_label, prev_btn, next_btn, content, item_style, ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_PUSH), EO_TYPECHECK(const char *, title_label), EO_TYPECHECK(Evas_Object *, prev_btn), EO_TYPECHECK(Evas_Object *, next_btn), EO_TYPECHECK(Evas_Object *, content), EO_TYPECHECK(const char *, item_style), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_naviframe_item_insert_before
+ * @since 1.8
+ *
+ * @brief Insert a new item into the naviframe before item before.
+ *
+ * @param[in] before
+ * @param[in] title_label
+ * @param[in] prev_btn
+ * @param[in] next_btn
+ * @param[in] content
+ * @param[in] item_style
+ * @param[out] ret
+ *
+ * @see elm_naviframe_item_insert_before
+ */
+#define elm_obj_naviframe_item_insert_before(before, title_label, prev_btn, next_btn, content, item_style, ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, title_label), EO_TYPECHECK(Evas_Object *, prev_btn), EO_TYPECHECK(Evas_Object *, next_btn), EO_TYPECHECK(Evas_Object *, content), EO_TYPECHECK(const char *, item_style), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_naviframe_item_insert_after
+ * @since 1.8
+ *
+ * @brief Insert a new item into the naviframe after item after.
+ *
+ * @param[in] after
+ * @param[in] title_label
+ * @param[in] prev_btn
+ * @param[in] next_btn
+ * @param[in] content
+ * @param[in] item_style
+ * @param[out] ret
+ *
+ * @see elm_naviframe_item_insert_after
+ */
+#define elm_obj_naviframe_item_insert_after(after, title_label, prev_btn, next_btn, content, item_style, ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, title_label), EO_TYPECHECK(Evas_Object *, prev_btn), EO_TYPECHECK(Evas_Object *, next_btn), EO_TYPECHECK(Evas_Object *, content), EO_TYPECHECK(const char *, item_style), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_naviframe_item_pop
+ * @since 1.8
+ *
+ * @brief Pop an item that is on top of the stack
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_item_pop
+ */
+#define elm_obj_naviframe_item_pop(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_POP), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_naviframe_item_simple_promote
+ * @since 1.8
+ *
+ * @brief Simple version of item_promote.
+ *
+ * @param[in] content
+ *
+ * @see elm_naviframe_item_simple_promote
+ */
+#define elm_obj_naviframe_item_simple_promote(content) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEM_SIMPLE_PROMOTE), EO_TYPECHECK(Evas_Object *, content)
+
+/**
+ * @def elm_obj_naviframe_content_preserve_on_pop_set
+ * @since 1.8
+ *
+ * @brief preserve the content objects when items are popped.
+ *
+ * @param[in] preserve
+ *
+ * @see elm_naviframe_content_preserve_on_pop_set
+ */
+#define elm_obj_naviframe_content_preserve_on_pop_set(preserve) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_SET), EO_TYPECHECK(Eina_Bool, preserve)
+
+/**
+ * @def elm_obj_naviframe_content_preserve_on_pop_get
+ * @since 1.8
+ *
+ * @brief Get a value whether preserve mode is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_content_preserve_on_pop_get
+ */
+#define elm_obj_naviframe_content_preserve_on_pop_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_CONTENT_PRESERVE_ON_POP_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_naviframe_top_item_get
+ * @since 1.8
+ *
+ * @brief Get a top item on the naviframe stack
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_top_item_get
+ */
+#define elm_obj_naviframe_top_item_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_TOP_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_naviframe_bottom_item_get
+ * @since 1.8
+ *
+ * @brief Get a bottom item on the naviframe stack
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_bottom_item_get
+ */
+#define elm_obj_naviframe_bottom_item_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_BOTTOM_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_naviframe_prev_btn_auto_pushed_set
+ * @since 1.8
+ *
+ * @brief Set creating prev button automatically or not
+ *
+ * @param[in] auto_pushed
+ *
+ * @see elm_naviframe_prev_btn_auto_pushed_set
+ */
+#define elm_obj_naviframe_prev_btn_auto_pushed_set(auto_pushed) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_SET), EO_TYPECHECK(Eina_Bool, auto_pushed)
+
+/**
+ * @def elm_obj_naviframe_prev_btn_auto_pushed_get
+ * @since 1.8
+ *
+ * @brief Get a value whether prev button(back button) will be auto pushed or
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_prev_btn_auto_pushed_get
+ */
+#define elm_obj_naviframe_prev_btn_auto_pushed_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_PREV_BTN_AUTO_PUSHED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_naviframe_items_get
+ * @since 1.8
+ *
+ * @brief Get a list of all the naviframe items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_items_get
+ */
+#define elm_obj_naviframe_items_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret)
+
+/**
+ * @def elm_obj_naviframe_event_enabled_set
+ * @since 1.8
+ *
+ * @brief Set the event enabled when pushing/popping items
+ *
+ * @param[in] enabled
+ *
+ * @see elm_naviframe_event_enabled_set
+ */
+#define elm_obj_naviframe_event_enabled_set(enabled) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_naviframe_event_enabled_get
+ * @since 1.8
+ *
+ * @brief Get the value of event enabled status.
+ *
+ * @param[out] ret
+ *
+ * @see elm_naviframe_event_enabled_get
+ */
+#define elm_obj_naviframe_event_enabled_get(ret) ELM_OBJ_NAVIFRAME_ID(ELM_OBJ_NAVIFRAME_SUB_ID_EVENT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @addtogroup Naviframe
* @{
diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c
index 2c148022b..087aa888e 100644
--- a/src/lib/elc_player.c
+++ b/src/lib/elc_player.c
@@ -1,12 +1,19 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_widget_layout.h"
#include "elm_widget_player.h"
#ifdef HAVE_EMOTION
# include <Emotion.h>
#endif
-EAPI const char ELM_PLAYER_SMART_NAME[] = "elm_player";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_PLAYER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PLAYER_CLASS
+
+#define MY_CLASS_NAME "elm_player"
static const char SIG_FORWARD_CLICKED[] = "forward,clicked";
static const char SIG_INFO_CLICKED[] = "info,clicked";
@@ -28,25 +35,25 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{ NULL, NULL }
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PLAYER_SMART_NAME, _elm_player, Elm_Player_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
#ifdef HAVE_EMOTION
-static Eina_Bool
-_elm_player_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_player_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
- ELM_PLAYER_DATA_GET(obj, sd);
+ Elm_Player_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (!sd->video) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (!sd->video) return;
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -63,7 +70,8 @@ _elm_player_smart_event(Evas_Object *obj,
}
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Right")) ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
@@ -81,7 +89,8 @@ _elm_player_smart_event(Evas_Object *obj,
}
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if (!strcmp(ev->keyname, "space"))
{
@@ -90,19 +99,23 @@ _elm_player_smart_event(Evas_Object *obj,
else
elm_video_play(sd->video);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
fprintf(stderr, "keyname: '%s' not handle\n", ev->keyname);
-
- return EINA_FALSE;
}
-static Eina_Bool
-_elm_player_smart_theme(Evas_Object *obj)
+
+static void
+_elm_player_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_PLAYER_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
- if (!ELM_WIDGET_CLASS(_elm_player_parent_sc)->theme(obj)) return EINA_FALSE;
+ Elm_Player_Smart_Data *sd = _pd;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
#define UPDATE_THEME(Target, Name) \
if (Target) \
@@ -125,19 +138,19 @@ _elm_player_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_player_smart_sizing_eval(Evas_Object *obj)
+_elm_player_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord w, h;
- ELM_PLAYER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_size_min_get(ELM_WIDGET_DATA(sd)->resize_obj, &w, &h);
+ edje_object_size_min_get(wd->resize_obj, &w, &h);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &w, &h, w, h);
+ (wd->resize_obj, &w, &h, w, h);
evas_object_size_hint_min_set(obj, w, h);
}
@@ -385,28 +398,36 @@ _str_free(char *data)
/* a video object is never parented by a player one, just tracked.
* treating this special case here and delegating other objects to own
* layout */
-static Eina_Bool
-_elm_player_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+
+static void
+_elm_player_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
double pos, length;
Eina_Bool seekable;
if (part && strcmp(part, "video"))
- return ELM_CONTAINER_CLASS(_elm_player_parent_sc)->content_set
- (obj, part, content);
+ {
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if (ret) *ret = int_ret;
+ return;
+ }
- ELM_PLAYER_DATA_GET(obj, sd);
+ Elm_Player_Smart_Data *sd = _pd;
- if (!_elm_video_check(content)) return EINA_FALSE;
- if (sd->video == content) return EINA_TRUE;
+ if (!_elm_video_check(content)) return;
+ if (sd->video == content) goto end;
if (sd->video) evas_object_del(sd->video);
sd->video = content;
- if (!content) return EINA_TRUE;
+ if (!content) goto end;
elm_object_disabled_set(sd->slider, EINA_FALSE);
elm_object_disabled_set(sd->forward, EINA_FALSE);
@@ -449,16 +470,16 @@ _elm_player_smart_content_set(Evas_Object *obj,
_play_finished, obj);
/* FIXME: track info from video */
-
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_player_smart_add(Evas_Object *obj)
+_elm_player_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Player_Smart_Data);
+ eo_do_super(obj, evas_obj_smart_add());
- ELM_WIDGET_CLASS(_elm_player_parent_sc)->base.add(obj);
+ Elm_Player_Smart_Data *priv = _pd;
elm_layout_theme_set(obj, "player", "base", elm_widget_style_get(obj));
@@ -493,59 +514,71 @@ _elm_player_smart_add(Evas_Object *obj)
#endif
-static void
-_elm_player_smart_set_user(Elm_Player_Smart_Class *sc)
+EAPI Evas_Object *
+elm_player_add(Evas_Object *parent)
{
#ifdef HAVE_EMOTION
- ELM_WIDGET_CLASS(sc)->base.add = _elm_player_smart_add;
-
- ELM_WIDGET_CLASS(sc)->event = _elm_player_smart_event;
- ELM_WIDGET_CLASS(sc)->theme = _elm_player_smart_theme;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_player_smart_content_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_player_smart_sizing_eval;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
#else
- (void) sc;
+ (void) parent;
+ return NULL;
#endif
}
-EAPI const Elm_Player_Smart_Class *
-elm_player_smart_class_get(void)
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- static Elm_Player_Smart_Class _sc =
- ELM_PLAYER_SMART_CLASS_INIT_NAME_VERSION(ELM_PLAYER_SMART_NAME);
- static const Elm_Player_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
+#ifdef HAVE_EMOTION
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- _elm_player_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
+ Evas_Object *parent = eo_parent_get(obj);
+ if (!elm_widget_sub_object_add(parent, obj))
+ ERR("could not add %p as sub object of %p", obj, parent);
+#else
+ eo_error_set(obj);
+#endif
- return class;
}
-EAPI Evas_Object *
-elm_player_add(Evas_Object *parent)
+static void
+_class_constructor(Eo_Class *klass)
{
-#ifdef HAVE_EMOTION
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ const Eo_Op_Func_Description func_desc[] = {
- obj = elm_widget_add(_elm_player_smart_class_new(), parent);
- if (!obj) return NULL;
+ EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
+#ifdef HAVE_EMOTION
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_player_smart_add),
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_player_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_player_smart_event),
- return obj;
-#else
- (void) parent;
- (void) _elm_player_smart_class_new;
- return NULL;
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_player_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_player_smart_sizing_eval),
#endif
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PLAYER_BASE_ID, op_desc, ELM_OBJ_PLAYER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Player_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_player_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index 45970a682..71e9129d6 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -2,9 +2,15 @@
#include "elm_priv.h"
#include "elm_widget_popup.h"
-#define ELM_POPUP_ACTION_BUTTON_MAX 3
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_POPUP_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_POPUP_CLASS
-EAPI const char ELM_POPUP_SMART_NAME[] = "elm_popup";
+#define MY_CLASS_NAME "elm_popup"
+
+#define ELM_POPUP_ACTION_BUTTON_MAX 3
static void _button_remove(Evas_Object *, int, Eina_Bool);
@@ -16,10 +22,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_POPUP_SMART_NAME, _elm_popup, Elm_Popup_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void
@@ -99,6 +101,7 @@ _scroller_size_calc(Evas_Object *obj)
const char *action_area_height;
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->items) return;
@@ -107,7 +110,7 @@ _scroller_size_calc(Evas_Object *obj)
sd->max_sc_w = -1;
evas_object_geometry_get(sd->notify, NULL, NULL, NULL, &h);
if (sd->title_text || sd->title_icon)
- edje_object_part_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_part_geometry_get(wd->resize_obj,
"elm.bg.title", NULL, NULL, NULL, &h_title);
if (sd->button_count)
{
@@ -161,11 +164,11 @@ _items_remove(Elm_Popup_Smart_Data *sd)
}
static void
-_elm_popup_smart_del(Evas_Object *obj)
+_elm_popup_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
unsigned int i;
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Smart_Data *sd = _pd;
evas_object_smart_callback_del
(sd->notify, "block,clicked", _block_clicked_cb);
@@ -189,7 +192,7 @@ _elm_popup_smart_del(Evas_Object *obj)
_list_del(sd);
}
- ELM_WIDGET_CLASS(_elm_popup_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
@@ -207,18 +210,23 @@ _mirrored_set(Evas_Object *obj,
edje_object_mirrored_set(VIEW(item), rtl);
}
-static Eina_Bool
-_elm_popup_smart_theme(Evas_Object *obj)
+static void
+_elm_popup_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Elm_Popup_Item *item;
unsigned int i = 0;
Eina_List *elist;
char buf[128];
- ELM_POPUP_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_popup_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Elm_Popup_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -275,10 +283,10 @@ _elm_popup_smart_theme(Evas_Object *obj)
elm_layout_signal_emit(obj, "elm,state,title,icon,visible", "elm");
_visuals_set(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -293,14 +301,15 @@ _item_sizing_eval(Elm_Popup_Item *item)
}
static void
-_elm_popup_smart_sizing_eval(Evas_Object *obj)
+_elm_popup_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Eina_List *elist;
Elm_Popup_Item *item;
Evas_Coord h_box = 0, minh_box = 0;
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->items)
{
@@ -317,30 +326,35 @@ _elm_popup_smart_sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_get(sd->scr, &minw, &minh);
}
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_popup_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_popup_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
Elm_Popup_Item *item;
- ELM_POPUP_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ Elm_Popup_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_event_callback_del
(sd->content, EVAS_CALLBACK_DEL, _on_content_del);
- if (!ELM_WIDGET_CLASS(_elm_popup_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sobj == sd->title_icon)
{
elm_layout_signal_emit(obj, "elm,state,title,icon,hidden", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
sd->title_icon = NULL;
}
else if ((item =
@@ -355,7 +369,7 @@ _elm_popup_smart_sub_object_del(Evas_Object *obj,
}
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -431,6 +445,7 @@ _button_remove(Evas_Object *obj,
char buf[128];
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->button_count) return;
@@ -466,7 +481,7 @@ _button_remove(Evas_Object *obj,
edje_object_part_unswallow
(obj, edje_object_part_swallow_get(obj, "elm.swallow.action_area"));
evas_object_hide(sd->action_area);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
else
{
@@ -500,6 +515,7 @@ static void
_list_add(Evas_Object *obj)
{
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->tbl = elm_table_add(obj);
@@ -507,7 +523,7 @@ _list_add(Evas_Object *obj)
(sd->tbl, EVAS_CALLBACK_DEL, _on_table_del, obj);
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.content", sd->tbl);
+ (wd->resize_obj, "elm.swallow.content", sd->tbl);
evas_object_size_hint_weight_set
(sd->tbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sd->tbl, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -739,8 +755,6 @@ _item_signal_emit_hook(Elm_Object_Item *it,
static void
_item_new(Elm_Popup_Item *item)
{
- ELM_POPUP_DATA_GET(WIDGET(item), sd);
-
elm_widget_item_text_set_hook_set(item, _item_text_set_hook);
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
elm_widget_item_content_set_hook_set(item, _item_content_set_hook);
@@ -750,7 +764,7 @@ _item_new(Elm_Popup_Item *item)
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
VIEW(item) = edje_object_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ (evas_object_evas_get(WIDGET(item)));
elm_widget_theme_object_set(WIDGET(item), VIEW(item), "popup", "item",
elm_widget_style_get(WIDGET(item)));
edje_object_mirrored_set(VIEW(item), elm_widget_mirrored_get(WIDGET(item)));
@@ -768,6 +782,7 @@ _title_text_set(Evas_Object *obj,
Eina_Bool title_visibility_old, title_visibility_current;
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->title_text == text) return EINA_TRUE;
@@ -776,13 +791,13 @@ _title_text_set(Evas_Object *obj,
//bare edje here because we're inside the hook, already
edje_object_part_text_escaped_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.text.title", text);
+ (wd->resize_obj, "elm.text.title", text);
// XXX: ACCESS
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
{
sd->title_access_obj = _elm_access_edje_object_part_object_register
- (ELM_WIDGET_DATA(sd)->resize_obj, ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj, wd->resize_obj,
"elm.text.title");
_elm_access_text_set(_elm_access_object_get(sd->title_access_obj),
ELM_ACCESS_TYPE, E_("popup title"));
@@ -799,7 +814,7 @@ _title_text_set(Evas_Object *obj,
if (title_visibility_old != title_visibility_current)
_visuals_set(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
return EINA_TRUE;
@@ -813,6 +828,7 @@ _content_text_set(Evas_Object *obj,
char buf[128];
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->items)
{
@@ -829,7 +845,7 @@ _content_text_set(Evas_Object *obj,
if (!text) goto end;
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.content",
+ (wd->resize_obj, "elm.swallow.content",
sd->content_area);
sd->text_content_obj = elm_label_add(obj);
@@ -858,17 +874,21 @@ end:
return EINA_TRUE;
}
-static Eina_Bool
-_elm_popup_smart_text_set(Evas_Object *obj,
- const char *part,
- const char *label)
+static void
+_elm_popup_smart_text_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+
if (!part || !strcmp(part, "default"))
- return _content_text_set(obj, label);
+ int_ret = _content_text_set(obj, label);
else if (!strcmp(part, "title,text"))
- return _title_text_set(obj, label);
+ int_ret = _title_text_set(obj, label);
else
- return _elm_popup_parent_sc->text_set(obj, part, label);
+ eo_do_super(obj, elm_obj_layout_text_set(part, label, &int_ret));
+ if (ret) *ret = int_ret;
}
static const char *
@@ -892,20 +912,18 @@ _content_text_get(const Evas_Object *obj)
return str;
}
-static const char *
-_elm_popup_smart_text_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_popup_smart_text_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- const char *str = NULL;
+ const char *part = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
if (!part || !strcmp(part, "default"))
- str = _content_text_get(obj);
+ *text = _content_text_get(obj);
else if (!strcmp(part, "title,text"))
- str = _title_text_get(obj);
+ *text = _title_text_get(obj);
else
- str = _elm_popup_parent_sc->text_get(obj, part);
-
- return str;
+ eo_do_super(obj, elm_obj_layout_text_get(part, text));
}
static Eina_Bool
@@ -915,6 +933,7 @@ _title_icon_set(Evas_Object *obj,
Eina_Bool title_visibility_old, title_visibility_current;
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->title_icon == icon) return EINA_TRUE;
title_visibility_old = (sd->title_text) || (sd->title_icon);
@@ -925,14 +944,14 @@ _title_icon_set(Evas_Object *obj,
//bare edje here because we're already in content_set virtual
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.title.icon",
+ (wd->resize_obj, "elm.swallow.title.icon",
sd->title_icon);
if (sd->title_icon)
elm_layout_signal_emit(obj, "elm,state,title,icon,visible", "elm");
if (title_visibility_old != title_visibility_current) _visuals_set(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
return EINA_TRUE;
@@ -945,6 +964,7 @@ _content_set(Evas_Object *obj,
Evas_Object *prev_content;
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->content && sd->content == content) return EINA_TRUE;
if (sd->items)
@@ -962,7 +982,7 @@ _content_set(Evas_Object *obj,
{
//bare edje as to avoid loop
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.content",
+ (wd->resize_obj, "elm.swallow.content",
sd->content_area);
elm_layout_content_set
@@ -987,6 +1007,7 @@ _action_button_set(Evas_Object *obj,
char buf[128];
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (idx >= ELM_POPUP_ACTION_BUTTON_MAX) return;
@@ -1023,27 +1044,36 @@ _action_button_set(Evas_Object *obj,
evas_object_show(sd->buttons[i]->btn);
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.action_area",
+ (wd->resize_obj, "elm.swallow.action_area",
sd->action_area);
if (sd->button_count == 1) _visuals_set(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
if (sd->items) _scroller_size_calc(obj);
elm_layout_sizing_eval(obj);
}
-static Eina_Bool
-_elm_popup_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_popup_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+
unsigned int i;
if (!part || !strcmp(part, "default"))
- return _content_set(obj, content);
+ {
+ int_ret = _content_set(obj, content);
+ goto end;
+ }
else if (!strcmp(part, "title,icon"))
- return _title_icon_set(obj, content);
+ {
+ int_ret = _title_icon_set(obj, content);
+ goto end;
+ }
else if (!strncmp(part, "button", 6))
{
i = atoi(part + 6) - 1;
@@ -1053,13 +1083,16 @@ _elm_popup_smart_content_set(Evas_Object *obj,
_action_button_set(obj, content, i);
- return EINA_TRUE;
+ int_ret = EINA_TRUE;
+ goto end;
}
err:
ERR("The part name is invalid! : popup=%p", obj);
+ int_ret = EINA_FALSE;
- return EINA_FALSE;
+end:
+ if (ret) *ret = int_ret;
}
static Evas_Object *
@@ -1094,13 +1127,15 @@ _action_button_get(const Evas_Object *obj,
return button;
}
-static Evas_Object *
-_elm_popup_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_popup_smart_content_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Object *content = NULL;
unsigned int i;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+
if (!part || !strcmp(part, "default"))
content = _content_get(obj);
else if (!strcmp(part, "title,text"))
@@ -1117,11 +1152,12 @@ _elm_popup_smart_content_get(const Evas_Object *obj,
else
goto err;
- return content;
+ *ret = content;
+ return;
err:
WRN("The part name is invalid! : popup=%p", obj);
- return content;
+ *ret = content;
}
static Evas_Object *
@@ -1150,23 +1186,26 @@ _title_icon_unset(Evas_Object *obj)
Evas_Object *icon;
ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->title_icon) return NULL;
icon = sd->title_icon;
- edje_object_part_unswallow(ELM_WIDGET_DATA(sd)->resize_obj, sd->title_icon);
+ edje_object_part_unswallow(wd->resize_obj, sd->title_icon);
sd->title_icon = NULL;
return icon;
}
-static Evas_Object *
-_elm_popup_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_popup_smart_content_unset(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Object *content = NULL;
unsigned int i;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+
if (!part || !strcmp(part, "default"))
content = _content_unset(obj);
else if (!strcmp(part, "title,icon"))
@@ -1183,20 +1222,31 @@ _elm_popup_smart_content_unset(Evas_Object *obj,
else
goto err;
- return content;
+ *ret = content;
+ return;
err:
ERR("The part name is invalid! : popup=%p", obj);
- return content;
+ *ret = content;
}
-static Eina_Bool
-_elm_popup_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_popup_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_POPUP_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_popup_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Popup_Smart_Data *sd = _pd;
+
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
if (!elm_widget_focus_next_get(sd->content_area, dir, next) &&
!elm_widget_focus_next_get(sd->action_area, dir, next)
@@ -1206,43 +1256,55 @@ _elm_popup_smart_focus_next(const Evas_Object *obj,
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
{
*next = sd->title_access_obj;
- return EINA_TRUE;
+ return;
}
elm_widget_focused_object_clear((Evas_Object *)obj);
if (!elm_widget_focus_next_get(sd->content_area, dir, next))
- return elm_widget_focus_next_get(sd->action_area, dir, next);
- return EINA_TRUE;
+ {
+ Eina_Bool int_ret = elm_widget_focus_next_get(sd->action_area, dir, next);
+ if (ret) *ret = int_ret;
+ }
+ return;
}
+}
- return EINA_TRUE;
+static void
+_elm_popup_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_popup_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_popup_smart_focus_direction(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Smart_Data *sd = _pd;
- return elm_widget_focus_direction_get
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+
+ int_ret = elm_widget_focus_direction_get
(sd->notify, base, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
static void
-_elm_popup_smart_add(Evas_Object *obj)
+_elm_popup_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Popup_Smart_Data);
-
- ELM_WIDGET_CLASS(_elm_popup_parent_sc)->base.add(obj);
+ Elm_Popup_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj));
evas_object_size_hint_weight_set
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ (wd->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ (wd->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
priv->notify = elm_notify_add(obj);
elm_notify_align_set(priv->notify, 0.5, 0.5);
@@ -1296,67 +1358,33 @@ _elm_popup_smart_add(Evas_Object *obj)
}
static void
-_elm_popup_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_popup_smart_parent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Smart_Data *sd = _pd;
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
elm_notify_parent_set(sd->notify, parent);
}
-static void
-_elm_popup_smart_set_user(Elm_Popup_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_popup_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_popup_smart_del;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_popup_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->theme = _elm_popup_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_popup_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_popup_smart_focus_direction;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_popup_smart_sub_object_del;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_popup_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_popup_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_popup_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_popup_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_popup_smart_text_get;
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_popup_smart_sizing_eval;
-}
-
-EAPI const Elm_Popup_Smart_Class *
-elm_popup_smart_class_get(void)
-{
- static Elm_Popup_Smart_Class _sc =
- ELM_POPUP_SMART_CLASS_INIT_NAME_VERSION(ELM_POPUP_SMART_NAME);
- static const Elm_Popup_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_popup_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_popup_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_popup_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -1364,7 +1392,14 @@ elm_popup_content_text_wrap_type_set(Evas_Object *obj,
Elm_Wrap_Type wrap)
{
ELM_POPUP_CHECK(obj);
- ELM_POPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_popup_content_text_wrap_type_set(wrap));
+}
+
+static void
+_content_text_wrap_type_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type wrap = va_arg(*list, Elm_Wrap_Type);
+ Elm_Popup_Smart_Data *sd = _pd;
//Need to wrap the content text, so not allowing ELM_WRAP_NONE
if (sd->content_text_wrap_type == ELM_WRAP_NONE) return;
@@ -1378,9 +1413,18 @@ EAPI Elm_Wrap_Type
elm_popup_content_text_wrap_type_get(const Evas_Object *obj)
{
ELM_POPUP_CHECK(obj) ELM_WRAP_LAST;
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Wrap_Type ret = ELM_WRAP_LAST;
+ eo_do((Eo *) obj, elm_obj_popup_content_text_wrap_type_get(&ret));
+ return ret;
+}
+
+static void
+_content_text_wrap_type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type *ret = va_arg(*list, Elm_Wrap_Type *);
+ Elm_Popup_Smart_Data *sd = _pd;
- return sd->content_text_wrap_type;
+ *ret = sd->content_text_wrap_type;
}
/* keeping old externals orient api for notify, but taking away the
@@ -1473,7 +1517,14 @@ elm_popup_orient_set(Evas_Object *obj,
Elm_Popup_Orient orient)
{
ELM_POPUP_CHECK(obj);
- ELM_POPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_popup_orient_set(orient));
+}
+
+static void
+_orient_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Popup_Orient orient = va_arg(*list, Elm_Popup_Orient);
+ Elm_Popup_Smart_Data *sd = _pd;
if (orient >= ELM_POPUP_ORIENT_LAST) return;
_elm_notify_orient_set(sd->notify, (Elm_Notify_Orient)orient);
@@ -1483,9 +1534,18 @@ EAPI Elm_Popup_Orient
elm_popup_orient_get(const Evas_Object *obj)
{
ELM_POPUP_CHECK(obj) - 1;
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Orient ret = -1;
+ eo_do((Eo *) obj, elm_obj_popup_orient_get(&ret));
+ return ret;
+}
- return (Elm_Popup_Orient)_elm_notify_orient_get(sd->notify);
+static void
+_orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Popup_Orient *ret = va_arg(*list, Elm_Popup_Orient *);
+ Elm_Popup_Smart_Data *sd = _pd;
+
+ *ret = (Elm_Popup_Orient)_elm_notify_orient_get(sd->notify);
}
EAPI void
@@ -1493,7 +1553,14 @@ elm_popup_timeout_set(Evas_Object *obj,
double timeout)
{
ELM_POPUP_CHECK(obj);
- ELM_POPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_popup_timeout_set(timeout));
+}
+
+static void
+_timeout_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double timeout = va_arg(*list, double);
+ Elm_Popup_Smart_Data *sd = _pd;
elm_notify_timeout_set(sd->notify, timeout);
}
@@ -1502,19 +1569,35 @@ EAPI double
elm_popup_timeout_get(const Evas_Object *obj)
{
ELM_POPUP_CHECK(obj) 0.0;
- ELM_POPUP_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_popup_timeout_get(&ret));
+ return ret;
+}
- return elm_notify_timeout_get(sd->notify);
+static void
+_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Popup_Smart_Data *sd = _pd;
+
+ *ret = elm_notify_timeout_get(sd->notify);
}
EAPI void
elm_popup_allow_events_set(Evas_Object *obj,
Eina_Bool allow)
{
- Eina_Bool allow_events = !!allow;
-
ELM_POPUP_CHECK(obj);
- ELM_POPUP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_popup_allow_events_set(allow));
+}
+
+static void
+_allow_events_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool allow = va_arg(*list, int);
+
+ Eina_Bool allow_events = !!allow;
+ Elm_Popup_Smart_Data *sd = _pd;
elm_notify_allow_events_set(sd->notify, allow_events);
}
@@ -1523,9 +1606,18 @@ EAPI Eina_Bool
elm_popup_allow_events_get(const Evas_Object *obj)
{
ELM_POPUP_CHECK(obj) EINA_FALSE;
- ELM_POPUP_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_popup_allow_events_get(&ret));
+ return ret;
+}
- return elm_notify_allow_events_get(sd->notify);
+static void
+_allow_events_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Popup_Smart_Data *sd = _pd;
+
+ *ret = elm_notify_allow_events_get(sd->notify);
}
EAPI Elm_Object_Item *
@@ -1535,14 +1627,29 @@ elm_popup_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_POPUP_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_popup_item_append(label, icon, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ if (ret) *ret = NULL;
+
Evas_Object *prev_content;
Elm_Popup_Item *item;
- ELM_POPUP_CHECK(obj) NULL;
- ELM_POPUP_DATA_GET(obj, sd);
+ Elm_Popup_Smart_Data *sd = _pd;
item = elm_widget_item_new(obj, Elm_Popup_Item);
- if (!item) return NULL;
+ if (!item) return;
if (sd->content || sd->text_content_obj)
{
prev_content = elm_layout_content_get
@@ -1568,5 +1675,70 @@ elm_popup_item_append(Evas_Object *obj,
_scroller_size_calc(obj);
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)item;
+ if (ret) *ret = (Elm_Object_Item *)item;
}
+
+static void
+_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_popup_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_popup_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_popup_smart_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_popup_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_popup_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_popup_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_popup_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_popup_smart_focus_direction),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_popup_smart_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_popup_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_popup_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_popup_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_popup_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_popup_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_popup_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET), _content_text_wrap_type_set),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET), _content_text_wrap_type_get),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_SET), _orient_set),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_GET), _orient_get),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET), _timeout_set),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET), _timeout_get),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), _allow_events_set),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), _allow_events_get),
+ EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET, "Sets the wrapping type of content text packed in content."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET, "Returns the wrapping type of content text packed in content area of."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ORIENT_SET, "Sets the orientation of the popup in the parent region."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ORIENT_GET, "Returns the orientation of Popup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET, "Sets a timeout to hide popup automatically."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET, "Returns the timeout value set to the popup (in seconds)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET, "Sets whether events should be passed to by a click outside."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET, "Returns value indicating whether allow event is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND, "Add a new item to a Popup object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_POPUP_BASE_ID, op_desc, ELM_OBJ_POPUP_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Popup_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_popup_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
+
+
diff --git a/src/lib/elc_popup.h b/src/lib/elc_popup.h
index c0900bc00..91113a4ec 100644
--- a/src/lib/elc_popup.h
+++ b/src/lib/elc_popup.h
@@ -107,6 +107,141 @@
* @li @ref popup_example_03_c
*/
+#define ELM_OBJ_POPUP_CLASS elm_obj_popup_class_get()
+
+const Eo_Class *elm_obj_popup_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_POPUP_BASE_ID;
+
+enum
+{
+ ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET,
+ ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET,
+ ELM_OBJ_POPUP_SUB_ID_ORIENT_SET,
+ ELM_OBJ_POPUP_SUB_ID_ORIENT_GET,
+ ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET,
+ ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET,
+ ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET,
+ ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET,
+ ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_POPUP_SUB_ID_LAST
+};
+
+#define ELM_OBJ_POPUP_ID(sub_id) (ELM_OBJ_POPUP_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_popup_content_text_wrap_type_set
+ * @since 1.8
+ *
+ * @brief Sets the wrapping type of content text packed in content
+ *
+ * @param[in] wrap
+ *
+ * @see elm_popup_content_text_wrap_type_set
+ */
+#define elm_obj_popup_content_text_wrap_type_set(wrap) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)
+
+/**
+ * @def elm_obj_popup_content_text_wrap_type_get
+ * @since 1.8
+ *
+ * @brief Returns the wrapping type of content text packed in content area of
+ * area of popup object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_popup_content_text_wrap_type_get
+ */
+#define elm_obj_popup_content_text_wrap_type_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_CONTENT_TEXT_WRAP_TYPE_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)
+
+/**
+ * @def elm_obj_popup_orient_set
+ * @since 1.8
+ *
+ * @brief Sets the orientation of the popup in the parent region
+ *
+ * @param[in] orient
+ *
+ * @see elm_popup_orient_set
+ */
+#define elm_obj_popup_orient_set(orient) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Popup_Orient, orient)
+
+/**
+ * @def elm_obj_popup_orient_get
+ * @since 1.8
+ *
+ * @brief Returns the orientation of Popup
+ *
+ * @param[out] ret
+ *
+ * @see elm_popup_orient_get
+ */
+#define elm_obj_popup_orient_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Popup_Orient *, ret)
+
+/**
+ * @def elm_obj_popup_timeout_set
+ * @since 1.8
+ *
+ * @brief Sets a timeout to hide popup automatically
+ *
+ * @param[in] timeout
+ *
+ * @see elm_popup_timeout_set
+ */
+#define elm_obj_popup_timeout_set(timeout) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_SET), EO_TYPECHECK(double, timeout)
+
+/**
+ * @def elm_obj_popup_timeout_get
+ * @since 1.8
+ *
+ * @brief Returns the timeout value set to the popup (in seconds)
+ *
+ * @param[out] ret
+ *
+ * @see elm_popup_timeout_get
+ */
+#define elm_obj_popup_timeout_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_popup_allow_events_set
+ * @since 1.8
+ *
+ * @brief Sets whether events should be passed to by a click outside.
+ *
+ * @param[in] allow
+ *
+ * @see elm_popup_allow_events_set
+ */
+#define elm_obj_popup_allow_events_set(allow) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), EO_TYPECHECK(Eina_Bool, allow)
+
+/**
+ * @def elm_obj_popup_allow_events_get
+ * @since 1.8
+ *
+ * @brief Returns value indicating whether allow event is enabled or not
+ *
+ * @param[out] ret
+ *
+ * @see elm_popup_allow_events_get
+ */
+#define elm_obj_popup_allow_events_get(ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_popup_item_append
+ * @since 1.8
+ *
+ * @brief Add a new item to a Popup object
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_popup_item_append
+ */
+#define elm_obj_popup_item_append(label, icon, func, data, ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
/**
* @brief Possible orient values for popup.
*
diff --git a/src/lib/elm_access.c b/src/lib/elm_access.c
index c6c8a91e4..0c418aac2 100644
--- a/src/lib/elm_access.c
+++ b/src/lib/elm_access.c
@@ -1,57 +1,51 @@
#include <Elementary.h>
#include "elm_priv.h"
-static const char ACCESS_SMART_NAME[] = "elm_access";
+#include "Eo.h"
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (ACCESS_SMART_NAME, _elm_access, Elm_Widget_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+const Eo_Class *elm_obj_access_class_get(void) EINA_CONST;
+
+#define ELM_OBJ_ACCESS_CLASS elm_obj_access_class_get()
+
+#define MY_CLASS ELM_OBJ_ACCESS_CLASS
+
+#define MY_CLASS_NAME "elm_access"
static Evas_Object * _elm_access_add(Evas_Object *parent);
static void
-_elm_access_smart_add(Evas_Object *obj)
+_elm_access_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Widget_Smart_Data);
- ELM_WIDGET_CLASS(_elm_access_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
}
-static Eina_Bool
-_elm_access_smart_on_focus(Evas_Object *obj)
+static void
+_elm_access_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- evas_object_focus_set(obj, elm_widget_focus_get(obj));
+ Elm_Activate act = va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- return EINA_TRUE;
-}
-
-static Eina_Bool
-_elm_access_smart_activate(Evas_Object *obj, Elm_Activate act)
-{
- if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
+ if (act != ELM_ACTIVATE_DEFAULT) return;
Elm_Access_Info *ac = evas_object_data_get(obj, "_elm_access");
- if (!ac) return EINA_FALSE;
+ if (!ac) return;
if (ac->activate)
ac->activate(ac->activate_data, ac->part_object, ac->widget_item);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_access_smart_set_user(Elm_Widget_Smart_Class *sc)
+_elm_access_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- sc->base.add = _elm_access_smart_add;
-
- /* not a 'focus chain manager' */
- sc->focus_next = NULL;
- sc->focus_direction = NULL;
- sc->on_focus = _elm_access_smart_on_focus;
- sc->activate = _elm_access_smart_activate;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ evas_object_focus_set(obj, elm_widget_focus_get(obj));
- return;
+ if (ret) *ret = EINA_TRUE;
}
typedef struct _Mod_Api Mod_Api;
@@ -820,15 +814,50 @@ _elm_access_2nd_click_timeout(Evas_Object *obj)
static Evas_Object *
_elm_access_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_access_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
+}
- return obj;
+static void
+_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_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_access_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_access_smart_activate),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Class_Description class_desc = {
+ 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);
+
diff --git a/src/lib/elm_actionslider.c b/src/lib/elm_actionslider.c
index 4ca30d585..3c210ef5d 100644
--- a/src/lib/elm_actionslider.c
+++ b/src/lib/elm_actionslider.c
@@ -2,8 +2,15 @@
#include <math.h>
#include "elm_priv.h"
#include "elm_widget_actionslider.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_ACTIONSLIDER_SMART_NAME[] = "elm_actionslider";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_ACTIONSLIDER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_ACTIONSLIDER_CLASS
+
+#define MY_CLASS_NAME "elm_actionslider"
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
@@ -23,11 +30,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_ACTIONSLIDER_SMART_NAME, _elm_actionslider,
- Elm_Actionslider_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
static Elm_Actionslider_Pos
_get_pos_by_orientation(const Evas_Object *obj,
Elm_Actionslider_Pos pos)
@@ -52,11 +54,12 @@ _get_pos_by_orientation(const Evas_Object *obj,
}
static void
-_elm_actionslider_smart_sizing_eval(Evas_Object *obj)
+_elm_actionslider_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(sd->drag_button_base, minw, minh);
@@ -66,7 +69,7 @@ _elm_actionslider_smart_sizing_eval(Evas_Object *obj)
minh = -1;
elm_coords_finger_size_adjust(3, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -77,7 +80,7 @@ _mirroredness_change_eval(Evas_Object *obj)
double pos;
char *left;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
left = (char *)elm_layout_text_get(obj, "elm.text.left");
if (left) left = strdup(left);
@@ -89,29 +92,32 @@ _mirroredness_change_eval(Evas_Object *obj)
free(left);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", &pos, NULL);
+ (wd->resize_obj, "elm.drag_button_base", &pos, NULL);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", 1.0 - pos, 0.5);
+ (wd->resize_obj, "elm.drag_button_base", 1.0 - pos, 0.5);
}
-static Eina_Bool
-_elm_actionslider_smart_theme(Evas_Object *obj)
+static void
+_elm_actionslider_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool mirrored;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
mirrored = elm_object_mirrored_get(obj);
- if (!ELM_WIDGET_CLASS(_elm_actionslider_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (elm_object_mirrored_get(obj) != mirrored)
_mirroredness_change_eval(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -135,11 +141,12 @@ _drag_button_move_cb(void *data,
double pos = 0.0;
ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->mouse_down) return;
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", &pos, NULL);
+ (wd->resize_obj, "elm.drag_button_base", &pos, NULL);
if (pos == 0.0)
evas_object_smart_callback_call
(obj, SIG_CHANGED, !elm_widget_mirrored_get(obj) ? "left" : "right");
@@ -171,9 +178,10 @@ _button_animator(void *data)
double cur_position = 0.0, new_position = 0.0;
ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base",
+ (wd->resize_obj, "elm.drag_button_base",
&cur_position, NULL);
{
double adjusted_final;
@@ -204,7 +212,7 @@ _button_animator(void *data)
}
}
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base",
+ (wd->resize_obj, "elm.drag_button_base",
new_position, 0.5);
}
@@ -242,11 +250,12 @@ _drag_button_up_cb(void *data,
double position = 0.0;
ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->mouse_down = EINA_FALSE;
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", &position,
+ (wd->resize_obj, "elm.drag_button_base", &position,
NULL);
const char *left, *right, *center;
@@ -351,31 +360,39 @@ _mirrored_part_fix(const Evas_Object *obj,
}
}
-static Eina_Bool
-_elm_actionslider_smart_text_set(Evas_Object *obj,
- const char *item,
- const char *label)
+static void
+_elm_actionslider_smart_text_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- _mirrored_part_fix(obj, &item);
+ const char *part = va_arg(*list, const char *);
+ const char *text = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
- return _elm_actionslider_parent_sc->text_set(obj, item, label);
+ _mirrored_part_fix(obj, &part);
+
+ eo_do_super(obj, elm_obj_layout_text_set(part, text, &int_ret));
+ if (ret) *ret = int_ret;
}
-static const char *
-_elm_actionslider_smart_text_get(const Evas_Object *obj,
- const char *item)
+static void
+_elm_actionslider_smart_text_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+
{
- _mirrored_part_fix(obj, &item);
+ const char *part = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
- return _elm_actionslider_parent_sc->text_get(obj, item);
+ _mirrored_part_fix(obj, &part);
+
+ eo_do_super(obj, elm_obj_layout_text_get(part, text));
}
static void
-_elm_actionslider_smart_add(Evas_Object *obj)
+_elm_actionslider_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Actionslider_Smart_Data);
+ Elm_Actionslider_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_actionslider_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->mouse_down = EINA_FALSE;
priv->enabled_position = ELM_ACTIONSLIDER_ALL;
@@ -385,13 +402,13 @@ _elm_actionslider_smart_add(Evas_Object *obj)
evas_object_color_set(priv->drag_button_base, 0, 0, 0, 0);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.drag_button,mouse,up", "",
+ (wd->resize_obj, "elm.drag_button,mouse,up", "",
_drag_button_up_cb, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.drag_button,mouse,down", "",
+ (wd->resize_obj, "elm.drag_button,mouse,down", "",
_drag_button_down_cb, priv);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.drag_button,mouse,move", "",
+ (wd->resize_obj, "elm.drag_button,mouse,move", "",
_drag_button_move_cb, obj);
elm_layout_theme_set
@@ -403,66 +420,50 @@ _elm_actionslider_smart_add(Evas_Object *obj)
}
static void
-_elm_actionslider_smart_set_user(Elm_Actionslider_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_actionslider_smart_add;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_actionslider_smart_theme;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_actionslider_smart_sizing_eval;
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_actionslider_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_actionslider_smart_text_get;
-
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
-}
-
-EAPI const Elm_Actionslider_Smart_Class *
-elm_actionslider_smart_class_get(void)
+_elm_actionslider_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Actionslider_Smart_Class _sc =
- ELM_ACTIONSLIDER_SMART_CLASS_INIT_NAME_VERSION
- (ELM_ACTIONSLIDER_SMART_NAME);
- static const Elm_Actionslider_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_actionslider_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
EAPI Evas_Object *
elm_actionslider_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_actionslider_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_actionslider_indicator_pos_set(Evas_Object *obj,
Elm_Actionslider_Pos pos)
{
+ ELM_ACTIONSLIDER_CHECK(obj);
+ eo_do(obj, elm_obj_actionslider_indicator_pos_set(pos));
+}
+
+static void
+_indicator_pos_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
double position = 0.0;
- ELM_ACTIONSLIDER_CHECK(obj);
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Pos pos = va_arg(*list, Elm_Actionslider_Pos);
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
pos = _get_pos_by_orientation(obj, pos);
if (pos == ELM_ACTIONSLIDER_CENTER) position = 0.5;
@@ -470,26 +471,36 @@ elm_actionslider_indicator_pos_set(Evas_Object *obj,
position = 1.0;
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", position, 0.5);
+ (wd->resize_obj, "elm.drag_button_base", position, 0.5);
}
EAPI Elm_Actionslider_Pos
elm_actionslider_indicator_pos_get(const Evas_Object *obj)
{
+ ELM_ACTIONSLIDER_CHECK(obj) ELM_ACTIONSLIDER_NONE;
+ Elm_Actionslider_Pos ret = ELM_ACTIONSLIDER_NONE;
+ eo_do((Eo *) obj, elm_obj_actionslider_indicator_pos_get(&ret));
+ return ret;
+}
+
+static void
+_indicator_pos_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
double position;
- ELM_ACTIONSLIDER_CHECK(obj) ELM_ACTIONSLIDER_NONE;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Pos *ret = va_arg(*list, Elm_Actionslider_Pos *);
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.drag_button_base", &position,
+ (wd->resize_obj, "elm.drag_button_base", &position,
NULL);
if (position < 0.3)
- return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_LEFT);
+ *ret = _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_LEFT);
else if (position < 0.7)
- return ELM_ACTIONSLIDER_CENTER;
+ *ret = ELM_ACTIONSLIDER_CENTER;
else
- return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT);
+ *ret = _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT);
}
EAPI void
@@ -497,8 +508,14 @@ elm_actionslider_magnet_pos_set(Evas_Object *obj,
Elm_Actionslider_Pos pos)
{
ELM_ACTIONSLIDER_CHECK(obj);
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_actionslider_magnet_pos_set(pos));
+}
+static void
+_magnet_pos_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Actionslider_Pos pos = va_arg(*list, Elm_Actionslider_Pos);
+ Elm_Actionslider_Smart_Data *sd = _pd;
sd->magnet_position = pos;
}
@@ -506,9 +523,17 @@ EAPI Elm_Actionslider_Pos
elm_actionslider_magnet_pos_get(const Evas_Object *obj)
{
ELM_ACTIONSLIDER_CHECK(obj) ELM_ACTIONSLIDER_NONE;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Pos ret = ELM_ACTIONSLIDER_NONE;
+ eo_do((Eo *) obj, elm_obj_actionslider_magnet_pos_get(&ret));
+ return ret;
+}
- return sd->magnet_position;
+static void
+_magnet_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Actionslider_Pos *ret = va_arg(*list, Elm_Actionslider_Pos *);
+ Elm_Actionslider_Smart_Data *sd = _pd;
+ *ret = sd->magnet_position;
}
EAPI void
@@ -516,8 +541,14 @@ elm_actionslider_enabled_pos_set(Evas_Object *obj,
Elm_Actionslider_Pos pos)
{
ELM_ACTIONSLIDER_CHECK(obj);
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_actionslider_enabled_pos_set(pos));
+}
+static void
+_enabled_pos_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Actionslider_Pos pos = va_arg(*list, Elm_Actionslider_Pos);
+ Elm_Actionslider_Smart_Data *sd = _pd;
sd->enabled_position = pos;
}
@@ -525,32 +556,113 @@ EAPI Elm_Actionslider_Pos
elm_actionslider_enabled_pos_get(const Evas_Object *obj)
{
ELM_ACTIONSLIDER_CHECK(obj) ELM_ACTIONSLIDER_NONE;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Pos ret = ELM_ACTIONSLIDER_NONE;
+ eo_do((Eo *) obj, elm_obj_actionslider_enabled_pos_get(&ret));
+ return ret;
+}
- return sd->enabled_position;
+static void
+_enabled_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Actionslider_Pos *ret = va_arg(*list, Elm_Actionslider_Pos *);
+ Elm_Actionslider_Smart_Data *sd = _pd;
+ *ret = sd->enabled_position;
}
EAPI const char *
elm_actionslider_selected_label_get(const Evas_Object *obj)
{
+ ELM_ACTIONSLIDER_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_actionslider_selected_label_get(&ret));
+ return ret;
+}
+
+static void
+_selected_label_get(Eo *obj, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
const char *left, *right, *center;
- ELM_ACTIONSLIDER_CHECK(obj) NULL;
- ELM_ACTIONSLIDER_DATA_GET(obj, sd);
+ Elm_Actionslider_Smart_Data *sd = _pd;
_text_get(obj, &left, &right, &center);
if ((sd->final_position == 0.0) &&
(sd->enabled_position & ELM_ACTIONSLIDER_LEFT))
- return left;
+ *ret = left;
if ((sd->final_position == 0.5) &&
(sd->enabled_position & ELM_ACTIONSLIDER_CENTER))
- return center;
+ *ret = center;
if ((sd->final_position == 1.0) &&
(sd->enabled_position & ELM_ACTIONSLIDER_RIGHT))
- return right;
+ *ret = right;
+}
- return NULL;
+static void
+_elm_actionslider_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_elm_actionslider_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_actionslider_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_actionslider_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_actionslider_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_actionslider_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_actionslider_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_actionslider_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_actionslider_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_actionslider_smart_text_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_SET), _indicator_pos_set),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_GET), _indicator_pos_get),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_SET), _magnet_pos_set),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_GET), _magnet_pos_get),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_SET), _enabled_pos_set),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_GET), _enabled_pos_get),
+ EO_OP_FUNC(ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_SELECTED_LABEL_GET), _selected_label_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_SET, "Set actionslider indicator position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_GET, "Get actionslider indicator position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_SET, "Set actionslider magnet position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_GET, "Get actionslider magnet position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_SET, "Set actionslider enabled position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_GET, "Get actionslider enabled position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ACTIONSLIDER_SUB_ID_SELECTED_LABEL_GET, "Get actionslider selected label."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_ACTIONSLIDER_BASE_ID, op_desc, ELM_OBJ_ACTIONSLIDER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Actionslider_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_actionslider_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_actionslider.h b/src/lib/elm_actionslider.h
index 3a15353d9..59e9e4cfd 100644
--- a/src/lib/elm_actionslider.h
+++ b/src/lib/elm_actionslider.h
@@ -48,6 +48,115 @@
* See an example of actionslider usage @ref actionslider_example_page "here"
* @{
*/
+
+#define ELM_OBJ_ACTIONSLIDER_CLASS elm_obj_actionslider_class_get()
+
+const Eo_Class *elm_obj_actionslider_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_ACTIONSLIDER_BASE_ID;
+
+enum
+{
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_SET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_GET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_SET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_GET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_SET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_GET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_SELECTED_LABEL_GET,
+ ELM_OBJ_ACTIONSLIDER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_ACTIONSLIDER_ID(sub_id) (ELM_OBJ_ACTIONSLIDER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_actionslider_indicator_pos_set
+ * @since 1.8
+ *
+ * Set actionslider indicator position.
+ *
+ * @param[in] pos
+ *
+ * @see elm_actionslider_indicator_pos_set
+ */
+#define elm_obj_actionslider_indicator_pos_set(pos) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_SET), EO_TYPECHECK(Elm_Actionslider_Pos, pos)
+
+/**
+ * @def elm_obj_actionslider_indicator_pos_get
+ * @since 1.8
+ *
+ * Get actionslider indicator position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_actionslider_indicator_pos_get
+ */
+#define elm_obj_actionslider_indicator_pos_get(ret) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_INDICATOR_POS_GET), EO_TYPECHECK(Elm_Actionslider_Pos *, ret)
+
+/**
+ * @def elm_obj_actionslider_magnet_pos_set
+ * @since 1.8
+ *
+ * Set actionslider magnet position. To make multiple positions magnets or
+ * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
+ *
+ * @param[in] pos
+ *
+ * @see elm_actionslider_magnet_pos_set
+ */
+#define elm_obj_actionslider_magnet_pos_set(pos) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_SET), EO_TYPECHECK(Elm_Actionslider_Pos, pos)
+
+/**
+ * @def elm_obj_actionslider_magnet_pos_get
+ * @since 1.8
+ *
+ * Get actionslider magnet position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_actionslider_magnet_pos_get
+ */
+#define elm_obj_actionslider_magnet_pos_get(ret) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_MAGNET_POS_GET), EO_TYPECHECK(Elm_Actionslider_Pos *, ret)
+
+/**
+ * @def elm_obj_actionslider_enabled_pos_set
+ * @since 1.8
+ *
+ * Set actionslider enabled position. To set multiple positions as enabled or
+ * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT).
+ *
+ * @param[in] pos
+ *
+ * @see elm_actionslider_enabled_pos_set
+ */
+#define elm_obj_actionslider_enabled_pos_set(pos) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_SET), EO_TYPECHECK(Elm_Actionslider_Pos, pos)
+
+/**
+ * @def elm_obj_actionslider_enabled_pos_get
+ * @since 1.8
+ *
+ * Get actionslider enabled position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_actionslider_enabled_pos_get
+ */
+#define elm_obj_actionslider_enabled_pos_get(ret) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_ENABLED_POS_GET), EO_TYPECHECK(Elm_Actionslider_Pos *, ret)
+
+/**
+ * @def elm_obj_actionslider_selected_label_get
+ * @since 1.8
+ *
+ * Get actionslider selected label.
+ *
+ * @param[out] ret
+ *
+ * @see elm_actionslider_selected_label_get
+ */
+#define elm_obj_actionslider_selected_label_get(ret) ELM_OBJ_ACTIONSLIDER_ID(ELM_OBJ_ACTIONSLIDER_SUB_ID_SELECTED_LABEL_GET), EO_TYPECHECK(const char **, ret)
+
+
typedef enum
{
ELM_ACTIONSLIDER_NONE = 0,
diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c
index 2e93702e0..eccfece65 100644
--- a/src/lib/elm_bg.c
+++ b/src/lib/elm_bg.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_bg.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_BG_SMART_NAME[] = "elm_bg";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_BG_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_BG_CLASS
+
+#define MY_CLASS_NAME "elm_bg"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -10,12 +17,8 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_BG_SMART_NAME, _elm_bg, Elm_Bg_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, NULL);
-
static void
-_elm_bg_smart_sizing_eval(Evas_Object *obj)
+_elm_bg_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord iw = 0, ih = 0, mw = -1, mh = -1;
Evas_Coord bx = 0, by = 0, bw = 0, bh = 0;
@@ -23,7 +26,8 @@ _elm_bg_smart_sizing_eval(Evas_Object *obj)
Evas_Coord nx = 0, ny = 0, nw = 0, nh = 0;
const char *p;
- ELM_BG_DATA_GET(obj, sd);
+ Elm_Bg_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if ((!sd->img) || (!sd->file)) return;
if (((p = strrchr(sd->file, '.'))) && (!strcasecmp(p, ".edj"))) return;
@@ -34,7 +38,7 @@ _elm_bg_smart_sizing_eval(Evas_Object *obj)
/* grab base object dimensions */
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &bx, &by, &bw, &bh);
+ (wd->resize_obj, &bx, &by, &bw, &bh);
/* set some defaults */
nx = bx;
@@ -95,11 +99,11 @@ _on_resize(void *data,
}
static void
-_elm_bg_smart_add(Evas_Object *obj)
+_elm_bg_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Bg_Smart_Data);
+ Elm_Bg_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_bg_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -111,45 +115,30 @@ _elm_bg_smart_add(Evas_Object *obj)
}
static void
-_elm_bg_smart_set_user(Elm_Bg_Smart_Class *sc)
+_elm_bg_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_bg_smart_add;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_bg_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
-}
-
-EAPI const Elm_Bg_Smart_Class *
-elm_bg_smart_class_get(void)
-{
- static Elm_Bg_Smart_Class _sc =
- ELM_BG_SMART_CLASS_INIT_NAME_VERSION(ELM_BG_SMART_NAME);
- static const Elm_Bg_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_bg_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
EAPI Evas_Object *
elm_bg_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_bg_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
static void
@@ -171,10 +160,22 @@ elm_bg_file_set(Evas_Object *obj,
const char *group)
{
ELM_BG_CHECK(obj) EINA_FALSE;
- ELM_BG_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_bg_file_set(file, group, &ret));
+ return ret;
+}
+
+static void
+_file_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Bg_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
const char *p;
- Eina_Bool ret;
+ Eina_Bool int_ret;
if (sd->img)
{
@@ -187,15 +188,16 @@ elm_bg_file_set(Evas_Object *obj,
sd->file = NULL;
eina_stringshare_del(sd->group);
sd->group = NULL;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
eina_stringshare_replace(&sd->file, file);
eina_stringshare_replace(&sd->group, group);
if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
{
sd->img = edje_object_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->resize_obj));
- ret = edje_object_file_set(sd->img, file, group);
+ (evas_object_evas_get(wd->resize_obj));
+ int_ret = edje_object_file_set(sd->img, file, group);
edje_object_signal_callback_del
(sd->img, "edje,change,file", "edje", _elm_bg_file_reload);
edje_object_signal_callback_add
@@ -206,7 +208,7 @@ elm_bg_file_set(Evas_Object *obj,
int err;
sd->img = evas_object_image_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->resize_obj));
+ (evas_object_evas_get(wd->resize_obj));
if ((sd->load_opts.w > 0) && (sd->load_opts.h > 0))
evas_object_image_load_size_set
(sd->img, sd->load_opts.w, sd->load_opts.h);
@@ -217,19 +219,19 @@ elm_bg_file_set(Evas_Object *obj,
{
ERR("Could not load image '%s': %s\n",
file, evas_load_error_str(err));
- ret = EINA_FALSE;
+ int_ret = EINA_FALSE;
}
else
- ret = EINA_TRUE;
+ int_ret = EINA_TRUE;
}
evas_object_repeat_events_set(sd->img, EINA_TRUE);
- ret &= elm_layout_content_set(obj, "elm.swallow.background", sd->img);
+ int_ret &= elm_layout_content_set(obj, "elm.swallow.background", sd->img);
elm_layout_sizing_eval(obj);
- return ret;
+ if (ret) *ret = int_ret;
}
EAPI void
@@ -238,7 +240,15 @@ elm_bg_file_get(const Evas_Object *obj,
const char **group)
{
ELM_BG_CHECK(obj);
- ELM_BG_DATA_GET_OR_RETURN(obj, sd);
+ eo_do((Eo *) obj, elm_obj_bg_file_get(file, group));
+}
+
+static void
+_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **file = va_arg(*list, const char **);
+ const char **group = va_arg(*list, const char **);
+ Elm_Bg_Smart_Data *sd = _pd;
if (file) *file = sd->file;
if (group) *group = sd->group;
@@ -249,7 +259,14 @@ elm_bg_option_set(Evas_Object *obj,
Elm_Bg_Option option)
{
ELM_BG_CHECK(obj);
- ELM_BG_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_bg_option_set(option));
+}
+
+static void
+_option_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Bg_Option option = va_arg(*list, Elm_Bg_Option);
+ Elm_Bg_Smart_Data *sd = _pd;
sd->option = option;
@@ -259,10 +276,19 @@ elm_bg_option_set(Evas_Object *obj,
EAPI Elm_Bg_Option
elm_bg_option_get(const Evas_Object *obj)
{
- ELM_BG_CHECK(obj) EINA_FALSE;
- ELM_BG_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_BG_OPTION_LAST);
+ ELM_BG_CHECK(obj) ELM_BG_OPTION_LAST;
+ Elm_Bg_Option ret = ELM_BG_OPTION_LAST;
+ eo_do((Eo *) obj, elm_obj_bg_option_get(&ret));
+ return ret;
+}
- return sd->option;
+static void
+_option_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Bg_Option *ret = va_arg(*list, Elm_Bg_Option *);
+ Elm_Bg_Smart_Data *sd = _pd;
+
+ *ret = sd->option;
}
EAPI void
@@ -272,12 +298,22 @@ elm_bg_color_set(Evas_Object *obj,
int b)
{
ELM_BG_CHECK(obj);
- ELM_BG_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_bg_color_set(r, g, b));
+}
+
+static void
+_color_set(Eo *obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ Elm_Bg_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd->rect)
{
sd->rect = evas_object_rectangle_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->resize_obj));
+ (evas_object_evas_get(wd->resize_obj));
elm_layout_content_set(obj, "elm.swallow.rectangle", sd->rect);
@@ -294,7 +330,16 @@ elm_bg_color_get(const Evas_Object *obj,
int *b)
{
ELM_BG_CHECK(obj);
- ELM_BG_DATA_GET_OR_RETURN(obj, sd);
+ eo_do((Eo *) obj, elm_obj_bg_color_get(r, g, b));
+}
+
+static void
+_color_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ Elm_Bg_Smart_Data *sd = _pd;
evas_object_color_get(sd->rect, r, g, b, NULL);
}
@@ -305,7 +350,15 @@ elm_bg_load_size_set(Evas_Object *obj,
Evas_Coord h)
{
ELM_BG_CHECK(obj);
- ELM_BG_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_bg_load_size_set(w, h));
+}
+
+static void
+_load_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Bg_Smart_Data *sd = _pd;
const char *p;
sd->load_opts.w = w;
@@ -315,3 +368,49 @@ elm_bg_load_size_set(Evas_Object *obj,
if (!(((p = strrchr(sd->file, '.'))) && (!strcasecmp(p, ".edj"))))
evas_object_image_load_size_set(sd->img, w, h);
}
+
+static void
+_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_bg_smart_add),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_bg_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_bg_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_FILE_GET), _file_get),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_OPTION_SET), _option_set),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_OPTION_GET), _option_get),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_COLOR_SET), _color_set),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_COLOR_GET), _color_get),
+ EO_OP_FUNC(ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_LOAD_SIZE_SET), _load_size_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_FILE_SET, "Set the file (image or edje collection) to give life for the background."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_FILE_GET, "Get the file (image or edje collection) set on a given background."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_OPTION_SET, "Set the mode of display for a given background widget's image."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_OPTION_GET, "Get the mode of display for a given background widget's image."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_COLOR_SET, "Set the color on a given background widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_COLOR_GET, "Get the color set on a given background widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BG_SUB_ID_LOAD_SIZE_SET, "Set the size of the pixmap representation of the image set on a given background widget."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_BG_BASE_ID, op_desc, ELM_OBJ_BG_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Bg_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_bg_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
diff --git a/src/lib/elm_bg.h b/src/lib/elm_bg.h
index cdb9b6dfa..3bed0a661 100644
--- a/src/lib/elm_bg.h
+++ b/src/lib/elm_bg.h
@@ -29,6 +29,121 @@
* @li @ref bg_03_example_page
*/
+#define ELM_OBJ_BG_CLASS elm_obj_bg_class_get()
+
+const Eo_Class *elm_obj_bg_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_BG_BASE_ID;
+
+enum
+{
+ ELM_OBJ_BG_SUB_ID_FILE_SET,
+ ELM_OBJ_BG_SUB_ID_FILE_GET,
+ ELM_OBJ_BG_SUB_ID_OPTION_SET,
+ ELM_OBJ_BG_SUB_ID_OPTION_GET,
+ ELM_OBJ_BG_SUB_ID_COLOR_SET,
+ ELM_OBJ_BG_SUB_ID_COLOR_GET,
+ ELM_OBJ_BG_SUB_ID_LOAD_SIZE_SET,
+ ELM_OBJ_BG_SUB_ID_LAST
+};
+
+#define ELM_OBJ_BG_ID(sub_id) (ELM_OBJ_BG_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_bg_file_set
+ * @since 1.8
+ *
+ * Set the file (image or edje collection) to give life for the
+ * background
+ *
+ * @param[in] file
+ * @param[in] group
+ * @param[out] ret
+ *
+ * @see elm_bg_file_set
+ */
+#define elm_obj_bg_file_set(file, group, ret) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_bg_file_get
+ * @since 1.8
+ *
+ * Get the file (image or edje collection) set on a given background
+ *
+ * @param[out] file
+ * @param[out] group
+ *
+ * @see elm_bg_file_get
+ */
+#define elm_obj_bg_file_get(file, group) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group)
+
+/**
+ * @def elm_obj_bg_option_set
+ * @since 1.8
+ *
+ * Set the mode of display for a given background widget's image
+ *
+ * @param[in] option
+ *
+ * @see elm_bg_option_set
+ */
+#define elm_obj_bg_option_set(option) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_OPTION_SET), EO_TYPECHECK(Elm_Bg_Option, option)
+
+/**
+ * @def elm_obj_bg_option_get
+ * @since 1.8
+ *
+ * Get the mode of display for a given background widget's image
+ *
+ * @param[out] ret
+ *
+ * @see elm_bg_option_get
+ */
+#define elm_obj_bg_option_get(ret) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_OPTION_GET), EO_TYPECHECK(Elm_Bg_Option *, ret)
+
+/**
+ * @def elm_obj_bg_color_set
+ * @since 1.8
+ *
+ * Set the color on a given background widget
+ *
+ * @param[in] r
+ * @param[in] g
+ * @param[in] b
+ *
+ * @see elm_bg_color_set
+ */
+#define elm_obj_bg_color_set(r, g, b) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_COLOR_SET), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b)
+
+/**
+ * @def elm_obj_bg_color_get
+ * @since 1.8
+ *
+ * Get the color set on a given background widget
+ *
+ * @param[out] r
+ * @param[out] g
+ * @param[out] b
+ *
+ * @see elm_bg_color_get
+ */
+#define elm_obj_bg_color_get(r, g, b) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_COLOR_GET), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b)
+
+/**
+ * @def elm_obj_bg_load_size_set
+ * @since 1.8
+ *
+ * Set the size of the pixmap representation of the image set on a
+ * given background widget.
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_bg_load_size_set
+ */
+#define elm_obj_bg_load_size_set(w, h) ELM_OBJ_BG_ID(ELM_OBJ_BG_SUB_ID_LOAD_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+
/**
* Identifiers on how a background widget is to display its image --
* if it was set to use an image file.
diff --git a/src/lib/elm_box.c b/src/lib/elm_box.c
index b65a81f4c..609b45b19 100644
--- a/src/lib/elm_box.c
+++ b/src/lib/elm_box.c
@@ -3,11 +3,12 @@
#include "els_box.h"
#include "elm_widget_box.h"
-EAPI const char ELM_BOX_SMART_NAME[] = "elm_box";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_BOX_SMART_NAME, _elm_box, Elm_Box_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_BOX_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_BOX_CLASS
+#define MY_CLASS_NAME "elm_box"
static const char SIG_CHILD_ADDED[] = "child,added";
static const char SIG_CHILD_REMOVED[] = "child,removed";
@@ -44,15 +45,24 @@ _child_removed_cb_proxy(void *data,
evas_object_smart_callback_call(box, SIG_CHILD_REMOVED, child);
}
-static Eina_Bool
-_elm_box_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_box_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_box_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_BOX_DATA_GET(obj, sd);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+ if (ret) *ret = EINA_FALSE;
/* Focus chain */
/* TODO: Change this to use other chain */
@@ -60,56 +70,74 @@ _elm_box_smart_focus_next(const Evas_Object *obj,
list_data_get = eina_list_data_get;
else
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
Evas_Object_Box_Data *bd =
- evas_object_smart_data_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_data_get(wd->resize_obj);
items = bd->children;
list_data_get = _elm_box_list_data_get;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- return elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_box_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_box_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_box_smart_focus_direction(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_BOX_DATA_GET(obj, sd);
-
if ((items = elm_widget_focus_custom_chain_get(obj)))
list_data_get = eina_list_data_get;
else
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Object_Box_Data *bd =
- evas_object_smart_data_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_data_get(wd->resize_obj);
items = bd->children;
list_data_get = _elm_box_list_data_get;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- return elm_widget_focus_list_direction_get
+ int_ret = elm_widget_focus_list_direction_get
(obj, base, items, list_data_get, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_box_smart_theme(Evas_Object *obj)
+static void
+_elm_box_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_BOX_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!_elm_box_parent_sc->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ evas_object_smart_calculate(wd->resize_obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -119,14 +147,17 @@ _sizing_eval(Evas_Object *obj)
Evas_Coord w, h;
ELM_BOX_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->on_deletion)
return;
evas_object_size_hint_min_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ (wd->resize_obj, &minw, &minh);
+
evas_object_size_hint_max_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &maxw, &maxh);
+ (wd->resize_obj, &maxw, &maxh);
+
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
@@ -147,17 +178,24 @@ _on_size_hints_changed(void *data,
_sizing_eval(data);
}
-static Eina_Bool
-_elm_box_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *child)
+
+static void
+_elm_box_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_box_parent_sc->sub_object_del(obj, child)) return EINA_FALSE;
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(child, &int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
+
static void
_elm_box_custom_layout(Evas_Object *o,
Evas_Object_Box_Data *priv,
@@ -359,124 +397,115 @@ _transition_layout_animation_exec(Evas_Object *obj,
}
static void
-_elm_box_smart_add(Evas_Object *obj)
+_elm_box_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Box_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ wd->resize_obj = evas_object_box_add(evas_object_evas_get(obj));
- ELM_WIDGET_DATA(priv)->resize_obj =
- evas_object_box_add(evas_object_evas_get(obj));
- evas_object_box_layout_set
- (ELM_WIDGET_DATA(priv)->resize_obj, _elm_box_custom_layout, obj, NULL);
+ evas_object_box_layout_set(wd->resize_obj, _elm_box_custom_layout, obj, NULL);
evas_object_event_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _on_size_hints_changed, obj);
+ (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _on_size_hints_changed, obj);
- _elm_box_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, SIG_CHILD_ADDED,
+ (wd->resize_obj, SIG_CHILD_ADDED,
_child_added_cb_proxy, obj);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, SIG_CHILD_REMOVED,
+ (wd->resize_obj, SIG_CHILD_REMOVED,
_child_removed_cb_proxy, obj);
+
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
}
+
static void
-_elm_box_smart_del(Evas_Object *obj)
+_elm_box_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Eina_List *l;
Evas_Object *child;
- ELM_BOX_DATA_GET(obj, sd);
-
+ Elm_Box_Smart_Data *sd = _pd;
sd->on_deletion = EINA_TRUE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_event_callback_del_full
- (ELM_WIDGET_DATA(sd)->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_size_hints_changed, obj);
/* let's make our box object the *last* to be processed, since it
* may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(ELM_WIDGET_DATA(sd)->subobjs, l, child)
+ EINA_LIST_FOREACH (wd->subobjs, l, child)
{
- if (child == ELM_WIDGET_DATA(sd)->resize_obj)
+ if (child == wd->resize_obj)
{
- ELM_WIDGET_DATA(sd)->subobjs =
- eina_list_demote_list(ELM_WIDGET_DATA(sd)->subobjs, l);
+ wd->subobjs =
+ eina_list_demote_list(wd->subobjs, l);
break;
}
}
- _elm_box_parent_sc->base.del(obj);
-}
-
-static void
-_elm_box_smart_set_user(Elm_Box_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_box_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_box_smart_del;
-
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_box_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->theme = _elm_box_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_box_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_box_smart_focus_direction;
-}
-
-EAPI const Elm_Box_Smart_Class *
-elm_box_smart_class_get(void)
-{
- static Elm_Box_Smart_Class _sc =
- ELM_BOX_SMART_CLASS_INIT_NAME_VERSION(ELM_BOX_SMART_NAME);
- static const Elm_Box_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_box_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_box_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_box_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
return obj;
}
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+}
+
EAPI void
elm_box_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Box_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->horizontal = !!horizontal;
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_calculate(wd->resize_obj);
}
EAPI Eina_Bool
elm_box_horizontal_get(const Evas_Object *obj)
{
ELM_BOX_CHECK(obj) EINA_FALSE;
- ELM_BOX_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_box_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ const Elm_Box_Smart_Data *sd = _pd;
+ *ret = sd->horizontal;
}
EAPI void
@@ -484,19 +513,35 @@ elm_box_homogeneous_set(Evas_Object *obj,
Eina_Bool homogeneous)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_homogeneous_set(homogeneous));
+}
+
+static void
+_homogeneous_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool homogeneous = va_arg(*list, int);
+ Elm_Box_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->homogeneous = !!homogeneous;
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_calculate(wd->resize_obj);
}
EAPI Eina_Bool
elm_box_homogeneous_get(const Evas_Object *obj)
{
ELM_BOX_CHECK(obj) EINA_FALSE;
- ELM_BOX_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_box_homogeneous_get(&ret));
+ return ret;
+}
- return sd->homogeneous;
+static void
+_homogeneous_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ const Elm_Box_Smart_Data *sd = _pd;
+ *ret = sd->homogeneous;
}
EAPI void
@@ -504,10 +549,18 @@ elm_box_pack_start(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_pack_start(subobj));
+}
+
+static void
+_pack_start(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_widget_sub_object_add(obj, subobj);
- evas_object_box_prepend(ELM_WIDGET_DATA(sd)->resize_obj, subobj);
+ evas_object_box_prepend(wd->resize_obj, subobj);
}
EAPI void
@@ -515,23 +568,40 @@ elm_box_pack_end(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_pack_end(subobj));
+}
+
+static void
+_pack_end(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_widget_sub_object_add(obj, subobj);
- evas_object_box_append(ELM_WIDGET_DATA(sd)->resize_obj, subobj);
+ evas_object_box_append(wd->resize_obj, subobj);
}
+
EAPI void
elm_box_pack_before(Evas_Object *obj,
Evas_Object *subobj,
Evas_Object *before)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_pack_before(subobj, before));
+}
+
+static void
+_pack_before(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Evas_Object *before = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_widget_sub_object_add(obj, subobj);
+
evas_object_box_insert_before
- (ELM_WIDGET_DATA(sd)->resize_obj, subobj, before);
+ (wd->resize_obj, subobj, before);
}
EAPI void
@@ -540,21 +610,34 @@ elm_box_pack_after(Evas_Object *obj,
Evas_Object *after)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_pack_after(subobj, after));
+}
+
+static void
+_pack_after(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Evas_Object *after = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_widget_sub_object_add(obj, subobj);
evas_object_box_insert_after
- (ELM_WIDGET_DATA(sd)->resize_obj, subobj, after);
+ (wd->resize_obj, subobj, after);
}
EAPI void
elm_box_clear(Evas_Object *obj)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_clear());
+}
+static void
+_clear(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
/* EINA_TRUE means to delete objects as well */
- evas_object_box_remove_all(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ evas_object_box_remove_all(wd->resize_obj, EINA_TRUE);
}
EAPI void
@@ -562,28 +645,42 @@ elm_box_unpack(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_unpack(subobj));
+
+}
- if (evas_object_box_remove(ELM_WIDGET_DATA(sd)->resize_obj, subobj))
+static void
+_unpack(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ if (evas_object_box_remove(wd->resize_obj, subobj))
elm_widget_sub_object_del(obj, subobj);
}
EAPI void
elm_box_unpack_all(Evas_Object *obj)
{
+ ELM_BOX_CHECK(obj);
+ eo_do(obj, elm_obj_box_unpack_all());
+}
+
+static void
+_unpack_all(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
Evas_Object_Box_Data *bd;
Evas_Object_Box_Option *opt;
Eina_List *l;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
-
- bd = evas_object_smart_data_get(ELM_WIDGET_DATA(sd)->resize_obj);
- EINA_LIST_FOREACH(bd->children, l, opt)
+ bd = evas_object_smart_data_get(wd->resize_obj);
+ EINA_LIST_FOREACH (bd->children, l, opt)
elm_widget_sub_object_del(obj, opt->obj);
/* EINA_FALSE means to delete objects as well */
- evas_object_box_remove_all(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_box_remove_all(wd->resize_obj, EINA_FALSE);
}
EAPI void
@@ -593,14 +690,22 @@ elm_box_layout_set(Evas_Object *obj,
Ecore_Cb free_data)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_layout_set(cb, data, free_data));
+}
+static void
+_layout_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object_Box_Layout cb = va_arg(*list, Evas_Object_Box_Layout);
+ const void *data = va_arg(*list, const void *);
+ Ecore_Cb free_data = va_arg(*list, Ecore_Cb);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (cb)
evas_object_box_layout_set
- (ELM_WIDGET_DATA(sd)->resize_obj, cb, data, free_data);
+ (wd->resize_obj, cb, data, free_data);
else
evas_object_box_layout_set
- (ELM_WIDGET_DATA(sd)->resize_obj, _elm_box_custom_layout, obj, NULL);
+ (wd->resize_obj, _elm_box_custom_layout, obj, NULL);
}
EAPI void
@@ -703,9 +808,17 @@ EAPI Eina_List *
elm_box_children_get(const Evas_Object *obj)
{
ELM_BOX_CHECK(obj) NULL;
- ELM_BOX_DATA_GET(obj, sd);
+ Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_box_children_get(&ret));
+ return ret;
+}
- return evas_object_box_children_get(ELM_WIDGET_DATA(sd)->resize_obj);
+static void
+_children_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = evas_object_box_children_get(wd->resize_obj);
}
EAPI void
@@ -714,10 +827,18 @@ elm_box_padding_set(Evas_Object *obj,
Evas_Coord vertical)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_padding_set(horizontal, vertical));
+}
+
+static void
+_padding_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord horizontal = va_arg(*list, Evas_Coord);
+ Evas_Coord vertical = va_arg(*list, Evas_Coord);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_box_padding_set
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
@@ -726,10 +847,17 @@ elm_box_padding_get(const Evas_Object *obj,
Evas_Coord *vertical)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_box_padding_get(horizontal, vertical));
+}
+static void
+_padding_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *horizontal = va_arg(*list, Evas_Coord *);
+ Evas_Coord *vertical = va_arg(*list, Evas_Coord *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_box_padding_get
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
@@ -738,10 +866,18 @@ elm_box_align_set(Evas_Object *obj,
double vertical)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_align_set(horizontal, vertical));
+}
+
+static void
+_align_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double horizontal = va_arg(*list, double);
+ double vertical = va_arg(*list, double);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_size_hint_align_set
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
@@ -750,23 +886,112 @@ elm_box_align_get(const Evas_Object *obj,
double *vertical)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_box_align_get(horizontal, vertical));
+}
+
+static void
+_align_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double *horizontal = va_arg(*list, double *);
+ double *vertical = va_arg(*list, double *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_size_hint_align_get
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
elm_box_recalculate(Evas_Object *obj)
{
ELM_BOX_CHECK(obj);
- ELM_BOX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_box_recalculate());
+}
+
+static void
+_recalculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Box_Smart_Data *sd = _pd;
if (sd->recalc) return;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_smart_need_recalculate_set
- (ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ (wd->resize_obj, EINA_TRUE);
sd->recalc++;
- evas_object_smart_calculate(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_smart_calculate(wd->resize_obj);
sd->recalc--;
}
+
+static void
+_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_box_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_box_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_box_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_box_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_box_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_box_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_box_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_box_smart_focus_direction),
+
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_SET), _homogeneous_set),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_GET), _homogeneous_get),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_START), _pack_start),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_END), _pack_end),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_BEFORE), _pack_before),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_AFTER), _pack_after),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_UNPACK), _unpack),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_UNPACK_ALL), _unpack_all),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_LAYOUT_SET), _layout_set),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_CHILDREN_GET), _children_get),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PADDING_SET), _padding_set),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PADDING_GET), _padding_get),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_ALIGN_SET), _align_set),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_ALIGN_GET), _align_get),
+ EO_OP_FUNC(ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_RECALCULATE), _recalculate),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_SET, "Set the horizontal orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_GET, "Get the horizontal orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_SET, "Set the box to arrange its children homogeneously."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_GET, "Get whether the box is using homogeneous mode or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PACK_START, "Add an object to the beginning of the pack list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PACK_END, "Add an object at the end of the pack list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PACK_BEFORE, "Adds an object to the box before the indicated object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PACK_AFTER, "Adds an object to the box after the indicated object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_CLEAR, "Clear the box of all children."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_UNPACK, "Unpack a box item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_UNPACK_ALL, "Remove all items from the box, without deleting them."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_LAYOUT_SET, "Set the layout defining function to be used by the box."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_CHILDREN_GET, "Retrieve a list of the objects packed into the box."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PADDING_SET, "Set the space (padding) between the box's elements."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_PADDING_GET, "Get the space (padding) between the box's elements."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_ALIGN_SET, "Set the alignment of the whole bounding box of contents."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_ALIGN_GET, "Get the alignment of the whole bounding box of contents."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BOX_SUB_ID_RECALCULATE, "Force the box to recalculate its children packing."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_BOX_BASE_ID, op_desc, ELM_OBJ_BOX_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Box_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_box_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_box.h b/src/lib/elm_box.h
index 1a3e72e41..db0bdaf17 100644
--- a/src/lib/elm_box.h
+++ b/src/lib/elm_box.h
@@ -1,3 +1,257 @@
+
+#define ELM_OBJ_BOX_CLASS elm_obj_box_class_get()
+
+const Eo_Class *elm_obj_box_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_BOX_BASE_ID;
+
+enum
+{
+ ELM_OBJ_BOX_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_BOX_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_SET,
+ ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_GET,
+ ELM_OBJ_BOX_SUB_ID_PACK_START,
+ ELM_OBJ_BOX_SUB_ID_PACK_END,
+ ELM_OBJ_BOX_SUB_ID_PACK_BEFORE,
+ ELM_OBJ_BOX_SUB_ID_PACK_AFTER,
+ ELM_OBJ_BOX_SUB_ID_CLEAR,
+ ELM_OBJ_BOX_SUB_ID_UNPACK,
+ ELM_OBJ_BOX_SUB_ID_UNPACK_ALL,
+ ELM_OBJ_BOX_SUB_ID_LAYOUT_SET,
+ ELM_OBJ_BOX_SUB_ID_CHILDREN_GET,
+ ELM_OBJ_BOX_SUB_ID_PADDING_SET,
+ ELM_OBJ_BOX_SUB_ID_PADDING_GET,
+ ELM_OBJ_BOX_SUB_ID_ALIGN_SET,
+ ELM_OBJ_BOX_SUB_ID_ALIGN_GET,
+ ELM_OBJ_BOX_SUB_ID_RECALCULATE,
+ ELM_OBJ_BOX_SUB_ID_LAST
+};
+
+#define ELM_OBJ_BOX_ID(sub_id) (ELM_OBJ_BOX_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_box_horizontal_set
+ * @since 1.8
+ *
+ * Set the horizontal orientation
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_box_horizontal_set
+ */
+#define elm_obj_box_horizontal_set(horizontal) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_box_horizontal_get
+ * @since 1.8
+ *
+ * Get the horizontal orientation
+ *
+ * @param[out] ret
+ *
+ * @see elm_box_horizontal_get
+ */
+#define elm_obj_box_horizontal_get(ret) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_box_homogeneous_set
+ * @since 1.8
+ *
+ * Set the box to arrange its children homogeneously
+ *
+ * @param[in] homogeneous
+ *
+ * @see elm_box_homogeneous_set
+ */
+#define elm_obj_box_homogeneous_set(homogeneous) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous)
+
+/**
+ * @def elm_obj_box_homogeneous_get
+ * @since 1.8
+ *
+ * Get whether the box is using homogeneous mode or not
+ *
+ * @param[out] ret
+ *
+ * @see elm_box_homogeneous_get
+ */
+#define elm_obj_box_homogeneous_get(ret) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_box_pack_start
+ * @since 1.8
+ *
+ * Add an object to the beginning of the pack list
+ *
+ * @param[in] subobj
+ *
+ * @see elm_box_pack_start
+ */
+#define elm_obj_box_pack_start(subobj) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_START), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_box_pack_end
+ * @since 1.8
+ *
+ * Add an object at the end of the pack list
+ *
+ * @param[in] subobj
+ *
+ * @see elm_box_pack_end
+ */
+#define elm_obj_box_pack_end(subobj) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_END), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_box_pack_before
+ * @since 1.8
+ *
+ * Adds an object to the box before the indicated object
+ *
+ * @param[in] subobj
+ * @param[in] before
+ *
+ * @see elm_box_pack_before
+ */
+#define elm_obj_box_pack_before(subobj, before) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_BEFORE), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(Evas_Object *, before)
+
+/**
+ * @def elm_obj_box_pack_after
+ * @since 1.8
+ *
+ * Adds an object to the box after the indicated object
+ *
+ * @param[in] subobj
+ * @param[in] after
+ *
+ * @see elm_box_pack_after
+ */
+#define elm_obj_box_pack_after(subobj, after) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PACK_AFTER), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(Evas_Object *, after)
+
+/**
+ * @def elm_obj_box_clear
+ * @since 1.8
+ *
+ * Clear the box of all children
+ *
+ *
+ * @see elm_box_clear
+ */
+#define elm_obj_box_clear() ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_box_unpack
+ * @since 1.8
+ *
+ * Unpack a box item
+ *
+ * @param[in] subobj
+ *
+ * @see elm_box_unpack
+ */
+#define elm_obj_box_unpack(subobj) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_box_unpack_all
+ * @since 1.8
+ *
+ * Remove all items from the box, without deleting them
+ *
+ *
+ * @see elm_box_unpack_all
+ */
+#define elm_obj_box_unpack_all() ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_UNPACK_ALL)
+
+/**
+ * @def elm_obj_box_layout_set
+ * @since 1.8
+ *
+ * Set the layout defining function to be used by the box
+ *
+ * @param[in] cb
+ * @param[in] data
+ * @param[in] free_data
+ *
+ * @see elm_box_layout_set
+ */
+#define elm_obj_box_layout_set(cb, data, free_data) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_LAYOUT_SET), EO_TYPECHECK(Evas_Object_Box_Layout, cb), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Ecore_Cb, free_data)
+
+/**
+ * @def elm_obj_box_children_get
+ * @since 1.8
+ *
+ * Retrieve a list of the objects packed into the box
+ *
+ * @param[out] ret
+ *
+ * @see elm_box_children_get
+ */
+#define elm_obj_box_children_get(ret) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret)
+
+/**
+ * @def elm_obj_box_padding_set
+ * @since 1.8
+ *
+ * Set the space (padding) between the box's elements.
+ *
+ * @param[in] horizontal
+ * @param[in] vertical
+ *
+ * @see elm_box_padding_set
+ */
+#define elm_obj_box_padding_set(horizontal, vertical) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PADDING_SET), EO_TYPECHECK(Evas_Coord, horizontal), EO_TYPECHECK(Evas_Coord, vertical)
+
+/**
+ * @def elm_obj_box_padding_get
+ * @since 1.8
+ *
+ * Get the space (padding) between the box's elements.
+ *
+ * @param[out] horizontal
+ * @param[out] vertical
+ *
+ * @see elm_box_padding_get
+ */
+#define elm_obj_box_padding_get(horizontal, vertical) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_PADDING_GET), EO_TYPECHECK(Evas_Coord *, horizontal), EO_TYPECHECK(Evas_Coord *, vertical)
+
+/**
+ * @def elm_obj_box_align_set
+ * @since 1.8
+ *
+ * Set the alignment of the whole bounding box of contents.
+ *
+ * @param[in] horizontal
+ * @param[in] vertical
+ *
+ * @see elm_box_align_set
+ */
+#define elm_obj_box_align_set(horizontal, vertical) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, horizontal), EO_TYPECHECK(double, vertical)
+
+/**
+ * @def elm_obj_box_align_get
+ * @since 1.8
+ *
+ * Get the alignment of the whole bounding box of contents.
+ *
+ * @param[out] horizontal
+ * @param[out] vertical
+ *
+ * @see elm_box_align_get
+ */
+#define elm_obj_box_align_get(horizontal, vertical) ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, horizontal), EO_TYPECHECK(double *, vertical)
+
+/**
+ * @def elm_obj_box_recalculate
+ * @since 1.8
+ *
+ * Force the box to recalculate its children packing.
+ *
+ *
+ * @see elm_box_recalculate
+ */
+#define elm_obj_box_recalculate() ELM_OBJ_BOX_ID(ELM_OBJ_BOX_SUB_ID_RECALCULATE)
+
/**
* @defgroup Box Box
* @ingroup Elementary
diff --git a/src/lib/elm_bubble.c b/src/lib/elm_bubble.c
index 7be56f1d6..bffa15c6f 100644
--- a/src/lib/elm_bubble.c
+++ b/src/lib/elm_bubble.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_bubble.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_BUBBLE_SMART_NAME[] = "elm_bubble";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_BUBBLE_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_BUBBLE_CLASS
+
+#define MY_CLASS_NAME "elm_bubble"
static const char SIG_CLICKED[] = "clicked";
@@ -34,20 +41,16 @@ static const char *corner_string[] =
"bottom_right"
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_BUBBLE_SMART_NAME, _elm_bubble, Elm_Bubble_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
-_elm_bubble_smart_sizing_eval(Evas_Object *obj)
+_elm_bubble_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_BUBBLE_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
@@ -68,57 +71,72 @@ _on_mouse_up(void *data,
/* overriding layout's focus_next() in order to just cycle through the
* content's tree */
-static Eina_Bool
-_elm_bubble_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_bubble_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Object *content;
- ELM_BUBBLE_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
if ((elm_widget_can_focus_get(obj)) &&
- (!ELM_WIDGET_DATA(sd)->focused))
+ (!wd->focused))
{
// ACCESS
*next = (Evas_Object *)obj;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
{
content = elm_layout_content_get(obj, NULL);
- if (!content) return EINA_FALSE;
+ if (!content) return;
/* attempt to follow focus cycle into sub-object */
- return elm_widget_focus_next_get(content, dir, next);
+ int_ret = elm_widget_focus_next_get(content, dir, next);
+ if (ret) *ret = int_ret;
}
}
-static Eina_Bool
-_elm_bubble_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_bubble_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Object *content;
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
content = elm_layout_content_get(obj, NULL);
- if (!content) return EINA_FALSE;
+ if (!content) return;
/* Try Focus cycle in subitem */
- return elm_widget_focus_direction_get
+ int_ret = elm_widget_focus_direction_get
(content, base, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_bubble_smart_text_set(Evas_Object *obj,
- const char *item,
- const char *label)
+static void
+_elm_bubble_smart_text_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_bubble_parent_sc->text_set(obj, item, label))
- return EINA_FALSE;
+ const char *item = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_obj_layout_text_set(item, label, &int_ret));
+ if (!int_ret) return;
if (item && (!strcmp(item, "info") || !strcmp(item, "elm.info")))
{
@@ -130,7 +148,7 @@ _elm_bubble_smart_text_set(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
@@ -176,22 +194,23 @@ _access_info_cb(void *data __UNUSED__,
}
static void
-_elm_bubble_smart_add(Evas_Object *obj)
+_elm_bubble_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Bubble_Smart_Data);
+ Elm_Bubble_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_bubble_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->pos = ELM_BUBBLE_POS_TOP_LEFT; //default
elm_widget_can_focus_set(obj, EINA_FALSE);
evas_object_event_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_CALLBACK_MOUSE_UP,
+ (wd->resize_obj, EVAS_CALLBACK_MOUSE_UP,
_on_mouse_up, obj);
// ACCESS
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Bubble"));
_elm_access_callback_set
@@ -206,8 +225,9 @@ _elm_bubble_smart_add(Evas_Object *obj)
}
static void
-_elm_bubble_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_bubble_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool is_access = va_arg(*list, int);
ELM_BUBBLE_CHECK(obj);
if (is_access)
@@ -216,54 +236,26 @@ _elm_bubble_smart_access(Evas_Object *obj, Eina_Bool is_access)
elm_widget_can_focus_set(obj, EINA_FALSE);
}
-static void
-_elm_bubble_smart_set_user(Elm_Bubble_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_bubble_smart_add;
-
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_bubble_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_bubble_smart_focus_direction;
- ELM_WIDGET_CLASS(sc)->access = _elm_bubble_smart_access;
-
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_bubble_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_bubble_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
-}
-
-EAPI const Elm_Bubble_Smart_Class *
-elm_bubble_smart_class_get(void)
-{
- static Elm_Bubble_Smart_Class _sc =
- ELM_BUBBLE_SMART_CLASS_INIT_NAME_VERSION(ELM_BUBBLE_SMART_NAME);
- static const Elm_Bubble_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_bubble_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_bubble_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_bubble_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -271,7 +263,15 @@ elm_bubble_pos_set(Evas_Object *obj,
Elm_Bubble_Pos pos)
{
ELM_BUBBLE_CHECK(obj);
- ELM_BUBBLE_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_bubble_pos_set(pos));
+}
+
+static void
+_pos_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Bubble_Pos pos = va_arg(*list, Elm_Bubble_Pos);
+ Elm_Bubble_Smart_Data *sd = _pd;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
if (pos < ELM_BUBBLE_POS_TOP_LEFT || pos > ELM_BUBBLE_POS_BOTTOM_RIGHT)
return;
@@ -279,16 +279,95 @@ elm_bubble_pos_set(Evas_Object *obj,
sd->pos = pos;
eina_stringshare_replace
- (&(ELM_LAYOUT_DATA(sd)->group), corner_string[sd->pos]);
+ (&ld->group, corner_string[sd->pos]);
- ELM_WIDGET_DATA(sd)->api->theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Elm_Bubble_Pos
elm_bubble_pos_get(const Evas_Object *obj)
{
ELM_BUBBLE_CHECK(obj) ELM_BUBBLE_POS_INVALID;
- ELM_BUBBLE_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_BUBBLE_POS_INVALID);
+ Elm_Bubble_Pos ret = ELM_BUBBLE_POS_INVALID;
+ eo_do((Eo *) obj, elm_obj_bubble_pos_get(&ret));
+ return ret;
+}
+
+static void
+_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Bubble_Pos *ret = va_arg(*list, Elm_Bubble_Pos *);
+ Elm_Bubble_Smart_Data *sd = _pd;
+ *ret = sd->pos;
+}
+
+static void
+_elm_bubble_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_bubble_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_bubble_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
+}
+
+static void
+_elm_bubble_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
+}
+
+static void
+_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_bubble_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_bubble_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_bubble_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_bubble_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_bubble_smart_focus_direction),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_bubble_smart_access),
- return sd->pos;
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_bubble_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_bubble_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_bubble_smart_text_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_bubble_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_BUBBLE_ID(ELM_OBJ_BUBBLE_SUB_ID_POS_SET), _pos_set),
+ EO_OP_FUNC(ELM_OBJ_BUBBLE_ID(ELM_OBJ_BUBBLE_SUB_ID_POS_GET), _pos_get),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_BUBBLE_SUB_ID_POS_SET, "Set the corner of the bubble."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUBBLE_SUB_ID_POS_GET, "Get the corner of the bubble."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_BUBBLE_BASE_ID, op_desc, ELM_OBJ_BUBBLE_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Bubble_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_bubble_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_bubble.h b/src/lib/elm_bubble.h
index 501ff76cf..99eedd420 100644
--- a/src/lib/elm_bubble.h
+++ b/src/lib/elm_bubble.h
@@ -59,6 +59,47 @@
* @{
*/
+#define ELM_OBJ_BUBBLE_CLASS elm_obj_bubble_class_get()
+
+const Eo_Class *elm_obj_bubble_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_BUBBLE_BASE_ID;
+
+enum
+{
+ ELM_OBJ_BUBBLE_SUB_ID_POS_SET,
+ ELM_OBJ_BUBBLE_SUB_ID_POS_GET,
+ ELM_OBJ_BUBBLE_SUB_ID_LAST
+};
+
+#define ELM_OBJ_BUBBLE_ID(sub_id) (ELM_OBJ_BUBBLE_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_bubble_pos_set
+ * @since 1.8
+ *
+ * Set the corner of the bubble
+ *
+ * @param[in] pos
+ *
+ * @see elm_bubble_pos_set
+ */
+#define elm_obj_bubble_pos_set(pos) ELM_OBJ_BUBBLE_ID(ELM_OBJ_BUBBLE_SUB_ID_POS_SET), EO_TYPECHECK(Elm_Bubble_Pos, pos)
+
+/**
+ * @def elm_obj_bubble_pos_get
+ * @since 1.8
+ *
+ * Get the corner of the bubble
+ *
+ * @param[out] ret
+ *
+ * @see elm_bubble_pos_get
+ */
+#define elm_obj_bubble_pos_get(ret) ELM_OBJ_BUBBLE_ID(ELM_OBJ_BUBBLE_SUB_ID_POS_GET), EO_TYPECHECK(Elm_Bubble_Pos *, ret)
+
+
/**
* Defines the corner values for a bubble.
*
diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c
index 1f1cfed16..4316d74d5 100644
--- a/src/lib/elm_button.c
+++ b/src/lib/elm_button.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_button.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_BUTTON_SMART_NAME[] = "elm_button";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_BUTTON_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_BUTTON_CLASS
+
+#define MY_CLASS_NAME "elm_button"
static const char SIG_CLICKED[] = "clicked";
static const char SIG_REPEATED[] = "repeated";
@@ -31,10 +38,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_BUTTON_SMART_NAME, _elm_button, Elm_Button_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_activate(Evas_Object *obj)
{
@@ -60,28 +63,31 @@ _activate(Evas_Object *obj)
}
static void
-_elm_button_smart_sizing_eval(Evas_Object *obj)
+_elm_button_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
- ELM_BUTTON_DATA_GET(obj, sd);
-
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
}
-static Eina_Bool
-_elm_button_smart_activate(Evas_Object *obj, Elm_Activate act)
+static void
+_elm_button_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
+ Elm_Activate act = va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (act != ELM_ACTIVATE_DEFAULT) return;
evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because button's icon spot
@@ -97,77 +103,92 @@ _icon_signal_emit(Evas_Object *obj)
elm_layout_signal_emit(obj, buf, "elm");
edje_object_message_signal_process(elm_layout_edje_get(obj));
- _elm_button_smart_sizing_eval(obj);
+ eo_do(obj, elm_obj_layout_sizing_eval());
}
/* FIXME: replicated from elm_layout just because button's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_button_smart_theme(Evas_Object *obj)
+static void
+_elm_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_button_parent_sc)->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because button's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_button_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_button_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_button_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because button's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_button_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_button_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_CONTAINER_CLASS(_elm_button_parent_sc)->content_set
- (obj, part, content))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if (!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_button_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_button_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Evas_Event_Key_Down *ev = event_info;
+ if (ret) *ret = EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((strcmp(ev->keyname, "Return")) &&
(strcmp(ev->keyname, "KP_Enter")) &&
(strcmp(ev->keyname, "space")))
- return EINA_FALSE;
+ return;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -269,23 +290,24 @@ _access_state_cb(void *data __UNUSED__,
}
static void
-_elm_button_smart_add(Evas_Object *obj)
+_elm_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Button_Smart_Data);
+ Elm_Button_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_button_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,click", "",
+ (wd->resize_obj, "elm,action,click", "",
_on_clicked_signal, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,press", "",
+ (wd->resize_obj, "elm,action,press", "",
_on_pressed_signal, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,unpress", "",
+ (wd->resize_obj, "elm,action,unpress", "",
_on_unpressed_signal, obj);
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Button"));
_elm_access_callback_set
@@ -299,60 +321,39 @@ _elm_button_smart_add(Evas_Object *obj)
}
static void
-_elm_button_smart_set_user(Elm_Button_Smart_Class *sc)
+_elm_button_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_button_smart_add;
-
- ELM_WIDGET_CLASS(sc)->event = _elm_button_smart_event;
- ELM_WIDGET_CLASS(sc)->theme = _elm_button_smart_theme;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_button_smart_sub_object_del;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_button_smart_content_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_button_smart_sizing_eval;
- ELM_WIDGET_CLASS(sc)->activate = _elm_button_smart_activate;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
-
- sc->admits_autorepeat = EINA_TRUE;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Button_Smart_Class *
-elm_button_smart_class_get(void)
+static void
+_elm_button_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Button_Smart_Class _sc =
- ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION(ELM_BUTTON_SMART_NAME);
- static const Elm_Button_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_button_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
EAPI Evas_Object *
elm_button_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_button_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -360,7 +361,14 @@ elm_button_autorepeat_set(Evas_Object *obj,
Eina_Bool on)
{
ELM_BUTTON_CHECK(obj);
- ELM_BUTTON_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_button_autorepeat_set(on));
+}
+
+static void
+_autorepeat_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool on = va_arg(*list, int);
+ Elm_Button_Smart_Data *sd = _pd;
if (sd->timer)
{
@@ -371,16 +379,39 @@ elm_button_autorepeat_set(Evas_Object *obj,
sd->repeating = EINA_FALSE;
}
-#define _AR_CAPABLE(_sd) \
- (ELM_BUTTON_CLASS(ELM_WIDGET_DATA(_sd)->api)->admits_autorepeat)
+#define _AR_CAPABLE(obj) \
+ (_elm_button_admits_autorepeat_get(obj))
+
+static Eina_Bool
+_elm_button_admits_autorepeat_get(const Evas_Object *obj)
+{
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_button_admits_autorepeat_get(&ret));
+ return ret;
+}
+
+static void
+_admits_autorepeat_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
EAPI Eina_Bool
elm_button_autorepeat_get(const Evas_Object *obj)
{
ELM_BUTTON_CHECK(obj) EINA_FALSE;
- ELM_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_button_autorepeat_get(&ret));
+ return ret;
+}
- return _AR_CAPABLE(sd) & sd->autorepeat;
+static void
+_autorepeat_get(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Button_Smart_Data *sd = _pd;
+ *ret = _AR_CAPABLE(obj) & sd->autorepeat;
}
EAPI void
@@ -388,9 +419,16 @@ elm_button_autorepeat_initial_timeout_set(Evas_Object *obj,
double t)
{
ELM_BUTTON_CHECK(obj);
- ELM_BUTTON_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_button_autorepeat_initial_timeout_set(t));
+}
+
+static void
+_autorepeat_initial_timeout_set(Eo *obj, void *_pd, va_list *list)
+{
+ double t = va_arg(*list, double);
+ Elm_Button_Smart_Data *sd = _pd;
- if (!_AR_CAPABLE(sd))
+ if (!_AR_CAPABLE(obj))
{
ERR("this widget does not support auto repetition of clicks.");
return;
@@ -409,11 +447,21 @@ EAPI double
elm_button_autorepeat_initial_timeout_get(const Evas_Object *obj)
{
ELM_BUTTON_CHECK(obj) 0.0;
- ELM_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_button_autorepeat_initial_timeout_get(&ret));
+ return ret;
+}
- if (!_AR_CAPABLE(sd)) return 0.0;
+static void
+_autorepeat_initial_timeout_get(Eo *obj, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Button_Smart_Data *sd = _pd;
- return sd->ar_threshold;
+ if (!_AR_CAPABLE(obj))
+ *ret = 0.0;
+ else
+ *ret = sd->ar_threshold;
}
EAPI void
@@ -421,9 +469,16 @@ elm_button_autorepeat_gap_timeout_set(Evas_Object *obj,
double t)
{
ELM_BUTTON_CHECK(obj);
- ELM_BUTTON_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_button_autorepeat_gap_timeout_set(t));
+}
- if (!_AR_CAPABLE(sd))
+static void
+_autorepeat_gap_timeout_set(Eo *obj, void *_pd, va_list *list)
+{
+ double t = va_arg(*list, double);
+ Elm_Button_Smart_Data *sd = _pd;
+
+ if (!_AR_CAPABLE(obj))
{
ERR("this widget does not support auto repetition of clicks.");
return;
@@ -439,7 +494,89 @@ EAPI double
elm_button_autorepeat_gap_timeout_get(const Evas_Object *obj)
{
ELM_BUTTON_CHECK(obj) 0.0;
- ELM_BUTTON_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_button_autorepeat_gap_timeout_get(&ret));
+ return ret;
+}
- return sd->ar_interval;
+static void
+_autorepeat_gap_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Button_Smart_Data *sd = _pd;
+
+ *ret = sd->ar_interval;
+}
+
+static void
+_elm_button_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_button_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_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_button_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_button_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_button_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_button_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_button_smart_activate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_button_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_button_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_button_smart_content_set),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_button_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_button_smart_content_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_button_smart_text_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _admits_autorepeat_get),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET), _autorepeat_set),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET), _autorepeat_get),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET), _autorepeat_initial_timeout_set),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET), _autorepeat_initial_timeout_get),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET), _autorepeat_gap_timeout_set),
+ EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET), _autorepeat_gap_timeout_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET, "Get whether auto-repetition is implemented or not"),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET, "Turn on/off the autorepeat event generated when the button is kept pressed."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET, "Get whether the autorepeat feature is enabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET, "Set the initial timeout before the autorepeat event is generated."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET, "Get the initial timeout before the autorepeat event is generated."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET, "Set the interval between each generated autorepeat event."),
+ EO_OP_DESCRIPTION(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET, "Get the interval between each generated autorepeat event."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_BUTTON_BASE_ID, op_desc, ELM_OBJ_BUTTON_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Button_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_button_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
+
diff --git a/src/lib/elm_button.h b/src/lib/elm_button.h
index 2dac0b1bb..3a2e3d2a7 100644
--- a/src/lib/elm_button.h
+++ b/src/lib/elm_button.h
@@ -65,6 +65,100 @@
* @{
*/
+#define ELM_OBJ_BUTTON_CLASS elm_obj_button_class_get()
+
+const Eo_Class *elm_obj_button_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_BUTTON_BASE_ID;
+
+enum
+{
+ ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET,
+ ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET,
+ ELM_OBJ_BUTTON_SUB_ID_LAST
+};
+
+#define ELM_OBJ_BUTTON_ID(sub_id) (ELM_OBJ_BUTTON_BASE_ID + sub_id)
+
+#define elm_obj_button_admits_autorepeat_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_button_autorepeat_set
+ * @since 1.8
+ *
+ * Turn on/off the autorepeat event generated when the button is kept pressed
+ *
+ * @param[in] on
+ *
+ * @see elm_button_autorepeat_set
+ */
+#define elm_obj_button_autorepeat_set(on) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET), EO_TYPECHECK(Eina_Bool, on)
+
+/**
+ * @def elm_obj_button_autorepeat_get
+ * @since 1.8
+ *
+ * Get whether the autorepeat feature is enabled
+ *
+ * @param[out] ret
+ *
+ * @see elm_button_autorepeat_get
+ */
+#define elm_obj_button_autorepeat_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_button_autorepeat_initial_timeout_set
+ * @since 1.8
+ *
+ * Set the initial timeout before the autorepeat event is generated
+ *
+ * @param[in] t
+ *
+ * @see elm_button_autorepeat_initial_timeout_set
+ */
+#define elm_obj_button_autorepeat_initial_timeout_set(t) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET), EO_TYPECHECK(double, t)
+
+/**
+ * @def elm_obj_button_autorepeat_initial_timeout_get
+ * @since 1.8
+ *
+ * Get the initial timeout before the autorepeat event is generated
+ *
+ * @param[out] ret
+ *
+ * @see elm_button_autorepeat_initial_timeout_get
+ */
+#define elm_obj_button_autorepeat_initial_timeout_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_button_autorepeat_gap_timeout_set
+ * @since 1.8
+ *
+ * Set the interval between each generated autorepeat event
+ *
+ * @param[in] t
+ *
+ * @see elm_button_autorepeat_gap_timeout_set
+ */
+#define elm_obj_button_autorepeat_gap_timeout_set(t) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET), EO_TYPECHECK(double, t)
+
+/**
+ * @def elm_obj_button_autorepeat_gap_timeout_get
+ * @since 1.8
+ *
+ * Get the interval between each generated autorepeat event
+ *
+ * @param[out] ret
+ *
+ * @see elm_button_autorepeat_gap_timeout_get
+ */
+#define elm_obj_button_autorepeat_gap_timeout_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
/**
* Add a new button to the parent's canvas
*
diff --git a/src/lib/elm_calendar.c b/src/lib/elm_calendar.c
index e915a1f15..6c11e646b 100644
--- a/src/lib/elm_calendar.c
+++ b/src/lib/elm_calendar.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_calendar.h"
-EAPI const char ELM_CALENDAR_SMART_NAME[] = "elm_calendar";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_CALENDAR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_CALENDAR_CLASS
+
+#define MY_CLASS_NAME "elm_calendar"
static const char SIG_CHANGED[] = "changed";
static const char SIG_DISPLAY_CHANGED[] = "display,changed";
@@ -27,10 +33,6 @@ static int _days_in_month[2][12] =
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_CALENDAR_SMART_NAME, _elm_calendar, Elm_Calendar_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static Elm_Calendar_Mark *
_mark_new(Evas_Object *obj,
const char *mark_type,
@@ -57,15 +59,16 @@ _mark_free(Elm_Calendar_Mark *mark)
}
static void
-_elm_calendar_smart_sizing_eval(Evas_Object *obj)
+_elm_calendar_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+
{
Evas_Coord minw = -1, minh = -1;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(8, &minw, ELM_DAY_LAST, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -111,7 +114,7 @@ _not_today(Elm_Calendar_Smart_Data *sd)
char emission[32];
snprintf(emission, sizeof(emission), "cit_%i,not_today", sd->today_it);
- elm_layout_signal_emit(ELM_WIDGET_DATA(sd)->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "elm");
sd->today_it = -1;
}
@@ -122,7 +125,7 @@ _today(Elm_Calendar_Smart_Data *sd,
char emission[32];
snprintf(emission, sizeof(emission), "cit_%i,today", it);
- elm_layout_signal_emit(ELM_WIDGET_DATA(sd)->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "elm");
sd->today_it = it;
}
@@ -178,7 +181,7 @@ _text_day_color_update(Elm_Calendar_Smart_Data *sd,
return;
}
- elm_layout_signal_emit(ELM_WIDGET_DATA(sd)->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "elm");
}
static void
@@ -190,10 +193,10 @@ _set_month_year(Elm_Calendar_Smart_Data *sd)
buf = sd->format_func(&sd->shown_time);
if (buf)
{
- elm_layout_text_set(ELM_WIDGET_DATA(sd)->obj, "month_text", buf);
+ elm_layout_text_set(sd->obj, "month_text", buf);
free(buf);
}
- else elm_layout_text_set(ELM_WIDGET_DATA(sd)->obj, "month_text", "");
+ else elm_layout_text_set(sd->obj, "month_text", "");
}
static char *
@@ -492,15 +495,18 @@ _set_headers(Evas_Object *obj)
elm_layout_thaw(obj);
}
-static Eina_Bool
-_elm_calendar_smart_theme(Evas_Object *obj)
+static void
+_elm_calendar_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_calendar_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- evas_object_smart_changed(obj);
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- return EINA_TRUE;
+ evas_object_smart_changed(obj);
+ if (ret) *ret = EINA_TRUE;
}
/* Set correct tm_wday and tm_yday after other fields changes*/
@@ -713,18 +719,22 @@ _update_cur_date(void *data)
return ECORE_CALLBACK_RENEW;
}
-static Eina_Bool
-_elm_calendar_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_calendar_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Smart_Data *sd = _pd;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (elm_widget_disabled_get(obj)) return;
if ((!strcmp(ev->keyname, "Prior")) ||
((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
@@ -772,15 +782,15 @@ _elm_calendar_smart_event(Evas_Object *obj,
&& (sd->shown_time.tm_mon == sd->selected_time.tm_mon)))
_update_sel_it(obj, sd->selected_it + ELM_DAY_LAST);
}
- else return EINA_FALSE;
+ else return;
}
- else return EINA_FALSE;
+ else return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_calendar_smart_calculate(Evas_Object *obj)
+_elm_calendar_smart_calculate(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
elm_layout_freeze(obj);
@@ -791,15 +801,16 @@ _elm_calendar_smart_calculate(Evas_Object *obj)
}
static void
-_elm_calendar_smart_add(Evas_Object *obj)
+_elm_calendar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
time_t weekday = 259200; /* Just the first sunday since epoch */
time_t current_time;
int i, t;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Calendar_Smart_Data);
+ Elm_Calendar_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_calendar_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->first_interval = 0.85;
priv->year_min = 2;
@@ -812,16 +823,16 @@ _elm_calendar_smart_add(Evas_Object *obj)
priv->selectable = (~(ELM_CALENDAR_SELECTABLE_NONE));
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,increment,start", "*",
+ (wd->resize_obj, "elm,action,increment,start", "*",
_button_inc_start, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,decrement,start", "*",
+ (wd->resize_obj, "elm,action,decrement,start", "*",
_button_dec_start, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,stop", "*",
+ (wd->resize_obj, "elm,action,stop", "*",
_button_stop, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,selected", "*",
+ (wd->resize_obj, "elm,action,selected", "*",
_day_selected, obj);
for (i = 0; i < ELM_DAY_LAST; i++)
@@ -862,11 +873,11 @@ _elm_calendar_smart_add(Evas_Object *obj)
}
static void
-_elm_calendar_smart_del(Evas_Object *obj)
+_elm_calendar_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
int i;
Elm_Calendar_Mark *mark;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Smart_Data *sd = _pd;
if (sd->spin) ecore_timer_del(sd->spin);
if (sd->update_timer) ecore_timer_del(sd->update_timer);
@@ -882,21 +893,40 @@ _elm_calendar_smart_del(Evas_Object *obj)
for (i = 0; i < ELM_DAY_LAST; i++)
eina_stringshare_del(sd->weekdays[i]);
- ELM_WIDGET_CLASS(_elm_calendar_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_calendar_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_calendar_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_calendar_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_calendar_smart_focus_next_enable;
+}
+
+static void
+_elm_calendar_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_calendar_smart_focus_next(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
int maxdays, day, i;
Eina_List *items = NULL;
Evas_Object *ao;
Evas_Object *po;
- ELM_CALENDAR_CHECK(obj) EINA_FALSE;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Smart_Data *sd = _pd;
items = eina_list_append(items, sd->month_access);
items = eina_list_append(items, sd->dec_btn_access);
@@ -919,8 +949,9 @@ _elm_calendar_smart_focus_next(const Evas_Object *obj,
}
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
static void
@@ -962,84 +993,52 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
static void
-_elm_calendar_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_calendar_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(obj, is_access);
-}
-
-static void
-_elm_calendar_smart_set_user(Elm_Calendar_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_calendar_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_calendar_smart_del;
- ELM_WIDGET_CLASS(sc)->base.calculate = _elm_calendar_smart_calculate;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_calendar_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_calendar_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_calendar_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_calendar_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_calendar_smart_access;
-}
-
-EAPI const Elm_Calendar_Smart_Class *
-elm_calendar_smart_class_get(void)
+_elm_calendar_smart_access(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Calendar_Smart_Class _sc =
- ELM_CALENDAR_SMART_CLASS_INIT_NAME_VERSION(ELM_CALENDAR_SMART_NAME);
- static const Elm_Calendar_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_calendar_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_calendar_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(obj, _elm_calendar_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_calendar_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
+
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Calendar_Smart_Data *sd = _pd;
+ sd->obj = obj;
- obj = elm_widget_add(_elm_calendar_smart_class_new(), parent);
- if (!obj) return NULL;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_calendar_weekdays_names_set(Evas_Object *obj,
const char *weekdays[])
{
+ ELM_CALENDAR_CHECK(obj);
+ eo_do(obj, elm_obj_calendar_weekdays_names_set(weekdays));
+}
+
+static void
+_weekdays_names_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char **weekdays = va_arg(*list, const char **);
int i;
- ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(weekdays);
for (i = 0; i < ELM_DAY_LAST; i++)
@@ -1054,9 +1053,19 @@ EAPI const char **
elm_calendar_weekdays_names_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) NULL;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char **ret = NULL;
+ eo_do((Eo *) obj, elm_obj_calendar_weekdays_names_get(&ret));
+ return ret;
+}
- return sd->weekdays;
+static void
+_weekdays_names_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char ***ret = va_arg(*list, const char ***);
+ *ret = NULL;
+ Elm_Calendar_Smart_Data *sd = _pd;
+
+ *ret = sd->weekdays;
}
EAPI void
@@ -1064,8 +1073,14 @@ elm_calendar_interval_set(Evas_Object *obj,
double interval)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_interval_set(interval));
+}
+static void
+_interval_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double interval = va_arg(*list, double);
+ Elm_Calendar_Smart_Data *sd = _pd;
sd->first_interval = interval;
}
@@ -1073,9 +1088,18 @@ EAPI double
elm_calendar_interval_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) 0.0;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_calendar_interval_get(&ret));
+ return ret;
+}
- return sd->first_interval;
+static void
+_interval_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = 0.0;
+ Elm_Calendar_Smart_Data *sd = _pd;
+ *ret = sd->first_interval;
}
EAPI void
@@ -1084,7 +1108,15 @@ elm_calendar_min_max_year_set(Evas_Object *obj,
int max)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_min_max_year_set(min, max));
+}
+
+static void
+_min_max_year_set(Eo *obj, void *_pd, va_list *list)
+{
+ int min = va_arg(*list, int);
+ int max = va_arg(*list, int);
+ Elm_Calendar_Smart_Data *sd = _pd;
min -= 1900;
max -= 1900;
@@ -1107,7 +1139,15 @@ elm_calendar_min_max_year_get(const Evas_Object *obj,
int *max)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_calendar_min_max_year_get(min, max));
+}
+
+static void
+_min_max_year_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *min = va_arg(*list, int *);
+ int *max = va_arg(*list, int *);
+ Elm_Calendar_Smart_Data *sd = _pd;
if (min) *min = sd->year_min + 1900;
if (max) *max = sd->year_max + 1900;
@@ -1129,7 +1169,7 @@ EINA_DEPRECATED EAPI Eina_Bool
elm_calendar_day_selection_disabled_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) EINA_FALSE;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ ELM_CALENDAR_DATA_GET(obj, sd);
return !!(sd->select_mode == ELM_CALENDAR_SELECT_MODE_NONE);
}
@@ -1139,7 +1179,14 @@ elm_calendar_selected_time_set(Evas_Object *obj,
struct tm *selected_time)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_selected_time_set(selected_time));
+}
+
+static void
+_selected_time_set(Eo *obj, void *_pd, va_list *list)
+{
+ struct tm *selected_time = va_arg(*list, struct tm *);
+ Elm_Calendar_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(selected_time);
if (sd->selectable & ELM_CALENDAR_SELECTABLE_YEAR)
@@ -1172,15 +1219,27 @@ elm_calendar_selected_time_get(const Evas_Object *obj,
struct tm *selected_time)
{
ELM_CALENDAR_CHECK(obj) EINA_FALSE;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(selected_time, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_calendar_selected_time_get(selected_time, &ret));
+ return ret;
+}
+
+static void
+_selected_time_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ struct tm *selected_time = va_arg(*list, struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ Elm_Calendar_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(selected_time);
if ((sd->select_mode == ELM_CALENDAR_SELECT_MODE_ONDEMAND)
&& (!sd->selected))
- return EINA_FALSE;
+ return;
*selected_time = sd->selected_time;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
EAPI void
@@ -1188,7 +1247,14 @@ elm_calendar_format_function_set(Evas_Object *obj,
Elm_Calendar_Format_Cb format_function)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_format_function_set(format_function));
+}
+
+static void
+_format_function_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Calendar_Format_Cb format_function = va_arg(*list, Elm_Calendar_Format_Cb);
+ Elm_Calendar_Smart_Data *sd = _pd;
sd->format_func = format_function;
_set_month_year(sd);
@@ -1201,15 +1267,28 @@ elm_calendar_mark_add(Evas_Object *obj,
Elm_Calendar_Mark_Repeat_Type repeat)
{
ELM_CALENDAR_CHECK(obj) NULL;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Elm_Calendar_Mark *ret = NULL;
+ eo_do(obj, elm_obj_calendar_mark_add(mark_type, mark_time, repeat, &ret));
+ return ret;
+}
+static void
+_mark_add(Eo *obj, void *_pd, va_list *list)
+{
+ const char *mark_type = va_arg(*list, const char *);
+ struct tm *mark_time = va_arg(*list, struct tm *);
+ Elm_Calendar_Mark_Repeat_Type repeat = va_arg(*list, Elm_Calendar_Mark_Repeat_Type);
+ Elm_Calendar_Mark **ret = va_arg(*list, Elm_Calendar_Mark **);
+ if (ret) *ret = NULL;
+
+ Elm_Calendar_Smart_Data *sd = _pd;
Elm_Calendar_Mark *mark;
mark = _mark_new(obj, mark_type, mark_time, repeat);
sd->marks = eina_list_append(sd->marks, mark);
mark->node = eina_list_last(sd->marks);
- return mark;
+ if (ret) *ret = mark;
}
EAPI void
@@ -1227,8 +1306,13 @@ EAPI void
elm_calendar_marks_clear(Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_marks_clear());
+}
+static void
+_marks_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Calendar_Smart_Data *sd = _pd;
Elm_Calendar_Mark *mark;
EINA_LIST_FREE (sd->marks, mark)
@@ -1239,16 +1323,29 @@ EAPI const Eina_List *
elm_calendar_marks_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) NULL;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_calendar_marks_get(&ret));
+ return ret;
+}
- return sd->marks;
+static void
+_marks_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Calendar_Smart_Data *sd = _pd;
+ *ret = sd->marks;
}
EAPI void
elm_calendar_marks_draw(Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj);
+ eo_do(obj, elm_obj_calendar_marks_draw());
+}
+static void
+_marks_draw(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
evas_object_smart_changed(obj);
}
@@ -1257,7 +1354,14 @@ elm_calendar_first_day_of_week_set(Evas_Object *obj,
Elm_Calendar_Weekday day)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_first_day_of_week_set(day));
+}
+
+static void
+_first_day_of_week_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Calendar_Weekday day = va_arg(*list, Elm_Calendar_Weekday);
+ Elm_Calendar_Smart_Data *sd = _pd;
if (day >= ELM_DAY_LAST) return;
if (sd->first_week_day != day)
@@ -1271,9 +1375,17 @@ EAPI Elm_Calendar_Weekday
elm_calendar_first_day_of_week_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) - 1;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Weekday ret = -1;
+ eo_do((Eo *) obj, elm_obj_calendar_first_day_of_week_get(&ret));
+ return ret;
+}
- return sd->first_week_day;
+static void
+_first_day_of_week_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Calendar_Weekday *ret = va_arg(*list, Elm_Calendar_Weekday *);
+ Elm_Calendar_Smart_Data *sd = _pd;
+ *ret = sd->first_week_day;
}
EAPI void
@@ -1281,7 +1393,14 @@ elm_calendar_select_mode_set(Evas_Object *obj,
Elm_Calendar_Select_Mode mode)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_select_mode_set(mode));
+}
+
+static void
+_select_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Calendar_Select_Mode mode = va_arg(*list, Elm_Calendar_Select_Mode);
+ Elm_Calendar_Smart_Data *sd = _pd;
if ((mode <= ELM_CALENDAR_SELECT_MODE_ONDEMAND)
&& (sd->select_mode != mode))
@@ -1301,17 +1420,31 @@ EAPI Elm_Calendar_Select_Mode
elm_calendar_select_mode_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) - 1;
- ELM_CALENDAR_DATA_GET(obj, sd);
+ Elm_Calendar_Select_Mode ret = -1;
+ eo_do((Eo *) obj, elm_obj_calendar_select_mode_get(&ret));
+ return ret;
+}
- return sd->select_mode;
+static void
+_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Calendar_Select_Mode *ret = va_arg(*list, Elm_Calendar_Select_Mode *);
+ Elm_Calendar_Smart_Data *sd = _pd;
+ *ret = sd->select_mode;
}
EAPI void
elm_calendar_selectable_set(Evas_Object *obj, Elm_Calendar_Selectable selectable)
{
ELM_CALENDAR_CHECK(obj);
- ELM_CALENDAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_calendar_selectable_set(selectable));
+}
+static void
+_selectable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Calendar_Selectable selectable = va_arg(*list, Elm_Calendar_Selectable);
+ Elm_Calendar_Smart_Data *sd = _pd;
sd->selectable = selectable;
}
@@ -1319,19 +1452,119 @@ EAPI Elm_Calendar_Selectable
elm_calendar_selectable_get(const Evas_Object *obj)
{
ELM_CALENDAR_CHECK(obj) -1;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ Elm_Calendar_Selectable ret = -1;
+ eo_do((Eo *) obj, elm_obj_calendar_selectable_get(&ret));
+ return ret;
+}
- return sd->selectable;
+static void
+_selectable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Calendar_Selectable *ret = va_arg(*list, Elm_Calendar_Selectable *);
+ Elm_Calendar_Smart_Data *sd = _pd;
+ *ret = sd->selectable;
}
EAPI Eina_Bool
elm_calendar_displayed_time_get(const Evas_Object *obj, struct tm *displayed_time)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(displayed_time, EINA_FALSE);
ELM_CALENDAR_CHECK(obj) EINA_FALSE;
- ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_calendar_displayed_time_get(displayed_time, &ret));
+ return ret;
+}
+static void
+_displayed_time_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ struct tm *displayed_time = va_arg(*list, struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ EINA_SAFETY_ON_NULL_RETURN(displayed_time);
+ Elm_Calendar_Smart_Data *sd = _pd;
*displayed_time = sd->shown_time;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
+static void
+_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_calendar_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_calendar_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_calendar_smart_calculate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_calendar_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_calendar_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_calendar_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_calendar_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_calendar_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_calendar_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_calendar_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET), _weekdays_names_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET), _weekdays_names_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET), _interval_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET), _interval_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET), _min_max_year_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET), _min_max_year_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET), _selected_time_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET), _selected_time_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET), _format_function_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD), _mark_add),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR), _marks_clear),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET), _marks_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW), _marks_draw),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET), _first_day_of_week_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET), _first_day_of_week_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET), _select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET), _select_mode_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET), _selectable_set),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET), _selectable_get),
+ EO_OP_FUNC(ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET), _displayed_time_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
+ _elm_calendar_smart_focus_next_enable = EINA_TRUE;
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET, "Set weekdays names to be displayed by the calendar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET, "Get weekdays names displayed by the calendar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET, "Set the interval on time updates for an user mouse button hold."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET, "Get the interval on time updates for an user mouse button hold."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET, "Set the minimum and maximum values for the year."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET, "Get the minimum and maximum values for the year."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET, "Set selected date to be highlighted on calendar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET, "Get selected date."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET, "Set a function to format the string that will be used to display."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD, "Add a new mark to the calendar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR, "Remove all calendar's marks."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET, "Get a list of all the calendar marks."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW, "Draw calendar marks."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET, "Set the first day of week to use on calendar widgets'."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET, "Get the first day of week, who are used on calendar widgets'."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET, "Set select day mode to use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET, "Get the select day mode used."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET, "Define which fields of a tm struct will be taken into account, when *elm_calendar_selected_time_set() is invoked."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET, "Get how elm_calendar_selected_time_set manage a date."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET, "Get the current time displayed in the widget"),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CALENDAR_BASE_ID, op_desc, ELM_OBJ_CALENDAR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Calendar_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_calendar_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_calendar.h b/src/lib/elm_calendar.h
index 164819a4c..86434017e 100644
--- a/src/lib/elm_calendar.h
+++ b/src/lib/elm_calendar.h
@@ -40,6 +40,289 @@
* @li @ref calendar_example_06
*/
+
+#define ELM_OBJ_CALENDAR_CLASS elm_obj_calendar_class_get()
+
+const Eo_Class *elm_obj_calendar_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_CALENDAR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD,
+ ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR,
+ ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW,
+ ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET,
+ ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET,
+ ELM_OBJ_CALENDAR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_CALENDAR_ID(sub_id) (ELM_OBJ_CALENDAR_BASE_ID + sub_id)
+
+/**
+ * @def elm_obj_calendar_weekdays_names_set
+ * @since 1.8
+ *
+ * Set weekdays names to be displayed by the calendar.
+ *
+ * @param[in] weekdays
+ *
+ * @see elm_calendar_weekdays_names_set
+ */
+#define elm_obj_calendar_weekdays_names_set(weekdays) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_SET), EO_TYPECHECK(const char **, weekdays)
+
+/**
+ * @def elm_obj_calendar_weekdays_names_get
+ * @since 1.8
+ *
+ * Get weekdays names displayed by the calendar.
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_weekdays_names_get
+ */
+#define elm_obj_calendar_weekdays_names_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_WEEKDAYS_NAMES_GET), EO_TYPECHECK(const char ***, ret)
+
+/**
+ * @def elm_obj_calendar_interval_set
+ * @since 1.8
+ *
+ * Set the interval on time updates for an user mouse button hold
+ *
+ * @param[in] interval
+ *
+ * @see elm_calendar_interval_set
+ */
+#define elm_obj_calendar_interval_set(interval) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_SET), EO_TYPECHECK(double, interval)
+
+/**
+ * @def elm_obj_calendar_interval_get
+ * @since 1.8
+ *
+ * Get the interval on time updates for an user mouse button hold
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_interval_get
+ */
+#define elm_obj_calendar_interval_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_INTERVAL_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_calendar_min_max_year_set
+ * @since 1.8
+ *
+ * Set the minimum and maximum values for the year
+ *
+ * @param[in] min
+ * @param[in] max
+ *
+ * @see elm_calendar_min_max_year_set
+ */
+#define elm_obj_calendar_min_max_year_set(min, max) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_SET), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max)
+
+/**
+ * @def elm_obj_calendar_min_max_year_get
+ * @since 1.8
+ *
+ * Get the minimum and maximum values for the year
+ *
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_calendar_min_max_year_get
+ */
+#define elm_obj_calendar_min_max_year_get(min, max) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MIN_MAX_YEAR_GET), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max)
+
+/**
+ * @def elm_obj_calendar_selected_time_set
+ * @since 1.8
+ *
+ * Set selected date to be highlighted on calendar.
+ *
+ * @param[in] selected_time
+ *
+ * @see elm_calendar_selected_time_set
+ */
+#define elm_obj_calendar_selected_time_set(selected_time) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_SET), EO_TYPECHECK(struct tm *, selected_time)
+
+/**
+ * @def elm_obj_calendar_selected_time_get
+ * @since 1.8
+ *
+ * Get selected date.
+ *
+ * @param[out] selected_time
+ * @param[out] ret
+ *
+ * @see elm_calendar_selected_time_get
+ */
+#define elm_obj_calendar_selected_time_get(selected_time, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTED_TIME_GET), EO_TYPECHECK(struct tm *, selected_time), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_calendar_format_function_set
+ * @since 1.8
+ *
+ * Set a function to format the string that will be used to display
+ * to display month and year.
+ *
+ * @param[in] format_function
+ *
+ * @see elm_calendar_format_function_set
+ */
+#define elm_obj_calendar_format_function_set(format_function) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FORMAT_FUNCTION_SET), EO_TYPECHECK(Elm_Calendar_Format_Cb, format_function)
+
+/**
+ * @def elm_obj_calendar_mark_add
+ * @since 1.8
+ *
+ * Add a new mark to the calendar
+ *
+ * @param[in] mark_type
+ * @param[in] mark_time
+ * @param[in] repeat
+ * @param[out] ret
+ *
+ * @see elm_calendar_mark_add
+ */
+#define elm_obj_calendar_mark_add(mark_type, mark_time, repeat, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARK_ADD), EO_TYPECHECK(const char *, mark_type), EO_TYPECHECK(struct tm *, mark_time), EO_TYPECHECK(Elm_Calendar_Mark_Repeat_Type, repeat), EO_TYPECHECK(Elm_Calendar_Mark **, ret)
+
+/**
+ * @def elm_obj_calendar_marks_clear
+ * @since 1.8
+ *
+ * Remove all calendar's marks
+ *
+ *
+ * @see elm_calendar_marks_clear
+ */
+#define elm_obj_calendar_marks_clear() ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_CLEAR)
+
+/**
+ * @def elm_obj_calendar_marks_get
+ * @since 1.8
+ *
+ * Get a list of all the calendar marks.
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_marks_get
+ */
+#define elm_obj_calendar_marks_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_calendar_marks_draw
+ * @since 1.8
+ *
+ * Draw calendar marks.
+ *
+ *
+ * @see elm_calendar_marks_draw
+ */
+#define elm_obj_calendar_marks_draw() ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_MARKS_DRAW)
+
+/**
+ * @def elm_obj_calendar_first_day_of_week_set
+ * @since 1.8
+ *
+ * Set the first day of week to use on calendar widgets'.
+ *
+ * @param[in] day
+ *
+ * @see elm_calendar_first_day_of_week_set
+ */
+#define elm_obj_calendar_first_day_of_week_set(day) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_SET), EO_TYPECHECK(Elm_Calendar_Weekday, day)
+
+/**
+ * @def elm_obj_calendar_first_day_of_week_get
+ * @since 1.8
+ *
+ * Get the first day of week, who are used on calendar widgets'.
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_first_day_of_week_get
+ */
+#define elm_obj_calendar_first_day_of_week_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_FIRST_DAY_OF_WEEK_GET), EO_TYPECHECK(Elm_Calendar_Weekday *, ret)
+
+/**
+ * @def elm_obj_calendar_select_mode_set
+ * @since 1.8
+ *
+ * Set select day mode to use.
+ *
+ * @param[in] mode
+ *
+ * @see elm_calendar_select_mode_set
+ */
+#define elm_obj_calendar_select_mode_set(mode) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Calendar_Select_Mode, mode)
+
+/**
+ * @def elm_obj_calendar_select_mode_get
+ * @since 1.8
+ *
+ * Get the select day mode used.
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_select_mode_get
+ */
+#define elm_obj_calendar_select_mode_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Calendar_Select_Mode *, ret)
+
+/**
+ * @def elm_obj_calendar_selectable_set
+ * @since 1.8
+ *
+ * Define which fields of a tm struct will be taken into account, when
+ * elm_calendar_selected_time_set() is invoked.
+ *
+ * @param[in] selectable
+ *
+ * @see elm_calendar_selectable_set
+ */
+#define elm_obj_calendar_selectable_set(selectable) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_SET), EO_TYPECHECK(Elm_Calendar_Selectable, selectable)
+
+/**
+ * @def elm_obj_calendar_selectable_get
+ * @since 1.8
+ *
+ * Get how elm_calendar_selected_time_set manage a date
+ *
+ * @param[out] ret
+ *
+ * @see elm_calendar_selectable_get
+ */
+#define elm_obj_calendar_selectable_get(ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_SELECTABLE_GET), EO_TYPECHECK(Elm_Calendar_Selectable *, ret)
+
+/**
+ * @def elm_obj_calendar_displayed_time_get
+ * @since 1.8
+ *
+ * Get the current time displayed in the widget
+ *
+ * @param[out] displayed_time
+ * @param[out] ret
+ *
+ * @see elm_calendar_displayed_time_get
+ */
+#define elm_obj_calendar_displayed_time_get(displayed_time, ret) ELM_OBJ_CALENDAR_ID(ELM_OBJ_CALENDAR_SUB_ID_DISPLAYED_TIME_GET), EO_TYPECHECK(struct tm *, displayed_time), EO_TYPECHECK(Eina_Bool *, ret)
+
+
+
/**
* @addtogroup Calendar
* @{
diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c
index 06b4ccd0f..2fbce08bb 100644
--- a/src/lib/elm_check.c
+++ b/src/lib/elm_check.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_check.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_CHECK_SMART_NAME[] = "elm_check";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_CHECK_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_CHECK_CLASS
+
+#define MY_CLASS_NAME "elm_check"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -26,10 +33,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_CHECK_SMART_NAME, _elm_check, Elm_Check_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_activate(Evas_Object *obj)
{
@@ -70,96 +73,116 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because check's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_check_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_check_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_check_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_check_smart_activate(Evas_Object *obj, Elm_Activate act)
+static void
+_elm_check_smart_activate(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- if (act != ELM_ACTIVATE_DEFAULT) return EINA_FALSE;
+ Elm_Activate act = va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (act != ELM_ACTIVATE_DEFAULT) return;
_activate(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because check's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_check_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_check_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_CONTAINER_CLASS(_elm_check_parent_sc)->content_set
- (obj, part, content))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if (!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_check_smart_sizing_eval(Evas_Object *obj)
+_elm_check_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_CHECK_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_check_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_check_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Evas_Event_Key_Down *ev = event_info;
+ if (ret) *ret = EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((strcmp(ev->keyname, "Return")) &&
(strcmp(ev->keyname, "KP_Enter")) &&
(strcmp(ev->keyname, "space")))
- return EINA_FALSE;
+ return;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_check_smart_theme(Evas_Object *obj)
+static void
+_elm_check_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_CHECK_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_check_parent_sc)->theme(obj)) return EINA_FALSE;
+ Elm_Check_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (!sd->state) elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
else elm_layout_signal_emit(obj, "elm,state,check,on", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
/* FIXME: replicated from elm_layout just because check's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever
@@ -168,7 +191,7 @@ _elm_check_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
@@ -189,14 +212,14 @@ _access_state_cb(void *data,
Evas_Object *obj,
Elm_Widget_Item *item __UNUSED__)
{
- Elm_Check_Smart_Data *sd = data;
+ Elm_Check_Smart_Data *sd = eo_data_get(data, MY_CLASS);
const char *on_text, *off_text;
if (elm_widget_disabled_get(obj))
return strdup(E_("State: Disabled"));
if (sd->state)
{
- on_text = elm_layout_text_get(ELM_WIDGET_DATA(sd)->obj, "on");
+ on_text = elm_layout_text_get(data, "on");
if (on_text)
{
@@ -209,7 +232,7 @@ _access_state_cb(void *data,
return strdup(E_("State: On"));
}
- off_text = elm_layout_text_get(ELM_WIDGET_DATA(sd)->obj, "off");
+ off_text = elm_layout_text_get(data, "off");
if (off_text)
{
@@ -264,29 +287,30 @@ _on_check_toggle(void *data,
}
static void
-_elm_check_smart_add(Evas_Object *obj)
+_elm_check_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Check_Smart_Data);
+ Elm_Check_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_check_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,on", "",
+ (wd->resize_obj, "elm,action,check,on", "",
_on_check_on, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,off", "",
+ (wd->resize_obj, "elm,action,check,off", "",
_on_check_off, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,check,toggle", "",
+ (wd->resize_obj, "elm,action,check,toggle", "",
_on_check_toggle, obj);
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Check"));
_elm_access_callback_set
(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, priv);
_elm_access_callback_set
- (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, priv);
+ (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, obj);
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -295,59 +319,39 @@ _elm_check_smart_add(Evas_Object *obj)
}
static void
-_elm_check_smart_set_user(Elm_Check_Smart_Class *sc)
+_elm_check_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_check_smart_add;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_check_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_check_smart_event;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_check_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->activate = _elm_check_smart_activate;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_check_smart_content_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_check_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Check_Smart_Class *
-elm_check_smart_class_get(void)
+static void
+_elm_check_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Check_Smart_Class _sc =
- ELM_CHECK_SMART_CLASS_INIT_NAME_VERSION(ELM_CHECK_SMART_NAME);
- static const Elm_Check_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_check_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
EAPI Evas_Object *
elm_check_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_check_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -355,7 +359,15 @@ elm_check_state_set(Evas_Object *obj,
Eina_Bool state)
{
ELM_CHECK_CHECK(obj);
- ELM_CHECK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_check_state_set(state));
+}
+
+static void
+_elm_check_smart_state_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool state = va_arg(*list, int);
+ Elm_Check_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (state != sd->state)
{
@@ -367,16 +379,24 @@ elm_check_state_set(Evas_Object *obj,
elm_layout_signal_emit(obj, "elm,state,check,off", "elm");
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
EAPI Eina_Bool
elm_check_state_get(const Evas_Object *obj)
{
ELM_CHECK_CHECK(obj) EINA_FALSE;
- ELM_CHECK_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_check_state_get(&ret));
+ return ret;
+}
- return sd->state;
+static void
+_elm_check_smart_state_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Check_Smart_Data *sd = _pd;
+ *ret = sd->state;
}
EAPI void
@@ -384,7 +404,14 @@ elm_check_state_pointer_set(Evas_Object *obj,
Eina_Bool *statep)
{
ELM_CHECK_CHECK(obj);
- ELM_CHECK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_check_state_pointer_set(statep));
+}
+
+static void
+_elm_check_smart_state_pointer_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool *statep = va_arg(*list, Eina_Bool *);
+ Elm_Check_Smart_Data *sd = _pd;
if (statep)
{
@@ -401,3 +428,67 @@ elm_check_state_pointer_set(Evas_Object *obj,
else
sd->statep = NULL;
}
+
+static void
+_elm_check_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_check_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_check_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_check_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_check_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_check_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_check_smart_activate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_check_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_check_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_check_smart_content_set),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_check_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_check_smart_content_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_check_smart_text_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_SET), _elm_check_smart_state_set),
+ EO_OP_FUNC(ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_GET), _elm_check_smart_state_get),
+ EO_OP_FUNC(ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_POINTER_SET), _elm_check_smart_state_pointer_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_CHECK_SUB_ID_STATE_SET, "Set the on/off state of the check object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CHECK_SUB_ID_STATE_GET, "Get the state of the check object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CHECK_SUB_ID_STATE_POINTER_SET, "Set a convenience pointer to a boolean to change."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CHECK_BASE_ID, op_desc, ELM_OBJ_CHECK_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Check_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_check_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
diff --git a/src/lib/elm_check.h b/src/lib/elm_check.h
index 70a645b7b..afbffb04b 100644
--- a/src/lib/elm_check.h
+++ b/src/lib/elm_check.h
@@ -56,6 +56,59 @@
* @{
*/
+#define ELM_OBJ_CHECK_CLASS elm_obj_check_class_get()
+
+const Eo_Class *elm_obj_check_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_CHECK_BASE_ID;
+
+enum
+{
+ ELM_OBJ_CHECK_SUB_ID_STATE_SET,
+ ELM_OBJ_CHECK_SUB_ID_STATE_GET,
+ ELM_OBJ_CHECK_SUB_ID_STATE_POINTER_SET,
+ ELM_OBJ_CHECK_SUB_ID_LAST
+};
+
+#define ELM_OBJ_CHECK_ID(sub_id) (ELM_OBJ_CHECK_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_check_state_set
+ * @since 1.8
+ *
+ * @brief Set the on/off state of the check object
+ *
+ * @param[in] state
+ *
+ * @see elm_check_state_set
+ */
+#define elm_obj_check_state_set(state) ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_SET), EO_TYPECHECK(Eina_Bool, state)
+
+/**
+ * @def elm_obj_check_state_get
+ * @since 1.8
+ *
+ * @brief Get the state of the check object
+ *
+ * @param[out] ret
+ *
+ * @see elm_check_state_get
+ */
+#define elm_obj_check_state_get(ret) ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_check_state_pointer_set
+ * @since 1.8
+ *
+ * @brief Set a convenience pointer to a boolean to change
+ *
+ * @param[in] statep
+ *
+ * @see elm_check_state_pointer_set
+ */
+#define elm_obj_check_state_pointer_set(statep) ELM_OBJ_CHECK_ID(ELM_OBJ_CHECK_SUB_ID_STATE_POINTER_SET), EO_TYPECHECK(Eina_Bool *, statep)
+
/**
* @brief Add a new Check object
*
diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c
index c426ccee6..f6a70d364 100644
--- a/src/lib/elm_clock.c
+++ b/src/lib/elm_clock.c
@@ -2,10 +2,15 @@
#include "elm_priv.h"
#include "elm_widget_clock.h"
-EAPI const char ELM_CLOCK_SMART_NAME[] = "elm_clock";
+#include "Eo.h"
-#define DEFAULT_FIRST_INTERVAL 0.85
+EAPI Eo_Op ELM_OBJ_CLOCK_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_CLOCK_CLASS
+#define MY_CLASS_NAME "elm_clock"
+
+#define DEFAULT_FIRST_INTERVAL 0.85
static void _time_update(Evas_Object *obj);
static const char SIG_CHANGED[] = "changed";
@@ -15,10 +20,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_CLOCK_SMART_NAME, _elm_clock, Elm_Clock_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static Eina_Bool
_on_clock_val_up(void *data)
{
@@ -335,6 +336,7 @@ static void
_time_update(Evas_Object *obj)
{
ELM_CLOCK_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Edje_Message_Int msg;
int ampm = 0;
@@ -370,7 +372,7 @@ _time_update(Evas_Object *obj)
elm_layout_theme_set(obj, "clock", "base", style);
edje_object_scale_set
- (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_scale_get(obj) *
+ (wd->resize_obj, elm_widget_scale_get(obj) *
elm_config_scale_get());
for (i = 0; i < 6; i++)
@@ -379,7 +381,7 @@ _time_update(Evas_Object *obj)
if ((!sd->seconds) && (i >= 4)) break;
sd->digit[i] = edje_object_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->resize_obj));
+ (evas_object_evas_get(wd->resize_obj));
elm_widget_theme_object_set
(obj, sd->digit[i], "clock", "flipdigit", style);
edje_object_scale_set
@@ -415,7 +417,7 @@ _time_update(Evas_Object *obj)
if (sd->am_pm)
{
sd->am_pm_obj =
- edje_object_add(evas_object_evas_get(ELM_WIDGET_DATA(sd)->resize_obj));
+ edje_object_add(evas_object_evas_get(wd->resize_obj));
elm_widget_theme_object_set
(obj, sd->am_pm_obj, "clock", "flipampm", style);
edje_object_scale_set(sd->am_pm_obj, elm_widget_scale_get(obj) *
@@ -450,7 +452,7 @@ _time_update(Evas_Object *obj)
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
_access_time_register(obj, EINA_TRUE);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &mw, &mh);
+ edje_object_size_min_calc(wd->resize_obj, &mw, &mh);
evas_object_size_hint_min_set(obj, mw, mh);
sd->cur.hrs = 0;
@@ -560,14 +562,19 @@ _time_update(Evas_Object *obj)
sd->cur.ampm = -1;
}
-static Eina_Bool
-_elm_clock_smart_theme(Evas_Object *obj)
+static void
+_elm_clock_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_clock_parent_sc)->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_time_update(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Eina_Bool
@@ -648,11 +655,12 @@ _access_state_cb(void *data __UNUSED__,
}
static void
-_elm_clock_smart_add(Evas_Object *obj)
+_elm_clock_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Clock_Smart_Data);
+ Elm_Clock_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_clock_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->cur.ampm = -1;
priv->cur.seconds = EINA_TRUE;
@@ -671,11 +679,11 @@ _elm_clock_smart_add(Evas_Object *obj)
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
{
evas_object_propagate_events_set(obj, EINA_FALSE);
- edje_object_signal_emit(ELM_WIDGET_DATA(priv)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,access,on", "elm");
}
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Clock"));
_elm_access_callback_set
@@ -686,37 +694,51 @@ _elm_clock_smart_add(Evas_Object *obj)
}
static void
-_elm_clock_smart_del(Evas_Object *obj)
+_elm_clock_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_CLOCK_DATA_GET(obj, sd);
+ Elm_Clock_Smart_Data *sd = _pd;
if (sd->ticker) ecore_timer_del(sd->ticker);
if (sd->spin) ecore_timer_del(sd->spin);
/* NB: digits are killed for being sub objects, automatically */
- ELM_WIDGET_CLASS(_elm_clock_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_clock_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_clock_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_clock_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_clock_smart_focus_next_enable;
+}
+
+static void
+_elm_clock_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Object *ao, *po;
Eina_List *items = NULL;
- ELM_CLOCK_DATA_GET(obj, sd);
+ Elm_Clock_Smart_Data *sd = _pd;
if (!sd->edit)
{
*next = (Evas_Object *)obj;
- return !elm_widget_focus_get(obj);
+ if (ret) *ret = !elm_widget_focus_get(obj);
+ return;
}
else if (!elm_widget_focus_get(obj))
{
*next = (Evas_Object *)obj;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
int i;
@@ -750,23 +772,23 @@ _elm_clock_smart_focus_next(const Evas_Object *obj,
items = eina_list_append(items, ao);
}
- return elm_widget_focus_list_next_get
+ if (ret) *ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
}
static void
_access_obj_process(Evas_Object *obj, Eina_Bool is_access)
{
- ELM_CLOCK_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
/* clock object */
evas_object_propagate_events_set(obj, !is_access);
if (is_access)
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,access,on", "elm");
else
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,access,off", "elm");
/* clock time objects */
@@ -774,70 +796,32 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
static void
-_elm_clock_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_clock_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(obj, is_access);
-}
-
-static void
-_elm_clock_smart_set_user(Elm_Clock_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_clock_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_clock_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_clock_smart_theme;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- /* access */
- if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_clock_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_clock_smart_access;
-}
-
-EAPI const Elm_Clock_Smart_Class *
-elm_clock_smart_class_get(void)
+_elm_clock_smart_access(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Clock_Smart_Class _sc =
- ELM_CLOCK_SMART_CLASS_INIT_NAME_VERSION(ELM_CLOCK_SMART_NAME);
- static const Elm_Clock_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_clock_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_clock_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(obj, _elm_clock_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_clock_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_clock_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
static void
@@ -862,7 +846,16 @@ elm_clock_time_set(Evas_Object *obj,
int sec)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_time_set(hrs, min, sec));
+}
+
+static void
+_time_set(Eo *obj, void *_pd, va_list *list)
+{
+ int hrs = va_arg(*list, int);
+ int min = va_arg(*list, int);
+ int sec = va_arg(*list, int);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->hrs = hrs;
sd->min = min;
@@ -879,7 +872,16 @@ elm_clock_time_get(const Evas_Object *obj,
int *sec)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_clock_time_get(hrs, min, sec));
+}
+
+static void
+_time_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *hrs = va_arg(*list, int *);
+ int *min = va_arg(*list, int *);
+ int *sec = va_arg(*list, int *);
+ Elm_Clock_Smart_Data *sd = _pd;
if (hrs) *hrs = sd->hrs;
if (min) *min = sd->min;
@@ -891,7 +893,14 @@ elm_clock_edit_set(Evas_Object *obj,
Eina_Bool edit)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_edit_set(edit));
+}
+
+static void
+_edit_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool edit = va_arg(*list, int);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->edit = edit;
if (!edit)
@@ -906,9 +915,18 @@ EAPI Eina_Bool
elm_clock_edit_get(const Evas_Object *obj)
{
ELM_CLOCK_CHECK(obj) EINA_FALSE;
- ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_clock_edit_get(&ret));
+ return ret;
+}
- return sd->edit;
+static void
+_edit_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Clock_Smart_Data *sd = _pd;
+
+ *ret = sd->edit;
}
EAPI void
@@ -916,7 +934,14 @@ elm_clock_edit_mode_set(Evas_Object *obj,
Elm_Clock_Edit_Mode digedit)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_edit_mode_set(digedit));
+}
+
+static void
+_edit_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Clock_Edit_Mode digedit = va_arg(*list, Elm_Clock_Edit_Mode);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->digedit = digedit;
if (digedit == ELM_CLOCK_EDIT_DEFAULT)
@@ -929,9 +954,18 @@ EAPI Elm_Clock_Edit_Mode
elm_clock_edit_mode_get(const Evas_Object *obj)
{
ELM_CLOCK_CHECK(obj) 0;
- ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
+ Elm_Clock_Edit_Mode ret = 0;
+ eo_do((Eo *) obj, elm_obj_clock_edit_mode_get(&ret));
+ return ret;
+}
+
+static void
+_edit_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Clock_Edit_Mode *ret = va_arg(*list, Elm_Clock_Edit_Mode *);
+ Elm_Clock_Smart_Data *sd = _pd;
- return sd->digedit;
+ *ret = sd->digedit;
}
EAPI void
@@ -939,7 +973,14 @@ elm_clock_show_am_pm_set(Evas_Object *obj,
Eina_Bool am_pm)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_show_am_pm_set(am_pm));
+}
+
+static void
+_show_am_pm_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool am_pm = va_arg(*list, int);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->am_pm = !!am_pm;
_time_update(obj);
@@ -949,9 +990,18 @@ EAPI Eina_Bool
elm_clock_show_am_pm_get(const Evas_Object *obj)
{
ELM_CLOCK_CHECK(obj) EINA_FALSE;
- ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_clock_show_am_pm_get(&ret));
+ return ret;
+}
+
+static void
+_show_am_pm_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Clock_Smart_Data *sd = _pd;
- return sd->am_pm;
+ *ret = sd->am_pm;
}
EAPI void
@@ -959,7 +1009,14 @@ elm_clock_show_seconds_set(Evas_Object *obj,
Eina_Bool seconds)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_show_seconds_set(seconds));
+}
+
+static void
+_show_seconds_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool seconds = va_arg(*list, int);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->seconds = !!seconds;
_time_update(obj);
@@ -969,9 +1026,18 @@ EAPI Eina_Bool
elm_clock_show_seconds_get(const Evas_Object *obj)
{
ELM_CLOCK_CHECK(obj) EINA_FALSE;
- ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_clock_show_seconds_get(&ret));
+ return ret;
+}
- return sd->seconds;
+static void
+_show_seconds_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Clock_Smart_Data *sd = _pd;
+
+ *ret = sd->seconds;
}
EAPI void
@@ -979,7 +1045,14 @@ elm_clock_first_interval_set(Evas_Object *obj,
double interval)
{
ELM_CLOCK_CHECK(obj);
- ELM_CLOCK_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_clock_first_interval_set(interval));
+}
+
+static void
+_first_interval_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double interval = va_arg(*list, double);
+ Elm_Clock_Smart_Data *sd = _pd;
sd->first_interval = !!interval;
}
@@ -988,7 +1061,85 @@ EAPI double
elm_clock_first_interval_get(const Evas_Object *obj)
{
ELM_CLOCK_CHECK(obj) 0.0;
- ELM_CLOCK_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_clock_first_interval_get(&ret));
+ return ret;
+}
+
+static void
+_first_interval_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Clock_Smart_Data *sd = _pd;
+
+ *ret = sd->first_interval;
+}
- return sd->first_interval;
+static void
+_elm_clock_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_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_clock_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_clock_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_clock_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_clock_smart_access),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_clock_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_clock_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_clock_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_SET), _time_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_GET), _time_get),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_SET), _edit_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_GET), _edit_get),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET), _edit_mode_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET), _edit_mode_get),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET), _show_am_pm_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET), _show_am_pm_get),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET), _show_seconds_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET), _show_seconds_get),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET), _first_interval_set),
+ EO_OP_FUNC(ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET), _first_interval_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
+ _elm_clock_smart_focus_next_enable = EINA_TRUE;
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_TIME_SET, "Set a clock widget's time, programmatically."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_TIME_GET, "Get a clock widget's time values."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_EDIT_SET, "Set whether a given clock widget is under <b>edition mode</b> or."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_EDIT_GET, "Retrieve whether a given clock widget is under editing mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET, "Set what digits of the given clock widget should be editable."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET, "Retrieve what digits of the given clock widget should be."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET, "Set if the given clock widget must show hours in military or."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET, "Get if the given clock widget shows hours in military or am/pm."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET, "Set if the given clock widget must show time with seconds or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET, "Get whether the given clock widget is showing time with seconds."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET, "Set the first interval on time updates for a user mouse button hold."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET, "Get the first interval on time updates for a user mouse button hold."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CLOCK_BASE_ID, op_desc, ELM_OBJ_CLOCK_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Clock_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_clock_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
diff --git a/src/lib/elm_clock.h b/src/lib/elm_clock.h
index 0ec7e4345..cbbb18bb3 100644
--- a/src/lib/elm_clock.h
+++ b/src/lib/elm_clock.h
@@ -54,6 +54,185 @@
* @{
*/
+#define ELM_OBJ_CLOCK_CLASS elm_obj_clock_class_get()
+
+const Eo_Class *elm_obj_clock_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_CLOCK_BASE_ID;
+
+enum
+{
+ ELM_OBJ_CLOCK_SUB_ID_TIME_SET,
+ ELM_OBJ_CLOCK_SUB_ID_TIME_GET,
+ ELM_OBJ_CLOCK_SUB_ID_EDIT_SET,
+ ELM_OBJ_CLOCK_SUB_ID_EDIT_GET,
+ ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET,
+ ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET,
+ ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET,
+ ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET,
+ ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET,
+ ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET,
+ ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET,
+ ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET,
+ ELM_OBJ_CLOCK_SUB_ID_LAST
+};
+
+#define ELM_OBJ_CLOCK_ID(sub_id) (ELM_OBJ_CLOCK_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_clock_time_set
+ * @since 1.8
+ *
+ * Set a clock widget's time, programmatically
+ *
+ * @param[in] hrs
+ * @param[in] min
+ * @param[in] sec
+ *
+ * @see elm_clock_time_set
+ */
+#define elm_obj_clock_time_set(hrs, min, sec) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_SET), EO_TYPECHECK(int, hrs), EO_TYPECHECK(int, min), EO_TYPECHECK(int, sec)
+
+/**
+ * @def elm_obj_clock_time_get
+ * @since 1.8
+ *
+ * Get a clock widget's time values
+ *
+ * @param[out] hrs
+ * @param[out] min
+ * @param[out] sec
+ *
+ * @see elm_clock_time_get
+ */
+#define elm_obj_clock_time_get(hrs, min, sec) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_TIME_GET), EO_TYPECHECK(int *, hrs), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, sec)
+
+/**
+ * @def elm_obj_clock_edit_set
+ * @since 1.8
+ *
+ * Set whether a given clock widget is under <b>edition mode</b> or
+ * under (default) displaying-only mode.
+ *
+ * @param[in] edit
+ *
+ * @see elm_clock_edit_set
+ */
+#define elm_obj_clock_edit_set(edit) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_SET), EO_TYPECHECK(Eina_Bool, edit)
+
+/**
+ * @def elm_obj_clock_edit_get
+ * @since 1.8
+ *
+ * Retrieve whether a given clock widget is under editing mode
+ * under (default) displaying-only mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_clock_edit_get
+ */
+#define elm_obj_clock_edit_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_clock_edit_mode_set
+ * @since 1.8
+ *
+ * Set what digits of the given clock widget should be editable
+ *
+ * @param[in] digedit
+ *
+ * @see elm_clock_edit_mode_set
+ */
+#define elm_obj_clock_edit_mode_set(digedit) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_SET), EO_TYPECHECK(Elm_Clock_Edit_Mode, digedit)
+
+/**
+ * @def elm_obj_clock_edit_mode_get
+ * @since 1.8
+ *
+ * Retrieve what digits of the given clock widget should be
+ * editable when in edition mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_clock_edit_mode_get
+ */
+#define elm_obj_clock_edit_mode_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_EDIT_MODE_GET), EO_TYPECHECK(Elm_Clock_Edit_Mode *, ret)
+
+/**
+ * @def elm_obj_clock_show_am_pm_set
+ * @since 1.8
+ *
+ * Set if the given clock widget must show hours in military or
+ * am/pm mode
+ *
+ * @param[in] am_pm
+ *
+ * @see elm_clock_show_am_pm_set
+ */
+#define elm_obj_clock_show_am_pm_set(am_pm) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_SET), EO_TYPECHECK(Eina_Bool, am_pm)
+
+/**
+ * @def elm_obj_clock_show_am_pm_get
+ * @since 1.8
+ *
+ * Get if the given clock widget shows hours in military or am/pm
+ * mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_clock_show_am_pm_get
+ */
+#define elm_obj_clock_show_am_pm_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_AM_PM_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_clock_show_seconds_set
+ * @since 1.8
+ *
+ * Set if the given clock widget must show time with seconds or not
+ *
+ * @param[in] seconds
+ *
+ * @see elm_clock_show_seconds_set
+ */
+#define elm_obj_clock_show_seconds_set(seconds) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_SET), EO_TYPECHECK(Eina_Bool, seconds)
+
+/**
+ * @def elm_obj_clock_show_seconds_get
+ * @since 1.8
+ *
+ * Get whether the given clock widget is showing time with seconds
+ *
+ * @param[out] ret
+ *
+ * @see elm_clock_show_seconds_get
+ */
+#define elm_obj_clock_show_seconds_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_SHOW_SECONDS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_clock_first_interval_set
+ * @since 1.8
+ *
+ * Set the first interval on time updates for a user mouse button hold
+ *
+ * @param[in] interval
+ *
+ * @see elm_clock_first_interval_set
+ */
+#define elm_obj_clock_first_interval_set(interval) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval)
+
+/**
+ * @def elm_obj_clock_first_interval_get
+ * @since 1.8
+ *
+ * Get the first interval on time updates for a user mouse button hold
+ *
+ * @param[out] ret
+ *
+ * @see elm_clock_first_interval_get
+ */
+#define elm_obj_clock_first_interval_get(ret) ELM_OBJ_CLOCK_ID(ELM_OBJ_CLOCK_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret)
+
/**
* Identifiers for which clock digits should be editable, when a
* clock widget is in edition mode. Values may be OR-ed together to
diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c
index 343e60a7f..52a54f381 100644
--- a/src/lib/elm_colorselector.c
+++ b/src/lib/elm_colorselector.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_colorselector.h"
-EAPI const char ELM_COLORSELECTOR_SMART_NAME[] = "elm_colorselector";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_COLORSELECTOR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_COLORSELECTOR_CLASS
+
+#define MY_CLASS_NAME "elm_colorselector"
#define BASE_STEP 360.0
#define HUE_STEP 360.0
@@ -23,11 +29,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_COLORSELECTOR_SMART_NAME, _elm_colorselector,
- Elm_Colorselector_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
static void
_items_del(Elm_Colorselector_Smart_Data *sd)
{
@@ -1055,8 +1056,8 @@ _color_bars_add(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_colorselector_smart_theme(Evas_Object *obj)
+static void
+_elm_colorselector_smart_theme(Eo *obj, void *_pd, va_list *list)
{
int i;
Eina_List *elist;
@@ -1065,22 +1066,26 @@ _elm_colorselector_smart_theme(Evas_Object *obj)
unsigned int h_pad = DEFAULT_HOR_PAD;
unsigned int v_pad = DEFAULT_VER_PAD;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_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;
- if (!ELM_WIDGET_CLASS(_elm_colorselector_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- if (!sd->col_bars_area) return EINA_FALSE;
+ if (!sd->col_bars_area) return;
elm_widget_theme_object_set
(obj, sd->col_bars_area, "colorselector", "bg",
elm_widget_style_get(obj));
hpadstr = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "horizontal_pad");
+ (wd->resize_obj, "horizontal_pad");
if (hpadstr) h_pad = atoi(hpadstr);
vpadstr = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "vertical_pad");
+ (wd->resize_obj, "vertical_pad");
if (vpadstr) v_pad = atoi(vpadstr);
elm_box_padding_set
@@ -1125,7 +1130,7 @@ _elm_colorselector_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -1201,11 +1206,12 @@ _full_sizing_eval(Evas_Object *obj)
}
static void
-_elm_colorselector_smart_sizing_eval(Evas_Object *obj)
+_elm_colorselector_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
@@ -1227,7 +1233,7 @@ _elm_colorselector_smart_sizing_eval(Evas_Object *obj)
return;
}
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -1436,15 +1442,16 @@ _palette_colors_load(Evas_Object *obj)
}
static void
-_elm_colorselector_smart_add(Evas_Object *obj)
+_elm_colorselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
const char *hpadstr, *vpadstr;
unsigned int h_pad = DEFAULT_HOR_PAD;
unsigned int v_pad = DEFAULT_VER_PAD;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Colorselector_Smart_Data);
+ Elm_Colorselector_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_colorselector_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set
(obj, "colorselector", "palette", elm_object_style_get(obj));
@@ -1460,10 +1467,10 @@ _elm_colorselector_smart_add(Evas_Object *obj)
elm_box_homogeneous_set(priv->palette_box, EINA_TRUE);
hpadstr =
- edje_object_data_get(ELM_WIDGET_DATA(priv)->resize_obj, "horizontal_pad");
+ edje_object_data_get(wd->resize_obj, "horizontal_pad");
if (hpadstr) h_pad = atoi(hpadstr);
vpadstr = edje_object_data_get
- (ELM_WIDGET_DATA(priv)->resize_obj, "vertical_pad");
+ (wd->resize_obj, "vertical_pad");
if (vpadstr) v_pad = atoi(vpadstr);
elm_box_padding_set
@@ -1522,12 +1529,12 @@ _elm_colorselector_smart_add(Evas_Object *obj)
}
static void
-_elm_colorselector_smart_del(Evas_Object *obj)
+_elm_colorselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
int i = 0;
void *tmp[4];
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Smart_Data *sd = _pd;
evas_event_callback_del_full(evas_object_evas_get(obj), EVAS_CALLBACK_CANVAS_FOCUS_IN, _mouse_in_canvas, obj);
evas_event_callback_del_full(evas_object_evas_get(obj), EVAS_CALLBACK_CANVAS_FOCUS_OUT, _mouse_out_canvas, obj);
@@ -1542,27 +1549,32 @@ _elm_colorselector_smart_del(Evas_Object *obj)
/* This cb_data are used during the destruction process of base.del */
for (i = 0; i < 4; i++)
tmp[i] = sd->cb_data[i];
- ELM_WIDGET_CLASS(_elm_colorselector_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
for (i = 0; i < 4; i++)
free(tmp[i]);
}
-static Eina_Bool
-_elm_colorselector_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_colorselector_smart_event(Eo *obj, void *_pd, va_list *list)
{
Eina_List *cl = NULL;
Elm_Color_Item *item = NULL;
char colorbar_s[128];
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
Evas_Event_Key_Down *ev = event_info;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Smart_Data *sd = _pd;
- if (!sd) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (!sd) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
if (!sd->selected) sd->selected = sd->items;
if ((!strcmp(ev->keyname, "Left")) ||
@@ -1572,7 +1584,7 @@ _elm_colorselector_smart_event(Evas_Object *obj,
cl = eina_list_prev(sd->selected);
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
_button_clicked_cb(sd->cb_data[sd->sel_color_type], sd->cb_data[sd->sel_color_type]->lbt, NULL);
- else return EINA_FALSE;
+ else return;
}
else if ((!strcmp(ev->keyname, "Right")) ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
@@ -1581,7 +1593,7 @@ _elm_colorselector_smart_event(Evas_Object *obj,
cl = eina_list_next(sd->selected);
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
_button_clicked_cb(sd->cb_data[sd->sel_color_type], sd->cb_data[sd->sel_color_type]->rbt, NULL);
- else return EINA_FALSE;
+ else return;
}
else if ((!strcmp(ev->keyname, "Up")) ||
((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
@@ -1602,12 +1614,12 @@ _elm_colorselector_smart_event(Evas_Object *obj,
else
{
sd->sel_color_type = HUE;
- return EINA_FALSE;
+ return;
}
}
}
else if (sd->focused == ELM_COLORSELECTOR_PALETTE)
- return EINA_FALSE;
+ return;
}
else if ((!strcmp(ev->keyname, "Down")) ||
((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
@@ -1621,7 +1633,7 @@ _elm_colorselector_smart_event(Evas_Object *obj,
* first color type*/
sd->sel_color_type = HUE;
}
- else return EINA_FALSE;
+ else return;
}
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
{
@@ -1630,10 +1642,10 @@ _elm_colorselector_smart_event(Evas_Object *obj,
/*Append color type only if next color bar is available*/
if (edje_object_part_swallow_get(sd->col_bars_area, colorbar_s))
sd->sel_color_type = sd->sel_color_type + 1;
- else return EINA_FALSE;
+ else return;
}
}
- else return EINA_FALSE;
+ else return;
if (cl)
{
item = eina_list_data_get(cl);
@@ -1646,25 +1658,45 @@ _elm_colorselector_smart_event(Evas_Object *obj,
sd->selected = cl;
}
else if (!cl && sd->focused == ELM_COLORSELECTOR_PALETTE)
- return EINA_FALSE;
+ return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_colorselector_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_colorselector_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_colorselector_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_colorselector_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_colorselector_smart_focus_next_enable;
+}
+
+static void
+_elm_colorselector_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
Eina_List *items = NULL;
Eina_List *l;
Elm_Widget_Item *item;
int i = 0;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
- if (!sd) return EINA_FALSE;
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ if (!sd) return;
- if (!sd->items) return EINA_FALSE;
+ if (!sd->items) return;
EINA_LIST_FOREACH(sd->items, l, item)
items = eina_list_append(items, item->access_obj);
@@ -1676,8 +1708,9 @@ _elm_colorselector_smart_focus_next(const Evas_Object *obj,
items = eina_list_append(items, sd->cb_data[i]->rbt);
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
static void
@@ -1708,75 +1741,32 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
static void
-_elm_colorselector_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_COLORSELECTOR_CHECK(obj);
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_colorselector_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
-
- _access_obj_process(obj, is_access);
-}
-
-static void
-_elm_colorselector_smart_set_user(Elm_Colorselector_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_colorselector_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_colorselector_smart_del;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_colorselector_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_colorselector_smart_event;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_colorselector_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_colorselector_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_colorselector_smart_access;
-}
-
-EAPI const Elm_Colorselector_Smart_Class *
-elm_colorselector_smart_class_get(void)
+_elm_colorselector_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Colorselector_Smart_Class _sc =
- ELM_COLORSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- (ELM_COLORSELECTOR_SMART_NAME);
- static const Elm_Colorselector_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_colorselector_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_colorselector_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(obj, _elm_colorselector_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_colorselector_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_colorselector_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -1787,10 +1777,20 @@ elm_colorselector_color_set(Evas_Object *obj,
int a)
{
ELM_COLORSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_colorselector_color_set(r, g, b, a));
+}
+static void
+_color_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
_colors_set(obj, r, g, b, a);
}
+
EAPI void
elm_colorselector_color_get(const Evas_Object *obj,
int *r,
@@ -1799,7 +1799,17 @@ elm_colorselector_color_get(const Evas_Object *obj,
int *a)
{
ELM_COLORSELECTOR_CHECK(obj);
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_colorselector_color_get(r, g, b, a));
+}
+
+static void
+_color_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+ Elm_Colorselector_Smart_Data *sd = _pd;
if (r) *r = sd->r;
if (g) *g = sd->g;
@@ -1812,7 +1822,15 @@ elm_colorselector_mode_set(Evas_Object *obj,
Elm_Colorselector_Mode mode)
{
ELM_COLORSELECTOR_CHECK(obj);
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_colorselector_mode_set(mode));
+}
+
+static void
+_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Colorselector_Mode mode = va_arg(*list, Elm_Colorselector_Mode);
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->mode == mode) return;
sd->mode = mode;
@@ -1864,7 +1882,7 @@ elm_colorselector_mode_set(Evas_Object *obj,
return;
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
}
@@ -1873,9 +1891,17 @@ EAPI Elm_Colorselector_Mode
elm_colorselector_mode_get(const Evas_Object *obj)
{
ELM_COLORSELECTOR_CHECK(obj) ELM_COLORSELECTOR_BOTH;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Mode ret = ELM_COLORSELECTOR_BOTH;
+ eo_do((Eo *) obj, elm_obj_colorselector_mode_get(&ret));
+ return ret;
+}
- return sd->mode;
+static void
+_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Colorselector_Mode *ret = va_arg(*list, Elm_Colorselector_Mode *);
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ *ret = sd->mode;
}
EAPI void
@@ -1929,10 +1955,25 @@ elm_colorselector_palette_color_add(Evas_Object *obj,
int b,
int a)
{
+ ELM_COLORSELECTOR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_colorselector_palette_color_add(r, g, b, a, &ret));
+ return ret;
+}
+
+static void
+_palette_color_add(Eo *obj, void *_pd, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ if (ret) *ret = NULL;
+
Elm_Color_Item *item;
- ELM_COLORSELECTOR_CHECK(obj) NULL;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ Elm_Colorselector_Smart_Data *sd = _pd;
if (sd->config_load)
{
@@ -1940,10 +1981,10 @@ elm_colorselector_palette_color_add(Evas_Object *obj,
sd->config_load = EINA_FALSE;
}
item = _item_new(obj);
- if (!item) return NULL;
+ if (!item) return;
item->color = ELM_NEW(Elm_Color_RGBA);
- if (!item->color) return NULL;
+ if (!item->color) return;
item->color->r = r;
item->color->g = g;
@@ -1962,14 +2003,20 @@ elm_colorselector_palette_color_add(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)item;
+ if (ret) *ret = (Elm_Object_Item *)item;
}
EAPI void
elm_colorselector_palette_clear(Evas_Object *obj)
{
ELM_COLORSELECTOR_CHECK(obj);
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_colorselector_palette_clear());
+}
+
+static void
+_palette_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Colorselector_Smart_Data *sd = _pd;
_colors_remove(obj);
if (sd->mode == ELM_COLORSELECTOR_BOTH)
@@ -1981,7 +2028,14 @@ elm_colorselector_palette_name_set(Evas_Object *obj,
const char *palette_name)
{
ELM_COLORSELECTOR_CHECK(obj);
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_colorselector_palette_name_set(palette_name));
+}
+
+static void
+_palette_name_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *palette_name = va_arg(*list, const char *);
+ Elm_Colorselector_Smart_Data *sd = _pd;
if (!strcmp(sd->palette_name, palette_name)) return;
@@ -1997,7 +2051,72 @@ EAPI const char *
elm_colorselector_palette_name_get(const Evas_Object *obj)
{
ELM_COLORSELECTOR_CHECK(obj) NULL;
- ELM_COLORSELECTOR_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_colorselector_palette_name_get(&ret));
+ return ret;
+}
+
+static void
+_palette_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Colorselector_Smart_Data *sd = _pd;
+ *ret = sd->palette_name;
+}
+
+static void
+_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_colorselector_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_colorselector_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_colorselector_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_colorselector_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_colorselector_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_colorselector_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_colorselector_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_colorselector_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_colorselector_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_SET), _color_set),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_GET), _color_get),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_SET), _mode_set),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_GET), _mode_get),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_COLOR_ADD), _palette_color_add),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_CLEAR), _palette_clear),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_SET), _palette_name_set),
+ EO_OP_FUNC(ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_GET), _palette_name_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
- return sd->palette_name;
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ _elm_colorselector_smart_focus_next_enable = EINA_TRUE;
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_SET, "Set color to colorselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_GET, "Get current color from colorselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_SET, "Set Colorselector's mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_GET, "Get Colorselector's mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_COLOR_ADD, "Add a new color item to palette."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_CLEAR, "Clear the palette items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_SET, "Set current palette's name."),
+ EO_OP_DESCRIPTION(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_GET, "Get current palette's name."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_COLORSELECTOR_BASE_ID, op_desc, ELM_OBJ_COLORSELECTOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Colorselector_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_colorselector_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_colorselector.h b/src/lib/elm_colorselector.h
index c77810d79..7a1e96dce 100644
--- a/src/lib/elm_colorselector.h
+++ b/src/lib/elm_colorselector.h
@@ -33,6 +33,133 @@
* @{
*/
+#define ELM_OBJ_COLORSELECTOR_CLASS elm_obj_colorselector_class_get()
+
+const Eo_Class *elm_obj_colorselector_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_COLORSELECTOR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_SET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_GET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_SET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_GET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_COLOR_ADD,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_CLEAR,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_SET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_GET,
+ ELM_OBJ_COLORSELECTOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_COLORSELECTOR_ID(sub_id) (ELM_OBJ_COLORSELECTOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_colorselector_color_set
+ * @since 1.8
+ *
+ * Set color to colorselector
+ *
+ * @param[in] r
+ * @param[in] g
+ * @param[in] b
+ * @param[in] a
+ *
+ * @see elm_colorselector_color_set
+ */
+#define elm_obj_colorselector_color_set(r, g, b, a) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_SET), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b), EO_TYPECHECK(int, a)
+
+/**
+ * @def elm_obj_colorselector_color_get
+ * @since 1.8
+ *
+ * Get current color from colorselector
+ *
+ * @param[out] r
+ * @param[out] g
+ * @param[out] b
+ * @param[out] a
+ *
+ * @see elm_colorselector_color_get
+ */
+#define elm_obj_colorselector_color_get(r, g, b, a) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_COLOR_GET), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b), EO_TYPECHECK(int *, a)
+
+/**
+ * @def elm_obj_colorselector_mode_set
+ * @since 1.8
+ *
+ * Set Colorselector's mode.
+ *
+ * @param[in] mode
+ *
+ * @see elm_colorselector_mode_set
+ */
+#define elm_obj_colorselector_mode_set(mode) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_Colorselector_Mode, mode)
+
+/**
+ * @def elm_obj_colorselector_mode_get
+ * @since 1.8
+ *
+ * Get Colorselector's mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_colorselector_mode_get
+ */
+#define elm_obj_colorselector_mode_get(ret) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_Colorselector_Mode *, ret)
+
+/**
+ * @def elm_obj_colorselector_palette_color_add
+ * @since 1.8
+ *
+ * Add a new color item to palette.
+ *
+ * @param[in] r
+ * @param[in] g
+ * @param[in] b
+ * @param[in] a
+ * @param[out] ret
+ *
+ * @see elm_colorselector_palette_color_add
+ */
+#define elm_obj_colorselector_palette_color_add(r, g, b, a, ret) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_COLOR_ADD), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b), EO_TYPECHECK(int, a), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_colorselector_palette_clear
+ * @since 1.8
+ *
+ * Clear the palette items.
+ *
+ *
+ * @see elm_colorselector_palette_clear
+ */
+#define elm_obj_colorselector_palette_clear() ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_CLEAR)
+
+/**
+ * @def elm_obj_colorselector_palette_name_set
+ * @since 1.8
+ *
+ * Set current palette's name
+ *
+ * @param[in] palette_name
+ *
+ * @see elm_colorselector_palette_name_set
+ */
+#define elm_obj_colorselector_palette_name_set(palette_name) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_SET), EO_TYPECHECK(const char *, palette_name)
+
+/**
+ * @def elm_obj_colorselector_palette_name_get
+ * @since 1.8
+ *
+ * Get current palette's name
+ *
+ * @param[out] ret
+ *
+ * @see elm_colorselector_palette_name_get
+ */
+#define elm_obj_colorselector_palette_name_get(ret) ELM_OBJ_COLORSELECTOR_ID(ELM_OBJ_COLORSELECTOR_SUB_ID_PALETTE_NAME_GET), EO_TYPECHECK(const char **, ret)
+
typedef struct _Elm_Color_RGBA
{
unsigned int r;
diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c
index 0349b4d1c..99d89bf8d 100644
--- a/src/lib/elm_conform.c
+++ b/src/lib/elm_conform.c
@@ -1,6 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_conform.h"
+#include "elm_widget_layout.h"
+
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_CONFORMANT_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_CONFORMANT_CLASS
+
+#define MY_CLASS_NAME "elm_conformant"
#ifndef MIN
# define MIN(a, b) ((a) < (b)) ? (a) : (b)
@@ -10,7 +19,6 @@
# define MAX(a, b) ((a) < (b)) ? (b) : (a)
#endif
-EAPI const char ELM_CONFORMANT_SMART_NAME[] = "elm_conformant";
static char CONFORMANT_KEY[] = "_elm_conform_key";
#ifdef HAVE_ELEMENTARY_X
@@ -37,10 +45,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_CONFORMANT_SMART_NAME, _elm_conformant, Elm_Conformant_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
/* Example of env vars:
* ILLUME_KBD="0, 0, 800, 301"
* ILLUME_IND="0, 0, 800, 32"
@@ -543,17 +547,21 @@ _on_rotation_changed(void *data,
}
}
-static Eina_Bool
-_elm_conformant_smart_theme(Evas_Object *obj)
+static void
+_elm_conformant_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_conformant_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_conformant_parts_swallow(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
// unused now - but meant to be for making sure the focused widget is always
@@ -685,7 +693,7 @@ _autoscroll_objects_update(void *data)
while (sub)
{
type = elm_widget_type_get(sub);
- if (!strcmp(type, ELM_CONFORMANT_SMART_NAME)) break;
+ if (!strcmp(type, MY_CLASS_NAME)) break;
for (i = 0; i < SUB_TYPE_COUNT; i++)
if (!strcmp(type, sub_type[i]))
@@ -799,11 +807,9 @@ _on_prop_change(void *data,
#endif
static void
-_elm_conformant_smart_add(Evas_Object *obj)
+_elm_conformant_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Conformant_Smart_Data);
-
- ELM_WIDGET_CLASS(_elm_conformant_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -820,10 +826,10 @@ _elm_conformant_smart_add(Evas_Object *obj)
}
static void
-_elm_conformant_smart_del(Evas_Object *obj)
+_elm_conformant_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *top;
- ELM_CONFORMANT_DATA_GET(obj, sd);
+ Elm_Conformant_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
if (sd->prop_hdl) ecore_event_handler_del(sd->prop_hdl);
@@ -839,20 +845,21 @@ _elm_conformant_smart_del(Evas_Object *obj)
top = elm_widget_top_get(obj);
evas_object_data_set(top, "\377 elm,conformant", NULL);
- ELM_WIDGET_CLASS(_elm_conformant_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_conformant_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_conformant_smart_parent_set(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+
#ifdef HAVE_ELEMENTARY_X
Evas_Object *top = elm_widget_top_get(parent);
Ecore_X_Window xwin = elm_win_xwindow_get(parent);
if ((xwin) && (!elm_win_inlined_image_object_get(top)))
{
- ELM_CONFORMANT_DATA_GET(obj, sd);
+ Elm_Conformant_Smart_Data *sd = _pd;
sd->prop_hdl = ecore_event_handler_add
(ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj);
@@ -864,50 +871,36 @@ _elm_conformant_smart_parent_set(Evas_Object *obj,
}
static void
-_elm_conformant_smart_set_user(Elm_Conformant_Smart_Class *sc)
+_elm_conformant_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_conformant_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_conformant_smart_del;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_conformant_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->theme = _elm_conformant_smart_theme;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Conformant_Smart_Class *
-elm_conformant_smart_class_get(void)
+EAPI Evas_Object *
+elm_conformant_add(Evas_Object *parent)
{
- static Elm_Conformant_Smart_Class _sc =
- ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION(ELM_CONFORMANT_SMART_NAME);
- static const Elm_Conformant_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_conformant_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
}
-EAPI Evas_Object *
-elm_conformant_add(Evas_Object *parent)
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- Evas_Object *obj;
Evas_Object *top;
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_conformant_smart_class_new(), parent);
- if (!obj) return NULL;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
- ELM_CONFORMANT_DATA_GET(obj, sd);
+ Elm_Conformant_Smart_Data *sd = _pd;
top = elm_widget_top_get(obj);
_on_indicator_mode_changed(obj, top, NULL);
@@ -922,6 +915,38 @@ elm_conformant_add(Evas_Object *parent)
(top, "indicator,prop,changed", _on_indicator_mode_changed, obj);
evas_object_smart_callback_add
(top, "rotation,changed", _on_rotation_changed, obj);
+}
- return obj;
+static void
+_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_conformant_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_conformant_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_conformant_smart_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_conformant_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_conformant_smart_content_aliases_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CONFORMANT_BASE_ID, op_desc, ELM_OBJ_CONFORMANT_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Conformant_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_conformant_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_conform.h b/src/lib/elm_conform.h
index ae91a1cc7..cf073c316 100644
--- a/src/lib/elm_conform.h
+++ b/src/lib/elm_conform.h
@@ -45,6 +45,17 @@
* @ref conformant_example
*/
+#define ELM_OBJ_CONFORMANT_CLASS elm_obj_conformant_class_get()
+
+const Eo_Class *elm_obj_conformant_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_CONFORMANT_BASE_ID;
+
+enum
+{
+ ELM_OBJ_CONFORMANT_SUB_ID_LAST
+};
+
/**
* @addtogroup Conformant
* @{
diff --git a/src/lib/elm_container.c b/src/lib/elm_container.c
index d8e91df04..987320811 100644
--- a/src/lib/elm_container.c
+++ b/src/lib/elm_container.c
@@ -2,67 +2,31 @@
#include "elm_priv.h"
#include "elm_widget_container.h"
-static const char CONTAINER_SMART_NAME[] = "elm_container";
+#include "Eo.h"
-/* Elementary smart class for all widgets containing others */
-EVAS_SMART_SUBCLASS_NEW
- (CONTAINER_SMART_NAME, _elm_container, Elm_Container_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_CONTAINER_BASE_ID = EO_NOOP;
-/* no *direct* instantiation of this class, so far */
-__UNUSED__ static Evas_Smart *_elm_container_smart_class_new(void);
+#define MY_CLASS ELM_OBJ_CONTAINER_CLASS
-static Eina_Bool
-_unimplemented_smart_content_set(Evas_Object *obj,
- const char *name __UNUSED__,
- Evas_Object *content __UNUSED__)
-{
- WRN("The %s widget does not implement the \"content_set()\" function.",
- elm_widget_type_get(obj));
+#define MY_CLASS_NAME "elm_container"
- return EINA_FALSE;
-}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET, "Set the content on part of a given container widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET, "Get the content on a part of a given container widget"),
+ EO_OP_DESCRIPTION(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET, "Unset the content on a part of a given container widget"),
+ EO_OP_DESCRIPTION_SENTINEL
+};
-static Evas_Object *
-_unimplemented_smart_content_get(const Evas_Object *obj,
- const char *name __UNUSED__)
-{
- WRN("The %s widget does not implement the \"content_get()\" function.",
- elm_widget_type_get(obj));
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_CONTAINER_BASE_ID, op_desc, ELM_OBJ_CONTAINER_SUB_ID_LAST),
+ NULL,
+ 0,
+ NULL,
+ NULL
+};
- return NULL;
-}
+EO_DEFINE_CLASS(elm_obj_container_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
-static Evas_Object *
-_unimplemented_smart_content_unset(Evas_Object *obj,
- const char *name __UNUSED__)
-{
- WRN("The %s widunset does not implement the \"content_unset()\" function.",
- elm_widget_type_get(obj));
-
- return NULL;
-}
-
-EAPI const Elm_Container_Smart_Class *
-elm_container_smart_class_get(void)
-{
- static Elm_Container_Smart_Class _sc =
- ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(CONTAINER_SMART_NAME);
- static const Elm_Container_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_container_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
-static void
-_elm_container_smart_set_user(Elm_Container_Smart_Class *sc)
-{
- sc->content_set = _unimplemented_smart_content_set;
- sc->content_get = _unimplemented_smart_content_get;
- sc->content_unset = _unimplemented_smart_content_unset;
-}
diff --git a/src/lib/elm_datetime.c b/src/lib/elm_datetime.c
index a8f35a3bc..324c4729b 100644
--- a/src/lib/elm_datetime.c
+++ b/src/lib/elm_datetime.c
@@ -2,6 +2,14 @@
#include "elm_priv.h"
#include "elm_widget_datetime.h"
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_DATETIME_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_DATETIME_CLASS
+
+#define MY_CLASS_NAME "elm_datetime"
+
#ifdef HAVE_LOCALE_H
# include <locale.h>
#endif
@@ -10,8 +18,6 @@
# include <langinfo.h>
#endif
-EAPI const char ELM_DATETIME_SMART_NAME[] = "elm_datetime";
-
#define MAX_SEPARATOR_LEN 6
#define MIN_DAYS_IN_MONTH 28
#define BUFFER_SIZE 1024
@@ -61,10 +67,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_DATETIME_SMART_NAME, _elm_datetime, Elm_Datetime_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static Datetime_Mod_Api *
_dt_mod_init()
{
@@ -300,6 +302,7 @@ _reload_format(Evas_Object *obj)
char *dt_fmt;
ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
// FIXME: provide nl_langinfo on Windows if possible
// fetch the default format from Libc.
@@ -351,21 +354,22 @@ _reload_format(Evas_Object *obj)
elm_layout_text_set(obj, buf, field->separator);
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
_field_list_arrange(obj);
}
-static Eina_Bool
-_elm_datetime_smart_translate(Evas_Object *obj)
+static void
+_elm_datetime_smart_translate(Eo *obj, void *_pd, va_list *list)
{
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (!sd->user_format) _reload_format(obj);
else _field_list_display(obj);
evas_object_smart_callback_call(obj, SIG_LANGUAGE_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Eina_List *
@@ -402,16 +406,26 @@ _datetime_items_get(const Evas_Object *obj)
return items;
}
-static Eina_Bool
-_elm_datetime_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_datetime_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_datetime_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
const Eina_List *items;
Eina_List *(*list_free)(Eina_List *list);
void *(*list_data_get)(const Eina_List *list);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
if ((items = elm_widget_focus_custom_chain_get(obj)))
{
list_data_get = eina_list_data_get;
@@ -422,37 +436,39 @@ _elm_datetime_smart_focus_next(const Evas_Object *obj,
items = _datetime_items_get(obj);
list_data_get = eina_list_data_get;
list_free = eina_list_free;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
printf("count = %d\n", eina_list_count(items));
- ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
if (list_free) list_free((Eina_List *)items);
- return ret;
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_datetime_smart_on_focus(Evas_Object *obj)
+static void
+_elm_datetime_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (!elm_widget_focus_get(obj))
{
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
if ((dt_mod) && (dt_mod->obj_hide))
dt_mod->obj_hide(sd->mod_data);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_datetime_smart_sizing_eval(Evas_Object *obj)
+_elm_datetime_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Datetime_Field *field;
Evas_Coord minw = -1, minh = -1;
unsigned int idx, field_count = 0;
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
{
@@ -462,24 +478,33 @@ _elm_datetime_smart_sizing_eval(Evas_Object *obj)
if (field_count)
elm_coords_finger_size_adjust(field_count, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
-static Eina_Bool
-_elm_datetime_smart_theme(Evas_Object *obj)
+static void
+_elm_datetime_smart_theme(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;
+
Datetime_Field *field;
char buf[BUFFER_SIZE];
unsigned int idx;
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!ELM_WIDGET_CLASS(_elm_datetime_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- if ((!dt_mod) || (!dt_mod->field_value_display)) return EINA_TRUE;
+ if ((!dt_mod) || (!dt_mod->field_value_display))
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
{
@@ -504,10 +529,10 @@ _elm_datetime_smart_theme(Evas_Object *obj)
}
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static int
@@ -735,14 +760,14 @@ _access_info_cb(void *data,
}
static void
-_elm_datetime_smart_add(Evas_Object *obj)
+_elm_datetime_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
int idx;
Datetime_Field *field;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Datetime_Smart_Data);
+ Elm_Datetime_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_datetime_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "datetime", "base", elm_widget_style_get(obj));
@@ -789,12 +814,12 @@ _elm_datetime_smart_add(Evas_Object *obj)
}
static void
-_elm_datetime_smart_del(Evas_Object *obj)
+_elm_datetime_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Datetime_Field *tmp;
unsigned int idx;
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
for (idx = 0; idx < ELM_DATETIME_TYPE_COUNT; idx++)
{
@@ -806,64 +831,46 @@ _elm_datetime_smart_del(Evas_Object *obj)
if ((dt_mod) && (dt_mod->obj_unhook))
dt_mod->obj_unhook(sd->mod_data); // module - unhook
- ELM_WIDGET_CLASS(_elm_datetime_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_datetime_smart_set_user(Elm_Datetime_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_datetime_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_datetime_smart_del;
-
- ELM_WIDGET_CLASS(sc)->translate = _elm_datetime_smart_translate;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_datetime_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_datetime_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_datetime_smart_theme;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_datetime_smart_sizing_eval;
-}
-
-EAPI const Elm_Datetime_Smart_Class *
-elm_datetime_smart_class_get(void)
-{
- static Elm_Datetime_Smart_Class _sc =
- ELM_DATETIME_SMART_CLASS_INIT_NAME_VERSION(ELM_DATETIME_SMART_NAME);
- static const Elm_Datetime_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_datetime_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_datetime_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_datetime_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI const char *
elm_datetime_format_get(const Evas_Object *obj)
{
ELM_DATETIME_CHECK(obj) NULL;
- ELM_DATETIME_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_datetime_format_get(&ret));
+ return ret;
+}
- return sd->format;
+static void
+_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Datetime_Smart_Data *sd = _pd;
+ *ret = sd->format;
}
EAPI void
@@ -871,7 +878,14 @@ elm_datetime_format_set(Evas_Object *obj,
const char *fmt)
{
ELM_DATETIME_CHECK(obj);
- ELM_DATETIME_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_datetime_format_set(fmt));
+}
+
+static void
+_format_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *fmt = va_arg(*list, const char *);
+ Elm_Datetime_Smart_Data *sd = _pd;
if (fmt)
{
@@ -887,15 +901,27 @@ EAPI Eina_Bool
elm_datetime_field_visible_get(const Evas_Object *obj,
Elm_Datetime_Field_Type fieldtype)
{
- Datetime_Field *field;
ELM_DATETIME_CHECK(obj) EINA_FALSE;
- ELM_DATETIME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_datetime_field_visible_get(fieldtype, &ret));
+ return ret;
+}
- if (fieldtype > ELM_DATETIME_AMPM) return EINA_FALSE;
+static void
+_field_visible_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Datetime_Field_Type fieldtype = va_arg(*list, Elm_Datetime_Field_Type);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ Datetime_Field *field;
+ Elm_Datetime_Smart_Data *sd = _pd;
+
+ if (fieldtype > ELM_DATETIME_AMPM) return;
field = sd->field_list + fieldtype;
- return field->visible;
+ *ret = field->visible;
}
EAPI void
@@ -903,10 +929,18 @@ elm_datetime_field_visible_set(Evas_Object *obj,
Elm_Datetime_Field_Type fieldtype,
Eina_Bool visible)
{
+ ELM_DATETIME_CHECK(obj);
+ eo_do(obj, elm_obj_datetime_field_visible_set(fieldtype, visible));
+}
+
+static void
+_field_visible_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Datetime_Field_Type fieldtype = va_arg(*list, Elm_Datetime_Field_Type);
+ Eina_Bool visible = va_arg(*list, int);
Datetime_Field *field;
- ELM_DATETIME_CHECK(obj);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
if (fieldtype > ELM_DATETIME_AMPM) return;
@@ -923,10 +957,20 @@ elm_datetime_field_limit_get(const Evas_Object *obj,
int *min,
int *max)
{
+ ELM_DATETIME_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_datetime_field_limit_get(fieldtype, min, max));
+}
+
+static void
+_elm_datetime_field_limit_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Datetime_Field_Type fieldtype = va_arg(*list, Elm_Datetime_Field_Type);
+ int *min = va_arg(*list, int *);
+ int *max = va_arg(*list, int *);
+
Datetime_Field *field;
- ELM_DATETIME_CHECK(obj);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
if (fieldtype >= ELM_DATETIME_AMPM) return;
@@ -941,10 +985,20 @@ elm_datetime_field_limit_set(Evas_Object *obj,
int min,
int max)
{
+ ELM_DATETIME_CHECK(obj);
+ eo_do(obj, elm_obj_datetime_field_limit_set(fieldtype, min, max));
+}
+
+static void
+_elm_datetime_field_limit_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Datetime_Field_Type fieldtype = va_arg(*list, Elm_Datetime_Field_Type);
+ int min = va_arg(*list, int);
+ int max = va_arg(*list, int);
+
Datetime_Field *field;
- ELM_DATETIME_CHECK(obj);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Elm_Datetime_Smart_Data *sd = _pd;
if (fieldtype >= ELM_DATETIME_AMPM) return;
@@ -968,22 +1022,45 @@ elm_datetime_value_get(const Evas_Object *obj,
struct tm *currtime)
{
ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(currtime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_datetime_value_get(currtime, &ret));
+ return ret;
+}
+
+static void
+_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ struct tm *currtime = va_arg(*list, struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+ EINA_SAFETY_ON_NULL_RETURN(currtime);
+ Elm_Datetime_Smart_Data *sd = _pd;
*currtime = sd->curr_time;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_set(Evas_Object *obj,
const struct tm *newtime)
{
+ ELM_DATETIME_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_datetime_value_set(newtime, &ret));
+ return ret;
+}
+
+static void
+_value_set(Eo *obj, void *_pd, va_list *list)
+{
+ const struct tm *newtime = va_arg(*list, const struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
struct tm old_time;
- ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(newtime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ EINA_SAFETY_ON_NULL_RETURN(newtime);
+ Elm_Datetime_Smart_Data *sd = _pd;
old_time = sd->curr_time;
sd->curr_time = *newtime;
@@ -997,7 +1074,7 @@ elm_datetime_value_set(Evas_Object *obj,
if (!_date_cmp(&old_time, &sd->curr_time))
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI Eina_Bool
@@ -1005,22 +1082,46 @@ elm_datetime_value_min_get(const Evas_Object *obj,
struct tm *mintime)
{
ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(mintime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_datetime_value_min_get(mintime, &ret));
+ return ret;
+}
+
+static void
+_value_min_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ struct tm *mintime = va_arg(*list, struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(mintime);
+ Elm_Datetime_Smart_Data *sd = _pd;
*mintime = sd->min_limit;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_min_set(Evas_Object *obj,
const struct tm *mintime)
{
+ ELM_DATETIME_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_datetime_value_min_set(mintime, &ret));
+ return ret;
+}
+
+static void
+_value_min_set(Eo *obj, void *_pd, va_list *list)
+{
+ const struct tm *mintime = va_arg(*list, const struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
struct tm old_time;
- ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(mintime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ EINA_SAFETY_ON_NULL_RETURN(mintime);
+ Elm_Datetime_Smart_Data *sd = _pd;
sd->min_limit = *mintime;
old_time = sd->curr_time;
@@ -1034,7 +1135,7 @@ elm_datetime_value_min_set(Evas_Object *obj,
if (!_date_cmp(&old_time, &sd->curr_time))
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI Eina_Bool
@@ -1042,22 +1143,46 @@ elm_datetime_value_max_get(const Evas_Object *obj,
struct tm *maxtime)
{
ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(maxtime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_datetime_value_max_get(maxtime, &ret));
+ return ret;
+}
+
+static void
+_value_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ struct tm *maxtime = va_arg(*list, struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(maxtime);
+ Elm_Datetime_Smart_Data *sd = _pd;
*maxtime = sd->max_limit;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
EAPI Eina_Bool
elm_datetime_value_max_set(Evas_Object *obj,
const struct tm *maxtime)
{
+ ELM_DATETIME_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_datetime_value_max_set(maxtime, &ret));
+ return ret;
+}
+
+static void
+_value_max_set(Eo *obj, void *_pd, va_list *list)
+{
+ const struct tm *maxtime = va_arg(*list, const struct tm *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
struct tm old_time;
- ELM_DATETIME_CHECK(obj) EINA_FALSE;
- EINA_SAFETY_ON_NULL_RETURN_VAL(maxtime, EINA_FALSE);
- ELM_DATETIME_DATA_GET(obj, sd);
+ EINA_SAFETY_ON_NULL_RETURN(maxtime);
+ Elm_Datetime_Smart_Data *sd = _pd;
sd->max_limit = *maxtime;
old_time = sd->curr_time;
@@ -1071,5 +1196,65 @@ elm_datetime_value_max_set(Evas_Object *obj,
if (!_date_cmp(&old_time, &sd->curr_time))
evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
+
+static void
+_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_datetime_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_datetime_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_datetime_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_datetime_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_datetime_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_datetime_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_datetime_smart_on_focus),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_datetime_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET), _format_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET), _format_set),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET), _field_visible_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET), _field_visible_set),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET), _elm_datetime_field_limit_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET), _elm_datetime_field_limit_set),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_GET), _value_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_SET), _value_set),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET), _value_min_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET), _value_min_set),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET), _value_max_get),
+ EO_OP_FUNC(ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET), _value_max_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET, "Get the datetime format."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET, "Set the datetime format."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET, "Get whether a field can be visible/not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET, "Set a field to be visible or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET, "Get the field limits of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET, "Set the field limits of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_GET, "Get the current value of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_SET, "Set the current value of a Datetime object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET, "Get the lower boundary of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET, "Set the lower boundary of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET, "Get the upper boundary of a field."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET, "Set the upper boundary of a field."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_DATETIME_BASE_ID, op_desc, ELM_OBJ_DATETIME_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Datetime_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_datetime_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_datetime.h b/src/lib/elm_datetime.h
index 1a8c51f8b..16a14c46f 100644
--- a/src/lib/elm_datetime.h
+++ b/src/lib/elm_datetime.h
@@ -190,6 +190,187 @@
*
*/
+#define ELM_OBJ_DATETIME_CLASS elm_obj_datetime_class_get()
+
+const Eo_Class *elm_obj_datetime_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_DATETIME_BASE_ID;
+
+enum
+{
+ ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET,
+ ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET,
+ ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET,
+ ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET,
+ ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET,
+ ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_GET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_SET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET,
+ ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET,
+ ELM_OBJ_DATETIME_SUB_ID_LAST
+};
+
+#define ELM_OBJ_DATETIME_ID(sub_id) (ELM_OBJ_DATETIME_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_datetime_format_get
+ * @since 1.8
+ *
+ * Get the datetime format.
+ *
+ * @param[out] ret
+ *
+ * @see elm_datetime_format_get
+ */
+#define elm_obj_datetime_format_get(ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_datetime_format_set
+ * @since 1.8
+ *
+ * Set the datetime format.
+ *
+ * @param[in] fmt
+ *
+ * @see elm_datetime_format_set
+ */
+#define elm_obj_datetime_format_set(fmt) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FORMAT_SET), EO_TYPECHECK(const char *, fmt)
+
+/**
+ * @def elm_obj_datetime_field_visible_get
+ * @since 1.8
+ *
+ * @brief Get whether a field can be visible/not
+ *
+ * @param[in] fieldtype
+ * @param[out] ret
+ *
+ * @see elm_datetime_field_visible_get
+ */
+#define elm_obj_datetime_field_visible_get(fieldtype, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_field_visible_set
+ * @since 1.8
+ *
+ * @brief Set a field to be visible or not.
+ *
+ * @param[in] fieldtype
+ * @param[in] visible
+ *
+ * @see elm_datetime_field_visible_set
+ */
+#define elm_obj_datetime_field_visible_set(fieldtype, visible) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_VISIBLE_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(Eina_Bool, visible)
+
+/**
+ * @def elm_obj_datetime_field_limit_get
+ * @since 1.8
+ *
+ * @brief Get the field limits of a field.
+ *
+ * @param[in] fieldtype
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_datetime_field_limit_get
+ */
+#define elm_obj_datetime_field_limit_get(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_GET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int *, min), EO_TYPECHECK(int *, max)
+
+/**
+ * @def elm_obj_datetime_field_limit_set
+ * @since 1.8
+ *
+ * @brief Set the field limits of a field.
+ *
+ * @param[in] fieldtype
+ * @param[in] min
+ * @param[in] max
+ *
+ * @see elm_datetime_field_limit_set
+ */
+#define elm_obj_datetime_field_limit_set(fieldtype, min, max) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_FIELD_LIMIT_SET), EO_TYPECHECK(Elm_Datetime_Field_Type, fieldtype), EO_TYPECHECK(int, min), EO_TYPECHECK(int, max)
+
+/**
+ * @def elm_obj_datetime_value_get
+ * @since 1.8
+ *
+ * @brief Get the current value of a field.
+ *
+ * @param[out] currtime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_get
+ */
+#define elm_obj_datetime_value_get(currtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_GET), EO_TYPECHECK(struct tm *, currtime), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_value_set
+ * @since 1.8
+ *
+ * @brief Set the current value of a Datetime object.
+ *
+ * @param[in] newtime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_set
+ */
+#define elm_obj_datetime_value_set(newtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_SET), EO_TYPECHECK(const struct tm *, newtime), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_value_min_get
+ * @since 1.8
+ *
+ * @brief Get the lower boundary of a field.
+ *
+ * @param[out] mintime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_min_get
+ */
+#define elm_obj_datetime_value_min_get(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_GET), EO_TYPECHECK(struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_value_min_set
+ * @since 1.8
+ *
+ * @brief Set the lower boundary of a field.
+ *
+ * @param[in] mintime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_min_set
+ */
+#define elm_obj_datetime_value_min_set(mintime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MIN_SET), EO_TYPECHECK(const struct tm *, mintime), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_value_max_get
+ * @since 1.8
+ *
+ * @brief Get the upper boundary of a field.
+ *
+ * @param[out] maxtime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_max_get
+ */
+#define elm_obj_datetime_value_max_get(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_GET), EO_TYPECHECK(struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_datetime_value_max_set
+ * @since 1.8
+ *
+ * @brief Set the upper boundary of a field.
+ *
+ * @param[in] maxtime
+ * @param[out] ret
+ *
+ * @see elm_datetime_value_max_set
+ */
+#define elm_obj_datetime_value_max_set(maxtime, ret) ELM_OBJ_DATETIME_ID(ELM_OBJ_DATETIME_SUB_ID_VALUE_MAX_SET), EO_TYPECHECK(const struct tm *, maxtime), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @addtogroup Datetime
* @{
diff --git a/src/lib/elm_dayselector.c b/src/lib/elm_dayselector.c
index e2df5e39c..cdb151ae6 100644
--- a/src/lib/elm_dayselector.c
+++ b/src/lib/elm_dayselector.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_dayselector.h"
+#include "elm_widget_container.h"
-EAPI const char ELM_DAYSELECTOR_SMART_NAME[] = "elm_dayselector";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_DAYSELECTOR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_DAYSELECTOR_CLASS
+
+#define MY_CLASS_NAME "elm_dayselector"
/* signals to edc */
#define ITEM_TYPE_WEEKDAY_DEFAULT "elm,type,weekday,default"
@@ -21,20 +28,16 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_DAYSELECTOR_SMART_NAME, _elm_dayselector, Elm_Dayselector_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
-_elm_dayselector_smart_sizing_eval(Evas_Object *obj)
+_elm_dayselector_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord min_w = -1, min_h = -1;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(ELM_DAYSELECTOR_MAX, &min_w, 1, &min_h);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &min_w, &min_h, min_w, min_h);
+ (wd->resize_obj, &min_w, &min_h, min_w, min_h);
elm_coords_finger_size_adjust(ELM_DAYSELECTOR_MAX, &min_w, 1, &min_h);
evas_object_size_hint_min_set(obj, min_w, min_h);
}
@@ -48,16 +51,19 @@ _dayselector_resize(void *data,
elm_layout_sizing_eval(data);
}
-static Eina_Bool
-_elm_dayselector_smart_translate(Evas_Object *obj)
+static void
+_elm_dayselector_smart_translate(Eo *obj, void *_pd, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
time_t t;
Eina_List *l;
char buf[1024];
struct tm time_daysel;
Elm_Dayselector_Item *it;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
t = time(NULL);
localtime_r(&t, &time_daysel);
@@ -70,7 +76,7 @@ _elm_dayselector_smart_translate(Evas_Object *obj)
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -114,17 +120,21 @@ _item_location_get(Elm_Dayselector_Smart_Data *sd,
ELM_DAYSELECTOR_MAX;
}
-static Eina_Bool
-_elm_dayselector_smart_theme(Evas_Object *obj)
+static void
+_elm_dayselector_smart_theme(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;
+
Eina_List *l;
char buf[1024];
Elm_Dayselector_Item *it;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_dayselector_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
EINA_LIST_FOREACH(sd->items, l, it)
{
@@ -140,7 +150,7 @@ _elm_dayselector_smart_theme(Evas_Object *obj)
_update_items(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -210,36 +220,42 @@ _item_find(const Evas_Object *obj,
return NULL;
}
-static Eina_Bool
-_elm_dayselector_smart_content_set(Evas_Object *obj,
- const char *item,
- Evas_Object *content)
+static void
+_elm_dayselector_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
+ const char *item= va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
int day;
char buf[1024];
Elm_Dayselector_Item *it = NULL;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
if (strcmp(elm_object_widget_type_get(content), "elm_check"))
- return EINA_FALSE;
+ return;
- if (!item) return EINA_FALSE;
+ if (!item) return;
day = atoi(item + (strlen(item) - 1));
- if (day < 0 || day > ELM_DAYSELECTOR_MAX) return EINA_FALSE;
+ if (day < 0 || day > ELM_DAYSELECTOR_MAX) return;
it = _item_find(obj, day);
if (it)
{
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
- if (!ELM_CONTAINER_CLASS(_elm_dayselector_parent_sc)->content_set
- (obj, buf, content))
- return EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_set(buf, content, &int_ret));
+ if (!int_ret) return;
- if (!content) return EINA_TRUE; /* item deletion already
- * handled */
+ if (!content)
+ {
+ if (ret) *ret = EINA_TRUE; /* item deletion already handled */
+ return;
+ }
evas_object_del(VIEW(it));
VIEW(it) = content;
@@ -251,11 +267,11 @@ _elm_dayselector_smart_content_set(Evas_Object *obj,
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
- if (!ELM_CONTAINER_CLASS(_elm_dayselector_parent_sc)->content_set
- (obj, buf, content))
+ eo_do_super(obj, elm_obj_container_content_set(buf, content, &int_ret));
+ if (!int_ret)
{
elm_widget_item_free(it);
- return EINA_FALSE;
+ return;
}
sd->items = eina_list_append(sd->items, it);
@@ -281,31 +297,33 @@ _elm_dayselector_smart_content_set(Evas_Object *obj,
elm_layout_sizing_eval(obj);
_update_items(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_dayselector_smart_content_unset(Evas_Object *obj,
- const char *item)
+static void
+_elm_dayselector_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
+ const char *item = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
+
int day;
char buf[1024];
Evas_Object *content;
Elm_Dayselector_Item *it = NULL;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
day = atoi(item + (strlen(item) - 1));
- if (day < 0 || day > ELM_DAYSELECTOR_MAX) return EINA_FALSE;
+ if (day < 0 || day > ELM_DAYSELECTOR_MAX) return;
it = _item_find(obj, day);
- if (!it) return NULL;
+ if (!it) return;
content = VIEW(it);
- if (!ELM_CONTAINER_CLASS(_elm_dayselector_parent_sc)->content_unset
- (obj, buf))
- return EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_unset(buf, &content));
+ if (!content) return;
sd->items = eina_list_remove(sd->items, it);
evas_object_smart_callback_del(content, "changed", _item_clicked_cb);
@@ -328,7 +346,7 @@ _elm_dayselector_smart_content_unset(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return content;
+ if (ret) *ret = content;
}
static void
@@ -402,11 +420,11 @@ _items_create(Evas_Object *obj)
}
static void
-_elm_dayselector_smart_add(Evas_Object *obj)
+_elm_dayselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Dayselector_Smart_Data);
+ Elm_Dayselector_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_dayselector_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "dayselector", "base", "dayselector");
@@ -422,9 +440,9 @@ _elm_dayselector_smart_add(Evas_Object *obj)
}
static void
-_elm_dayselector_smart_del(Evas_Object *obj)
+_elm_dayselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
Elm_Dayselector_Item *it;
@@ -436,59 +454,29 @@ _elm_dayselector_smart_del(Evas_Object *obj)
}
/* handles freeing sd */
- ELM_WIDGET_CLASS(_elm_dayselector_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_dayselector_smart_set_user(Elm_Dayselector_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_dayselector_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_dayselector_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_dayselector_smart_theme;
- ELM_WIDGET_CLASS(sc)->translate = _elm_dayselector_smart_translate;
-
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_dayselector_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_unset =
- _elm_dayselector_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_dayselector_smart_sizing_eval;
-}
-
-EAPI const Elm_Dayselector_Smart_Class *
-elm_dayselector_smart_class_get(void)
-{
- static Elm_Dayselector_Smart_Class _sc =
- ELM_DAYSELECTOR_SMART_CLASS_INIT_NAME_VERSION(ELM_DAYSELECTOR_SMART_NAME);
- static const Elm_Dayselector_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_dayselector_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_dayselector_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_dayselector_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -497,6 +485,14 @@ elm_dayselector_day_selected_set(Evas_Object *obj,
Eina_Bool selected)
{
ELM_DAYSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_dayselector_day_selected_set(day, selected));
+}
+
+static void
+_day_selected_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Dayselector_Day day = va_arg(*list, Elm_Dayselector_Day);
+ Eina_Bool selected = va_arg(*list, int);
elm_check_state_set(VIEW(_item_find(obj, day)), selected);
}
@@ -506,20 +502,38 @@ elm_dayselector_day_selected_get(const Evas_Object *obj,
Elm_Dayselector_Day day)
{
ELM_DAYSELECTOR_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_dayselector_day_selected_get(day, &ret));
+ return ret;
+}
+
+static void
+_day_selected_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Dayselector_Day day = va_arg(*list, Elm_Dayselector_Day);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return elm_check_state_get(VIEW(_item_find(obj, day)));
+ *ret = elm_check_state_get(VIEW(_item_find(obj, day)));
}
EAPI void
elm_dayselector_week_start_set(Evas_Object *obj,
Elm_Dayselector_Day day)
{
+ ELM_DAYSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_dayselector_week_start_set(day));
+}
+
+static void
+_week_start_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Dayselector_Day day = va_arg(*list, Elm_Dayselector_Day);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Eina_List *l;
char buf[1024];
Elm_Dayselector_Item *it;
- ELM_DAYSELECTOR_CHECK(obj);
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Smart_Data *sd = _pd;
/* just shuffling items, so swalling them directly */
sd->week_start = day;
@@ -527,7 +541,7 @@ elm_dayselector_week_start_set(Evas_Object *obj,
{
snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, buf, VIEW(it));
+ (wd->resize_obj, buf, VIEW(it));
}
_update_items(obj);
@@ -537,9 +551,18 @@ EAPI Elm_Dayselector_Day
elm_dayselector_week_start_get(const Evas_Object *obj)
{
ELM_DAYSELECTOR_CHECK(obj) ELM_DAYSELECTOR_MAX;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Day ret = ELM_DAYSELECTOR_MAX;
+ eo_do((Eo *) obj, elm_obj_dayselector_week_start_get(&ret));
+ return ret;
+}
+
+static void
+_week_start_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Dayselector_Day *ret = va_arg(*list, Elm_Dayselector_Day *);
+ Elm_Dayselector_Smart_Data *sd = _pd;
- return sd->week_start;
+ *ret = sd->week_start;
}
EAPI void
@@ -547,7 +570,14 @@ elm_dayselector_weekend_start_set(Evas_Object *obj,
Elm_Dayselector_Day day)
{
ELM_DAYSELECTOR_CHECK(obj);
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_dayselector_weekend_start_set(day));
+}
+
+static void
+_weekend_start_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Dayselector_Day day = va_arg(*list, Elm_Dayselector_Day);
+ Elm_Dayselector_Smart_Data *sd = _pd;
sd->weekend_start = day;
@@ -559,9 +589,18 @@ EAPI Elm_Dayselector_Day
elm_dayselector_weekend_start_get(const Evas_Object *obj)
{
ELM_DAYSELECTOR_CHECK(obj) ELM_DAYSELECTOR_MAX;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ Elm_Dayselector_Day ret = ELM_DAYSELECTOR_MAX;
+ eo_do((Eo *) obj, elm_obj_dayselector_weekend_start_get(&ret));
+ return ret;
+}
+
+static void
+_weekend_start_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Dayselector_Day *ret = va_arg(*list, Elm_Dayselector_Day *);
+ Elm_Dayselector_Smart_Data *sd = _pd;
- return sd->weekend_start;
+ *ret = sd->weekend_start;
}
EAPI void
@@ -569,7 +608,14 @@ elm_dayselector_weekend_length_set(Evas_Object *obj,
unsigned int length)
{
ELM_DAYSELECTOR_CHECK(obj);
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_dayselector_weekend_length_set(length));
+}
+
+static void
+_weekend_length_set(Eo *obj, void *_pd, va_list *list)
+{
+ unsigned int length = va_arg(*list, unsigned int);
+ Elm_Dayselector_Smart_Data *sd = _pd;
sd->weekend_len = length;
@@ -581,7 +627,79 @@ EAPI unsigned int
elm_dayselector_weekend_length_get(const Evas_Object *obj)
{
ELM_DAYSELECTOR_CHECK(obj) 0;
- ELM_DAYSELECTOR_DATA_GET(obj, sd);
+ unsigned int ret = 0;
+ eo_do((Eo *) obj, elm_obj_dayselector_weekend_length_get(&ret));
+ return ret;
+}
+
+static void
+_weekend_length_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Dayselector_Smart_Data *sd = _pd;
- return sd->weekend_len;
+ *ret = sd->weekend_len;
}
+
+static void
+_elm_dayselector_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_dayselector_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_dayselector_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_dayselector_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_dayselector_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_dayselector_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_dayselector_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_dayselector_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_dayselector_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET), _day_selected_set),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET), _day_selected_get),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET), _week_start_set),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET), _week_start_get),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET), _weekend_start_set),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET), _weekend_start_get),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET), _weekend_length_set),
+ EO_OP_FUNC(ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET), _weekend_length_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET, "Set the state of given Dayselector_Day."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET, "Get the state of given Dayselector_Day."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET, "Set the starting day of Dayselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET, "Get the starting day of Dayselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET, "Set the weekend starting day of Dayselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET, "Get the weekend starting day of Dayselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET, "Set the weekend length of Dayselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET, "Get the weekend length of Dayselector."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_DAYSELECTOR_BASE_ID, op_desc, ELM_OBJ_DAYSELECTOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Dayselector_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_dayselector_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_dayselector.h b/src/lib/elm_dayselector.h
index 7012c4efc..3cd6f63c0 100644
--- a/src/lib/elm_dayselector.h
+++ b/src/lib/elm_dayselector.h
@@ -75,6 +75,126 @@
* @{
*/
+#define ELM_OBJ_DAYSELECTOR_CLASS elm_obj_dayselector_class_get()
+
+const Eo_Class *elm_obj_dayselector_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_DAYSELECTOR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET,
+ ELM_OBJ_DAYSELECTOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_DAYSELECTOR_ID(sub_id) (ELM_OBJ_DAYSELECTOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_dayselector_day_selected_set
+ * @since 1.8
+ *
+ * Set the state of given Dayselector_Day.
+ *
+ * @param[in] day
+ * @param[in] selected
+ *
+ * @see elm_dayselector_day_selected_set
+ */
+#define elm_obj_dayselector_day_selected_set(day, selected) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_SET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool, selected)
+
+/**
+ * @def elm_obj_dayselector_day_selected_get
+ * @since 1.8
+ *
+ * Get the state of given Dayselector_Day.
+ *
+ * @param[in] day
+ * @param[out] ret
+ *
+ * @see elm_dayselector_day_selected_get
+ */
+#define elm_obj_dayselector_day_selected_get(day, ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_DAY_SELECTED_GET), EO_TYPECHECK(Elm_Dayselector_Day, day), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_dayselector_week_start_set
+ * @since 1.8
+ *
+ * Set the starting day of Dayselector.
+ *
+ * @param[in] day
+ *
+ * @see elm_dayselector_week_start_set
+ */
+#define elm_obj_dayselector_week_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day)
+
+/**
+ * @def elm_obj_dayselector_week_start_get
+ * @since 1.8
+ *
+ * Get the starting day of Dayselector.
+ *
+ * @param[out] ret
+ *
+ * @see elm_dayselector_week_start_get
+ */
+#define elm_obj_dayselector_week_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEK_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret)
+
+/**
+ * @def elm_obj_dayselector_weekend_start_set
+ * @since 1.8
+ *
+ * Set the weekend starting day of Dayselector.
+ *
+ * @param[in] day
+ *
+ * @see elm_dayselector_weekend_start_set
+ */
+#define elm_obj_dayselector_weekend_start_set(day) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_SET), EO_TYPECHECK(Elm_Dayselector_Day, day)
+
+/**
+ * @def elm_obj_dayselector_weekend_start_get
+ * @since 1.8
+ *
+ * Get the weekend starting day of Dayselector.
+ *
+ * @param[out] ret
+ *
+ * @see elm_dayselector_weekend_start_get
+ */
+#define elm_obj_dayselector_weekend_start_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_START_GET), EO_TYPECHECK(Elm_Dayselector_Day *, ret)
+
+/**
+ * @def elm_obj_dayselector_weekend_length_set
+ * @since 1.8
+ *
+ * Set the weekend length of Dayselector.
+ *
+ * @param[in] length
+ *
+ * @see elm_dayselector_weekend_length_set
+ */
+#define elm_obj_dayselector_weekend_length_set(length) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_SET), EO_TYPECHECK(unsigned int, length)
+
+/**
+ * @def elm_obj_dayselector_weekend_length_get
+ * @since 1.8
+ *
+ * Get the weekend length of Dayselector.
+ *
+ * @param[out] ret
+ *
+ * @see elm_dayselector_weekend_length_get
+ */
+#define elm_obj_dayselector_weekend_length_get(ret) ELM_OBJ_DAYSELECTOR_ID(ELM_OBJ_DAYSELECTOR_SUB_ID_WEEKEND_LENGTH_GET), EO_TYPECHECK(unsigned int *, ret)
+
/**
* Identifies the day of the week.
* API can call the selection/unselection of day with this as a parameter.
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index b6719d483..32df6a9f4 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -1,6 +1,7 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_diskselector.h"
+#include "elm_interface_scrollable.h"
#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -12,7 +13,11 @@
#define DISPLAY_ITEM_NUM_MIN 3
-EAPI const char ELM_DISKSELECTOR_SMART_NAME[] = "elm_diskselector";
+EAPI Eo_Op ELM_OBJ_DISKSELECTOR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_DISKSELECTOR_CLASS
+
+#define MY_CLASS_NAME "elm_diskselector"
static const char SIG_SELECTED[] = "selected";
static const char SIG_CLICKED[] = "clicked";
@@ -31,16 +36,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_DISKSELECTOR_SMART_NAME, _elm_diskselector,
- Elm_Diskselector_Smart_Class, Elm_Widget_Smart_Class,
- elm_widget_smart_class_get, _smart_callbacks, _smart_interfaces);
-
static void
_selected_item_indicate(Elm_Diskselector_Item *it)
{
@@ -119,14 +114,16 @@ _item_signal_emit(Elm_Diskselector_Item *item)
static Eina_Bool
_string_check(void *data)
{
- Elm_Diskselector_Smart_Data *sd = data;
+ Evas_Object *obj = data;
+ ELM_DISKSELECTOR_DATA_GET(obj, sd);
+
int mid, steps, length, diff;
Elm_Diskselector_Item *it;
Eina_List *list, *l;
Evas_Coord ox, ow;
char buf[1024];
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &ox, NULL, &ow, NULL);
+ evas_object_geometry_get(obj, &ox, NULL, &ow, NULL);
if (ow <= 0)
return EINA_FALSE;
@@ -238,11 +235,11 @@ _scroller_move(void *data)
}
evas_object_geometry_get(obj, NULL, &y, &w, &h);
- sd->s_iface->content_region_show(obj, w / sd->display_item_num * i, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show(w / sd->display_item_num * i, y, w, h));
_item_select(dit);
sd->init = EINA_TRUE;
- _string_check(sd);
+ _string_check(obj);
end:
sd->idler = NULL;
@@ -258,12 +255,13 @@ _resize_cb(void *data __UNUSED__,
Evas_Coord w, h;
ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if ((sd->minw == -1) && (sd->minh == -1))
elm_coords_finger_size_adjust(6, &sd->minw, 1, &sd->minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &sd->minw, &sd->minh, sd->minw,
+ (wd->resize_obj, &sd->minw, &sd->minh, sd->minw,
sd->minh);
evas_object_size_hint_min_set(obj, sd->minw, sd->minh);
@@ -279,7 +277,7 @@ _resize_cb(void *data __UNUSED__,
* (sd->item_count + eina_list_count(sd->left_blanks)
+ eina_list_count(sd->right_blanks)), h);
- sd->s_iface->paging_set(obj, 0, 0, (int)(w / sd->display_item_num), 0);
+ eo_do(obj, elm_scrollable_interface_paging_set(0, 0, (int)(w / sd->display_item_num), 0));
if (!sd->idler)
sd->idler = ecore_idle_enterer_before_add(_scroller_move, obj);
@@ -310,8 +308,9 @@ _item_del_pre_hook(Elm_Object_Item *it)
int i = 0;
item = (Elm_Diskselector_Item *)it;
+ Evas_Object *obj = WIDGET(item);
- ELM_DISKSELECTOR_DATA_GET(WIDGET(item), sd);
+ ELM_DISKSELECTOR_DATA_GET(obj, sd);
elm_box_unpack(sd->main_box, VIEW(item));
@@ -404,9 +403,9 @@ _item_del_pre_hook(Elm_Object_Item *it)
}
}
- sd->check_idler = ecore_idle_enterer_before_add(_string_check, sd);
+ sd->check_idler = ecore_idle_enterer_before_add(_string_check, obj);
- _sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ _sizing_eval(obj);
return EINA_TRUE;
}
@@ -503,7 +502,7 @@ _identical_item_check(Elm_Diskselector_Item *it,
}
if (dit) _item_icon_set(dit, icon);
- _sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ _sizing_eval(WIDGET(it));
}
}
@@ -581,7 +580,7 @@ _access_on_highlight_cb(void *data)
x -= bx;
y -= by;
- sd->s_iface->region_bring_in(WIDGET(it), x, y, w, h);
+ eo_do(WIDGET(it), elm_scrollable_interface_region_bring_in(x, y, w, h));
}
static Elm_Diskselector_Item *
@@ -743,17 +742,20 @@ _theme_data_get(Evas_Object *obj)
else sd->minh = -1;
}
-static Eina_Bool
-_elm_diskselector_smart_theme(Evas_Object *obj)
+static void
+_elm_diskselector_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_List *l;
Elm_Diskselector_Item *it;
Evas_Object *blank;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (sd->round)
{
@@ -793,21 +795,24 @@ _elm_diskselector_smart_theme(Evas_Object *obj)
_theme_data_get(obj);
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_diskselector_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_diskselector_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
Elm_Diskselector_Item *it;
const Eina_List *l;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->sub_object_del
- (obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
EINA_LIST_FOREACH(sd->items, l, it)
{
@@ -820,48 +825,73 @@ _elm_diskselector_smart_sub_object_del(Evas_Object *obj,
}
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_diskselector_smart_on_focus(Evas_Object *obj)
+static void
+_elm_diskselector_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,focus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ (wd->resize_obj, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,unfocus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ (wd->resize_obj, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_diskselector_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_diskselector_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_diskselector_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_diskselector_smart_focus_next_enable;
+}
+
+static void
+_elm_diskselector_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
Eina_List *items = NULL;
Eina_List *elist = NULL;
Elm_Diskselector_Item *it;
- ELM_DISKSELECTOR_CHECK(obj) EINA_FALSE;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ ELM_DISKSELECTOR_CHECK(obj);
+ Elm_Diskselector_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->items, elist, it)
items = eina_list_append(items, it->base.access_obj);
if (!sd->round)
- return elm_widget_focus_list_next_get
+ {
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
+ return;
+ }
if (!elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next))
@@ -870,30 +900,34 @@ _elm_diskselector_smart_focus_next(const Evas_Object *obj,
elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_diskselector_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_diskselector_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
Elm_Diskselector_Item *it = NULL;
Eina_List *l;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
if (!sd->selected_item)
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
-
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Left")) ||
@@ -920,7 +954,7 @@ _elm_diskselector_smart_event(Evas_Object *obj,
else if ((!strcmp(ev->keyname, "End")) ||
((!strcmp(ev->keyname, "KP_End")) && (!ev->string)))
l = eina_list_last(sd->items);
- else return EINA_FALSE;
+ else return;
if (l)
it = eina_list_data_get(l);
@@ -934,7 +968,7 @@ _elm_diskselector_smart_event(Evas_Object *obj,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -947,9 +981,10 @@ _scroll_cb(Evas_Object *obj,
ELM_DISKSELECTOR_DATA_GET(obj, sd);
- _string_check(sd);
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->content_viewport_size_get(obj, &w, &h);
+ _string_check(obj);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_content_viewport_size_get(&w, &h));
if (sd->round)
{
evas_object_geometry_get(sd->main_box, NULL, NULL, &bw, NULL);
@@ -960,13 +995,13 @@ _scroll_cb(Evas_Object *obj,
if (sd->left_boundary_reached) return;
sd->right_boundary_reached = EINA_TRUE;
- sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_get(&h_bounce, NULL));
/* If scroller's bounce effect is disabled, add 1 pixel
* to provide circular effect */
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
&& h_bounce) ? 0 : 1;
- sd->s_iface->content_region_show
- (obj, x - x_boundary + adjust_pixels, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show
+ (x - x_boundary + adjust_pixels, y, w, h));
sd->left_boundary_reached = EINA_FALSE;
}
else if (x <= 0)
@@ -974,13 +1009,13 @@ _scroll_cb(Evas_Object *obj,
if (sd->right_boundary_reached) return;
sd->left_boundary_reached = EINA_TRUE;
- sd->s_iface->bounce_allow_get(obj, &h_bounce, NULL);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_get(&h_bounce, NULL));
/* If scroller's bounce effect is disabled, subtract 1 pixel
* to provide circular effect */
adjust_pixels = (_elm_config->thumbscroll_bounce_enable
&& h_bounce) ? 0 : 1;
- sd->s_iface->content_region_show
- (obj, x + x_boundary - adjust_pixels, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show
+ (x + x_boundary - adjust_pixels, y, w, h));
sd->right_boundary_reached = EINA_FALSE;
}
else
@@ -1185,17 +1220,18 @@ _round_items_add(Elm_Diskselector_Smart_Data *sd)
}
static void
-_elm_diskselector_smart_add(Evas_Object *obj)
+_elm_diskselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Diskselector_Smart_Data);
+ Elm_Diskselector_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, "diskselector", "base",
+ (obj, wd->resize_obj, "diskselector", "base",
elm_widget_style_get(obj));
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
@@ -1209,11 +1245,7 @@ _elm_diskselector_smart_add(Evas_Object *obj)
elm_widget_can_focus_set(obj, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
priv->item_count = 0;
priv->round = EINA_FALSE;
@@ -1221,16 +1253,17 @@ _elm_diskselector_smart_add(Evas_Object *obj)
priv->len_side = 3;
priv->display_item_num_by_api = EINA_FALSE;
- _elm_diskselector_smart_theme(obj);
- priv->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
- priv->s_iface->bounce_allow_set(obj, EINA_TRUE, EINA_FALSE);
+ eo_do(obj, elm_wdg_theme(NULL));
+
+ eo_do(obj, elm_scrollable_interface_policy_set(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF));
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(EINA_TRUE, EINA_FALSE));
- priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
- priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
- priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
- priv->s_iface->scroll_cb_set(obj, _scroll_cb);
+ eo_do(obj,
+ elm_scrollable_interface_animate_start_cb_set(_scroll_animate_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_animate_stop_cb),
+ elm_scrollable_interface_drag_start_cb_set(_scroll_drag_start_cb),
+ elm_scrollable_interface_drag_stop_cb_set(_scroll_drag_stop_cb),
+ elm_scrollable_interface_scroll_cb_set(_scroll_cb));
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, NULL);
@@ -1246,7 +1279,7 @@ _elm_diskselector_smart_add(Evas_Object *obj)
elm_widget_sub_object_add(obj, priv->main_box);
- priv->s_iface->content_set(obj, priv->main_box);
+ eo_do(obj, elm_scrollable_interface_content_set(priv->main_box));
/* left blank */
Evas_Object *blank;
@@ -1267,13 +1300,13 @@ _elm_diskselector_smart_add(Evas_Object *obj)
}
static void
-_elm_diskselector_smart_del(Evas_Object *obj)
+_elm_diskselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Diskselector_Item *it;
Eina_List *l;
Evas_Object *blank;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Diskselector_Smart_Data *sd = _pd;
/* left blank */
EINA_LIST_FOREACH (sd->left_blanks, l, blank)
@@ -1350,132 +1383,108 @@ _elm_diskselector_smart_del(Evas_Object *obj)
sd->check_idler = NULL;
}
- ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_diskselector_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_diskselector_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_diskselector_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_diskselector_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_diskselector_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_diskselector_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_diskselector_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
static void
-_elm_diskselector_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = _elm_diskselector_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
-}
-
-
-static void
-_elm_diskselector_smart_set_user(Elm_Diskselector_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_diskselector_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_diskselector_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_diskselector_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_diskselector_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_diskselector_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->sub_object_del =
- _elm_diskselector_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_diskselector_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_diskselector_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_diskselector_smart_event;
-
- //XXX: ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_diskselector_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_diskselector_smart_access;
-}
-
-EAPI const Elm_Diskselector_Smart_Class *
-elm_diskselector_smart_class_get(void)
+_elm_diskselector_smart_access(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Diskselector_Smart_Class _sc =
- ELM_DISKSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- (ELM_DISKSELECTOR_SMART_NAME);
- static const Elm_Diskselector_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_diskselector_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_diskselector_smart_focus_next_enable = va_arg(*list, int);
}
EAPI Evas_Object *
elm_diskselector_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_diskselector_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Eina_Bool
elm_diskselector_round_enabled_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) EINA_FALSE;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_diskselector_round_enabled_get(&ret));
+ return ret;
+}
+
+static void
+_round_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- return sd->round;
+ *ret = sd->round;
}
EAPI void
elm_diskselector_round_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
+ ELM_DISKSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_diskselector_round_enabled_set(enabled));
+}
+
+static void
+_round_enabled_set(Eo *obj, void *_pd, va_list *list)
+{
Eina_List *elist;
Elm_Diskselector_Item *it;
Evas_Object *blank;
- ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Diskselector_Smart_Data *sd = _pd;
if (sd->round == enabled)
return;
@@ -1555,9 +1564,18 @@ EAPI int
elm_diskselector_side_text_max_length_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) 0;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_diskselector_side_text_max_length_get(&ret));
+ return ret;
+}
+
+static void
+_side_text_max_length_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- return sd->len_side;
+ *ret = sd->len_side;
}
EAPI void
@@ -1565,7 +1583,14 @@ elm_diskselector_side_text_max_length_set(Evas_Object *obj,
int len)
{
ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_diskselector_side_text_max_length_set(len));
+}
+
+static void
+_side_text_max_length_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int len = va_arg(*list, int);
+ Elm_Diskselector_Smart_Data *sd = _pd;
sd->len_side = len;
}
@@ -1576,9 +1601,8 @@ elm_diskselector_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_set(obj, h_bounce, v_bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
}
EAPI void
@@ -1587,9 +1611,8 @@ elm_diskselector_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -1597,12 +1620,19 @@ elm_diskselector_scroller_policy_get(const Evas_Object *obj,
Elm_Scroller_Policy *policy_h,
Elm_Scroller_Policy *policy_v)
{
+ ELM_DISKSELECTOR_CHECK(obj);
+ eo_do((Eo *) obj, elm_scrollable_interface_policy_get(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
Elm_Scroller_Policy s_policy_h, s_policy_v;
- ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Scroller_Policy *policy_h = va_arg(*list, Elm_Scroller_Policy *);
+ Elm_Scroller_Policy *policy_v = va_arg(*list, Elm_Scroller_Policy *);
- sd->s_iface->policy_get(obj, &s_policy_h, &s_policy_v);
+ eo_do_super((Eo *)obj, elm_scrollable_interface_policy_get(&s_policy_h, &s_policy_v));
if (policy_h) *policy_h = (Elm_Scroller_Policy)s_policy_h;
if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v;
}
@@ -1613,22 +1643,35 @@ elm_diskselector_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_v)
{
ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Scroller_Policy policy_h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy policy_v = va_arg(*list, Elm_Scroller_Policy);
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
return;
- sd->s_iface->policy_set(obj, policy_h, policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
}
EAPI void
elm_diskselector_clear(Evas_Object *obj)
{
+ ELM_DISKSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_diskselector_clear());
+}
+
+static void
+_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_Diskselector_Item *it;
- ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Diskselector_Smart_Data *sd = _pd;
if (!sd->items) return;
@@ -1648,9 +1691,18 @@ EAPI const Eina_List *
elm_diskselector_items_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) NULL;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_diskselector_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Diskselector_Smart_Data *sd = _pd;
+
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
@@ -1660,11 +1712,24 @@ elm_diskselector_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_DISKSELECTOR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_diskselector_item_append(label, icon, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
Elm_Diskselector_Item *it, *dit;
Eina_List *elist;
- ELM_DISKSELECTOR_CHECK(obj) NULL;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Diskselector_Smart_Data *sd = _pd;
it = _item_new(obj, icon, label, func, data);
sd->items = eina_list_append(sd->items, it);
@@ -1710,16 +1775,25 @@ elm_diskselector_item_append(Evas_Object *obj,
sd->idler = ecore_idle_enterer_before_add(_scroller_move, obj);
_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
elm_diskselector_selected_item_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) NULL;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_diskselector_selected_item_get(&ret));
+ return ret;
+}
- return (Elm_Object_Item *)sd->selected_item;
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Diskselector_Smart_Data *sd = _pd;
+
+ *ret = (Elm_Object_Item *)sd->selected_item;
}
EAPI void
@@ -1781,19 +1855,37 @@ EAPI Elm_Object_Item *
elm_diskselector_first_item_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) NULL;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
- if (!sd || !sd->items) return NULL;
- return eina_list_data_get(sd->items);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_diskselector_first_item_get(&ret));
+ return ret;
+}
+
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Diskselector_Smart_Data *sd = _pd;
+ if (!sd || !sd->items) *ret = NULL;
+ else *ret = eina_list_data_get(sd->items);
}
EAPI Elm_Object_Item *
elm_diskselector_last_item_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) NULL;
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_diskselector_last_item_get(&ret));
+ return ret;
+}
+
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Diskselector_Smart_Data *sd = _pd;
- if (!sd->items) return NULL;
- return eina_list_data_get(eina_list_last(sd->items));
+ if (!sd->items) *ret = NULL;
+ else *ret = eina_list_data_get(eina_list_last(sd->items));
}
EAPI void
@@ -1801,7 +1893,14 @@ elm_diskselector_display_item_num_set(Evas_Object *obj,
int num)
{
ELM_DISKSELECTOR_CHECK(obj);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_diskselector_display_item_num_set(num));
+}
+
+static void
+_display_item_num_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int num = va_arg(*list, int);
+ Elm_Diskselector_Smart_Data *sd = _pd;
if (num < DISPLAY_ITEM_NUM_MIN) num = DISPLAY_ITEM_NUM_MIN;
sd->display_item_num = num;
@@ -1814,7 +1913,89 @@ EAPI int
elm_diskselector_display_item_num_get(const Evas_Object *obj)
{
ELM_DISKSELECTOR_CHECK(obj) (-1);
- ELM_DISKSELECTOR_DATA_GET(obj, sd);
+ int ret = -1;
+ eo_do((Eo *) obj, elm_obj_diskselector_display_item_num_get(&ret));
+ return ret;
+}
- return sd->display_item_num;
+static void
+_display_item_num_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Diskselector_Smart_Data *sd = _pd;
+
+ *ret = sd->display_item_num;
}
+
+static void
+_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_MEMBER_ADD), _elm_diskselector_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_diskselector_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_diskselector_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_diskselector_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_diskselector_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_diskselector_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_diskselector_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_diskselector_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_diskselector_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_diskselector_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_diskselector_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_diskselector_smart_access),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _scroller_policy_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET), _scroller_policy_get),
+
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET), _round_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), _round_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), _side_text_max_length_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), _side_text_max_length_set),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), _display_item_num_set),
+ EO_OP_FUNC(ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), _display_item_num_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ _elm_diskselector_smart_focus_next_enable = EINA_TRUE;
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET, "Get a value whether round mode is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET, "Enable or disable round mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET, "Get the side labels max length."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET, "Set the side labels max length."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR, "Remove all diskselector's items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET, "Get a list of all the diskselector items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND, "Appends a new item to the diskselector object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET, "Get the selected item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET, "Get the first item of the diskselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET, "Get the last item of the diskselector."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET, "Set the number of items to be displayed."),
+ EO_OP_DESCRIPTION(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET, "Get the number of items in the diskselector object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_DISKSELECTOR_BASE_ID, op_desc, ELM_OBJ_DISKSELECTOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Diskselector_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_diskselector_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_diskselector.h b/src/lib/elm_diskselector.h
index b731899ba..377bb9a50 100644
--- a/src/lib/elm_diskselector.h
+++ b/src/lib/elm_diskselector.h
@@ -61,6 +61,179 @@
* @{
*/
+#define ELM_OBJ_DISKSELECTOR_CLASS elm_obj_diskselector_class_get()
+
+const Eo_Class *elm_obj_diskselector_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_DISKSELECTOR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET,
+ ELM_OBJ_DISKSELECTOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_DISKSELECTOR_ID(sub_id) (ELM_OBJ_DISKSELECTOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_diskselector_round_enabled_get
+ * @since 1.8
+ *
+ * Get a value whether round mode is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_round_enabled_get
+ */
+#define elm_obj_diskselector_round_enabled_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_diskselector_round_enabled_set
+ * @since 1.8
+ *
+ * Enable or disable round mode.
+ *
+ * @param[in] enabled
+ *
+ * @see elm_diskselector_round_enabled_set
+ */
+#define elm_obj_diskselector_round_enabled_set(enabled) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ROUND_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_diskselector_side_text_max_length_get
+ * @since 1.8
+ *
+ * Get the side labels max length.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_side_text_max_length_get
+ */
+#define elm_obj_diskselector_side_text_max_length_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_diskselector_side_text_max_length_set
+ * @since 1.8
+ *
+ * Set the side labels max length.
+ *
+ * @param[in] len
+ *
+ * @see elm_diskselector_side_text_max_length_set
+ */
+#define elm_obj_diskselector_side_text_max_length_set(len) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SIDE_TEXT_MAX_LENGTH_SET), EO_TYPECHECK(int, len)
+
+/**
+ * @def elm_obj_diskselector_clear
+ * @since 1.8
+ *
+ * Remove all diskselector's items.
+ *
+ *
+ * @see elm_diskselector_clear
+ */
+#define elm_obj_diskselector_clear() ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_diskselector_items_get
+ * @since 1.8
+ *
+ * Get a list of all the diskselector items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_items_get
+ */
+#define elm_obj_diskselector_items_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_diskselector_item_append
+ * @since 1.8
+ *
+ * Appends a new item to the diskselector object.
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_diskselector_item_append
+ */
+#define elm_obj_diskselector_item_append(label, icon, func, data, ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_diskselector_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_selected_item_get
+ */
+#define elm_obj_diskselector_selected_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_diskselector_first_item_get
+ * @since 1.8
+ *
+ * Get the first item of the diskselector.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_first_item_get
+ */
+#define elm_obj_diskselector_first_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_diskselector_last_item_get
+ * @since 1.8
+ *
+ * Get the last item of the diskselector.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_last_item_get
+ */
+#define elm_obj_diskselector_last_item_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_diskselector_display_item_num_set
+ * @since 1.8
+ *
+ * Set the number of items to be displayed.
+ *
+ * @param[in] num
+ *
+ * @see elm_diskselector_display_item_num_set
+ */
+#define elm_obj_diskselector_display_item_num_set(num) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_SET), EO_TYPECHECK(int, num)
+
+/**
+ * @def elm_obj_diskselector_display_item_num_get
+ * @since 1.8
+ *
+ * Get the number of items in the diskselector object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_diskselector_display_item_num_get
+ */
+#define elm_obj_diskselector_display_item_num_get(ret) ELM_OBJ_DISKSELECTOR_ID(ELM_OBJ_DISKSELECTOR_SUB_ID_DISPLAY_ITEM_NUM_GET), EO_TYPECHECK(int *, ret)
+
/**
* Add a new diskselector widget to the given parent Elementary
* (container) object.
diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index ec89def7b..e54e237c3 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -3,7 +3,11 @@
#include "elm_priv.h"
#include "elm_widget_entry.h"
-EAPI const char ELM_ENTRY_SMART_NAME[] = "elm_entry";
+EAPI Eo_Op ELM_OBJ_ENTRY_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_ENTRY_CLASS
+
+#define MY_CLASS_NAME "elm_entry"
/* Maximum chunk size to be inserted to the entry at once
* FIXME: This size is arbitrary, should probably choose a better size.
@@ -84,16 +88,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_ENTRY_SMART_NAME, _elm_entry, Elm_Entry_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
static Eina_List *entries = NULL;
struct _Mod_Api
@@ -473,10 +467,12 @@ _elm_entry_theme_group_get(Evas_Object *obj)
}
/* we can't reuse layout's here, because it's on entry_edje only */
-static Eina_Bool
-_elm_entry_smart_disable(Evas_Object *obj)
+static void
+_elm_entry_smart_disable(Eo *obj, void *_pd, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Elm_Entry_Smart_Data *sd = _pd;
if (elm_object_disabled_get(obj))
{
@@ -489,31 +485,32 @@ _elm_entry_smart_disable(Evas_Object *obj)
sd->disabled = EINA_FALSE;
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object, always */
-static Eina_Bool
-_elm_entry_smart_theme(Evas_Object *obj)
+static void
+_elm_entry_smart_theme(Eo *obj, void *_pd, va_list *list)
{
const char *t;
- Elm_Widget_Smart_Class *parent_parent =
- (Elm_Widget_Smart_Class *)((Evas_Smart_Class *)
- _elm_entry_parent_sc)->parent;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!parent_parent->theme(obj))
- return EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
evas_event_freeze(evas_object_evas_get(obj));
edje_object_mirrored_set
- (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));
+ (wd->resize_obj, elm_widget_mirrored_get(obj));
edje_object_scale_set
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
elm_widget_scale_get(obj) * elm_config_scale_get());
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -562,7 +559,7 @@ _elm_entry_smart_theme(Evas_Object *obj)
{
const char *str;
- sd->s_iface->mirrored_set(obj, elm_widget_mirrored_get(obj));
+ eo_do(obj, elm_scrollable_interface_mirrored_set(elm_widget_mirrored_get(obj)));
elm_widget_theme_object_set
(obj, sd->scr_edje, "scroller", "entry", elm_widget_style_get(obj));
@@ -583,7 +580,7 @@ _elm_entry_smart_theme(Evas_Object *obj)
evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -682,12 +679,12 @@ _deferred_recalc_job(void *data)
}
static void
-_elm_entry_smart_sizing_eval(Evas_Object *obj)
+_elm_entry_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
Evas_Coord resw, resh;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &resw, &resh);
@@ -699,7 +696,7 @@ _elm_entry_smart_sizing_eval(Evas_Object *obj)
{
Evas_Coord vw = 0, vh = 0, w = 0, h = 0;
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
w = sd->ent_mw;
h = sd->ent_mh;
@@ -722,7 +719,7 @@ _elm_entry_smart_sizing_eval(Evas_Object *obj)
evas_object_resize(sd->scr_edje, resw, resh);
edje_object_size_min_calc(sd->scr_edje, &vmw, &vmh);
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
edje_object_size_min_restricted_calc
(sd->entry_edje, &minw, &minh, vw, 0);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
@@ -781,7 +778,7 @@ _elm_entry_smart_sizing_eval(Evas_Object *obj)
sd->ent_mh = minh;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (minw > vw) vw = minw;
if (minh > vh) vh = minh;
@@ -832,19 +829,21 @@ _return_key_enabled_check(Evas_Object *obj)
elm_entry_input_panel_return_key_disabled_set(obj, return_key_disabled);
}
-static Eina_Bool
-_elm_entry_smart_on_focus(Evas_Object *obj)
+static void
+_elm_entry_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Evas_Object *top;
Eina_Bool top_is_win;
+ if (ret) *ret = EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
top = elm_widget_top_get(obj);
if (!strcmp(evas_object_type_get(top), "elm_win"))
top_is_win = EINA_TRUE;
- if (!sd->editable) return EINA_FALSE;
+ if (!sd->editable) return;
if (elm_widget_focus_get(obj))
{
evas_object_focus_set(sd->entry_edje, EINA_TRUE);
@@ -863,48 +862,50 @@ _elm_entry_smart_on_focus(Evas_Object *obj)
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_entry_smart_translate(Evas_Object *obj)
+static void
+_elm_entry_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_entry_smart_on_focus_region(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y,
- Evas_Coord *w,
- Evas_Coord *h)
+static void
+_elm_entry_smart_on_focus_region(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_geometry_get
(sd->entry_edje, "elm.text", x, y, w, h);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_show_region_hook(void *data,
+_show_region_hook(void *data EINA_UNUSED,
Evas_Object *obj)
{
Evas_Coord x, y, w, h;
- ELM_ENTRY_DATA_GET(data, sd);
-
elm_widget_show_region_get(obj, &x, &y, &w, &h);
- sd->s_iface->content_region_show(obj, x, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show(x, y, w, h));
}
-static Eina_Bool
-_elm_entry_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_entry_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
/* unfortunately entry doesn't follow the signal pattern
* elm,state,icon,{visible,hidden}, so we have to replicate this
* smart function */
@@ -917,10 +918,10 @@ _elm_entry_smart_sub_object_del(Evas_Object *obj,
elm_layout_signal_emit(obj, "elm,action,hide,end", "elm");
}
- if (!ELM_WIDGET_CLASS(_elm_entry_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, ret));
+ if (!ret) return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -2384,11 +2385,11 @@ _chars_add_till_limit(Evas_Object *obj,
}
static void
-_elm_entry_smart_signal(Evas_Object *obj,
- const char *emission,
- const char *source)
+_elm_entry_smart_signal(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Elm_Entry_Smart_Data *sd = _pd;
/* always pass to both edje objs */
edje_object_signal_emit(sd->entry_edje, emission, source);
@@ -2398,73 +2399,76 @@ _elm_entry_smart_signal(Evas_Object *obj,
}
static void
-_elm_entry_smart_callback_add(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb,
- void *data)
+_elm_entry_smart_callback_add(Eo *obj, void *_pd, va_list *list)
{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func_cb = va_arg(*list, Edje_Signal_Cb);
+ void *data = va_arg(*list, void *);
Evas_Object *ro;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ro = ELM_WIDGET_DATA(sd)->resize_obj;
+ ro = wd->resize_obj;
- ELM_WIDGET_DATA(sd)->resize_obj = sd->entry_edje;
+ wd->resize_obj = sd->entry_edje;
- ELM_LAYOUT_CLASS(_elm_entry_parent_sc)->callback_add
- (obj, emission, source, func_cb, data);
+ eo_do_super(obj, elm_obj_layout_signal_callback_add
+ (emission, source, func_cb, data));
if (sd->scr_edje)
{
- ELM_WIDGET_DATA(sd)->resize_obj = sd->scr_edje;
+ wd->resize_obj = sd->scr_edje;
- ELM_LAYOUT_CLASS(_elm_entry_parent_sc)->callback_add
- (obj, emission, source, func_cb, data);
+ eo_do_super(obj, elm_obj_layout_signal_callback_add
+ (emission, source, func_cb, data));
}
- ELM_WIDGET_DATA(sd)->resize_obj = ro;
+ wd->resize_obj = ro;
}
-static void *
-_elm_entry_smart_callback_del(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb)
+static void
+_elm_entry_smart_callback_del(Eo *obj, void *_pd, va_list *list)
{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func_cb = va_arg(*list, Edje_Signal_Cb);
+ void **data = va_arg(*list, void **);
Evas_Object *ro;
- void *data;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ro = ELM_WIDGET_DATA(sd)->resize_obj;
+ ro = wd->resize_obj;
- ELM_WIDGET_DATA(sd)->resize_obj = sd->entry_edje;
+ wd->resize_obj = sd->entry_edje;
- data = ELM_LAYOUT_CLASS(_elm_entry_parent_sc)->callback_del
- (obj, emission, source, func_cb);
+ eo_do_super(obj, elm_obj_layout_signal_callback_del
+ (emission, source, func_cb, data));
if (sd->scr_edje)
{
- ELM_WIDGET_DATA(sd)->resize_obj = sd->scr_edje;
+ wd->resize_obj = sd->scr_edje;
- ELM_LAYOUT_CLASS(_elm_entry_parent_sc)->callback_del
- (obj, emission, source, func_cb);
+ eo_do_super(obj, elm_obj_layout_signal_callback_del
+ (emission, source, func_cb, data));
}
- ELM_WIDGET_DATA(sd)->resize_obj = ro;
-
- return data;
+ wd->resize_obj = ro;
}
-static Eina_Bool
-_elm_entry_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_entry_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_CONTAINER_CLASS(_elm_entry_parent_sc)->content_set
- (obj, part, content))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if (!int_ret) return;
/* too bad entry does not follow the pattern
* "elm,state,{icon,end},visible", we have to repeat ourselves */
@@ -2474,17 +2478,19 @@ _elm_entry_smart_content_set(Evas_Object *obj,
if (!part || !strcmp(part, "end") || !strcmp(part, "elm.swallow.end"))
elm_entry_end_visible_set(obj, EINA_TRUE);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_entry_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_entry_smart_content_unset(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Evas_Object *ret;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **content = va_arg(*list, Evas_Object **);
+ if (content) *content = NULL;
- ret = ELM_CONTAINER_CLASS(_elm_entry_parent_sc)->content_unset(obj, part);
- if (!ret) return NULL;
+ Evas_Object *int_content;
+ eo_do_super(obj, elm_obj_container_content_unset(part, &int_content));
+ if (!int_content) return;
/* too bad entry does not follow the pattern
* "elm,state,{icon,end},hidden", we have to repeat ourselves */
@@ -2494,17 +2500,20 @@ _elm_entry_smart_content_unset(Evas_Object *obj,
if (!part || !strcmp(part, "end") || !strcmp(part, "elm.swallow.end"))
elm_entry_end_visible_set(obj, EINA_FALSE);
- return ret;
+ if (content) *content = int_content;
}
-static Eina_Bool
-_elm_entry_smart_text_set(Evas_Object *obj,
- const char *item,
- const char *entry)
+static void
+_elm_entry_smart_text_set(Eo *obj, void *_pd, va_list *list)
{
+ const char *item = va_arg(*list, const char *);
+ const char *entry = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
+
int len = 0;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
if (!entry) entry = "";
if (item)
@@ -2514,7 +2523,7 @@ _elm_entry_smart_text_set(Evas_Object *obj,
else
edje_object_part_text_set(sd->entry_edje, item, entry);
- return EINA_TRUE;
+ return;
}
evas_event_freeze(evas_object_evas_get(obj));
@@ -2560,25 +2569,26 @@ _elm_entry_smart_text_set(Evas_Object *obj,
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
-
- return EINA_TRUE;
}
-static const char *
-_elm_entry_smart_text_get(const Evas_Object *obj,
- const char *item)
+static void
+_elm_entry_smart_text_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *item = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
const char *text;
+ *ret = NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
if (item)
{
if (!strcmp(item, "default")) goto proceed;
else if (!strcmp(item, "guide"))
- return edje_object_part_text_get(sd->entry_edje, "elm.guide");
+ *ret = edje_object_part_text_get(sd->entry_edje, "elm.guide");
else
- return edje_object_part_text_get(sd->entry_edje, item);
+ *ret = edje_object_part_text_get(sd->entry_edje, item);
+ return;
}
proceed:
@@ -2588,7 +2598,7 @@ proceed:
{
ERR("text=NULL for edje %p, part 'elm.text'", sd->entry_edje);
- return NULL;
+ return;
}
if (sd->append_text_len > 0)
@@ -2602,7 +2612,7 @@ proceed:
if (!tmpbuf)
{
ERR("Failed to allocate memory for entry's text %p", obj);
- return NULL;
+ return;
}
memcpy(tmpbuf, text, tlen);
@@ -2619,7 +2629,7 @@ proceed:
eina_stringshare_replace(&sd->text, text);
}
- return sd->text;
+ *ret = sd->text;
}
static char *
@@ -2755,7 +2765,7 @@ _resize_cb(void *data,
{
Evas_Coord vw = 0, vh = 0;
- sd->s_iface->content_viewport_size_get(data, &vw, &vh);
+ eo_do(data, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (vw < sd->ent_mw) vw = sd->ent_mw;
if (vh < sd->ent_mh) vh = sd->ent_mh;
evas_object_resize(sd->entry_edje, vw, vh);
@@ -2765,17 +2775,18 @@ _resize_cb(void *data,
}
static void
-_elm_entry_smart_add(Evas_Object *obj)
+_elm_entry_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
#ifdef HAVE_ELEMENTARY_X
Evas_Object *top;
#endif
- EVAS_SMART_DATA_ALLOC(obj, Elm_Entry_Smart_Data);
+ Elm_Entry_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_entry_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
- priv->entry_edje = ELM_WIDGET_DATA(priv)->resize_obj;
+ priv->entry_edje = wd->resize_obj;
priv->cnp_mode = ELM_CNP_MODE_MARKUP;
priv->line_wrap = ELM_WRAP_WORD;
@@ -2800,10 +2811,7 @@ _elm_entry_smart_add(Evas_Object *obj)
evas_object_show(priv->hit_rect);
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set(obj, priv->entry_edje, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(priv->entry_edje, priv->hit_rect));
edje_object_item_provider_set(priv->entry_edje, _item_get, obj);
@@ -2886,7 +2894,7 @@ _elm_entry_smart_add(Evas_Object *obj)
elm_layout_text_set(obj, "elm.text", "");
elm_object_sub_cursor_set
- (ELM_WIDGET_DATA(priv)->resize_obj, obj, ELM_CURSOR_XTERM);
+ (wd->resize_obj, obj, ELM_CURSOR_XTERM);
elm_widget_can_focus_set(obj, EINA_TRUE);
if (_elm_config->desktop_entry)
edje_object_part_text_select_allow_set
@@ -2938,13 +2946,13 @@ _elm_entry_smart_add(Evas_Object *obj)
}
static void
-_elm_entry_smart_del(Evas_Object *obj)
+_elm_entry_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Entry_Context_Menu_Item *it;
Elm_Entry_Item_Provider *ip;
Elm_Entry_Markup_Filter *tf;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->delay_write)
{
@@ -3011,17 +3019,17 @@ _elm_entry_smart_del(Evas_Object *obj)
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_entry_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_entry_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_entry_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Entry_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_entry_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
@@ -3029,93 +3037,64 @@ _elm_entry_smart_move(Evas_Object *obj,
}
static void
-_elm_entry_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_entry_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Entry_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_entry_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_entry_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_entry_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Entry_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_entry_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
static void
-_elm_entry_smart_set_user(Elm_Entry_Smart_Class *sc)
+_elm_entry_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_entry_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_entry_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_entry_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_entry_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_entry_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->on_focus_region = _elm_entry_smart_on_focus_region;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_entry_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_entry_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_entry_smart_theme;
- ELM_WIDGET_CLASS(sc)->disable = _elm_entry_smart_disable;
- ELM_WIDGET_CLASS(sc)->translate = _elm_entry_smart_translate;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_entry_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_entry_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->signal = _elm_entry_smart_signal;
- ELM_LAYOUT_CLASS(sc)->callback_add = _elm_entry_smart_callback_add;
- ELM_LAYOUT_CLASS(sc)->callback_del = _elm_entry_smart_callback_del;
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_entry_smart_text_set;
- ELM_LAYOUT_CLASS(sc)->text_get = _elm_entry_smart_text_get;
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_entry_smart_sizing_eval;
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Entry_Smart_Class *
-elm_entry_smart_class_get(void)
+static void
+_elm_entry_smart_theme_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Entry_Smart_Class _sc =
- ELM_ENTRY_SMART_CLASS_INIT_NAME_VERSION(ELM_ENTRY_SMART_NAME);
- static const Elm_Entry_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_entry_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Eina_Bool *enable = va_arg(*list, Eina_Bool *);
+ *enable = EINA_FALSE;
}
+
EAPI Evas_Object *
elm_entry_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_entry_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -3123,30 +3102,52 @@ elm_entry_text_style_user_push(Evas_Object *obj,
const char *style)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_text_style_user_push(style));
+}
+
+static void
+_text_style_user_push(Eo *obj, void *_pd, va_list *list)
+{
+ const char *style = va_arg(*list, const char *);
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_style_user_push(sd->entry_edje, "elm.text", style);
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI void
elm_entry_text_style_user_pop(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_text_style_user_pop());
+}
+
+static void
+_text_style_user_pop(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_style_user_pop(sd->entry_edje, "elm.text");
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI const char *
elm_entry_text_style_user_peek(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_entry_text_style_user_peek(&ret));
+ return ret;
+}
- return edje_object_part_text_style_user_peek(sd->entry_edje, "elm.text");
+static void
+_text_style_user_peek(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = edje_object_part_text_style_user_peek(sd->entry_edje, "elm.text");
}
EAPI void
@@ -3154,23 +3155,29 @@ elm_entry_single_line_set(Evas_Object *obj,
Eina_Bool single_line)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_single_line_set(single_line));
+}
+
+static void
+_single_line_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool single_line = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->single_line == single_line) return;
sd->single_line = single_line;
sd->line_wrap = ELM_WRAP_NONE;
elm_entry_cnp_mode_set(obj, ELM_CNP_MODE_NO_IMAGE);
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
if (sd->scroll)
{
if (sd->single_line)
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF));
else
{
- sd->s_iface->policy_set(obj, sd->policy_h, sd->policy_v);
+ eo_do(obj, elm_scrollable_interface_policy_set(sd->policy_h, sd->policy_v));
}
elm_layout_sizing_eval(obj);
}
@@ -3180,9 +3187,18 @@ EAPI Eina_Bool
elm_entry_single_line_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_single_line_get(&ret));
+ return ret;
+}
+
+static void
+_single_line_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->single_line;
+ *ret = sd->single_line;
}
EAPI void
@@ -3190,7 +3206,14 @@ elm_entry_password_set(Evas_Object *obj,
Eina_Bool password)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_password_set(password));
+}
+
+static void
+_password_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool password = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
password = !!password;
@@ -3214,16 +3237,25 @@ elm_entry_password_set(Evas_Object *obj,
_entry_selection_callbacks_register(obj);
}
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_entry_password_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_password_get(&ret));
+ return ret;
+}
- return sd->password;
+static void
+_password_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->password;
}
EAPI void
@@ -3231,24 +3263,33 @@ elm_entry_entry_set(Evas_Object *obj,
const char *entry)
{
ELM_ENTRY_CHECK(obj);
- _elm_entry_smart_text_set(obj, NULL, entry);
+ eo_do(obj, elm_obj_layout_text_set(NULL, entry, NULL));
}
EAPI const char *
elm_entry_entry_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- return _elm_entry_smart_text_get(obj, NULL);
+ const char *text;
+ eo_do((Eo *)obj, elm_obj_layout_text_get(NULL, &text));
+ return text;
}
EAPI void
elm_entry_entry_append(Evas_Object *obj,
const char *entry)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_entry_append(entry));
+}
+
+static void
+_entry_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *entry = va_arg(*list, const char *);
int len = 0;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
if (!entry) entry = "";
@@ -3279,14 +3320,22 @@ elm_entry_entry_append(Evas_Object *obj,
EAPI Eina_Bool
elm_entry_is_empty(const Evas_Object *obj)
{
+ ELM_ENTRY_CHECK(obj) EINA_TRUE;
+ Eina_Bool ret = EINA_TRUE;
+ eo_do((Eo *) obj, elm_obj_entry_is_empty(&ret));
+ return ret;
+}
+
+static void
+_is_empty(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
/* FIXME: until there's support for that in textblock, we just
* check to see if the there is text or not. */
const Evas_Object *tb;
Evas_Textblock_Cursor *cur;
- Eina_Bool ret;
- ELM_ENTRY_CHECK(obj) EINA_TRUE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
/* It's a hack until we get the support suggested above. We just
* create a cursor, point it to the begining, and then try to
@@ -3298,19 +3347,28 @@ elm_entry_is_empty(const Evas_Object *obj)
will be removed once evas 1.0 is out */
cur = evas_object_textblock_cursor_new((Evas_Object *)tb);
evas_textblock_cursor_pos_set(cur, 0);
- ret = evas_textblock_cursor_char_next(cur);
+ *ret = evas_textblock_cursor_char_next(cur);
evas_textblock_cursor_free(cur);
- return !ret;
+ *ret = !*ret;
}
EAPI Evas_Object *
elm_entry_textblock_get(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_entry_textblock_get(&ret));
+ return ret;
+}
- return (Evas_Object *)edje_object_part_object_get
+static void
+_textblock_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = (Evas_Object *)edje_object_part_object_get
(sd->entry_edje, "elm.text");
}
@@ -3318,7 +3376,13 @@ EAPI void
elm_entry_calc_force(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_calc_force());
+}
+
+static void
+_calc_force(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_calc_force(sd->entry_edje);
sd->changed = EINA_TRUE;
@@ -3329,10 +3393,20 @@ EAPI const char *
elm_entry_selection_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_entry_selection_get(&ret));
+ return ret;
+}
+
+static void
+_selection_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Entry_Smart_Data *sd = _pd;
+ *ret = NULL;
- if ((sd->password)) return NULL;
- return edje_object_part_text_selection_get(sd->entry_edje, "elm.text");
+ if ((sd->password)) return;
+ *ret = edje_object_part_text_selection_get(sd->entry_edje, "elm.text");
}
EAPI void
@@ -3340,7 +3414,14 @@ elm_entry_entry_insert(Evas_Object *obj,
const char *entry)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_entry_insert(entry));
+}
+
+static void
+_entry_insert(Eo *obj, void *_pd, va_list *list)
+{
+ const char *entry = va_arg(*list, const char *);
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_insert(sd->entry_edje, "elm.text", entry);
sd->changed = EINA_TRUE;
@@ -3352,21 +3433,37 @@ elm_entry_line_wrap_set(Evas_Object *obj,
Elm_Wrap_Type wrap)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_line_wrap_set(wrap));
+}
+
+static void
+_line_wrap_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type wrap = va_arg(*list, Elm_Wrap_Type);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->line_wrap == wrap) return;
sd->last_w = -1;
sd->line_wrap = wrap;
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Elm_Wrap_Type
elm_entry_line_wrap_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Wrap_Type ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_line_wrap_get(&ret));
+ return ret;
+}
- return sd->line_wrap;
+static void
+_line_wrap_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type *ret = va_arg(*list, Elm_Wrap_Type *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->line_wrap;
}
EAPI void
@@ -3374,11 +3471,18 @@ elm_entry_editable_set(Evas_Object *obj,
Eina_Bool editable)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_editable_set(editable));
+}
+
+static void
+_editable_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool editable = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->editable == editable) return;
sd->editable = editable;
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
#ifdef HAVE_ELEMENTARY_X
if (editable)
@@ -3392,16 +3496,31 @@ EAPI Eina_Bool
elm_entry_editable_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_editable_get(&ret));
+ return ret;
+}
+
+static void
+_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->editable;
+ *ret = sd->editable;
}
EAPI void
elm_entry_select_none(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_select_none());
+}
+
+static void
+_select_none(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if ((sd->password)) return;
if (sd->sel_mode)
@@ -3420,7 +3539,13 @@ EAPI void
elm_entry_select_all(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_select_all());
+}
+
+static void
+_select_all(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if ((sd->password)) return;
if (sd->sel_mode)
@@ -3442,20 +3567,42 @@ elm_entry_cursor_geometry_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_geometry_get(x, y, w, h, &ret));
+ return ret;
+}
+
+static void
+_cursor_geometry_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_geometry_get
(sd->entry_edje, "elm.text", x, y, w, h);
- return EINA_TRUE;
}
EAPI Eina_Bool
elm_entry_cursor_next(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_entry_cursor_next(&ret));
+ return ret;
+}
+
+static void
+_cursor_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return edje_object_part_text_cursor_next
+ *ret = edje_object_part_text_cursor_next
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3463,9 +3610,18 @@ EAPI Eina_Bool
elm_entry_cursor_prev(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_entry_cursor_prev(&ret));
+ return ret;
+}
- return edje_object_part_text_cursor_prev
+static void
+_cursor_prev(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = edje_object_part_text_cursor_prev
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3473,9 +3629,18 @@ EAPI Eina_Bool
elm_entry_cursor_up(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_entry_cursor_up(&ret));
+ return ret;
+}
- return edje_object_part_text_cursor_up
+static void
+_cursor_up(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = edje_object_part_text_cursor_up
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3483,9 +3648,18 @@ EAPI Eina_Bool
elm_entry_cursor_down(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_entry_cursor_down(&ret));
+ return ret;
+}
+
+static void
+_cursor_down(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return edje_object_part_text_cursor_down
+ *ret = edje_object_part_text_cursor_down
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3493,7 +3667,13 @@ EAPI void
elm_entry_cursor_begin_set(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_begin_set());
+}
+
+static void
+_cursor_begin_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_begin_set
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -3503,7 +3683,13 @@ EAPI void
elm_entry_cursor_end_set(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_end_set());
+}
+
+static void
+_cursor_end_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_end_set
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -3513,7 +3699,13 @@ EAPI void
elm_entry_cursor_line_begin_set(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_line_begin_set());
+}
+
+static void
+_cursor_line_begin_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_line_begin_set
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -3523,7 +3715,13 @@ EAPI void
elm_entry_cursor_line_end_set(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_line_end_set());
+}
+
+static void
+_cursor_line_end_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_line_end_set
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
@@ -3533,7 +3731,13 @@ EAPI void
elm_entry_cursor_selection_begin(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_selection_begin());
+}
+
+static void
+_cursor_selection_begin(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_select_begin(sd->entry_edje, "elm.text");
}
@@ -3542,7 +3746,13 @@ EAPI void
elm_entry_cursor_selection_end(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_selection_end());
+}
+
+static void
+_cursor_selection_end(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_select_extend(sd->entry_edje, "elm.text");
}
@@ -3551,9 +3761,18 @@ EAPI Eina_Bool
elm_entry_cursor_is_format_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_is_format_get(&ret));
+ return ret;
+}
- return edje_object_part_text_cursor_is_format_get
+static void
+_cursor_is_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = edje_object_part_text_cursor_is_format_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3561,9 +3780,18 @@ EAPI Eina_Bool
elm_entry_cursor_is_visible_format_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_is_visible_format_get(&ret));
+ return ret;
+}
+
+static void
+_cursor_is_visible_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return edje_object_part_text_cursor_is_visible_format_get
+ *ret = edje_object_part_text_cursor_is_visible_format_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3571,9 +3799,18 @@ EAPI char *
elm_entry_cursor_content_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_content_get(&ret));
+ return ret;
+}
+
+static void
+_cursor_content_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ char **ret = va_arg(*list, char **);
+ Elm_Entry_Smart_Data *sd = _pd;
- return edje_object_part_text_cursor_content_get
+ *ret = edje_object_part_text_cursor_content_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3582,7 +3819,14 @@ elm_entry_cursor_pos_set(Evas_Object *obj,
int pos)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_cursor_pos_set(pos));
+}
+
+static void
+_cursor_pos_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int pos = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_cursor_pos_set
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, pos);
@@ -3593,9 +3837,18 @@ EAPI int
elm_entry_cursor_pos_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) 0;
- ELM_ENTRY_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_pos_get(&ret));
+ return ret;
+}
- return edje_object_part_text_cursor_pos_get
+static void
+_cursor_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = edje_object_part_text_cursor_pos_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
@@ -3603,7 +3856,13 @@ EAPI void
elm_entry_selection_cut(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_selection_cut());
+}
+
+static void
+_selection_cut(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if ((sd->password)) return;
_cut_cb(obj, NULL, NULL);
@@ -3613,7 +3872,13 @@ EAPI void
elm_entry_selection_copy(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_selection_copy());
+}
+
+static void
+_selection_copy(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if ((sd->password)) return;
_copy_cb(obj, NULL, NULL);
@@ -3623,7 +3888,13 @@ EAPI void
elm_entry_selection_paste(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_selection_paste());
+}
+
+static void
+_selection_paste(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if ((sd->password)) return;
_paste_cb(obj, NULL, NULL);
@@ -3632,10 +3903,16 @@ elm_entry_selection_paste(Evas_Object *obj)
EAPI void
elm_entry_context_menu_clear(Evas_Object *obj)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_context_menu_clear());
+}
+
+static void
+_context_menu_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_Entry_Context_Menu_Item *it;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_LIST_FREE (sd->items, it)
{
@@ -3654,10 +3931,21 @@ elm_entry_context_menu_item_add(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_context_menu_item_add(label, icon_file, icon_type, func, data));
+}
+
+static void
+_context_menu_item_add(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ const char *icon_file = va_arg(*list, const char *);
+ Elm_Icon_Type icon_type = va_arg(*list, Elm_Icon_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
Elm_Entry_Context_Menu_Item *it;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
it = calloc(1, sizeof(Elm_Entry_Context_Menu_Item));
if (!it) return;
@@ -3676,7 +3964,14 @@ elm_entry_context_menu_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_context_menu_disabled_set(disabled));
+}
+
+static void
+_context_menu_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->context_menu == !disabled) return;
sd->context_menu = !disabled;
@@ -3686,9 +3981,18 @@ EAPI Eina_Bool
elm_entry_context_menu_disabled_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_context_menu_disabled_get(&ret));
+ return ret;
+}
- return !sd->context_menu;
+static void
+_context_menu_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = !sd->context_menu;
}
EAPI void
@@ -3696,10 +4000,18 @@ elm_entry_item_provider_append(Evas_Object *obj,
Elm_Entry_Item_Provider_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_item_provider_append(func, data));
+}
+
+static void
+_item_provider_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Item_Provider_Cb func = va_arg(*list, Elm_Entry_Item_Provider_Cb);
+ void *data = va_arg(*list, void *);
Elm_Entry_Item_Provider *ip;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
@@ -3715,10 +4027,18 @@ elm_entry_item_provider_prepend(Evas_Object *obj,
Elm_Entry_Item_Provider_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_item_provider_prepend(func, data));
+}
+
+static void
+_item_provider_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Item_Provider_Cb func = va_arg(*list, Elm_Entry_Item_Provider_Cb);
+ void *data = va_arg(*list, void *);
Elm_Entry_Item_Provider *ip;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
@@ -3734,11 +4054,19 @@ elm_entry_item_provider_remove(Evas_Object *obj,
Elm_Entry_Item_Provider_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_item_provider_remove(func, data));
+}
+
+static void
+_item_provider_remove(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Item_Provider_Cb func = va_arg(*list, Elm_Entry_Item_Provider_Cb);
+ void *data = va_arg(*list, void *);
Eina_List *l;
Elm_Entry_Item_Provider *ip;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
EINA_LIST_FOREACH(sd->item_providers, l, ip)
@@ -3757,10 +4085,18 @@ elm_entry_markup_filter_append(Evas_Object *obj,
Elm_Entry_Filter_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_markup_filter_append(func, data));
+}
+
+static void
+_markup_filter_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Filter_Cb func = va_arg(*list, Elm_Entry_Filter_Cb);
+ void *data = va_arg(*list, void *);
Elm_Entry_Markup_Filter *tf;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
tf = _filter_new(func, data);
@@ -3774,10 +4110,18 @@ elm_entry_markup_filter_prepend(Evas_Object *obj,
Elm_Entry_Filter_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_markup_filter_prepend(func, data));
+}
+
+static void
+_markup_filter_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Filter_Cb func = va_arg(*list, Elm_Entry_Filter_Cb);
+ void *data = va_arg(*list, void *);
Elm_Entry_Markup_Filter *tf;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
tf = _filter_new(func, data);
@@ -3791,11 +4135,19 @@ elm_entry_markup_filter_remove(Evas_Object *obj,
Elm_Entry_Filter_Cb func,
void *data)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_markup_filter_remove(func, data));
+}
+
+static void
+_markup_filter_remove(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Entry_Filter_Cb func = va_arg(*list, Elm_Entry_Filter_Cb);
+ void *data = va_arg(*list, void *);
Eina_List *l;
Elm_Entry_Markup_Filter *tf;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(func);
EINA_LIST_FOREACH(sd->markup_filters, l, tf)
@@ -3956,7 +4308,20 @@ elm_entry_file_set(Evas_Object *obj,
Elm_Text_Format format)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_entry_file_set(file, format, &ret));
+ return ret;
+}
+
+static void
+_file_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ Elm_Text_Format format = va_arg(*list, Elm_Text_Format);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->delay_write)
{
@@ -3967,7 +4332,8 @@ elm_entry_file_set(Evas_Object *obj,
if (sd->auto_save) _save_do(obj);
eina_stringshare_replace(&sd->file, file);
sd->format = format;
- return _load_do(obj);
+ Eina_Bool int_ret = _load_do(obj);
+ if (ret) *ret = int_ret;
}
EAPI void
@@ -3976,7 +4342,15 @@ elm_entry_file_get(const Evas_Object *obj,
Elm_Text_Format *format)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_entry_file_get(file, format));
+}
+
+static void
+_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **file = va_arg(*list, const char **);
+ Elm_Text_Format *format = va_arg(*list, Elm_Text_Format *);
+ Elm_Entry_Smart_Data *sd = _pd;
if (file) *file = sd->file;
if (format) *format = sd->format;
@@ -3986,7 +4360,13 @@ EAPI void
elm_entry_file_save(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_file_save());
+}
+
+static void
+_file_save(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->delay_write)
{
@@ -4002,7 +4382,14 @@ elm_entry_autosave_set(Evas_Object *obj,
Eina_Bool auto_save)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_autosave_set(auto_save));
+}
+
+static void
+_autosave_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool auto_save = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->auto_save = !!auto_save;
}
@@ -4011,9 +4398,18 @@ EAPI Eina_Bool
elm_entry_autosave_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_autosave_get(&ret));
+ return ret;
+}
- return sd->auto_save;
+static void
+_autosave_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->auto_save;
}
EINA_DEPRECATED EAPI void
@@ -4041,10 +4437,17 @@ EAPI void
elm_entry_cnp_mode_set(Evas_Object *obj,
Elm_Cnp_Mode cnp_mode)
{
+ ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_cnp_mode_set(cnp_mode));
+}
+
+static void
+_cnp_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Cnp_Mode cnp_mode = va_arg(*list, Elm_Cnp_Mode);
Elm_Sel_Format format = ELM_SEL_FORMAT_MARKUP;
- ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->cnp_mode == cnp_mode) return;
sd->cnp_mode = cnp_mode;
@@ -4061,9 +4464,18 @@ EAPI Elm_Cnp_Mode
elm_entry_cnp_mode_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) ELM_CNP_MODE_MARKUP;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Cnp_Mode ret = ELM_CNP_MODE_MARKUP;
+ eo_do((Eo *) obj, elm_obj_entry_cnp_mode_get(&ret));
+ return ret;
+}
- return sd->cnp_mode;
+static void
+_cnp_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Cnp_Mode *ret = va_arg(*list, Elm_Cnp_Mode *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->cnp_mode;
}
EAPI void
@@ -4071,7 +4483,14 @@ elm_entry_scrollable_set(Evas_Object *obj,
Eina_Bool scroll)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_scrollable_set(scroll));
+}
+
+static void
+_scrollable_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool scroll = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
scroll = !!scroll;
if (sd->scroll == scroll) return;
@@ -4103,22 +4522,21 @@ elm_entry_scrollable_set(Evas_Object *obj,
elm_widget_resize_object_set(obj, sd->scr_edje);
- sd->s_iface->objects_set(obj, sd->scr_edje, sd->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(sd->scr_edje, sd->hit_rect));
- sd->s_iface->bounce_allow_set(obj, sd->h_bounce, sd->v_bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(sd->h_bounce, sd->v_bounce));
if (sd->single_line)
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set(ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF));
else
- sd->s_iface->policy_set(obj, sd->policy_h, sd->policy_v);
- sd->s_iface->content_set(obj, sd->entry_edje);
+ eo_do(obj, elm_scrollable_interface_policy_set(sd->policy_h, sd->policy_v));
+ eo_do(obj, elm_scrollable_interface_content_set(sd->entry_edje));
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
}
else
{
if (sd->scr_edje)
{
- sd->s_iface->content_set(obj, NULL);
+ eo_do(obj, elm_scrollable_interface_content_set(NULL));
evas_object_hide(sd->scr_edje);
}
elm_widget_resize_object_set(obj, sd->entry_edje);
@@ -4126,21 +4544,30 @@ elm_entry_scrollable_set(Evas_Object *obj,
if (sd->scr_edje)
elm_widget_sub_object_add(obj, sd->scr_edje);
- sd->s_iface->objects_set(obj, sd->entry_edje, sd->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(sd->entry_edje, sd->hit_rect));
elm_widget_on_show_region_hook_set(obj, NULL, NULL);
}
sd->last_w = -1;
- _elm_entry_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_entry_scrollable_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_scrollable_get(&ret));
+ return ret;
+}
+
+static void
+_scrollable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->scroll;
+ *ret = sd->scroll;
}
EAPI void
@@ -4148,6 +4575,13 @@ elm_entry_icon_visible_set(Evas_Object *obj,
Eina_Bool setting)
{
ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_icon_visible_set(setting));
+}
+
+static void
+_icon_visible_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool setting = va_arg(*list, int);
if (!elm_layout_content_get(obj, "elm.swallow.icon")) return;
@@ -4164,6 +4598,13 @@ elm_entry_end_visible_set(Evas_Object *obj,
Eina_Bool setting)
{
ELM_ENTRY_CHECK(obj);
+ eo_do(obj, elm_obj_entry_end_visible_set(setting));
+}
+
+static void
+_end_visible_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool setting = va_arg(*list, int);
if (!elm_layout_content_get(obj, "elm.swallow.icon")) return;
@@ -4181,11 +4622,19 @@ elm_entry_scrollbar_policy_set(Evas_Object *obj,
Elm_Scroller_Policy v)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_policy_set(h, v));
+}
+
+static void
+_scroller_policy_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Scroller_Policy h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy v = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->policy_h = h;
sd->policy_v = v;
- sd->s_iface->policy_set(obj, sd->policy_h, sd->policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(sd->policy_h, sd->policy_v));
}
EAPI void
@@ -4194,11 +4643,19 @@ elm_entry_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
+}
+
+static void
+_bounce_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool h_bounce = va_arg(*list, int);
+ Eina_Bool v_bounce = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->h_bounce = h_bounce;
sd->v_bounce = v_bounce;
- sd->s_iface->bounce_allow_set(obj, h_bounce, v_bounce);
+ eo_do_super(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
}
EAPI void
@@ -4207,9 +4664,7 @@ elm_entry_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
-
- sd->s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -4217,7 +4672,14 @@ elm_entry_input_panel_layout_set(Evas_Object *obj,
Elm_Input_Panel_Layout layout)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_layout_set(layout));
+}
+
+static void
+_input_panel_layout_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Layout layout = va_arg(*list, Elm_Input_Panel_Layout);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->input_panel_layout = layout;
@@ -4229,9 +4691,18 @@ EAPI Elm_Input_Panel_Layout
elm_entry_input_panel_layout_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) ELM_INPUT_PANEL_LAYOUT_INVALID;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Input_Panel_Layout ret = ELM_INPUT_PANEL_LAYOUT_INVALID;
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_layout_get(&ret));
+ return ret;
+}
- return sd->input_panel_layout;
+static void
+_input_panel_layout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Layout *ret = va_arg(*list, Elm_Input_Panel_Layout *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->input_panel_layout;
}
EAPI void
@@ -4239,7 +4710,14 @@ elm_entry_autocapital_type_set(Evas_Object *obj,
Elm_Autocapital_Type autocapital_type)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_autocapital_type_set(autocapital_type));
+}
+
+static void
+_autocapital_type_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Autocapital_Type autocapital_type = va_arg(*list, Elm_Autocapital_Type);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->autocapital_type = autocapital_type;
edje_object_part_text_autocapital_type_set
@@ -4250,9 +4728,18 @@ EAPI Elm_Autocapital_Type
elm_entry_autocapital_type_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) ELM_AUTOCAPITAL_TYPE_NONE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Autocapital_Type ret = ELM_AUTOCAPITAL_TYPE_NONE;
+ eo_do((Eo *) obj, elm_obj_entry_autocapital_type_get(&ret));
+ return ret;
+}
+
+static void
+_autocapital_type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Autocapital_Type *ret = va_arg(*list, Elm_Autocapital_Type *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->autocapital_type;
+ *ret = sd->autocapital_type;
}
EAPI void
@@ -4260,7 +4747,14 @@ elm_entry_prediction_allow_set(Evas_Object *obj,
Eina_Bool prediction)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_prediction_allow_set(prediction));
+}
+
+static void
+_prediction_allow_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool prediction = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->prediction_allow = prediction;
edje_object_part_text_prediction_allow_set
@@ -4271,16 +4765,31 @@ EAPI Eina_Bool
elm_entry_prediction_allow_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_TRUE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_TRUE;
+ eo_do((Eo *) obj, elm_obj_entry_prediction_allow_get(&ret));
+ return ret;
+}
- return sd->prediction_allow;
+static void
+_prediction_allow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->prediction_allow;
}
EAPI void
elm_entry_imf_context_reset(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_imf_context_reset());
+}
+
+static void
+_imf_context_reset(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_imf_context_reset(sd->entry_edje, "elm.text");
}
@@ -4290,7 +4799,14 @@ elm_entry_input_panel_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_enabled_set(enabled));
+}
+
+static void
+_input_panel_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->input_panel_enable = enabled;
edje_object_part_text_input_panel_enabled_set
@@ -4301,16 +4817,31 @@ EAPI Eina_Bool
elm_entry_input_panel_enabled_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_TRUE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_TRUE;
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_enabled_get(&ret));
+ return ret;
+}
+
+static void
+_input_panel_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->input_panel_enable;
+ *ret = sd->input_panel_enable;
}
EAPI void
elm_entry_input_panel_show(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_show());
+}
+
+static void
+_input_panel_show(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_input_panel_show(sd->entry_edje, "elm.text");
}
@@ -4319,7 +4850,13 @@ EAPI void
elm_entry_input_panel_hide(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_hide());
+}
+
+static void
+_input_panel_hide(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_input_panel_hide(sd->entry_edje, "elm.text");
}
@@ -4329,7 +4866,14 @@ elm_entry_input_panel_language_set(Evas_Object *obj,
Elm_Input_Panel_Lang lang)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_language_set(lang));
+}
+
+static void
+_input_panel_language_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Lang lang = va_arg(*list, Elm_Input_Panel_Lang);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->input_panel_lang = lang;
edje_object_part_text_input_panel_language_set
@@ -4340,9 +4884,18 @@ EAPI Elm_Input_Panel_Lang
elm_entry_input_panel_language_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) ELM_INPUT_PANEL_LANG_AUTOMATIC;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Input_Panel_Lang ret = ELM_INPUT_PANEL_LANG_AUTOMATIC;
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_language_get(&ret));
+ return ret;
+}
- return sd->input_panel_lang;
+static void
+_input_panel_language_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Lang *ret = va_arg(*list, Elm_Input_Panel_Lang *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->input_panel_lang;
}
EAPI void
@@ -4351,7 +4904,15 @@ elm_entry_input_panel_imdata_set(Evas_Object *obj,
int len)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_imdata_set(data, len));
+}
+
+static void
+_input_panel_imdata_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const void *data = va_arg(*list, const void *);
+ int len = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->input_panel_imdata)
free(sd->input_panel_imdata);
@@ -4371,7 +4932,15 @@ elm_entry_input_panel_imdata_get(const Evas_Object *obj,
int *len)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_imdata_get(data, len));
+}
+
+static void
+_input_panel_imdata_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ void *data = va_arg(*list, void *);
+ int *len = va_arg(*list, int *);
+ Elm_Entry_Smart_Data *sd = _pd;
edje_object_part_text_input_panel_imdata_get
(sd->entry_edje, "elm.text", data, len);
@@ -4383,7 +4952,14 @@ elm_entry_input_panel_return_key_type_set(Evas_Object *obj,
return_key_type)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_return_key_type_set(return_key_type));
+}
+
+static void
+_input_panel_return_key_type_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Return_Key_Type return_key_type = va_arg(*list, Elm_Input_Panel_Return_Key_Type);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->input_panel_return_key_type = return_key_type;
@@ -4395,9 +4971,18 @@ EAPI Elm_Input_Panel_Return_Key_Type
elm_entry_input_panel_return_key_type_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Elm_Input_Panel_Return_Key_Type ret = ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_return_key_type_get(&ret));
+ return ret;
+}
- return sd->input_panel_return_key_type;
+static void
+_input_panel_return_key_type_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Input_Panel_Return_Key_Type *ret = va_arg(*list, Elm_Input_Panel_Return_Key_Type *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->input_panel_return_key_type;
}
EAPI void
@@ -4405,7 +4990,14 @@ elm_entry_input_panel_return_key_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_return_key_disabled_set(disabled));
+}
+
+static void
+_input_panel_return_key_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->input_panel_return_key_disabled = disabled;
@@ -4417,9 +5009,18 @@ EAPI Eina_Bool
elm_entry_input_panel_return_key_disabled_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_input_panel_return_key_disabled_get(&ret));
+ return ret;
+}
- return sd->input_panel_return_key_disabled;
+static void
+_input_panel_return_key_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->input_panel_return_key_disabled;
}
EAPI void
@@ -4427,7 +5028,14 @@ elm_entry_input_panel_return_key_autoenabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_input_panel_return_key_autoenabled_set(enabled));
+}
+
+static void
+_input_panel_return_key_autoenabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Entry_Smart_Data *sd = _pd;
sd->auto_return_key = enabled;
_return_key_enabled_check(obj);
@@ -4437,10 +5045,20 @@ EAPI void *
elm_entry_imf_context_get(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
- if (!sd) return NULL;
+ void *ret = NULL;
+ eo_do(obj, elm_obj_entry_imf_context_get(&ret));
+ return ret;
+}
+
+static void
+_imf_context_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ void **ret = va_arg(*list, void **);
+ *ret = NULL;
+ Elm_Entry_Smart_Data *sd = _pd;
+ if (!sd) return;
- return edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text");
+ *ret = edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text");
}
/* START - ANCHOR HOVER */
@@ -4460,7 +5078,14 @@ elm_entry_anchor_hover_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_anchor_hover_parent_set(parent));
+}
+
+static void
+_anchor_hover_parent_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->anchor_hover.hover_parent)
evas_object_event_callback_del_full
@@ -4477,9 +5102,18 @@ EAPI Evas_Object *
elm_entry_anchor_hover_parent_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_entry_anchor_hover_parent_get(&ret));
+ return ret;
+}
- return sd->anchor_hover.hover_parent;
+static void
+_anchor_hover_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Entry_Smart_Data *sd = _pd;
+
+ *ret = sd->anchor_hover.hover_parent;
}
EAPI void
@@ -4487,7 +5121,14 @@ elm_entry_anchor_hover_style_set(Evas_Object *obj,
const char *style)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_anchor_hover_style_set(style));
+}
+
+static void
+_anchor_hover_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *style = va_arg(*list, const char *);
+ Elm_Entry_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->anchor_hover.hover_style, style);
}
@@ -4496,16 +5137,31 @@ EAPI const char *
elm_entry_anchor_hover_style_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
- ELM_ENTRY_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_entry_anchor_hover_style_get(&ret));
+ return ret;
+}
+
+static void
+_anchor_hover_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Entry_Smart_Data *sd = _pd;
- return sd->anchor_hover.hover_style;
+ *ret = sd->anchor_hover.hover_style;
}
EAPI void
elm_entry_anchor_hover_end(Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj);
- ELM_ENTRY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_entry_anchor_hover_end());
+}
+
+static void
+_anchor_hover_end(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Entry_Smart_Data *sd = _pd;
if (sd->anchor_hover.hover) evas_object_del(sd->anchor_hover.hover);
if (sd->anchor_hover.pop) evas_object_del(sd->anchor_hover.pop);
@@ -4513,4 +5169,245 @@ elm_entry_anchor_hover_end(Evas_Object *obj)
sd->anchor_hover.pop = NULL;
}
+static void
+_elm_entry_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_entry_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_entry_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_entry_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_entry_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_entry_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD), _elm_entry_smart_member_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_entry_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_entry_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_entry_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_entry_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS_REGION), _elm_entry_smart_on_focus_region),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_entry_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_entry_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_entry_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_entry_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_entry_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_entry_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT), _elm_entry_smart_signal),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD), _elm_entry_smart_callback_add),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL), _elm_entry_smart_callback_del),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_entry_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_entry_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_entry_smart_content_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE), _elm_entry_smart_theme_enable),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET), _bounce_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _scroller_policy_set),
+
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH), _text_style_user_push),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP), _text_style_user_pop),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK), _text_style_user_peek),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET), _single_line_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET), _single_line_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET), _password_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET), _password_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND), _entry_append),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY), _is_empty),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET), _textblock_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE), _calc_force),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET), _selection_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT), _entry_insert),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET), _line_wrap_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET), _line_wrap_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET), _editable_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET), _editable_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE), _select_none),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL), _select_all),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET), _cursor_geometry_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT), _cursor_next),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV), _cursor_prev),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP), _cursor_up),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN), _cursor_down),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET), _cursor_begin_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET), _cursor_end_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET), _cursor_line_begin_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET), _cursor_line_end_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN), _cursor_selection_begin),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END), _cursor_selection_end),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET), _cursor_is_format_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET), _cursor_is_visible_format_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET), _cursor_content_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET), _cursor_pos_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET), _cursor_pos_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT), _selection_cut),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY), _selection_copy),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE), _selection_paste),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR), _context_menu_clear),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD), _context_menu_item_add),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET), _context_menu_disabled_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET), _context_menu_disabled_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND), _item_provider_append),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND), _item_provider_prepend),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE), _item_provider_remove),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND), _markup_filter_append),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND), _markup_filter_prepend),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE), _markup_filter_remove),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_GET), _file_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE), _file_save),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET), _autosave_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET), _autosave_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET), _cnp_mode_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET), _cnp_mode_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET), _scrollable_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET), _scrollable_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET), _icon_visible_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET), _end_visible_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET), _input_panel_layout_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET), _input_panel_layout_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET), _autocapital_type_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET), _autocapital_type_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET), _prediction_allow_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET), _prediction_allow_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET), _imf_context_reset),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET), _input_panel_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET), _input_panel_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW), _input_panel_show),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE), _input_panel_hide),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET), _input_panel_language_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET), _input_panel_language_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET), _input_panel_imdata_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET), _input_panel_imdata_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET), _input_panel_return_key_type_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET), _input_panel_return_key_type_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET), _input_panel_return_key_disabled_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET), _input_panel_return_key_disabled_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET), _input_panel_return_key_autoenabled_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET), _imf_context_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET), _anchor_hover_parent_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET), _anchor_hover_parent_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET), _anchor_hover_style_set),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET), _anchor_hover_style_get),
+ EO_OP_FUNC(ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END), _anchor_hover_end),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH, "Push the style to the top of user style stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP, "Remove the style in the top of user style stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK, "Retrieve the style on the top of user style stack."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET, "Sets the entry to single line mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET, "Gets whether the entry is set to be single line."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET, "Sets the entry to password mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET, "Gets whether the entry is set to password mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND, "Appends entry to the text of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY, "Gets whether the entry is empty."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET, "Returns the actual textblock object of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE, "Forces calculation of the entry size and text layouting."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET, "Gets any selected text within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT, "Inserts the given text into the entry at the current cursor position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET, "Set the line wrap type to use on multi-line entries."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET, "Gets the wrap mode the entry was set to use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET, "Sets if the entry is to be editable or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET, "Gets whether the entry is editable or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE, "This drops any existing text selection within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL, "This selects all text within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET, "This function returns the geometry of the cursor."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT, "This moves the cursor one place to the right within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV, "This moves the cursor one place to the left within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP, "This moves the cursor one line up within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN, "This moves the cursor one line down within the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET, "This moves the cursor to the beginning of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET, "This moves the cursor to the end of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET, "This moves the cursor to the beginning of the current line."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET, "This moves the cursor to the end of the current line."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN, "This begins a selection within the entry as though."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END, "This ends a selection within the entry as though."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET, "Gets whether a format node exists at the current cursor position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET, "Gets if the current cursor position holds a visible format node."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET, "Gets the character pointed by the cursor at its current position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET, "Sets the cursor position in the entry to the given value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET, "Retrieves the current position of the cursor in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT, "This executes a 'cut' action on the selected text in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY, "This executes a 'copy' action on the selected text in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE, "This executes a 'paste' action in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR, "This clears and frees the items in a entry's contextual (longpress)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD, "This adds an item to the entry's contextual menu."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET, "This disables the entry's contextual (longpress) menu."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET, "This returns whether the entry's contextual (longpress) menu is disabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND, "This appends a custom item provider to the list for that entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND, "This prepends a custom item provider to the list for that entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE, "This removes a custom item provider to the list for that entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND, "Append a markup filter function for text inserted in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND, "Prepend a markup filter function for text inserted in the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE, "Remove a markup filter from the list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_FILE_SET, "This sets the file (and implicitly loads it) for the text to display and then edit."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_FILE_GET, "Gets the file being edited by the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE, "This function writes any changes made to the file set with elm_entry_file_set()."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET, "This sets the entry object to 'autosave' the loaded text file or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET, "This gets the entry object's 'autosave' status."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET, "Control pasting of text and images for the widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET, "Getting elm_entry text paste/drop mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET, "Enable or disable scrolling in entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET, "Get the scrollable state of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET, "Sets the visibility of the left-side widget of the entry,."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET, "Sets the visibility of the end widget of the entry, set by elm_object_part_content_set(ent, 'end', content)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET, "Set the input panel layout of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET, "Get the input panel layout of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET, "Set the autocapitalization type on the immodule."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET, "Retrieve the autocapitalization type on the immodule."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET, "Set whether the entry should allow to use the text prediction."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET, "Get whether the entry should allow to use the text prediction."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET, "Reset the input method context of the entry if needed."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET, "Sets the attribute to show the input panel automatically."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET, "Retrieve the attribute to show the input panel automatically."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW, "Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE, "Hide the input panel (virtual keyboard)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET, "Set the language mode of the input panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET, "Get the language mode of the input panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET, "Set the input panel-specific data to deliver to the input panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET, "Get the specific data of the current input panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET, "Set the 'return' key type."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET, "Get the 'return' key type."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET, "Set the return key on the input panel to be disabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET, "Get whether the return key on the input panel should be disabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET, "Set whether the return key on the input panel is disabled automatically when entry has no text."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET, "Returns the input method context of the entry."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET, "Set the parent of the hover popup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET, "Get the parent of the hover popup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET, "Set the style that the hover should use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET, "Get the style that the hover should use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END, "Ends the hover popup in the entry."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_ENTRY_BASE_ID, op_desc, ELM_OBJ_ENTRY_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Entry_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_entry_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, ELM_SCROLLABLE_INTERFACE, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
/* END - ANCHOR HOVER */
diff --git a/src/lib/elm_entry.h b/src/lib/elm_entry.h
index 7d9e2d93d..2044841ca 100644
--- a/src/lib/elm_entry.h
+++ b/src/lib/elm_entry.h
@@ -1795,6 +1795,1130 @@ EAPI const char *elm_entry_anchor_hover_style_get(const Evas_Obj
*/
EAPI void elm_entry_anchor_hover_end(Evas_Object *obj);
+#define ELM_OBJ_ENTRY_CLASS elm_obj_entry_class_get()
+
+const Eo_Class *elm_obj_entry_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_ENTRY_BASE_ID;
+
+enum
+{
+ ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH,
+ ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP,
+ ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK,
+ ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET,
+ ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND,
+ ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY,
+ ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE,
+ ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT,
+ ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET,
+ ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET,
+ ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE,
+ ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET,
+ ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT,
+ ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY,
+ ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE,
+ ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR,
+ ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD,
+ ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND,
+ ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND,
+ ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE,
+ ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND,
+ ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND,
+ ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE,
+ ELM_OBJ_ENTRY_SUB_ID_FILE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_FILE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE,
+ ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET,
+ ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET,
+ ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET,
+ ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET,
+ ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET,
+ ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET,
+ ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET,
+ ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END,
+ ELM_OBJ_ENTRY_SUB_ID_LAST
+};
+
+#define ELM_OBJ_ENTRY_ID(sub_id) (ELM_OBJ_ENTRY_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_entry_text_style_user_push
+ * @since 1.8
+ *
+ * Push the style to the top of user style stack.
+ *
+ * @param[in] style
+ *
+ * @see elm_entry_text_style_user_push
+ */
+#define elm_obj_entry_text_style_user_push(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PUSH), EO_TYPECHECK(const char *, style)
+
+/**
+ * @def elm_obj_entry_text_style_user_pop
+ * @since 1.8
+ *
+ * Remove the style in the top of user style stack.
+ *
+ *
+ * @see elm_entry_text_style_user_pop
+ */
+#define elm_obj_entry_text_style_user_pop() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_POP)
+
+/**
+ * @def elm_obj_entry_text_style_user_peek
+ * @since 1.8
+ *
+ * Retrieve the style on the top of user style stack.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_text_style_user_peek
+ */
+#define elm_obj_entry_text_style_user_peek(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXT_STYLE_USER_PEEK), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_entry_single_line_set
+ * @since 1.8
+ *
+ * Sets the entry to single line mode.
+ *
+ * @param[in] single_line
+ *
+ * @see elm_entry_single_line_set
+ */
+#define elm_obj_entry_single_line_set(single_line) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_SET), EO_TYPECHECK(Eina_Bool, single_line)
+
+/**
+ * @def elm_obj_entry_single_line_get
+ * @since 1.8
+ *
+ * Gets whether the entry is set to be single line.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_single_line_get
+ */
+#define elm_obj_entry_single_line_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SINGLE_LINE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_password_set
+ * @since 1.8
+ *
+ * Sets the entry to password mode.
+ *
+ * @param[in] password
+ *
+ * @see elm_entry_password_set
+ */
+#define elm_obj_entry_password_set(password) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_SET), EO_TYPECHECK(Eina_Bool, password)
+
+/**
+ * @def elm_obj_entry_password_get
+ * @since 1.8
+ *
+ * Gets whether the entry is set to password mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_password_get
+ */
+#define elm_obj_entry_password_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PASSWORD_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_entry_append
+ * @since 1.8
+ *
+ * Appends entry to the text of the entry.
+ *
+ * @param[in] entry
+ *
+ * @see elm_entry_entry_append
+ */
+#define elm_obj_entry_entry_append(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_APPEND), EO_TYPECHECK(const char *, entry)
+
+/**
+ * @def elm_obj_entry_is_empty
+ * @since 1.8
+ *
+ * Gets whether the entry is empty.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_is_empty
+ */
+#define elm_obj_entry_is_empty(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IS_EMPTY), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_textblock_get
+ * @since 1.8
+ *
+ * Returns the actual textblock object of the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_textblock_get
+ */
+#define elm_obj_entry_textblock_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_TEXTBLOCK_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_entry_calc_force
+ * @since 1.8
+ *
+ * Forces calculation of the entry size and text layouting.
+ *
+ *
+ * @see elm_entry_calc_force
+ */
+#define elm_obj_entry_calc_force() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CALC_FORCE)
+
+/**
+ * @def elm_obj_entry_selection_get
+ * @since 1.8
+ *
+ * Gets any selected text within the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_selection_get
+ */
+#define elm_obj_entry_selection_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_entry_entry_insert
+ * @since 1.8
+ *
+ * Inserts the given text into the entry at the current cursor position.
+ *
+ * @param[in] entry
+ *
+ * @see elm_entry_entry_insert
+ */
+#define elm_obj_entry_entry_insert(entry) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ENTRY_INSERT), EO_TYPECHECK(const char *, entry)
+
+/**
+ * @def elm_obj_entry_line_wrap_set
+ * @since 1.8
+ *
+ * Set the line wrap type to use on multi-line entries.
+ *
+ * @param[in] wrap
+ *
+ * @see elm_entry_line_wrap_set
+ */
+#define elm_obj_entry_line_wrap_set(wrap) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)
+
+/**
+ * @def elm_obj_entry_line_wrap_get
+ * @since 1.8
+ *
+ * Gets the wrap mode the entry was set to use.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_line_wrap_get
+ */
+#define elm_obj_entry_line_wrap_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)
+
+/**
+ * @def elm_obj_entry_editable_set
+ * @since 1.8
+ *
+ * Sets if the entry is to be editable or not.
+ *
+ * @param[in] editable
+ *
+ * @see elm_entry_editable_set
+ */
+#define elm_obj_entry_editable_set(editable) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, editable)
+
+/**
+ * @def elm_obj_entry_editable_get
+ * @since 1.8
+ *
+ * Gets whether the entry is editable or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_editable_get
+ */
+#define elm_obj_entry_editable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_select_none
+ * @since 1.8
+ *
+ * This drops any existing text selection within the entry.
+ *
+ *
+ * @see elm_entry_select_none
+ */
+#define elm_obj_entry_select_none() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_NONE)
+
+/**
+ * @def elm_obj_entry_select_all
+ * @since 1.8
+ *
+ * This selects all text within the entry.
+ *
+ *
+ * @see elm_entry_select_all
+ */
+#define elm_obj_entry_select_all() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECT_ALL)
+
+/**
+ * @def elm_obj_entry_cursor_geometry_get
+ * @since 1.8
+ *
+ * This function returns the geometry of the cursor.
+ *
+ * @param[out] x
+ * @param[out] y
+ * @param[out] w
+ * @param[out] h
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_geometry_get
+ */
+#define elm_obj_entry_cursor_geometry_get(x, y, w, h, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_GEOMETRY_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_next
+ * @since 1.8
+ *
+ * This moves the cursor one place to the right within the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_next
+ */
+#define elm_obj_entry_cursor_next(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_NEXT), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_prev
+ * @since 1.8
+ *
+ * This moves the cursor one place to the left within the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_prev
+ */
+#define elm_obj_entry_cursor_prev(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_PREV), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_up
+ * @since 1.8
+ *
+ * This moves the cursor one line up within the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_up
+ */
+#define elm_obj_entry_cursor_up(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_UP), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_down
+ * @since 1.8
+ *
+ * This moves the cursor one line down within the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_down
+ */
+#define elm_obj_entry_cursor_down(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_DOWN), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_begin_set
+ * @since 1.8
+ *
+ * This moves the cursor to the beginning of the entry.
+ *
+ *
+ * @see elm_entry_cursor_begin_set
+ */
+#define elm_obj_entry_cursor_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_BEGIN_SET)
+
+/**
+ * @def elm_obj_entry_cursor_end_set
+ * @since 1.8
+ *
+ * This moves the cursor to the end of the entry.
+ *
+ *
+ * @see elm_entry_cursor_end_set
+ */
+#define elm_obj_entry_cursor_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_END_SET)
+
+/**
+ * @def elm_obj_entry_cursor_line_begin_set
+ * @since 1.8
+ *
+ * This moves the cursor to the beginning of the current line.
+ *
+ *
+ * @see elm_entry_cursor_line_begin_set
+ */
+#define elm_obj_entry_cursor_line_begin_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_BEGIN_SET)
+
+/**
+ * @def elm_obj_entry_cursor_line_end_set
+ * @since 1.8
+ *
+ * This moves the cursor to the end of the current line.
+ *
+ *
+ * @see elm_entry_cursor_line_end_set
+ */
+#define elm_obj_entry_cursor_line_end_set() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_LINE_END_SET)
+
+/**
+ * @def elm_obj_entry_cursor_selection_begin
+ * @since 1.8
+ *
+ * This begins a selection within the entry as though
+ *
+ *
+ * @see elm_entry_cursor_selection_begin
+ */
+#define elm_obj_entry_cursor_selection_begin() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_BEGIN)
+
+/**
+ * @def elm_obj_entry_cursor_selection_end
+ * @since 1.8
+ *
+ * This ends a selection within the entry as though
+ *
+ *
+ * @see elm_entry_cursor_selection_end
+ */
+#define elm_obj_entry_cursor_selection_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_SELECTION_END)
+
+/**
+ * @def elm_obj_entry_cursor_is_format_get
+ * @since 1.8
+ *
+ * Gets whether a format node exists at the current cursor position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_is_format_get
+ */
+#define elm_obj_entry_cursor_is_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_is_visible_format_get
+ * @since 1.8
+ *
+ * Gets if the current cursor position holds a visible format node.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_is_visible_format_get
+ */
+#define elm_obj_entry_cursor_is_visible_format_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_IS_VISIBLE_FORMAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cursor_content_get
+ * @since 1.8
+ *
+ * Gets the character pointed by the cursor at its current position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_content_get
+ */
+#define elm_obj_entry_cursor_content_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_CONTENT_GET), EO_TYPECHECK(char **, ret)
+
+/**
+ * @def elm_obj_entry_cursor_pos_set
+ * @since 1.8
+ *
+ * Sets the cursor position in the entry to the given value
+ *
+ * @param[in] pos
+ *
+ * @see elm_entry_cursor_pos_set
+ */
+#define elm_obj_entry_cursor_pos_set(pos) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_SET), EO_TYPECHECK(int, pos)
+
+/**
+ * @def elm_obj_entry_cursor_pos_get
+ * @since 1.8
+ *
+ * Retrieves the current position of the cursor in the entry
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cursor_pos_get
+ */
+#define elm_obj_entry_cursor_pos_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CURSOR_POS_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_entry_selection_cut
+ * @since 1.8
+ *
+ * This executes a "cut" action on the selected text in the entry.
+ *
+ *
+ * @see elm_entry_selection_cut
+ */
+#define elm_obj_entry_selection_cut() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_CUT)
+
+/**
+ * @def elm_obj_entry_selection_copy
+ * @since 1.8
+ *
+ * This executes a "copy" action on the selected text in the entry.
+ *
+ *
+ * @see elm_entry_selection_copy
+ */
+#define elm_obj_entry_selection_copy() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_COPY)
+
+/**
+ * @def elm_obj_entry_selection_paste
+ * @since 1.8
+ *
+ * This executes a "paste" action in the entry.
+ *
+ *
+ * @see elm_entry_selection_paste
+ */
+#define elm_obj_entry_selection_paste() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SELECTION_PASTE)
+
+/**
+ * @def elm_obj_entry_context_menu_clear
+ * @since 1.8
+ *
+ * This clears and frees the items in a entry's contextual (longpress)
+ *
+ *
+ * @see elm_entry_context_menu_clear
+ */
+#define elm_obj_entry_context_menu_clear() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_CLEAR)
+
+/**
+ * @def elm_obj_entry_context_menu_item_add
+ * @since 1.8
+ *
+ * This adds an item to the entry's contextual menu.
+ *
+ * @param[in] label
+ * @param[in] icon_file
+ * @param[in] icon_type
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_context_menu_item_add
+ */
+#define elm_obj_entry_context_menu_item_add(label, icon_file, icon_type, func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_ITEM_ADD), EO_TYPECHECK(const char *, label), EO_TYPECHECK(const char *, icon_file), EO_TYPECHECK(Elm_Icon_Type, icon_type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data)
+
+/**
+ * @def elm_obj_entry_context_menu_disabled_set
+ * @since 1.8
+ *
+ * This disables the entry's contextual (longpress) menu.
+ *
+ * @param[in] disabled
+ *
+ * @see elm_entry_context_menu_disabled_set
+ */
+#define elm_obj_entry_context_menu_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_entry_context_menu_disabled_get
+ * @since 1.8
+ *
+ * This returns whether the entry's contextual (longpress) menu is
+ * disabled.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_context_menu_disabled_get
+ */
+#define elm_obj_entry_context_menu_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CONTEXT_MENU_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_item_provider_append
+ * @since 1.8
+ *
+ * This appends a custom item provider to the list for that entry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_item_provider_append
+ */
+#define elm_obj_entry_item_provider_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_APPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_item_provider_prepend
+ * @since 1.8
+ *
+ * This prepends a custom item provider to the list for that entry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_item_provider_prepend
+ */
+#define elm_obj_entry_item_provider_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_PREPEND), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_item_provider_remove
+ * @since 1.8
+ *
+ * This removes a custom item provider to the list for that entry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_item_provider_remove
+ */
+#define elm_obj_entry_item_provider_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ITEM_PROVIDER_REMOVE), EO_TYPECHECK(Elm_Entry_Item_Provider_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_markup_filter_append
+ * @since 1.8
+ *
+ * Append a markup filter function for text inserted in the entry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_markup_filter_append
+ */
+#define elm_obj_entry_markup_filter_append(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_APPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_markup_filter_prepend
+ * @since 1.8
+ *
+ * Prepend a markup filter function for text inserted in the entry
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_markup_filter_prepend
+ */
+#define elm_obj_entry_markup_filter_prepend(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_PREPEND), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_markup_filter_remove
+ * @since 1.8
+ *
+ * Remove a markup filter from the list
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_entry_markup_filter_remove
+ */
+#define elm_obj_entry_markup_filter_remove(func, data) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_MARKUP_FILTER_REMOVE), EO_TYPECHECK(Elm_Entry_Filter_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_entry_file_set
+ * @since 1.8
+ *
+ * This sets the file (and implicitly loads it) for the text to display and
+ * then edit. All changes are written back to the file after a short delay if
+ * the entry object is set to autosave (which is the default).
+ *
+ * @param[in] file
+ * @param[in] format
+ * @param[out] ret
+ *
+ * @see elm_entry_file_set
+ */
+#define elm_obj_entry_file_set(file, format, ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Elm_Text_Format, format), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_file_get
+ * @since 1.8
+ *
+ * Gets the file being edited by the entry.
+ *
+ * @param[out] file
+ * @param[out] format
+ *
+ * @see elm_entry_file_get
+ */
+#define elm_obj_entry_file_get(file, format) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(Elm_Text_Format *, format)
+
+/**
+ * @def elm_obj_entry_file_save
+ * @since 1.8
+ *
+ * This function writes any changes made to the file set with
+ * elm_entry_file_set()
+ *
+ *
+ * @see elm_entry_file_save
+ */
+#define elm_obj_entry_file_save() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_FILE_SAVE)
+
+/**
+ * @def elm_obj_entry_autosave_set
+ * @since 1.8
+ *
+ * This sets the entry object to 'autosave' the loaded text file or not.
+ *
+ * @param[in] auto_save
+ *
+ * @see elm_entry_autosave_set
+ */
+#define elm_obj_entry_autosave_set(auto_save) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_SET), EO_TYPECHECK(Eina_Bool, auto_save)
+
+/**
+ * @def elm_obj_entry_autosave_get
+ * @since 1.8
+ *
+ * This gets the entry object's 'autosave' status.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_autosave_get
+ */
+#define elm_obj_entry_autosave_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOSAVE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_cnp_mode_set
+ * @since 1.8
+ *
+ * Control pasting of text and images for the widget.
+ *
+ * @param[in] cnp_mode
+ *
+ * @see elm_entry_cnp_mode_set
+ */
+#define elm_obj_entry_cnp_mode_set(cnp_mode) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_SET), EO_TYPECHECK(Elm_Cnp_Mode, cnp_mode)
+
+/**
+ * @def elm_obj_entry_cnp_mode_get
+ * @since 1.8
+ *
+ * Getting elm_entry text paste/drop mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_cnp_mode_get
+ */
+#define elm_obj_entry_cnp_mode_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_CNP_MODE_GET), EO_TYPECHECK(Elm_Cnp_Mode *, ret)
+
+/**
+ * @def elm_obj_entry_scrollable_set
+ * @since 1.8
+ *
+ * Enable or disable scrolling in entry
+ *
+ * @param[in] scroll
+ *
+ * @see elm_entry_scrollable_set
+ */
+#define elm_obj_entry_scrollable_set(scroll) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_SET), EO_TYPECHECK(Eina_Bool, scroll)
+
+/**
+ * @def elm_obj_entry_scrollable_get
+ * @since 1.8
+ *
+ * Get the scrollable state of the entry
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_scrollable_get
+ */
+#define elm_obj_entry_scrollable_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_SCROLLABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_icon_visible_set
+ * @since 1.8
+ *
+ * Sets the visibility of the left-side widget of the entry,
+ * set by elm_object_part_content_set().
+ *
+ * @param[in] setting
+ *
+ * @see elm_entry_icon_visible_set
+ */
+#define elm_obj_entry_icon_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ICON_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting)
+
+/**
+ * @def elm_obj_entry_end_visible_set
+ * @since 1.8
+ *
+ * Sets the visibility of the end widget of the entry, set by
+ *
+ * @param[in] setting
+ *
+ * @see elm_entry_end_visible_set
+ */
+#define elm_obj_entry_end_visible_set(setting) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_END_VISIBLE_SET), EO_TYPECHECK(Eina_Bool, setting)
+
+/**
+ * @def elm_obj_entry_input_panel_layout_set
+ * @since 1.8
+ *
+ * Set the input panel layout of the entry
+ *
+ * @param[in] layout
+ *
+ * @see elm_entry_input_panel_layout_set
+ */
+#define elm_obj_entry_input_panel_layout_set(layout) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_SET), EO_TYPECHECK(Elm_Input_Panel_Layout, layout)
+
+/**
+ * @def elm_obj_entry_input_panel_layout_get
+ * @since 1.8
+ *
+ * Get the input panel layout of the entry
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_input_panel_layout_get
+ */
+#define elm_obj_entry_input_panel_layout_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LAYOUT_GET), EO_TYPECHECK(Elm_Input_Panel_Layout *, ret)
+
+/**
+ * @def elm_obj_entry_autocapital_type_set
+ * @since 1.8
+ *
+ * Set the autocapitalization type on the immodule.
+ *
+ * @param[in] autocapital_type
+ *
+ * @see elm_entry_autocapital_type_set
+ */
+#define elm_obj_entry_autocapital_type_set(autocapital_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_SET), EO_TYPECHECK(Elm_Autocapital_Type, autocapital_type)
+
+/**
+ * @def elm_obj_entry_autocapital_type_get
+ * @since 1.8
+ *
+ * Retrieve the autocapitalization type on the immodule.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_autocapital_type_get
+ */
+#define elm_obj_entry_autocapital_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_AUTOCAPITAL_TYPE_GET), EO_TYPECHECK(Elm_Autocapital_Type *, ret)
+
+/**
+ * @def elm_obj_entry_prediction_allow_set
+ * @since 1.8
+ *
+ * Set whether the entry should allow to use the text prediction.
+ *
+ * @param[in] prediction
+ *
+ * @see elm_entry_prediction_allow_set
+ */
+#define elm_obj_entry_prediction_allow_set(prediction) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_SET), EO_TYPECHECK(Eina_Bool, prediction)
+
+/**
+ * @def elm_obj_entry_prediction_allow_get
+ * @since 1.8
+ *
+ * Get whether the entry should allow to use the text prediction.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_prediction_allow_get
+ */
+#define elm_obj_entry_prediction_allow_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_PREDICTION_ALLOW_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_imf_context_reset
+ * @since 1.8
+ *
+ * Reset the input method context of the entry if needed.
+ *
+ *
+ * @see elm_entry_imf_context_reset
+ */
+#define elm_obj_entry_imf_context_reset() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_RESET)
+
+/**
+ * @def elm_obj_entry_input_panel_enabled_set
+ * @since 1.8
+ *
+ * Sets the attribute to show the input panel automatically.
+ *
+ * @param[in] enabled
+ *
+ * @see elm_entry_input_panel_enabled_set
+ */
+#define elm_obj_entry_input_panel_enabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_entry_input_panel_enabled_get
+ * @since 1.8
+ *
+ * Retrieve the attribute to show the input panel automatically.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_input_panel_enabled_get
+ */
+#define elm_obj_entry_input_panel_enabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_input_panel_show
+ * @since 1.8
+ *
+ * Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on.
+ *
+ *
+ * @see elm_entry_input_panel_show
+ */
+#define elm_obj_entry_input_panel_show() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_SHOW)
+
+/**
+ * @def elm_obj_entry_input_panel_hide
+ * @since 1.8
+ *
+ * Hide the input panel (virtual keyboard).
+ *
+ *
+ * @see elm_entry_input_panel_hide
+ */
+#define elm_obj_entry_input_panel_hide() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_HIDE)
+
+/**
+ * @def elm_obj_entry_input_panel_language_set
+ * @since 1.8
+ *
+ * Set the language mode of the input panel.
+ *
+ * @param[in] lang
+ *
+ * @see elm_entry_input_panel_language_set
+ */
+#define elm_obj_entry_input_panel_language_set(lang) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_SET), EO_TYPECHECK(Elm_Input_Panel_Lang, lang)
+
+/**
+ * @def elm_obj_entry_input_panel_language_get
+ * @since 1.8
+ *
+ * Get the language mode of the input panel.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_input_panel_language_get
+ */
+#define elm_obj_entry_input_panel_language_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_LANGUAGE_GET), EO_TYPECHECK(Elm_Input_Panel_Lang *, ret)
+
+/**
+ * @def elm_obj_entry_input_panel_imdata_set
+ * @since 1.8
+ *
+ * Set the input panel-specific data to deliver to the input panel.
+ *
+ * @param[in] data
+ * @param[in] len
+ *
+ * @see elm_entry_input_panel_imdata_set
+ */
+#define elm_obj_entry_input_panel_imdata_set(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_SET), EO_TYPECHECK(const void *, data), EO_TYPECHECK(int, len)
+
+/**
+ * @def elm_obj_entry_input_panel_imdata_get
+ * @since 1.8
+ *
+ * Get the specific data of the current input panel.
+ *
+ * @param[out] data
+ * @param[out] len
+ *
+ * @see elm_entry_input_panel_imdata_get
+ */
+#define elm_obj_entry_input_panel_imdata_get(data, len) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_IMDATA_GET), EO_TYPECHECK(void *, data), EO_TYPECHECK(int *, len)
+
+/**
+ * @def elm_obj_entry_input_panel_return_key_type_set
+ * @since 1.8
+ *
+ * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
+ *
+ * @param[out] return_key_type
+ *
+ * @see elm_entry_input_panel_return_key_type_set
+ */
+#define elm_obj_entry_input_panel_return_key_type_set(return_key_type) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_SET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type, return_key_type)
+
+/**
+ * @def elm_obj_entry_input_panel_return_key_type_get
+ * @since 1.8
+ *
+ * Get the "return" key type.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_input_panel_return_key_type_get
+ */
+#define elm_obj_entry_input_panel_return_key_type_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_TYPE_GET), EO_TYPECHECK(Elm_Input_Panel_Return_Key_Type *, ret)
+
+/**
+ * @def elm_obj_entry_input_panel_return_key_disabled_set
+ * @since 1.8
+ *
+ * Set the return key on the input panel to be disabled.
+ *
+ * @param[in] disabled
+ *
+ * @see elm_entry_input_panel_return_key_disabled_set
+ */
+#define elm_obj_entry_input_panel_return_key_disabled_set(disabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_entry_input_panel_return_key_disabled_get
+ * @since 1.8
+ *
+ * Get whether the return key on the input panel should be disabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_input_panel_return_key_disabled_get
+ */
+#define elm_obj_entry_input_panel_return_key_disabled_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_entry_input_panel_return_key_autoenabled_set
+ * @since 1.8
+ *
+ * Set whether the return key on the input panel is disabled automatically when entry has no text.
+ *
+ * @param[in] enabled
+ *
+ * @see elm_entry_input_panel_return_key_autoenabled_set
+ */
+#define elm_obj_entry_input_panel_return_key_autoenabled_set(enabled) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_INPUT_PANEL_RETURN_KEY_AUTOENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_entry_imf_context_get
+ * @since 1.8
+ *
+ * Returns the input method context of the entry.
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_imf_context_get
+ */
+#define elm_obj_entry_imf_context_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_IMF_CONTEXT_GET), EO_TYPECHECK(void **, ret)
+
+/**
+ * @def elm_obj_entry_anchor_hover_parent_set
+ * @since 1.8
+ *
+ * Set the parent of the hover popup
+ *
+ * @param[in] parent
+ *
+ * @see elm_entry_anchor_hover_parent_set
+ */
+#define elm_obj_entry_anchor_hover_parent_set(parent) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+
+/**
+ * @def elm_obj_entry_anchor_hover_parent_get
+ * @since 1.8
+ *
+ * Get the parent of the hover popup
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_anchor_hover_parent_get
+ */
+#define elm_obj_entry_anchor_hover_parent_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_entry_anchor_hover_style_set
+ * @since 1.8
+ *
+ * Set the style that the hover should use
+ *
+ * @param[in] style
+ *
+ * @see elm_entry_anchor_hover_style_set
+ */
+#define elm_obj_entry_anchor_hover_style_set(style) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_SET), EO_TYPECHECK(const char *, style)
+
+/**
+ * @def elm_obj_entry_anchor_hover_style_get
+ * @since 1.8
+ *
+ * Get the style that the hover should use
+ *
+ * @param[out] ret
+ *
+ * @see elm_entry_anchor_hover_style_get
+ */
+#define elm_obj_entry_anchor_hover_style_get(ret) ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_STYLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_entry_anchor_hover_end
+ * @since 1.8
+ *
+ * Ends the hover popup in the entry
+ *
+ *
+ * @see elm_entry_anchor_hover_end
+ */
+#define elm_obj_entry_anchor_hover_end() ELM_OBJ_ENTRY_ID(ELM_OBJ_ENTRY_SUB_ID_ANCHOR_HOVER_END)
+
/**
* @}
*/
diff --git a/src/lib/elm_flip.c b/src/lib/elm_flip.c
index 246259666..74face581 100644
--- a/src/lib/elm_flip.c
+++ b/src/lib/elm_flip.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_flip.h"
+#include "elm_widget_container.h"
-EAPI const char ELM_FLIP_SMART_NAME[] = "elm_flip";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FLIP_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FLIP_CLASS
+
+#define MY_CLASS_NAME "elm_flip"
static const char SIG_ANIMATE_BEGIN[] = "animate,begin";
static const char SIG_ANIMATE_DONE[] = "animate,done";
@@ -14,10 +21,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
static Eina_Bool _flip(Evas_Object *obj);
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FLIP_SMART_NAME, _elm_flip, Elm_Flip_Smart_Class,
- Elm_Container_Smart_Class, elm_container_smart_class_get, _smart_callbacks);
-
static void
_slice_free(Slice *sl)
{
@@ -87,28 +90,43 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_flip_smart_theme(Evas_Object *obj)
+static void
+_elm_flip_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_flip_parent_sc)->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+ if (ret) *ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_flip_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_flip_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_FLIP_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_flip_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+ Elm_Flip_Smart_Data *sd = _pd;
/* attempt to cycle focus on in sub-items */
if (sd->state)
- return elm_widget_focus_next_get(sd->front.content, dir, next);
+ int_ret = elm_widget_focus_next_get(sd->front.content, dir, next);
else
- return elm_widget_focus_next_get(sd->back.content, dir, next);
+ int_ret = elm_widget_focus_next_get(sd->back.content, dir, next);
+ if (ret) *ret = int_ret;
}
static void
@@ -120,29 +138,37 @@ _changed_size_hints_cb(void *data,
_sizing_eval(data);
}
-static Eina_Bool
-_elm_flip_smart_sub_object_add(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_flip_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_flip_parent_sc)->sub_object_add(obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+ if (ret) *ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
+ if (!int_ret) return;
evas_object_data_set(sobj, "_elm_leaveme", sobj);
evas_object_smart_member_add(sobj, obj);
evas_object_event_callback_add
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_flip_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_flip_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_FLIP_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Flip_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_flip_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sobj == sd->front.content)
{
@@ -164,11 +190,11 @@ _elm_flip_smart_sub_object_del(Evas_Object *obj,
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, obj);
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Slice *
-_slice_new(Elm_Flip_Smart_Data *sd,
+_slice_new(Evas_Object *container_obj,
Evas_Object *obj)
{
Slice *sl;
@@ -178,7 +204,7 @@ _slice_new(Elm_Flip_Smart_Data *sd,
sl->obj = evas_object_image_add(evas_object_evas_get(obj));
- evas_object_smart_member_add(sl->obj, ELM_WIDGET_DATA(sd)->obj);
+ evas_object_smart_member_add(sl->obj, container_obj);
evas_object_image_smooth_scale_set(sl->obj, EINA_FALSE);
evas_object_pass_events_set(sl->obj, EINA_TRUE);
@@ -457,8 +483,9 @@ _slice_obj_vert_color_merge(Slice *s1,
}
static int
-_state_update(Elm_Flip_Smart_Data *sd)
+_state_update(Evas_Object *obj)
{
+ Elm_Flip_Smart_Data *sd = eo_data_get(obj, MY_CLASS);
Slice *sl;
Vertex3 *tvo, *tvol;
Evas_Object *front, *back;
@@ -481,7 +508,7 @@ _state_update(Elm_Flip_Smart_Data *sd)
back = sd->back.content;
}
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &x, &y, &w, &h);
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
ox = x; oy = y; ow = w; oh = h;
xx1 = sd->down_x;
yy1 = sd->down_y;
@@ -700,7 +727,7 @@ _state_update(Elm_Flip_Smart_Data *sd)
sl = sd->slices[nn];
if (!sl)
{
- sl = _slice_new(sd, front);
+ sl = _slice_new(obj, front);
sd->slices[nn] = sl;
}
_slice_xyz(sd, sl,
@@ -720,7 +747,7 @@ _state_update(Elm_Flip_Smart_Data *sd)
sl = sd->slices2[nn];
if (!sl)
{
- sl = _slice_new(sd, back);
+ sl = _slice_new(obj, back);
sd->slices2[nn] = sl;
}
@@ -1221,7 +1248,7 @@ _flip(Evas_Object *obj)
sd->x = (1.0 - t) * sd->down_x;
sd->y = sd->down_y;
_flip_show_hide(obj);
- _state_update(sd);
+ _state_update(obj);
}
else if (sd->mode == ELM_FLIP_PAGE_RIGHT)
{
@@ -1233,7 +1260,7 @@ _flip(Evas_Object *obj)
sd->x = (t) * w;
sd->y = sd->down_y;
_flip_show_hide(obj);
- _state_update(sd);
+ _state_update(obj);
}
else if (sd->mode == ELM_FLIP_PAGE_UP)
{
@@ -1245,7 +1272,7 @@ _flip(Evas_Object *obj)
sd->x = sd->down_x;
sd->y = (1.0 - t) * sd->down_y;
_flip_show_hide(obj);
- _state_update(sd);
+ _state_update(obj);
}
else if (sd->mode == ELM_FLIP_PAGE_DOWN)
{
@@ -1257,7 +1284,7 @@ _flip(Evas_Object *obj)
sd->x = sd->down_x;
sd->y = (t) * h;
_flip_show_hide(obj);
- _state_update(sd);
+ _state_update(obj);
}
else
_flip_do(obj, t, sd->mode, 0, 0);
@@ -1324,14 +1351,15 @@ _animate(void *data)
}
static double
-_pos_get(Elm_Flip_Smart_Data *sd,
+_pos_get(Evas_Object *obj,
+ Elm_Flip_Smart_Data *sd,
int *rev,
Elm_Flip_Mode *m)
{
Evas_Coord x, y, w, h;
double t = 1.0;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &x, &y, &w, &h);
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
switch (sd->intmode)
{
case ELM_FLIP_INTERACTION_ROTATE:
@@ -1436,15 +1464,15 @@ _event_anim(void *data,
{
Elm_Flip_Mode m = ELM_FLIP_ROTATE_X_CENTER_AXIS;
int rev = 0;
- p = _pos_get(sd, &rev, &m);
- _flip_do(ELM_WIDGET_DATA(sd)->obj, p, m, 1, rev);
+ p = _pos_get(sd->obj, sd, &rev, &m);
+ _flip_do(sd->obj, p, m, 1, rev);
}
break;
case ELM_FLIP_INTERACTION_PAGE:
sd->pageflip = EINA_TRUE;
- _configure(ELM_WIDGET_DATA(sd)->obj);
- _state_update(sd);
+ _configure(sd->obj);
+ _state_update(sd->obj);
break;
default:
@@ -1460,15 +1488,15 @@ _event_anim(void *data,
evas_object_resize(sd->front.content, 0, 0);
evas_object_resize(sd->back.content, 0, 0);
evas_smart_objects_calculate
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ (evas_object_evas_get(sd->obj));
// FIXME: end hack
sd->animator = NULL;
if (sd->finish) sd->state = sd->next_state;
- _flip_show_hide(ELM_WIDGET_DATA(sd)->obj);
- _configure(ELM_WIDGET_DATA(sd)->obj);
+ _flip_show_hide(sd->obj);
+ _configure(sd->obj);
sd->animator = NULL;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ANIMATE_DONE, NULL);
+ (sd->obj, SIG_ANIMATE_DONE, NULL);
return ECORE_CALLBACK_CANCEL;
}
@@ -1477,7 +1505,8 @@ static void
_update_job(void *data)
{
Elm_Flip_Mode m = ELM_FLIP_ROTATE_X_CENTER_AXIS;
- Elm_Flip_Smart_Data *sd = data;
+ Evas_Object *obj = data;
+ Elm_Flip_Smart_Data *sd = eo_data_get(obj, MY_CLASS);
int rev = 0;
double p;
@@ -1486,14 +1515,14 @@ _update_job(void *data)
{
case ELM_FLIP_INTERACTION_ROTATE:
case ELM_FLIP_INTERACTION_CUBE:
- p = _pos_get(sd, &rev, &m);
- _flip_do(ELM_WIDGET_DATA(sd)->obj, p, m, 1, rev);
+ p = _pos_get(obj, sd, &rev, &m);
+ _flip_do(obj, p, m, 1, rev);
break;
case ELM_FLIP_INTERACTION_PAGE:
sd->pageflip = EINA_TRUE;
- _configure(ELM_WIDGET_DATA(sd)->obj);
- _state_update(sd);
+ _configure(obj);
+ _state_update(obj);
break;
default:
@@ -1656,7 +1685,7 @@ _move_cb(void *data,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
if (sd->job) ecore_job_del(sd->job);
- sd->job = ecore_job_add(_update_job, sd);
+ sd->job = ecore_job_add(_update_job, fl);
}
static Eina_Bool
@@ -1719,51 +1748,56 @@ _flip_content_unset(Evas_Object *obj,
return content;
}
-static Eina_Bool
-_elm_flip_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_flip_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
+
if (!part || !strcmp(part, "front"))
- return _flip_content_set(obj, content, EINA_TRUE);
+ int_ret = _flip_content_set(obj, content, EINA_TRUE);
else if (!strcmp(part, "back"))
- return _flip_content_set(obj, content, EINA_FALSE);
+ int_ret = _flip_content_set(obj, content, EINA_FALSE);
- return EINA_FALSE;
+ if (ret) *ret = int_ret;
}
-static Evas_Object *
-_elm_flip_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_flip_smart_content_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_FLIP_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Flip_Smart_Data *sd = _pd;
+ *ret = NULL;
if (!part || !strcmp(part, "front"))
- return sd->front.content;
+ *ret = sd->front.content;
else if (!strcmp(part, "back"))
- return sd->back.content;
-
- return NULL;
+ *ret = sd->back.content;
}
-static Evas_Object *
-_elm_flip_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_flip_smart_content_unset(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Evas_Object *int_ret = NULL;
+
if (!part || !strcmp(part, "front"))
- return _flip_content_unset(obj, EINA_TRUE);
+ int_ret = _flip_content_unset(obj, EINA_TRUE);
else if (!strcmp(part, "back"))
- return _flip_content_unset(obj, EINA_FALSE);
-
- return NULL;
+ int_ret = _flip_content_unset(obj, EINA_FALSE);
+ if (ret) *ret = int_ret;
}
static void
-_elm_flip_smart_add(Evas_Object *obj)
+_elm_flip_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Flip_Smart_Data);
+ Elm_Flip_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_flip_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_static_clip_set(priv->clip, EINA_TRUE);
@@ -1803,72 +1837,55 @@ _elm_flip_smart_add(Evas_Object *obj)
}
static void
-_elm_flip_smart_del(Evas_Object *obj)
+_elm_flip_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Smart_Data *sd = _pd;
if (sd->animator) ecore_animator_del(sd->animator);
_state_slices_clear(sd);
- ELM_WIDGET_CLASS(_elm_flip_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_flip_smart_set_user(Elm_Flip_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_flip_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_flip_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_flip_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_flip_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_flip_smart_sub_object_add;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_flip_smart_sub_object_del;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_flip_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_flip_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_flip_smart_content_unset;
-}
-
-EAPI const Elm_Flip_Smart_Class *
-elm_flip_smart_class_get(void)
-{
- static Elm_Flip_Smart_Class _sc =
- ELM_FLIP_SMART_CLASS_INIT_NAME_VERSION(ELM_FLIP_SMART_NAME);
- static const Elm_Flip_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_flip_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_flip_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_flip_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Flip_Smart_Data *sd = _pd;
+ sd->obj = obj;
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Eina_Bool
elm_flip_front_visible_get(const Evas_Object *obj)
{
ELM_FLIP_CHECK(obj) EINA_FALSE;
- ELM_FLIP_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_flip_front_visible_get(&ret));
+ return ret;
+}
- return sd->state;
+static void
+_front_visible_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Flip_Smart_Data *sd = _pd;
+ *ret = sd->state;
}
EAPI void
@@ -1883,12 +1900,11 @@ elm_flip_perspective_set(Evas_Object *obj,
// FIXME: add ambient and lighting control
static void
-_elm_flip_go_to(Elm_Flip_Smart_Data *sd,
+_elm_flip_go_to(Evas_Object *obj,
+ Elm_Flip_Smart_Data *sd,
Eina_Bool front,
Elm_Flip_Mode mode)
{
- Evas_Object *obj = ELM_WIDGET_DATA(sd)->obj;
-
if (!sd->animator) sd->animator = ecore_animator_add(_animate, obj);
_flip_show_hide(obj);
@@ -1922,11 +1938,19 @@ elm_flip_go_to(Evas_Object *obj,
Elm_Flip_Mode mode)
{
ELM_FLIP_CHECK(obj);
- ELM_FLIP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_flip_go_to(front, mode));
+}
+
+static void
+_go_to(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool front = va_arg(*list, int);
+ Elm_Flip_Mode mode = va_arg(*list, Elm_Flip_Mode);
+ Elm_Flip_Smart_Data *sd = _pd;
if (sd->next_state == front) return;
- _elm_flip_go_to(sd, front, mode);
+ _elm_flip_go_to(obj, sd, front, mode);
}
EAPI void
@@ -1934,19 +1958,33 @@ elm_flip_go(Evas_Object *obj,
Elm_Flip_Mode mode)
{
ELM_FLIP_CHECK(obj);
- ELM_FLIP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_flip_go(mode));
+}
- _elm_flip_go_to(sd, !sd->state, mode);
+static void
+_go(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Flip_Mode mode = va_arg(*list, Elm_Flip_Mode);
+ Elm_Flip_Smart_Data *sd = _pd;
+
+ _elm_flip_go_to(obj, sd, !sd->state, mode);
}
EAPI void
elm_flip_interaction_set(Evas_Object *obj,
Elm_Flip_Interaction mode)
{
+ ELM_FLIP_CHECK(obj);
+ eo_do(obj, elm_obj_flip_interaction_set(mode));
+}
+
+static void
+_interaction_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Flip_Interaction mode = va_arg(*list, Elm_Flip_Interaction);
int i;
- ELM_FLIP_CHECK(obj);
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Smart_Data *sd = _pd;
if (sd->intmode == mode) return;
sd->intmode = mode;
@@ -1990,9 +2028,17 @@ EAPI Elm_Flip_Interaction
elm_flip_interaction_get(const Evas_Object *obj)
{
ELM_FLIP_CHECK(obj) ELM_FLIP_INTERACTION_NONE;
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Interaction ret = ELM_FLIP_INTERACTION_NONE;
+ eo_do((Eo *) obj, elm_obj_flip_interaction_get(&ret));
+ return ret;
+}
- return sd->intmode;
+static void
+_interaction_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Flip_Interaction *ret = va_arg(*list, Elm_Flip_Interaction *);
+ Elm_Flip_Smart_Data *sd = _pd;
+ *ret = sd->intmode;
}
EAPI void
@@ -2000,10 +2046,18 @@ elm_flip_interaction_direction_enabled_set(Evas_Object *obj,
Elm_Flip_Direction dir,
Eina_Bool enabled)
{
+ ELM_FLIP_CHECK(obj);
+ eo_do(obj, elm_obj_flip_interaction_direction_enabled_set(dir, enabled));
+}
+
+static void
+_interaction_direction_enabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Flip_Direction dir = va_arg(*list, Elm_Flip_Direction);
+ Eina_Bool enabled = va_arg(*list, int);
int i = -1;
- ELM_FLIP_CHECK(obj);
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Smart_Data *sd = _pd;
enabled = !!enabled;
if (dir == ELM_FLIP_DIRECTION_UP) i = 0;
@@ -2046,10 +2100,20 @@ EAPI Eina_Bool
elm_flip_interaction_direction_enabled_get(Evas_Object *obj,
Elm_Flip_Direction dir)
{
+ ELM_FLIP_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret;
+ eo_do(obj, elm_obj_flip_interaction_direction_enabled_get(dir, &ret));
+ return ret;
+}
+
+static void
+_interaction_direction_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Flip_Direction dir = va_arg(*list, Elm_Flip_Direction);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
int i = -1;
- ELM_FLIP_CHECK(obj) EINA_FALSE;
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Smart_Data *sd = _pd;
if (dir == ELM_FLIP_DIRECTION_UP) i = 0;
else if (dir == ELM_FLIP_DIRECTION_DOWN)
@@ -2058,8 +2122,8 @@ elm_flip_interaction_direction_enabled_get(Evas_Object *obj,
i = 2;
else if (dir == ELM_FLIP_DIRECTION_RIGHT)
i = 3;
- if (i < 0) return EINA_FALSE;
- return sd->dir_enabled[i];
+ if (i < 0) *ret = EINA_FALSE;
+ else *ret = sd->dir_enabled[i];
}
EAPI void
@@ -2067,10 +2131,18 @@ elm_flip_interaction_direction_hitsize_set(Evas_Object *obj,
Elm_Flip_Direction dir,
double hitsize)
{
+ ELM_FLIP_CHECK(obj);
+ eo_do(obj, elm_obj_flip_interaction_direction_hitsize_set(dir, hitsize));
+}
+
+static void
+_interaction_direction_hitsize_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Flip_Direction dir = va_arg(*list, Elm_Flip_Direction);
+ double hitsize = va_arg(*list, double);
int i = -1;
- ELM_FLIP_CHECK(obj);
- ELM_FLIP_DATA_GET(obj, sd);
+ Elm_Flip_Smart_Data *sd = _pd;
if (dir == ELM_FLIP_DIRECTION_UP) i = 0;
else if (dir == ELM_FLIP_DIRECTION_DOWN)
@@ -2093,9 +2165,19 @@ EAPI double
elm_flip_interaction_direction_hitsize_get(Evas_Object *obj,
Elm_Flip_Direction dir)
{
- int i = -1;
ELM_FLIP_CHECK(obj) EINA_FALSE;
- ELM_FLIP_DATA_GET(obj, sd);
+ double ret;
+ eo_do(obj, elm_obj_flip_interaction_direction_hitsize_get(dir, &ret));
+ return ret;
+}
+
+static void
+_interaction_direction_hitsize_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Flip_Direction dir = va_arg(*list, Elm_Flip_Direction);
+ double *ret = va_arg(*list, double *);
+ int i = -1;
+ Elm_Flip_Smart_Data *sd = _pd;
if (dir == ELM_FLIP_DIRECTION_UP) i = 0;
else if (dir == ELM_FLIP_DIRECTION_DOWN)
@@ -2104,6 +2186,64 @@ elm_flip_interaction_direction_hitsize_get(Evas_Object *obj,
i = 2;
else if (dir == ELM_FLIP_DIRECTION_RIGHT)
i = 3;
- if (i < 0) return 0.0;
- return sd->dir_hitsize[i];
+ if (i < 0) *ret = 0.0;
+ else *ret = sd->dir_hitsize[i];
}
+
+static void
+_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_flip_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_flip_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_flip_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_flip_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_flip_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_flip_smart_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_flip_smart_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_flip_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_flip_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_flip_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET), _front_visible_get),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO), _go),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO_TO), _go_to),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET), _interaction_set),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET), _interaction_get),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET), _interaction_direction_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET), _interaction_direction_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET), _interaction_direction_hitsize_set),
+ EO_OP_FUNC(ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET), _interaction_direction_hitsize_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET, "Get flip front visibility state"),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_PERSPECTIVE_SET, "Set flip perspective."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_GO, "Runs the flip animation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_GO_TO, "Runs the flip animation to front or back."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET, "Set the interactive flip mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET, "Get the interactive flip mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET, "Set which directions of the flip respond to interactive flip."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET, "Get the enabled state of that flip direction."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET, "Set the amount of the flip that is sensitive to interactive flip."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET, "Get the amount of the flip that is sensitive to interactive flip."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FLIP_BASE_ID, op_desc, ELM_OBJ_FLIP_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Flip_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_flip_class_get, &class_desc, ELM_OBJ_CONTAINER_CLASS, NULL);
+
diff --git a/src/lib/elm_flip.h b/src/lib/elm_flip.h
index 1e3457732..ebae36e4d 100644
--- a/src/lib/elm_flip.h
+++ b/src/lib/elm_flip.h
@@ -69,6 +69,143 @@ typedef enum
ELM_FLIP_DIRECTION_RIGHT /**< Allows interaction with the right portion of the widget */
} Elm_Flip_Direction;
+#define ELM_OBJ_FLIP_CLASS elm_obj_flip_class_get()
+
+const Eo_Class *elm_obj_flip_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FLIP_BASE_ID;
+
+enum
+{
+ ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET,
+ ELM_OBJ_FLIP_SUB_ID_PERSPECTIVE_SET,
+ ELM_OBJ_FLIP_SUB_ID_GO,
+ ELM_OBJ_FLIP_SUB_ID_GO_TO,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET,
+ ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET,
+ ELM_OBJ_FLIP_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FLIP_ID(sub_id) (ELM_OBJ_FLIP_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_flip_front_visible_get
+ * @since 1.8
+ *
+ * @brief Get flip front visibility state
+ *
+ * @param[out] ret
+ *
+ * @see elm_flip_front_visible_get
+ */
+#define elm_obj_flip_front_visible_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_FRONT_VISIBLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_flip_go_to
+ * @since 1.8
+ *
+ * @brief Runs the flip animation to front or back.
+ *
+ * @param[in] front
+ * @param[in] mode
+ *
+ * @see elm_flip_go_to
+ */
+#define elm_obj_flip_go_to(front, mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO_TO), EO_TYPECHECK(Eina_Bool, front), EO_TYPECHECK(Elm_Flip_Mode, mode)
+
+/**
+ * @def elm_obj_flip_go
+ * @since 1.8
+ *
+ * @brief Runs the flip animation
+ *
+ * @param[in] mode
+ *
+ * @see elm_flip_go
+ */
+#define elm_obj_flip_go(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_GO), EO_TYPECHECK(Elm_Flip_Mode, mode)
+
+/**
+ * @def elm_obj_flip_interaction_set
+ * @since 1.8
+ *
+ * @brief Set the interactive flip mode
+ *
+ * @param[in] mode
+ *
+ * @see elm_flip_interaction_set
+ */
+#define elm_obj_flip_interaction_set(mode) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_SET), EO_TYPECHECK(Elm_Flip_Interaction, mode)
+
+/**
+ * @def elm_obj_flip_interaction_get
+ * @since 1.8
+ *
+ * @brief Get the interactive flip mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_flip_interaction_get
+ */
+#define elm_obj_flip_interaction_get(ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_GET), EO_TYPECHECK(Elm_Flip_Interaction *, ret)
+
+/**
+ * @def elm_obj_flip_interaction_direction_enabled_set
+ * @since 1.8
+ *
+ * @brief Set which directions of the flip respond to interactive flip
+ *
+ * @param[in] dir
+ * @param[in] enabled
+ *
+ * @see elm_flip_interaction_direction_enabled_set
+ */
+#define elm_obj_flip_interaction_direction_enabled_set(dir, enabled) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_flip_interaction_direction_enabled_get
+ * @since 1.8
+ *
+ * @brief Get the enabled state of that flip direction
+ *
+ * @param[in] dir
+ * @param[out] ret
+ *
+ * @see elm_flip_interaction_direction_enabled_get
+ */
+#define elm_obj_flip_interaction_direction_enabled_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_ENABLED_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_flip_interaction_direction_hitsize_set
+ * @since 1.8
+ *
+ * @brief Set the amount of the flip that is sensitive to interactive flip
+ *
+ * @param[in] dir
+ * @param[in] hitsize
+ *
+ * @see elm_flip_interaction_direction_hitsize_set
+ */
+#define elm_obj_flip_interaction_direction_hitsize_set(dir, hitsize) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_SET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double, hitsize)
+
+/**
+ * @def elm_obj_flip_interaction_direction_hitsize_get
+ * @since 1.8
+ *
+ * @brief Get the amount of the flip that is sensitive to interactive flip
+ *
+ * @param[in] dir
+ * @param[out] ret
+ *
+ * @see elm_flip_interaction_direction_hitsize_get
+ */
+#define elm_obj_flip_interaction_direction_hitsize_get(dir, ret) ELM_OBJ_FLIP_ID(ELM_OBJ_FLIP_SUB_ID_INTERACTION_DIRECTION_HITSIZE_GET), EO_TYPECHECK(Elm_Flip_Direction, dir), EO_TYPECHECK(double *, ret)
+
/**
* @brief Add a new flip to the parent
*
@@ -88,7 +225,7 @@ EAPI Evas_Object *elm_flip_add(Evas_Object *parent);
*
* @ingroup Flip
*/
-Eina_Bool elm_flip_front_visible_get(const Evas_Object *obj);
+EAPI Eina_Bool elm_flip_front_visible_get(const Evas_Object *obj);
/**
* @brief Set flip perspective
diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c
index 1a03b9ef4..65fe02e0b 100644
--- a/src/lib/elm_flipselector.c
+++ b/src/lib/elm_flipselector.c
@@ -2,6 +2,14 @@
#include "elm_priv.h"
#include "elm_widget_flipselector.h"
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FLIPSELECTOR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FLIPSELECTOR_CLASS
+
+#define MY_CLASS_NAME "elm_flipselector"
+
/* TODO: ideally, the default theme would use map{} blocks on the TEXT
parts to implement their fading in/out propertly (as in the clock
widget) */
@@ -16,8 +24,6 @@
* bootstrapping (receiving the 1st message) and populate the downmost
* TEXT parts with the same text as the upmost, where appropriate. */
-EAPI const char ELM_FLIPSELECTOR_SMART_NAME[] = "elm_flipselector";
-
#define FLIP_FIRST_INTERVAL (0.85)
#define FLIP_MIN_INTERVAL (0.1)
#define MSG_FLIP_DOWN (1)
@@ -36,18 +42,14 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FLIPSELECTOR_SMART_NAME, _elm_flipselector,
- Elm_Flipselector_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
static void
-_elm_flipselector_smart_sizing_eval(Evas_Object *obj)
+_elm_flipselector_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
char *tmp = NULL;
Evas_Coord minw = -1, minh = -1, w, h;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->evaluating) return;
@@ -64,7 +66,7 @@ _elm_flipselector_smart_sizing_eval(Evas_Object *obj)
}
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 2, &minh);
evas_object_size_hint_min_get(obj, &w, &h);
@@ -89,6 +91,7 @@ _update_view(Evas_Object *obj)
Elm_Flipselector_Item *item;
ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
label = NULL;
item = DATA_GET(sd->current);
@@ -97,7 +100,7 @@ _update_view(Evas_Object *obj)
elm_layout_text_set(obj, "elm.top", label ? label : "");
elm_layout_text_set(obj, "elm.bottom", label ? label : "");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
static void
@@ -214,13 +217,13 @@ _flipselector_process_deletions(Elm_Flipselector_Smart_Data *sd)
if (eina_list_count(sd->items) <= 1)
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->obj, "elm,state,button,hidden", "elm");
+ (sd->obj, "elm,state,button,hidden", "elm");
else
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->obj, "elm,state,button,visible", "elm");
+ (sd->obj, "elm,state,button,visible", "elm");
}
- if (!skip) _update_view(ELM_WIDGET_DATA(sd)->obj);
+ if (!skip) _update_view(sd->obj);
if (sentinel_eval) _sentinel_eval(sd);
@@ -255,7 +258,7 @@ _on_item_changed(Elm_Flipselector_Smart_Data *sd)
item->func((void *)item->base.data, WIDGET(item), item);
if (!item->deleted)
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_SELECTED, item);
+ (sd->obj, SIG_SELECTED, item);
}
static void
@@ -264,11 +267,12 @@ _send_msg(Elm_Flipselector_Smart_Data *sd,
char *label)
{
Edje_Message_String msg;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
msg.str = label;
edje_object_message_send
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_MESSAGE_STRING, flipside, &msg);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ (wd->resize_obj, EDJE_MESSAGE_STRING, flipside, &msg);
+ edje_object_message_signal_process(wd->resize_obj);
_on_item_changed(sd);
}
@@ -348,17 +352,22 @@ _item_new(Evas_Object *obj,
return it;
}
-static Eina_Bool
-_elm_flipselector_smart_theme(Evas_Object *obj)
+static void
+_elm_flipselector_smart_theme(Eo *obj, void *_pd, va_list *list)
{
const char *max_len;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_flipselector_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- max_len = edje_object_data_get(ELM_WIDGET_DATA(sd)->resize_obj, "max_len");
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
+
+ max_len = edje_object_data_get(wd->resize_obj, "max_len");
if (!max_len) sd->max_len = MAX_LEN_DEFAULT;
else
{
@@ -370,7 +379,7 @@ _elm_flipselector_smart_theme(Evas_Object *obj)
_update_view(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -385,7 +394,7 @@ _flip_up(Elm_Flipselector_Smart_Data *sd)
{
sd->current = eina_list_last(sd->items);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_UNDERFLOWED, NULL);
+ (sd->obj, SIG_UNDERFLOWED, NULL);
}
else
sd->current = eina_list_prev(sd->current);
@@ -409,7 +418,7 @@ _flip_down(Elm_Flipselector_Smart_Data *sd)
{
sd->current = sd->items;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_OVERFLOWED, NULL);
+ (sd->obj, SIG_OVERFLOWED, NULL);
}
item = DATA_GET(sd->current);
@@ -418,28 +427,32 @@ _flip_down(Elm_Flipselector_Smart_Data *sd)
_send_msg(sd, MSG_FLIP_DOWN, (char *)item->label);
}
-static Eina_Bool
-_elm_flipselector_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_flipselector_smart_event(Eo *obj, void *_pd, va_list *list)
{
Evas_Event_Key_Down *ev;
Eina_Bool is_up = EINA_TRUE;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Flipselector_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((!strcmp(ev->keyname, "Down")) || (!strcmp(ev->keyname, "KP_Down")))
is_up = EINA_FALSE;
else if ((strcmp(ev->keyname, "Up")) && (strcmp(ev->keyname, "KP_Up")))
- return EINA_FALSE;
+ return;
if (sd->spin) ecore_timer_del(sd->spin);
sd->spin = NULL;
@@ -455,7 +468,7 @@ _elm_flipselector_smart_event(Evas_Object *obj,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Eina_Bool
@@ -538,11 +551,11 @@ _signal_val_change_stop(void *data,
}
static void
-_elm_flipselector_smart_add(Evas_Object *obj)
+_elm_flipselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Flipselector_Smart_Data);
+ Elm_Flipselector_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_flipselector_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set
(obj, "flipselector", "base", elm_widget_style_get(obj));
@@ -561,13 +574,13 @@ _elm_flipselector_smart_add(Evas_Object *obj)
elm_widget_can_focus_set(obj, EINA_TRUE);
- _elm_flipselector_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
static void
-_elm_flipselector_smart_del(Evas_Object *obj)
+_elm_flipselector_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
sd->deleting = EINA_TRUE;
@@ -578,65 +591,44 @@ _elm_flipselector_smart_del(Evas_Object *obj)
if (sd->spin) ecore_timer_del(sd->spin);
- ELM_WIDGET_CLASS(_elm_flipselector_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_flipselector_smart_set_user(Elm_Flipselector_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_flipselector_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_flipselector_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_flipselector_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_flipselector_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_flipselector_smart_sizing_eval;
-}
-
-EAPI const Elm_Flipselector_Smart_Class *
-elm_flipselector_smart_class_get(void)
-{
- static Elm_Flipselector_Smart_Class _sc =
- ELM_FLIPSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- (ELM_FLIPSELECTOR_SMART_NAME);
- static const Elm_Flipselector_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_flipselector_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_flipselector_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_flipselector_smart_class_new(), parent);
- if (!obj) return NULL;
-
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_flipselector_flip_next(Evas_Object *obj)
{
ELM_FLIPSELECTOR_CHECK(obj);
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_flipselector_flip_next());
+}
+
+static void
+_flip_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Flipselector_Smart_Data *sd = _pd;
if (sd->spin) ecore_timer_del(sd->spin);
sd->spin = NULL;
@@ -650,8 +642,13 @@ EAPI void
elm_flipselector_flip_prev(Evas_Object *obj)
{
ELM_FLIPSELECTOR_CHECK(obj);
+ eo_do(obj, elm_obj_flipselector_flip_prev());
+}
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+static void
+_flip_prev(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Flipselector_Smart_Data *sd = _pd;
if (sd->spin) ecore_timer_del(sd->spin);
sd->spin = NULL;
@@ -667,13 +664,27 @@ elm_flipselector_item_append(Evas_Object *obj,
void (*func)(void *, Evas_Object *, void *),
void *data)
{
+ Elm_Flipselector_Item *ret = NULL;
+ ELM_FLIPSELECTOR_CHECK(obj) NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_item_append(label, func, data, &ret));
+ return (Elm_Object_Item *)ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ flipselector_func_type func = va_arg(*list, flipselector_func_type);
+ void *data = va_arg(*list, void *);
+ Elm_Flipselector_Item **ret = va_arg(*list, Elm_Flipselector_Item **);
+ *ret = NULL;
+
Elm_Flipselector_Item *item;
- ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
item = _item_new(obj, label, func, data);
- if (!item) return NULL;
+ if (!item) return;
sd->items = eina_list_append(sd->items, item);
if (!sd->current)
@@ -693,7 +704,7 @@ elm_flipselector_item_append(Evas_Object *obj,
if (eina_list_count(sd->items) > 1)
elm_layout_signal_emit(obj, "elm,state,button,visible", "elm");
- return (Elm_Object_Item *)item;
+ *ret = item;
}
EAPI Elm_Object_Item *
@@ -702,13 +713,27 @@ elm_flipselector_item_prepend(Evas_Object *obj,
void (*func)(void *, Evas_Object *, void *),
void *data)
{
+ Elm_Flipselector_Item *ret = NULL;
+ ELM_FLIPSELECTOR_CHECK(obj) NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_item_prepend(label, func, data, &ret));
+ return (Elm_Object_Item *)ret;
+}
+
+static void
+_item_prepend(Eo *obj, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ flipselector_func_type func = va_arg(*list, flipselector_func_type);
+ void *data = va_arg(*list, void *);
+ Elm_Flipselector_Item **ret = va_arg(*list, Elm_Flipselector_Item **);
+ *ret = NULL;
+
Elm_Flipselector_Item *item;
- ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
item = _item_new(obj, label, func, data);
- if (!item) return NULL;
+ if (!item) return;
sd->items = eina_list_prepend(sd->items, item);
if (!sd->current)
@@ -728,65 +753,102 @@ elm_flipselector_item_prepend(Evas_Object *obj,
if (eina_list_count(sd->items) >= 2)
elm_layout_signal_emit(obj, "elm,state,button,visible", "elm");
- return (Elm_Object_Item *)item;
+ *ret = item;
}
EAPI const Eina_List *
elm_flipselector_items_get(const Evas_Object *obj)
{
ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
elm_flipselector_first_item_get(const Evas_Object *obj)
{
+ ELM_FLIPSELECTOR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_first_item_get(&ret));
+ return ret;
+}
+
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Flipselector_Item *it;
Eina_List *l;
- ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
- if (!sd->items) return NULL;
+ if (!sd->items) return;
EINA_LIST_FOREACH(sd->items, l, it)
{
if (it->deleted) continue;
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
+ return;
}
-
- return NULL;
}
EAPI Elm_Object_Item *
elm_flipselector_last_item_get(const Evas_Object *obj)
{
+ ELM_FLIPSELECTOR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_last_item_get(&ret));
+ return ret;
+}
+
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Flipselector_Item *it;
Eina_List *l;
- ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Flipselector_Smart_Data *sd = _pd;
+
- if (!sd->items) return NULL;
+ if (!sd->items) return;
EINA_LIST_REVERSE_FOREACH(sd->items, l, it)
{
if (it->deleted) continue;
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
+ return;
}
-
- return NULL;
}
EAPI Elm_Object_Item *
elm_flipselector_selected_item_get(const Evas_Object *obj)
{
ELM_FLIPSELECTOR_CHECK(obj) NULL;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_flipselector_selected_item_get(&ret));
+ return ret;
+}
- return DATA_GET(sd->current);
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ *ret = DATA_GET(sd->current);
}
EAPI void
@@ -889,8 +951,14 @@ elm_flipselector_first_interval_set(Evas_Object *obj,
double interval)
{
ELM_FLIPSELECTOR_CHECK(obj);
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_flipselector_first_interval_set(interval));
+}
+static void
+_first_interval_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double interval = va_arg(*list, double);
+ Elm_Flipselector_Smart_Data *sd = _pd;
sd->first_interval = interval;
}
@@ -898,7 +966,84 @@ EAPI double
elm_flipselector_first_interval_get(const Evas_Object *obj)
{
ELM_FLIPSELECTOR_CHECK(obj) 0;
- ELM_FLIPSELECTOR_DATA_GET(obj, sd);
+ double ret = 0;
+ eo_do((Eo *) obj, elm_obj_flipselector_first_interval_get(&ret));
+ return ret;
+}
+
+static void
+_first_interval_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Flipselector_Smart_Data *sd = _pd;
+ *ret = sd->first_interval;
+}
- return sd->first_interval;
+static void
+_elm_flipselector_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_elm_flipselector_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_flipselector_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_flipselector_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_flipselector_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_flipselector_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_flipselector_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_flipselector_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_flipselector_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT), _flip_next),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV), _flip_prev),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET), _first_interval_set),
+ EO_OP_FUNC(ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET), _first_interval_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT, "Programmatically select the next item of a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV, "Programmatically select the previous item of a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND, "Append a (text) item to a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND, "Prepend a (text) item to a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET, "Get the internal list of items in a given flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET, "Get the first item in the given flip selector widget's list of items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET, "Get the last item in the given flip selector widget's list of items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET, "Get the currently selected item in a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET, "Set the interval on time updates for a user mouse button hold on a flip selector widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET, "Get the interval on time updates for a user mouse button hold on a flip selector widget."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FLIPSELECTOR_BASE_ID, op_desc, ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Flipselector_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_flipselector_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_flipselector.h b/src/lib/elm_flipselector.h
index 8db4178d8..7f8e8ba53 100644
--- a/src/lib/elm_flipselector.h
+++ b/src/lib/elm_flipselector.h
@@ -49,6 +49,157 @@
* @li @ref flipselector_example
*/
+#define ELM_OBJ_FLIPSELECTOR_CLASS elm_obj_flipselector_class_get()
+
+const Eo_Class *elm_obj_flipselector_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FLIPSELECTOR_BASE_ID;
+
+typedef void (*flipselector_func_type)(void *, Evas_Object *, void *);
+
+enum
+{
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET,
+ ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FLIPSELECTOR_ID(sub_id) (ELM_OBJ_FLIPSELECTOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_flipselector_flip_next
+ * @since 1.8
+ *
+ * Programmatically select the next item of a flip selector widget
+ *
+ *
+ * @see elm_flipselector_flip_next
+ */
+#define elm_obj_flipselector_flip_next() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_NEXT)
+
+/**
+ * @def elm_obj_flipselector_flip_prev
+ * @since 1.8
+ *
+ * Programmatically select the previous item of a flip selector
+ *
+ *
+ * @see elm_flipselector_flip_prev
+ */
+#define elm_obj_flipselector_flip_prev() ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FLIP_PREV)
+
+
+/**
+ * @def elm_obj_flipselector_item_append
+ * @since 1.8
+ *
+ * Append a (text) item to a flip selector widget
+ *
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_flipselector_item_append
+ */
+#define elm_obj_flipselector_item_append(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret)
+
+/**
+ * @def elm_obj_flipselector_item_prepend
+ * @since 1.8
+ *
+ * Prepend a (text) item to a flip selector widget
+ *
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_flipselector_item_prepend
+ */
+#define elm_obj_flipselector_item_prepend(label, func, data, ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(flipselector_func_type, func), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Flipselector_Item **, ret)
+
+
+/**
+ * @def elm_obj_flipselector_items_get
+ * @since 1.8
+ *
+ * Get the internal list of items in a given flip selector widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_flipselector_items_get
+ */
+#define elm_obj_flipselector_items_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_flipselector_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in the given flip selector widget's list of
+ *
+ * @param[out] ret
+ *
+ * @see elm_flipselector_first_item_get
+ */
+#define elm_obj_flipselector_first_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_flipselector_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in the given flip selector widget's list of
+ *
+ * @param[out] ret
+ *
+ * @see elm_flipselector_last_item_get
+ */
+#define elm_obj_flipselector_last_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_flipselector_selected_item_get
+ * @since 1.8
+ *
+ * Get the currently selected item in a flip selector widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_flipselector_selected_item_get
+ */
+#define elm_obj_flipselector_selected_item_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_flipselector_first_interval_set
+ * @since 1.8
+ *
+ * Set the interval on time updates for a user mouse button hold
+ *
+ * @param[in] interval
+ *
+ * @see elm_flipselector_first_interval_set
+ */
+#define elm_obj_flipselector_first_interval_set(interval) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_SET), EO_TYPECHECK(double, interval)
+
+/**
+ * @def elm_obj_flipselector_first_interval_get
+ * @since 1.8
+ *
+ * Get the interval on time updates for an user mouse button hold
+ *
+ * @param[out] ret
+ *
+ * @see elm_flipselector_first_interval_get
+ */
+#define elm_obj_flipselector_first_interval_get(ret) ELM_OBJ_FLIPSELECTOR_ID(ELM_OBJ_FLIPSELECTOR_SUB_ID_FIRST_INTERVAL_GET), EO_TYPECHECK(double *, ret)
/**
* @addtogroup Flipselector
* @{
diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c
index a177f2da1..984224c8b 100644
--- a/src/lib/elm_frame.c
+++ b/src/lib/elm_frame.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_frame.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_FRAME_SMART_NAME[] = "elm_frame";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_FRAME_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_FRAME_CLASS
+
+#define MY_CLASS_NAME "elm_frame"
static const char SIG_CLICKED[] = "clicked";
@@ -10,6 +17,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CLICKED, ""},
{NULL, NULL}
};
+
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
{"default", "elm.swallow.content"},
@@ -22,18 +30,15 @@ static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_FRAME_SMART_NAME, _elm_frame, Elm_Frame_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_sizing_eval(Evas_Object *obj,
- Elm_Frame_Smart_Data *sd)
+ Elm_Frame_Smart_Data *sd EINA_UNUSED)
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
Evas_Coord cminw = -1, cminh = -1;
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_get(obj, &cminw, &cminh);
if ((minw == cminw) && (minh == cminh)) return;
@@ -41,37 +46,63 @@ _sizing_eval(Evas_Object *obj,
evas_object_size_hint_max_set(obj, -1, -1);
}
-static Eina_Bool
-_elm_frame_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_frame_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_frame_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
Evas_Object *content;
content = elm_layout_content_get(obj, NULL);
- if (!content) return EINA_FALSE;
+ if (!content) int_ret = EINA_FALSE;
- /* attempt to follow focus cycle into sub-object */
- return elm_widget_focus_next_get(content, dir, next);
+ else
+ {
+ /* attempt to follow focus cycle into sub-object */
+ int_ret = elm_widget_focus_next_get(content, dir, next);
+ }
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_frame_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_frame_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_frame_smart_focus_direction(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Evas_Object *base = va_arg(*list, const Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
Evas_Object *content;
content = elm_layout_content_get(obj, NULL);
- if (!content) return EINA_FALSE;
+ if (!content) int_ret = EINA_FALSE;
- /* Try to cycle focus on content */
- return elm_widget_focus_direction_get
- (content, base, degree, direction, weight);
+ else
+ {
+ /* Try to cycle focus on content */
+ int_ret = elm_widget_focus_direction_get
+ (content, base, degree, direction, weight);
+ }
+ if (ret) *ret = int_ret;
}
static void
@@ -89,9 +120,10 @@ _on_recalc_done(void *data,
const char *src __UNUSED__)
{
ELM_FRAME_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
evas_object_smart_callback_del
- (ELM_WIDGET_DATA(sd)->resize_obj, "recalc", _recalc);
+ (wd->resize_obj, "recalc", _recalc);
sd->anim = EINA_FALSE;
elm_layout_sizing_eval(data);
@@ -104,13 +136,14 @@ _on_frame_clicked(void *data,
const char *src __UNUSED__)
{
ELM_FRAME_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
if (sd->anim) return;
if (sd->collapsible)
{
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(sd)->resize_obj, "recalc", _recalc, data);
+ (wd->resize_obj, "recalc", _recalc, data);
elm_layout_signal_emit(data, "elm,action,toggle", "elm");
sd->collapsed++;
sd->anim = EINA_TRUE;
@@ -120,30 +153,31 @@ _on_frame_clicked(void *data,
/* using deferred sizing evaluation, just like the parent */
static void
-_elm_frame_smart_calculate(Evas_Object *obj)
+_elm_frame_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_FRAME_DATA_GET(obj, sd);
+ Elm_Frame_Smart_Data *sd = _pd;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, elm_obj_layout_class_get());
- if (ELM_LAYOUT_DATA(sd)->needs_size_calc)
+ if (ld->needs_size_calc)
{
/* calling OWN sizing evaluate code here */
_sizing_eval(obj, sd);
- ELM_LAYOUT_DATA(sd)->needs_size_calc = EINA_FALSE;
+ ld->needs_size_calc = EINA_FALSE;
}
}
static void
-_elm_frame_smart_add(Evas_Object *obj)
+_elm_frame_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Frame_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_frame_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,anim,done", "elm",
+ (wd->resize_obj, "elm,anim,done", "elm",
_on_recalc_done, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,click", "elm",
+ (wd->resize_obj, "elm,action,click", "elm",
_on_frame_clicked, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -154,50 +188,39 @@ _elm_frame_smart_add(Evas_Object *obj)
}
static void
-_elm_frame_smart_set_user(Elm_Frame_Smart_Class *sc)
+_elm_frame_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_frame_smart_add;
- ELM_WIDGET_CLASS(sc)->base.calculate = _elm_frame_smart_calculate;
-
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_frame_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_frame_smart_focus_direction;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Frame_Smart_Class *
-elm_frame_smart_class_get(void)
+static void
+_elm_frame_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Frame_Smart_Class _sc =
- ELM_FRAME_SMART_CLASS_INIT_NAME_VERSION(ELM_FRAME_SMART_NAME);
- static const Elm_Frame_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_frame_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
EAPI Evas_Object *
elm_frame_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_frame_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -205,7 +228,14 @@ elm_frame_autocollapse_set(Evas_Object *obj,
Eina_Bool autocollapse)
{
ELM_FRAME_CHECK(obj);
- ELM_FRAME_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_frame_autocollapse_set(autocollapse));
+}
+
+static void
+_autocollapse_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool autocollapse = va_arg(*list, int);
+ Elm_Frame_Smart_Data *sd = _pd;
sd->collapsible = !!autocollapse;
}
@@ -214,9 +244,18 @@ EAPI Eina_Bool
elm_frame_autocollapse_get(const Evas_Object *obj)
{
ELM_FRAME_CHECK(obj) EINA_FALSE;
- ELM_FRAME_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_frame_autocollapse_get(&ret));
+ return ret;
+}
- return sd->collapsible;
+static void
+_autocollapse_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Frame_Smart_Data *sd = _pd;
+
+ *ret = sd->collapsible;
}
EAPI void
@@ -224,13 +263,21 @@ elm_frame_collapse_set(Evas_Object *obj,
Eina_Bool collapse)
{
ELM_FRAME_CHECK(obj);
- ELM_FRAME_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_frame_collapse_set(collapse));
+}
+
+static void
+_collapse_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool collapse = va_arg(*list, int);
+ Elm_Frame_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
collapse = !!collapse;
if (sd->collapsed == collapse) return;
elm_layout_signal_emit(obj, "elm,action,switch", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
sd->collapsed = !!collapse;
sd->anim = EINA_FALSE;
@@ -242,14 +289,22 @@ elm_frame_collapse_go(Evas_Object *obj,
Eina_Bool collapse)
{
ELM_FRAME_CHECK(obj);
- ELM_FRAME_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_frame_collapse_go(collapse));
+}
+
+static void
+_collapse_go(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool collapse = va_arg(*list, int);
+ Elm_Frame_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
collapse = !!collapse;
if (sd->collapsed == collapse) return;
elm_layout_signal_emit(obj, "elm,action,toggle", "elm");
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(sd)->resize_obj, "recalc", _recalc, obj);
+ (wd->resize_obj, "recalc", _recalc, obj);
sd->collapsed = collapse;
sd->anim = EINA_TRUE;
}
@@ -258,7 +313,65 @@ EAPI Eina_Bool
elm_frame_collapse_get(const Evas_Object *obj)
{
ELM_FRAME_CHECK(obj) EINA_FALSE;
- ELM_FRAME_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_frame_collapse_get(&ret));
+ return ret;
+}
+
+static void
+_collapse_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Frame_Smart_Data *sd = _pd;
- return sd->collapsed;
+ *ret = sd->collapsed;
}
+
+static void
+_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_frame_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_frame_smart_calculate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_frame_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_frame_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_frame_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_frame_smart_focus_direction),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_frame_smart_content_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_frame_smart_text_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET), _autocollapse_set),
+ EO_OP_FUNC(ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET), _autocollapse_get),
+ EO_OP_FUNC(ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET), _collapse_set),
+ EO_OP_FUNC(ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO), _collapse_go),
+ EO_OP_FUNC(ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET), _collapse_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET, "Toggle autocollapsing of a frame."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET, "Determine autocollapsing of a frame."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET, "Manually collapse a frame without animations."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO, "Manually collapse a frame with animations."),
+ EO_OP_DESCRIPTION(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET, "Determine the collapse state of a frame."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_FRAME_BASE_ID, op_desc, ELM_OBJ_FRAME_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Frame_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_frame_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
diff --git a/src/lib/elm_frame.h b/src/lib/elm_frame.h
index 29b380937..8e9e0a39f 100644
--- a/src/lib/elm_frame.h
+++ b/src/lib/elm_frame.h
@@ -47,6 +47,85 @@
* @{
*/
+#define ELM_OBJ_FRAME_CLASS elm_obj_frame_class_get()
+
+const Eo_Class *elm_obj_frame_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_FRAME_BASE_ID;
+
+enum
+{
+ ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET,
+ ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET,
+ ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET,
+ ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO,
+ ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET,
+ ELM_OBJ_FRAME_SUB_ID_LAST
+};
+
+#define ELM_OBJ_FRAME_ID(sub_id) (ELM_OBJ_FRAME_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_frame_autocollapse_set
+ * @since 1.8
+ *
+ * @brief Toggle autocollapsing of a frame
+ *
+ * @param[in] autocollapse
+ *
+ * @see elm_frame_autocollapse_set
+ */
+#define elm_obj_frame_autocollapse_set(autocollapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_SET), EO_TYPECHECK(Eina_Bool, autocollapse)
+
+/**
+ * @def elm_obj_frame_autocollapse_get
+ * @since 1.8
+ *
+ * @brief Determine autocollapsing of a frame
+ *
+ * @param[out] ret
+ *
+ * @see elm_frame_autocollapse_get
+ */
+#define elm_obj_frame_autocollapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_AUTOCOLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_frame_collapse_set
+ * @since 1.8
+ *
+ * @brief Manually collapse a frame without animations
+ *
+ * @param[in] collapse
+ *
+ * @see elm_frame_collapse_set
+ */
+#define elm_obj_frame_collapse_set(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_SET), EO_TYPECHECK(Eina_Bool, collapse)
+
+/**
+ * @def elm_obj_frame_collapse_go
+ * @since 1.8
+ *
+ * @brief Manually collapse a frame with animations
+ *
+ * @param[in] collapse
+ *
+ * @see elm_frame_collapse_go
+ */
+#define elm_obj_frame_collapse_go(collapse) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GO), EO_TYPECHECK(Eina_Bool, collapse)
+
+/**
+ * @def elm_obj_frame_collapse_get
+ * @since 1.8
+ *
+ * @brief Determine the collapse state of a frame
+ *
+ * @param[out] ret
+ *
+ * @see elm_frame_collapse_get
+ */
+#define elm_obj_frame_collapse_get(ret) ELM_OBJ_FRAME_ID(ELM_OBJ_FRAME_SUB_ID_COLLAPSE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @brief Add a new frame to the parent
*
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 00e9ad387..798b45136 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -2,6 +2,19 @@
#include <Elementary_Cursor.h>
#include "elm_priv.h"
#include "elm_widget_gengrid.h"
+#include "elm_interface_scrollable.h"
+
+EAPI Eo_Op ELM_OBJ_GENGRID_PAN_BASE_ID = EO_NOOP;
+
+#define MY_PAN_CLASS ELM_OBJ_GENGRID_PAN_CLASS
+
+#define MY_PAN_CLASS_NAME "elm_gengrid_pan"
+
+EAPI Eo_Op ELM_OBJ_GENGRID_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_GENGRID_CLASS
+
+#define MY_CLASS_NAME "elm_gengrid"
// internally allocated
#define CLASS_ALLOCATED 0x3a70f00f
@@ -19,11 +32,6 @@ EAPI const char ELM_GENGRID_PAN_SMART_NAME[] = "elm_gengrid_pan";
#define GG_IT(_it) (_it->item)
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_LONGPRESSED[] = "longpressed";
@@ -77,15 +85,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_GENGRID_SMART_NAME, _elm_gengrid, Elm_Gengrid_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (ELM_GENGRID_PAN_SMART_NAME, _elm_gengrid_pan, Elm_Gengrid_Pan_Smart_Class,
- Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
-
static void
_calc_job(void *data)
{
@@ -156,33 +155,24 @@ _calc_job(void *data)
}
static void
-_elm_gengrid_pan_smart_add(Evas_Object *obj)
+_elm_gengrid_pan_smart_move(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- /* here just to allocate our extended data */
- EVAS_SMART_DATA_ALLOC(obj, Elm_Gengrid_Pan_Smart_Data);
-
- ELM_PAN_CLASS(_elm_gengrid_pan_parent_sc)->base.add(obj);
-}
-
-static void
-_elm_gengrid_pan_smart_move(Evas_Object *obj,
- Evas_Coord x __UNUSED__,
- Evas_Coord y __UNUSED__)
-{
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
+ va_arg(*list, Evas_Coord);
+ va_arg(*list, Evas_Coord);
if (psd->wsd->calc_job) ecore_job_del(psd->wsd->calc_job);
psd->wsd->calc_job = ecore_job_add(_calc_job, psd->wsd);
}
static void
-_elm_gengrid_pan_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_gengrid_pan_smart_resize(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
if ((ow == w) && (oh == h)) return;
@@ -363,12 +353,12 @@ _long_press_cb(void *data)
{
sd->reorder_it = it;
evas_object_raise(VIEW(it));
- sd->s_iface->hold_set(WIDGET(it), EINA_TRUE);
- sd->s_iface->bounce_allow_get
- (WIDGET(it), &(GG_IT(it)->wsd->old_h_bounce),
- &(GG_IT(it)->wsd->old_v_bounce));
+ eo_do(WIDGET(it), elm_scrollable_interface_hold_set(EINA_TRUE));
+ eo_do(WIDGET(it), elm_scrollable_interface_bounce_allow_get(
+ &(GG_IT(it)->wsd->old_h_bounce),
+ &(GG_IT(it)->wsd->old_v_bounce)));
- sd->s_iface->bounce_allow_set(WIDGET(it), EINA_FALSE, EINA_FALSE);
+ eo_do(WIDGET(it), elm_scrollable_interface_bounce_allow_set(EINA_FALSE, EINA_FALSE));
edje_object_signal_emit(VIEW(it), "elm,state,reorder,enabled", "elm");
}
@@ -511,10 +501,10 @@ _item_mouse_up_cb(void *data,
sd->calc_job =
ecore_job_add(_calc_job, sd);
- sd->s_iface->hold_set(WIDGET(it), EINA_FALSE);
- sd->s_iface->bounce_allow_set
- (WIDGET(it), GG_IT(it)->wsd->old_h_bounce,
- GG_IT(it)->wsd->old_v_bounce);
+ eo_do(WIDGET(it), elm_scrollable_interface_hold_set(EINA_FALSE));
+ eo_do(WIDGET(it), elm_scrollable_interface_bounce_allow_set(
+ GG_IT(it)->wsd->old_h_bounce,
+ GG_IT(it)->wsd->old_v_bounce));
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
}
@@ -628,11 +618,9 @@ _access_on_highlight_cb(void *data)
Elm_Gen_Item *it = (Elm_Gen_Item *)data;
ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
- ELM_GENGRID_DATA_GET(it->base.widget, sd);
-
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
+ evas_object_geometry_get(it->base.widget, &sx, &sy, &sw, &sh);
if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
elm_gengrid_item_bring_in((Elm_Object_Item *)it,
ELM_GENGRID_ITEM_SCROLLTO_IN);
@@ -1231,12 +1219,12 @@ _group_item_place(Elm_Gengrid_Pan_Smart_Data *psd)
}
static void
-_elm_gengrid_pan_smart_calculate(Evas_Object *obj)
+_elm_gengrid_pan_smart_calculate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord cx = 0, cy = 0;
Elm_Gen_Item *it;
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
if (!psd->wsd->nmax) return;
@@ -1304,15 +1292,15 @@ _elm_gengrid_pan_smart_calculate(Evas_Object *obj)
psd->wsd->move_effect_enabled = EINA_FALSE;
}
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(psd->wsd)->obj, SIG_CHANGED, NULL);
+ (psd->wobj, SIG_CHANGED, NULL);
}
static void
-_elm_gengrid_pan_smart_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_gengrid_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
psd->wsd->pan_x = x;
@@ -1321,35 +1309,35 @@ _elm_gengrid_pan_smart_pos_set(Evas_Object *obj,
}
static void
-_elm_gengrid_pan_smart_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_gengrid_pan_smart_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
static void
-_elm_gengrid_pan_smart_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_gengrid_pan_smart_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
if (w) *w = psd->wsd->minw;
if (h) *h = psd->wsd->minh;
}
static void
-_elm_gengrid_pan_smart_pos_max_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_gengrid_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
if (x)
@@ -1359,15 +1347,15 @@ _elm_gengrid_pan_smart_pos_max_get(const Evas_Object *obj,
}
static void
-_elm_gengrid_pan_smart_pos_min_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_gengrid_pan_smart_pos_min_get(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord mx = 0, my = 0;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
- ELM_GENGRID_PAN_DATA_GET(obj, psd);
+ Elm_Gengrid_Pan_Smart_Data *psd = _pd;
- _elm_gengrid_pan_smart_pos_max_get(obj, &mx, &my);
+ eo_do(obj, elm_obj_pan_pos_max_get(&mx, &my));
if (x)
*x = -mx * psd->wsd->align_x;
if (y)
@@ -1375,20 +1363,34 @@ _elm_gengrid_pan_smart_pos_min_get(const Evas_Object *obj,
}
static void
-_elm_gengrid_pan_smart_set_user(Elm_Gengrid_Pan_Smart_Class *sc)
-{
- ELM_PAN_CLASS(sc)->base.add = _elm_gengrid_pan_smart_add;
- ELM_PAN_CLASS(sc)->base.move = _elm_gengrid_pan_smart_move;
- ELM_PAN_CLASS(sc)->base.resize = _elm_gengrid_pan_smart_resize;
- ELM_PAN_CLASS(sc)->base.calculate = _elm_gengrid_pan_smart_calculate;
+_gengrid_pan_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_gengrid_pan_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_gengrid_pan_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_gengrid_pan_smart_calculate),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_gengrid_pan_smart_pos_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_gengrid_pan_smart_pos_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_gengrid_pan_smart_pos_max_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_gengrid_pan_smart_pos_min_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_gengrid_pan_smart_content_size_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Class_Description _elm_obj_gengrid_pan_class_desc = {
+ EO_VERSION,
+ MY_PAN_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ sizeof(Elm_Gengrid_Pan_Smart_Data),
+ _gengrid_pan_class_constructor,
+ NULL
+};
- ELM_PAN_CLASS(sc)->pos_set = _elm_gengrid_pan_smart_pos_set;
- ELM_PAN_CLASS(sc)->pos_get = _elm_gengrid_pan_smart_pos_get;
- ELM_PAN_CLASS(sc)->pos_max_get = _elm_gengrid_pan_smart_pos_max_get;
- ELM_PAN_CLASS(sc)->pos_min_get = _elm_gengrid_pan_smart_pos_min_get;
- ELM_PAN_CLASS(sc)->content_size_get =
- _elm_gengrid_pan_smart_content_size_get;
-}
+EO_DEFINE_CLASS(elm_obj_gengrid_pan_class_get, &_elm_obj_gengrid_pan_class_desc, ELM_OBJ_PAN_CLASS, NULL);
static Eina_Bool
_item_multi_select_left(Elm_Gengrid_Smart_Data *sd)
@@ -1607,12 +1609,16 @@ _item_single_select_right(Elm_Gengrid_Smart_Data *sd)
return EINA_TRUE;
}
-static Eina_Bool
-_elm_gengrid_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_gengrid_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord v_w = 0;
@@ -1624,17 +1630,18 @@ _elm_gengrid_smart_event(Evas_Object *obj,
Elm_Object_Item *it = NULL;
Evas_Event_Key_Down *ev = event_info;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (!sd->items) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (!sd->items) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -1645,7 +1652,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_up(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!sd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -1653,7 +1661,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_left(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
x -= step_x;
@@ -1667,7 +1676,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_down(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!sd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -1675,7 +1685,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_right(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
x += step_x;
@@ -1689,7 +1700,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_left(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!sd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -1697,7 +1709,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_up(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y -= step_y;
@@ -1711,7 +1724,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_right(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!sd->horizontal) &&
(((evas_key_modifier_is_set(ev->modifiers, "Shift")) &&
@@ -1719,7 +1733,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
|| (_item_single_select_down(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y += step_y;
@@ -1731,7 +1746,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
elm_gengrid_item_selected_set(it, EINA_TRUE);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "End")) ||
((!strcmp(ev->keyname, "KP_End")) && (!ev->string)))
@@ -1740,7 +1756,8 @@ _elm_gengrid_smart_event(Evas_Object *obj,
elm_gengrid_item_bring_in(it, ELM_GENGRID_ITEM_SCROLLTO_IN);
elm_gengrid_item_selected_set(it, EINA_TRUE);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "Prior")) ||
((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
@@ -1780,9 +1797,10 @@ _elm_gengrid_smart_event(Evas_Object *obj,
}
else if (!strcmp(ev->keyname, "Escape"))
{
- if (!_all_items_deselect(sd)) return EINA_FALSE;
+ if (!_all_items_deselect(sd)) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if (((!strcmp(ev->keyname, "Return")) ||
(!strcmp(ev->keyname, "KP_Enter")) ||
@@ -1792,38 +1810,60 @@ _elm_gengrid_smart_event(Evas_Object *obj,
it = elm_gengrid_selected_item_get(obj);
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
- return EINA_TRUE;
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_gengrid_smart_on_focus(Evas_Object *obj)
+static void
+_elm_gengrid_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Gengrid_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->on_focus(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (elm_widget_focus_get(obj) && (sd->selected) &&
(!sd->last_selected_item))
sd->last_selected_item = eina_list_data_get(sd->selected);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_gengrid_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_gengrid_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_gengrid_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_gengrid_smart_focus_next_enable;
+}
+
+static void
+_elm_gengrid_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_gengrid_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
Eina_List *items = NULL;
Elm_Gen_Item *it;
- ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Gengrid_Smart_Data *sd = _pd;
EINA_INLIST_FOREACH(sd->items, it)
{
@@ -1831,8 +1871,9 @@ _elm_gengrid_smart_focus_next(const Evas_Object *obj,
items = eina_list_append(items, it->base.access_obj);
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
static void
@@ -1843,7 +1884,7 @@ _mirrored_set(Evas_Object *obj,
ELM_GENGRID_DATA_GET(obj, sd);
- sd->s_iface->mirrored_set(obj, rtl);
+ eo_do_super(obj, elm_scrollable_interface_mirrored_set(rtl));
if (!sd->items) return;
it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
@@ -1856,15 +1897,19 @@ _mirrored_set(Evas_Object *obj,
}
}
-static Eina_Bool
-_elm_gengrid_smart_theme(Evas_Object *obj)
+static void
+_elm_gengrid_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -2104,7 +2149,7 @@ _elm_gengrid_clear(Evas_Object *obj,
sd->clear_me = EINA_TRUE;
return;
}
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(obj));
for (l = sd->items, next = l ? l->next : NULL;
l;
l = next, next = next ? next->next : NULL)
@@ -2141,9 +2186,9 @@ _elm_gengrid_clear(Evas_Object *obj,
evas_object_size_hint_min_set(sd->pan_obj, sd->minw, sd->minh);
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
}
- sd->s_iface->content_region_show(obj, 0, 0, 0, 0);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ eo_do(obj, elm_scrollable_interface_content_region_show(0, 0, 0, 0));
+ evas_event_thaw(evas_object_evas_get(obj));
+ evas_event_thaw_eval(evas_object_evas_get(obj));
}
static void
@@ -2201,7 +2246,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Smart_Data *sd,
if (!itc) return NULL;
- it = elm_widget_item_new(ELM_WIDGET_DATA(sd)->obj, Elm_Gen_Item);
+ it = elm_widget_item_new(sd->obj, Elm_Gen_Item);
if (!it) return NULL;
it->generation = sd->generation;
@@ -2237,20 +2282,21 @@ _elm_gengrid_item_new(Elm_Gengrid_Smart_Data *sd,
/* common layout sizing won't apply here */
static void
-_elm_gengrid_smart_sizing_eval(Evas_Object *obj __UNUSED__)
+_elm_gengrid_smart_sizing_eval(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
return; /* no-op */
}
static void
-_elm_gengrid_smart_add(Evas_Object *obj)
+_elm_gengrid_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
Elm_Gengrid_Pan_Smart_Data *pan_data;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Gengrid_Smart_Data);
+ Elm_Gengrid_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_smart_member_add(priv->hit_rect, obj);
@@ -2269,84 +2315,82 @@ _elm_gengrid_smart_add(Evas_Object *obj)
elm_layout_theme_set(obj, "gengrid", "base", elm_widget_style_get(obj));
- /* interface's add() routine issued AFTER the object's smart_add() */
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
priv->old_h_bounce = bounce;
priv->old_v_bounce = bounce;
- priv->s_iface->bounce_allow_set(obj, bounce, bounce);
-
- priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
- priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
- priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
- priv->s_iface->edge_left_cb_set(obj, _edge_left_cb);
- priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
- priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
- priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
- priv->s_iface->scroll_cb_set(obj, _scroll_cb);
+
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(bounce, bounce));
+
+ eo_do(obj,
+ elm_scrollable_interface_animate_start_cb_set(_scroll_animate_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_animate_stop_cb),
+ elm_scrollable_interface_drag_start_cb_set(_scroll_drag_start_cb),
+ elm_scrollable_interface_drag_stop_cb_set(_scroll_drag_stop_cb),
+ elm_scrollable_interface_edge_left_cb_set(_edge_left_cb),
+ elm_scrollable_interface_edge_right_cb_set(_edge_right_cb),
+ elm_scrollable_interface_edge_top_cb_set(_edge_top_cb),
+ elm_scrollable_interface_edge_bottom_cb_set(_edge_bottom_cb),
+ elm_scrollable_interface_scroll_cb_set(_scroll_cb));
priv->align_x = 0.5;
priv->align_y = 0.5;
priv->highlight = EINA_TRUE;
- priv->pan_obj = evas_object_smart_add
- (evas_object_evas_get(obj), _elm_gengrid_pan_smart_class_new());
- pan_data = evas_object_smart_data_get(priv->pan_obj);
+ priv->pan_obj = eo_add(MY_PAN_CLASS, evas_object_evas_get(obj));
+ pan_data = eo_data_get(priv->pan_obj, MY_PAN_CLASS);
+ pan_data->wobj = obj;
pan_data->wsd = priv;
- priv->s_iface->extern_pan_set(obj, priv->pan_obj);
+ eo_do(obj, elm_scrollable_interface_extern_pan_set(priv->pan_obj));
}
static void
-_elm_gengrid_smart_del(Evas_Object *obj)
+_elm_gengrid_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Gengrid_Smart_Data *sd = _pd;
elm_gengrid_clear(obj);
+ eo_unref(sd->pan_obj);
evas_object_del(sd->pan_obj);
sd->pan_obj = NULL;
if (sd->calc_job) ecore_job_del(sd->calc_job);
- ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_gengrid_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_gengrid_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENGRID_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_gengrid_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_gengrid_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENGRID_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_gengrid_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_gengrid_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENGRID_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_gengrid_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
@@ -2368,78 +2412,36 @@ _access_obj_process(Elm_Gengrid_Smart_Data * sd, Eina_Bool is_access)
}
static void
-_elm_gengrid_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_gengrid_smart_access(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_gengrid_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
-
- _access_obj_process(sd, is_access);
-}
-
-static void
-_elm_gengrid_smart_set_user(Elm_Gengrid_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_gengrid_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_gengrid_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_gengrid_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_gengrid_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_gengrid_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_gengrid_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_gengrid_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_gengrid_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_gengrid_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_gengrid_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_gengrid_smart_access;
-}
-
-EAPI const Elm_Gengrid_Smart_Class *
-elm_gengrid_smart_class_get(void)
-{
- static Elm_Gengrid_Smart_Class _sc =
- ELM_GENGRID_SMART_CLASS_INIT_NAME_VERSION(ELM_GENGRID_SMART_NAME);
- static const Elm_Gengrid_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_gengrid_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ _elm_gengrid_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(sd, _elm_gengrid_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_gengrid_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_gengrid_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ sd->obj = obj;
+
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -2448,7 +2450,15 @@ elm_gengrid_item_size_set(Evas_Object *obj,
Evas_Coord h)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_item_size_set(w, h));
+}
+
+static void
+_item_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if ((sd->item_width == w) && (sd->item_height == h)) return;
sd->item_width = w;
@@ -2463,7 +2473,15 @@ elm_gengrid_item_size_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_gengrid_item_size_get(w, h));
+}
+
+static void
+_item_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if (w) *w = sd->item_width;
if (h) *h = sd->item_height;
@@ -2475,7 +2493,15 @@ elm_gengrid_group_item_size_set(Evas_Object *obj,
Evas_Coord h)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_group_item_size_set(w, h));
+}
+
+static void
+_group_item_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if ((sd->group_item_width == w) && (sd->group_item_height == h)) return;
sd->group_item_width = w;
@@ -2490,7 +2516,15 @@ elm_gengrid_group_item_size_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_gengrid_group_item_size_get(w, h));
+}
+
+static void
+_group_item_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if (w) *w = sd->group_item_width;
if (h) *h = sd->group_item_height;
@@ -2501,10 +2535,18 @@ elm_gengrid_align_set(Evas_Object *obj,
double align_x,
double align_y)
{
+ ELM_GENGRID_CHECK(obj);
+ eo_do(obj, elm_obj_gengrid_align_set(align_x, align_y));
+}
+
+static void
+_align_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
double old_h, old_y;
- ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ double align_x = va_arg(*list, double);
+ double align_y = va_arg(*list, double);
+ Elm_Gengrid_Smart_Data *sd = _pd;
old_h = sd->align_x;
old_y = sd->align_y;
@@ -2531,7 +2573,15 @@ elm_gengrid_align_get(const Evas_Object *obj,
double *align_y)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_gengrid_align_get(align_x, align_y));
+}
+
+static void
+_align_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *align_x = va_arg(*list, double *);
+ double *align_y = va_arg(*list, double *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if (align_x) *align_x = sd->align_x;
if (align_y) *align_y = sd->align_y;
@@ -2544,13 +2594,27 @@ elm_gengrid_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENGRID_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_gengrid_item_append(itc, data, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Elm_Gengrid_Item_Class *itc = va_arg(*list, const Elm_Gengrid_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ *ret = NULL;
it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_inlist_append(sd->items, EINA_INLIST_GET(it));
it->position = eina_inlist_count(sd->items);
@@ -2562,7 +2626,7 @@ elm_gengrid_item_append(Evas_Object *obj,
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2572,13 +2636,27 @@ elm_gengrid_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENGRID_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_gengrid_item_prepend(itc, data, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Elm_Gengrid_Item_Class *itc = va_arg(*list, const Elm_Gengrid_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Gengrid_Smart_Data *sd = _pd;
it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(it));
_item_position_update(sd->items, 0);
@@ -2589,7 +2667,7 @@ elm_gengrid_item_prepend(Evas_Object *obj,
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2600,15 +2678,30 @@ elm_gengrid_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENGRID_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_gengrid_item_insert_before(itc, data, relative, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
Eina_Inlist *tmp;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL);
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Elm_Gengrid_Item_Class *itc = va_arg(*list, const Elm_Gengrid_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *relative = va_arg(*list, Elm_Object_Item *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ ELM_GENGRID_ITEM_CHECK(relative);
+ Elm_Gengrid_Smart_Data *sd = _pd;
it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_inlist_prepend_relative
(sd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET((Elm_Gen_Item *)relative));
@@ -2622,7 +2715,7 @@ elm_gengrid_item_insert_before(Evas_Object *obj,
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2633,15 +2726,30 @@ elm_gengrid_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENGRID_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_gengrid_item_insert_after(itc, data, relative, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
Eina_Inlist *tmp;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_ITEM_CHECK_OR_RETURN(relative, NULL);
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Elm_Gengrid_Item_Class *itc = va_arg(*list, const Elm_Gengrid_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *relative = va_arg(*list, Elm_Object_Item *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ ELM_GENGRID_ITEM_CHECK(relative);
+ Elm_Gengrid_Smart_Data *sd = _pd;
it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_inlist_append_relative
(sd->items, EINA_INLIST_GET(it),
EINA_INLIST_GET((Elm_Gen_Item *)relative));
@@ -2655,7 +2763,7 @@ elm_gengrid_item_insert_after(Evas_Object *obj,
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2666,13 +2774,28 @@ elm_gengrid_item_sorted_insert(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENGRID_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_gengrid_item_sorted_insert(itc, data, comp, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_sorted_insert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Elm_Gengrid_Item_Class *itc = va_arg(*list, const Elm_Gengrid_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Eina_Compare_Cb comp = va_arg(*list, Eina_Compare_Cb);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Gengrid_Smart_Data *sd = _pd;
it = _elm_gengrid_item_new(sd, itc, data, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
if (!sd->state)
{
@@ -2688,7 +2811,7 @@ elm_gengrid_item_sorted_insert(Evas_Object *obj,
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI void
@@ -2696,7 +2819,14 @@ elm_gengrid_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Gengrid_Smart_Data *sd = _pd;
horizontal = !!horizontal;
if (horizontal == sd->horizontal) return;
@@ -2711,16 +2841,30 @@ EAPI Eina_Bool
elm_gengrid_horizontal_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gengrid_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+
+ *ret = sd->horizontal;
}
EAPI void
elm_gengrid_clear(Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj);
+ eo_do(obj, elm_obj_gengrid_clear());
+}
+static void
+_clear(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
_elm_gengrid_clear(obj, EINA_FALSE);
}
@@ -2790,7 +2934,14 @@ elm_gengrid_multi_select_set(Evas_Object *obj,
Eina_Bool multi)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_multi_select_set(multi));
+}
+
+static void
+_multi_select_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool multi = va_arg(*list, int);
+ Elm_Gengrid_Smart_Data *sd = _pd;
sd->multi = !!multi;
}
@@ -2799,28 +2950,55 @@ EAPI Eina_Bool
elm_gengrid_multi_select_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gengrid_multi_select_get(&ret));
+ return ret;
+}
+
+static void
+_multi_select_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- return sd->multi;
+ *ret = sd->multi;
}
EAPI Elm_Object_Item *
elm_gengrid_selected_item_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_gengrid_selected_item_get(&ret));
+ return ret;
+}
- if (sd->selected) return sd->selected->data;
- return NULL;
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ *ret = NULL;
+
+ if (sd->selected) *ret = sd->selected->data;
}
EAPI const Eina_List *
elm_gengrid_selected_items_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_gengrid_selected_items_get(&ret));
+ return ret;
+}
+
+static void
+_selected_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- return sd->selected;
+ *ret = sd->selected;
}
EAPI void
@@ -2868,27 +3046,40 @@ elm_gengrid_item_selected_get(const Elm_Object_Item *it)
EAPI Eina_List *
elm_gengrid_realized_items_get(const Evas_Object *obj)
{
- Eina_List *list = NULL;
+ ELM_GENGRID_CHECK(obj) NULL;
+ Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_gengrid_realized_items_get(&ret));
+ return ret;
+}
+
+static void
+_realized_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ *ret = NULL;
EINA_INLIST_FOREACH(sd->items, it)
{
- if (it->realized) list = eina_list_append(list, (Elm_Object_Item *)it);
+ if (it->realized) *ret = eina_list_append(*ret, (Elm_Object_Item *)it);
}
- return list;
}
EAPI void
elm_gengrid_realized_items_update(Evas_Object *obj)
{
+ ELM_GENGRID_CHECK(obj);
+ eo_do(obj, elm_obj_gengrid_realized_items_update());
+}
+
+static void
+_realized_items_update(Eo *obj, void *_pd EINA_UNUSED, va_list *list_unused EINA_UNUSED)
+{
Eina_List *list, *l;
Elm_Object_Item *it;
- ELM_GENGRID_CHECK(obj);
-
list = elm_gengrid_realized_items_get(obj);
EINA_LIST_FOREACH(list, l, it)
elm_gengrid_item_update(it);
@@ -3081,7 +3272,14 @@ elm_gengrid_reorder_mode_set(Evas_Object *obj,
Eina_Bool reorder_mode)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_reorder_mode_set(reorder_mode));
+}
+
+static void
+_reorder_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool reorder_mode = va_arg(*list, int);
+ Elm_Gengrid_Smart_Data *sd = _pd;
sd->reorder_mode = !!reorder_mode;
}
@@ -3090,9 +3288,18 @@ EAPI Eina_Bool
elm_gengrid_reorder_mode_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gengrid_reorder_mode_get(&ret));
+ return ret;
+}
+
+static void
+_reorder_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- return sd->reorder_mode;
+ *ret = sd->reorder_mode;
}
EAPI void
@@ -3101,9 +3308,15 @@ elm_gengrid_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
+}
- sd->s_iface->bounce_allow_set(obj, !!h_bounce, !!v_bounce);
+static void
+_bounce_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool h_bounce = va_arg(*list, int);
+ Eina_Bool v_bounce = va_arg(*list, int);
+ eo_do_super(obj, elm_scrollable_interface_bounce_allow_set(!!h_bounce, !!v_bounce));
}
EAPI void
@@ -3112,9 +3325,7 @@ elm_gengrid_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- sd->s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -3122,15 +3333,22 @@ elm_gengrid_page_relative_set(Evas_Object *obj,
double h_pagerel,
double v_pagerel)
{
+ ELM_GENGRID_CHECK(obj);
+ eo_do(obj, elm_obj_gengrid_page_relative_set(h_pagerel, v_pagerel));
+}
+
+static void
+_page_relative_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
Evas_Coord pagesize_h;
Evas_Coord pagesize_v;
- ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ double h_pagerel = va_arg(*list, double);
+ double v_pagerel = va_arg(*list, double);
- sd->s_iface->paging_get(obj, NULL, NULL, &pagesize_h, &pagesize_v);
- sd->s_iface->paging_set
- (obj, h_pagerel, v_pagerel, pagesize_h, pagesize_v);
+ eo_do((Eo *) obj, elm_scrollable_interface_paging_get(NULL, NULL, &pagesize_h, &pagesize_v));
+ eo_do((Eo *) obj, elm_scrollable_interface_paging_set
+ (h_pagerel, v_pagerel, pagesize_h, pagesize_v));
}
EAPI void
@@ -3139,9 +3357,16 @@ elm_gengrid_page_relative_get(const Evas_Object *obj,
double *v_pagerel)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_gengrid_page_relative_get(h_pagerel, v_pagerel));
+}
+
+static void
+_page_relative_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double *h_pagerel = va_arg(*list, double *);
+ double *v_pagerel = va_arg(*list, double *);
- sd->s_iface->paging_get(obj, h_pagerel, v_pagerel, NULL, NULL);
+ eo_do((Eo *) obj, elm_scrollable_interface_paging_get(h_pagerel, v_pagerel, NULL, NULL));
}
EAPI void
@@ -3149,15 +3374,22 @@ elm_gengrid_page_size_set(Evas_Object *obj,
Evas_Coord h_pagesize,
Evas_Coord v_pagesize)
{
+ ELM_GENGRID_CHECK(obj);
+ eo_do(obj, elm_obj_gengrid_page_size_set(h_pagesize, v_pagesize));
+}
+
+static void
+_page_size_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
double pagerel_h;
double pagerel_v;
- ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ Evas_Coord h_pagesize = va_arg(*list, Evas_Coord);
+ Evas_Coord v_pagesize = va_arg(*list, Evas_Coord);
- sd->s_iface->paging_get(obj, &pagerel_h, &pagerel_v, NULL, NULL);
- sd->s_iface->paging_set
- (obj, pagerel_h, pagerel_v, h_pagesize, v_pagesize);
+ eo_do((Eo *) obj, elm_scrollable_interface_paging_get(&pagerel_h, &pagerel_v, NULL, NULL));
+ eo_do((Eo *) obj, elm_scrollable_interface_paging_set
+ (pagerel_h, pagerel_v, h_pagesize, v_pagesize));
}
EAPI void
@@ -3166,9 +3398,7 @@ elm_gengrid_current_page_get(const Evas_Object *obj,
int *v_pagenumber)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- sd->s_iface->current_page_get(obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_current_page_get(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -3177,9 +3407,7 @@ elm_gengrid_last_page_get(const Evas_Object *obj,
int *v_pagenumber)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- sd->s_iface->last_page_get(obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_last_page_get(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -3188,9 +3416,7 @@ elm_gengrid_page_show(const Evas_Object *obj,
int v_pagenumber)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- sd->s_iface->page_show((Evas_Object *)obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_page_show(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -3199,9 +3425,7 @@ elm_gengrid_page_bring_in(const Evas_Object *obj,
int v_pagenumber)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
-
- sd->s_iface->page_bring_in((Evas_Object *)obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_page_bring_in(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -3210,13 +3434,20 @@ elm_gengrid_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_v)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Scroller_Policy policy_h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy policy_v = va_arg(*list, Elm_Scroller_Policy);
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
return;
- sd->s_iface->policy_set(obj, policy_h, policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
}
EAPI void
@@ -3224,12 +3455,19 @@ elm_gengrid_scroller_policy_get(const Evas_Object *obj,
Elm_Scroller_Policy *policy_h,
Elm_Scroller_Policy *policy_v)
{
+ ELM_GENGRID_CHECK(obj);
+ eo_do((Eo *) obj, elm_scrollable_interface_policy_get(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
Elm_Scroller_Policy s_policy_h, s_policy_v;
- ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Scroller_Policy *policy_h = va_arg(*list, Elm_Scroller_Policy *);
+ Elm_Scroller_Policy *policy_v = va_arg(*list, Elm_Scroller_Policy *);
- sd->s_iface->policy_get(obj, &s_policy_h, &s_policy_v);
+ eo_do_super((Eo *)obj, elm_scrollable_interface_policy_get(&s_policy_h, &s_policy_v));
if (policy_h) *policy_h = (Elm_Scroller_Policy)s_policy_h;
if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v;
}
@@ -3238,31 +3476,51 @@ EAPI Elm_Object_Item *
elm_gengrid_first_item_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_gengrid_first_item_get(&ret));
+ return ret;
+}
- if (!sd->items) return NULL;
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Gengrid_Smart_Data *sd = _pd;
+
+ if (!sd->items) return;
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
while ((it) && (it->generation < sd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
elm_gengrid_last_item_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) NULL;
- ELM_GENGRID_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_gengrid_last_item_get(&ret));
+ return ret;
+}
- if (!sd->items) return NULL;
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+ *ret = NULL;
+
+ if (!sd->items) return;
Elm_Gen_Item *it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
while ((it) && (it->generation < sd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -3309,7 +3567,7 @@ elm_gengrid_item_show(Elm_Object_Item *item,
sd = GG_IT(it)->wsd;
if ((it->generation < sd->generation)) return;
- _elm_gengrid_pan_smart_pos_min_get(sd->pan_obj, &minx, &miny);
+ eo_do(sd->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (type == ELM_GENGRID_ITEM_SCROLLTO_IN)
{
@@ -3317,16 +3575,16 @@ elm_gengrid_item_show(Elm_Object_Item *item,
}
if (sd->horizontal)
- sd->s_iface->content_region_show
- (WIDGET(it), ((it->x - GG_IT(it)->prev_group) * sd->item_width)
+ eo_do(WIDGET(it), elm_scrollable_interface_content_region_show(
+ ((it->x - GG_IT(it)->prev_group) * sd->item_width)
+ (GG_IT(it)->prev_group * sd->group_item_width) + minx,
- it->y * sd->item_height + miny, sd->item_width, sd->item_height);
+ it->y * sd->item_height + miny, sd->item_width, sd->item_height));
else
- sd->s_iface->content_region_show
- (WIDGET(it), it->x * sd->item_width + minx,
+ eo_do(WIDGET(it), elm_scrollable_interface_content_region_show(
+ it->x * sd->item_width + minx,
((it->y - GG_IT(it)->prev_group) * sd->item_height) +
(GG_IT(it)->prev_group * sd->group_item_height) + miny,
- sd->item_width, sd->item_height);
+ sd->item_width, sd->item_height));
}
EAPI void
@@ -3342,7 +3600,7 @@ elm_gengrid_item_bring_in(Elm_Object_Item *item,
if (it->generation < sd->generation) return;
- _elm_gengrid_pan_smart_pos_min_get(sd->pan_obj, &minx, &miny);
+ eo_do(sd->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (type == ELM_GENGRID_ITEM_SCROLLTO_IN)
{
@@ -3350,16 +3608,16 @@ elm_gengrid_item_bring_in(Elm_Object_Item *item,
}
if (sd->horizontal)
- sd->s_iface->region_bring_in
- (WIDGET(it), ((it->x - GG_IT(it)->prev_group) * sd->item_width)
+ eo_do(WIDGET(it), elm_scrollable_interface_region_bring_in(
+ ((it->x - GG_IT(it)->prev_group) * sd->item_width)
+ (GG_IT(it)->prev_group * sd->group_item_width) + minx,
- it->y * sd->item_height + miny, sd->item_width, sd->item_height);
+ it->y * sd->item_height + miny, sd->item_width, sd->item_height));
else
- sd->s_iface->region_bring_in
- (WIDGET(it), it->x * sd->item_width + minx,
+ eo_do(WIDGET(it), elm_scrollable_interface_region_bring_in(
+ it->x * sd->item_width + minx,
((it->y - GG_IT(it)->prev_group) * sd->item_height)
+ (GG_IT(it)->prev_group * sd->group_item_height)
- + miny, sd->item_width, sd->item_height);
+ + miny, sd->item_width, sd->item_height));
}
EAPI void
@@ -3367,7 +3625,14 @@ elm_gengrid_filled_set(Evas_Object *obj,
Eina_Bool fill)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_filled_set(fill));
+}
+
+static void
+_filled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool fill = va_arg(*list, int);
+ Elm_Gengrid_Smart_Data *sd = _pd;
fill = !!fill;
if (sd->filled != fill)
@@ -3378,18 +3643,36 @@ EAPI Eina_Bool
elm_gengrid_filled_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gengrid_filled_get(&ret));
+ return ret;
+}
- return sd->filled;
+static void
+_filled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+
+ *ret = sd->filled;
}
EAPI unsigned int
elm_gengrid_items_count(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) 0;
- ELM_GENGRID_DATA_GET(obj, sd);
+ unsigned int ret = 0;
+ eo_do((Eo *) obj, elm_obj_gengrid_items_count(&ret));
+ return ret;
+}
- return sd->item_count;
+static void
+_items_count(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+
+ *ret = sd->item_count;
}
EAPI Elm_Gengrid_Item_Class *
@@ -3447,7 +3730,14 @@ elm_gengrid_select_mode_set(Evas_Object *obj,
Elm_Object_Select_Mode mode)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_select_mode_set(mode));
+}
+
+static void
+_select_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode mode = va_arg(*list, Elm_Object_Select_Mode);
+ Elm_Gengrid_Smart_Data *sd = _pd;
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
return;
@@ -3460,9 +3750,18 @@ EAPI Elm_Object_Select_Mode
elm_gengrid_select_mode_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) ELM_OBJECT_SELECT_MODE_MAX;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Elm_Object_Select_Mode ret = ELM_OBJECT_SELECT_MODE_MAX;
+ eo_do((Eo *) obj, elm_obj_gengrid_select_mode_get(&ret));
+ return ret;
+}
+
+static void
+_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
- return sd->select_mode;
+ *ret = sd->select_mode;
}
EAPI void
@@ -3470,7 +3769,14 @@ elm_gengrid_highlight_mode_set(Evas_Object *obj,
Eina_Bool highlight)
{
ELM_GENGRID_CHECK(obj);
- ELM_GENGRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gengrid_highlight_mode_set(highlight));
+}
+
+static void
+_highlight_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool highlight = va_arg(*list, int);
+ Elm_Gengrid_Smart_Data *sd = _pd;
sd->highlight = !!highlight;
}
@@ -3479,9 +3785,18 @@ EAPI Eina_Bool
elm_gengrid_highlight_mode_get(const Evas_Object *obj)
{
ELM_GENGRID_CHECK(obj) EINA_FALSE;
- ELM_GENGRID_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gengrid_highlight_mode_get(&ret));
+ return ret;
+}
- return sd->highlight;
+static void
+_highlight_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gengrid_Smart_Data *sd = _pd;
+
+ *ret = sd->highlight;
}
EAPI int
@@ -3544,3 +3859,119 @@ elm_gengrid_nth_item_get(const Evas_Object *obj, unsigned int nth)
eina_accessor_free(a);
return (Elm_Object_Item *)it;
}
+
+static void
+_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_MEMBER_ADD), _elm_gengrid_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_gengrid_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_gengrid_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_gengrid_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_gengrid_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_gengrid_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_gengrid_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_gengrid_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_gengrid_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_gengrid_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_gengrid_smart_access),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_gengrid_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_gengrid_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET), _bounce_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _scroller_policy_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET), _scroller_policy_get),
+
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET), _item_size_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET), _item_size_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET), _group_item_size_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET), _group_item_size_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET), _align_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET), _align_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT), _item_sorted_insert),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET), _multi_select_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET), _multi_select_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET), _selected_items_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET), _realized_items_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE), _realized_items_update),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET), _reorder_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET), _reorder_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET), _page_relative_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET), _page_relative_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET), _page_size_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_SET), _filled_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_GET), _filled_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT), _items_count),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET), _select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET), _select_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET), _highlight_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET), _highlight_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET, "Set the size for the items of a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET, "Get the size set for the items of a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET, "Set the size for the group items of a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET, "Get the size set for the group items of a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET, "Set the items grid's alignment within a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET, "Get the items grid's alignment values within a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND, "Append a new item in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND, "Prepend a new item in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE, "Insert an item before another in a gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER, "Insert an item after another in a gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT, "Insert an item in a gengrid widget using a user-defined sort function."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET, "Set the direction in which a given gengrid widget will expand while placing its items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET, "Get for what direction a given gengrid widget will expand while placing its items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_CLEAR, "Remove all items from a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET, "Enable or disable multi-selection in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET, "Get whether multi-selection is enabled or disabled for a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET, "Get the selected item in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET, "Get a list of selected items in a given gengrid."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET, "Get a list of realized items in gengrid."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE, "Update the contents of all realized items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET, "Set whether a given gengrid widget is or not able have items reordered."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET, "Get whether a given gengrid widget is or not able have items reordered."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET, "EINA_DEPRECATED Set a given gengrid widget's scrolling page size, relative to its viewport size."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET, "EINA_DEPRECATED Get a given gengrid widget's scrolling page size, relative to its viewport size."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET, "EINA_DEPRECATED Set a given gengrid widget's scrolling page size"),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET, "Get the first item in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET, "Get the last item in a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_FILLED_SET, "Set how the items grid's filled within a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_FILLED_GET, "Get how the items grid's filled within a given gengrid widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT, "Return how many items are currently in a list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET, "Set the gengrid select mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET, "Get the gengrid select mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET, "Set whether the gengrid items should be highlighted when item selected."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET, "Get whether the gengrid items should be highlighted when item selected."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_GENGRID_BASE_ID, op_desc, ELM_OBJ_GENGRID_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Gengrid_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_gengrid_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, ELM_SCROLLABLE_INTERFACE, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_gengrid.h b/src/lib/elm_gengrid.h
index b9813c134..15e9494b4 100644
--- a/src/lib/elm_gengrid.h
+++ b/src/lib/elm_gengrid.h
@@ -234,6 +234,607 @@
* @li @ref gengrid_example
*/
+#define ELM_OBJ_GENGRID_PAN_CLASS elm_obj_gengrid_pan_class_get()
+
+const Eo_Class *elm_obj_gengrid_pan_class_get(void) EINA_CONST;
+
+#define ELM_OBJ_GENGRID_CLASS elm_obj_gengrid_class_get()
+
+const Eo_Class *elm_obj_gengrid_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_GENGRID_BASE_ID;
+
+enum
+{
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET,
+ ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT,
+ ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_GENGRID_SUB_ID_CLEAR,
+ ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET,
+ ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET,
+ ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET,
+ ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET,
+ ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE,
+ ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_GENGRID_SUB_ID_FILLED_SET,
+ ELM_OBJ_GENGRID_SUB_ID_FILLED_GET,
+ ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT,
+ ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET,
+ ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET,
+ ELM_OBJ_GENGRID_SUB_ID_LAST
+};
+
+#define ELM_OBJ_GENGRID_ID(sub_id) (ELM_OBJ_GENGRID_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_gengrid_item_size_set
+ * @since 1.8
+ *
+ * Set the size for the items of a given gengrid widget
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_gengrid_item_size_set
+ */
+#define elm_obj_gengrid_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+
+/**
+ * @def elm_obj_gengrid_item_size_get
+ * @since 1.8
+ *
+ * Get the size set for the items of a given gengrid widget
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_gengrid_item_size_get
+ */
+#define elm_obj_gengrid_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+/**
+ * @def elm_obj_gengrid_group_item_size_set
+ * @since 1.8
+ *
+ * Set the size for the group items of a given gengrid widget
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_gengrid_group_item_size_set
+ */
+#define elm_obj_gengrid_group_item_size_set(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+
+/**
+ * @def elm_obj_gengrid_group_item_size_get
+ * @since 1.8
+ *
+ * Get the size set for the group items of a given gengrid widget
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_gengrid_group_item_size_get
+ */
+#define elm_obj_gengrid_group_item_size_get(w, h) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_GROUP_ITEM_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+/**
+ * @def elm_obj_gengrid_align_set
+ * @since 1.8
+ *
+ * Set the items grid's alignment within a given gengrid widget
+ *
+ * @param[in] align_x
+ * @param[in] align_y
+ *
+ * @see elm_gengrid_align_set
+ */
+#define elm_obj_gengrid_align_set(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, align_x), EO_TYPECHECK(double, align_y)
+
+/**
+ * @def elm_obj_gengrid_align_get
+ * @since 1.8
+ *
+ * Get the items grid's alignment values within a given gengrid
+ *
+ * @param[out] align_x
+ * @param[out] align_y
+ *
+ * @see elm_gengrid_align_get
+ */
+#define elm_obj_gengrid_align_get(align_x, align_y) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, align_x), EO_TYPECHECK(double *, align_y)
+
+/**
+ * @def elm_obj_gengrid_item_append
+ * @since 1.8
+ *
+ * Append a new item in a given gengrid widget.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_gengrid_item_append
+ */
+#define elm_obj_gengrid_item_append(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_item_prepend
+ * @since 1.8
+ *
+ * Prepend a new item in a given gengrid widget.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_gengrid_item_prepend
+ */
+#define elm_obj_gengrid_item_prepend(itc, data, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_item_insert_before
+ * @since 1.8
+ *
+ * Insert an item before another in a gengrid widget
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] relative
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_gengrid_item_insert_before
+ */
+#define elm_obj_gengrid_item_insert_before(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_item_insert_after
+ * @since 1.8
+ *
+ * Insert an item after another in a gengrid widget
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] relative
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_gengrid_item_insert_after
+ */
+#define elm_obj_gengrid_item_insert_after(itc, data, relative, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, relative), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_item_sorted_insert
+ * @since 1.8
+ *
+ * Insert an item in a gengrid widget using a user-defined sort function.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] comp
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_gengrid_item_sorted_insert
+ */
+#define elm_obj_gengrid_item_sorted_insert(itc, data, comp, func, func_data, ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Gengrid_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_horizontal_set
+ * @since 1.8
+ *
+ * Set the direction in which a given gengrid widget will expand while
+ * placing its items.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_gengrid_horizontal_set
+ */
+#define elm_obj_gengrid_horizontal_set(horizontal) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_gengrid_horizontal_get
+ * @since 1.8
+ *
+ * Get for what direction a given gengrid widget will expand while
+ * placing its items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_horizontal_get
+ */
+#define elm_obj_gengrid_horizontal_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gengrid_clear
+ * @since 1.8
+ *
+ * Remove all items from a given gengrid widget
+ *
+ *
+ * @see elm_gengrid_clear
+ */
+#define elm_obj_gengrid_clear() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_gengrid_multi_select_set
+ * @since 1.8
+ *
+ * Enable or disable multi-selection in a given gengrid widget
+ *
+ * @param[in] multi
+ *
+ * @see elm_gengrid_multi_select_set
+ */
+#define elm_obj_gengrid_multi_select_set(multi) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi)
+
+/**
+ * @def elm_obj_gengrid_multi_select_get
+ * @since 1.8
+ *
+ * Get whether multi-selection is enabled or disabled for a given
+ * gengrid widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_multi_select_get
+ */
+#define elm_obj_gengrid_multi_select_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gengrid_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item in a given gengrid widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_selected_item_get
+ */
+#define elm_obj_gengrid_selected_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_selected_items_get
+ * @since 1.8
+ *
+ * Get <b>a list</b> of selected items in a given gengrid
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_selected_items_get
+ */
+#define elm_obj_gengrid_selected_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_gengrid_realized_items_get
+ * @since 1.8
+ *
+ * Get a list of realized items in gengrid
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_realized_items_get
+ */
+#define elm_obj_gengrid_realized_items_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret)
+
+/**
+ * @def elm_obj_gengrid_realized_items_update
+ * @since 1.8
+ *
+ * Update the contents of all realized items.
+ *
+ *
+ * @see elm_gengrid_realized_items_update
+ */
+#define elm_obj_gengrid_realized_items_update() ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REALIZED_ITEMS_UPDATE)
+
+/**
+ * @def elm_obj_gengrid_reorder_mode_set
+ * @since 1.8
+ *
+ * Set whether a given gengrid widget is or not able have items
+ *
+ * @param[in] reorder_mode
+ *
+ * @see elm_gengrid_reorder_mode_set
+ */
+#define elm_obj_gengrid_reorder_mode_set(reorder_mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode)
+
+/**
+ * @def elm_obj_gengrid_reorder_mode_get
+ * @since 1.8
+ *
+ * Get whether a given gengrid widget is or not able have items
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_reorder_mode_get
+ */
+#define elm_obj_gengrid_reorder_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gengrid_bounce_set
+ * @since 1.8
+ *
+ * Enable or disable bouncing effect for a given gengrid widget
+ *
+ * @param[in] h_bounce
+ * @param[in] v_bounce
+ *
+ * @see elm_gengrid_bounce_set
+ */
+#define elm_obj_gengrid_bounce_set(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_SET), EO_TYPECHECK(Eina_Bool, h_bounce), EO_TYPECHECK(Eina_Bool, v_bounce)
+
+/**
+ * @def elm_obj_gengrid_bounce_get
+ * @since 1.8
+ *
+ * Get whether bouncing effects are enabled or disabled, for a
+ * given gengrid widget, on each axis
+ *
+ * @param[out] h_bounce
+ * @param[out] v_bounce
+ *
+ * @see elm_gengrid_bounce_get
+ */
+#define elm_obj_gengrid_bounce_get(h_bounce, v_bounce) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_BOUNCE_GET), EO_TYPECHECK(Eina_Bool *, h_bounce), EO_TYPECHECK(Eina_Bool *, v_bounce)
+
+/**
+ * @def elm_obj_gengrid_page_relative_set
+ * @since 1.8
+ *
+ * Set a given gengrid widget's scrolling page size, relative to
+ * its viewport size.
+ *
+ * @param[in] h_pagerel
+ * @param[in] v_pagerel
+ *
+ * @see elm_gengrid_page_relative_set
+ */
+#define elm_obj_gengrid_page_relative_set(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_SET), EO_TYPECHECK(double, h_pagerel), EO_TYPECHECK(double, v_pagerel)
+
+/**
+ * @def elm_obj_gengrid_page_relative_get
+ * @since 1.8
+ *
+ * Get a given gengrid widget's scrolling page size, relative to
+ * its viewport size.
+ *
+ * @param[out] h_pagerel
+ * @param[out] v_pagerel
+ *
+ * @see elm_gengrid_page_relative_get
+ */
+#define elm_obj_gengrid_page_relative_get(h_pagerel, v_pagerel) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_RELATIVE_GET), EO_TYPECHECK(double *, h_pagerel), EO_TYPECHECK(double *, v_pagerel)
+
+/**
+ * @def elm_obj_gengrid_page_size_set
+ * @since 1.8
+ *
+ * Set a given gengrid widget's scrolling page size
+ *
+ * @param[in] h_pagesize
+ * @param[in] v_pagesize
+ *
+ * @see elm_gengrid_page_size_set
+ */
+#define elm_obj_gengrid_page_size_set(h_pagesize, v_pagesize) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SIZE_SET), EO_TYPECHECK(Evas_Coord, h_pagesize), EO_TYPECHECK(Evas_Coord, v_pagesize)
+
+/**
+ * @def elm_obj_gengrid_current_page_get
+ * @since 1.8
+ *
+ * @brief Get gengrid current page number.
+ *
+ * @param[out] h_pagenumber
+ * @param[out] v_pagenumber
+ *
+ * @see elm_gengrid_current_page_get
+ */
+#define elm_obj_gengrid_current_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_CURRENT_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber)
+
+/**
+ * @def elm_obj_gengrid_last_page_get
+ * @since 1.8
+ *
+ * @brief Get gengrid last page number.
+ *
+ * @param[out] h_pagenumber
+ * @param[out] v_pagenumber
+ *
+ * @see elm_gengrid_last_page_get
+ */
+#define elm_obj_gengrid_last_page_get(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_PAGE_GET), EO_TYPECHECK(int *, h_pagenumber), EO_TYPECHECK(int *, v_pagenumber)
+
+/**
+ * @def elm_obj_gengrid_page_show
+ * @since 1.8
+ *
+ * Show a specific virtual region within the gengrid content object by page number.
+ *
+ * @param[in] h_pagenumber
+ * @param[in] v_pagenumber
+ *
+ * @see elm_gengrid_page_show
+ */
+#define elm_obj_gengrid_page_show(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_SHOW), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber)
+
+/**
+ * @def elm_obj_gengrid_page_bring_in
+ * @since 1.8
+ *
+ * Show a specific virtual region within the gengrid content object by page number.
+ *
+ * @param[in] h_pagenumber
+ * @param[in] v_pagenumber
+ *
+ * @see elm_gengrid_page_bring_in
+ */
+#define elm_obj_gengrid_page_bring_in(h_pagenumber, v_pagenumber) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_PAGE_BRING_IN), EO_TYPECHECK(int, h_pagenumber), EO_TYPECHECK(int, v_pagenumber)
+
+/**
+ * @def elm_obj_gengrid_scroller_policy_set
+ * @since 1.8
+ *
+ * Set the scrollbar policy
+ *
+ * @param[in] policy_h
+ * @param[in] policy_v
+ *
+ * @see elm_gengrid_scroller_policy_set
+ */
+#define elm_obj_gengrid_scroller_policy_set(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_SET), EO_TYPECHECK(Elm_Scroller_Policy, policy_h), EO_TYPECHECK(Elm_Scroller_Policy, policy_v)
+
+/**
+ * @def elm_obj_gengrid_scroller_policy_get
+ * @since 1.8
+ *
+ * Get the scrollbar policy
+ *
+ * @param[out] policy_h
+ * @param[out] policy_v
+ *
+ * @see elm_gengrid_scroller_policy_get
+ */
+#define elm_obj_gengrid_scroller_policy_get(policy_h, policy_v) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SCROLLER_POLICY_GET), EO_TYPECHECK(Elm_Scroller_Policy *, policy_h), EO_TYPECHECK(Elm_Scroller_Policy *, policy_v)
+
+/**
+ * @def elm_obj_gengrid_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in a given gengrid widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_first_item_get
+ */
+#define elm_obj_gengrid_first_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in a given gengrid widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_last_item_get
+ */
+#define elm_obj_gengrid_last_item_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_gengrid_filled_set
+ * @since 1.8
+ *
+ * Set how the items grid's filled within a given gengrid widget
+ *
+ * @param[in] fill
+ *
+ * @see elm_gengrid_filled_set
+ */
+#define elm_obj_gengrid_filled_set(fill) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_SET), EO_TYPECHECK(Eina_Bool, fill)
+
+/**
+ * @def elm_obj_gengrid_filled_get
+ * @since 1.8
+ *
+ * Get how the items grid's filled within a given gengrid widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_filled_get
+ */
+#define elm_obj_gengrid_filled_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_FILLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gengrid_items_count
+ * @since 1.8
+ *
+ * Return how many items are currently in a list
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_items_count
+ */
+#define elm_obj_gengrid_items_count(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret)
+
+/**
+ * @def elm_obj_gengrid_select_mode_set
+ * @since 1.8
+ *
+ * Set the gengrid select mode.
+ *
+ * @param[in] mode
+ *
+ * @see elm_gengrid_select_mode_set
+ */
+#define elm_obj_gengrid_select_mode_set(mode) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode)
+
+/**
+ * @def elm_obj_gengrid_select_mode_get
+ * @since 1.8
+ *
+ * Get the gengrid select mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_select_mode_get
+ */
+#define elm_obj_gengrid_select_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret)
+
+/**
+ * @def elm_obj_gengrid_highlight_mode_set
+ * @since 1.8
+ *
+ * Set whether the gengrid items' should be highlighted when item selected.
+ *
+ * @param[in] highlight
+ *
+ * @see elm_gengrid_highlight_mode_set
+ */
+#define elm_obj_gengrid_highlight_mode_set(highlight) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight)
+
+/**
+ * @def elm_obj_gengrid_highlight_mode_get
+ * @since 1.8
+ *
+ * Get whether the gengrid items' should be highlighted when item selected.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gengrid_highlight_mode_get
+ */
+#define elm_obj_gengrid_highlight_mode_get(ret) ELM_OBJ_GENGRID_ID(ELM_OBJ_GENGRID_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+
/**
* @addtogroup Gengrid
* @{
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index ccbc6c11a..ceb2e3b5a 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -3,6 +3,19 @@
#include <Elementary_Cursor.h>
#include "elm_priv.h"
#include "elm_widget_genlist.h"
+#include "elm_interface_scrollable.h"
+
+EAPI Eo_Op ELM_OBJ_GENLIST_PAN_BASE_ID = EO_NOOP;
+
+#define MY_PAN_CLASS ELM_OBJ_GENLIST_PAN_CLASS
+
+#define MY_PAN_CLASS_NAME "elm_genlist_pan"
+
+EAPI Eo_Op ELM_OBJ_GENLIST_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_GENLIST_CLASS
+
+#define MY_CLASS_NAME "elm_genlist"
// internally allocated
#define CLASS_ALLOCATED 0x3a70f11f
@@ -10,20 +23,12 @@
#define MAX_ITEMS_PER_BLOCK 32
#define REORDER_EFFECT_TIME 0.5
-EAPI const char ELM_GENLIST_SMART_NAME[] = "elm_genlist";
-EAPI const char ELM_GENLIST_PAN_SMART_NAME[] = "elm_genlist_pan";
-
#define ERR_ABORT(_msg) \
ERR(_msg); \
if (getenv("ELM_ERROR_ABORT")) abort();
#define GL_IT(_it) (_it->item)
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
static const char SIG_SELECTED[] = "selected";
@@ -102,15 +107,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_GENLIST_SMART_NAME, _elm_genlist, Elm_Genlist_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (ELM_GENLIST_PAN_SMART_NAME, _elm_genlist_pan, Elm_Genlist_Pan_Smart_Class,
- Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
-
static void _calc_job(void *);
static Eina_Bool _item_block_recalc(Item_Block *, int, Eina_Bool);
static void _item_mouse_callbacks_add(Elm_Gen_Item *, Evas_Object *);
@@ -120,13 +116,13 @@ static void _access_activate_cb(void *data __UNUSED__,
Elm_Widget_Item *item);
static void
-_elm_genlist_pan_smart_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_genlist_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
Item_Block *itb;
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
psd->wsd->pan_x = x;
@@ -155,24 +151,24 @@ done:
}
static void
-_elm_genlist_pan_smart_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_genlist_pan_smart_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
static void
-_elm_genlist_pan_smart_pos_max_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_genlist_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
ow = psd->wsd->minw - ow;
@@ -184,38 +180,29 @@ _elm_genlist_pan_smart_pos_max_get(const Evas_Object *obj,
}
static void
-_elm_genlist_pan_smart_pos_min_get(const Evas_Object *obj __UNUSED__,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_genlist_pan_smart_pos_min_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = 0;
if (y) *y = 0;
}
static void
-_elm_genlist_pan_smart_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_genlist_pan_smart_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
if (w) *w = psd->wsd->minw;
if (h) *h = psd->wsd->minh;
}
static void
-_elm_genlist_pan_smart_add(Evas_Object *obj)
+_elm_genlist_pan_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- /* here just to allocate our extended data */
- EVAS_SMART_DATA_ALLOC(obj, Elm_Genlist_Pan_Smart_Data);
-
- ELM_PAN_CLASS(_elm_genlist_pan_parent_sc)->base.add(obj);
-}
-
-static void
-_elm_genlist_pan_smart_del(Evas_Object *obj)
-{
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
if (psd->resize_job)
{
@@ -223,15 +210,15 @@ _elm_genlist_pan_smart_del(Evas_Object *obj)
psd->resize_job = NULL;
}
- _elm_genlist_pan_parent_sc->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_genlist_pan_smart_move(Evas_Object *obj,
- Evas_Coord x __UNUSED__,
- Evas_Coord y __UNUSED__)
+_elm_genlist_pan_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
+ va_arg(*list, Evas_Coord);
+ va_arg(*list, Evas_Coord);
psd->wsd->pan_changed = EINA_TRUE;
evas_object_smart_changed(obj);
@@ -244,18 +231,18 @@ _elm_genlist_pan_smart_resize_job(void *data)
{
Elm_Genlist_Pan_Smart_Data *psd = data;
- elm_layout_sizing_eval(ELM_WIDGET_DATA(psd->wsd)->obj);
+ elm_layout_sizing_eval(psd->wobj);
psd->resize_job = NULL;
}
static void
-_elm_genlist_pan_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_genlist_pan_smart_resize(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
if ((ow == w) && (oh == h)) return;
@@ -329,10 +316,10 @@ _item_scroll(Elm_Genlist_Smart_Data *sd)
break;
}
if (sd->bring_in)
- sd->s_iface->region_bring_in(ELM_WIDGET_DATA(sd)->obj, dx, dy, dw, dh);
+ eo_do(sd->obj, elm_scrollable_interface_region_bring_in(dx, dy, dw, dh));
else
- sd->s_iface->content_region_show
- (ELM_WIDGET_DATA(sd)->obj, dx, dy, dw, dh);
+ eo_do(sd->obj, elm_scrollable_interface_content_region_show
+ (dx, dy, dw, dh));
it->item->show_me = EINA_FALSE;
sd->show_item = NULL;
@@ -388,7 +375,7 @@ _item_block_unrealize(Item_Block *itb)
Eina_Bool dragging = EINA_FALSE;
if (!itb->realized) return;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
+ evas_event_freeze(evas_object_evas_get((itb->sd)->obj));
EINA_LIST_FOREACH(itb->items, l, it)
{
@@ -410,8 +397,8 @@ _item_block_unrealize(Item_Block *itb)
}
else
itb->want_unrealize = EINA_FALSE;
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
+ evas_event_thaw(evas_object_evas_get((itb->sd)->obj));
+ evas_event_thaw_eval(evas_object_evas_get((itb->sd)->obj));
}
static Eina_Bool
@@ -438,11 +425,12 @@ _calc_job(void *data)
evas_object_geometry_get(sd->pan_obj, NULL, NULL, &ow, &sd->h);
if (sd->mode == ELM_LIST_COMPRESS)
- sd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(sd)->obj, &vw, NULL);
+ eo_do(sd->obj, elm_scrollable_interface_content_viewport_size_get
+ (&vw, NULL));
if (sd->w != ow) sd->w = ow;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
EINA_INLIST_FOREACH(sd->blocks, itb)
{
Eina_Bool show_me = EINA_FALSE;
@@ -514,7 +502,7 @@ _calc_job(void *data)
sd->minw = minw;
sd->minh = minh;
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ elm_layout_sizing_eval(sd->obj);
if (sd->reorder_it)
{
Elm_Gen_Item *it;
@@ -529,9 +517,9 @@ _calc_job(void *data)
it = sd->anchor_item;
it_y = sd->anchor_y;
- sd->s_iface->content_pos_set
- (ELM_WIDGET_DATA(sd)->obj, sd->pan_x, it->item->block->y
- + it->y + it_y);
+ eo_do(sd->obj, elm_scrollable_interface_content_pos_set
+ (sd->pan_x, it->item->block->y
+ + it->y + it_y));
sd->anchor_item = it;
sd->anchor_y = it_y;
}
@@ -543,7 +531,7 @@ _calc_job(void *data)
}
if (sd->check_scroll)
{
- _elm_genlist_pan_smart_content_size_get(sd->pan_obj, &pan_w, &pan_h);
+ eo_do(sd->pan_obj, elm_obj_pan_content_size_get(&pan_w, &pan_h));
if (EINA_INLIST_GET(sd->show_item) == sd->items->last)
sd->scroll_to_type = ELM_GENLIST_ITEM_SCROLLTO_IN;
@@ -575,33 +563,31 @@ _calc_job(void *data)
sd->calc_job = NULL;
evas_object_smart_changed(sd->pan_obj);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
}
static void
-_elm_genlist_smart_sizing_eval(Evas_Object *obj)
+_elm_genlist_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
Evas_Coord vmw = 0, vmh = 0;
- ELM_GENLIST_DATA_GET(obj, sd);
-
- /* parent class' early call */
- if (!sd->s_iface) return;
+ Elm_Genlist_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->on_sub_del) return;;
evas_object_size_hint_min_get(obj, &minw, NULL);
evas_object_size_hint_max_get(obj, &maxw, &maxh);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &vmw, &vmh);
+ edje_object_size_min_calc(wd->resize_obj, &vmw, &vmh);
if (sd->mode == ELM_LIST_COMPRESS)
{
Evas_Coord vw, vh;
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if ((vw != 0) && (vw != sd->prev_viewport_w))
{
Item_Block *itb;
@@ -679,13 +665,13 @@ _item_position(Elm_Gen_Item *it,
if (!view) return;
evas_event_freeze
- (evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
+ (evas_object_evas_get((GL_IT(it)->wsd)->obj));
evas_object_resize(view, it->item->w, it->item->h);
evas_object_move(view, it_x, it_y);
evas_object_show(view);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
+ evas_event_thaw(evas_object_evas_get((GL_IT(it)->wsd)->obj));
evas_event_thaw_eval
- (evas_object_evas_get(ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj));
+ (evas_object_evas_get((GL_IT(it)->wsd)->obj));
}
static void
@@ -811,7 +797,7 @@ _item_tree_effect_finish(Elm_Genlist_Smart_Data *sd)
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_TREE_EFFECT_FINISHED, NULL);
+ (sd->obj, SIG_TREE_EFFECT_FINISHED, NULL);
evas_object_smart_changed(sd->pan_obj);
sd->tree_effect_animator = NULL;
@@ -1301,13 +1287,11 @@ _access_on_highlight_cb(void *data)
Elm_Gen_Item *it = (Elm_Gen_Item *)data;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it);
- ELM_GENLIST_DATA_GET(it->base.widget, sd);
-
evas_object_geometry_get(it->base.view, &x, &y, &w, &h);
// XXX There would be a reason.
if ((w == 0) && (h == 0)) return;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
+ evas_object_geometry_get(it->base.widget, &sx, &sy, &sw, &sh);
if ((x < sx) || (y < sy) || ((x + w) > (sx + sw)) || ((y + h) > (sy + sh)))
elm_genlist_item_bring_in((Elm_Object_Item *)it,
ELM_GENLIST_ITEM_SCROLLTO_IN);
@@ -1715,7 +1699,7 @@ _group_items_recalc(void *data)
Elm_Gen_Item *git;
Elm_Genlist_Smart_Data *sd = data;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
EINA_LIST_FOREACH(sd->group_items, l, git)
{
if (git->item->want_realize)
@@ -1732,8 +1716,8 @@ _group_items_recalc(void *data)
_elm_genlist_item_unrealize(git, EINA_FALSE);
}
}
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
}
static Eina_Bool
@@ -1841,10 +1825,10 @@ _item_block_position(Item_Block *itb,
Eina_Bool vis = EINA_FALSE;
Evas_Coord y = 0, ox, oy, ow, oh, cvx, cvy, cvw, cvh;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
+ evas_event_freeze(evas_object_evas_get((itb->sd)->obj));
evas_object_geometry_get(itb->sd->pan_obj, &ox, &oy, &ow, &oh);
evas_output_viewport_get
- (evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj),
+ (evas_object_evas_get((itb->sd)->obj),
&cvx, &cvy, &cvw, &cvh);
EINA_LIST_FOREACH(itb->items, l, it)
@@ -1941,8 +1925,8 @@ _item_block_position(Item_Block *itb,
}
y += it->item->h;
}
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(itb->sd)->obj));
+ evas_event_thaw(evas_object_evas_get((itb->sd)->obj));
+ evas_event_thaw_eval(evas_object_evas_get((itb->sd)->obj));
}
static void
@@ -1955,7 +1939,7 @@ _item_block_realize(Item_Block *itb)
}
static void
-_elm_genlist_pan_smart_calculate(Evas_Object *obj)
+_elm_genlist_pan_smart_calculate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh;
Evas_Coord vx = 0, vy = 0, vw = 0, vh = 0;
@@ -1964,7 +1948,7 @@ _elm_genlist_pan_smart_calculate(Evas_Object *obj)
Eina_List *l;
int in = 0;
- ELM_GENLIST_PAN_DATA_GET(obj, psd);
+ Elm_Genlist_Pan_Smart_Data *psd = _pd;
evas_event_freeze(evas_object_evas_get(obj));
@@ -2030,37 +2014,49 @@ _elm_genlist_pan_smart_calculate(Evas_Object *obj)
(psd->wsd->move_effect_mode == ELM_GENLIST_TREE_EFFECT_NONE))
_item_auto_scroll(psd->wsd);
- psd->wsd->s_iface->content_pos_get(ELM_WIDGET_DATA(psd->wsd)->obj, &vx, &vy);
- psd->wsd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(psd->wsd)->obj,
- &vw, &vh);
+ eo_do((psd->wsd)->obj,
+ elm_scrollable_interface_content_pos_get(&vx, &vy),
+ elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (psd->wsd->reorder_fast == 1)
- psd->wsd->s_iface->content_region_show(ELM_WIDGET_DATA(psd->wsd)->obj,
- vx,vy - 10, vw, vh);
+ eo_do((psd->wsd)->obj, elm_scrollable_interface_content_region_show(vx, vy - 10, vw, vh));
else if (psd->wsd->reorder_fast == -1)
- psd->wsd->s_iface->content_region_show(ELM_WIDGET_DATA(psd->wsd)->obj,
- vx, vy + 10, vw, vh);
+ eo_do((psd->wsd)->obj, elm_scrollable_interface_content_region_show(vx, vy + 10, vw, vh));
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
}
static void
-_elm_genlist_pan_smart_set_user(Elm_Genlist_Pan_Smart_Class *sc)
-{
- ELM_PAN_CLASS(sc)->base.add = _elm_genlist_pan_smart_add;
- ELM_PAN_CLASS(sc)->base.del = _elm_genlist_pan_smart_del;
- ELM_PAN_CLASS(sc)->base.move = _elm_genlist_pan_smart_move;
- ELM_PAN_CLASS(sc)->base.resize = _elm_genlist_pan_smart_resize;
- ELM_PAN_CLASS(sc)->base.calculate = _elm_genlist_pan_smart_calculate;
+_genlist_pan_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_genlist_pan_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_genlist_pan_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_genlist_pan_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_genlist_pan_smart_calculate),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_genlist_pan_smart_pos_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_genlist_pan_smart_pos_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_genlist_pan_smart_pos_max_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_genlist_pan_smart_pos_min_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_genlist_pan_smart_content_size_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Class_Description _genlist_pan_class_desc = {
+ EO_VERSION,
+ MY_PAN_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ sizeof(Elm_Genlist_Pan_Smart_Data),
+ _genlist_pan_class_constructor,
+ NULL
+};
- ELM_PAN_CLASS(sc)->pos_set = _elm_genlist_pan_smart_pos_set;
- ELM_PAN_CLASS(sc)->pos_get = _elm_genlist_pan_smart_pos_get;
- ELM_PAN_CLASS(sc)->pos_max_get = _elm_genlist_pan_smart_pos_max_get;
- ELM_PAN_CLASS(sc)->pos_min_get = _elm_genlist_pan_smart_pos_min_get;
- ELM_PAN_CLASS(sc)->content_size_get =
- _elm_genlist_pan_smart_content_size_get;
-}
+EO_DEFINE_CLASS(elm_obj_genlist_pan_class_get, &_genlist_pan_class_desc, ELM_OBJ_PAN_CLASS, NULL);
static Eina_Bool
_item_multi_select_up(Elm_Genlist_Smart_Data *sd)
@@ -2176,12 +2172,16 @@ _item_single_select_down(Elm_Genlist_Smart_Data *sd)
return EINA_TRUE;
}
-static Eina_Bool
-_elm_genlist_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_genlist_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord v_w = 0;
@@ -2194,17 +2194,18 @@ _elm_genlist_smart_event(Evas_Object *obj,
Evas_Event_Key_Down *ev = event_info;
Evas_Coord pan_max_x = 0, pan_max_y = 0;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Genlist_Smart_Data *sd = _pd;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (!sd->items) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (!sd->items) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -2224,7 +2225,8 @@ _elm_genlist_smart_event(Evas_Object *obj,
|| (_item_single_select_up(sd)))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y -= step_y;
@@ -2237,7 +2239,8 @@ _elm_genlist_smart_event(Evas_Object *obj,
|| (_item_single_select_down(sd)))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y += step_y;
@@ -2249,7 +2252,8 @@ _elm_genlist_smart_event(Evas_Object *obj,
elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
elm_genlist_item_selected_set(it, EINA_TRUE);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "End")) ||
((!strcmp(ev->keyname, "KP_End")) && (!ev->string)))
@@ -2258,7 +2262,8 @@ _elm_genlist_smart_event(Evas_Object *obj,
elm_genlist_item_bring_in(it, ELM_GENLIST_ITEM_SCROLLTO_IN);
elm_genlist_item_selected_set(it, EINA_TRUE);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "Prior")) ||
((!strcmp(ev->keyname, "KP_Prior")) && (!ev->string)))
@@ -2278,9 +2283,10 @@ _elm_genlist_smart_event(Evas_Object *obj,
}
else if (!strcmp(ev->keyname, "Escape"))
{
- if (!_all_items_deselect(sd)) return EINA_FALSE;
+ if (!_all_items_deselect(sd)) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if (((!strcmp(ev->keyname, "Return")) ||
(!strcmp(ev->keyname, "KP_Enter")) ||
@@ -2291,28 +2297,37 @@ _elm_genlist_smart_event(Evas_Object *obj,
elm_genlist_item_expanded_set(it, !elm_genlist_item_expanded_get(it));
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- _elm_genlist_pan_smart_pos_max_get(sd->pan_obj, &pan_max_x, &pan_max_y);
+ eo_do(sd->pan_obj, elm_obj_pan_pos_max_get(&pan_max_x, &pan_max_y));
if (x < 0) x = 0;
if (x > pan_max_x) x = pan_max_x;
if (y < 0) y = 0;
if (y > pan_max_y) y = pan_max_y;
- sd->s_iface->content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_genlist_smart_sub_object_add(Evas_Object *obj,
- Evas_Object *sobj)
+/* This function disables the specific code of the layout sub object add.
+ * Only the widget sub_object_add is called.
+ */
+static void
+_elm_genlist_smart_layout_sub_object_add_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- Elm_Widget_Smart_Class *parent_parent;
+ Eina_Bool *enable = va_arg(*list, Eina_Bool *);
+ *enable = EINA_FALSE;
+}
- parent_parent = (Elm_Widget_Smart_Class *)((Evas_Smart_Class *)
- _elm_genlist_parent_sc)->parent;
+static void
+_elm_genlist_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
/* skipping layout's code, which registers size hint changing
* callback on sub objects. this is here because items'
@@ -2320,17 +2335,21 @@ _elm_genlist_smart_sub_object_add(Evas_Object *obj,
* creation, thus issuing TOO MANY sizing_eval()'s here. they are
* not needed at here anyway, so let's skip listening to those
* hints changes */
- if (!parent_parent->sub_object_add(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
+ if (!int_ret) return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_genlist_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_genlist_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_Genlist_Smart_Data *sd = _pd;
/* XXX: hack -- also skipping sizing recalculation on
* sub-object-del. genlist's crazy code paths (like groups and
@@ -2338,44 +2357,66 @@ _elm_genlist_smart_sub_object_del(Evas_Object *obj,
* about too many recalculations */
sd->on_sub_del = EINA_TRUE;
- if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
sd->on_sub_del = EINA_FALSE;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_genlist_smart_on_focus(Evas_Object *obj)
+static void
+_elm_genlist_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Genlist_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->on_focus(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (elm_widget_focus_get(obj) && (sd->items) && (sd->selected) &&
(!sd->last_selected_item))
sd->last_selected_item = eina_list_data_get(sd->selected);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_genlist_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_genlist_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_genlist_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_genlist_smart_focus_next_enable;
+}
+
+static void
+_elm_genlist_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_genlist_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
Evas_Coord x, y, w, h;
Evas_Coord sx, sy, sw, sh;
Item_Block *itb;
Eina_List *items = NULL;
Eina_Bool done = EINA_FALSE;
- ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Genlist_Smart_Data *sd = _pd;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &sx, &sy, &sw, &sh);
+ evas_object_geometry_get(sd->obj, &sx, &sy, &sw, &sh);
EINA_INLIST_FOREACH(sd->blocks, itb)
{
@@ -2401,14 +2442,16 @@ _elm_genlist_smart_focus_next(const Evas_Object *obj,
else if (done) break;
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+
+ if (ret) *ret = int_ret;
}
static void
_item_cache_clean(Elm_Genlist_Smart_Data *sd)
{
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
while ((sd->item_cache) && (sd->item_cache_count > sd->item_cache_max))
{
@@ -2423,8 +2466,8 @@ _item_cache_clean(Elm_Genlist_Smart_Data *sd)
eina_stringshare_del(itc->item_style);
free(itc);
}
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
}
static void
@@ -2444,20 +2487,23 @@ _mirrored_set(Evas_Object *obj,
ELM_GENLIST_DATA_GET(obj, sd);
_item_cache_zero(sd);
- sd->s_iface->mirrored_set(obj, rtl);
+ eo_do(obj, elm_scrollable_interface_mirrored_set(rtl));
}
-static Eina_Bool
-_elm_genlist_smart_theme(Evas_Object *obj)
+static void
+_elm_genlist_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Item_Block *itb;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Genlist_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
_item_cache_zero(sd);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -2478,10 +2524,10 @@ _elm_genlist_smart_theme(Evas_Object *obj)
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
elm_layout_sizing_eval(obj);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: take off later. maybe this show region coords belong in the
@@ -2498,15 +2544,16 @@ _show_region_hook(void *data,
//x & y are screen coordinates, Add with pan coordinates
x += sd->pan_x;
y += sd->pan_y;
- sd->s_iface->content_region_show(obj, x, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show(x, y, w, h));
}
-static Eina_Bool
-_elm_genlist_smart_translate(Evas_Object *obj)
+static void
+_elm_genlist_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_smart_callback_call(obj, "language,changed", NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -3007,12 +3054,12 @@ _long_press_cb(void *data)
else
evas_object_raise(VIEW(it));
- sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
- sd->s_iface->bounce_allow_set
- (ELM_WIDGET_DATA(sd)->obj, EINA_FALSE, EINA_FALSE);
+ eo_do(sd->obj, elm_scrollable_interface_hold_set(EINA_TRUE));
+ eo_do(sd->obj, elm_scrollable_interface_bounce_allow_set
+ (EINA_FALSE, EINA_FALSE));
list = elm_genlist_realized_items_get
- (ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
+ ((GL_IT(it)->wsd)->obj);
EINA_LIST_FOREACH(list, l, it_tmp)
{
if (it != it_tmp) _item_unselect(it_tmp);
@@ -3609,18 +3656,18 @@ _item_process_post(Elm_Genlist_Smart_Data *sd,
it2 = sd->selected->data;
if (!it2->item->block) return;
- sd->s_iface->content_pos_get(ELM_WIDGET_DATA(sd)->obj, NULL, &y);
+ eo_do(sd->obj, elm_scrollable_interface_content_pos_get(NULL, &y));
evas_object_geometry_get(sd->pan_obj, NULL, NULL, NULL, &h);
if ((it->y + it->item->block->y > y + h) ||
(it->y + it->item->block->y + it->item->h < y))
/* offscreen, just update */
- sd->s_iface->content_region_show
- (ELM_WIDGET_DATA(sd)->obj, it2->x + it2->item->block->x, y,
- it2->item->block->w, h);
+ eo_do(sd->obj, elm_scrollable_interface_content_region_show
+ (it2->x + it2->item->block->x, y,
+ it2->item->block->w, h));
else
- sd->s_iface->content_region_show
- (ELM_WIDGET_DATA(sd)->obj, it->x + it->item->block->x,
- y + it->item->h, it->item->block->w, h);
+ eo_do(sd->obj, elm_scrollable_interface_content_region_show
+ (it->x + it->item->block->x,
+ y + it->item->h, it->item->block->w, h));
}
}
@@ -3894,9 +3941,9 @@ _item_mouse_up_cb(void *data,
}
edje_object_signal_emit(VIEW(it), "elm,state,reorder,disabled", "elm");
sd->reorder_it = sd->reorder_rel = NULL;
- sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
- sd->s_iface->bounce_allow_set
- (ELM_WIDGET_DATA(sd)->obj, sd->h_bounce, sd->v_bounce);
+ eo_do(sd->obj, elm_scrollable_interface_hold_set(EINA_FALSE));
+ eo_do(sd->obj, elm_scrollable_interface_bounce_allow_set
+ (sd->h_bounce, sd->v_bounce));
}
if (sd->longpressed)
{
@@ -3994,7 +4041,7 @@ _scroll_hold_timer_cb(void *data)
if (!data) return ECORE_CALLBACK_CANCEL;
- sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ eo_do(sd->obj, elm_scrollable_interface_hold_set(EINA_FALSE));
sd->scr_hold_timer = NULL;
return ECORE_CALLBACK_CANCEL;
@@ -4004,7 +4051,7 @@ static void
_decorate_item_unrealize(Elm_Gen_Item *it)
{
Elm_Genlist_Smart_Data *sd = GL_IT(it)->wsd;
- Evas_Object *content, *obj = ELM_WIDGET_DATA(sd)->obj;
+ Evas_Object *content, *obj = sd->obj;
if (!it->item->deco_it_view) return;
@@ -4064,7 +4111,7 @@ static void
_item_cache_add(Elm_Gen_Item *it)
{
Item_Cache *itc;
- Evas_Object *obj = ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj;
+ Evas_Object *obj = GL_IT(it)->wsd->obj;
evas_event_freeze(evas_object_evas_get(obj));
if (GL_IT(it)->wsd->item_cache_max <= 0)
@@ -4324,7 +4371,7 @@ _update_job(void *data)
sd->update_job = NULL;
num = 0;
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
EINA_INLIST_FOREACH(sd->blocks, itb)
{
Evas_Coord itminw, itminh;
@@ -4377,8 +4424,8 @@ _update_job(void *data)
if (sd->calc_job) ecore_job_del(sd->calc_job);
sd->calc_job = ecore_job_add(_calc_job, sd);
}
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
}
static void
@@ -4441,7 +4488,7 @@ static void
_decorate_item_realize(Elm_Gen_Item *it)
{
char buf[1024];
- Evas_Object *obj = ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj;
+ Evas_Object *obj = (GL_IT(it)->wsd)->obj;
if ((it->item->deco_it_view) || (it->generation <
GL_IT(it)->wsd->generation)) return;
@@ -4524,17 +4571,17 @@ _decorate_item_set(Elm_Gen_Item *it)
ecore_timer_del(sd->scr_hold_timer);
sd->scr_hold_timer = NULL;
}
- sd->s_iface->hold_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
+ eo_do(sd->obj, elm_scrollable_interface_hold_set(EINA_TRUE));
sd->scr_hold_timer = ecore_timer_add(0.1, _scroll_hold_timer_cb, sd);
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
_decorate_item_realize(it);
if (it->item->group_item)
evas_object_raise(it->item->VIEW(group_item));
_item_position
(it, it->item->deco_it_view, it->item->scrl_x, it->item->scrl_y);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
snprintf(buf, sizeof(buf), "elm,state,%s,active", sd->decorate_it_type);
edje_object_signal_emit(it->item->deco_it_view, buf, "elm");
@@ -4562,14 +4609,15 @@ _decorate_item_unset(Elm_Genlist_Smart_Data *sd)
}
static void
-_elm_genlist_smart_add(Evas_Object *obj)
+_elm_genlist_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw, minh;
Elm_Genlist_Pan_Smart_Data *pan_data;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Genlist_Smart_Data);
+ Elm_Genlist_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_smart_member_add(priv->hit_rect, obj);
@@ -4587,25 +4635,21 @@ _elm_genlist_smart_add(Evas_Object *obj)
elm_layout_theme_set(obj, "genlist", "base", elm_widget_style_get(obj));
- /* interface's add() routine issued AFTER the object's smart_add() */
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
- priv->s_iface->bounce_allow_set
- (obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set
+ (EINA_FALSE, _elm_config->thumbscroll_bounce_enable));
priv->v_bounce = _elm_config->thumbscroll_bounce_enable;
- priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
- priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
- priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
- priv->s_iface->edge_left_cb_set(obj, _edge_left_cb);
- priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
- priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
- priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
+ eo_do(obj,
+ elm_scrollable_interface_animate_start_cb_set(_scroll_animate_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_animate_stop_cb),
+ elm_scrollable_interface_drag_start_cb_set(_scroll_drag_start_cb),
+ elm_scrollable_interface_drag_stop_cb_set(_scroll_drag_stop_cb),
+ elm_scrollable_interface_edge_left_cb_set(_edge_left_cb),
+ elm_scrollable_interface_edge_right_cb_set(_edge_right_cb),
+ elm_scrollable_interface_edge_top_cb_set(_edge_top_cb),
+ elm_scrollable_interface_edge_bottom_cb_set(_edge_bottom_cb));
priv->mode = ELM_LIST_SCROLL;
priv->max_items_per_block = MAX_ITEMS_PER_BLOCK;
@@ -4613,14 +4657,14 @@ _elm_genlist_smart_add(Evas_Object *obj)
priv->longpress_timeout = _elm_config->longpress_timeout;
priv->highlight = EINA_TRUE;
- priv->pan_obj = evas_object_smart_add
- (evas_object_evas_get(obj), _elm_genlist_pan_smart_class_new());
- pan_data = evas_object_smart_data_get(priv->pan_obj);
+ priv->pan_obj = eo_add(MY_PAN_CLASS, evas_object_evas_get(obj));
+ pan_data = eo_data_get(priv->pan_obj, MY_PAN_CLASS);
+ pan_data->wobj = obj;
pan_data->wsd = priv;
- priv->s_iface->extern_pan_set(obj, priv->pan_obj);
+ eo_do(obj, elm_scrollable_interface_extern_pan_set(priv->pan_obj));
- edje_object_size_min_calc(ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -4629,13 +4673,14 @@ _elm_genlist_smart_add(Evas_Object *obj)
}
static void
-_elm_genlist_smart_del(Evas_Object *obj)
+_elm_genlist_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Genlist_Smart_Data *sd = _pd;
if (sd->decorate_all_mode)
- elm_genlist_decorate_mode_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ elm_genlist_decorate_mode_set(sd->obj, EINA_FALSE);
elm_genlist_clear(obj);
+ eo_unref(sd->pan_obj);
evas_object_del(sd->pan_obj);
sd->pan_obj = NULL;
@@ -4649,40 +4694,40 @@ _elm_genlist_smart_del(Evas_Object *obj)
if (sd->scr_hold_timer) ecore_timer_del(sd->scr_hold_timer);
if (sd->tree_effect_animator) ecore_animator_del(sd->tree_effect_animator);
- ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_genlist_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_genlist_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Genlist_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_genlist_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_genlist_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Genlist_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_genlist_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_genlist_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_GENLIST_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Genlist_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
@@ -4715,80 +4760,36 @@ _access_obj_process(Elm_Genlist_Smart_Data *sd, Eina_Bool is_access)
}
static void
-_elm_genlist_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_genlist_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(sd, is_access);
-}
-
-static void
-_elm_genlist_smart_set_user(Elm_Genlist_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_genlist_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_genlist_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_genlist_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_genlist_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_genlist_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_genlist_smart_sub_object_add;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_genlist_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_genlist_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_genlist_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_genlist_smart_event;
- ELM_WIDGET_CLASS(sc)->translate = _elm_genlist_smart_translate;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_genlist_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_genlist_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_genlist_smart_access;
-}
-
-EAPI const Elm_Genlist_Smart_Class *
-elm_genlist_smart_class_get(void)
+_elm_genlist_smart_access(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- static Elm_Genlist_Smart_Class _sc =
- ELM_GENLIST_SMART_CLASS_INIT_NAME_VERSION(ELM_GENLIST_SMART_NAME);
- static const Elm_Genlist_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_genlist_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Elm_Genlist_Smart_Data *sd = _pd;
+ _elm_genlist_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(sd, _elm_genlist_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_genlist_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_genlist_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Genlist_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
static void
@@ -4837,7 +4838,7 @@ _elm_genlist_clear(Evas_Object *obj,
return;
}
- evas_event_freeze(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_event_freeze(evas_object_evas_get(sd->obj));
for (l = sd->items, next = l ? l->next : NULL;
l;
l = next, next = next ? next->next : NULL)
@@ -4877,10 +4878,10 @@ _elm_genlist_clear(Evas_Object *obj,
evas_object_size_hint_min_set(sd->pan_obj, sd->minw, sd->minh);
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
}
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
- sd->s_iface->content_region_show(obj, 0, 0, 0, 0);
- evas_event_thaw(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
- evas_event_thaw_eval(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ elm_layout_sizing_eval(sd->obj);
+ eo_do(obj, elm_scrollable_interface_content_region_show(0, 0, 0, 0));
+ evas_event_thaw(evas_object_evas_get(sd->obj));
+ evas_event_thaw_eval(evas_object_evas_get(sd->obj));
}
static void
@@ -5034,7 +5035,7 @@ _elm_genlist_item_new(Elm_Genlist_Smart_Data *sd,
if (!itc) return NULL;
- it = elm_widget_item_new(ELM_WIDGET_DATA(sd)->obj, Elm_Gen_Item);
+ it = elm_widget_item_new(sd->obj, Elm_Gen_Item);
if (!it) return NULL;
it->generation = sd->generation;
@@ -5106,9 +5107,18 @@ EAPI unsigned int
elm_genlist_items_count(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) 0;
- ELM_GENLIST_DATA_GET(obj, sd);
+ unsigned int ret = 0;
+ eo_do((Eo *) obj, elm_obj_genlist_items_count(&ret));
+ return ret;
+}
- return sd->item_count;
+static void
+_items_count(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->item_count;
}
EAPI Elm_Object_Item *
@@ -5120,14 +5130,30 @@ elm_genlist_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_genlist_item_append(itc, data, parent, type, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ const Elm_Genlist_Item_Class *itc = va_arg(*list, const Elm_Genlist_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Genlist_Item_Type type = va_arg(*list, Elm_Genlist_Item_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+ *ret = NULL;
it = _elm_genlist_item_new
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
if (!it->parent)
{
@@ -5153,7 +5179,7 @@ elm_genlist_item_append(Evas_Object *obj,
it->item->before = EINA_FALSE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -5165,13 +5191,30 @@ elm_genlist_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_genlist_item_prepend(itc, data, parent, type, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ const Elm_Genlist_Item_Class *itc = va_arg(*list, const Elm_Genlist_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Genlist_Item_Type type = va_arg(*list, Elm_Genlist_Item_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+ *ret = NULL;
+
it = _elm_genlist_item_new
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
if (!it->parent)
{
@@ -5197,7 +5240,7 @@ elm_genlist_item_prepend(Evas_Object *obj,
it->item->before = EINA_TRUE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -5210,20 +5253,39 @@ elm_genlist_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_genlist_item_insert_after(itc, data, parent, after_it, type, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Elm_Genlist_Item_Class *itc = va_arg(*list, const Elm_Genlist_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Object_Item *after_it = va_arg(*list, Elm_Object_Item *);
+ Elm_Genlist_Item_Type type = va_arg(*list, Elm_Genlist_Item_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+
Elm_Gen_Item *after = (Elm_Gen_Item *)after_it;
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_ITEM_CHECK_OR_RETURN(after_it, NULL);
- ELM_GENLIST_DATA_GET(obj, sd);
+ *ret = NULL;
+
+ ELM_GENLIST_ITEM_CHECK(after_it);
+ Elm_Genlist_Smart_Data *sd = _pd;
/* It makes no sense to insert after in an empty list with after !=
* NULL, something really bad is happening in your app. */
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(sd->items);
it = _elm_genlist_item_new
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
if (!it->parent)
{
@@ -5244,7 +5306,7 @@ elm_genlist_item_insert_after(Evas_Object *obj,
it->item->before = EINA_FALSE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -5257,20 +5319,38 @@ elm_genlist_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_genlist_item_insert_before(itc, data, parent, before_it, type, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Elm_Genlist_Item_Class *itc = va_arg(*list, const Elm_Genlist_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Object_Item *before_it = va_arg(*list, Elm_Object_Item *);
+ Elm_Genlist_Item_Type type = va_arg(*list, Elm_Genlist_Item_Type);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
Elm_Gen_Item *before = (Elm_Gen_Item *)before_it;
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_ITEM_CHECK_OR_RETURN(before_it, NULL);
- ELM_GENLIST_DATA_GET(obj, sd);
+ *ret = NULL;
+
+ ELM_GENLIST_ITEM_CHECK(before_it);
+ Elm_Genlist_Smart_Data *sd = _pd;
/* It makes no sense to insert before in an empty list with before
* != NULL, something really bad is happening in your app. */
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->items, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(sd->items);
it = _elm_genlist_item_new
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
if (!it->parent)
{
@@ -5291,7 +5371,7 @@ elm_genlist_item_insert_before(Evas_Object *obj,
it->item->before = EINA_TRUE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -5304,15 +5384,33 @@ elm_genlist_item_sorted_insert(Evas_Object *obj,
Evas_Smart_Cb func,
const void *func_data)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_genlist_item_sorted_insert(itc, data, parent, type, comp, func, func_data, &ret));
+ return ret;
+}
+
+static void
+_item_sorted_insert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *rel = NULL;
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ const Elm_Genlist_Item_Class *itc = va_arg(*list, const Elm_Genlist_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Genlist_Item_Type type = va_arg(*list, Elm_Genlist_Item_Type);
+ Eina_Compare_Cb comp = va_arg(*list, Eina_Compare_Cb);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *func_data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ Elm_Genlist_Smart_Data *sd = _pd;
it = _elm_genlist_item_new
(sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
- if (!it) return NULL;
+ if (!it) return;
sd->item_compare_cb = comp;
@@ -5383,14 +5481,19 @@ elm_genlist_item_sorted_insert(Evas_Object *obj,
_item_queue(sd, it, _elm_genlist_item_list_compare);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI void
elm_genlist_clear(Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj);
+ eo_do(obj, elm_obj_genlist_clear());
+}
+static void
+_clear_eo(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
_elm_genlist_clear(obj, EINA_FALSE);
}
@@ -5399,7 +5502,14 @@ elm_genlist_multi_select_set(Evas_Object *obj,
Eina_Bool multi)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_multi_select_set(multi));
+}
+
+static void
+_multi_select_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool multi = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->multi = !!multi;
}
@@ -5408,41 +5518,77 @@ EAPI Eina_Bool
elm_genlist_multi_select_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_multi_select_get(&ret));
+ return ret;
+}
- return sd->multi;
+static void
+_multi_select_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->multi;
}
EAPI Elm_Object_Item *
elm_genlist_selected_item_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_selected_item_get(&ret));
+ return ret;
+}
- if (sd->selected)
- return sd->selected->data;
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
- return NULL;
+ if (sd->selected)
+ *ret = sd->selected->data;
+ else
+ *ret = NULL;
}
EAPI const Eina_List *
elm_genlist_selected_items_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_selected_items_get(&ret));
+ return ret;
+}
- return sd->selected;
+static void
+_selected_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->selected;
}
EAPI Eina_List *
elm_genlist_realized_items_get(const Evas_Object *obj)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_realized_items_get(&ret));
+ return ret;
+}
+
+static void
+_realized_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Item_Block *itb;
- Eina_List *list = NULL;
Eina_Bool done = EINA_FALSE;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+ *ret = NULL;
EINA_INLIST_FOREACH(sd->blocks, itb)
{
@@ -5454,7 +5600,7 @@ elm_genlist_realized_items_get(const Evas_Object *obj)
done = EINA_TRUE;
EINA_LIST_FOREACH(itb->items, l, it)
{
- if (it->realized) list = eina_list_append(list, it);
+ if (it->realized) *ret = eina_list_append(*ret, it);
}
}
else
@@ -5462,7 +5608,6 @@ elm_genlist_realized_items_get(const Evas_Object *obj)
if (done) break;
}
}
- return list;
}
EAPI Elm_Object_Item *
@@ -5471,12 +5616,24 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj,
Evas_Coord y,
int *posret)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_at_xy_item_get(x, y, posret, &ret));
+ return ret;
+}
+
+static void
+_at_xy_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Evas_Coord ox, oy, ow, oh;
Evas_Coord lasty;
Item_Block *itb;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ int *posret = va_arg(*list, int *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
lasty = oy;
@@ -5506,7 +5663,8 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj,
else *posret = 0;
}
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
+ return;
}
lasty = ity + it->item->h;
}
@@ -5517,47 +5675,68 @@ elm_genlist_at_xy_item_get(const Evas_Object *obj,
else *posret = -1;
}
- return NULL;
+ *ret = NULL;
}
EAPI Elm_Object_Item *
elm_genlist_first_item_get(const Evas_Object *obj)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_first_item_get(&ret));
+ return ret;
+}
+
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+ *ret = NULL;
- if (!sd->items) return NULL;
+ if (!sd->items) return;
it = ELM_GEN_ITEM_FROM_INLIST(sd->items);
while ((it) && (it->generation < sd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
elm_genlist_last_item_get(const Evas_Object *obj)
{
+ ELM_GENLIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_last_item_get(&ret));
+ return ret;
+}
+
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Elm_Gen_Item *it;
- ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
- if (!sd->items) return NULL;
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ if (!sd->items) return;
it = ELM_GEN_ITEM_FROM_INLIST(sd->items->last);
while ((it) && (it->generation < sd->generation))
it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
elm_genlist_item_next_get(const Elm_Object_Item *item)
{
- Elm_Gen_Item *it;
+ Elm_Gen_Item *it = NULL;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -5574,7 +5753,7 @@ elm_genlist_item_next_get(const Elm_Object_Item *item)
EAPI Elm_Object_Item *
elm_genlist_item_prev_get(const Elm_Object_Item *item)
{
- Elm_Gen_Item *it;
+ Elm_Gen_Item *it = NULL;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item, NULL);
@@ -5701,7 +5880,7 @@ _elm_genlist_move_items_set(Elm_Gen_Item *it)
if (it->item->expanded)
{
GL_IT(it)->wsd->move_items = elm_genlist_realized_items_get
- (ELM_WIDGET_DATA(GL_IT(it)->wsd)->obj);
+ ((GL_IT(it)->wsd)->obj);
EINA_LIST_FOREACH_SAFE(GL_IT(it)->wsd->move_items, l, ll, it2)
{
@@ -5737,7 +5916,7 @@ _tray_alpha_bg_create(const Evas_Object *obj)
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
bg = evas_object_rectangle_add
- (evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ (evas_object_evas_get(sd->obj));
evas_object_color_set(bg, 0, 0, 0, 0);
evas_object_resize(bg, ow, oh);
evas_object_move(bg, ox, oy);
@@ -5885,13 +6064,13 @@ elm_genlist_item_show(Elm_Object_Item *item,
Elm_Genlist_Item_Scrollto_Type type)
{
Evas_Coord x, y, w, h;
- Elm_Gen_Item *it = (Elm_Gen_Item *)item;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
if (_elm_genlist_item_coordinates_calc
(item, type, EINA_FALSE, &x, &y, &w, &h))
- GL_IT(it)->wsd->s_iface->content_region_show(WIDGET(item), x, y, w, h);
+ eo_do(WIDGET(item), elm_scrollable_interface_content_region_show
+ (x, y, w, h));
}
EAPI void
@@ -5899,13 +6078,12 @@ elm_genlist_item_bring_in(Elm_Object_Item *item,
Elm_Genlist_Item_Scrollto_Type type)
{
Evas_Coord x, y, w, h;
- Elm_Gen_Item *it = (Elm_Gen_Item *)item;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(item);
if (_elm_genlist_item_coordinates_calc
(item, type, EINA_TRUE, &x, &y, &w, &h))
- GL_IT(it)->wsd->s_iface->region_bring_in(WIDGET(item), x, y, w, h);
+ eo_do(WIDGET(item), elm_scrollable_interface_region_bring_in(x, y, w, h));
}
EAPI void
@@ -6263,7 +6441,14 @@ elm_genlist_mode_set(Evas_Object *obj,
Elm_List_Mode mode)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_mode_set(mode));
+}
+
+static void
+_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_List_Mode mode = va_arg(*list, Elm_List_Mode);
+ Elm_Genlist_Smart_Data *sd = _pd;
if (sd->mode == mode) return;
sd->mode = mode;
@@ -6274,9 +6459,18 @@ EAPI Elm_List_Mode
elm_genlist_mode_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) ELM_LIST_LAST;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_List_Mode ret = ELM_LIST_LAST;
+ eo_do((Eo *) obj, elm_obj_genlist_mode_get(&ret));
+ return ret;
+}
- return sd->mode;
+static void
+_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_List_Mode *ret = va_arg(*list, Elm_List_Mode *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->mode;
}
EAPI void
@@ -6285,11 +6479,20 @@ elm_genlist_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
+}
+
+static void
+_bounce_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool h_bounce = va_arg(*list, int);
+ Eina_Bool v_bounce = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->h_bounce = !!h_bounce;
sd->v_bounce = !!v_bounce;
- sd->s_iface->bounce_allow_set(obj, sd->h_bounce, sd->v_bounce);
+ eo_do_super(obj, elm_scrollable_interface_bounce_allow_set
+ (sd->h_bounce, sd->v_bounce));
}
EAPI void
@@ -6298,7 +6501,16 @@ elm_genlist_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get
+ (h_bounce, v_bounce));
+}
+
+static void
+_bounce_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *h_bounce = va_arg(*list, Eina_Bool *);
+ Eina_Bool *v_bounce = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
if (h_bounce) *h_bounce = sd->h_bounce;
if (v_bounce) *v_bounce = sd->v_bounce;
@@ -6309,7 +6521,14 @@ elm_genlist_homogeneous_set(Evas_Object *obj,
Eina_Bool homogeneous)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_homogeneous_set(homogeneous));
+}
+
+static void
+_homogeneous_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool homogeneous = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->homogeneous = !!homogeneous;
}
@@ -6318,9 +6537,18 @@ EAPI Eina_Bool
elm_genlist_homogeneous_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_homogeneous_get(&ret));
+ return ret;
+}
- return sd->homogeneous;
+static void
+_homogeneous_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->homogeneous;
}
EAPI void
@@ -6328,7 +6556,14 @@ elm_genlist_block_count_set(Evas_Object *obj,
int count)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_block_count_set(count));
+}
+
+static void
+_block_count_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int count = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
EINA_SAFETY_ON_TRUE_RETURN(count < 1);
sd->max_items_per_block = count;
@@ -6340,9 +6575,18 @@ EAPI int
elm_genlist_block_count_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) 0;
- ELM_GENLIST_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_genlist_block_count_get(&ret));
+ return ret;
+}
- return sd->max_items_per_block;
+static void
+_block_count_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->max_items_per_block;
}
EAPI void
@@ -6350,7 +6594,14 @@ elm_genlist_longpress_timeout_set(Evas_Object *obj,
double timeout)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_longpress_timeout_set(timeout));
+}
+
+static void
+_longpress_timeout_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double timeout = va_arg(*list, double);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->longpress_timeout = timeout;
}
@@ -6359,9 +6610,18 @@ EAPI double
elm_genlist_longpress_timeout_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) 0;
- ELM_GENLIST_DATA_GET(obj, sd);
+ double ret = 0;
+ eo_do((Eo *) obj, elm_obj_genlist_longpress_timeout_get(&ret));
+ return ret;
+}
+
+static void
+_longpress_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Genlist_Smart_Data *sd = _pd;
- return sd->longpress_timeout;
+ *ret = sd->longpress_timeout;
}
EAPI void
@@ -6370,13 +6630,20 @@ elm_genlist_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_v)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Scroller_Policy policy_h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy policy_v = va_arg(*list, Elm_Scroller_Policy);
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
return;
- sd->s_iface->policy_set(obj, policy_h, policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
}
EAPI void
@@ -6384,12 +6651,20 @@ elm_genlist_scroller_policy_get(const Evas_Object *obj,
Elm_Scroller_Policy *policy_h,
Elm_Scroller_Policy *policy_v)
{
+ ELM_GENLIST_CHECK(obj);
+ eo_do((Eo *) obj, elm_scrollable_interface_policy_get(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
Elm_Scroller_Policy s_policy_h, s_policy_v;
- ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Scroller_Policy *policy_h = va_arg(*list, Elm_Scroller_Policy *);
+ Elm_Scroller_Policy *policy_v = va_arg(*list, Elm_Scroller_Policy *);
- sd->s_iface->policy_get(obj, &s_policy_h, &s_policy_v);
+ eo_do_super((Eo *)obj, elm_scrollable_interface_policy_get
+ (&s_policy_h, &s_policy_v));
if (policy_h) *policy_h = (Elm_Scroller_Policy)s_policy_h;
if (policy_v) *policy_v = (Elm_Scroller_Policy)s_policy_v;
}
@@ -6397,11 +6672,16 @@ elm_genlist_scroller_policy_get(const Evas_Object *obj,
EAPI void
elm_genlist_realized_items_update(Evas_Object *obj)
{
+ ELM_GENLIST_CHECK(obj);
+ eo_do(obj, elm_obj_genlist_realized_items_update());
+}
+
+static void
+_realized_items_update(Eo *obj, void *_pd EINA_UNUSED, va_list *list_unused EINA_UNUSED)
+{
Eina_List *list, *l;
Elm_Object_Item *it;
- ELM_GENLIST_CHECK(obj);
-
list = elm_genlist_realized_items_get(obj);
EINA_LIST_FOREACH(list, l, it)
elm_genlist_item_update(it);
@@ -6440,7 +6720,7 @@ elm_genlist_item_decorate_mode_set(Elm_Object_Item *item,
}
else
{
- it2 = elm_genlist_selected_item_get(ELM_WIDGET_DATA(sd)->obj);
+ it2 = elm_genlist_selected_item_get(sd->obj);
if ((it2) && (((Elm_Gen_Item *)it2)->realized))
elm_genlist_item_selected_set(it2, EINA_FALSE);
}
@@ -6467,30 +6747,55 @@ EAPI Elm_Object_Item *
elm_genlist_decorated_item_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) NULL;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_genlist_decorated_item_get(&ret));
+ return ret;
+}
- return (Elm_Object_Item *)sd->mode_item;
+static void
+_decorated_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = (Elm_Object_Item *)sd->mode_item;
}
EAPI Eina_Bool
elm_genlist_decorate_mode_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_decorate_mode_get(&ret));
+ return ret;
+}
- return sd->decorate_all_mode;
+static void
+_decorate_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->decorate_all_mode;
}
EAPI void
elm_genlist_decorate_mode_set(Evas_Object *obj,
Eina_Bool decorated)
{
+ ELM_GENLIST_CHECK(obj);
+ eo_do(obj, elm_obj_genlist_decorate_mode_set(decorated));
+}
+
+static void
+_decorate_mode_set(Eo *obj, void *_pd, va_list *valist)
+{
Elm_Gen_Item *it;
Eina_List *list, *l;
Elm_Object_Item *deco_it;
- ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool decorated = va_arg(*valist, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
decorated = !!decorated;
if (sd->decorate_all_mode == decorated) return;
@@ -6543,7 +6848,14 @@ elm_genlist_reorder_mode_set(Evas_Object *obj,
Eina_Bool reorder_mode)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_reorder_mode_set(reorder_mode));
+}
+
+static void
+_reorder_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool reorder_mode = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->reorder_mode = !!reorder_mode;
}
@@ -6552,9 +6864,18 @@ EAPI Eina_Bool
elm_genlist_reorder_mode_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_reorder_mode_get(&ret));
+ return ret;
+}
- return sd->reorder_mode;
+static void
+_reorder_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->reorder_mode;
}
EAPI Elm_Genlist_Item_Type
@@ -6672,7 +6993,14 @@ elm_genlist_select_mode_set(Evas_Object *obj,
Elm_Object_Select_Mode mode)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_select_mode_set(mode));
+}
+
+static void
+_select_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode mode = va_arg(*list, Elm_Object_Select_Mode);
+ Elm_Genlist_Smart_Data *sd = _pd;
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
return;
@@ -6685,9 +7013,18 @@ EAPI Elm_Object_Select_Mode
elm_genlist_select_mode_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) ELM_OBJECT_SELECT_MODE_MAX;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Elm_Object_Select_Mode ret = ELM_OBJECT_SELECT_MODE_MAX;
+ eo_do((Eo *) obj, elm_obj_genlist_select_mode_get(&ret));
+ return ret;
+}
- return sd->select_mode;
+static void
+_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *);
+ Elm_Genlist_Smart_Data *sd = _pd;
+
+ *ret = sd->select_mode;
}
EAPI void
@@ -6695,7 +7032,14 @@ elm_genlist_highlight_mode_set(Evas_Object *obj,
Eina_Bool highlight)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_highlight_mode_set(highlight));
+}
+
+static void
+_highlight_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool highlight = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->highlight = !!highlight;
}
@@ -6704,9 +7048,18 @@ EAPI Eina_Bool
elm_genlist_highlight_mode_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_highlight_mode_get(&ret));
+ return ret;
+}
+
+static void
+_highlight_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
- return sd->highlight;
+ *ret = sd->highlight;
}
EAPI void
@@ -6762,7 +7115,14 @@ elm_genlist_tree_effect_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_GENLIST_CHECK(obj);
- ELM_GENLIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_genlist_tree_effect_enabled_set(enabled));
+}
+
+static void
+_tree_effect_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Genlist_Smart_Data *sd = _pd;
sd->tree_effect_enabled = !!enabled;
}
@@ -6771,9 +7131,18 @@ EAPI Eina_Bool
elm_genlist_tree_effect_enabled_get(const Evas_Object *obj)
{
ELM_GENLIST_CHECK(obj) EINA_FALSE;
- ELM_GENLIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_genlist_tree_effect_enabled_get(&ret));
+ return ret;
+}
+
+static void
+_tree_effect_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Genlist_Smart_Data *sd = _pd;
- return sd->tree_effect_enabled;
+ *ret = sd->tree_effect_enabled;
}
EAPI Elm_Object_Item *
@@ -6796,3 +7165,126 @@ elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth)
return (Elm_Object_Item *)it;
}
+static void
+_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_MEMBER_ADD), _elm_genlist_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_genlist_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_genlist_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_genlist_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_genlist_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_genlist_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_genlist_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_genlist_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_genlist_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_genlist_smart_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_genlist_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_genlist_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_genlist_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_genlist_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_genlist_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_genlist_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), _elm_genlist_smart_layout_sub_object_add_enable),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET), _bounce_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_GET), _bounce_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _scroller_policy_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET), _scroller_policy_get),
+
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT), _items_count),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT), _item_sorted_insert),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_CLEAR), _clear_eo),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET), _multi_select_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET), _multi_select_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET), _selected_items_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET), _realized_items_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET), _at_xy_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_SET), _mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_GET), _mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET), _homogeneous_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET), _homogeneous_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET), _block_count_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET), _block_count_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET), _longpress_timeout_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET), _longpress_timeout_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE), _realized_items_update),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET), _decorated_item_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET), _decorate_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET), _decorate_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET), _reorder_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET), _reorder_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET), _select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET), _select_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET), _highlight_mode_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET), _highlight_mode_get),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET), _tree_effect_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET), _tree_effect_enabled_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT, "Return how many items are currently in a list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND, "Append a new item in a given genlist widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND, "Prepend a new item in a given genlist widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER, "Insert an item after another in a genlist widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE, "Insert an item before another in a genlist widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT, "Insert a new item into the sorted genlist object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_CLEAR, "Remove all items from a given genlist widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET, "Enable or disable multi-selection in the genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET, "Gets if multi-selection in genlist is enabled or disabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET, "Get the selected item in the genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET, "Get a list of selected items in the genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET, "Get a list of realized items in genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET, "Get the item that is at the x, y canvas coords."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET, "Get the first item in the genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET, "Get the last item in the genlist."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_MODE_SET, "This sets the horizontal stretching mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_MODE_GET, "Gets the horizontal stretching mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET, "Enable/disable homogeneous mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET, "Get whether the homogeneous mode is enabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET, "Set the maximum number of items within an item block."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET, "Get the maximum number of items within an item block."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET, "Set the timeout in seconds for the longpress event."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET, "Get the timeout in seconds for the longpress event."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE, "Update the contents of all realized items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET, "Get active genlist mode item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET, "Get Genlist decorate mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET, "Set Genlist decorate mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET, "Set reorder mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET, "Get the reorder mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET, "Set the genlist select mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET, "Get the genlist select mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET, "Set whether the genlist items' should be highlighted when item selected."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET, "Get whether the genlist items' should be highlighted when item selected."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET, "Set Genlist tree effect."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET, "Get Genlist tree effect."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_GENLIST_BASE_ID, op_desc, ELM_OBJ_GENLIST_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Genlist_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_genlist_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, ELM_SCROLLABLE_INTERFACE, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_genlist.h b/src/lib/elm_genlist.h
index cd850cbac..505a03582 100644
--- a/src/lib/elm_genlist.h
+++ b/src/lib/elm_genlist.h
@@ -378,6 +378,513 @@
* - @ref genlist_example_05
*/
+#define ELM_OBJ_GENLIST_PAN_CLASS elm_obj_genlist_pan_class_get()
+
+const Eo_Class *elm_obj_genlist_pan_class_get(void) EINA_CONST;
+
+#define ELM_OBJ_GENLIST_CLASS elm_obj_genlist_class_get()
+
+const Eo_Class *elm_obj_genlist_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_GENLIST_BASE_ID;
+
+enum
+{
+ ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT,
+ ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT,
+ ELM_OBJ_GENLIST_SUB_ID_CLEAR,
+ ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET,
+ ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET,
+ ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET,
+ ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET,
+ ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET,
+ ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_GENLIST_SUB_ID_MODE_SET,
+ ELM_OBJ_GENLIST_SUB_ID_MODE_GET,
+ ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET,
+ ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET,
+ ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET,
+ ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET,
+ ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET,
+ ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET,
+ ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE,
+ ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET,
+ ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET,
+ ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET,
+ ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET,
+ ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET,
+ ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET,
+ ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET,
+ ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET,
+ ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET,
+ ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET,
+ ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET,
+ ELM_OBJ_GENLIST_SUB_ID_LAST
+};
+
+#define ELM_OBJ_GENLIST_ID(sub_id) (ELM_OBJ_GENLIST_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_genlist_items_count
+ * @since 1.8
+ *
+ * Return how many items are currently in a list
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_items_count
+ */
+#define elm_obj_genlist_items_count(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret)
+
+/**
+ * @def elm_obj_genlist_item_append
+ * @since 1.8
+ *
+ * Append a new item in a given genlist widget.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] parent
+ * @param[in] type
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_genlist_item_append
+ */
+#define elm_obj_genlist_item_append(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_item_prepend
+ * @since 1.8
+ *
+ * Prepend a new item in a given genlist widget.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] parent
+ * @param[in] type
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_genlist_item_prepend
+ */
+#define elm_obj_genlist_item_prepend(itc, data, parent, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_item_insert_after
+ * @since 1.8
+ *
+ * Insert an item after another in a genlist widget
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] parent
+ * @param[in] after_it
+ * @param[in] type
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_genlist_item_insert_after
+ */
+#define elm_obj_genlist_item_insert_after(itc, data, parent, after_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, after_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_item_insert_before
+ * @since 1.8
+ *
+ * Insert an item before another in a genlist widget
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] parent
+ * @param[in] before_it
+ * @param[in] type
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_genlist_item_insert_before
+ */
+#define elm_obj_genlist_item_insert_before(itc, data, parent, before_it, type, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item *, before_it), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_item_sorted_insert
+ * @since 1.8
+ *
+ * Insert a new item into the sorted genlist object
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] parent
+ * @param[in] type
+ * @param[in] comp
+ * @param[in] func
+ * @param[in] func_data
+ * @param[out] ret
+ *
+ * @see elm_genlist_item_sorted_insert
+ */
+#define elm_obj_genlist_item_sorted_insert(itc, data, parent, type, comp, func, func_data, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Genlist_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Genlist_Item_Type, type), EO_TYPECHECK(Eina_Compare_Cb, comp), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, func_data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_clear
+ * @since 1.8
+ *
+ * Remove all items from a given genlist widget.
+ *
+ *
+ * @see elm_genlist_clear
+ */
+#define elm_obj_genlist_clear() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_genlist_multi_select_set
+ * @since 1.8
+ *
+ * Enable or disable multi-selection in the genlist
+ *
+ * @param[in] multi
+ *
+ * @see elm_genlist_multi_select_set
+ */
+#define elm_obj_genlist_multi_select_set(multi) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi)
+
+/**
+ * @def elm_obj_genlist_multi_select_get
+ * @since 1.8
+ *
+ * Gets if multi-selection in genlist is enabled or disabled.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_multi_select_get
+ */
+#define elm_obj_genlist_multi_select_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_genlist_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item in the genlist.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_selected_item_get
+ */
+#define elm_obj_genlist_selected_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_selected_items_get
+ * @since 1.8
+ *
+ * Get a list of selected items in the genlist.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_selected_items_get
+ */
+#define elm_obj_genlist_selected_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_genlist_realized_items_get
+ * @since 1.8
+ *
+ * Get a list of realized items in genlist
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_realized_items_get
+ */
+#define elm_obj_genlist_realized_items_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_GET), EO_TYPECHECK(Eina_List **, ret)
+
+/**
+ * @def elm_obj_genlist_at_xy_item_get
+ * @since 1.8
+ *
+ * Get the item that is at the x, y canvas coords.
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[out] posret
+ * @param[out] ret
+ *
+ * @see elm_genlist_at_xy_item_get
+ */
+#define elm_obj_genlist_at_xy_item_get(x, y, posret, ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_AT_XY_ITEM_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(int *, posret), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in the genlist
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_first_item_get
+ */
+#define elm_obj_genlist_first_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in the genlist
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_last_item_get
+ */
+#define elm_obj_genlist_last_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_mode_set
+ * @since 1.8
+ *
+ * This sets the horizontal stretching mode.
+ *
+ * @param[in] mode
+ *
+ * @see elm_genlist_mode_set
+ */
+#define elm_obj_genlist_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_List_Mode, mode)
+
+/**
+ * @def elm_obj_genlist_mode_get
+ * @since 1.8
+ *
+ * Gets the horizontal stretching mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_mode_get
+ */
+#define elm_obj_genlist_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_List_Mode *, ret)
+
+/**
+ * @def elm_obj_genlist_homogeneous_set
+ * @since 1.8
+ *
+ * Enable/disable homogeneous mode.
+ *
+ * @param[in] homogeneous
+ *
+ * @see elm_genlist_homogeneous_set
+ */
+#define elm_obj_genlist_homogeneous_set(homogeneous) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous)
+
+/**
+ * @def elm_obj_genlist_homogeneous_get
+ * @since 1.8
+ *
+ * Get whether the homogeneous mode is enabled.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_homogeneous_get
+ */
+#define elm_obj_genlist_homogeneous_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_genlist_block_count_set
+ * @since 1.8
+ *
+ * Set the maximum number of items within an item block
+ *
+ * @param[in] count
+ *
+ * @see elm_genlist_block_count_set
+ */
+#define elm_obj_genlist_block_count_set(count) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_SET), EO_TYPECHECK(int, count)
+
+/**
+ * @def elm_obj_genlist_block_count_get
+ * @since 1.8
+ *
+ * Get the maximum number of items within an item block
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_block_count_get
+ */
+#define elm_obj_genlist_block_count_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_BLOCK_COUNT_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_genlist_longpress_timeout_set
+ * @since 1.8
+ *
+ * Set the timeout in seconds for the longpress event.
+ *
+ * @param[in] timeout
+ *
+ * @see elm_genlist_longpress_timeout_set
+ */
+#define elm_obj_genlist_longpress_timeout_set(timeout) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_SET), EO_TYPECHECK(double, timeout)
+
+/**
+ * @def elm_obj_genlist_longpress_timeout_get
+ * @since 1.8
+ *
+ * Get the timeout in seconds for the longpress event.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_longpress_timeout_get
+ */
+#define elm_obj_genlist_longpress_timeout_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_LONGPRESS_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_genlist_realized_items_update
+ * @since 1.8
+ *
+ * Update the contents of all realized items.
+ *
+ *
+ * @see elm_genlist_realized_items_update
+ */
+#define elm_obj_genlist_realized_items_update() ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REALIZED_ITEMS_UPDATE)
+
+/**
+ * @def elm_obj_genlist_decorated_item_get
+ * @since 1.8
+ *
+ * Get active genlist mode item
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_decorated_item_get
+ */
+#define elm_obj_genlist_decorated_item_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_genlist_decorate_mode_get
+ * @since 1.8
+ *
+ * Get Genlist decorate mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_decorate_mode_get
+ */
+#define elm_obj_genlist_decorate_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_genlist_decorate_mode_set
+ * @since 1.8
+ *
+ * Set Genlist decorate mode
+ *
+ * @param[in] decorated
+ *
+ * @see elm_genlist_decorate_mode_set
+ */
+#define elm_obj_genlist_decorate_mode_set(decorated) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_DECORATE_MODE_SET), EO_TYPECHECK(Eina_Bool, decorated)
+
+/**
+ * @def elm_obj_genlist_reorder_mode_set
+ * @since 1.8
+ *
+ * Set reorder mode
+ *
+ * @param[in] reorder_mode
+ *
+ * @see elm_genlist_reorder_mode_set
+ */
+#define elm_obj_genlist_reorder_mode_set(reorder_mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_SET), EO_TYPECHECK(Eina_Bool, reorder_mode)
+
+/**
+ * @def elm_obj_genlist_reorder_mode_get
+ * @since 1.8
+ *
+ * Get the reorder mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_reorder_mode_get
+ */
+#define elm_obj_genlist_reorder_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_REORDER_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_genlist_select_mode_set
+ * @since 1.8
+ *
+ * Set the genlist select mode.
+ *
+ * @param[in] mode
+ *
+ * @see elm_genlist_select_mode_set
+ */
+#define elm_obj_genlist_select_mode_set(mode) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode)
+
+/**
+ * @def elm_obj_genlist_select_mode_get
+ * @since 1.8
+ *
+ * Get the genlist select mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_select_mode_get
+ */
+#define elm_obj_genlist_select_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret)
+
+/**
+ * @def elm_obj_genlist_highlight_mode_set
+ * @since 1.8
+ *
+ * Set whether the genlist items' should be highlighted when item selected.
+ *
+ * @param[in] highlight
+ *
+ * @see elm_genlist_highlight_mode_set
+ */
+#define elm_obj_genlist_highlight_mode_set(highlight) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_SET), EO_TYPECHECK(Eina_Bool, highlight)
+
+/**
+ * @def elm_obj_genlist_highlight_mode_get
+ * @since 1.8
+ *
+ * Get whether the genlist items' should be highlighted when item selected.
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_highlight_mode_get
+ */
+#define elm_obj_genlist_highlight_mode_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_HIGHLIGHT_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_genlist_tree_effect_enabled_set
+ * @since 1.8
+ *
+ * Set Genlist tree effect
+ *
+ * @param[in] enabled
+ *
+ * @see elm_genlist_tree_effect_enabled_set
+ */
+#define elm_obj_genlist_tree_effect_enabled_set(enabled) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_genlist_tree_effect_enabled_get
+ * @since 1.8
+ *
+ * Get Genlist tree effect
+ *
+ * @param[out] ret
+ *
+ * @see elm_genlist_tree_effect_enabled_get
+ */
+#define elm_obj_genlist_tree_effect_enabled_get(ret) ELM_OBJ_GENLIST_ID(ELM_OBJ_GENLIST_SUB_ID_TREE_EFFECT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @addtogroup Genlist
* @{
diff --git a/src/lib/elm_gesture_layer.c b/src/lib/elm_gesture_layer.c
index 7f3dffd54..74e86b2fb 100644
--- a/src/lib/elm_gesture_layer.c
+++ b/src/lib/elm_gesture_layer.c
@@ -1,7 +1,13 @@
#include <Elementary.h>
#include "elm_priv.h"
-static const char GESTURE_LAYER_SMART_NAME[] = "elm_gesture_layer";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_GESTURE_LAYER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_GESTURE_LAYER_CLASS
+
+#define MY_CLASS_NAME "elm_gesture_layer"
/* Some defaults */
#define ELM_MOUSE_DEVICE 0
@@ -49,7 +55,7 @@ _glayer_buf_dup(void *buf, size_t size)
((sd->gesture[T]) ? sd->gesture[T]->test : EINA_FALSE)
#define ELM_GESTURE_LAYER_DATA_GET(o, sd) \
- Elm_Gesture_Layer_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Gesture_Layer_Smart_Data * sd = eo_data_get(o, MY_CLASS)
#define ELM_GESTURE_LAYER_DATA_GET_OR_RETURN(o, ptr) \
ELM_GESTURE_LAYER_DATA_GET(o, ptr); \
@@ -70,14 +76,9 @@ _glayer_buf_dup(void *buf, size_t size)
}
#define ELM_GESTURE_LAYER_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), \
- GESTURE_LAYER_SMART_NAME, __func__)) \
+ if (!obj || !eo_isa(obj, MY_CLASS)) \
return
-EVAS_SMART_SUBCLASS_NEW
- (GESTURE_LAYER_SMART_NAME, _elm_gesture_layer, Elm_Widget_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
-
/**
* @internal
*
@@ -355,10 +356,6 @@ typedef struct _Rotate_Type Rotate_Type;
typedef struct _Elm_Gesture_Layer_Smart_Data Elm_Gesture_Layer_Smart_Data;
struct _Elm_Gesture_Layer_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *target; /* Target Widget */
Event_History *event_history_list;
@@ -3570,23 +3567,24 @@ _rotate_test(Evas_Object *obj,
}
}
-static Eina_Bool
-_elm_gesture_layer_smart_disable(Evas_Object *obj)
+static void
+_elm_gesture_layer_smart_disable(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (elm_widget_disabled_get(obj))
_callbacks_unregister(obj);
else
_callbacks_register(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_gesture_layer_smart_add(Evas_Object *obj)
+_elm_gesture_layer_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Gesture_Layer_Smart_Data);
+ eo_do_super(obj, evas_obj_smart_add());
- _elm_gesture_layer_parent_sc->base.add(obj);
+ Elm_Gesture_Layer_Smart_Data *priv = _pd;
priv->target = NULL;
priv->line_min_length =
@@ -3614,13 +3612,12 @@ _elm_gesture_layer_smart_add(Evas_Object *obj)
}
static void
-_elm_gesture_layer_smart_del(Evas_Object *obj)
+_elm_gesture_layer_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
Pointer_Event *data;
int i;
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
-
_event_history_clear(obj);
eina_list_free(sd->pending);
@@ -3640,41 +3637,43 @@ _elm_gesture_layer_smart_del(Evas_Object *obj)
free(sd->gesture[i]);
}
- _elm_gesture_layer_parent_sc->base.del(obj); /* handles freeing sd */
-}
-
-static void
-_elm_gesture_layer_smart_set_user(Elm_Widget_Smart_Class *sc)
-{
- sc->base.add = _elm_gesture_layer_smart_add;
- sc->base.del = _elm_gesture_layer_smart_del;
-
- sc->disable = _elm_gesture_layer_smart_disable;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_gesture_layer_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_gesture_layer_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Eina_Bool
elm_gesture_layer_hold_events_get(const Evas_Object *obj)
{
ELM_GESTURE_LAYER_CHECK(obj) EINA_FALSE;
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_gesture_layer_hold_events_get(&ret));
+ return ret;
+}
- return !sd->repeat_events;
+static void
+_hold_events_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
+ *ret = !sd->repeat_events;
}
EAPI void
@@ -3682,7 +3681,14 @@ elm_gesture_layer_hold_events_set(Evas_Object *obj,
Eina_Bool hold_events)
{
ELM_GESTURE_LAYER_CHECK(obj);
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gesture_layer_hold_events_set(hold_events));
+}
+
+static void
+_hold_events_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool hold_events = va_arg(*list, int);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
sd->repeat_events = !(!!hold_events);
}
@@ -3691,9 +3697,17 @@ EAPI double
elm_gesture_layer_zoom_step_get(const Evas_Object *obj)
{
ELM_GESTURE_LAYER_CHECK(obj) 0;
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ double ret = 0;
+ eo_do((Eo *) obj, elm_obj_gesture_layer_zoom_step_get(&ret));
+ return ret;
+}
- return sd->zoom_step;
+static void
+_zoom_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
+ *ret = sd->zoom_step;
}
EAPI void
@@ -3701,7 +3715,14 @@ elm_gesture_layer_zoom_step_set(Evas_Object *obj,
double step)
{
ELM_GESTURE_LAYER_CHECK(obj);
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gesture_layer_zoom_step_set(step));
+}
+
+static void
+_zoom_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double step = va_arg(*list, double);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
if (step < 0) return;
@@ -3712,9 +3733,17 @@ EAPI double
elm_gesture_layer_rotate_step_get(const Evas_Object *obj)
{
ELM_GESTURE_LAYER_CHECK(obj) 0;
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ double ret = 0;
+ eo_do((Eo *) obj, elm_obj_gesture_layer_rotate_step_get(&ret));
+ return ret;
+}
- return sd->rotate_step;
+static void
+_rotate_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
+ *ret = sd->rotate_step;
}
EAPI void
@@ -3722,7 +3751,14 @@ elm_gesture_layer_rotate_step_set(Evas_Object *obj,
double step)
{
ELM_GESTURE_LAYER_CHECK(obj);
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gesture_layer_rotate_step_set(step));
+}
+
+static void
+_rotate_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double step = va_arg(*list, double);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
if (step < 0) return;
@@ -3734,9 +3770,20 @@ elm_gesture_layer_attach(Evas_Object *obj,
Evas_Object *target)
{
ELM_GESTURE_LAYER_CHECK(obj) EINA_FALSE;
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_gesture_layer_attach(target, &ret));
+ return ret;
+}
- if (!target) return EINA_FALSE;
+static void
+_attach(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *target = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
+ if (ret) *ret = EINA_FALSE;
+
+ if (!target) return;
/* if was attached before, unregister callbacks first */
if (sd->target)
@@ -3745,7 +3792,7 @@ elm_gesture_layer_attach(Evas_Object *obj,
sd->target = target;
_callbacks_register(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI void
@@ -3755,10 +3802,20 @@ elm_gesture_layer_cb_set(Evas_Object *obj,
Elm_Gesture_Event_Cb cb,
void *data)
{
- Gesture_Info *p;
-
ELM_GESTURE_LAYER_CHECK(obj);
- ELM_GESTURE_LAYER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_gesture_layer_cb_set(idx, cb_type, cb, data));
+}
+
+static void
+_cb_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Gesture_Type idx = va_arg(*list, Elm_Gesture_Type);
+ Elm_Gesture_State cb_type = va_arg(*list, Elm_Gesture_State);
+ Elm_Gesture_Event_Cb cb = va_arg(*list, Elm_Gesture_Event_Cb);
+ void *data = va_arg(*list, void *);
+
+ Gesture_Info *p;
+ Elm_Gesture_Layer_Smart_Data *sd = _pd;
if (!sd->gesture[idx])
sd->gesture[idx] = calloc(1, sizeof(Gesture_Info));
@@ -3772,3 +3829,52 @@ elm_gesture_layer_cb_set(Evas_Object *obj,
p->state = ELM_GESTURE_STATE_UNDEFINED;
SET_TEST_BIT(p);
}
+
+static void
+_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_gesture_layer_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_gesture_layer_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_gesture_layer_smart_disable),
+
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), _hold_events_get),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), _hold_events_set),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), _zoom_step_get),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), _zoom_step_set),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), _rotate_step_get),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), _rotate_step_set),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), _attach),
+ EO_OP_FUNC(ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), _cb_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET, "Call this function to get repeat-events settings."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET, "This function is to make gesture-layer repeat events."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET, "This function returns step-value for zoom action."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET, "This function sets step-value for zoom action."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET, "This function returns step-value for rotate action."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET, "This function sets step-value for rotate action."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH, "Attach a given gesture layer widget to an Evas object, thus setting the widget's target."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET, "Use function to set callbacks to be notified about change of state of gesture."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_GESTURE_LAYER_BASE_ID, op_desc, ELM_OBJ_GESTURE_LAYER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Gesture_Layer_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_gesture_layer_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_gesture_layer.h b/src/lib/elm_gesture_layer.h
index 66451b70a..878120581 100644
--- a/src/lib/elm_gesture_layer.h
+++ b/src/lib/elm_gesture_layer.h
@@ -67,6 +67,130 @@
*
*/
+#define ELM_OBJ_GESTURE_LAYER_CLASS elm_obj_gesture_layer_class_get()
+
+const Eo_Class *elm_obj_gesture_layer_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_GESTURE_LAYER_BASE_ID;
+
+enum
+{
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET,
+ ELM_OBJ_GESTURE_LAYER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_GESTURE_LAYER_ID(sub_id) (ELM_OBJ_GESTURE_LAYER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_gesture_layer_hold_events_get
+ * @since 1.8
+ *
+ * Call this function to get repeat-events settings.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gesture_layer_hold_events_get
+ */
+#define elm_obj_gesture_layer_hold_events_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gesture_layer_hold_events_set
+ * @since 1.8
+ *
+ * This function is to make gesture-layer repeat events.
+ *
+ * @param[in] hold_events
+ *
+ * @see elm_gesture_layer_hold_events_set
+ */
+#define elm_obj_gesture_layer_hold_events_set(hold_events) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_HOLD_EVENTS_SET), EO_TYPECHECK(Eina_Bool, hold_events)
+
+/**
+ * @def elm_obj_gesture_layer_zoom_step_get
+ * @since 1.8
+ *
+ * This function returns step-value for zoom action.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gesture_layer_zoom_step_get
+ */
+#define elm_obj_gesture_layer_zoom_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_gesture_layer_zoom_step_set
+ * @since 1.8
+ *
+ * This function sets step-value for zoom action.
+ *
+ * @param[in] step
+ *
+ * @see elm_gesture_layer_zoom_step_set
+ */
+#define elm_obj_gesture_layer_zoom_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ZOOM_STEP_SET), EO_TYPECHECK(double, step)
+
+/**
+ * @def elm_obj_gesture_layer_rotate_step_get
+ * @since 1.8
+ *
+ * This function returns step-value for rotate action.
+ *
+ * @param[out] ret
+ *
+ * @see elm_gesture_layer_rotate_step_get
+ */
+#define elm_obj_gesture_layer_rotate_step_get(ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_gesture_layer_rotate_step_set
+ * @since 1.8
+ *
+ * This function sets step-value for rotate action.
+ *
+ * @param[in] step
+ *
+ * @see elm_gesture_layer_rotate_step_set
+ */
+#define elm_obj_gesture_layer_rotate_step_set(step) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ROTATE_STEP_SET), EO_TYPECHECK(double, step)
+
+/**
+ * @def elm_obj_gesture_layer_attach
+ * @since 1.8
+ *
+ * Attach a given gesture layer widget to an Evas object, thus setting
+ * the widget's @b target.
+ *
+ * @param[in] target
+ * @param[out] ret
+ *
+ * @see elm_gesture_layer_attach
+ */
+#define elm_obj_gesture_layer_attach(target, ret) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_ATTACH), EO_TYPECHECK(Evas_Object *, target), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_gesture_layer_cb_set
+ * @since 1.8
+ *
+ * Use function to set callbacks to be notified about
+ * change of state of gesture.
+ *
+ * @param[in] idx
+ * @param[in] cb_type
+ * @param[in] cb
+ * @param[in] data
+ *
+ * @see elm_gesture_layer_cb_set
+ */
+#define elm_obj_gesture_layer_cb_set(idx, cb_type, cb, data) ELM_OBJ_GESTURE_LAYER_ID(ELM_OBJ_GESTURE_LAYER_SUB_ID_CB_SET), EO_TYPECHECK(Elm_Gesture_Type, idx), EO_TYPECHECK(Elm_Gesture_State, cb_type), EO_TYPECHECK(Elm_Gesture_Event_Cb, cb), EO_TYPECHECK(void *, data)
+
/**
* @enum _Elm_Gesture_Type
* Enum of supported gesture types.
diff --git a/src/lib/elm_glview.c b/src/lib/elm_glview.c
index b9ec7da03..c2689164c 100644
--- a/src/lib/elm_glview.c
+++ b/src/lib/elm_glview.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_glview.h"
-EAPI const char ELM_GLVIEW_SMART_NAME[] = "elm_glview";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_GLVIEW_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_GLVIEW_CLASS
+
+#define MY_CLASS_NAME "elm_glview"
static const char SIG_FOCUSED[] = "focused";
static const char SIG_UNFOCUSED[] = "unfocused";
@@ -14,44 +20,42 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_GLVIEW_SMART_NAME, _elm_glview, Elm_Glview_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_glview_smart_on_focus(Evas_Object *obj)
+static void
+_elm_glview_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (elm_widget_focus_get(obj))
{
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
}
else
{
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
_glview_update_surface(Evas_Object *obj)
{
ELM_GLVIEW_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!sd) return;
if (sd->surface)
{
evas_object_image_native_surface_set
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL);
+ (wd->resize_obj, NULL);
evas_gl_surface_destroy(sd->evasgl, sd->surface);
sd->surface = NULL;
}
- evas_object_image_size_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->w, sd->h);
+ evas_object_image_size_set(wd->resize_obj, sd->w, sd->h);
if (!sd->surface)
{
@@ -61,19 +65,19 @@ _glview_update_surface(Evas_Object *obj)
(sd->evasgl, sd->config, sd->w, sd->h);
evas_gl_native_surface_get(sd->evasgl, sd->surface, &ns);
evas_object_image_native_surface_set
- (ELM_WIDGET_DATA(sd)->resize_obj, &ns);
+ (wd->resize_obj, &ns);
elm_glview_changed_set(obj);
}
}
static void
-_elm_glview_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_glview_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Glview_Smart_Data * sd = _pd;
- _elm_glview_parent_sc->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
sd->resized = EINA_TRUE;
@@ -146,6 +150,7 @@ static void
_set_render_policy_callback(Evas_Object *obj)
{
ELM_GLVIEW_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
switch (sd->render_policy)
{
@@ -159,7 +164,7 @@ _set_render_policy_callback(Evas_Object *obj)
// Set pixel getter callback
evas_object_image_pixels_get_callback_set
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
(Evas_Object_Image_Pixels_Get_Cb)_render_cb,
obj);
break;
@@ -167,7 +172,7 @@ _set_render_policy_callback(Evas_Object *obj)
case ELM_GLVIEW_RENDER_POLICY_ALWAYS:
// Unset the pixel getter callback if set already
evas_object_image_pixels_get_callback_set
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL);
+ (wd->resize_obj, NULL, NULL);
break;
@@ -178,17 +183,16 @@ _set_render_policy_callback(Evas_Object *obj)
}
static void
-_elm_glview_smart_add(Evas_Object *obj)
+_elm_glview_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Glview_Smart_Data);
-
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
// Create image to render Evas_GL Surface
- ELM_WIDGET_DATA(priv)->resize_obj =
- evas_object_image_filled_add(evas_object_evas_get(obj));
- evas_object_image_size_set(ELM_WIDGET_DATA(priv)->resize_obj, 1, 1);
+ wd->resize_obj = evas_object_image_filled_add(evas_object_evas_get(obj));
+ evas_object_image_size_set(wd->resize_obj, 1, 1);
- _elm_glview_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
+ Elm_Glview_Smart_Data *priv = _pd;
// Evas_GL
priv->evasgl = evas_gl_new(evas_object_evas_get(obj));
if (!priv->evasgl)
@@ -242,9 +246,9 @@ _elm_glview_smart_add(Evas_Object *obj)
}
static void
-_elm_glview_smart_del(Evas_Object *obj)
+_elm_glview_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Elm_Glview_Smart_Data * sd = _pd;
// Call delete func if it's registered
if (sd->del_func)
@@ -261,67 +265,52 @@ _elm_glview_smart_del(Evas_Object *obj)
if (sd->config) evas_gl_config_free(sd->config);
if (sd->evasgl) evas_gl_free(sd->evasgl);
- _elm_glview_parent_sc->base.del(obj); /* handles freeing sd */
-}
-
-static void
-_elm_glview_smart_set_user(Elm_Glview_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_glview_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_glview_smart_del;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_glview_smart_resize;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_glview_smart_on_focus;
-}
-
-EAPI const Elm_Glview_Smart_Class *
-elm_glview_smart_class_get(void)
-{
- static Elm_Glview_Smart_Class _sc =
- ELM_GLVIEW_SMART_CLASS_INIT_NAME_VERSION(ELM_GLVIEW_SMART_NAME);
- static const Elm_Glview_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_glview_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_glview_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_glview_smart_class_new(), parent);
- if (!obj) return NULL;
-
- ELM_GLVIEW_DATA_GET(obj, sd);
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ const Elm_Glview_Smart_Data *sd = _pd;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
if (!sd->evasgl)
{
- evas_object_del(obj);
- return NULL;
+ eo_error_set(obj);
+ return;
}
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Evas_GL_API *
elm_glview_gl_api_get(const Evas_Object *obj)
{
ELM_GLVIEW_CHECK(obj) NULL;
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Evas_GL_API *ret = NULL;
+ eo_do((Eo *)obj, elm_obj_glview_gl_api_get(&ret));
+ return ret;
+}
- return evas_gl_api_get(sd->evasgl);
+static void
+_gl_api_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_GL_API **ret = va_arg(*list, Evas_GL_API **);
+ const Elm_Glview_Smart_Data *sd = _pd;
+ *ret = evas_gl_api_get(sd->evasgl);
}
EAPI Eina_Bool
@@ -329,7 +318,18 @@ elm_glview_mode_set(Evas_Object *obj,
Elm_GLView_Mode mode)
{
ELM_GLVIEW_CHECK(obj) EINA_FALSE;
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_glview_mode_set(mode, &ret));
+ return ret;
+}
+
+static void
+_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_GLView_Mode mode = va_arg(*list, Elm_GLView_Mode);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Glview_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
// Set the configs
if (mode & ELM_GLVIEW_ALPHA) sd->config->color_format = EVAS_GL_RGBA_8888;
@@ -348,15 +348,15 @@ elm_glview_mode_set(Evas_Object *obj,
// Check for Alpha Channel and enable it
if (mode & ELM_GLVIEW_ALPHA)
- evas_object_image_alpha_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ evas_object_image_alpha_set(wd->resize_obj, EINA_TRUE);
else
- evas_object_image_alpha_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_image_alpha_set(wd->resize_obj, EINA_FALSE);
sd->mode = mode;
elm_glview_changed_set(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI Eina_Bool
@@ -364,9 +364,20 @@ elm_glview_resize_policy_set(Evas_Object *obj,
Elm_GLView_Resize_Policy policy)
{
ELM_GLVIEW_CHECK(obj) EINA_FALSE;
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_glview_resize_policy_set(policy, &ret));
+ return ret;
+}
- if (policy == sd->scale_policy) return EINA_TRUE;
+static void
+_resize_policy_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_GLView_Resize_Policy policy = va_arg(*list, Elm_GLView_Resize_Policy);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
+ Elm_Glview_Smart_Data *sd = _pd;
+
+ if (policy == sd->scale_policy) return;
switch (policy)
{
case ELM_GLVIEW_RESIZE_POLICY_RECREATE:
@@ -374,11 +385,12 @@ elm_glview_resize_policy_set(Evas_Object *obj,
sd->scale_policy = policy;
_glview_update_surface(obj);
elm_glview_changed_set(obj);
- return EINA_TRUE;
+ return;
default:
ERR("Invalid Scale Policy.\n");
- return EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
+ return;
}
}
@@ -387,22 +399,32 @@ elm_glview_render_policy_set(Evas_Object *obj,
Elm_GLView_Render_Policy policy)
{
ELM_GLVIEW_CHECK(obj) EINA_FALSE;
- ELM_GLVIEW_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_glview_render_policy_set(policy, &ret));
+ return ret;
+}
+
+static void
+_render_policy_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_GLView_Render_Policy policy = va_arg(*list, Elm_GLView_Render_Policy);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Glview_Smart_Data *sd = _pd;
+ if (ret) *ret = EINA_TRUE;
if ((policy != ELM_GLVIEW_RENDER_POLICY_ON_DEMAND) &&
(policy != ELM_GLVIEW_RENDER_POLICY_ALWAYS))
{
ERR("Invalid Render Policy.\n");
- return EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
+ return;
}
- if (sd->render_policy == policy) return EINA_TRUE;
+ if (sd->render_policy == policy) return;
sd->render_policy = policy;
_set_render_policy_callback(obj);
_glview_update_surface(obj);
-
- return EINA_TRUE;
}
EAPI void
@@ -411,7 +433,15 @@ elm_glview_size_set(Evas_Object *obj,
int h)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_size_set(w, h));
+}
+
+static void
+_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ Elm_Glview_Smart_Data *sd = _pd;
if ((w == sd->w) && (h == sd->h)) return;
@@ -428,7 +458,15 @@ elm_glview_size_get(const Evas_Object *obj,
int *h)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_glview_size_get(w, h));
+}
+
+static void
+_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+ Elm_Glview_Smart_Data *sd = _pd;
if (w) *w = sd->w;
if (h) *h = sd->h;
@@ -439,7 +477,14 @@ elm_glview_init_func_set(Evas_Object *obj,
Elm_GLView_Func_Cb func)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_init_func_set(func));
+}
+
+static void
+_init_func_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_GLView_Func_Cb func = va_arg(*list, Elm_GLView_Func_Cb);
+ Elm_Glview_Smart_Data *sd = _pd;
sd->initialized = EINA_FALSE;
sd->init_func = func;
@@ -450,7 +495,14 @@ elm_glview_del_func_set(Evas_Object *obj,
Elm_GLView_Func_Cb func)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_del_func_set(func));
+}
+
+static void
+_del_func_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_GLView_Func_Cb func = va_arg(*list, Elm_GLView_Func_Cb);
+ Elm_Glview_Smart_Data *sd = _pd;
sd->del_func = func;
}
@@ -460,7 +512,14 @@ elm_glview_resize_func_set(Evas_Object *obj,
Elm_GLView_Func_Cb func)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_resize_func_set(func));
+}
+
+static void
+_resize_func_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_GLView_Func_Cb func = va_arg(*list, Elm_GLView_Func_Cb);
+ Elm_Glview_Smart_Data *sd = _pd;
sd->resize_func = func;
}
@@ -470,7 +529,14 @@ elm_glview_render_func_set(Evas_Object *obj,
Elm_GLView_Func_Cb func)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_render_func_set(func));
+}
+
+static void
+_render_func_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_GLView_Func_Cb func = va_arg(*list, Elm_GLView_Func_Cb);
+ Elm_Glview_Smart_Data *sd = _pd;
sd->render_func = func;
_set_render_policy_callback(obj);
@@ -480,12 +546,76 @@ EAPI void
elm_glview_changed_set(Evas_Object *obj)
{
ELM_GLVIEW_CHECK(obj);
- ELM_GLVIEW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_glview_changed_set());
+}
+
+static void
+_changed_set(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Glview_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_image_pixels_dirty_set
- (ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ (wd->resize_obj, EINA_TRUE);
if (sd->render_policy == ELM_GLVIEW_RENDER_POLICY_ALWAYS &&
!sd->render_idle_enterer)
sd->render_idle_enterer =
ecore_idle_enterer_before_add((Ecore_Task_Cb)_render_cb, obj);
}
+
+static void
+_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_glview_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_glview_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_glview_smart_resize),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_glview_smart_on_focus),
+
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET), _gl_api_get),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_MODE_SET), _mode_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET), _resize_policy_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET), _render_policy_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET), _size_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET), _size_get),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET), _init_func_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET), _del_func_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET), _resize_func_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET), _render_func_set),
+ EO_OP_FUNC(ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET), _changed_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET, "Gets the gl api struct for gl rendering."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_MODE_SET, "Set the mode of the GLView."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET, "Set the resize policy for the glview object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET, "Set the render policy for the glview object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET, "Sets the size of the glview."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET, "Gets the size of the glview."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET, "Set the init function that runs once in the main loop."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET, "Set the render function that runs in the main loop."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET, "Set the resize function that gets called when resize happens."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET, "Set the render function that runs in the main loop."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET, "Notifies that there has been changes in the GLView."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_GLVIEW_BASE_ID, op_desc, ELM_OBJ_GLVIEW_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Glview_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_glview_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
+
diff --git a/src/lib/elm_glview.h b/src/lib/elm_glview.h
index aa2738215..5dc9b8f3a 100644
--- a/src/lib/elm_glview.h
+++ b/src/lib/elm_glview.h
@@ -16,6 +16,167 @@
*
*/
+#define ELM_OBJ_GLVIEW_CLASS elm_obj_glview_class_get()
+
+const Eo_Class *elm_obj_glview_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_GLVIEW_BASE_ID;
+
+enum
+{
+ ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET,
+ ELM_OBJ_GLVIEW_SUB_ID_MODE_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET,
+ ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET,
+ ELM_OBJ_GLVIEW_SUB_ID_LAST
+};
+
+#define ELM_OBJ_GLVIEW_ID(sub_id) (ELM_OBJ_GLVIEW_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_glview_gl_api_get
+ * @since 1.8
+ *
+ * Gets the gl api struct for gl rendering
+ *
+ * @param[out] ret
+ *
+ * @see elm_glview_gl_api_get
+ */
+#define elm_obj_glview_gl_api_get(ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_GL_API_GET), EO_TYPECHECK(Evas_GL_API **, ret)
+
+/**
+ * @def elm_obj_glview_mode_set
+ * @since 1.8
+ *
+ * Set the mode of the GLView. Supports alpha, depth, stencil.
+ *
+ * @param[in] mode
+ * @param[out] ret
+ *
+ * @see elm_glview_mode_set
+ */
+#define elm_obj_glview_mode_set(mode, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_GLView_Mode, mode), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_glview_resize_policy_set
+ * @since 1.8
+ *
+ * Set the resize policy for the glview object.
+ *
+ * @param[in] policy
+ * @param[out] ret
+ *
+ * @see elm_glview_resize_policy_set
+ */
+#define elm_obj_glview_resize_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_POLICY_SET), EO_TYPECHECK(Elm_GLView_Resize_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_glview_render_policy_set
+ * @since 1.8
+ *
+ * Set the render policy for the glview object.
+ *
+ * @param[in] policy
+ * @param[out] ret
+ *
+ * @see elm_glview_render_policy_set
+ */
+#define elm_obj_glview_render_policy_set(policy, ret) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_POLICY_SET), EO_TYPECHECK(Elm_GLView_Render_Policy, policy), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_glview_size_set
+ * @since 1.8
+ *
+ * Sets the size of the glview
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_glview_size_set
+ */
+#define elm_obj_glview_size_set(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_glview_size_get
+ * @since 1.8
+ *
+ * Gets the size of the glview.
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_glview_size_get
+ */
+#define elm_obj_glview_size_get(w, h) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_glview_init_func_set
+ * @since 1.8
+ *
+ * Set the init function that runs once in the main loop.
+ *
+ * @param[in] func
+ *
+ * @see elm_glview_init_func_set
+ */
+#define elm_obj_glview_init_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_INIT_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func)
+
+/**
+ * @def elm_obj_glview_del_func_set
+ * @since 1.8
+ *
+ * Set the render function that runs in the main loop.
+ *
+ * @param[in] func
+ *
+ * @see elm_glview_del_func_set
+ */
+#define elm_obj_glview_del_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_DEL_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func)
+
+/**
+ * @def elm_obj_glview_resize_func_set
+ * @since 1.8
+ *
+ * Set the resize function that gets called when resize happens.
+ *
+ * @param[in] func
+ *
+ * @see elm_glview_resize_func_set
+ */
+#define elm_obj_glview_resize_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RESIZE_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func)
+
+/**
+ * @def elm_obj_glview_render_func_set
+ * @since 1.8
+ *
+ * Set the render function that runs in the main loop.
+ *
+ * @param[in] func
+ *
+ * @see elm_glview_render_func_set
+ */
+#define elm_obj_glview_render_func_set(func) ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_RENDER_FUNC_SET), EO_TYPECHECK(Elm_GLView_Func_Cb, func)
+
+/**
+ * @def elm_obj_glview_changed_set
+ * @since 1.8
+ *
+ * Notifies that there has been changes in the GLView.
+ *
+ *
+ * @see elm_glview_changed_set
+ */
+#define elm_obj_glview_changed_set() ELM_OBJ_GLVIEW_ID(ELM_OBJ_GLVIEW_SUB_ID_CHANGED_SET)
+
typedef void (*Elm_GLView_Func_Cb)(Evas_Object *obj);
typedef enum _Elm_GLView_Mode
diff --git a/src/lib/elm_grid.c b/src/lib/elm_grid.c
index eb7f8e5a7..2330535b8 100644
--- a/src/lib/elm_grid.c
+++ b/src/lib/elm_grid.c
@@ -2,23 +2,34 @@
#include "elm_priv.h"
#include "elm_widget_grid.h"
-EAPI const char ELM_GRID_SMART_NAME[] = "elm_grid";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_GRID_SMART_NAME, _elm_grid, Elm_Grid_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_GRID_BASE_ID = EO_NOOP;
-static Eina_Bool
-_elm_grid_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+#define MY_CLASS ELM_OBJ_GRID_CLASS
+#define MY_CLASS_NAME "elm_grid"
+
+static void
+_elm_grid_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_grid_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
const Eina_List *items;
Eina_List *(*list_free)(Eina_List *list);
void *(*list_data_get)(const Eina_List *list);
- ELM_GRID_DATA_GET(obj, sd);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ ELM_WIDGET_DATA_GET(obj, wd);
/* Focus chain */
/* TODO: Change this to use other chain */
@@ -29,33 +40,43 @@ _elm_grid_smart_focus_next(const Evas_Object *obj,
}
else
{
- items = evas_object_grid_children_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ items = evas_object_grid_children_get(wd->resize_obj);
list_data_get = eina_list_data_get;
list_free = eina_list_free;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
if (list_free) list_free((Eina_List *)items);
- return ret;
+ if (ret) *ret = int_ret;
+}
+
+static void
+_elm_grid_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_grid_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_grid_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
const Eina_List *items;
Eina_List *(*list_free)(Eina_List *list);
void *(*list_data_get)(const Eina_List *list);
- ELM_GRID_DATA_GET(obj, sd);
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ ELM_WIDGET_DATA_GET(obj, wd);
/* Focus chain */
/* TODO: Change this to use other chain */
@@ -66,118 +87,99 @@ _elm_grid_smart_focus_direction(const Evas_Object *obj,
}
else
{
- items = evas_object_grid_children_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ items = evas_object_grid_children_get(wd->resize_obj);
list_data_get = eina_list_data_get;
list_free = eina_list_free;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- ret = elm_widget_focus_list_direction_get(obj, base, items, list_data_get,
+ int_ret = elm_widget_focus_list_direction_get(obj, base, items, list_data_get,
degree, direction, weight);
if (list_free) list_free((Eina_List *)items);
- return ret;
+ if (ret) *ret = int_ret;
}
static void
_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
{
- ELM_GRID_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
- evas_object_grid_mirrored_set(ELM_WIDGET_DATA(sd)->resize_obj, rtl);
+ evas_object_grid_mirrored_set(wd->resize_obj, rtl);
}
-static Eina_Bool
-_elm_grid_smart_theme(Evas_Object *obj)
+static void
+_elm_grid_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_grid_parent_sc->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_grid_smart_add(Evas_Object *obj)
+_elm_grid_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Grid_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
- evas_object_grid_add(evas_object_evas_get(obj));
- evas_object_grid_size_set(ELM_WIDGET_DATA(priv)->resize_obj, 100, 100);
+ wd->resize_obj = evas_object_grid_add(evas_object_evas_get(obj));
+ evas_object_grid_size_set(wd->resize_obj, 100, 100);
- _elm_grid_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
- _elm_grid_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
static void
-_elm_grid_smart_del(Evas_Object *obj)
+_elm_grid_smart_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Eina_List *l;
Evas_Object *child;
- ELM_GRID_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
/* let's make our grid object the *last* to be processed, since it
* may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(ELM_WIDGET_DATA(sd)->subobjs, l, child)
+ EINA_LIST_FOREACH(wd->subobjs, l, child)
{
- if (child == ELM_WIDGET_DATA(sd)->resize_obj)
+ if (child == wd->resize_obj)
{
- ELM_WIDGET_DATA(sd)->subobjs =
- eina_list_demote_list(ELM_WIDGET_DATA(sd)->subobjs, l);
+ wd->subobjs =
+ eina_list_demote_list(wd->subobjs, l);
break;
}
}
- _elm_grid_parent_sc->base.del(obj);
-}
-
-static void
-_elm_grid_smart_set_user(Elm_Grid_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_grid_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_grid_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_grid_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_grid_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_grid_smart_focus_direction;
-}
-
-EAPI const Elm_Grid_Smart_Class *
-elm_grid_smart_class_get(void)
-{
- static Elm_Grid_Smart_Class _sc =
- ELM_GRID_SMART_CLASS_INIT_NAME_VERSION(ELM_GRID_SMART_NAME);
- static const Elm_Grid_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_grid_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_grid_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_grid_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -186,9 +188,17 @@ elm_grid_size_set(Evas_Object *obj,
Evas_Coord h)
{
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_grid_size_set(w, h));
+}
- evas_object_grid_size_set(ELM_WIDGET_DATA(sd)->resize_obj, w, h);
+static void
+_size_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ ELM_WIDGET_DATA_GET(obj, wd);
+
+ evas_object_grid_size_set(wd->resize_obj, w, h);
}
EAPI void
@@ -197,9 +207,18 @@ elm_grid_size_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_grid_size_get(w, h));
+}
- evas_object_grid_size_get(ELM_WIDGET_DATA(sd)->resize_obj, w, h);
+static void
+_size_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+
+ ELM_WIDGET_DATA_GET(obj, wd);
+
+ evas_object_grid_size_get(wd->resize_obj, w, h);
}
EAPI void
@@ -211,10 +230,23 @@ elm_grid_pack(Evas_Object *obj,
Evas_Coord h)
{
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_grid_pack(subobj, x, y, w, h));
+}
+
+
+static void
+_pack(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+
+ ELM_WIDGET_DATA_GET(obj, wd);
elm_widget_sub_object_add(obj, subobj);
- evas_object_grid_pack(ELM_WIDGET_DATA(sd)->resize_obj, subobj, x, y, w, h);
+ evas_object_grid_pack(wd->resize_obj, subobj, x, y, w, h);
}
EAPI void
@@ -222,30 +254,46 @@ elm_grid_unpack(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_grid_unpack(subobj));
+}
+
+static void
+_unpack(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+
+ ELM_WIDGET_DATA_GET(obj, wd);
elm_widget_sub_object_del(obj, subobj);
- evas_object_grid_unpack(ELM_WIDGET_DATA(sd)->resize_obj, subobj);
+ evas_object_grid_unpack(wd->resize_obj, subobj);
}
EAPI void
elm_grid_clear(Evas_Object *obj,
Eina_Bool clear)
{
+ ELM_GRID_CHECK(obj);
+ eo_do(obj, elm_obj_grid_clear(clear));
+}
+
+static void
+_clear(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool clear = va_arg(*list, int);
+
Eina_List *chld;
Evas_Object *o;
- ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
if (!clear)
{
- chld = evas_object_grid_children_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ chld = evas_object_grid_children_get(wd->resize_obj);
EINA_LIST_FREE (chld, o)
elm_widget_sub_object_del(obj, o);
}
- evas_object_grid_clear(ELM_WIDGET_DATA(sd)->resize_obj, clear);
+ evas_object_grid_clear(wd->resize_obj, clear);
}
EAPI void
@@ -258,9 +306,9 @@ elm_grid_pack_set(Evas_Object *subobj,
Evas_Object *obj = elm_widget_parent_widget_get(subobj);
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
- evas_object_grid_pack(ELM_WIDGET_DATA(sd)->resize_obj, subobj, x, y, w, h);
+ evas_object_grid_pack(wd->resize_obj, subobj, x, y, w, h);
}
EAPI void
@@ -273,17 +321,76 @@ elm_grid_pack_get(Evas_Object *subobj,
Evas_Object *obj = elm_widget_parent_widget_get(subobj);
ELM_GRID_CHECK(obj);
- ELM_GRID_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_grid_pack_get
- (ELM_WIDGET_DATA(sd)->resize_obj, subobj, x, y, w, h);
+ (wd->resize_obj, subobj, x, y, w, h);
}
EAPI Eina_List *
elm_grid_children_get(const Evas_Object *obj)
{
ELM_GRID_CHECK(obj) NULL;
- ELM_GRID_DATA_GET(obj, sd);
+ Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_grid_children_get(&ret));
+ return ret;
+}
+
- return evas_object_grid_children_get(ELM_WIDGET_DATA(sd)->resize_obj);
+static void
+_children_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = evas_object_grid_children_get(wd->resize_obj);
+ return;
}
+
+static void
+_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_grid_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_grid_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_grid_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_grid_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_grid_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_grid_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_grid_smart_focus_direction),
+
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_SET), _size_set),
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_GET), _size_get),
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_PACK), _pack),
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_UNPACK), _unpack),
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CHILDREN_GET), _children_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_SIZE_SET, "Set the virtual size of the grid."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_SIZE_GET, "Get the virtual size of the grid."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_PACK, "Pack child at given position and size."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_UNPACK, "Unpack a child from a grid object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_CLEAR, "Faster way to remove all child objects from a grid object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_GRID_SUB_ID_CHILDREN_GET, "Get the list of the children for the grid."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_GRID_BASE_ID, op_desc, ELM_OBJ_GRID_SUB_ID_LAST),
+ NULL,
+ 0,
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_grid_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_grid.h b/src/lib/elm_grid.h
index b99a330ed..d2b5bf2ae 100644
--- a/src/lib/elm_grid.h
+++ b/src/lib/elm_grid.h
@@ -17,6 +17,106 @@
* @{
*/
+
+#define ELM_OBJ_GRID_CLASS elm_obj_grid_class_get()
+
+const Eo_Class *elm_obj_grid_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_GRID_BASE_ID;
+
+enum
+{
+
+ ELM_OBJ_GRID_SUB_ID_SIZE_SET,
+ ELM_OBJ_GRID_SUB_ID_SIZE_GET,
+ ELM_OBJ_GRID_SUB_ID_PACK,
+ ELM_OBJ_GRID_SUB_ID_UNPACK,
+ ELM_OBJ_GRID_SUB_ID_CLEAR,
+ ELM_OBJ_GRID_SUB_ID_CHILDREN_GET,
+ ELM_OBJ_GRID_SUB_ID_LAST
+};
+
+#define ELM_OBJ_GRID_ID(sub_id) (ELM_OBJ_GRID_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_grid_size_set
+ * @since 1.8
+ *
+ * Set the virtual size of the grid
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_grid_size_set
+ */
+#define elm_obj_grid_size_set(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_SET), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+
+/**
+ * @def elm_obj_grid_size_get
+ * @since 1.8
+ *
+ * Get the virtual size of the grid
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_grid_size_get
+ */
+#define elm_obj_grid_size_get(w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+/**
+ * @def elm_obj_grid_pack
+ * @since 1.8
+ *
+ * Pack child at given position and size
+ *
+ * @param[in] subobj
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_grid_pack
+ */
+#define elm_obj_grid_pack(subobj, x, y, w, h) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+
+/**
+ * @def elm_obj_grid_unpack
+ * @since 1.8
+ *
+ * Unpack a child from a grid object
+ *
+ * @param[in] subobj
+ *
+ * @see elm_grid_unpack
+ */
+#define elm_obj_grid_unpack(subobj) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_grid_clear
+ * @since 1.8
+ *
+ * Faster way to remove all child objects from a grid object.
+ *
+ * @param[in] clear
+ *
+ * @see elm_grid_clear
+ */
+#define elm_obj_grid_clear(clear) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear)
+
+/**
+ * @def elm_obj_grid_children_get
+ * @since 1.8
+ *
+ * Get the list of the children for the grid.
+ *
+ * @param[out] ret
+ *
+ * @see elm_grid_children_get
+ */
+#define elm_obj_grid_children_get(ret) ELM_OBJ_GRID_ID(ELM_OBJ_GRID_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret)
+
/**
* Add a new grid to the parent
*
diff --git a/src/lib/elm_hover.c b/src/lib/elm_hover.c
index 281d71cd8..020ae1c30 100644
--- a/src/lib/elm_hover.c
+++ b/src/lib/elm_hover.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_hover.h"
-EAPI const char ELM_HOVER_SMART_NAME[] = "elm_hover";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_HOVER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_HOVER_CLASS
+
+#define MY_CLASS_NAME "elm_hover"
#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -43,10 +49,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_HOVER_SMART_NAME, _elm_hover, Elm_Hover_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_parent_move_cb(void *data,
Evas *e __UNUSED__,
@@ -270,12 +272,16 @@ _hov_show_do(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_hover_smart_theme(Evas_Object *obj)
+static void
+_elm_hover_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Hover_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_hover_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (sd->smt_sub) _elm_hover_smt_sub_re_eval(obj);
@@ -283,16 +289,16 @@ _elm_hover_smart_theme(Evas_Object *obj)
if (evas_object_visible_get(obj)) _hov_show_do(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_hover_smart_sizing_eval(Evas_Object *obj)
+_elm_hover_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord ofs_x, x = 0, y = 0, w = 0, h = 0, x2 = 0,
y2 = 0, w2 = 0, h2 = 0;
- ELM_HOVER_DATA_GET(obj, sd);
+ Elm_Hover_Smart_Data *sd = _pd;
if (sd->on_del) return;
@@ -302,8 +308,9 @@ _elm_hover_smart_sizing_eval(Evas_Object *obj)
if (elm_widget_mirrored_get(obj)) ofs_x = w - (x2 - x) - w2;
else ofs_x = x2 - x;
- evas_object_move(ELM_WIDGET_DATA(sd)->resize_obj, x, y);
- evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, w, h);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ evas_object_move(wd->resize_obj, x, y);
+ evas_object_resize(wd->resize_obj, w, h);
evas_object_size_hint_min_set(sd->offset, ofs_x, y2 - y);
evas_object_size_hint_min_set(sd->size, w2, h2);
}
@@ -317,30 +324,36 @@ _on_smt_sub_changed(void *data,
_elm_hover_smt_sub_re_eval(data);
}
-static Eina_Bool
-_elm_hover_smart_sub_object_add(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_hover_smart_sub_object_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Hover_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_hover_parent_sc)->sub_object_add(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
+ if (!int_ret) return;
if (sd->smt_sub && sd->smt_sub->obj == sobj)
evas_object_event_callback_add
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_smt_sub_changed, obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_hover_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_hover_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Hover_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_hover_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sd->smt_sub && sd->smt_sub->obj == sobj)
{
@@ -363,7 +376,7 @@ _elm_hover_smart_sub_object_del(Evas_Object *obj,
}
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -379,15 +392,17 @@ _elm_hover_subs_del(Elm_Hover_Smart_Data *sd)
}
}
-static Eina_Bool
-_elm_hover_smart_content_set(Evas_Object *obj,
- const char *swallow,
- Evas_Object *content)
+static void
+_elm_hover_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_CHECK(obj) EINA_FALSE;
- ELM_HOVER_DATA_GET(obj, sd);
+ const char *swallow= va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Hover_Smart_Data *sd = _pd;
- if (!swallow) return EINA_FALSE;
+ if (!swallow) return;
if (!strcmp(swallow, "smart"))
{
@@ -421,9 +436,8 @@ _elm_hover_smart_content_set(Evas_Object *obj,
}
}
- if (!ELM_CONTAINER_CLASS(_elm_hover_parent_sc)->content_set
- (obj, swallow, content))
- return EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_set(swallow, content, &int_ret));
+ if (!int_ret) return;
if (strstr(swallow, "elm.swallow.slot."))
swallow += sizeof("elm.swallow.slot.");
@@ -439,44 +453,43 @@ _elm_hover_smart_content_set(Evas_Object *obj,
end:
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_hover_smart_content_get(const Evas_Object *obj,
- const char *swallow)
+static void
+_elm_hover_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_CHECK(obj) NULL;
-
- ELM_HOVER_DATA_GET(obj, sd);
+ const char *swallow = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Hover_Smart_Data *sd = _pd;
+ *ret = NULL;
- if (!swallow) return NULL;
+ if (!swallow) return;
if (!strcmp(swallow, "smart"))
- return ELM_CONTAINER_CLASS(_elm_hover_parent_sc)->content_get
- (obj, sd->smt_sub->swallow);
-
- return ELM_CONTAINER_CLASS(_elm_hover_parent_sc)->content_get(obj, swallow);
+ eo_do_super(obj, elm_obj_container_content_get(sd->smt_sub->swallow, ret));
+ else
+ eo_do_super(obj, elm_obj_container_content_get(swallow, ret));
}
-static Evas_Object *
-_elm_hover_smart_content_unset(Evas_Object *obj,
- const char *swallow)
+static void
+_elm_hover_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
- ELM_HOVER_CHECK(obj) NULL;
-
- ELM_HOVER_DATA_GET(obj, sd);
+ const char *swallow = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
+ Evas_Object *int_ret;
+ Elm_Hover_Smart_Data *sd = _pd;
- if (!swallow) return NULL;
+ if (!swallow) return;
if (!strcmp(swallow, "smart"))
- return ELM_CONTAINER_CLASS(_elm_hover_parent_sc)->content_unset
- (obj, sd->smt_sub->swallow);
-
- return ELM_CONTAINER_CLASS(_elm_hover_parent_sc)->content_unset
- (obj, swallow);
-
- return NULL;
+ eo_do_super(obj, elm_obj_container_content_unset
+ (sd->smt_sub->swallow, &int_ret));
+ else
+ eo_do_super(obj, elm_obj_container_content_unset
+ (swallow, &int_ret));
+ if (ret) *ret = int_ret;
}
static void
@@ -511,13 +524,13 @@ _hov_dismiss_cb(void *data,
}
static void
-_elm_hover_smart_add(Evas_Object *obj)
+_elm_hover_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
unsigned int i;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Hover_Smart_Data);
+ Elm_Hover_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
for (i = 0; i < sizeof(priv->subs) / sizeof(priv->subs[0]); i++)
priv->subs[i].swallow = _content_aliases[i].alias;
@@ -541,9 +554,9 @@ _elm_hover_smart_add(Evas_Object *obj)
}
static void
-_elm_hover_smart_del(Evas_Object *obj)
+_elm_hover_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_HOVER_DATA_GET(obj, sd);
+ Elm_Hover_Smart_Data *sd = _pd;
sd->on_del = EINA_TRUE;
@@ -555,43 +568,42 @@ _elm_hover_smart_del(Evas_Object *obj)
_elm_hover_parent_detach(obj);
sd->parent = NULL;
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_hover_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_hover_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.move(obj, x, y);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
elm_layout_sizing_eval(obj);
}
static void
-_elm_hover_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_hover_smart_resize(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.resize(obj, w, h);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
elm_layout_sizing_eval(obj);
}
static void
-_elm_hover_smart_show(Evas_Object *obj)
+_elm_hover_smart_show(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
_hov_show_do(obj);
}
static void
-_elm_hover_smart_hide(Evas_Object *obj)
+_elm_hover_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_HOVER_DATA_GET(obj, sd);
-
- ELM_WIDGET_CLASS(_elm_hover_parent_sc)->base.hide(obj);
+ Elm_Hover_Smart_Data *sd = _pd;
+ eo_do_super(obj, evas_obj_smart_hide());
elm_layout_signal_emit(obj, "elm,action,hide", "elm");
@@ -609,74 +621,32 @@ _elm_hover_smart_hide(Evas_Object *obj)
}
static void
-_elm_hover_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_hover_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- elm_hover_parent_set(obj, parent);
-
- elm_layout_sizing_eval(obj);
-}
-
-static void
-_elm_hover_smart_set_user(Elm_Hover_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_hover_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_hover_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_hover_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_hover_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.show = _elm_hover_smart_show;
- ELM_WIDGET_CLASS(sc)->base.hide = _elm_hover_smart_hide;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_hover_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_hover_smart_sub_object_add;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_hover_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->theme = _elm_hover_smart_theme;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_hover_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_hover_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_hover_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_hover_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
-}
-
-EAPI const Elm_Hover_Smart_Class *
-elm_hover_smart_class_get(void)
-{
- static Elm_Hover_Smart_Class _sc =
- ELM_HOVER_SMART_CLASS_INIT_NAME_VERSION(ELM_HOVER_SMART_NAME);
- static const Elm_Hover_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_hover_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
EAPI Evas_Object *
elm_hover_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_hover_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -684,7 +654,14 @@ elm_hover_target_set(Evas_Object *obj,
Evas_Object *target)
{
ELM_HOVER_CHECK(obj);
- ELM_HOVER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_hover_target_set(target));
+}
+
+static void
+_elm_hover_target_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *target = va_arg(*list, Evas_Object *);
+ Elm_Hover_Smart_Data *sd = _pd;
if (sd->target)
{
@@ -712,7 +689,14 @@ elm_hover_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
ELM_HOVER_CHECK(obj);
- ELM_HOVER_DATA_GET(obj, sd);
+ eo_do(obj, elm_wdg_parent_set(parent));
+}
+
+static void
+_elm_hover_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Hover_Smart_Data *sd = _pd;
_elm_hover_parent_detach(obj);
@@ -738,62 +722,171 @@ EAPI Evas_Object *
elm_hover_target_get(const Evas_Object *obj)
{
ELM_HOVER_CHECK(obj) NULL;
- ELM_HOVER_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_hover_target_get(&ret));
+ return ret;
+}
- return sd->target;
+static void
+_elm_hover_target_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Hover_Smart_Data *sd = _pd;
+ *ret = sd->target;
}
EAPI Evas_Object *
elm_hover_parent_get(const Evas_Object *obj)
{
ELM_HOVER_CHECK(obj) NULL;
- ELM_HOVER_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_parent_get(&ret));
+ return ret;
+}
- return sd->parent;
+static void
+_elm_hover_smart_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Hover_Smart_Data *sd = _pd;
+ *ret = sd->parent;
}
EAPI const char *
elm_hover_best_content_location_get(const Evas_Object *obj,
Elm_Hover_Axis pref_axis)
{
+ ELM_HOVER_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_hover_best_content_location_get(pref_axis, &ret));
+ return ret;
+}
+
+static void
+_elm_hover_best_content_location_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
Evas_Coord spc_l, spc_r, spc_t, spc_b;
- ELM_HOVER_CHECK(obj) NULL;
- ELM_HOVER_DATA_GET(obj, sd);
+ Elm_Hover_Axis pref_axis = va_arg(*list, Elm_Hover_Axis);
+ const char **ret = va_arg(*list, const char **);
+ Elm_Hover_Smart_Data *sd = _pd;
_elm_hover_left_space_calc(sd, &spc_l, &spc_t, &spc_r, &spc_b);
if (pref_axis == ELM_HOVER_AXIS_HORIZONTAL)
{
- if (spc_l < spc_r) return (_HOV_RIGHT)->swallow;
- else return (_HOV_LEFT)->swallow;
+ if (spc_l < spc_r) *ret = (_HOV_RIGHT)->swallow;
+ else *ret = (_HOV_LEFT)->swallow;
+ return;
}
else if (pref_axis == ELM_HOVER_AXIS_VERTICAL)
{
- if (spc_t < spc_b) return (_HOV_BOTTOM)->swallow;
- else return (_HOV_TOP)->swallow;
+ if (spc_t < spc_b) *ret = (_HOV_BOTTOM)->swallow;
+ else *ret = (_HOV_TOP)->swallow;
+ return;
}
if (spc_l < spc_r)
{
- if (spc_t > spc_r) return (_HOV_TOP)->swallow;
+ if (spc_t > spc_r)
+ *ret = (_HOV_TOP)->swallow;
else if (spc_b > spc_r)
- return (_HOV_BOTTOM)->swallow;
-
- return (_HOV_RIGHT)->swallow;
+ *ret = (_HOV_BOTTOM)->swallow;
+ else
+ *ret = (_HOV_RIGHT)->swallow;
+ return;
}
- if (spc_t > spc_r) return (_HOV_TOP)->swallow;
+ if (spc_t > spc_r)
+ *ret = (_HOV_TOP)->swallow;
else if (spc_b > spc_r)
- return (_HOV_BOTTOM)->swallow;
-
- return (_HOV_LEFT)->swallow;
+ *ret = (_HOV_BOTTOM)->swallow;
+ else
+ *ret = (_HOV_LEFT)->swallow;
}
EAPI void
elm_hover_dismiss(Evas_Object *obj)
{
ELM_HOVER_CHECK(obj);
+ eo_do(obj, elm_obj_hover_dismiss());
+}
+static void
+_elm_hover_dismiss(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
elm_layout_signal_emit(obj, "elm,action,dismiss", "");
}
+
+static void
+_elm_hover_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_hover_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_hover_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_hover_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_hover_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_hover_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_hover_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_hover_smart_hide),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_hover_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_hover_smart_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_hover_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_hover_smart_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), _elm_hover_smart_parent_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_hover_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_hover_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_hover_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_hover_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_hover_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_hover_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_hover_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_SET), _elm_hover_target_set),
+ EO_OP_FUNC(ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_GET), _elm_hover_target_get),
+ EO_OP_FUNC(ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET), _elm_hover_best_content_location_get),
+ EO_OP_FUNC(ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_DISMISS), _elm_hover_dismiss),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVER_SUB_ID_TARGET_SET, "Sets the target object for the hover."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVER_SUB_ID_TARGET_GET, "Gets the target object for the hover."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET, "Returns the best swallow location for content in the hover."),
+ EO_OP_DESCRIPTION(ELM_OBJ_HOVER_SUB_ID_DISMISS, "Dismiss a hover object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_HOVER_BASE_ID, op_desc, ELM_OBJ_HOVER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Hover_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_hover_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_hover.h b/src/lib/elm_hover.h
index 978327e2f..76fbed728 100644
--- a/src/lib/elm_hover.h
+++ b/src/lib/elm_hover.h
@@ -77,6 +77,73 @@
* @{
*/
+#define ELM_OBJ_HOVER_CLASS elm_obj_hover_class_get()
+
+const Eo_Class *elm_obj_hover_class_get(void) EINA_CONST;
+
+ extern EAPI Eo_Op ELM_OBJ_HOVER_BASE_ID;
+
+ enum
+ {
+ ELM_OBJ_HOVER_SUB_ID_TARGET_SET,
+ ELM_OBJ_HOVER_SUB_ID_TARGET_GET,
+ ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET,
+ ELM_OBJ_HOVER_SUB_ID_DISMISS,
+ ELM_OBJ_HOVER_SUB_ID_LAST
+ };
+
+#define ELM_OBJ_HOVER_ID(sub_id) (ELM_OBJ_HOVER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_hover_target_set
+ * @since 1.8
+ *
+ * @brief Sets the target object for the hover.
+ *
+ * @param[in] target
+ *
+ * @see elm_hover_target_set
+ */
+#define elm_obj_hover_target_set(target) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_SET), EO_TYPECHECK(Evas_Object *, target)
+
+/**
+ * @def elm_obj_hover_target_get
+ * @since 1.8
+ *
+ * @brief Gets the target object for the hover.
+ *
+ * @param[out] ret
+ *
+ * @see elm_hover_target_get
+ */
+#define elm_obj_hover_target_get(ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_TARGET_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_hover_best_content_location_get
+ * @since 1.8
+ *
+ * @brief Returns the best swallow location for content in the hover.
+ *
+ * @param[in] pref_axis
+ * @param[out] ret
+ *
+ * @see elm_hover_best_content_location_get
+ */
+#define elm_obj_hover_best_content_location_get(pref_axis, ret) ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_BEST_CONTENT_LOCATION_GET), EO_TYPECHECK(Elm_Hover_Axis, pref_axis), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_hover_dismiss
+ * @since 1.8
+ *
+ * @brief Dismiss a hover object
+ *
+ *
+ * @see elm_hover_dismiss
+ */
+#define elm_obj_hover_dismiss() ELM_OBJ_HOVER_ID(ELM_OBJ_HOVER_SUB_ID_DISMISS)
+
+
/**
* @typedef Elm_Hover_Axis
*
diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c
index 3ae774b00..882bf10ec 100644
--- a/src/lib/elm_icon.c
+++ b/src/lib/elm_icon.c
@@ -1,13 +1,19 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_icon.h"
+#include "elm_widget_image.h"
+
+#include <Eo.h>
#ifdef ELM_EFREET
#define NON_EXISTING (void *)-1
static const char *icon_theme = NULL;
#endif
-EAPI const char ELM_ICON_SMART_NAME[] = "elm_icon";
+EAPI Eo_Op ELM_OBJ_ICON_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_ICON_CLASS
+#define MY_CLASS_NAME "elm_icon"
#ifdef HAVE_ELEMENTARY_ETHUMB
static Eina_List *_elm_icon_retry = NULL;
@@ -22,10 +28,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_ICON_SMART_NAME, _elm_icon, Elm_Icon_Smart_Class,
- Elm_Image_Smart_Class, elm_image_smart_class_get, _smart_callbacks);
-
/* FIXME: move this code to ecore */
#ifdef _WIN32
static Eina_Bool
@@ -101,7 +103,7 @@ _icon_thumb_display(Elm_Icon_Smart_Data *sd)
}
ret = elm_image_file_set
- (ELM_WIDGET_DATA(sd)->obj, sd->thumb.thumb.path,
+ (sd->obj, sd->thumb.thumb.path,
sd->thumb.thumb.key);
sd->is_video = EINA_FALSE;
@@ -109,14 +111,14 @@ _icon_thumb_display(Elm_Icon_Smart_Data *sd)
if (!ret)
ret = elm_image_file_set
- (ELM_WIDGET_DATA(sd)->obj, sd->thumb.thumb.path, sd->thumb.thumb.key);
+ (sd->obj, sd->thumb.thumb.path, sd->thumb.thumb.key);
if (ret)
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_THUMB_DONE, NULL);
+ (sd->obj, SIG_THUMB_DONE, NULL);
else
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_THUMB_ERROR, NULL);
+ (sd->obj, SIG_THUMB_ERROR, NULL);
return ret;
}
@@ -150,9 +152,9 @@ _icon_thumb_finish(Elm_Icon_Smart_Data *sd,
Ethumb_Client *ethumbd)
{
const char *file = NULL, *group = NULL;
- Eina_Bool ret;
+ Eina_Bool ret = EINA_FALSE;
- elm_image_file_get(ELM_WIDGET_DATA(sd)->obj, &file, &group);
+ elm_image_file_get(sd->obj, &file, &group);
file = eina_stringshare_ref(file);
group = eina_stringshare_ref(group);
@@ -167,7 +169,7 @@ _icon_thumb_finish(Elm_Icon_Smart_Data *sd,
}
/* Back to previous image */
- elm_image_file_set(ELM_WIDGET_DATA(sd)->obj, file, group);
+ elm_image_file_set(sd->obj, file, group);
}
_icon_thumb_cleanup(ethumbd);
@@ -218,7 +220,7 @@ _icon_thumb_error(Ethumb_Client *client,
ERR("could not generate thumbnail for %s (key: %s)",
sd->thumb.file.path, sd->thumb.file.key);
- evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_THUMB_ERROR, NULL);
+ evas_object_smart_callback_call(sd->obj, SIG_THUMB_ERROR, NULL);
_icon_thumb_cleanup(client);
}
@@ -239,7 +241,7 @@ _icon_thumb_apply(Elm_Icon_Smart_Data *sd)
if (!ethumb_client_file_set
(ethumbd, sd->thumb.file.path, sd->thumb.file.key)) return;
- min_size = _icon_size_min_get(ELM_WIDGET_DATA(sd)->obj);
+ min_size = _icon_size_min_get(sd->obj);
ethumb_client_size_set(ethumbd, min_size, min_size);
sd->thumb.request = ethumb_client_thumb_async_get
@@ -319,11 +321,11 @@ _icon_freedesktop_set(Evas_Object * obj __UNUSED__,
}
static void
-_elm_icon_smart_sizing_eval(Evas_Object *obj)
+_elm_icon_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
int w, h;
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Smart_Data *sd = _pd;
if (sd->in_eval) return;
@@ -344,7 +346,7 @@ _elm_icon_smart_sizing_eval(Evas_Object *obj)
}
#endif
- _elm_icon_parent_sc->sizing_eval(obj);
+ eo_do_super(obj, elm_obj_image_sizing_eval());
sd->in_eval--;
}
@@ -362,16 +364,21 @@ _edje_signals_free(Elm_Icon_Smart_Data *sd)
}
}
-static Eina_Bool
-_elm_icon_smart_file_set(Evas_Object *obj,
- const char *file,
- const char *key)
+static void
+_elm_icon_smart_file_set(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *pclip;
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Smart_Data *sd = _pd;
+ Elm_Image_Smart_Data *id = eo_data_get(obj, ELM_OBJ_IMAGE_CLASS);
- EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
+ const char *file = va_arg(*list, const char *);
+ const char *key = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(file);
_edje_signals_free(sd);
@@ -383,79 +390,88 @@ _elm_icon_smart_file_set(Evas_Object *obj,
}
#endif
- if (!sd->is_video) return _elm_icon_parent_sc->file_set(obj, file, key);
+ if (!sd->is_video)
+ {
+ eo_do_super(obj, elm_obj_image_file_set(file, key, &int_ret));
+ if (ret) *ret = int_ret;
+ return;
+ }
/* parent's edje file setting path replicated here (we got .eet
* extension, so bypassing it) */
- if (ELM_IMAGE_DATA(sd)->prev_img)
- evas_object_del(ELM_IMAGE_DATA(sd)->prev_img);
- ELM_IMAGE_DATA(sd)->prev_img = NULL;
+ if (id->prev_img)
+ evas_object_del(id->prev_img);
+ id->prev_img = NULL;
- if (!ELM_IMAGE_DATA(sd)->edje)
+ if (!id->edje)
{
- pclip = evas_object_clip_get(ELM_IMAGE_DATA(sd)->img);
- if (ELM_IMAGE_DATA(sd)->img) evas_object_del(ELM_IMAGE_DATA(sd)->img);
+ pclip = evas_object_clip_get(id->img);
+ if (id->img) evas_object_del(id->img);
/* Edje object instead */
- ELM_IMAGE_DATA(sd)->img = edje_object_add(evas_object_evas_get(obj));
- evas_object_smart_member_add(ELM_IMAGE_DATA(sd)->img, obj);
- if (ELM_IMAGE_DATA(sd)->show)
- evas_object_show(ELM_IMAGE_DATA(sd)->img);
- evas_object_clip_set(ELM_IMAGE_DATA(sd)->img, pclip);
+ id->img = edje_object_add(evas_object_evas_get(obj));
+ evas_object_smart_member_add(id->img, obj);
+ if (id->show)
+ evas_object_show(id->img);
+ evas_object_clip_set(id->img, pclip);
}
- ELM_IMAGE_DATA(sd)->edje = EINA_TRUE;
- if (!edje_object_file_set(ELM_IMAGE_DATA(sd)->img, file, key))
+ id->edje = EINA_TRUE;
+ if (!edje_object_file_set(id->img, file, key))
{
ERR("failed to set edje file '%s', group '%s': %s", file, key,
edje_load_error_str
- (edje_object_load_error_get(ELM_IMAGE_DATA(sd)->img)));
- return EINA_FALSE;
+ (edje_object_load_error_get(id->img)));
+ return;
}
- evas_object_move(ELM_IMAGE_DATA(sd)->img, ELM_IMAGE_DATA(sd)->img_x,
- ELM_IMAGE_DATA(sd)->img_y);
- evas_object_resize(ELM_IMAGE_DATA(sd)->img, ELM_IMAGE_DATA(sd)->img_w,
- ELM_IMAGE_DATA(sd)->img_h);
+ evas_object_move(id->img, id->img_x,
+ id->img_y);
+ evas_object_resize(id->img, id->img_w,
+ id->img_h);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_icon_smart_memfile_set(Evas_Object *obj,
- const void *img,
- size_t size,
- const char *format,
- const char *key)
+static void
+_elm_icon_smart_memfile_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_ICON_DATA_GET(obj, sd);
-
- Eina_Bool ret;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(img, EINA_FALSE);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, EINA_FALSE);
+ Elm_Icon_Smart_Data *sd = _pd;
+
+ const void *img = va_arg(*list, const void *);
+ size_t size = va_arg(*list, size_t);
+ const char *format = va_arg(*list, const char *);
+ const char *key = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(img);
+ EINA_SAFETY_ON_TRUE_RETURN(!size);
eina_stringshare_del(sd->stdicon);
sd->stdicon = NULL;
_edje_signals_free(sd);
- ret = _elm_icon_parent_sc->memfile_set(obj, img, size, format, key);
-
- return ret;
+ eo_do_super(obj, elm_obj_image_memfile_set(img, size, format, key, &int_ret));
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_icon_smart_theme(Evas_Object *obj)
+static void
+_elm_icon_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
if (sd->stdicon)
_elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj));
- if (!ELM_WIDGET_CLASS(_elm_icon_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Eina_Bool
@@ -504,7 +520,7 @@ _elm_icon_standard_set(Evas_Object *obj,
Eina_Bool *fdo)
{
char *tmp;
- Eina_Bool ret;
+ Eina_Bool ret = EINA_FALSE;
ELM_ICON_DATA_GET(obj, sd);
@@ -542,7 +558,7 @@ _elm_icon_standard_set(Evas_Object *obj,
if (ret)
{
eina_stringshare_replace(&sd->stdicon, name);
- _elm_icon_smart_sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
return EINA_TRUE;
}
@@ -590,11 +606,10 @@ _elm_icon_thumb_resize_cb(void *data,
#endif
static void
-_elm_icon_smart_add(Evas_Object *obj)
+_elm_icon_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Icon_Smart_Data);
-
- ELM_WIDGET_CLASS(_elm_icon_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
+ Elm_Icon_Smart_Data *priv = _pd;
priv->lookup_order = ELM_ICON_LOOKUP_THEME_FDO;
@@ -604,13 +619,13 @@ _elm_icon_smart_add(Evas_Object *obj)
}
static void
-_elm_icon_smart_del(Evas_Object *obj)
+_elm_icon_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
#ifdef HAVE_ELEMENTARY_ETHUMB
Ethumb_Client *ethumbd;
#endif
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Smart_Data *sd = _pd;
if (sd->stdicon) eina_stringshare_del(sd->stdicon);
@@ -629,7 +644,7 @@ _elm_icon_smart_del(Evas_Object *obj)
_edje_signals_free(sd);
- ELM_WIDGET_CLASS(_elm_icon_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
/* WARNING: to be deprecated */
@@ -638,11 +653,12 @@ _elm_icon_signal_emit(Evas_Object *obj,
const char *emission,
const char *source)
{
- ELM_ICON_DATA_GET(obj, sd);
- if (!ELM_IMAGE_DATA(sd)->edje) return;
+ Elm_Image_Smart_Data *id = eo_data_get(obj, ELM_OBJ_IMAGE_CLASS);
- edje_object_signal_emit(ELM_IMAGE_DATA(sd)->img, emission, source);
+ if (!id->edje) return;
+
+ edje_object_signal_emit(id->img, emission, source);
}
static void
@@ -667,8 +683,9 @@ _elm_icon_signal_callback_add(Evas_Object *obj,
Edje_Signal_Data *esd;
ELM_ICON_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *id = eo_data_get(obj, ELM_OBJ_IMAGE_CLASS);
- if (!ELM_IMAGE_DATA(sd)->edje) return;
+ if (!id->edje) return;
esd = ELM_NEW(Edje_Signal_Data);
if (!esd) return;
@@ -682,7 +699,7 @@ _elm_icon_signal_callback_add(Evas_Object *obj,
eina_list_append(sd->edje_signals, esd);
edje_object_signal_callback_add
- (ELM_IMAGE_DATA(sd)->img, emission, source, _edje_signal_callback, esd);
+ (id->img, emission, source, _edje_signal_callback, esd);
}
/* WARNING: to be deprecated */
@@ -697,8 +714,9 @@ _elm_icon_signal_callback_del(Evas_Object *obj,
Eina_List *l;
ELM_ICON_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *id = eo_data_get(obj, ELM_OBJ_IMAGE_CLASS);
- if (!ELM_IMAGE_DATA(sd)->edje) return NULL;
+ if (!id->edje) return NULL;
EINA_LIST_FOREACH(sd->edje_signals, l, esd)
{
@@ -712,7 +730,7 @@ _elm_icon_signal_callback_del(Evas_Object *obj,
free(esd);
edje_object_signal_callback_del_full
- (ELM_IMAGE_DATA(sd)->img, emission, source,
+ (id->img, emission, source,
_edje_signal_callback, esd);
return data; /* stop at 1st match */
@@ -722,50 +740,28 @@ _elm_icon_signal_callback_del(Evas_Object *obj,
return data;
}
-static void
-_elm_icon_smart_set_user(Elm_Icon_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_icon_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_icon_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_icon_smart_theme;
-
- ELM_IMAGE_CLASS(sc)->file_set = _elm_icon_smart_file_set;
- ELM_IMAGE_CLASS(sc)->memfile_set = _elm_icon_smart_memfile_set;
- ELM_IMAGE_CLASS(sc)->sizing_eval = _elm_icon_smart_sizing_eval;
-}
-
-EAPI const Elm_Icon_Smart_Class *
-elm_icon_smart_class_get(void)
-{
- static Elm_Icon_Smart_Class _sc =
- ELM_ICON_SMART_CLASS_INIT_NAME_VERSION(ELM_ICON_SMART_NAME);
- static const Elm_Icon_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_icon_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_icon_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_icon_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Icon_Smart_Data *sd = _pd;
+ sd->obj = obj;
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Eina_Bool
@@ -777,7 +773,9 @@ elm_icon_memfile_set(Evas_Object *obj,
{
ELM_ICON_CHECK(obj) EINA_FALSE;
- return elm_image_memfile_set(obj, img, size, format, key);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_image_memfile_set(img, size, format, key, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -786,8 +784,11 @@ elm_icon_file_set(Evas_Object *obj,
const char *group)
{
ELM_ICON_CHECK(obj) EINA_FALSE;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
- return elm_image_file_set(obj, file, group);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_image_file_set(file, group, &ret));
+ return ret;
}
EAPI void
@@ -806,9 +807,16 @@ elm_icon_thumb_set(Evas_Object *obj,
const char *group)
{
ELM_ICON_CHECK(obj);
+ eo_do(obj, elm_obj_icon_thumb_set(file, group));
+}
+static void
+_thumb_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
#ifdef HAVE_ELEMENTARY_ETHUMB
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Smart_Data *sd = _pd;
evas_object_event_callback_del_full
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, sd);
@@ -834,6 +842,7 @@ elm_icon_thumb_set(Evas_Object *obj,
}
#else
(void)obj;
+ (void)_pd;
(void)file;
(void)group;
#endif
@@ -886,32 +895,58 @@ elm_icon_standard_set(Evas_Object *obj,
const char *name)
{
ELM_ICON_CHECK(obj) EINA_FALSE;
- ELM_ICON_DATA_GET(obj, sd);
+
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_icon_standard_set(name, &ret));
+ return ret;
+}
+
+static void
+_standard_set(Eo *obj, void *_pd, va_list *list)
+{
+
+ Elm_Icon_Smart_Data *sd = _pd;
Eina_Bool fdo = EINA_FALSE;
- Eina_Bool ret;
+ const char *name = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- if (!name) return EINA_FALSE;
+ if (!name)
+ {
+ if (ret) *ret = EINA_FALSE;
+ return;
+ }
evas_object_event_callback_del_full
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, sd);
- ret = _elm_icon_standard_set(obj, name, &fdo);
+ Eina_Bool int_ret = _elm_icon_standard_set(obj, name, &fdo);
if (fdo)
evas_object_event_callback_add
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, sd);
- return ret;
+ if (ret) *ret = int_ret;
}
EAPI const char *
elm_icon_standard_get(const Evas_Object *obj)
{
ELM_ICON_CHECK(obj) NULL;
- ELM_ICON_DATA_GET(obj, sd);
- return sd->stdicon;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_icon_standard_get(&ret));
+ return ret;
+}
+
+static void
+_standard_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+
+ Elm_Icon_Smart_Data *sd = _pd;
+ const char **ret = va_arg(*list, const char **);
+
+ *ret = sd->stdicon;
}
EAPI void
@@ -919,7 +954,16 @@ elm_icon_order_lookup_set(Evas_Object *obj,
Elm_Icon_Lookup_Order order)
{
ELM_ICON_CHECK(obj);
- ELM_ICON_DATA_GET(obj, sd);
+
+ eo_do(obj, elm_obj_icon_order_lookup_set(order));
+}
+
+static void
+_order_lookup_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+
+ Elm_Icon_Smart_Data *sd = _pd;
+ Elm_Icon_Lookup_Order order = va_arg(*list, Elm_Icon_Lookup_Order);
sd->lookup_order = order;
}
@@ -928,9 +972,19 @@ EAPI Elm_Icon_Lookup_Order
elm_icon_order_lookup_get(const Evas_Object *obj)
{
ELM_ICON_CHECK(obj) ELM_ICON_LOOKUP_THEME_FDO;
- ELM_ICON_DATA_GET(obj, sd);
+ Elm_Icon_Lookup_Order ret = ELM_ICON_LOOKUP_THEME_FDO;
+ eo_do((Eo *) obj, elm_obj_icon_order_lookup_get(&ret));
+ return ret;
+}
+
+static void
+_order_lookup_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
- return sd->lookup_order;
+ Elm_Icon_Smart_Data *sd = _pd;
+ Elm_Icon_Lookup_Order *ret = va_arg(*list, Elm_Icon_Lookup_Order *);
+
+ *ret = sd->lookup_order;
}
EAPI void
@@ -1064,3 +1118,48 @@ elm_icon_aspect_fixed_get(const Evas_Object *obj)
return elm_image_aspect_fixed_get(obj);
}
+
+static void
+_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_icon_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_icon_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_icon_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_SET), _elm_icon_smart_file_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET), _elm_icon_smart_memfile_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL), _elm_icon_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_THUMB_SET), _thumb_set),
+ EO_OP_FUNC(ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_SET), _standard_set),
+ EO_OP_FUNC(ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_GET), _standard_get),
+ EO_OP_FUNC(ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET), _order_lookup_set),
+ EO_OP_FUNC(ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET), _order_lookup_get),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_ICON_SUB_ID_THUMB_SET, "Set the file that will be used, but use a generated thumbnail."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ICON_SUB_ID_STANDARD_SET, "Set the icon by icon standards names."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ICON_SUB_ID_STANDARD_GET, "Get the icon name set by icon standard names."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET, "Sets the icon lookup order used by elm_icon_standard_set()."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET, "Gets the icon lookup order."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_ICON_BASE_ID, op_desc, ELM_OBJ_ICON_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Icon_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_icon_class_get, &class_desc, ELM_OBJ_IMAGE_CLASS, NULL);
diff --git a/src/lib/elm_icon.h b/src/lib/elm_icon.h
index a7c7d71c5..6fd53ae13 100644
--- a/src/lib/elm_icon.h
+++ b/src/lib/elm_icon.h
@@ -97,6 +97,88 @@
* @li @ref tutorial_icon
*/
+#define ELM_OBJ_ICON_CLASS elm_obj_icon_class_get()
+
+const Eo_Class *elm_obj_icon_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_ICON_BASE_ID;
+
+enum
+{
+ ELM_OBJ_ICON_SUB_ID_THUMB_SET,
+ ELM_OBJ_ICON_SUB_ID_STANDARD_SET,
+ ELM_OBJ_ICON_SUB_ID_STANDARD_GET,
+ ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET,
+ ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET,
+ ELM_OBJ_ICON_SUB_ID_LAST
+};
+
+#define ELM_OBJ_ICON_ID(sub_id) (ELM_OBJ_ICON_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_icon_thumb_set
+ * @since 1.8
+ *
+ * Set the file that will be used, but use a generated thumbnail.
+ *
+ * @param[in] file
+ * @param[in] group
+ *
+ * @see elm_icon_thumb_set
+ */
+#define elm_obj_icon_thumb_set(file, group) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group)
+
+/**
+ * @def elm_obj_icon_standard_set
+ * @since 1.8
+ *
+ * Set the icon by icon standards names.
+ *
+ * @param[in] name
+ * @param[out] ret
+ *
+ * @see elm_icon_standard_set
+ */
+#define elm_obj_icon_standard_set(name, ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_icon_standard_get
+ * @since 1.8
+ *
+ * Get the icon name set by icon standard names.
+ *
+ * @param[out] ret
+ *
+ * @see elm_icon_standard_get
+ */
+#define elm_obj_icon_standard_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_STANDARD_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_icon_order_lookup_set
+ * @since 1.8
+ *
+ * Sets the icon lookup order used by elm_icon_standard_set().
+ *
+ * @param[in] order
+ *
+ * @see elm_icon_order_lookup_set
+ */
+#define elm_obj_icon_order_lookup_set(order) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_SET), EO_TYPECHECK(Elm_Icon_Lookup_Order, order)
+
+/**
+ * @def elm_obj_icon_order_lookup_get
+ * @since 1.8
+ *
+ * Gets the icon lookup order.
+ *
+ * @param[out] ret
+ *
+ * @see elm_icon_order_lookup_get
+ */
+#define elm_obj_icon_order_lookup_get(ret) ELM_OBJ_ICON_ID(ELM_OBJ_ICON_SUB_ID_ORDER_LOOKUP_GET), EO_TYPECHECK(Elm_Icon_Lookup_Order *, ret)
+
+
/**
* @addtogroup Icon
* @{
diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 1f1d3e094..ef0f62d94 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -2,13 +2,18 @@
#include "elm_priv.h"
#include "elm_widget_image.h"
+#include <Eo.h>
+
#ifdef _WIN32
# define FMT_SIZE_T "%Iu"
#else
# define FMT_SIZE_T "%zu"
#endif
-EAPI const char ELM_IMAGE_SMART_NAME[] = "elm_image";
+EAPI Eo_Op ELM_OBJ_IMAGE_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_IMAGE_CLASS
+#define MY_CLASS_NAME "elm_image"
static const char SIG_DND[] = "drop";
static const char SIG_CLICKED[] = "clicked";
@@ -18,10 +23,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_IMAGE_SMART_NAME, _elm_image, Elm_Image_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
static void
_on_image_preloaded(void *data,
Evas *e __UNUSED__,
@@ -96,7 +97,7 @@ _img_new(Evas_Object *obj)
}
static void
-_elm_image_internal_sizing_eval(Elm_Image_Smart_Data *sd)
+_elm_image_internal_sizing_eval(Evas_Object *obj, Elm_Image_Smart_Data *sd)
{
Evas_Coord x, y, w, h;
const char *type;
@@ -161,7 +162,7 @@ _elm_image_internal_sizing_eval(Elm_Image_Smart_Data *sd)
}
evas_object_size_hint_align_get
- (ELM_WIDGET_DATA(sd)->obj, &alignh, &alignv);
+ (obj, &alignh, &alignv);
if (alignh == EVAS_HINT_FILL) alignh = 0.5;
if (alignv == EVAS_HINT_FILL) alignv = 0.5;
@@ -239,21 +240,22 @@ _elm_image_edje_file_set(Evas_Object *obj,
}
/* FIXME: do i want to update icon on file change ? */
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
return EINA_TRUE;
}
static void
-_elm_image_smart_size_get(const Evas_Object *obj,
- int *w,
- int *h)
+_elm_image_smart_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+
int tw, th;
int cw = 0, ch = 0;
const char *type;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
type = evas_object_type_get(sd->img);
if (!type) return;
@@ -275,39 +277,48 @@ _elm_image_smart_size_get(const Evas_Object *obj,
}
static void
-_elm_image_smart_smooth_scale_set(Evas_Object *obj,
- Eina_Bool smooth)
+_elm_image_smart_smooth_scale_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool smooth = va_arg(*list, int);
+
+ Elm_Image_Smart_Data *sd = _pd;
if (sd->edje) return;
evas_object_image_smooth_scale_set(sd->img, smooth);
}
-static Eina_Bool
-_elm_image_smart_smooth_scale_get(const Evas_Object *obj)
+static void
+_elm_image_smart_smooth_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Image_Smart_Data *sd = _pd;
- if (sd->edje) return EINA_FALSE;
+ if (sd->edje)
+ {
+ *ret = EINA_FALSE;
+ return;
+ }
- return evas_object_image_smooth_scale_get(sd->img);
+ *ret = evas_object_image_smooth_scale_get(sd->img);
}
-static Evas_Object *
-_elm_image_smart_object_get(const Evas_Object *obj)
+static void
+_elm_image_smart_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+
+ Elm_Image_Smart_Data *sd = _pd;
- return sd->img;
+ *ret = sd->img;
}
static void
-_elm_image_smart_fill_inside_set(Evas_Object *obj,
- Eina_Bool fill_inside)
+_elm_image_smart_fill_inside_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool fill_inside = va_arg(*list, int);
+
+ Elm_Image_Smart_Data *sd = _pd;
fill_inside = !!fill_inside;
@@ -315,22 +326,26 @@ _elm_image_smart_fill_inside_set(Evas_Object *obj,
sd->fill_inside = fill_inside;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static Eina_Bool
-_elm_image_smart_fill_inside_get(const Evas_Object *obj)
+static void
+_elm_image_smart_fill_inside_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
+ Elm_Image_Smart_Data *sd = _pd;
- return sd->fill_inside;
+ *ret = sd->fill_inside;
}
static void
-_elm_image_smart_resize_up_set(Evas_Object *obj,
- Eina_Bool resize_up)
+_elm_image_smart_resize_up_set(Eo *obj, void *_pd, va_list *list)
+
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool resize_up = va_arg(*list, int);
+
+ Elm_Image_Smart_Data *sd = _pd;
resize_up = !!resize_up;
@@ -338,22 +353,25 @@ _elm_image_smart_resize_up_set(Evas_Object *obj,
sd->resize_up = resize_up;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static Eina_Bool
-_elm_image_smart_resize_up_get(const Evas_Object *obj)
+static void
+_elm_image_smart_resize_up_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sd->resize_up;
+ Elm_Image_Smart_Data *sd = _pd;
+
+ *ret = sd->resize_up;
}
static void
-_elm_image_smart_resize_down_set(Evas_Object *obj,
- Eina_Bool resize_down)
+_elm_image_smart_resize_down_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool resize_down = va_arg(*list, int);
+
+ Elm_Image_Smart_Data *sd = _pd;
resize_down = !!resize_down;
@@ -361,19 +379,20 @@ _elm_image_smart_resize_down_set(Evas_Object *obj,
sd->resize_down = resize_down;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static Eina_Bool
-_elm_image_smart_resize_down_get(const Evas_Object *obj)
+static void
+_elm_image_smart_resize_down_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sd->resize_up;
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = sd->resize_up;
}
static void
-_elm_image_flip_horizontal(Elm_Image_Smart_Data *sd)
+_elm_image_flip_horizontal(Evas_Object *obj, Elm_Image_Smart_Data *sd)
{
unsigned int *p1, *p2, tmp;
unsigned int *data;
@@ -399,11 +418,11 @@ _elm_image_flip_horizontal(Elm_Image_Smart_Data *sd)
evas_object_image_data_set(sd->img, data);
evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
static void
-_elm_image_flip_vertical(Elm_Image_Smart_Data *sd)
+_elm_image_flip_vertical(Evas_Object *obj, Elm_Image_Smart_Data *sd)
{
unsigned int *p1, *p2, tmp;
unsigned int *data;
@@ -429,11 +448,11 @@ _elm_image_flip_vertical(Elm_Image_Smart_Data *sd)
evas_object_image_data_set(sd->img, data);
evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
static void
-_elm_image_smart_rotate_180(Elm_Image_Smart_Data *sd)
+_elm_image_smart_rotate_180(Evas_Object *obj, Elm_Image_Smart_Data *sd)
{
unsigned int *p1, *p2, tmp;
unsigned int *data;
@@ -459,17 +478,18 @@ _elm_image_smart_rotate_180(Elm_Image_Smart_Data *sd)
evas_object_image_data_set(sd->img, data);
evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
static void
-_elm_image_smart_orient_set(Evas_Object *obj,
- Elm_Image_Orient orient)
+_elm_image_smart_orient_set(Eo *obj, void *_pd, va_list *list)
{
+ Elm_Image_Orient orient = va_arg(*list, Elm_Image_Orient);
+
unsigned int *data, *data2 = NULL, *to, *from;
int x, y, w, hw, iw, ih;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
if (sd->edje)
return;
@@ -477,17 +497,17 @@ _elm_image_smart_orient_set(Evas_Object *obj,
switch (orient)
{
case ELM_IMAGE_FLIP_HORIZONTAL:
- _elm_image_flip_horizontal(sd);
+ _elm_image_flip_horizontal(obj, sd);
sd->orient = orient;
return;
case ELM_IMAGE_FLIP_VERTICAL:
- _elm_image_flip_vertical(sd);
+ _elm_image_flip_vertical(obj, sd);
sd->orient = orient;
return;
case ELM_IMAGE_ROTATE_180:
- _elm_image_smart_rotate_180(sd);
+ _elm_image_smart_rotate_180(obj, sd);
sd->orient = orient;
return;
@@ -569,15 +589,17 @@ _elm_image_smart_orient_set(Evas_Object *obj,
evas_object_image_data_set(sd->img, data);
evas_object_image_data_update_add(sd->img, 0, 0, iw, ih);
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static Elm_Image_Orient
-_elm_image_smart_orient_get(const Evas_Object *obj)
+static void
+_elm_image_smart_orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ Elm_Image_Orient *ret = va_arg(*list, Elm_Image_Orient *);
- return sd->orient;
+ *ret = sd->orient;
}
static Eina_Bool
@@ -585,10 +607,9 @@ _elm_image_drag_n_drop_cb(void *elm_obj,
Evas_Object *obj,
Elm_Selection_Data *drop)
{
- ELM_IMAGE_DATA_GET(obj, sd);
-
- if (ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->file_set
- (obj, drop->data, NULL))
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_image_file_set(drop->data, NULL, &ret));
+ if(ret)
{
printf("dnd: %s, %s, %s", elm_widget_type_get(elm_obj),
SIG_DND, (char *)drop->data);
@@ -601,11 +622,11 @@ _elm_image_drag_n_drop_cb(void *elm_obj,
}
static void
-_elm_image_smart_add(Evas_Object *obj)
+_elm_image_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Image_Smart_Data);
+ eo_do_super(obj, evas_obj_smart_add());
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.add(obj);
+ Elm_Image_Smart_Data *priv = _pd;
/* starts as an Evas image. may switch to an Edje object */
priv->img = _img_new(obj);
@@ -620,17 +641,17 @@ _elm_image_smart_add(Evas_Object *obj)
priv->load_size = 64;
priv->scale = 1.0;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(priv)->api)->load_size_set(obj, 0);
+ eo_do(obj, elm_obj_image_load_size_set(0));
elm_widget_can_focus_set(obj, EINA_FALSE);
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(priv)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
}
static void
-_elm_image_smart_del(Evas_Object *obj)
+_elm_image_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
if (sd->anim_timer)
ecore_timer_del(sd->anim_timer);
@@ -638,34 +659,35 @@ _elm_image_smart_del(Evas_Object *obj)
evas_object_del(sd->img);
if (sd->prev_img) evas_object_del(sd->prev_img);
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_image_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_image_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.move(obj, x, y);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+
+ eo_do_super(obj, evas_obj_smart_move(x, y));
if ((sd->img_x == x) && (sd->img_y == y)) return;
sd->img_x = x;
sd->img_y = y;
/* takes care of moving */
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
static void
-_elm_image_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_image_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
if ((sd->img_w == w) && (sd->img_h == h)) return;
@@ -673,19 +695,19 @@ _elm_image_smart_resize(Evas_Object *obj,
sd->img_h = h;
/* takes care of resizing */
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
static void
-_elm_image_smart_show(Evas_Object *obj)
+_elm_image_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
sd->show = EINA_TRUE;
if (sd->preloading)
return;
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
evas_object_show(sd->img);
@@ -694,11 +716,11 @@ _elm_image_smart_show(Evas_Object *obj)
}
static void
-_elm_image_smart_hide(Evas_Object *obj)
+_elm_image_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.hide(obj);
+ eo_do_super(obj, evas_obj_smart_hide());
sd->show = EINA_FALSE;
evas_object_hide(sd->img);
@@ -708,82 +730,86 @@ _elm_image_smart_hide(Evas_Object *obj)
}
static void
-_elm_image_smart_color_set(Evas_Object *obj,
- int r,
- int g,
- int b,
- int a)
+_elm_image_smart_color_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.color_set(obj, r, g, b, a);
+ eo_do_super(obj, evas_obj_smart_color_set(r, g, b, a));
evas_object_color_set(sd->img, r, g, b, a);
if (sd->prev_img) evas_object_color_set(sd->prev_img, r, g, b, a);
}
static void
-_elm_image_smart_clip_set(Evas_Object *obj,
- Evas_Object *clip)
+_elm_image_smart_clip_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.clip_set(obj, clip);
+ Evas_Object *clip = va_arg(*list, Evas_Object *);
+
+ eo_do_super(obj, evas_obj_smart_clip_set(clip));
evas_object_clip_set(sd->img, clip);
if (sd->prev_img) evas_object_clip_set(sd->prev_img, clip);
}
static void
-_elm_image_smart_clip_unset(Evas_Object *obj)
+_elm_image_smart_clip_unset(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_image_parent_sc)->base.clip_unset(obj);
+ eo_do_super(obj, evas_obj_smart_clip_unset());
evas_object_clip_unset(sd->img);
if (sd->prev_img) evas_object_clip_unset(sd->prev_img);
}
-static Eina_Bool
-_elm_image_smart_theme(Evas_Object *obj)
+static void
+_elm_image_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_image_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_image_smart_sizing_eval(Evas_Object *obj)
+_elm_image_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
int w, h;
double ts;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->smooth_scale_set
- (obj, sd->smooth);
+ eo_do(obj, elm_obj_image_smooth_scale_set(sd->smooth));
if (sd->no_scale)
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->scale_set(obj, 1.0);
+ eo_do(obj, elm_obj_image_scale_set(1.0));
else
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->scale_set
- (obj, elm_widget_scale_get(obj) * elm_config_scale_get());
+ eo_do(obj, elm_obj_image_smooth_scale_set(elm_widget_scale_get(obj) * elm_config_scale_get()));
ts = sd->scale;
sd->scale = 1.0;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->size_get(obj, &w, &h);
+ eo_do(obj, elm_obj_image_size_get(&w, &h));
+
sd->scale = ts;
evas_object_size_hint_min_get(obj, &minw, &minh);
-
+
if (sd->no_scale)
{
maxw = minw = w;
@@ -817,14 +843,16 @@ _elm_image_smart_sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_image_smart_memfile_set(Evas_Object *obj,
- const void *img,
- size_t size,
- const char *format,
- const char *key)
+static void
+_elm_image_smart_memfile_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ const void *img = va_arg(*list, const void *);
+ size_t size = va_arg(*list, size_t);
+ const char *format = va_arg(*list, const char *);
+ const char *key = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
_elm_image_file_set_do(obj);
@@ -840,25 +868,32 @@ _elm_image_smart_memfile_set(Evas_Object *obj,
{
ERR("Things are going bad for some random " FMT_SIZE_T
" byte chunk of memory (%p)", size, sd->img);
- return EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
+ return;
}
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_image_smart_file_set(Evas_Object *obj,
- const char *file,
- const char *key)
+static void
+_elm_image_smart_file_set(Eo *obj, void *_pd, va_list *list)
{
+ const char *file = va_arg(*list, const char *);
+ const char *key = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
Evas_Coord w, h;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
if (eina_str_has_extension(file, ".edj"))
- return _elm_image_edje_file_set(obj, file, key);
+ {
+ Eina_Bool int_ret = _elm_image_edje_file_set(obj, file, key);
+ if (ret) *ret = int_ret;
+ return;
+ }
_elm_image_file_set_do(obj);
@@ -869,7 +904,7 @@ _elm_image_smart_file_set(Evas_Object *obj,
evas_object_hide(sd->img);
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->size_get(obj, &w, &h);
+ eo_do(obj, elm_obj_image_size_get(&w, &h));
evas_object_image_load_size_set(sd->img, w, h);
@@ -877,20 +912,22 @@ _elm_image_smart_file_set(Evas_Object *obj,
if (evas_object_image_load_error_get(sd->img) != EVAS_LOAD_ERROR_NONE)
{
ERR("Things are going bad for '%s' (%p)", file, sd->img);
- return EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
+ return;
}
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_image_smart_file_get(const Evas_Object *obj,
- const char **file,
- const char **key)
+_elm_image_smart_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ const char **file = va_arg(*list, const char **);
+ const char **key = va_arg(*list, const char **);
if (sd->edje)
edje_object_file_get(sd->img, file, key);
@@ -899,10 +936,11 @@ _elm_image_smart_file_get(const Evas_Object *obj,
}
static void
-_elm_image_smart_preload_set(Evas_Object *obj,
- Eina_Bool disable)
+_elm_image_smart_preload_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ Eina_Bool disable = va_arg(*list, int);
if (sd->edje) return;
@@ -911,10 +949,11 @@ _elm_image_smart_preload_set(Evas_Object *obj,
}
static void
-_elm_image_smart_load_size_set(Evas_Object *obj,
- int size)
+_elm_image_smart_load_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ int size = va_arg(*list, int);
sd->load_size = size;
if (!sd->img || sd->edje) return;
@@ -922,42 +961,47 @@ _elm_image_smart_load_size_set(Evas_Object *obj,
evas_object_image_load_size_set(sd->img, sd->load_size, sd->load_size);
}
-static int
-_elm_image_smart_load_size_get(const Evas_Object *obj)
+static void
+_elm_image_smart_load_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ int *ret = va_arg(*list, int *);
- return sd->load_size;
+ *ret = sd->load_size;
}
static void
-_elm_image_smart_scale_set(Evas_Object *obj,
- double scale)
+_elm_image_smart_scale_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+
+ double scale = va_arg(*list, double);
sd->scale = scale;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static double
-_elm_image_smart_scale_get(const Evas_Object *obj)
+static void
+_elm_image_smart_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ double *ret = va_arg(*list, double *);
- return sd->scale;
+ *ret = sd->scale;
}
/**
* Turns on editing through drag and drop and copy and paste.
*/
static void
-_elm_image_smart_edit_set(Evas_Object *obj,
- Eina_Bool edit,
- Evas_Object *parent)
+_elm_image_smart_editable_set(Eo *obj, void *_pd, va_list *list)
+
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ Eina_Bool edit = va_arg(*list, int);
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
if (sd->edje)
{
@@ -978,110 +1022,57 @@ _elm_image_smart_edit_set(Evas_Object *obj,
elm_drop_target_del(obj);
}
-static Eina_Bool
-_elm_image_smart_edit_get(const Evas_Object *obj)
+static void
+_elm_image_smart_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sd->edit;
+ *ret = sd->edit;
}
static void
-_elm_image_smart_aspect_fixed_set(Evas_Object *obj,
- Eina_Bool fixed)
+_elm_image_smart_aspect_fixed_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ Eina_Bool fixed = va_arg(*list, int);
fixed = !!fixed;
if (sd->aspect_fixed == fixed) return;
sd->aspect_fixed = fixed;
- _elm_image_internal_sizing_eval(sd);
+ _elm_image_internal_sizing_eval(obj, sd);
}
-static Eina_Bool
-_elm_image_smart_aspect_fixed_get(const Evas_Object *obj)
+static void
+_elm_image_smart_aspect_fixed_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_IMAGE_DATA_GET(obj, sd);
+ Elm_Image_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sd->aspect_fixed;
-}
-
-static void
-_elm_image_smart_set_user(Elm_Image_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_image_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_image_smart_del,
- ELM_WIDGET_CLASS(sc)->base.move = _elm_image_smart_move,
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_image_smart_resize,
- ELM_WIDGET_CLASS(sc)->base.show = _elm_image_smart_show,
- ELM_WIDGET_CLASS(sc)->base.hide = _elm_image_smart_hide,
- ELM_WIDGET_CLASS(sc)->base.color_set = _elm_image_smart_color_set,
- ELM_WIDGET_CLASS(sc)->base.clip_set = _elm_image_smart_clip_set,
- ELM_WIDGET_CLASS(sc)->base.clip_unset = _elm_image_smart_clip_unset,
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_image_smart_theme;
-
- sc->aspect_fixed_get = _elm_image_smart_aspect_fixed_get;
- sc->aspect_fixed_set = _elm_image_smart_aspect_fixed_set;
- sc->edit_get = _elm_image_smart_edit_get;
- sc->edit_set = _elm_image_smart_edit_set;
- sc->file_get = _elm_image_smart_file_get;
- sc->file_set = _elm_image_smart_file_set;
- sc->fill_inside_get = _elm_image_smart_fill_inside_get;
- sc->fill_inside_set = _elm_image_smart_fill_inside_set;
- sc->image_object_get = _elm_image_smart_object_get;
- sc->load_size_get = _elm_image_smart_load_size_get;
- sc->load_size_set = _elm_image_smart_load_size_set;
- sc->memfile_set = _elm_image_smart_memfile_set;
- sc->orient_get = _elm_image_smart_orient_get;
- sc->orient_set = _elm_image_smart_orient_set;
- sc->preload_set = _elm_image_smart_preload_set;
- sc->resize_down_get = _elm_image_smart_resize_down_get;
- sc->resize_down_set = _elm_image_smart_resize_down_set;
- sc->scale_get = _elm_image_smart_scale_get;
- sc->scale_set = _elm_image_smart_scale_set;
- sc->resize_up_get = _elm_image_smart_resize_up_get;
- sc->resize_up_set = _elm_image_smart_resize_up_set;
- sc->size_get = _elm_image_smart_size_get;
- sc->sizing_eval = _elm_image_smart_sizing_eval;
- sc->smooth_scale_get = _elm_image_smart_smooth_scale_get;
- sc->smooth_scale_set = _elm_image_smart_smooth_scale_set;
-}
-
-EAPI const Elm_Image_Smart_Class *
-elm_image_smart_class_get(void)
-{
- static Elm_Image_Smart_Class _sc =
- ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION(ELM_IMAGE_SMART_NAME);
- static const Elm_Image_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_image_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ *ret = sd->aspect_fixed;
}
EAPI Evas_Object *
elm_image_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_image_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Eina_Bool
@@ -1092,13 +1083,13 @@ elm_image_memfile_set(Evas_Object *obj,
const char *key)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
EINA_SAFETY_ON_NULL_RETURN_VAL(img, EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(!size, EINA_FALSE);
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->memfile_set
- (obj, img, size, format, key);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_image_memfile_set(img, size, format, key, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1106,17 +1097,12 @@ elm_image_file_set(Evas_Object *obj,
const char *file,
const char *group)
{
- Eina_Bool ret;
+ Eina_Bool ret = EINA_FALSE;
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
-
EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
-
- ret = ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->file_set(obj, file, group);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
-
+ eo_do(obj, elm_obj_image_file_set(file, group, &ret));
+ eo_do(obj, elm_obj_image_sizing_eval());
return ret;
}
@@ -1126,9 +1112,7 @@ elm_image_file_get(const Evas_Object *obj,
const char **group)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->file_get(obj, file, group);
+ eo_do((Eo *) obj, elm_obj_image_file_get(file, group));
}
EAPI void
@@ -1136,20 +1120,34 @@ elm_image_smooth_set(Evas_Object *obj,
Eina_Bool smooth)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_smooth_set(smooth));
+}
+static void
+_elm_image_smart_smooth_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool smooth = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
sd->smooth = smooth;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
}
EAPI Eina_Bool
elm_image_smooth_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_smooth_get(&ret));
+ return ret;
+}
- return sd->smooth;
+static void
+_elm_image_smart_smooth_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = sd->smooth;
}
EAPI void
@@ -1161,9 +1159,7 @@ elm_image_object_size_get(const Evas_Object *obj,
if (h) *h = 0;
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->size_get(obj, w, h);
+ eo_do((Eo *) obj, elm_obj_image_size_get(w, h));
}
EAPI void
@@ -1171,20 +1167,34 @@ elm_image_no_scale_set(Evas_Object *obj,
Eina_Bool no_scale)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_no_scale_set(no_scale));
+}
+static void
+_elm_image_smart_no_scale_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool no_scale = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
sd->no_scale = no_scale;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
}
EAPI Eina_Bool
elm_image_no_scale_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_no_scale_get(&ret));
+ return ret;
+}
- return sd->no_scale;
+static void
+_elm_image_smart_no_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = sd->no_scale;
}
EAPI void
@@ -1193,12 +1203,20 @@ elm_image_resizable_set(Evas_Object *obj,
Eina_Bool down)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_resizable_set(up, down));
+}
+
+static void
+_elm_image_smart_resizable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool up = va_arg(*list, int);
+ Eina_Bool down = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
sd->resize_up = !!up;
sd->resize_down = !!down;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
}
EAPI void
@@ -1207,8 +1225,16 @@ elm_image_resizable_get(const Evas_Object *obj,
Eina_Bool *size_down)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_image_resizable_get(size_up, size_down));
+}
+static void
+_elm_image_smart_resizable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *size_up = va_arg(*list, Eina_Bool *);
+ Eina_Bool *size_down = va_arg(*list, Eina_Bool *);
+
+ Elm_Image_Smart_Data *sd = _pd;
if (size_up) *size_up = sd->resize_up;
if (size_down) *size_down = sd->resize_down;
}
@@ -1218,20 +1244,36 @@ elm_image_fill_outside_set(Evas_Object *obj,
Eina_Bool fill_outside)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_fill_outside_set(fill_outside));
+}
+static void
+_elm_image_smart_fill_outside_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool fill_outside = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
sd->fill_inside = !fill_outside;
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_image_sizing_eval());
}
+
EAPI Eina_Bool
elm_image_fill_outside_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_fill_outside_get(&ret));
+ return ret;
+}
- return !sd->fill_inside;
+static void
+_elm_image_smart_fill_outside_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = !sd->fill_inside;
}
EAPI void
@@ -1239,9 +1281,7 @@ elm_image_preload_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->preload_set(obj, !!disabled);
+ eo_do(obj, elm_obj_image_preload_disabled_set(!!disabled));
}
EAPI void
@@ -1249,18 +1289,17 @@ elm_image_prescale_set(Evas_Object *obj,
int size)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->load_size_set(obj, size);
+ eo_do(obj, elm_obj_image_load_size_set(size));
}
EAPI int
elm_image_prescale_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) 0;
- ELM_IMAGE_DATA_GET(obj, sd);
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->load_size_get(obj);
+ int ret = 0;
+ eo_do((Eo *)obj, elm_obj_image_load_size_get(&ret));
+ return ret;
}
EAPI void
@@ -1268,18 +1307,18 @@ elm_image_orient_set(Evas_Object *obj,
Elm_Image_Orient orient)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->orient_set(obj, orient);
+ eo_do(obj, elm_obj_image_orient_set(orient));
}
EAPI Elm_Image_Orient
elm_image_orient_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) ELM_IMAGE_ORIENT_NONE;
- ELM_IMAGE_DATA_GET(obj, sd);
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->orient_get(obj);
+ Elm_Image_Orient ret = ELM_IMAGE_ORIENT_NONE;
+ eo_do((Eo *) obj, elm_obj_image_orient_get(&ret));
+
+ return ret;
}
EAPI void
@@ -1287,27 +1326,26 @@ elm_image_editable_set(Evas_Object *obj,
Eina_Bool set)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->edit_set(obj, set, obj);
+ eo_do(obj, elm_obj_image_editable_set(set, obj));
}
EAPI Eina_Bool
elm_image_editable_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
-
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->edit_get(obj);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_editable_get(&ret));
+ return ret;
}
EAPI Evas_Object *
elm_image_object_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) NULL;
- ELM_IMAGE_DATA_GET(obj, sd);
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->image_object_get(obj);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_image_object_get(&ret));
+ return ret;
}
EAPI void
@@ -1315,29 +1353,41 @@ elm_image_aspect_fixed_set(Evas_Object *obj,
Eina_Bool fixed)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
-
- ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->aspect_fixed_set(obj, fixed);
+ eo_do(obj, elm_obj_image_aspect_fixed_set(fixed));
}
EAPI Eina_Bool
elm_image_aspect_fixed_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
-
- return ELM_IMAGE_CLASS(ELM_WIDGET_DATA(sd)->api)->aspect_fixed_get(obj);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_aspect_fixed_get(&ret));
+ return ret;
}
EAPI Eina_Bool
elm_image_animated_available_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_animated_available_get(&ret));
+ return ret;
+}
+
+static void
+_elm_image_smart_animated_available_get(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- if (sd->edje) return EINA_FALSE;
+ Elm_Image_Smart_Data *sd = _pd;
- return evas_object_image_animated_get(elm_image_object_get(obj));
+ if (sd->edje)
+ {
+ *ret = EINA_FALSE;
+ return;
+ }
+
+ *ret = evas_object_image_animated_get(elm_image_object_get(obj));
}
EAPI void
@@ -1345,7 +1395,14 @@ elm_image_animated_set(Evas_Object *obj,
Eina_Bool anim)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_animated_set(anim));
+}
+
+static void
+_elm_image_smart_animated_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool anim = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
anim = !!anim;
if (sd->anim == anim) return;
@@ -1379,9 +1436,17 @@ EAPI Eina_Bool
elm_image_animated_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_animated_get(&ret));
+ return ret;
+}
- return sd->anim;
+static void
+_elm_image_smart_animated_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = sd->anim;
}
EAPI void
@@ -1389,7 +1454,14 @@ elm_image_animated_play_set(Evas_Object *obj,
Eina_Bool play)
{
ELM_IMAGE_CHECK(obj);
- ELM_IMAGE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_image_animated_play_set(play));
+}
+
+static void
+_elm_image_smart_animated_play_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool play = va_arg(*list, int);
+ Elm_Image_Smart_Data *sd = _pd;
if (!sd->anim) return;
if (sd->play == play) return;
@@ -1416,7 +1488,173 @@ EAPI Eina_Bool
elm_image_animated_play_get(const Evas_Object *obj)
{
ELM_IMAGE_CHECK(obj) EINA_FALSE;
- ELM_IMAGE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_image_animated_play_get(&ret));
+ return ret;
+}
- return sd->play;
+static void
+_elm_image_smart_animated_play_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Image_Smart_Data *sd = _pd;
+ *ret = sd->play;
}
+
+static void
+_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_image_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_image_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_image_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_image_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_image_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_image_smart_hide),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_COLOR_SET), _elm_image_smart_color_set),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_SET), _elm_image_smart_clip_set),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET), _elm_image_smart_clip_unset),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_image_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET), _elm_image_smart_aspect_fixed_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET), _elm_image_smart_aspect_fixed_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET), _elm_image_smart_editable_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET), _elm_image_smart_editable_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_SET), _elm_image_smart_file_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_GET), _elm_image_smart_file_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL), _elm_image_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET), _elm_image_smart_smooth_scale_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET), _elm_image_smart_smooth_scale_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET), _elm_image_smart_fill_inside_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET), _elm_image_smart_fill_inside_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET), _elm_image_smart_fill_outside_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET), _elm_image_smart_fill_outside_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET), _elm_image_smart_object_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET), _elm_image_smart_load_size_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET), _elm_image_smart_load_size_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET), _elm_image_smart_memfile_set),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET), _elm_image_smart_orient_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET), _elm_image_smart_orient_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET), _elm_image_smart_preload_disabled_set),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET), _elm_image_smart_resize_down_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET), _elm_image_smart_resize_down_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET), _elm_image_smart_resize_up_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET), _elm_image_smart_resize_up_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_SET), _elm_image_smart_scale_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_GET), _elm_image_smart_scale_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET), _elm_image_smart_size_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET), _elm_image_smart_smooth_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET), _elm_image_smart_smooth_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET), _elm_image_smart_no_scale_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET), _elm_image_smart_no_scale_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET), _elm_image_smart_resizable_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET), _elm_image_smart_resizable_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET), _elm_image_smart_animated_available_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET), _elm_image_smart_animated_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET), _elm_image_smart_animated_get),
+
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET), _elm_image_smart_animated_play_set),
+ EO_OP_FUNC(ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET), _elm_image_smart_animated_play_get),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET, "Set whether the original aspect ratio of the image should be kept on resize."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET, "Get if the object retains the original aspect ratio."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET, "Make the image 'editable'."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET, "Check if the image is 'editable'."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILE_SET, "Set the file that will be used as the image's source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILE_GET, "Get the file that will be used as image."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL, "'Virtual' function on evalutating the object's final geometry."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET, "'Virtual' function on setting whether the object's image should be scaled smoothly or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET, "'Virtual' function on retrieving whether the object's image is to scaled smoothly or not."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET, "'Virtual' function on how to resize the object's internal image, when maintaining a given aspect ratio -- leave blank spaces or scale to fill all space, with pixels out of bounds."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET, "'Virtual' function on retrieving how the object's internal image is to be resized, when maintaining a given aspect ratio."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET, "Set if the image fills the entire object area, when keeping the aspect ratio."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET, "Get if the object is filled outside."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET, "Get the inlined image object of the image widget."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET, "'Virtual' function on setting the object's image loading size (in pixels, applied to both axis)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET, "'Virtual' function on retrieving the object's image loading size."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET, "Set a location in memory to be used as an image object's source bitmap."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET, "Set the image orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET, "Get the image orientation."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET, "Enable or disable preloading of the image."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET, "'Virtual' function on setting whether the object's image can be resized to a size smaller than the original one."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET, "'Virtual' function on retrieving whether the object's image can be resized to a size smaller than the original one."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET, "'Virtual' function on setting whether the object's image can be resized to a size greater than the original one."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET, "'Virtual' function on retrieving whether the object's image can be resized to a size greater than the original one."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SCALE_SET, "'Virtual' function on setting the scale for the object's image size."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SCALE_GET, "'Virtual' function on retrieving the scale for the object's image size."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET, "Gets the current size of the image."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET, "Set the smooth effect for an image."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET, "Get the smooth effect for an image."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET, "Disable scaling of this object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET, "Get whether scaling is disabled on the object."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET, "Set if the object is (up/down) resizable."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET, "Get if the object is (up/down) resizable."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET, "Get whether an image object supports animation or not."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET, "Set whether an image object (which supports animation) is to animate itself or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET, "Get whether an image object has animation enabled or not."),
+
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET, "Start or stop an image object's animation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET, "Get whether an image object is under animation or not."),
+
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_IMAGE_BASE_ID, op_desc, ELM_OBJ_IMAGE_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Image_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_image_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
diff --git a/src/lib/elm_image.h b/src/lib/elm_image.h
index 8397ae29c..5a0c4f039 100644
--- a/src/lib/elm_image.h
+++ b/src/lib/elm_image.h
@@ -35,6 +35,398 @@
* @li @ref tutorial_image
*/
+
+#define ELM_OBJ_IMAGE_CLASS elm_obj_image_class_get()
+
+const Eo_Class *elm_obj_image_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_IMAGE_BASE_ID;
+
+enum
+{
+ ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET,
+ ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_FILE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_FILE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL,
+
+ ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET,
+
+ ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET,
+ ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET,
+
+ ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET,
+ ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET,
+ ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_SCALE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_SCALE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET,
+ ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET,
+ ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET,
+ ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET,
+ ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET,
+
+ ELM_OBJ_IMAGE_SUB_ID_LAST
+};
+
+#define ELM_OBJ_IMAGE_ID(sub_id) (ELM_OBJ_IMAGE_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_image_memfile_set
+ * @since 1.8
+ *
+ * Set a location in memory to be used as an image object's source
+ *
+ * @param[in] img
+ * @param[in] size
+ * @param[in] format
+ * @param[in] key
+ * @param[out] ret
+ *
+ * @see elm_image_memfile_set
+ */
+#define elm_obj_image_memfile_set(img, size, format, key, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_MEMFILE_SET), EO_TYPECHECK(const void *, img), EO_TYPECHECK(size_t, size), EO_TYPECHECK(const char *, format), EO_TYPECHECK(const char *, key), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_file_set
+ * @since 1.8
+ *
+ * Set the file that will be used as the image's source.
+ *
+ * @param[in] file
+ * @param[in] group
+ * @param[out] ret
+ *
+ * @see elm_image_file_set
+ */
+#define elm_obj_image_file_set(file, group, ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_file_get
+ * @since 1.8
+ *
+ * Get the file that will be used as image.
+ *
+ * @param[out] file
+ * @param[out] group
+ *
+ * @see elm_image_file_get
+ */
+#define elm_obj_image_file_get(file, group) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group)
+
+/**
+ * @def elm_obj_image_smooth_set
+ * @since 1.8
+ *
+ * Set the smooth effect for an image.
+ *
+ * @param[in] smooth
+ *
+ * @see elm_image_smooth_set
+ */
+#define elm_obj_image_smooth_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SET), EO_TYPECHECK(Eina_Bool, smooth)
+
+/**
+ * @def elm_obj_image_smooth_get
+ * @since 1.8
+ *
+ * Get the smooth effect for an image.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_smooth_get
+ */
+#define elm_obj_image_smooth_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_image_size_get(w, h) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_image_no_scale_set
+ * @since 1.8
+ *
+ * Disable scaling of this object.
+ *
+ * @param[in] no_scale
+ *
+ * @see elm_image_no_scale_set
+ */
+#define elm_obj_image_no_scale_set(no_scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_SET), EO_TYPECHECK(Eina_Bool, no_scale)
+
+/**
+ * @def elm_obj_image_no_scale_get
+ * @since 1.8
+ *
+ * Get whether scaling is disabled on the object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_no_scale_get
+ */
+#define elm_obj_image_no_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_NO_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_resizable_set
+ * @since 1.8
+ *
+ * Set if the object is (up/down) resizable.
+ *
+ * @param[in] up
+ * @param[in] down
+ *
+ * @see elm_image_resizable_set
+ */
+#define elm_obj_image_resizable_set(up, down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_SET), EO_TYPECHECK(Eina_Bool, up), EO_TYPECHECK(Eina_Bool, down)
+
+/**
+ * @def elm_obj_image_resizable_get
+ * @since 1.8
+ *
+ * Get if the object is (up/down) resizable.
+ *
+ * @param[out] size_up
+ * @param[out] size_down
+ *
+ * @see elm_image_resizable_get
+ */
+#define elm_obj_image_resizable_get(size_up, size_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZABLE_GET), EO_TYPECHECK(Eina_Bool *, size_up), EO_TYPECHECK(Eina_Bool *, size_down)
+
+/**
+ * @def elm_obj_image_fill_outside_set
+ * @since 1.8
+ *
+ * Set if the image fills the entire object area, when keeping the aspect ratio.
+ *
+ * @param[in] fill_outside
+ *
+ * @see elm_image_fill_outside_set
+ */
+#define elm_obj_image_fill_outside_set(fill_outside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_outside)
+
+/**
+ * @def elm_obj_image_fill_outside_get
+ * @since 1.8
+ *
+ * Get if the object is filled outside
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_fill_outside_get
+ */
+#define elm_obj_image_fill_outside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_OUTSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_preload_disabled_set
+ * @since 1.8
+ *
+ * Enable or disable preloading of the image
+ *
+ * @param[in] disabled
+ *
+ * @see elm_image_preload_disabled_set
+ */
+#define elm_obj_image_preload_disabled_set(disabled) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_PRELOAD_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_image_orient_set
+ * @since 1.8
+ *
+ * Set the image orientation.
+ *
+ * @param[in] orient
+ *
+ * @see elm_image_orient_set
+ */
+#define elm_obj_image_orient_set(orient) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Image_Orient, orient)
+
+/**
+ * @def elm_obj_image_orient_get
+ * @since 1.8
+ *
+ * Get the image orientation.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_orient_get
+ */
+#define elm_obj_image_orient_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Image_Orient *, ret)
+
+/**
+ * @def elm_obj_image_editable_set
+ * @since 1.8
+ *
+ * Make the image 'editable'.
+ *
+ * @param[in] set
+ * @param[in] parent
+ *
+ * @see elm_image_editable_set
+ */
+#define elm_obj_image_editable_set(set, parent) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set), EO_TYPECHECK(Evas_Object *, parent)
+
+/**
+ * @def elm_obj_image_editable_get
+ * @since 1.8
+ *
+ * Check if the image is 'editable'.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_editable_get
+ */
+#define elm_obj_image_editable_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_object_get
+ * @since 1.8
+ *
+ * Get the inlined image object of the image widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_object_get
+ */
+#define elm_obj_image_object_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_image_aspect_fixed_set
+ * @since 1.8
+ *
+ * Set whether the original aspect ratio of the image should be kept on resize.
+ *
+ * @param[in] fixed
+ *
+ * @see elm_image_aspect_fixed_set
+ */
+#define elm_obj_image_aspect_fixed_set(fixed) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed)
+
+/**
+ * @def elm_obj_image_aspect_fixed_get
+ * @since 1.8
+ *
+ * Get if the object retains the original aspect ratio.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_aspect_fixed_get
+ */
+#define elm_obj_image_aspect_fixed_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_animated_available_get
+ * @since 1.8
+ *
+ * Get whether an image object supports animation or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_animated_available_get
+ */
+#define elm_obj_image_animated_available_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_AVAILABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_animated_set
+ * @since 1.8
+ *
+ * Set whether an image object (which supports animation) is to
+ *
+ * @param[in] anim
+ *
+ * @see elm_image_animated_set
+ */
+#define elm_obj_image_animated_set(anim) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_SET), EO_TYPECHECK(Eina_Bool, anim)
+
+/**
+ * @def elm_obj_image_animated_get
+ * @since 1.8
+ *
+ * Get whether an image object has animation enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_animated_get
+ */
+#define elm_obj_image_animated_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_image_animated_play_set
+ * @since 1.8
+ *
+ * Start or stop an image object's animation.
+ *
+ * @param[in] play
+ *
+ * @see elm_image_animated_play_set
+ */
+#define elm_obj_image_animated_play_set(play) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_SET), EO_TYPECHECK(Eina_Bool, play)
+
+/**
+ * @def elm_obj_image_animated_play_get
+ * @since 1.8
+ *
+ * Get whether an image object is under animation or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_image_animated_play_get
+ */
+#define elm_obj_image_animated_play_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_ANIMATED_PLAY_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_obj_image_sizing_eval() ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SIZING_EVAL)
+#define elm_obj_image_smooth_scale_set(smooth) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_SET), EO_TYPECHECK(Eina_Bool, smooth)
+#define elm_obj_image_smooth_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_obj_image_fill_inside_set(fill_inside) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill_inside)
+#define elm_obj_image_fill_inside_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_FILL_INSIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_obj_image_load_size_set(size) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_SET), EO_TYPECHECK(int, size)
+#define elm_obj_image_load_size_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_LOAD_SIZE_GET), EO_TYPECHECK(int *, ret)
+
+#define elm_obj_image_resize_down_set(resize_down) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_SET), EO_TYPECHECK(Eina_Bool, resize_down)
+#define elm_obj_image_resize_down_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_DOWN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_obj_image_resize_up_set(resize_up) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_SET), EO_TYPECHECK(Eina_Bool, resize_up)
+#define elm_obj_image_resize_up_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_RESIZE_UP_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_obj_image_scale_set(scale) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_SET), EO_TYPECHECK(double, scale)
+#define elm_obj_image_scale_get(ret) ELM_OBJ_IMAGE_ID(ELM_OBJ_IMAGE_SUB_ID_SCALE_GET), EO_TYPECHECK(double *, ret)
/**
* @addtogroup Image
* @{
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index 3fbeb0752..dcc59c50f 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -1,9 +1,16 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "els_box.h"
+#include "elm_widget_layout.h"
#include "elm_widget_index.h"
-EAPI const char ELM_INDEX_SMART_NAME[] = "elm_index";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_INDEX_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_INDEX_CLASS
+
+#define MY_CLASS_NAME "elm_index"
static const char SIG_CHANGED[] = "changed";
static const char SIG_DELAY_CHANGED[] = "delay,changed";
@@ -19,10 +26,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_INDEX_SMART_NAME, _elm_index, Elm_Index_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_item_free(Elm_Index_Item *it)
{
@@ -193,28 +196,34 @@ _index_box_auto_fill(Evas_Object *obj,
sd->level_active[level] = 1;
}
-static Eina_Bool
-_elm_index_smart_theme(Evas_Object *obj)
+static void
+_elm_index_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord minw = 0, minh = 0;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
_index_box_clear(obj, sd->bx[0], 0);
_index_box_clear(obj, sd->bx[1], 1);
if (sd->horizontal)
- eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "base/horizontal");
+ eina_stringshare_replace(&ld->group, "base/horizontal");
else
- eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "base/vertical");
+ eina_stringshare_replace(&ld->group, "base/vertical");
- if (!ELM_WIDGET_CLASS(_elm_index_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(sd->event[0], minw, minh);
if (edje_object_part_exists
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.index.1"))
+ (wd->resize_obj, "elm.swallow.index.1"))
{
if (!sd->bx[1])
{
@@ -231,7 +240,7 @@ _elm_index_smart_theme(Evas_Object *obj)
sd->bx[1] = NULL;
}
if (edje_object_part_exists
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.event.1"))
+ (wd->resize_obj, "elm.swallow.event.1"))
{
if (!sd->event[1])
{
@@ -248,7 +257,7 @@ _elm_index_smart_theme(Evas_Object *obj)
evas_object_del(sd->event[1]);
sd->event[1] = NULL;
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
_index_box_auto_fill(obj, sd->bx[0], 0);
@@ -260,17 +269,17 @@ _elm_index_smart_theme(Evas_Object *obj)
}
else elm_layout_signal_emit(obj, "elm,state,inactive", "elm");
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_index_smart_sizing_eval(Evas_Object *obj)
+_elm_index_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
@@ -351,6 +360,7 @@ _sel_eval(Evas_Object *obj,
int i;
ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
for (i = 0; i <= sd->level; i++)
{
@@ -394,7 +404,7 @@ _sel_eval(Evas_Object *obj,
}
if ((i == 0) && (sd->level == 0))
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.index.1", cdv, cdv);
+ (wd->resize_obj, "elm.dragable.index.1", cdv, cdv);
if (it_closest) it_closest->selected = 1;
if (it_closest != it_last)
{
@@ -494,10 +504,11 @@ _on_mouse_down(void *data,
Evas_Coord x, y, w;
ELM_INDEX_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
if (ev->button != 1) return;
sd->down = 1;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, &x, &y, &w, NULL);
+ evas_object_geometry_get(wd->resize_obj, &x, &y, &w, NULL);
sd->dx = ev->canvas.x - x;
sd->dy = ev->canvas.y - y;
if (!sd->autohide_disabled)
@@ -508,7 +519,7 @@ _on_mouse_down(void *data,
}
_sel_eval(data, ev->canvas.x, ev->canvas.y);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.pointer",
+ (wd->resize_obj, "elm.dragable.pointer",
(!elm_object_mirrored_get(data)) ? sd->dx : (sd->dx - w), sd->dy);
if (sd->items && !sd->indicator_disabled)
elm_layout_signal_emit(data, "elm,indicator,state,active", "elm");
@@ -555,18 +566,19 @@ _on_mouse_move(void *data,
char buf[1024];
ELM_INDEX_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
if (!sd->down) return;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, &x, &y, &w, NULL);
+ evas_object_geometry_get(wd->resize_obj, &x, &y, &w, NULL);
x = ev->cur.canvas.x - x;
y = ev->cur.canvas.y - y;
dx = x - sd->dx;
adx = dx;
if (adx < 0) adx = -dx;
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.pointer",
- (!edje_object_mirrored_get(ELM_WIDGET_DATA(sd)->resize_obj)) ?
+ (wd->resize_obj, "elm.dragable.pointer",
+ (!edje_object_mirrored_get(wd->resize_obj)) ?
x : (x - w), y);
if (!sd->horizontal)
{
@@ -673,14 +685,15 @@ _access_index_register(Evas_Object *obj)
}
static void
-_elm_index_smart_add(Evas_Object *obj)
+_elm_index_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *o;
Evas_Coord minw, minh;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Index_Smart_Data);
+ Elm_Index_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_index_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->indicator_disabled = EINA_FALSE;
priv->horizontal = EINA_FALSE;
@@ -719,7 +732,7 @@ _elm_index_smart_add(Evas_Object *obj)
}
if (edje_object_part_exists
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.swallow.event.1"))
+ (wd->resize_obj, "elm.swallow.event.1"))
{
o = evas_object_rectangle_add(evas_object_evas_get(obj));
priv->event[1] = o;
@@ -736,7 +749,7 @@ _elm_index_smart_add(Evas_Object *obj)
evas_object_show(priv->bx[0]);
if (edje_object_part_exists
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.swallow.index.1"))
+ (wd->resize_obj, "elm.swallow.index.1"))
{
priv->bx[1] = evas_object_box_add(evas_object_evas_get(obj));
evas_object_box_layout_set
@@ -755,11 +768,11 @@ _elm_index_smart_add(Evas_Object *obj)
}
static void
-_elm_index_smart_del(Evas_Object *obj)
+_elm_index_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Index_Item *it;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
while (sd->items)
{
@@ -770,22 +783,41 @@ _elm_index_smart_del(Evas_Object *obj)
if (sd->delay) ecore_timer_del(sd->delay);
- ELM_WIDGET_CLASS(_elm_index_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_index_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_index_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_index_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_index_smart_focus_next_enable;
+}
+
+static void
+_elm_index_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_index_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
Eina_List *items = NULL;
Eina_List *l = NULL;
Elm_Index_Item *it;
Evas_Object *ao;
Evas_Object *po;
- ELM_INDEX_CHECK(obj) EINA_FALSE;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
if (!sd->autohide_disabled)
elm_layout_signal_emit((Evas_Object *)obj, "elm,state,active", "elm");
@@ -801,15 +833,14 @@ _elm_index_smart_focus_next(const Evas_Object *obj,
items = eina_list_append(items, it->base.access_obj);
}
- Eina_Bool ret;
- ret = elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
// to hide index item, if there is nothing to focus on autohide disalbe mode
- if ((!sd->autohide_disabled) && (!ret))
+ if ((!sd->autohide_disabled) && (!int_ret))
elm_layout_signal_emit((Evas_Object *)obj, "elm,state,inactive", "elm");
- return ret;
+ if (ret) *ret = int_ret;
}
static void
@@ -855,71 +886,31 @@ _access_obj_process(Evas_Object *obj, Eina_Bool is_access)
}
static void
-_elm_index_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_index_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(obj, is_access);
-}
-
-static void
-_elm_index_smart_set_user(Elm_Index_Smart_Class *sc)
+_elm_index_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_index_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_index_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_index_smart_theme;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_index_smart_sizing_eval;
-
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_index_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_index_smart_access;
-}
-
-EAPI const Elm_Index_Smart_Class *
-elm_index_smart_class_get(void)
-{
- static Elm_Index_Smart_Class _sc =
- ELM_INDEX_SMART_CLASS_INIT_NAME_VERSION(ELM_INDEX_SMART_NAME);
- static const Elm_Index_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_index_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ _elm_index_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(obj, _elm_index_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_index_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_index_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -927,7 +918,14 @@ elm_index_autohide_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_index_autohide_disabled_set(disabled));
+}
+
+static void
+_autohide_disabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+ Elm_Index_Smart_Data *sd = _pd;
disabled = !!disabled;
if (sd->autohide_disabled == disabled) return;
@@ -949,9 +947,17 @@ EAPI Eina_Bool
elm_index_autohide_disabled_get(const Evas_Object *obj)
{
ELM_INDEX_CHECK(obj) EINA_FALSE;
- ELM_INDEX_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_index_autohide_disabled_get(&ret));
+ return ret;
+}
- return sd->autohide_disabled;
+static void
+_autohide_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Index_Smart_Data *sd = _pd;
+ *ret = sd->autohide_disabled;
}
EAPI void
@@ -959,7 +965,14 @@ elm_index_item_level_set(Evas_Object *obj,
int level)
{
ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_index_item_level_set(level));
+}
+
+static void
+_item_level_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int level = va_arg(*list, int);
+ Elm_Index_Smart_Data *sd = _pd;
if (sd->level == level) return;
sd->level = level;
@@ -969,9 +982,17 @@ EAPI int
elm_index_item_level_get(const Evas_Object *obj)
{
ELM_INDEX_CHECK(obj) 0;
- ELM_INDEX_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_index_item_level_get(&ret));
+ return ret;
+}
- return sd->level;
+static void
+_item_level_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Index_Smart_Data *sd = _pd;
+ *ret = sd->level;
}
EAPI void
@@ -998,19 +1019,33 @@ EAPI Elm_Object_Item *
elm_index_selected_item_get(const Evas_Object *obj,
int level)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_index_selected_item_get(level, &ret));
+ return ret;
+}
+
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int level = va_arg(*list, int);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+
Eina_List *l;
Elm_Index_Item *it;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->items, l, it)
{
if ((it->selected) && (it->level == level))
- return (Elm_Object_Item *)it;
+ {
+ *ret = (Elm_Object_Item *)it;
+ return;
+ }
}
- return NULL;
+ *ret = NULL;
}
EAPI Elm_Object_Item *
@@ -1019,18 +1054,32 @@ elm_index_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_append(letter, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
+ const char *letter = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Index_Item *it;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
it = _item_new(obj, letter, func, data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_list_append(sd->items, it);
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1039,18 +1088,32 @@ elm_index_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_prepend(letter, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj, void *_pd, va_list *list)
+{
+ const char *letter = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Index_Item *it;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
it = _item_new(obj, letter, func, data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_list_prepend(sd->items, it);
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EINA_DEPRECATED EAPI Elm_Object_Item *
@@ -1070,20 +1133,39 @@ elm_index_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_insert_after(after, letter, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *after = va_arg(*list, Elm_Object_Item *);
+ const char *letter = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Index_Item *it;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
- if (!after) return elm_index_item_append(obj, letter, func, data);
+ if (!after)
+ {
+ *ret = elm_index_item_append(obj, letter, func, data);
+ return;
+ }
it = _item_new(obj, letter, func, data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_list_append_relative(sd->items, it, after);
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1093,20 +1175,39 @@ elm_index_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_insert_before(before, letter, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *before = va_arg(*list, Elm_Object_Item *);
+ const char *letter = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Index_Item *it;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
- if (!before) return elm_index_item_prepend(obj, letter, func, data);
+ if (!before)
+ {
+ *ret = elm_index_item_prepend(obj, letter, func, data);
+ return;
+ }
it = _item_new(obj, letter, func, data);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_list_prepend_relative(sd->items, it, before);
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1117,17 +1218,37 @@ elm_index_item_sorted_insert(Evas_Object *obj,
Eina_Compare_Cb cmp_func,
Eina_Compare_Cb cmp_data_func)
{
+ ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_sorted_insert(letter, func, data, cmp_func, cmp_data_func, &ret));
+ return ret;
+}
+
+static void
+_item_sorted_insert(Eo *obj, void *_pd, va_list *list)
+{
+ const char *letter = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Eina_Compare_Cb cmp_func = va_arg(*list, Eina_Compare_Cb);
+ Eina_Compare_Cb cmp_data_func = va_arg(*list, Eina_Compare_Cb);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Index_Item *it;
Eina_List *lnear;
int cmp;
- ELM_INDEX_CHECK(obj) NULL;
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
- if (!(sd->items)) return elm_index_item_append(obj, letter, func, data);
+ if (!(sd->items))
+ {
+ *ret = elm_index_item_append(obj, letter, func, data);
+ return;
+ }
it = _item_new(obj, letter, func, data);
- if (!it) return NULL;
+ if (!it) return;
lnear = eina_list_search_sorted_near_list(sd->items, cmp_func, it, &cmp);
if (cmp < 0)
@@ -1150,7 +1271,7 @@ elm_index_item_sorted_insert(Evas_Object *obj,
}
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -1158,18 +1279,33 @@ elm_index_item_find(Evas_Object *obj,
const void *data)
{
ELM_INDEX_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_index_item_find(data, &ret));
+ return ret;
+}
- return (Elm_Object_Item *)_item_find(obj, data);
+static void
+_elm_index_item_find(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = (Elm_Object_Item *)_item_find(obj, data);
}
EAPI void
elm_index_item_clear(Evas_Object *obj)
{
+ ELM_INDEX_CHECK(obj);
+ eo_do(obj, elm_obj_index_item_clear());
+}
+
+static void
+_item_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_Index_Item *it;
Eina_List *l, *clear = NULL;
- ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ Elm_Index_Smart_Data *sd = _pd;
_index_box_clear(obj, sd->bx[sd->level], sd->level);
EINA_LIST_FOREACH(sd->items, l, it)
@@ -1186,11 +1322,18 @@ elm_index_item_clear(Evas_Object *obj)
EAPI void
elm_index_level_go(Evas_Object *obj,
- int level __UNUSED__)
+ int level)
{
ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_index_level_go(level));
+}
+static void
+_level_go(Eo *obj, void *_pd, va_list *list)
+{
+ int level = va_arg(*list, int);
+ (void) level;
+ Elm_Index_Smart_Data *sd = _pd;
_index_box_auto_fill(obj, sd->bx[0], 0);
if (sd->level == 1) _index_box_auto_fill(obj, sd->bx[1], 1);
}
@@ -1200,7 +1343,14 @@ elm_index_indicator_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_index_indicator_disabled_set(disabled));
+}
+
+static void
+_indicator_disabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+ Elm_Index_Smart_Data *sd = _pd;
disabled = !!disabled;
if (sd->indicator_disabled == disabled) return;
@@ -1216,9 +1366,17 @@ EAPI Eina_Bool
elm_index_indicator_disabled_get(const Evas_Object *obj)
{
ELM_INDEX_CHECK(obj) EINA_FALSE;
- ELM_INDEX_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_index_indicator_disabled_get(&ret));
+ return ret;
+}
- return sd->indicator_disabled;
+static void
+_indicator_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Index_Smart_Data *sd = _pd;
+ *ret = sd->indicator_disabled;
}
EAPI const char *
@@ -1234,20 +1392,105 @@ elm_index_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_INDEX_CHECK(obj);
- ELM_INDEX_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_index_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Index_Smart_Data *sd = _pd;
horizontal = !!horizontal;
if (horizontal == sd->horizontal) return;
sd->horizontal = horizontal;
- _elm_index_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_index_horizontal_get(const Evas_Object *obj)
{
ELM_INDEX_CHECK(obj) EINA_FALSE;
- ELM_INDEX_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_index_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Index_Smart_Data *sd = _pd;
+ *ret = sd->horizontal;
}
+
+static void
+_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_index_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_index_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_index_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_index_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_index_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_index_smart_access),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_index_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_index_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET), _autohide_disabled_set),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET), _autohide_disabled_get),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET), _item_level_set),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET), _item_level_get),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT), _item_sorted_insert),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_FIND), _elm_index_item_find),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR), _item_clear),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_LEVEL_GO), _level_go),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET), _indicator_disabled_set),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET), _indicator_disabled_get),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET, "Enable or disable auto hiding feature for a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET, "Get whether auto hiding feature is enabled or not for a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET, "Set the items level for a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET, "Get the items level set for a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET, "Returns the last selected item, for a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND, "Append a new item on a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND, "Prepend a new item on a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER, "Insert a new item into the index object after item after."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE, "Insert a new item into the index object before item before."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT, "Insert a new item into the given index widget, using cmp_func."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_FIND, "Find a given index widget's item, <b>using item data</b>."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR, "Removes all items from a given index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_LEVEL_GO, "Go to a given items level on a index widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET, "Set the indicator as to be disabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET, "Get the value of indicator's disabled status."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET, "Enable or disable horizontal mode on the index object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET, "Get a value whether horizontal mode is enabled or not."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_INDEX_BASE_ID, op_desc, ELM_OBJ_INDEX_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Index_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_index_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_index.h b/src/lib/elm_index.h
index f3f58f377..76c0fc2ab 100644
--- a/src/lib/elm_index.h
+++ b/src/lib/elm_index.h
@@ -52,6 +52,260 @@
* @li @ref index_example_02
*/
+#define ELM_OBJ_INDEX_CLASS elm_obj_index_class_get()
+
+const Eo_Class *elm_obj_index_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_INDEX_BASE_ID;
+
+enum
+{
+ ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET,
+ ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET,
+ ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_FIND,
+ ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR,
+ ELM_OBJ_INDEX_SUB_ID_LEVEL_GO,
+ ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET,
+ ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET,
+ ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_INDEX_SUB_ID_LAST
+};
+
+#define ELM_OBJ_INDEX_ID(sub_id) (ELM_OBJ_INDEX_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_index_autohide_disabled_set
+ * @since 1.8
+ *
+ * Enable or disable auto hiding feature for a given index widget.
+ *
+ * @param[in] disabled
+ *
+ * @see elm_index_autohide_disabled_set
+ */
+#define elm_obj_index_autohide_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_index_autohide_disabled_get
+ * @since 1.8
+ *
+ * Get whether auto hiding feature is enabled or not for a given index widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_index_autohide_disabled_get
+ */
+#define elm_obj_index_autohide_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_AUTOHIDE_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_index_item_level_set
+ * @since 1.8
+ *
+ * Set the items level for a given index widget.
+ *
+ * @param[in] level
+ *
+ * @see elm_index_item_level_set
+ */
+#define elm_obj_index_item_level_set(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_SET), EO_TYPECHECK(int, level)
+
+/**
+ * @def elm_obj_index_item_level_get
+ * @since 1.8
+ *
+ * Get the items level set for a given index widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_index_item_level_get
+ */
+#define elm_obj_index_item_level_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_LEVEL_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_index_selected_item_get
+ * @since 1.8
+ *
+ * Returns the last selected item, for a given index widget.
+ *
+ * @param[in] level
+ * @param[out] ret
+ *
+ * @see elm_index_selected_item_get
+ */
+#define elm_obj_index_selected_item_get(level, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(int, level), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_append
+ * @since 1.8
+ *
+ * Append a new item on a given index widget.
+ *
+ * @param[in] letter
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_index_item_append
+ */
+#define elm_obj_index_item_append(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_prepend
+ * @since 1.8
+ *
+ * Prepend a new item on a given index widget.
+ *
+ * @param[in] letter
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_index_item_prepend
+ */
+#define elm_obj_index_item_prepend(letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_insert_after
+ * @since 1.8
+ *
+ * Insert a new item into the index object after item after.
+ *
+ * @param[in] after
+ * @param[in] letter
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_index_item_insert_after
+ */
+#define elm_obj_index_item_insert_after(after, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_insert_before
+ * @since 1.8
+ *
+ * Insert a new item into the index object before item before.
+ *
+ * @param[in] before
+ * @param[in] letter
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_index_item_insert_before
+ */
+#define elm_obj_index_item_insert_before(before, letter, func, data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_sorted_insert
+ * @since 1.8
+ *
+ * Insert a new item into the given index widget, using cmp_func
+ *
+ * @param[in] letter
+ * @param[in] func
+ * @param[in] data
+ * @param[in] cmp_func
+ * @param[in] cmp_data_func
+ * @param[out] ret
+ *
+ * @see elm_index_item_sorted_insert
+ */
+#define elm_obj_index_item_sorted_insert(letter, func, data, cmp_func, cmp_data_func, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const char *, letter), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, cmp_func), EO_TYPECHECK(Eina_Compare_Cb, cmp_data_func), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_find
+ * @since 1.8
+ *
+ * Find a given index widget's item, <b>using item data</b>.
+ *
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_index_item_find
+ */
+#define elm_obj_index_item_find(data, ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_FIND), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_index_item_clear
+ * @since 1.8
+ *
+ * Removes all items from a given index widget.
+ *
+ *
+ * @see elm_index_item_clear
+ */
+#define elm_obj_index_item_clear() ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_ITEM_CLEAR)
+
+/**
+ * @def elm_obj_index_level_go
+ * @since 1.8
+ *
+ * Go to a given items level on a index widget
+ *
+ * @param[in] level
+ *
+ * @see elm_index_level_go
+ */
+#define elm_obj_index_level_go(level) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_LEVEL_GO), EO_TYPECHECK(int, level)
+
+/**
+ * @def elm_obj_index_indicator_disabled_set
+ * @since 1.8
+ *
+ * Set the indicator as to be disabled.
+ *
+ * @param[in] disabled
+ *
+ * @see elm_index_indicator_disabled_set
+ */
+#define elm_obj_index_indicator_disabled_set(disabled) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_index_indicator_disabled_get
+ * @since 1.8
+ *
+ * Get the value of indicator's disabled status.
+ *
+ * @param[out] ret
+ *
+ * @see elm_index_indicator_disabled_get
+ */
+#define elm_obj_index_indicator_disabled_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_INDICATOR_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_index_horizontal_set
+ * @since 1.8
+ *
+ * Enable or disable horizontal mode on the index object
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_index_horizontal_set
+ */
+#define elm_obj_index_horizontal_set(horizontal) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_index_horizontal_get
+ * @since 1.8
+ *
+ * Get a value whether horizontal mode is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_index_horizontal_get
+ */
+#define elm_obj_index_horizontal_get(ret) ELM_OBJ_INDEX_ID(ELM_OBJ_INDEX_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @addtogroup Index
* @{
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 9606d745e..55cf0da90 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -2,10 +2,14 @@
#include "elm_priv.h"
#include "elm_interface_scrollable.h"
-static const char PAN_SMART_NAME[] = "elm_pan";
+EAPI Eo_Op ELM_OBJ_PAN_BASE_ID = EO_NOOP;
+
+#define MY_PAN_CLASS ELM_OBJ_PAN_CLASS
+
+#define MY_PAN_CLASS_NAME "elm_pan"
#define ELM_PAN_DATA_GET(o, sd) \
- Elm_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Pan_Smart_Data * sd = eo_data_get(o, MY_PAN_CLASS)
#define ELM_PAN_DATA_GET_OR_RETURN(o, ptr) \
ELM_PAN_DATA_GET(o, ptr); \
@@ -31,30 +35,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (PAN_SMART_NAME, _elm_pan, Elm_Pan_Smart_Class, Evas_Smart_Class,
- evas_object_smart_clipped_class_get, _smart_callbacks);
-
static void _elm_pan_content_set(Evas_Object *, Evas_Object *);
-EAPI const Elm_Pan_Smart_Class *
-elm_pan_smart_class_get(void)
-{
- static Elm_Pan_Smart_Class _sc =
- ELM_PAN_SMART_CLASS_INIT_NAME_VERSION(PAN_SMART_NAME);
- static const Elm_Pan_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_pan_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
static void
_elm_pan_update(Elm_Pan_Smart_Data *psd)
{
@@ -80,14 +62,11 @@ _elm_pan_update(Elm_Pan_Smart_Data *psd)
}
static void
-_elm_pan_smart_add(Evas_Object *obj)
+_elm_pan_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- const Evas_Smart_Class *sc;
- const Evas_Smart *smart;
+ Elm_Pan_Smart_Data *priv = _pd;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Pan_Smart_Data);
-
- _elm_pan_parent_sc->add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->self = obj;
@@ -97,28 +76,22 @@ _elm_pan_smart_add(Evas_Object *obj)
priv->h = 0;
priv->gravity_x = 0.0;
priv->gravity_y = 0.0;
-
- smart = evas_object_smart_smart_get(obj);
- sc = evas_smart_class_get(smart);
- priv->api = (const Elm_Pan_Smart_Class *)sc;
}
static void
-_elm_pan_smart_del(Evas_Object *obj)
+_elm_pan_smart_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
_elm_pan_content_set(obj, NULL);
- _elm_pan_parent_sc->del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_pan_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_pan_smart_move(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
-
- /* we don't want the clipped smart object version here */
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Pan_Smart_Data *psd = _pd;
psd->x = x;
psd->y = y;
@@ -127,11 +100,11 @@ _elm_pan_smart_move(Evas_Object *obj,
}
static void
-_elm_pan_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_pan_smart_resize(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
psd->w = w;
psd->h = h;
@@ -141,33 +114,33 @@ _elm_pan_smart_resize(Evas_Object *obj,
}
static void
-_elm_pan_smart_show(Evas_Object *obj)
+_elm_pan_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
- _elm_pan_parent_sc->show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
if (psd->content)
evas_object_show(psd->content);
}
static void
-_elm_pan_smart_hide(Evas_Object *obj)
+_elm_pan_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
- _elm_pan_parent_sc->hide(obj);
+ eo_do_super(obj, evas_obj_smart_hide());
if (psd->content)
evas_object_hide(psd->content);
}
static void
-_elm_pan_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_pan_pos_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
if ((x == psd->px) && (y == psd->py)) return;
psd->px = x;
@@ -178,22 +151,22 @@ _elm_pan_pos_set(Evas_Object *obj,
}
static void
-_elm_pan_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_pan_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = psd->px;
if (y) *y = psd->py;
}
static void
-_elm_pan_pos_max_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_pan_pos_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x)
{
@@ -208,10 +181,10 @@ _elm_pan_pos_max_get(const Evas_Object *obj,
}
static void
-_elm_pan_pos_min_get(const Evas_Object *obj __UNUSED__,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x)
*x = 0;
if (y)
@@ -219,23 +192,23 @@ _elm_pan_pos_min_get(const Evas_Object *obj __UNUSED__,
}
static void
-_elm_pan_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_pan_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
if (w) *w = psd->content_w;
if (h) *h = psd->content_h;
}
static void
-_elm_pan_gravity_set(Evas_Object *obj,
- double x,
- double y)
+_elm_pan_gravity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ double x = va_arg(*list, double);
+ double y = va_arg(*list, double);
psd->gravity_x = x;
psd->gravity_y = y;
psd->prev_cw = psd->content_w;
@@ -245,39 +218,31 @@ _elm_pan_gravity_set(Evas_Object *obj,
}
static void
-_elm_pan_gravity_get(const Evas_Object *obj,
- double *x,
- double *y)
+_elm_pan_gravity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PAN_DATA_GET(obj, psd);
+ Elm_Pan_Smart_Data *psd = _pd;
+ double *x = va_arg(*list, double *);
+ double *y = va_arg(*list, double *);
if (x) *x = psd->gravity_x;
if (y) *y = psd->gravity_y;
}
-static void
-_elm_pan_smart_set_user(Elm_Pan_Smart_Class *sc)
+static Evas_Object *
+_elm_pan_add(Evas *evas)
{
- sc->base.add = _elm_pan_smart_add;
- sc->base.del = _elm_pan_smart_del;
- sc->base.move = _elm_pan_smart_move;
- sc->base.resize = _elm_pan_smart_resize;
- sc->base.show = _elm_pan_smart_show;
- sc->base.hide = _elm_pan_smart_hide;
-
- sc->pos_set = _elm_pan_pos_set;
- sc->pos_get = _elm_pan_pos_get;
- sc->pos_max_get = _elm_pan_pos_max_get;
- sc->pos_min_get = _elm_pan_pos_min_get;
- sc->content_size_get = _elm_pan_content_size_get;
- sc->gravity_set = _elm_pan_gravity_set;
- sc->gravity_get = _elm_pan_gravity_get;
+ Evas_Object *obj = eo_add(MY_PAN_CLASS, evas);
+ eo_unref(obj);
+ return obj;
}
-static Evas_Object *
-_elm_pan_add(Evas *evas)
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- return evas_object_smart_add(evas, _elm_pan_smart_class_new());
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_PAN_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
}
static void
@@ -357,14 +322,66 @@ end:
evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL);
}
+static void
+_elm_pan_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_pan_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_pan_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_pan_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_pan_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_pan_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_pan_smart_hide),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_pan_pos_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_pan_pos_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_pan_pos_max_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_pan_pos_min_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_pan_content_size_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_GRAVITY_SET), _elm_pan_gravity_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_GRAVITY_GET), _elm_pan_gravity_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description _elm_pan_op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_GRAVITY_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_OBJ_PAN_SUB_ID_GRAVITY_GET, "description here"),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description _elm_pan_class_desc = {
+ EO_VERSION,
+ MY_PAN_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PAN_BASE_ID, _elm_pan_op_desc, ELM_OBJ_PAN_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Pan_Smart_Data),
+ _elm_pan_class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_pan_eo_class_get, &_elm_pan_class_desc, EVAS_OBJ_SMART_CLIPPED_CLASS, NULL);
+
/* pan smart object on top, scroller interface on bottom */
/* ============================================================ */
-static const char SCROLL_SMART_NAME[] = "elm_scroll";
+EAPI Eo_Op ELM_SCROLLABLE_INTERFACE_BASE_ID = EO_NOOP;
+
+#define MY_SCROLLABLE_INTERFACE ELM_SCROLLABLE_INTERFACE
+
+#define MY_SCROLLABLE_INTERFACE_NAME "elm_interface_scrollable"
#define ELM_SCROLL_IFACE_DATA_GET(o, sid) \
Elm_Scrollable_Smart_Interface_Data * sid = \
- evas_object_smart_interface_data_get(o, &(ELM_SCROLLABLE_IFACE.base))
+ (!eo_isa(obj, MY_SCROLLABLE_INTERFACE) ? NULL : \
+ eo_data_get(o, MY_SCROLLABLE_INTERFACE));
#define ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(o, ptr) \
ELM_SCROLL_IFACE_DATA_GET(o, ptr); \
@@ -387,12 +404,6 @@ static const char SCROLL_SMART_NAME[] = "elm_scroll";
static void _elm_scroll_scroll_bar_size_adjust(
Elm_Scrollable_Smart_Interface_Data *);
static void _elm_scroll_wanted_region_set(Evas_Object *);
-static void _elm_scroll_content_pos_get(const Evas_Object *,
- Evas_Coord *,
- Evas_Coord *);
-static void _elm_scroll_content_pos_set(Evas_Object *,
- Evas_Coord,
- Evas_Coord);
#define LEFT 0
#define RIGHT 1
@@ -516,11 +527,10 @@ _elm_direction_arrows_eval(Elm_Scrollable_Smart_Interface_Data *sid)
Evas_Coord x = 0, y = 0, mx = 0, my = 0, minx = 0, miny = 0;
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->pos_get(sid->pan_obj, &x, &y);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&x, &y));
if (x == minx) go_left = EINA_FALSE;
if (x == (mx + minx)) go_right = EINA_FALSE;
@@ -815,8 +825,6 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
{
if (!sid->pan_obj || !sid->edje_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if ((sid->content) || (sid->extern_pan))
{
Evas_Coord x, y, w, h, mx = 0, my = 0, vw = 0, vh = 0, px, py,
@@ -855,8 +863,8 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
edje_object_part_drag_value_get
(sid->edje_obj, "elm.dragable.vbar", NULL, &vy);
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
x = vx * mx + minx;
y = vy * my + miny;
@@ -883,10 +891,10 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
(sid->edje_obj, "elm.dragable.vbar", 0.0,
-((double)sid->page.y * ((double)vh / (double)h)) / 100.0);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
if (vx != mx) x = px;
if (vy != my) y = py;
- psd->api->pos_set(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y));
}
else
{
@@ -896,9 +904,9 @@ _elm_scroll_scroll_bar_size_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
(sid->edje_obj, "elm.dragable.vbar", 1.0, 1.0);
edje_object_part_drag_size_set
(sid->edje_obj, "elm.dragable.hbar", 1.0, 1.0);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->pos_get(sid->pan_obj, &px, &py);
- psd->api->pos_set(sid->pan_obj, minx, miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_set(minx, miny));
if ((px != minx) || (py != miny))
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
}
@@ -914,8 +922,6 @@ _elm_scroll_scroll_bar_read_and_update(
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if ((sid->down.dragged) || (sid->down.bounce_x_animator)
|| (sid->down.bounce_y_animator) || (sid->down.momentum_animator)
|| (sid->scrollto.x.animator) || (sid->scrollto.y.animator))
@@ -924,12 +930,12 @@ _elm_scroll_scroll_bar_read_and_update(
(sid->edje_obj, "elm.dragable.vbar", NULL, &vy);
edje_object_part_drag_value_get
(sid->edje_obj, "elm.dragable.hbar", &vx, NULL);
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
x = vx * (double)mx + minx;
y = vy * (double)my + miny;
- psd->api->pos_get(sid->pan_obj, &px, &py);
- psd->api->pos_set(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y));
if ((px != x) || (py != y))
{
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
@@ -1039,11 +1045,11 @@ _elm_scroll_edje_drag_h_cb(void *data,
}
static void
-_elm_scroll_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_scroll_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
if (!sid->content) return;
@@ -1051,11 +1057,11 @@ _elm_scroll_content_size_get(const Evas_Object *obj,
}
static void
-_elm_scroll_content_viewport_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_scroll_content_viewport_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
if (!sid->pan_obj || !sid->edje_obj) return;
@@ -1064,11 +1070,11 @@ _elm_scroll_content_viewport_size_get(const Evas_Object *obj,
}
static void
-_elm_scroll_content_min_limit(Evas_Object *obj,
- Eina_Bool w,
- Eina_Bool h)
+_elm_scroll_content_min_limit(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
if (!sid->edje_obj) return;
@@ -1094,10 +1100,9 @@ _elm_scroll_x_mirrored_get(const Evas_Object *obj,
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
- _elm_scroll_content_viewport_size_get(obj, &w, NULL);
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
+ eo_do((Eo *)obj, elm_scrollable_interface_content_viewport_size_get(&w, NULL));
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
ret = (cw - (x + w));
return (ret >= 0) ? ret : 0;
@@ -1114,13 +1119,12 @@ _elm_scroll_wanted_coordinates_update(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
/* Update wx/y/w/h - and if the requested positions aren't legal
* adjust a bit. */
- _elm_scroll_content_viewport_size_get(sid->obj, &sid->ww, &sid->wh);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get
+ (&sid->ww, &sid->wh));
if (x < 0)
sid->wx = 0;
else if ((x + sid->ww) > cw)
@@ -1142,7 +1146,7 @@ _elm_scroll_momentum_end(Elm_Scrollable_Smart_Interface_Data *sid)
if (sid->down.momentum_animator)
{
Evas_Coord px, py;
- _elm_scroll_content_pos_get(sid->obj, &px, &py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&px, &py));
_elm_scroll_wanted_coordinates_update(sid, px, py);
ecore_animator_del(sid->down.momentum_animator);
@@ -1174,7 +1178,8 @@ _elm_scroll_bounce_x_animator(void *data)
{
dt = dt / _elm_config->thumbscroll_bounce_friction;
odx = sid->down.b2x - sid->down.bx;
- _elm_scroll_content_viewport_size_get(sid->obj, &w, NULL);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get
+ (&w, NULL));
if (!sid->down.momentum_animator && (w > abs(odx)))
{
pd = (double)odx / (double)w;
@@ -1184,7 +1189,7 @@ _elm_scroll_bounce_x_animator(void *data)
}
if (dt > 1.0) dt = 1.0;
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
dx = (odx * p);
r = 1.0;
if (sid->down.momentum_animator)
@@ -1196,7 +1201,7 @@ _elm_scroll_bounce_x_animator(void *data)
}
x = sid->down.b2x + (int)((double)(dx - odx) * r);
if (!sid->down.cancelled)
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
if (dt >= 1.0)
{
if (sid->down.momentum_animator)
@@ -1230,7 +1235,8 @@ _elm_scroll_bounce_y_animator(void *data)
{
dt = dt / _elm_config->thumbscroll_bounce_friction;
ody = sid->down.b2y - sid->down.by;
- _elm_scroll_content_viewport_size_get(sid->obj, NULL, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get
+ (NULL, &h));
if (!sid->down.momentum_animator && (h > abs(ody)))
{
pd = (double)ody / (double)h;
@@ -1240,7 +1246,7 @@ _elm_scroll_bounce_y_animator(void *data)
}
if (dt > 1.0) dt = 1.0;
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
dy = (ody * p);
r = 1.0;
if (sid->down.momentum_animator)
@@ -1252,7 +1258,7 @@ _elm_scroll_bounce_y_animator(void *data)
}
y = sid->down.b2y + (int)((double)(dy - ody) * r);
if (!sid->down.cancelled)
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
if (dt >= 1.0)
{
if (sid->down.momentum_animator)
@@ -1280,8 +1286,6 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if (sid->freeze) return;
if ((!sid->bouncemex) && (!sid->bouncemey)) return;
if (sid->down.now) return; // down bounce while still held down
@@ -1299,9 +1303,9 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
if (sid->content_info.resized)
_elm_scroll_wanted_region_set(sid->obj);
}
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
bx = px;
by = py;
if (px < minx) px = minx;
@@ -1361,36 +1365,33 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
}
static void
-_elm_scroll_content_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_scroll_content_pos_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->pos_get(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(x, y));
}
static void
-_elm_scroll_content_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_scroll_content_pos_set(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+
Evas_Coord mx = 0, my = 0, px = 0, py = 0, minx = 0, miny = 0;
double vx, vy;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
if (!sid->edje_obj || !sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
// FIXME: allow for bounce outside of range
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (mx > 0) vx = (double)(x - minx) / (double)mx;
else vx = 0.0;
@@ -1410,7 +1411,7 @@ _elm_scroll_content_pos_set(Evas_Object *obj,
(sid->edje_obj, "elm.dragable.vbar", 0.0, vy);
edje_object_part_drag_value_set
(sid->edje_obj, "elm.dragable.hbar", vx, 0.0);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
if (!_elm_config->thumbscroll_bounce_enable)
{
if (x < minx) x = minx;
@@ -1430,7 +1431,7 @@ _elm_scroll_content_pos_set(Evas_Object *obj,
if (y - miny > my) y = my + miny;
}
- psd->api->pos_set(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_set(x, y));
if ((px != x) || (py != y))
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
if (!sid->down.bounce_x_animator)
@@ -1496,12 +1497,12 @@ _elm_scroll_content_pos_set(Evas_Object *obj,
}
static void
-_elm_scroll_mirrored_set(Evas_Object *obj,
- Eina_Bool mirrored)
+_elm_scroll_mirrored_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
Evas_Coord wx;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool mirrored = va_arg(*list, int);
if (!sid->edje_obj) return;
@@ -1518,7 +1519,7 @@ _elm_scroll_mirrored_set(Evas_Object *obj,
else
wx = sid->wx;
- _elm_scroll_content_pos_set(sid->obj, wx, sid->wy);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(wx, sid->wy));
}
/* returns TRUE when we need to move the scroller, FALSE otherwise.
@@ -1537,12 +1538,10 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
evas_object_geometry_get(sid->pan_obj, NULL, NULL, &pw, &ph);
nx = px;
@@ -1624,17 +1623,17 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
* because of an animation or because this is the correct position after
* constraints. */
static void
-_elm_scroll_content_region_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h)
+_elm_scroll_content_region_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
- _elm_scroll_content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
sid->down.sx = x;
sid->down.sy = y;
sid->down.x = sid->down.history[0].x;
@@ -1645,13 +1644,13 @@ _elm_scroll_content_region_set(Evas_Object *obj,
/* Set should be used for setting the wanted position, for example a
* user scroll or moving the cursor in an entry. */
static void
-_elm_scroll_content_region_show(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h)
+_elm_scroll_content_region_show(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
sid->wx = x;
sid->wy = y;
@@ -1659,7 +1658,7 @@ _elm_scroll_content_region_show(Evas_Object *obj,
sid->wh = h;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
- _elm_scroll_content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
sid->down.sx = x;
sid->down.sy = y;
sid->down.x = sid->down.history[0].x;
@@ -1690,7 +1689,8 @@ _elm_scroll_wanted_region_set(Evas_Object *obj)
if (sid->ww == -1)
{
- _elm_scroll_content_viewport_size_get(obj, &ww, &wh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get
+ (&ww, &wh));
}
else
{
@@ -1698,7 +1698,7 @@ _elm_scroll_wanted_region_set(Evas_Object *obj)
wh = sid->wh;
}
- _elm_scroll_content_region_set(obj, wx, sid->wy, ww, wh);
+ eo_do(obj, elm_scrollable_interface_content_region_set(wx, sid->wy, ww, wh));
}
static void
@@ -1724,7 +1724,7 @@ _elm_scroll_wheel_event_cb(void *data,
return;
else if (evas_key_modifier_is_set(ev->modifiers, "Shift"))
direction = 1;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
if ((sid->down.bounce_x_animator) || (sid->down.bounce_y_animator) ||
(sid->scrollto.x.animator) || (sid->scrollto.y.animator))
{
@@ -1764,7 +1764,7 @@ _elm_scroll_wheel_event_cb(void *data,
if ((!sid->hold) && (!sid->freeze))
{
_elm_scroll_wanted_coordinates_update(sid, x, y);
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
}
}
@@ -1804,8 +1804,6 @@ _elm_scroll_momentum_animator(void *data)
if (!sid->pan_obj) return ECORE_CALLBACK_CANCEL;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
t = ecore_loop_time_get();
dt = t - sid->down.anim_start;
if (dt >= 0.0)
@@ -1821,7 +1819,7 @@ _elm_scroll_momentum_animator(void *data)
sid->down.ay = dy;
x = sid->down.sx - dx;
y = sid->down.sy - dy;
- _elm_scroll_content_pos_get(sid->obj, &px, &py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&px, &py));
if ((sid->down.bounce_x_animator) ||
(sid->down.bounce_x_hold))
{
@@ -1834,10 +1832,10 @@ _elm_scroll_momentum_animator(void *data)
sid->down.by = sid->down.by0 - dy + sid->down.b0y;
y = py;
}
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
_elm_scroll_wanted_coordinates_update(sid, x, y);
- psd->api->pos_max_get(sid->pan_obj, &maxx, &maxy);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&maxx, &maxy));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (!sid->bounce_horiz)
{
if (x <= minx) no_bounce_x_end = EINA_TRUE;
@@ -1879,12 +1877,10 @@ _elm_scroll_page_x_get(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
- psd->api->pos_min_get(sid->pan_obj, &minx, NULL);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, NULL));
x += offset;
@@ -1910,12 +1906,10 @@ _elm_scroll_page_y_get(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return 0;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
- psd->api->pos_min_get(sid->pan_obj, NULL, &miny);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(NULL, &miny));
y += offset;
@@ -1942,20 +1936,18 @@ _elm_scroll_scroll_to_x_animator(void *data)
if (!sid->pan_obj) return ECORE_CALLBACK_CANCEL;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
t = ecore_loop_time_get();
tt = (t - sid->scrollto.x.t_start) /
(sid->scrollto.x.t_end - sid->scrollto.x.t_start);
tt = 1.0 - tt;
tt = 1.0 - (tt * tt);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
px = (sid->scrollto.x.start * (1.0 - tt)) +
(sid->scrollto.x.end * tt);
if (t >= sid->scrollto.x.t_end)
{
px = sid->scrollto.x.end;
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py));
sid->down.sx = px;
sid->down.x = sid->down.history[0].x;
_elm_scroll_wanted_coordinates_update(sid, px, py);
@@ -1964,7 +1956,7 @@ _elm_scroll_scroll_to_x_animator(void *data)
_elm_scroll_anim_stop(sid);
return ECORE_CALLBACK_CANCEL;
}
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py));
_elm_scroll_wanted_coordinates_update(sid, px, py);
return ECORE_CALLBACK_RENEW;
}
@@ -1978,20 +1970,18 @@ _elm_scroll_scroll_to_y_animator(void *data)
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
t = ecore_loop_time_get();
tt = (t - sid->scrollto.y.t_start) /
(sid->scrollto.y.t_end - sid->scrollto.y.t_start);
tt = 1.0 - tt;
tt = 1.0 - (tt * tt);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
py = (sid->scrollto.y.start * (1.0 - tt)) +
(sid->scrollto.y.end * tt);
if (t >= sid->scrollto.y.t_end)
{
py = sid->scrollto.y.end;
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py));
sid->down.sy = py;
sid->down.y = sid->down.history[0].y;
_elm_scroll_wanted_coordinates_update(sid, px, py);
@@ -2000,7 +1990,7 @@ _elm_scroll_scroll_to_y_animator(void *data)
_elm_scroll_anim_stop(sid);
return ECORE_CALLBACK_CANCEL;
}
- _elm_scroll_content_pos_set(sid->obj, px, py);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(px, py));
_elm_scroll_wanted_coordinates_update(sid, px, py);
return ECORE_CALLBACK_RENEW;
@@ -2016,19 +2006,18 @@ _elm_scroll_scroll_to_y(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if (sid->freeze) return;
if (t_in <= 0.0)
{
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get
+ (&w, &h));
y = pos_y;
- _elm_scroll_content_region_set(sid->obj, x, y, w, h);
+ eo_do(sid->obj, elm_scrollable_interface_content_region_set(x, y, w, h));
return;
}
t = ecore_loop_time_get();
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
sid->scrollto.y.start = py;
sid->scrollto.y.end = pos_y;
sid->scrollto.y.t_start = t;
@@ -2061,19 +2050,19 @@ _elm_scroll_scroll_to_x(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if (sid->freeze) return;
if (t_in <= 0.0)
{
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get
+ (&w, &h));
x = pos_x;
- _elm_scroll_content_region_set(sid->obj, x, y, w, h);
+ eo_do(sid->obj, elm_scrollable_interface_content_region_set
+ (x, y, w, h));
return;
}
t = ecore_loop_time_get();
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
sid->scrollto.x.start = px;
sid->scrollto.x.end = pos_x;
sid->scrollto.x.t_start = t;
@@ -2108,8 +2097,6 @@ _elm_scroll_mouse_up_event_cb(void *data,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
#ifdef SMOOTHDBG
if (_elm_scroll_smooth_debug) _elm_scroll_smooth_debug_shutdown();
#endif
@@ -2183,10 +2170,11 @@ _elm_scroll_mouse_up_event_cb(void *data,
{
int minx, miny, mx, my, px, py;
- psd->api->pos_min_get
- (sid->pan_obj, &minx, &miny);
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get
+ (&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get
+ (&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
sid->down.dx = ((double)dx / at);
sid->down.dy = ((double)dy / at);
if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
@@ -2236,7 +2224,8 @@ _elm_scroll_mouse_up_event_cb(void *data,
_elm_scroll_anim_start(sid);
}
sid->down.anim_start = ecore_loop_time_get();
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj,
+ elm_scrollable_interface_content_pos_get(&x, &y));
sid->down.sx = x;
sid->down.sy = y;
sid->down.b0x = 0;
@@ -2255,7 +2244,8 @@ _elm_scroll_mouse_up_event_cb(void *data,
{
Evas_Coord pgx, pgy;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get
+ (&x, &y));
if ((!sid->obj) ||
(!elm_widget_drag_child_locked_x_get
(sid->obj)))
@@ -2290,7 +2280,8 @@ _elm_scroll_mouse_up_event_cb(void *data,
{
Evas_Coord pgx, pgy;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get
+ (&x, &y));
if ((!sid->obj) ||
(!elm_widget_drag_child_locked_x_get
(sid->obj)))
@@ -2334,8 +2325,8 @@ _elm_scroll_mouse_up_event_cb(void *data,
sid->down.want_dragged = EINA_FALSE;
sid->down.dragged = EINA_FALSE;
sid->down.now = EINA_FALSE;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
_elm_scroll_wanted_coordinates_update(sid, x, y);
if (sid->content_info.resized)
@@ -2435,7 +2426,7 @@ _elm_scroll_mouse_down_event_cb(void *data,
sid->down.dir_y = EINA_FALSE;
sid->down.x = ev->canvas.x;
sid->down.y = ev->canvas.y;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
sid->down.sx = x;
sid->down.sy = y;
sid->down.locked = EINA_FALSE;
@@ -2468,11 +2459,9 @@ _elm_scroll_can_scroll(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return EINA_FALSE;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->pos_max_get(sid->pan_obj, &mx, &my);
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->pos_get(sid->pan_obj, &px, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_max_get(&mx, &my));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
switch (dir)
{
case LEFT:
@@ -2572,8 +2561,6 @@ _elm_scroll_down_coord_eval(Elm_Scrollable_Smart_Interface_Data *sid,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
if (sid->down.dir_x) *x = sid->down.sx - (*x - sid->down.x);
else *x = sid->down.sx;
if (sid->down.dir_y) *y = sid->down.sy - (*y - sid->down.y);
@@ -2588,7 +2575,7 @@ _elm_scroll_down_coord_eval(Elm_Scrollable_Smart_Interface_Data *sid,
}
}
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (*x < minx)
*x += (minx - *x) * _elm_config->thumbscroll_border_friction;
@@ -2691,7 +2678,7 @@ _elm_scroll_hold_animator(void *data)
fx = fy = 0;
}
- _elm_scroll_content_pos_get(sid->obj, &ox, &oy);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&ox, &oy));
if (sid->down.dir_x)
{
if ((!sid->obj) ||
@@ -2710,7 +2697,7 @@ _elm_scroll_hold_animator(void *data)
_elm_scroll_smooth_debug_movetime_add(ox, oy);
#endif
- _elm_scroll_content_pos_set(sid->obj, ox, oy);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(ox, oy));
return ECORE_CALLBACK_RENEW;
}
@@ -2732,7 +2719,7 @@ _elm_scroll_on_hold_animator(void *data)
(double)_elm_config->thumbscroll_threshold * 2.0;
vy = sid->down.onhold_vy * td *
(double)_elm_config->thumbscroll_threshold * 2.0;
- _elm_scroll_content_pos_get(sid->obj, &ox, &oy);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&ox, &oy));
x = ox;
y = oy;
@@ -2758,7 +2745,7 @@ _elm_scroll_on_hold_animator(void *data)
}
}
- _elm_scroll_content_pos_set(sid->obj, x, y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_set(x, y));
}
sid->down.onhold_tlast = t;
@@ -2777,8 +2764,6 @@ _elm_scroll_mouse_move_event_cb(void *data,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
ev = event_info;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
sid->down.hold_parent = EINA_TRUE;
@@ -2796,7 +2781,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
Evas_Coord px;
ecore_animator_del(sid->scrollto.x.animator);
sid->scrollto.x.animator = NULL;
- psd->api->pos_get(sid->pan_obj, &px, NULL);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, NULL));
sid->down.sx = px;
sid->down.x = sid->down.history[0].x;
}
@@ -2806,7 +2791,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
Evas_Coord py;
ecore_animator_del(sid->scrollto.y.animator);
sid->scrollto.y.animator = NULL;
- psd->api->pos_get(sid->pan_obj, NULL, &py);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(NULL, &py));
sid->down.sy = py;
sid->down.y = sid->down.history[0].y;
}
@@ -2924,7 +2909,7 @@ _elm_scroll_mouse_move_event_cb(void *data,
{
Evas_Coord minx, miny;
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
if (y < miny)
y += (miny - y) *
_elm_config->thumbscroll_border_friction;
@@ -3040,12 +3025,12 @@ _elm_scroll_page_adjust(Elm_Scrollable_Smart_Interface_Data *sid)
if (!_paging_is_enabled(sid)) return;
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
x = _elm_scroll_page_x_get(sid, 0);
y = _elm_scroll_page_y_get(sid, 0);
- _elm_scroll_content_region_set(sid->obj, x, y, w, h);
+ eo_do(sid->obj, elm_scrollable_interface_content_region_set(x, y, w, h));
}
static void
@@ -3225,13 +3210,13 @@ _scroll_event_object_detach(Evas_Object *obj)
}
static void
-_elm_scroll_objects_set(Evas_Object *obj,
- Evas_Object *edje_object,
- Evas_Object *hit_rectangle)
+_elm_scroll_objects_set(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord mw, mh;
+ Evas_Object *edje_object = va_arg(*list, Evas_Object *);
+ Evas_Object *hit_rectangle = va_arg(*list, Evas_Object *);
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
if (!edje_object || !hit_rectangle) return;
@@ -3292,11 +3277,9 @@ _elm_scroll_scroll_bar_reset(Elm_Scrollable_Smart_Interface_Data *sid)
}
if (sid->pan_obj)
{
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->pos_min_get(sid->pan_obj, &minx, &miny);
- psd->api->pos_get(sid->pan_obj, &px, &py);
- psd->api->pos_set(sid->pan_obj, minx, miny);
+ eo_do(sid->pan_obj, elm_obj_pan_pos_min_get(&minx, &miny));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_get(&px, &py));
+ eo_do(sid->pan_obj, elm_obj_pan_pos_set(minx, miny));
}
if ((px != minx) || (py != miny))
edje_object_signal_emit(sid->edje_obj, "elm,action,scroll", "elm");
@@ -3314,9 +3297,7 @@ _elm_scroll_pan_changed_cb(void *data,
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->content_size_get(sid->pan_obj, &w, &h);
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&w, &h));
if ((w != sid->content_info.w) || (h != sid->content_info.h))
{
sid->content_info.w = w;
@@ -3344,13 +3325,14 @@ _elm_scroll_content_del_cb(void *data,
}
static void
-_elm_scroll_content_set(Evas_Object *obj,
- Evas_Object *content)
+_elm_scroll_content_set(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord w, h;
Evas_Object *o;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+
if (!sid->edje_obj) return;
@@ -3377,13 +3359,11 @@ _elm_scroll_content_set(Evas_Object *obj,
edje_object_part_swallow(sid->edje_obj, "elm.swallow.content", o);
}
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
evas_object_event_callback_add
(content, EVAS_CALLBACK_DEL, _elm_scroll_content_del_cb, sid);
_elm_pan_content_set(sid->pan_obj, content);
- psd->api->content_size_get(sid->pan_obj, &w, &h);
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&w, &h));
sid->content_info.w = w;
sid->content_info.h = h;
@@ -3392,14 +3372,15 @@ _elm_scroll_content_set(Evas_Object *obj,
}
static void
-_elm_scroll_extern_pan_set(Evas_Object *obj,
- Evas_Object *pan)
+_elm_scroll_extern_pan_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Object *pan = va_arg(*list, Evas_Object *);
+
if (!sid->edje_obj) return;
- _elm_scroll_content_set(obj, NULL);
+ eo_do(obj, elm_scrollable_interface_content_set(NULL));
if (sid->pan_obj)
{
@@ -3440,119 +3421,99 @@ _elm_scroll_extern_pan_set(Evas_Object *obj,
}
static void
-_elm_scroll_drag_start_cb_set(Evas_Object *obj,
- void (*drag_start_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_drag_start_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb drag_start_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
sid->cb_func.drag_start = drag_start_cb;
}
static void
-_elm_scroll_drag_stop_cb_set(Evas_Object *obj,
- void (*drag_stop_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_drag_stop_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb drag_stop_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
sid->cb_func.drag_stop = drag_stop_cb;
}
static void
-_elm_scroll_animate_start_cb_set(Evas_Object *obj,
- void (*animate_start_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_animate_start_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb animate_start_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
sid->cb_func.animate_start = animate_start_cb;
}
static void
-_elm_scroll_animate_stop_cb_set(Evas_Object *obj,
- void (*animate_stop_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_animate_stop_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb animate_stop_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
sid->cb_func.animate_stop = animate_stop_cb;
}
static void
-_elm_scroll_scroll_cb_set(Evas_Object *obj,
- void (*scroll_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_scroll_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb scroll_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
sid->cb_func.scroll = scroll_cb;
}
static void
-_elm_scroll_edge_left_cb_set(Evas_Object *obj,
- void (*edge_left_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_edge_left_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
- sid->cb_func.edge_left = edge_left_cb;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb edje_left_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
+ sid->cb_func.edge_left = edje_left_cb;
}
static void
-_elm_scroll_edge_right_cb_set(Evas_Object *obj,
- void (*edge_right_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_edge_right_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
- sid->cb_func.edge_right = edge_right_cb;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb edje_right_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
+ sid->cb_func.edge_right = edje_right_cb;
}
static void
-_elm_scroll_edge_top_cb_set(Evas_Object *obj,
- void (*edge_top_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_edge_top_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
- sid->cb_func.edge_top = edge_top_cb;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb edje_top_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
+ sid->cb_func.edge_top = edje_top_cb;
}
static void
-_elm_scroll_edge_bottom_cb_set(Evas_Object *obj,
- void (*edge_bottom_cb)(Evas_Object *obj,
- void *data))
+_elm_scroll_edge_bottom_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
- sid->cb_func.edge_bottom = edge_bottom_cb;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Cb edje_bottom_cb = va_arg(*list, Elm_Interface_Scrollable_Cb);
+ sid->cb_func.edge_bottom = edje_bottom_cb;
}
static void
-_elm_scroll_content_min_limit_cb_set(Evas_Object *obj,
- void (*c_min_limit_cb)(Evas_Object *obj,
- Eina_Bool w,
- Eina_Bool h))
+_elm_scroll_content_min_limit_cb_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
-
- sid->cb_func.content_min_limit = c_min_limit_cb;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Interface_Scrollable_Min_Limit_Cb min_limit_cb = va_arg(*list, Elm_Interface_Scrollable_Min_Limit_Cb);
+ sid->cb_func.content_min_limit = min_limit_cb;
}
-static Eina_Bool
-_elm_scroll_momentum_animator_disabled_get(const Evas_Object *obj)
+static void
+_elm_scroll_momentum_animator_disabled_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, EINA_FALSE);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sid->momentum_animator_disabled;
+ *ret = sid->momentum_animator_disabled;
}
static void
-_elm_scroll_momentum_animator_disabled_set(Evas_Object *obj,
- Eina_Bool disabled)
+_elm_scroll_momentum_animator_disabled_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool disabled = va_arg(*list, int);
sid->momentum_animator_disabled = disabled;
if (sid->momentum_animator_disabled)
@@ -3567,19 +3528,19 @@ _elm_scroll_momentum_animator_disabled_set(Evas_Object *obj,
}
}
-static Eina_Bool
-_elm_scroll_bounce_animator_disabled_get(const Evas_Object *obj)
+static void
+_elm_scroll_bounce_animator_disabled_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, EINA_FALSE);
-
- return sid->bounce_animator_disabled;
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = sid->bounce_animator_disabled;
}
static void
-_elm_scroll_bounce_animator_disabled_set(Evas_Object *obj,
- Eina_Bool disabled)
+_elm_scroll_bounce_animator_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool disabled = va_arg(*list, int);
sid->bounce_animator_disabled = disabled;
if (sid->bounce_animator_disabled)
@@ -3598,19 +3559,20 @@ _elm_scroll_bounce_animator_disabled_set(Evas_Object *obj,
}
}
-static Eina_Bool
-_elm_scroll_wheel_disabled_get(const Evas_Object *obj)
+static void
+_elm_scroll_wheel_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, EINA_FALSE);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sid->wheel_disabled;
+ *ret = sid->wheel_disabled;
}
static void
-_elm_scroll_wheel_disabled_set(Evas_Object *obj,
- Eina_Bool disabled)
+_elm_scroll_wheel_disabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool disabled = va_arg(*list, int);
if (!sid->event_rect) return;
@@ -3626,11 +3588,11 @@ _elm_scroll_wheel_disabled_set(Evas_Object *obj,
}
static void
-_elm_scroll_step_size_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_scroll_step_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
if (x < 1) x = 1;
if (y < 1) y = 1;
@@ -3641,22 +3603,22 @@ _elm_scroll_step_size_set(Evas_Object *obj,
}
static void
-_elm_scroll_step_size_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_scroll_step_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = sid->step.x;
if (y) *y = sid->step.y;
}
static void
-_elm_scroll_page_size_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_scroll_page_size_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
sid->page.x = x;
sid->page.y = y;
@@ -3665,22 +3627,22 @@ _elm_scroll_page_size_set(Evas_Object *obj,
}
static void
-_elm_scroll_page_size_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_scroll_page_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = sid->page.x;
if (y) *y = sid->page.y;
}
static void
-_elm_scroll_policy_set(Evas_Object *obj,
- Elm_Scroller_Policy hbar,
- Elm_Scroller_Policy vbar)
+_elm_scroll_policy_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Scroller_Policy hbar = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy vbar = va_arg(*list, Elm_Scroller_Policy);
if (!sid->edje_obj) return;
@@ -3714,47 +3676,47 @@ _elm_scroll_policy_set(Evas_Object *obj,
}
static void
-_elm_scroll_policy_get(const Evas_Object *obj,
- Elm_Scroller_Policy *hbar,
- Elm_Scroller_Policy *vbar)
+_elm_scroll_policy_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Elm_Scroller_Policy *hbar = va_arg(*list, Elm_Scroller_Policy *);
+ Elm_Scroller_Policy *vbar = va_arg(*list, Elm_Scroller_Policy *);
if (hbar) *hbar = sid->hbar_flags;
if (vbar) *vbar = sid->vbar_flags;
}
static void
-_elm_scroll_single_direction_set(Evas_Object *obj,
- Eina_Bool single_dir)
+_elm_scroll_single_direction_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool single_dir = va_arg(*list, int);
sid->one_direction_at_a_time = single_dir;
}
-static Eina_Bool
-_elm_scroll_single_direction_get(const Evas_Object *obj)
+static void
+_elm_scroll_single_direction_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN_VAL(obj, sid, EINA_FALSE);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- return sid->one_direction_at_a_time;
+ *ret = sid->one_direction_at_a_time;
}
static void
-_elm_scroll_hold_set(Evas_Object *obj,
- Eina_Bool hold)
+_elm_scroll_hold_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool hold = va_arg(*list, int);
sid->hold = hold;
}
-
static void
-_elm_scroll_freeze_set(Evas_Object *obj,
- Eina_Bool freeze)
+_elm_scroll_freeze_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool freeze = va_arg(*list, int);
sid->freeze = freeze;
if (sid->freeze)
@@ -3772,35 +3734,35 @@ _elm_scroll_freeze_set(Evas_Object *obj,
}
static void
-_elm_scroll_bounce_allow_set(Evas_Object *obj,
- Eina_Bool horiz,
- Eina_Bool vert)
+_elm_scroll_bounce_allow_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool horiz = va_arg(*list, int);
+ Eina_Bool vert= va_arg(*list, int);
sid->bounce_horiz = !!horiz;
sid->bounce_vert = !!vert;
}
static void
-_elm_scroll_bounce_allow_get(const Evas_Object *obj,
- Eina_Bool *horiz,
- Eina_Bool *vert)
+_elm_scroll_bounce_allow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Eina_Bool *horiz = va_arg(*list, Eina_Bool *);
+ Eina_Bool *vert= va_arg(*list, Eina_Bool *);
if (horiz) *horiz = sid->bounce_horiz;
if (vert) *vert = sid->bounce_vert;
}
static void
-_elm_scroll_paging_set(Evas_Object *obj,
- double pagerel_h,
- double pagerel_v,
- Evas_Coord pagesize_h,
- Evas_Coord pagesize_v)
+_elm_scroll_paging_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ double pagerel_h = va_arg(*list, double);
+ double pagerel_v = va_arg(*list, double);
+ Evas_Coord pagesize_h = va_arg(*list, Evas_Coord);
+ Evas_Coord pagesize_v = va_arg(*list, Evas_Coord);
sid->pagerel_h = pagerel_h;
sid->pagerel_v = pagerel_v;
@@ -3811,13 +3773,13 @@ _elm_scroll_paging_set(Evas_Object *obj,
}
static void
-_elm_scroll_paging_get(const Evas_Object *obj,
- double *pagerel_h,
- double *pagerel_v,
- Evas_Coord *pagesize_h,
- Evas_Coord *pagesize_v)
+_elm_scroll_paging_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ double *pagerel_h = va_arg(*list, double *);
+ double *pagerel_v = va_arg(*list, double *);
+ Evas_Coord *pagesize_h = va_arg(*list, Evas_Coord *);
+ Evas_Coord *pagesize_v = va_arg(*list, Evas_Coord *);
if (pagerel_h) *pagerel_h = sid->pagerel_h;
if (pagerel_v) *pagerel_v = sid->pagerel_v;
@@ -3826,15 +3788,15 @@ _elm_scroll_paging_get(const Evas_Object *obj,
}
static void
-_elm_scroll_current_page_get(const Evas_Object *obj,
- int *pagenumber_h,
- int *pagenumber_v)
+_elm_scroll_current_page_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
Evas_Coord x, y;
+ int *pagenumber_h = va_arg(*list, int *);
+ int *pagenumber_v = va_arg(*list, int *);
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
- _elm_scroll_content_pos_get(sid->obj, &x, &y);
+ eo_do(sid->obj, elm_scrollable_interface_content_pos_get(&x, &y));
if (pagenumber_h)
{
if (sid->pagesize_h > 0)
@@ -3852,19 +3814,18 @@ _elm_scroll_current_page_get(const Evas_Object *obj,
}
static void
-_elm_scroll_last_page_get(const Evas_Object *obj,
- int *pagenumber_h,
- int *pagenumber_v)
+_elm_scroll_last_page_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
+ int *pagenumber_h = va_arg(*list, int *);
+ int *pagenumber_v = va_arg(*list, int *);
+
Evas_Coord cw, ch;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->content_size_get(sid->pan_obj, &cw, &ch);
+ eo_do(sid->pan_obj, elm_obj_pan_content_size_get(&cw, &ch));
if (pagenumber_h)
{
if (sid->pagesize_h > 0)
@@ -3882,31 +3843,35 @@ _elm_scroll_last_page_get(const Evas_Object *obj,
}
static void
-_elm_scroll_page_show(Evas_Object *obj,
- int pagenumber_h,
- int pagenumber_v)
+_elm_scroll_page_show(Eo *obj, void *_pd, va_list *list)
{
+ int pagenumber_h = va_arg(*list, int);
+ int pagenumber_v = va_arg(*list, int);
+
Evas_Coord x, y, w, h;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
- _elm_scroll_content_pos_set(obj, x, y);
+
+
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
}
static void
-_elm_scroll_page_bring_in(Evas_Object *obj,
- int pagenumber_h,
- int pagenumber_v)
+_elm_scroll_page_bring_in(Eo *obj, void *_pd, va_list *list)
{
+ int pagenumber_h = va_arg(*list, int);
+ int pagenumber_v = va_arg(*list, int);
+
Evas_Coord x, y, w, h;
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
- _elm_scroll_content_viewport_size_get(sid->obj, &w, &h);
+ eo_do(sid->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
if (pagenumber_h >= 0) x = sid->pagesize_h * pagenumber_h;
if (pagenumber_v >= 0) y = sid->pagesize_v * pagenumber_v;
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
@@ -3917,13 +3882,13 @@ _elm_scroll_page_bring_in(Evas_Object *obj,
}
static void
-_elm_scroll_region_bring_in(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h)
+_elm_scroll_region_bring_in(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
if (_elm_scroll_content_region_show_internal(obj, &x, &y, w, h))
{
@@ -3933,37 +3898,33 @@ _elm_scroll_region_bring_in(Evas_Object *obj,
}
static void
-_elm_scroll_gravity_set(Evas_Object *obj,
- double x,
- double y)
+_elm_scroll_gravity_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ double x = va_arg(*list, double);
+ double y = va_arg(*list, double);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->gravity_set(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_gravity_set(x, y));
}
static void
-_elm_scroll_gravity_get(const Evas_Object *obj,
- double *x,
- double *y)
+_elm_scroll_gravity_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLL_IFACE_DATA_GET_OR_RETURN(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+ double *x = va_arg(*list, double *);
+ double *y = va_arg(*list, double *);
if (!sid->pan_obj) return;
- ELM_PAN_DATA_GET(sid->pan_obj, psd);
-
- psd->api->gravity_get(sid->pan_obj, x, y);
+ eo_do(sid->pan_obj, elm_obj_pan_gravity_get(x, y));
}
-static Eina_Bool
-_elm_scroll_interface_add(Evas_Object *obj)
+static void
+_elm_scroll_interface_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_SCROLL_IFACE_DATA_GET(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
memset(sid, 0, sizeof(*sid));
@@ -3991,15 +3952,17 @@ _elm_scroll_interface_add(Evas_Object *obj)
_elm_scroll_scroll_bar_reset(sid);
- return EINA_TRUE;
+ eo_do_super(obj, evas_obj_smart_add());
}
static void
-_elm_scroll_interface_del(Evas_Object *obj)
+_elm_scroll_interface_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_SCROLL_IFACE_DATA_GET(obj, sid);
+ Elm_Scrollable_Smart_Interface_Data *sid = _pd;
+
+ eo_do_super(obj, evas_obj_smart_del());
- _elm_scroll_content_set(obj, NULL);
+ eo_do(obj, elm_scrollable_interface_content_set(NULL));
if (!sid->extern_pan) evas_object_del(sid->pan_obj);
if (sid->down.hold_animator)
@@ -4016,63 +3979,134 @@ _elm_scroll_interface_del(Evas_Object *obj)
if (sid->scrollto.y.animator) ecore_animator_del(sid->scrollto.y.animator);
}
-EAPI const char ELM_SCROLLABLE_IFACE_NAME[] = "elm_interface_scrollable";
-
-EAPI const Elm_Scrollable_Smart_Interface ELM_SCROLLABLE_IFACE =
-{
- {
- ELM_SCROLLABLE_IFACE_NAME,
- sizeof(Elm_Scrollable_Smart_Interface_Data),
- _elm_scroll_interface_add,
- _elm_scroll_interface_del
- },
-
- _elm_scroll_objects_set,
- _elm_scroll_content_set,
- _elm_scroll_extern_pan_set,
- _elm_scroll_drag_start_cb_set,
- _elm_scroll_drag_stop_cb_set,
- _elm_scroll_animate_start_cb_set,
- _elm_scroll_animate_stop_cb_set,
- _elm_scroll_scroll_cb_set,
- _elm_scroll_edge_left_cb_set,
- _elm_scroll_edge_right_cb_set,
- _elm_scroll_edge_top_cb_set,
- _elm_scroll_edge_bottom_cb_set,
- _elm_scroll_content_min_limit_cb_set,
- _elm_scroll_content_pos_set,
- _elm_scroll_content_pos_get,
- _elm_scroll_content_region_show,
- _elm_scroll_content_region_set,
- _elm_scroll_content_size_get,
- _elm_scroll_content_viewport_size_get,
- _elm_scroll_content_min_limit,
- _elm_scroll_step_size_set,
- _elm_scroll_step_size_get,
- _elm_scroll_page_size_set,
- _elm_scroll_page_size_get,
- _elm_scroll_policy_set,
- _elm_scroll_policy_get,
- _elm_scroll_single_direction_set,
- _elm_scroll_single_direction_get,
- _elm_scroll_mirrored_set,
- _elm_scroll_hold_set,
- _elm_scroll_freeze_set,
- _elm_scroll_bounce_allow_set,
- _elm_scroll_bounce_allow_get,
- _elm_scroll_paging_set,
- _elm_scroll_paging_get,
- _elm_scroll_current_page_get,
- _elm_scroll_last_page_get,
- _elm_scroll_page_show,
- _elm_scroll_page_bring_in,
- _elm_scroll_region_bring_in,
- _elm_scroll_gravity_set,
- _elm_scroll_gravity_get,
- _elm_scroll_momentum_animator_disabled_get,
- _elm_scroll_momentum_animator_disabled_set,
- _elm_scroll_bounce_animator_disabled_set,
- _elm_scroll_bounce_animator_disabled_get,
- _elm_scroll_wheel_disabled_get,
- _elm_scroll_wheel_disabled_set
+static void
+_elm_scroll_interface_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+}
+
+static void
+_elm_scrollable_interface_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _elm_scroll_interface_constructor),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_scroll_interface_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_scroll_interface_del),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_OBJECTS_SET), _elm_scroll_objects_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SET), _elm_scroll_content_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EXTERN_PAN_SET), _elm_scroll_extern_pan_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_START_CB_SET), _elm_scroll_drag_start_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_STOP_CB_SET), _elm_scroll_drag_stop_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_START_CB_SET), _elm_scroll_animate_start_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_STOP_CB_SET), _elm_scroll_animate_stop_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SCROLL_CB_SET), _elm_scroll_scroll_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_LEFT_CB_SET), _elm_scroll_edge_left_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_RIGHT_CB_SET), _elm_scroll_edge_right_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_TOP_CB_SET), _elm_scroll_edge_top_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_BOTTOM_CB_SET), _elm_scroll_edge_bottom_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), _elm_scroll_content_min_limit_cb_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), _elm_scroll_content_pos_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET), _elm_scroll_content_pos_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW), _elm_scroll_content_region_show),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SET), _elm_scroll_content_region_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SIZE_GET), _elm_scroll_content_size_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_SIZE_GET), _elm_scroll_content_viewport_size_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT), _elm_scroll_content_min_limit),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_SET), _elm_scroll_step_size_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_GET), _elm_scroll_step_size_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_SET), _elm_scroll_page_size_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_GET), _elm_scroll_page_size_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _elm_scroll_policy_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET), _elm_scroll_policy_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_SET), _elm_scroll_single_direction_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_GET), _elm_scroll_single_direction_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MIRRORED_SET), _elm_scroll_mirrored_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HOLD_SET), _elm_scroll_hold_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_FREEZE_SET), _elm_scroll_freeze_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET), _elm_scroll_bounce_allow_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_GET), _elm_scroll_bounce_allow_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_SET), _elm_scroll_paging_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_GET), _elm_scroll_paging_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CURRENT_PAGE_GET), _elm_scroll_current_page_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST_PAGE_GET), _elm_scroll_last_page_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SHOW), _elm_scroll_page_show),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_BRING_IN), _elm_scroll_page_bring_in),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_REGION_BRING_IN), _elm_scroll_region_bring_in),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_SET), _elm_scroll_gravity_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_GET), _elm_scroll_gravity_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_GET), _elm_scroll_momentum_animator_disabled_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_SET), _elm_scroll_momentum_animator_disabled_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_SET), _elm_scroll_bounce_animator_disabled_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_GET), _elm_scroll_bounce_animator_disabled_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_GET), _elm_scroll_wheel_disabled_get),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_SET), _elm_scroll_wheel_disabled_set),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_OBJECTS_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_EXTERN_PAN_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_START_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_STOP_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_START_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_STOP_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_SCROLL_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_LEFT_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_RIGHT_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_TOP_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_BOTTOM_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SIZE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_SIZE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_MIRRORED_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_HOLD_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_FREEZE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_CURRENT_PAGE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST_PAGE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SHOW, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_BRING_IN, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_REGION_BRING_IN, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_SET, "description here"),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description _elm_scrollable_interface_desc = {
+ EO_VERSION,
+ MY_SCROLLABLE_INTERFACE_NAME,
+ EO_CLASS_TYPE_MIXIN,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_SCROLLABLE_INTERFACE_BASE_ID, op_desc, ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Scrollable_Smart_Interface_Data),
+ _elm_scrollable_interface_constructor,
+ NULL
};
+
+EO_DEFINE_CLASS(elm_scrollable_interface_get, &_elm_scrollable_interface_desc, NULL, EVAS_SMART_SCROLLABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_interface_scrollable.h b/src/lib/elm_interface_scrollable.h
index 3a54cefda..66c0c049d 100644
--- a/src/lib/elm_interface_scrollable.h
+++ b/src/lib/elm_interface_scrollable.h
@@ -31,128 +31,148 @@
* Elm_Scrollable_Smart_Interface::extern_pan_set.
*/
-/**
- * @def ELM_PAN_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Pan_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
- #define ELM_PAN_CLASS(x) ((Elm_Pan_Smart_Class *)x)
+#define ELM_OBJ_PAN_CLASS elm_obj_pan_eo_class_get()
+const Eo_Class *elm_obj_pan_eo_class_get(void) EINA_CONST;
-/**
- * @def ELM_PAN_SMART_CLASS_VERSION
- *
- * Current version for Elementary pan @b base smart class, a value
- * which goes to _Elm_Pan_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PAN_SMART_CLASS_VERSION 1
+extern EAPI Eo_Op ELM_OBJ_PAN_BASE_ID;
-/**
- * @def ELM_PAN_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Pan_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PAN_SMART_CLASS_INIT_NULL
- * @see ELM_PAN_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PAN_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PAN_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL}
+enum
+{
+ ELM_OBJ_PAN_SUB_ID_POS_SET,
+ ELM_OBJ_PAN_SUB_ID_POS_GET,
+ ELM_OBJ_PAN_SUB_ID_POS_MAX_GET,
+ ELM_OBJ_PAN_SUB_ID_POS_MIN_GET,
+ ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET,
+ ELM_OBJ_PAN_SUB_ID_GRAVITY_SET,
+ ELM_OBJ_PAN_SUB_ID_GRAVITY_GET,
+ ELM_OBJ_PAN_SUB_ID_LAST
+};
-/**
- * @def ELM_PAN_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Pan_Smart_Class structure.
- *
- * @see ELM_PAN_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PAN_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PAN_SMART_CLASS_INIT_NULL \
- ELM_PAN_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
+#define ELM_OBJ_PAN_ID(sub_id) (ELM_OBJ_PAN_BASE_ID + sub_id)
+#define elm_obj_pan_pos_set(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
+#define elm_obj_pan_pos_get(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_obj_pan_pos_max_get(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_obj_pan_pos_min_get(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_obj_pan_content_size_get(w, h) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+#define elm_obj_pan_gravity_set(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_GRAVITY_SET), EO_TYPECHECK(double, x), EO_TYPECHECK(double, y)
+#define elm_obj_pan_gravity_get(x, y) ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_GRAVITY_GET), EO_TYPECHECK(double *, x), EO_TYPECHECK(double *, y)
-/**
- * @def ELM_PAN_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Pan_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PAN_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Pan_Smart_Class (base field)
- * to the latest #ELM_PAN_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PAN_SMART_CLASS_INIT_NULL
- * @see ELM_PAN_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PAN_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PAN_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
+#define ELM_SCROLLABLE_INTERFACE elm_scrollable_interface_get()
-/**
- * Elementary scroller panning base smart class. This inherits
- * directly from the Evas smart clipped class (an object clipping
- * children to its viewport/size). It is exposed here only to build
- * widgets needing a custom panning behavior.
- */
-typedef struct _Elm_Pan_Smart_Class Elm_Pan_Smart_Class;
-struct _Elm_Pan_Smart_Class
+const Eo_Class *elm_scrollable_interface_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_SCROLLABLE_INTERFACE_BASE_ID;
+
+enum
{
- Evas_Smart_Class base; /* it's a clipped smart object */
-
- int version; /**< Version of this smart class definition */
-
- void (*pos_set)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y);
- void (*pos_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*pos_max_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*pos_min_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*content_size_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*gravity_set)(Evas_Object *obj,
- double x,
- double y);
- void (*gravity_get)(const Evas_Object *obj,
- double *x,
- double *y);
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_OBJECTS_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_EXTERN_PAN_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_START_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_STOP_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_START_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_STOP_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_SCROLL_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_LEFT_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_RIGHT_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_TOP_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_BOTTOM_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SIZE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_SIZE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_MIRRORED_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_HOLD_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_FREEZE_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_CURRENT_PAGE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST_PAGE_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SHOW,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_BRING_IN,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_REGION_BRING_IN,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_GET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_SET,
+ ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST
};
+#define ELM_SCROLLABLE_INTERFACE_ID(sub_id) (ELM_SCROLLABLE_INTERFACE_BASE_ID + sub_id)
+
+#define elm_scrollable_interface_objects_set(edje_object, hit_rectangle) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_OBJECTS_SET), EO_TYPECHECK(Evas_Object *, edje_object), EO_TYPECHECK(Evas_Object *, hit_rectangle)
+#define elm_scrollable_interface_content_set(content) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SET), EO_TYPECHECK(Evas_Object *, content)
+#define elm_scrollable_interface_extern_pan_set(pan) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EXTERN_PAN_SET), EO_TYPECHECK(Evas_Object *, pan)
+#define elm_scrollable_interface_drag_start_cb_set(drag_start_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_START_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, drag_start_cb)
+#define elm_scrollable_interface_drag_stop_cb_set(drag_stop_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_DRAG_STOP_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, drag_stop_cb)
+#define elm_scrollable_interface_animate_start_cb_set(animate_start_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_START_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, animate_start_cb)
+#define elm_scrollable_interface_animate_stop_cb_set(animate_stop_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_ANIMATE_STOP_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, animate_stop_cb)
+#define elm_scrollable_interface_scroll_cb_set(scroll_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SCROLL_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, scroll_cb)
+#define elm_scrollable_interface_edge_left_cb_set(edge_left_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_LEFT_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, edge_left_cb)
+#define elm_scrollable_interface_edge_right_cb_set(edge_right_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_RIGHT_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, edge_right_cb)
+#define elm_scrollable_interface_edge_top_cb_set(edge_top_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_TOP_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, edge_top_cb)
+#define elm_scrollable_interface_edge_bottom_cb_set(edge_bottom_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_EDGE_BOTTOM_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Cb, edge_bottom_cb)
+#define elm_scrollable_interface_content_min_limit_cb_set(min_limit_cb) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT_CB_SET), EO_TYPECHECK(Elm_Interface_Scrollable_Min_Limit_Cb, min_limit_cb)
+#define elm_scrollable_interface_content_pos_set(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
+#define elm_scrollable_interface_content_pos_get(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_POS_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_scrollable_interface_content_region_show(x, y, w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SHOW), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+#define elm_scrollable_interface_content_region_set(x, y, w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_REGION_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+#define elm_scrollable_interface_content_size_get(w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+#define elm_scrollable_interface_content_viewport_size_get(w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_VIEWPORT_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+#define elm_scrollable_interface_content_min_limit(w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CONTENT_MIN_LIMIT), EO_TYPECHECK(Eina_Bool, w), EO_TYPECHECK(Eina_Bool, h)
+#define elm_scrollable_interface_step_size_set(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
+#define elm_scrollable_interface_step_size_get(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_STEP_SIZE_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_scrollable_interface_page_size_set(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
+#define elm_scrollable_interface_page_size_get(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+#define elm_scrollable_interface_policy_set(hbar, vbar) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), EO_TYPECHECK(Elm_Scroller_Policy, hbar), EO_TYPECHECK(Elm_Scroller_Policy, vbar)
+#define elm_scrollable_interface_policy_get(hbar, vbar) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_GET), EO_TYPECHECK(Elm_Scroller_Policy *, hbar), EO_TYPECHECK(Elm_Scroller_Policy *, vbar)
+#define elm_scrollable_interface_single_direction_set(single_dir) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_SET), EO_TYPECHECK(Eina_Bool, single_dir)
+#define elm_scrollable_interface_single_direction_get(single_dir) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_SINGLE_DIRECTION_GET), EO_TYPECHECK(Eina_Bool *, single_dir)
+#define elm_scrollable_interface_mirrored_set(mirrored) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MIRRORED_SET), EO_TYPECHECK(Eina_Bool, mirrored)
+#define elm_scrollable_interface_hold_set(hold) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_HOLD_SET), EO_TYPECHECK(Eina_Bool, hold)
+#define elm_scrollable_interface_freeze_set(freeze) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_FREEZE_SET), EO_TYPECHECK(Eina_Bool, freeze)
+#define elm_scrollable_interface_bounce_allow_set(horiz, vert) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_SET), EO_TYPECHECK(Eina_Bool, horiz), EO_TYPECHECK(Eina_Bool, vert)
+#define elm_scrollable_interface_bounce_allow_get(horiz, vert) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ALLOW_GET), EO_TYPECHECK(Eina_Bool *, horiz), EO_TYPECHECK(Eina_Bool *, vert)
+#define elm_scrollable_interface_paging_set(pagerel_h, pagerel_v, pagesize_h, pagesize_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_SET), EO_TYPECHECK(double, pagerel_h), EO_TYPECHECK(double, pagerel_v), EO_TYPECHECK(Evas_Coord, pagesize_h), EO_TYPECHECK(Evas_Coord, pagesize_v)
+#define elm_scrollable_interface_paging_get(pagerel_h, pagerel_v, pagesize_h, pagesize_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGING_GET), EO_TYPECHECK(double *, pagerel_h), EO_TYPECHECK(double *, pagerel_v), EO_TYPECHECK(Evas_Coord *, pagesize_h), EO_TYPECHECK(Evas_Coord *, pagesize_v)
+#define elm_scrollable_interface_current_page_get(pagenumber_h, pagenumber_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_CURRENT_PAGE_GET), EO_TYPECHECK(int *, pagenumber_h), EO_TYPECHECK(int *, pagenumber_v)
+#define elm_scrollable_interface_last_page_get(pagenumber_h, pagenumber_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_LAST_PAGE_GET), EO_TYPECHECK(int *, pagenumber_h), EO_TYPECHECK(int *, pagenumber_v)
+#define elm_scrollable_interface_page_show(pagenumber_h, pagenumber_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SHOW), EO_TYPECHECK(int, pagenumber_h), EO_TYPECHECK(int, pagenumber_v)
+#define elm_scrollable_interface_page_bring_in(pagenumber_h, pagenumber_v) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_BRING_IN), EO_TYPECHECK(int, pagenumber_h), EO_TYPECHECK(int, pagenumber_v)
+#define elm_scrollable_interface_region_bring_in(x, y, w, h) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_REGION_BRING_IN), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h)
+#define elm_scrollable_interface_gravity_set(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_SET), EO_TYPECHECK(double, x), EO_TYPECHECK(double, y)
+#define elm_scrollable_interface_gravity_get(x, y) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_GRAVITY_GET), EO_TYPECHECK(double *, x), EO_TYPECHECK(double *, y)
+#define elm_scrollable_interface_momentum_animator_disabled_get(ret) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_scrollable_interface_momentum_animator_disabled_set(disabled) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_MOMENTUM_ANIMATOR_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+#define elm_scrollable_interface_bounce_animator_disabled_set(ret) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_SET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_scrollable_interface_bounce_animator_disabled_get(disabled) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_BOUNCE_ANIMATOR_DISABLED_GET), EO_TYPECHECK(Eina_Bool, disabled)
+#define elm_scrollable_interface_wheel_disabled_get(ret) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_scrollable_interface_wheel_disabled_set(disabled) ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_WHEEL_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
/**
* Elementary scroller panning base smart data.
*/
typedef struct _Elm_Pan_Smart_Data Elm_Pan_Smart_Data;
struct _Elm_Pan_Smart_Data
{
- Evas_Object_Smart_Clipped_Data base;
-
- const Elm_Pan_Smart_Class *api; /**< This is the pointer to the object's class, from where we can reach/call its class functions */
-
Evas_Object *self;
Evas_Object *content;
Evas_Coord x, y, w, h;
@@ -164,6 +184,9 @@ struct _Elm_Pan_Smart_Data
/**
* Elementary scrollable interface base data.
*/
+typedef void (*Elm_Interface_Scrollable_Cb)(Evas_Object *, void *data);
+typedef void (*Elm_Interface_Scrollable_Min_Limit_Cb)(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
+
typedef struct _Elm_Scrollable_Smart_Interface_Data
Elm_Scrollable_Smart_Interface_Data;
struct _Elm_Scrollable_Smart_Interface_Data
@@ -251,27 +274,16 @@ struct _Elm_Scrollable_Smart_Interface_Data
struct
{
- void (*drag_start)(Evas_Object *obj,
- void *data);
- void (*drag_stop)(Evas_Object *obj,
- void *data);
- void (*animate_start)(Evas_Object *obj,
- void *data);
- void (*animate_stop)(Evas_Object *obj,
- void *data);
- void (*scroll)(Evas_Object *obj,
- void *data);
- void (*edge_left)(Evas_Object *obj,
- void *data);
- void (*edge_right)(Evas_Object *obj,
- void *data);
- void (*edge_top)(Evas_Object *obj,
- void *data);
- void (*edge_bottom)(Evas_Object *obj,
- void *data);
- void (*content_min_limit)(Evas_Object *obj,
- Eina_Bool w,
- Eina_Bool h);
+ Elm_Interface_Scrollable_Cb drag_start;
+ Elm_Interface_Scrollable_Cb drag_stop;
+ Elm_Interface_Scrollable_Cb animate_start;
+ Elm_Interface_Scrollable_Cb animate_stop;
+ Elm_Interface_Scrollable_Cb scroll;
+ Elm_Interface_Scrollable_Cb edge_left;
+ Elm_Interface_Scrollable_Cb edge_right;
+ Elm_Interface_Scrollable_Cb edge_top;
+ Elm_Interface_Scrollable_Cb edge_bottom;
+ Elm_Interface_Scrollable_Min_Limit_Cb content_min_limit;
} cb_func;
struct
@@ -309,193 +321,12 @@ struct _Elm_Scrollable_Smart_Interface_Data
Eina_Bool go_down : 1;
};
-typedef struct _Elm_Scrollable_Smart_Interface Elm_Scrollable_Smart_Interface;
-struct _Elm_Scrollable_Smart_Interface
-{
- Evas_Smart_Interface base;
-
- void (*objects_set)(Evas_Object *obj,
- Evas_Object *edje_obj,
- Evas_Object *hit_rectangle);
- void (*content_set)(Evas_Object *obj,
- Evas_Object *content);
-
- void (*extern_pan_set)(Evas_Object *obj,
- Evas_Object *pan);
-
- void (*drag_start_cb_set)(Evas_Object *obj,
- void (*d_start_cb)(Evas_Object *obj,
- void *data));
- void (*drag_stop_cb_set)(Evas_Object *obj,
- void (*d_stop_cb)(Evas_Object *obj,
- void *data));
- void (*animate_start_cb_set)(Evas_Object *obj,
- void (*a_start_cb)(Evas_Object *obj,
- void *data));
- void (*animate_stop_cb_set)(Evas_Object *obj,
- void (*a_stop_cb)(Evas_Object *obj,
- void *data));
- void (*scroll_cb_set)(Evas_Object *obj,
- void (*s_cb)(Evas_Object *obj,
- void *data));
- void (*edge_left_cb_set)(Evas_Object *obj,
- void (*e_left_cb)(Evas_Object *obj,
- void *data));
- void (*edge_right_cb_set)(Evas_Object *obj,
- void (*e_right_cb)(Evas_Object *obj,
- void *data));
- void (*edge_top_cb_set)(Evas_Object *obj,
- void (*e_top_cb)(Evas_Object *obj,
- void *data));
- void (*edge_bottom_cb_set)(Evas_Object *obj,
- void (*e_bottom_cb)(Evas_Object *obj,
- void *data));
-
- void (*content_min_limit_cb_set)(Evas_Object *obj,
- void (*c_limit_cb)(Evas_Object *obj,
- Eina_Bool w,
- Eina_Bool h));
-
- /* set the position of content object inside the scrolling region,
- * immediately */
- void (*content_pos_set)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y);
- void (*content_pos_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
-
- void (*content_region_show)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h);
- void (*content_region_set)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h);
-
- void (*content_size_get)(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h);
-
- /* get the size of the actual viewport area (swallowed into
- * scroller Edje object) */
- void (*content_viewport_size_get)(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h);
-
- /* this one issues the respective callback, only */
- void (*content_min_limit)(Evas_Object *obj,
- Eina_Bool w,
- Eina_Bool h);
-
- void (*step_size_set)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y);
- void (*step_size_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*page_size_set)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y);
- void (*page_size_get)(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y);
- void (*policy_set)(Evas_Object *obj,
- Elm_Scroller_Policy hbar,
- Elm_Scroller_Policy vbar);
- void (*policy_get)(const Evas_Object *obj,
- Elm_Scroller_Policy *hbar,
- Elm_Scroller_Policy *vbar);
-
- void (*single_direction_set)(Evas_Object *obj,
- Eina_Bool single_dir);
- Eina_Bool (*single_direction_get)(const Evas_Object *obj);
-
- void (*mirrored_set)(Evas_Object *obj,
- Eina_Bool mirrored);
-
- void (*hold_set)(Evas_Object *obj,
- Eina_Bool hold);
- void (*freeze_set)(Evas_Object *obj,
- Eina_Bool freeze);
-
- void (*bounce_allow_set)(Evas_Object *obj,
- Eina_Bool horiz,
- Eina_Bool vert);
- void (*bounce_allow_get)(const Evas_Object *obj,
- Eina_Bool *horiz,
- Eina_Bool *vert);
-
- void (*paging_set)(Evas_Object *obj,
- double pagerel_h,
- double pagerel_v,
- Evas_Coord pagesize_h,
- Evas_Coord pagesize_v);
- void (*paging_get)(const Evas_Object *obj,
- double *pagerel_h,
- double *pagerel_v,
- Evas_Coord *pagesize_h,
- Evas_Coord *pagesize_v);
- void (*current_page_get)(const Evas_Object *obj,
- int *pagenumber_h,
- int *pagenumber_v);
- void (*last_page_get)(const Evas_Object *obj,
- int *pagenumber_h,
- int *pagenumber_v);
- void (*page_show)(Evas_Object *obj,
- int pagenumber_h,
- int pagenumber_v);
- void (*page_bring_in)(Evas_Object *obj,
- int pagenumber_h,
- int pagenumber_v);
-
- void (*region_bring_in)(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y,
- Evas_Coord w,
- Evas_Coord h);
-
- void (*gravity_set)(Evas_Object *obj,
- double x,
- double y);
- void (*gravity_get)(const Evas_Object *obj,
- double *x,
- double *y);
-
- Eina_Bool (*momentum_animator_disabled_get)(const Evas_Object *obj);
- void (*momentum_animator_disabled_set)(Evas_Object *obj,
- Eina_Bool disabled);
-
- void (*bounce_animator_disabled_set)(Evas_Object *obj,
- Eina_Bool disabled);
- Eina_Bool (*bounce_animator_disabled_get)(const Evas_Object *obj);
-
- Eina_Bool (*wheel_disabled_get)(const Evas_Object *obj);
- void (*wheel_disabled_set)(Evas_Object *obj,
- Eina_Bool disabled);
-};
-
-EAPI extern const char ELM_SCROLLABLE_IFACE_NAME[];
-EAPI extern const Elm_Scrollable_Smart_Interface ELM_SCROLLABLE_IFACE;
-
-EAPI const Elm_Pan_Smart_Class *elm_pan_smart_class_get(void);
-
-#define ELM_SCROLLABLE_IFACE_GET(obj, iface) \
- const Elm_Scrollable_Smart_Interface * iface; \
- iface = evas_object_smart_interface_get(obj, ELM_SCROLLABLE_IFACE_NAME);
-
#define ELM_SCROLLABLE_CHECK(obj, ...) \
- const Elm_Scrollable_Smart_Interface * s_iface = \
- evas_object_smart_interface_get(obj, ELM_SCROLLABLE_IFACE_NAME); \
\
- if (!s_iface) \
+ if (!eo_isa(obj, ELM_SCROLLABLE_INTERFACE)) \
{ \
- ERR("Passing object (%p) of type '%s' in function %s, but it doesn't" \
- " implement the Elementary scrollable interface.", obj, \
- elm_widget_type_get(obj), __func__); \
+ ERR("The object (%p) doesn't implement the Elementary scrollable" \
+ " interface", obj); \
if (getenv("ELM_ERROR_ABORT")) abort(); \
return __VA_ARGS__; \
}
diff --git a/src/lib/elm_inwin.c b/src/lib/elm_inwin.c
index 36fd74ccc..29265240f 100644
--- a/src/lib/elm_inwin.c
+++ b/src/lib/elm_inwin.c
@@ -1,12 +1,16 @@
#include <Elementary.h>
#include "elm_priv.h"
+
#include "elm_widget_inwin.h"
+#include "elm_widget_layout.h"
+
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_WIN_INWIN_BASE_ID = EO_NOOP;
-EAPI const char ELM_INWIN_SMART_NAME[] = "elm_inwin";
+#define MY_CLASS ELM_OBJ_WIN_INWIN_CLASS
-EVAS_SMART_SUBCLASS_NEW
- (ELM_INWIN_SMART_NAME, _elm_inwin, Elm_Inwin_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
+#define MY_CLASS_NAME "elm_inwin"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -15,29 +19,38 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
};
static void
-_elm_inwin_smart_sizing_eval(Evas_Object *obj)
+_elm_inwin_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Object *content;
Evas_Coord minw = -1, minh = -1;
- ELM_INWIN_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
content = elm_layout_content_get(obj, NULL);
if (!content) return;
evas_object_size_hint_min_get(content, &minw, &minh);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
-static Eina_Bool
-_elm_inwin_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_inwin_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_inwin_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
Evas_Object *content;
content = elm_layout_content_get(obj, NULL);
@@ -47,19 +60,19 @@ _elm_inwin_smart_focus_next(const Evas_Object *obj,
{
elm_widget_focus_next_get(content, dir, next);
if (*next)
- return EINA_TRUE;
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
}
*next = (Evas_Object *)obj;
- return EINA_FALSE;
}
static void
-_elm_inwin_smart_add(Evas_Object *obj)
+_elm_inwin_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Inwin_Smart_Data);
-
- ELM_WIDGET_CLASS(_elm_inwin_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
@@ -70,70 +83,64 @@ _elm_inwin_smart_add(Evas_Object *obj)
}
static void
-_elm_inwin_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_elm_inwin_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
elm_win_resize_object_add(parent, obj);
elm_layout_sizing_eval(obj);
}
static void
-_elm_inwin_smart_set_user(Elm_Inwin_Smart_Class *sc)
+_elm_inwin_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_inwin_smart_add;
-
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_inwin_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_inwin_smart_parent_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_inwin_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
-EAPI const Elm_Inwin_Smart_Class *
-elm_inwin_smart_class_get(void)
+EAPI Evas_Object *
+elm_win_inwin_add(Evas_Object *parent)
{
- static Elm_Inwin_Smart_Class _sc =
- ELM_INWIN_SMART_CLASS_INIT_NAME_VERSION(ELM_INWIN_SMART_NAME);
- static const Elm_Inwin_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_inwin_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
}
-EAPI Evas_Object *
-elm_win_inwin_add(Evas_Object *parent)
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Evas_Object *obj;
+ Evas_Object *parent = eo_parent_get(obj);
- if (!parent || !elm_widget_type_check((parent), "elm_win", __func__))
- return NULL; /* *has* to have a parent window */
+ if (!eo_isa(parent, ELM_OBJ_WIN_CLASS))
+ {
+ eo_error_set(obj); /* *has* to have a parent window */
+ return;
+ }
- obj = elm_widget_add(_elm_inwin_smart_class_new(), parent);
- if (!obj) return NULL;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_win_inwin_activate(Evas_Object *obj)
{
ELM_INWIN_CHECK(obj);
- ELM_INWIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_inwin_activate());
+}
+
+static void
+_elm_inwin_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_raise(obj);
evas_object_show(obj);
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,show", "elm");
+ (wd->resize_obj, "elm,action,show", "elm");
elm_object_focus_set(obj, EINA_TRUE);
}
@@ -142,25 +149,61 @@ elm_win_inwin_content_set(Evas_Object *obj,
Evas_Object *content)
{
ELM_INWIN_CHECK(obj);
- ELM_INWIN_DATA_GET_OR_RETURN(obj, sd);
-
- ELM_CONTAINER_CLASS(_elm_inwin_parent_sc)->content_set(obj, NULL, content);
+ eo_do(obj, elm_obj_container_content_set(NULL, content, NULL));
}
EAPI Evas_Object *
elm_win_inwin_content_get(const Evas_Object *obj)
{
ELM_INWIN_CHECK(obj) NULL;
- ELM_INWIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
-
- return ELM_CONTAINER_CLASS(_elm_inwin_parent_sc)->content_get(obj, NULL);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *)obj, elm_obj_container_content_get(NULL, &ret));
+ return ret;
}
EAPI Evas_Object *
elm_win_inwin_content_unset(Evas_Object *obj)
{
ELM_INWIN_CHECK(obj) NULL;
- ELM_INWIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_container_content_unset(NULL, &ret));
+ return ret;
+}
- return ELM_CONTAINER_CLASS(_elm_inwin_parent_sc)->content_unset(obj, NULL);
+static void
+_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_inwin_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_inwin_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_inwin_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_inwin_smart_parent_set),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_inwin_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_inwin_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE), _elm_inwin_smart_activate),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE, "Activates an inwin object, ensuring its visibility."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_INWIN_BASE_ID, op_desc, ELM_OBJ_WIN_INWIN_SUB_ID_LAST),
+ NULL,
+ 0,
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_win_inwin_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
diff --git a/src/lib/elm_inwin.h b/src/lib/elm_inwin.h
index 364243886..a68d2ecb0 100644
--- a/src/lib/elm_inwin.h
+++ b/src/lib/elm_inwin.h
@@ -41,6 +41,22 @@
* @{
*/
+#define ELM_OBJ_WIN_INWIN_CLASS elm_obj_win_inwin_class_get()
+
+const Eo_Class *elm_obj_win_inwin_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_WIN_INWIN_BASE_ID;
+
+enum
+{
+ ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE,
+ ELM_OBJ_WIN_INWIN_SUB_ID_LAST
+};
+
+#define ELM_OBJ_WIN_INWIN_ID(sub_id) (ELM_OBJ_WIN_INWIN_BASE_ID + sub_id)
+
+#define elm_obj_win_inwin_activate() ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE)
+
/**
* Adds an inwin to the current window
*
diff --git a/src/lib/elm_label.c b/src/lib/elm_label.c
index 5d7b22732..88cd193de 100644
--- a/src/lib/elm_label.c
+++ b/src/lib/elm_label.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_widget_layout.h"
#include "elm_widget_label.h"
-EAPI const char ELM_LABEL_SMART_NAME[] = "elm_label";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_LABEL_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_LABEL_CLASS
+
+#define MY_CLASS_NAME "elm_label"
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
@@ -10,26 +17,23 @@ static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_LABEL_SMART_NAME, _elm_label, Elm_Label_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
-
static void
_recalc(void *data)
{
ELM_LABEL_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
Evas_Coord resw;
evas_event_freeze(evas_object_evas_get(data));
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL, &resw, NULL);
+ (wd->resize_obj, NULL, NULL, &resw, NULL);
if (sd->wrap_w > resw)
resw = sd->wrap_w;
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, resw, 0);
+ (wd->resize_obj, &minw, &minh, resw, 0);
/* This is a hack to workaround the way min size hints are treated.
* If the minimum width is smaller than the restricted width, it means
@@ -64,6 +68,7 @@ _label_sliding_change(Evas_Object *obj)
int plainlen = 0;
ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
// doesn't support multiline sliding effect
if (sd->linewrap)
@@ -74,7 +79,7 @@ _label_sliding_change(Evas_Object *obj)
plaintxt = _elm_util_mkup_to_text
(edje_object_part_text_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.text"));
+ (wd->resize_obj, "elm.text"));
if (plaintxt != NULL)
{
plainlen = strlen(plaintxt);
@@ -102,14 +107,14 @@ _label_sliding_change(Evas_Object *obj)
msg->val[0] = sd->slide_duration;
edje_object_message_send
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
+ (wd->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,slide,start", "elm");
+ (wd->resize_obj, "elm,state,slide,start", "elm");
}
else
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,slide,stop", "elm");
+ (wd->resize_obj, "elm,state,slide,stop", "elm");
if (sd->slidingellipsis)
{
sd->slidingellipsis = EINA_FALSE;
@@ -118,40 +123,43 @@ _label_sliding_change(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_label_smart_theme(Evas_Object *obj)
+static void
+_elm_label_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- Eina_Bool ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_event_freeze(evas_object_evas_get(obj));
- ret = ELM_WIDGET_CLASS(_elm_label_parent_sc)->theme(obj);
- if (!ret) goto end;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) goto end;
- _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
+ _label_format_set(wd->resize_obj, sd->format);
_label_sliding_change(obj);
end:
evas_event_thaw(evas_object_evas_get(obj));
evas_event_thaw_eval(evas_object_evas_get(obj));
+ if (ret) *ret = int_ret;
- return ret;
}
static void
-_elm_label_smart_sizing_eval(Evas_Object *obj)
+_elm_label_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
Evas_Coord resw, resh;
ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->linewrap)
{
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL, &resw, &resh);
+ (wd->resize_obj, NULL, NULL, &resw, &resh);
if (resw == sd->lastw) return;
sd->lastw = resw;
_recalc(obj);
@@ -160,9 +168,9 @@ _elm_label_smart_sizing_eval(Evas_Object *obj)
{
evas_event_freeze(evas_object_evas_get(obj));
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL, &resw, &resh);
+ (wd->resize_obj, NULL, NULL, &resw, &resh);
edje_object_size_min_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ (wd->resize_obj, &minw, &minh);
if (sd->wrap_w > 0 && minw > sd->wrap_w) minw = sd->wrap_w;
evas_object_size_hint_min_set(obj, minw, minh);
evas_event_thaw(evas_object_evas_get(obj));
@@ -283,32 +291,36 @@ _stringshare_key_value_replace(const char **srcstring,
return 0;
}
-static Eina_Bool
-_elm_label_smart_text_set(Evas_Object *obj,
- const char *item,
- const char *label)
+static void
+_elm_label_smart_text_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ const char *item = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
if (!label) label = "";
- _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
+ _label_format_set(wd->resize_obj, sd->format);
- if (_elm_label_parent_sc->text_set(obj, item, label))
+ eo_do_super(obj, elm_obj_layout_text_set(item, label, &int_ret));
+ if (int_ret)
{
sd->lastw = 0;
- _elm_label_smart_sizing_eval(obj);
- return EINA_TRUE;
+ eo_do(obj, elm_obj_layout_sizing_eval());
}
-
- return EINA_FALSE;
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_label_smart_translate(Evas_Object *obj)
+static void
+_elm_label_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_smart_callback_call(obj, "language,changed", NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
@@ -325,11 +337,12 @@ _access_info_cb(void *data __UNUSED__,
}
static void
-_elm_label_smart_add(Evas_Object *obj)
+_elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Label_Smart_Data);
+ Elm_Label_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_label_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->linewrap = ELM_WRAP_NONE;
priv->ellipsis = EINA_FALSE;
@@ -339,10 +352,10 @@ _elm_label_smart_add(Evas_Object *obj)
priv->slide_duration = 10;
priv->format = eina_stringshare_add("");
- _label_format_set(ELM_WIDGET_DATA(priv)->resize_obj, priv->format);
+ _label_format_set(wd->resize_obj, priv->format);
evas_object_event_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_CALLBACK_RESIZE,
+ (wd->resize_obj, EVAS_CALLBACK_RESIZE,
_on_label_resize, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -350,7 +363,7 @@ _elm_label_smart_add(Evas_Object *obj)
elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
elm_layout_text_set(obj, NULL, "<br>");
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Label"));
_elm_access_callback_set
@@ -359,65 +372,44 @@ _elm_label_smart_add(Evas_Object *obj)
elm_layout_sizing_eval(obj);
}
-static void
-_elm_label_smart_set_user(Elm_Label_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_label_smart_add;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_label_smart_theme;
- ELM_WIDGET_CLASS(sc)->translate = _elm_label_smart_translate;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_label_smart_sizing_eval;
- ELM_LAYOUT_CLASS(sc)->text_set = _elm_label_smart_text_set;
-
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
-}
-
-EAPI const Elm_Label_Smart_Class *
-elm_label_smart_class_get(void)
-{
- static Elm_Label_Smart_Class _sc =
- ELM_LABEL_SMART_CLASS_INIT_NAME_VERSION(ELM_LABEL_SMART_NAME);
- static const Elm_Label_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_label_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_label_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_label_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_label_line_wrap_set(Evas_Object *obj,
Elm_Wrap_Type wrap)
{
+ ELM_LABEL_CHECK(obj);
+ eo_do(obj, elm_obj_label_line_wrap_set(wrap));
+}
+
+static void
+_line_wrap_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type wrap = va_arg(*list, Elm_Wrap_Type);
const char *wrap_str, *text;
int len;
- ELM_LABEL_CHECK(obj);
- ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->linewrap == wrap) return;
@@ -449,7 +441,7 @@ elm_label_line_wrap_set(Evas_Object *obj,
if (_stringshare_key_value_replace(&sd->format, "wrap", wrap_str, 0) == 0)
{
- _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
+ _label_format_set(wd->resize_obj, sd->format);
elm_layout_sizing_eval(obj);
}
}
@@ -458,9 +450,17 @@ EAPI Elm_Wrap_Type
elm_label_line_wrap_get(const Evas_Object *obj)
{
ELM_LABEL_CHECK(obj) EINA_FALSE;
- ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Wrap_Type ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_label_line_wrap_get(&ret));
+ return ret;
+}
- return sd->linewrap;
+static void
+_line_wrap_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Wrap_Type *ret = va_arg(*list, Elm_Wrap_Type *);
+ Elm_Label_Smart_Data *sd = _pd;
+ *ret = sd->linewrap;
}
EAPI void
@@ -468,14 +468,22 @@ elm_label_wrap_width_set(Evas_Object *obj,
Evas_Coord w)
{
ELM_LABEL_CHECK(obj);
- ELM_LABEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_label_wrap_width_set(w));
+}
+
+static void
+_wrap_width_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (w < 0) w = 0;
if (sd->wrap_w == w) return;
if (sd->ellipsis)
- _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
+ _label_format_set(wd->resize_obj, sd->format);
sd->wrap_w = w;
elm_layout_sizing_eval(obj);
@@ -485,21 +493,37 @@ EAPI Evas_Coord
elm_label_wrap_width_get(const Evas_Object *obj)
{
ELM_LABEL_CHECK(obj) 0;
- ELM_LABEL_DATA_GET(obj, sd);
+ Evas_Coord ret = 0;
+ eo_do((Eo *) obj, elm_obj_label_wrap_width_get(&ret));
+ return ret;
+}
- return sd->wrap_w;
+static void
+_wrap_width_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *ret = va_arg(*list, Evas_Coord *);
+ Elm_Label_Smart_Data *sd = _pd;
+ *ret = sd->wrap_w;
}
EAPI void
elm_label_ellipsis_set(Evas_Object *obj,
Eina_Bool ellipsis)
{
+ ELM_LABEL_CHECK(obj);
+ eo_do(obj, elm_obj_label_ellipsis_set(ellipsis));
+}
+
+static void
+_ellipsis_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool ellipsis = va_arg(*list, int);
Eina_Strbuf *fontbuf = NULL;
int len, removeflag = 0;
const char *text;
- ELM_LABEL_CHECK(obj);
- ELM_LABEL_DATA_GET(obj, sd);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->ellipsis == ellipsis) return;
sd->ellipsis = ellipsis;
@@ -519,7 +543,7 @@ elm_label_ellipsis_set(Evas_Object *obj,
(&sd->format, "ellipsis", eina_strbuf_string_get
(fontbuf), removeflag) == 0)
{
- _label_format_set(ELM_WIDGET_DATA(sd)->resize_obj, sd->format);
+ _label_format_set(wd->resize_obj, sd->format);
elm_layout_sizing_eval(obj);
}
eina_strbuf_free(fontbuf);
@@ -529,9 +553,17 @@ EAPI Eina_Bool
elm_label_ellipsis_get(const Evas_Object *obj)
{
ELM_LABEL_CHECK(obj) EINA_FALSE;
- ELM_LABEL_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_label_ellipsis_get(&ret));
+ return ret;
+}
- return sd->ellipsis;
+static void
+_ellipsis_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Label_Smart_Data *sd = _pd;
+ *ret = sd->ellipsis;
}
EAPI void
@@ -539,7 +571,14 @@ elm_label_slide_set(Evas_Object *obj,
Eina_Bool slide)
{
ELM_LABEL_CHECK(obj);
- ELM_LABEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_label_slide_set(slide));
+}
+
+static void
+_slide_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool slide = va_arg(*list, int);
+ Elm_Label_Smart_Data *sd = _pd;
if (sd->slidingmode == slide) return;
sd->slidingmode = slide;
@@ -552,16 +591,32 @@ EAPI Eina_Bool
elm_label_slide_get(const Evas_Object *obj)
{
ELM_LABEL_CHECK(obj) EINA_FALSE;
- ELM_LABEL_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_label_slide_get(&ret));
+ return ret;
+}
- return sd->slidingmode;
+static void
+_slide_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Label_Smart_Data *sd = _pd;
+ *ret = sd->slidingmode;
}
EAPI void
elm_label_slide_duration_set(Evas_Object *obj, double duration)
{
ELM_LABEL_CHECK(obj);
- ELM_LABEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_label_slide_duration_set(duration));
+}
+
+static void
+_slide_duration_set(Eo *obj, void *_pd, va_list *list)
+{
+ double duration = va_arg(*list, double);
+ Elm_Label_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Edje_Message_Float_Set *msg =
alloca(sizeof(Edje_Message_Float_Set) + (sizeof(double)));
@@ -570,14 +625,99 @@ elm_label_slide_duration_set(Evas_Object *obj, double duration)
msg->count = 1;
msg->val[0] = sd->slide_duration;
edje_object_message_send
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
+ (wd->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
}
EAPI double
elm_label_slide_duration_get(const Evas_Object *obj)
{
ELM_LABEL_CHECK(obj) 0.0;
- ELM_LABEL_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_label_slide_duration_get(&ret));
+ return ret;
+}
+
+static void
+_slide_duration_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Label_Smart_Data *sd = _pd;
+ *ret = sd->slide_duration;
+}
+
+static void
+_elm_label_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
+}
- return sd->slide_duration;
+static void
+_elm_label_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_label_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_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_label_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_label_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_label_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_label_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_label_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_label_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_label_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_label_smart_text_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET), _line_wrap_set),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET), _line_wrap_get),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET), _wrap_width_set),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET), _wrap_width_get),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET), _ellipsis_set),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET), _ellipsis_get),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_SET), _slide_set),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_GET), _slide_get),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET), _slide_duration_set),
+ EO_OP_FUNC(ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET), _slide_duration_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET, "Set the wrapping behavior of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET, "Get the wrapping behavior of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET, "Set wrap width of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET, "Get wrap width of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET, "Set the ellipsis behavior of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET, "Get the ellipsis behavior of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_SLIDE_SET, "Set sliding effect of label widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_SLIDE_GET, "Get whether sliding effect is shown or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET, "Set the slide duration (speed) of the label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET, "Get the slide duration(speed) of the label."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_LABEL_BASE_ID, op_desc, ELM_OBJ_LABEL_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Label_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_label_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_label.h b/src/lib/elm_label.h
index a1f2de2b0..1f9b38575 100644
--- a/src/lib/elm_label.h
+++ b/src/lib/elm_label.h
@@ -39,6 +39,149 @@
* @{
*/
+#define ELM_OBJ_LABEL_CLASS elm_obj_label_class_get()
+
+const Eo_Class *elm_obj_label_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_LABEL_BASE_ID;
+
+enum
+{
+ ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET,
+ ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET,
+ ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET,
+ ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET,
+ ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET,
+ ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET,
+ ELM_OBJ_LABEL_SUB_ID_SLIDE_SET,
+ ELM_OBJ_LABEL_SUB_ID_SLIDE_GET,
+ ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET,
+ ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET,
+ ELM_OBJ_LABEL_SUB_ID_LAST
+};
+
+#define ELM_OBJ_LABEL_ID(sub_id) (ELM_OBJ_LABEL_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_label_line_wrap_set
+ * @since 1.8
+ *
+ * @brief Set the wrapping behavior of the label
+ *
+ * @param[in] wrap
+ *
+ * @see elm_label_line_wrap_set
+ */
+#define elm_obj_label_line_wrap_set(wrap) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_SET), EO_TYPECHECK(Elm_Wrap_Type, wrap)
+
+/**
+ * @def elm_obj_label_line_wrap_get
+ * @since 1.8
+ *
+ * @brief Get the wrapping behavior of the label
+ *
+ * @param[out] ret
+ *
+ * @see elm_label_line_wrap_get
+ */
+#define elm_obj_label_line_wrap_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_LINE_WRAP_GET), EO_TYPECHECK(Elm_Wrap_Type *, ret)
+
+/**
+ * @def elm_obj_label_wrap_width_set
+ * @since 1.8
+ *
+ * @brief Set wrap width of the label
+ *
+ * @param[in] w
+ *
+ * @see elm_label_wrap_width_set
+ */
+#define elm_obj_label_wrap_width_set(w) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_SET), EO_TYPECHECK(Evas_Coord, w)
+
+/**
+ * @def elm_obj_label_wrap_width_get
+ * @since 1.8
+ *
+ * @brief Get wrap width of the label
+ *
+ * @param[out] ret
+ *
+ * @see elm_label_wrap_width_get
+ */
+#define elm_obj_label_wrap_width_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_WRAP_WIDTH_GET), EO_TYPECHECK(Evas_Coord *, ret)
+
+/**
+ * @def elm_obj_label_ellipsis_set
+ * @since 1.8
+ *
+ * @brief Set the ellipsis behavior of the label
+ *
+ * @param[in] ellipsis
+ *
+ * @see elm_label_ellipsis_set
+ */
+#define elm_obj_label_ellipsis_set(ellipsis) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_SET), EO_TYPECHECK(Eina_Bool, ellipsis)
+
+/**
+ * @def elm_obj_label_ellipsis_get
+ * @since 1.8
+ *
+ * @brief Get the ellipsis behavior of the label
+ *
+ * @param[out] ret
+ *
+ * @see elm_label_ellipsis_get
+ */
+#define elm_obj_label_ellipsis_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_ELLIPSIS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_label_slide_set
+ * @since 1.8
+ *
+ * @brief Set sliding effect of label widget.
+ *
+ * @param[in] slide
+ *
+ * @see elm_label_slide_set
+ */
+#define elm_obj_label_slide_set(slide) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_SET), EO_TYPECHECK(Eina_Bool, slide)
+
+/**
+ * @def elm_obj_label_slide_get
+ * @since 1.8
+ *
+ * @brief Get whether sliding effect is shown or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_label_slide_get
+ */
+#define elm_obj_label_slide_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_label_slide_duration_set
+ * @since 1.8
+ *
+ * @brief Set the slide duration (speed) of the label
+ *
+ * @param[in] duration
+ *
+ * @see elm_label_slide_duration_set
+ */
+#define elm_obj_label_slide_duration_set(duration) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_SET), EO_TYPECHECK(double, duration)
+
+/**
+ * @def elm_obj_label_slide_duration_get
+ * @since 1.8
+ *
+ * @brief Get the slide duration(speed) of the label
+ *
+ * @param[out] ret
+ *
+ * @see elm_label_slide_duration_get
+ */
+#define elm_obj_label_slide_duration_get(ret) ELM_OBJ_LABEL_ID(ELM_OBJ_LABEL_SUB_ID_SLIDE_DURATION_GET), EO_TYPECHECK(double *, ret)
/**
* @brief Add a new label to the parent
*
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 3b52de299..ae2c8f84d 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -2,12 +2,15 @@
#include "elm_priv.h"
#include "elm_widget_layout.h"
-EAPI const char ELM_LAYOUT_SMART_NAME[] = "elm_layout";
+#include "Eo.h"
-static const char SIG_THEME_CHANGED[] = "theme,changed";
+EAPI Eo_Op ELM_OBJ_LAYOUT_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_LAYOUT_CLASS
-/* no *direct* instantiation of this class, so far */
-__UNUSED__ static Evas_Smart *_elm_layout_smart_class_new(void);
+#define MY_CLASS_NAME "elm_layout"
+
+static const char SIG_THEME_CHANGED[] = "theme,changed";
/* smart callbacks coming from elm layout objects: */
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
@@ -66,9 +69,9 @@ struct _Elm_Layout_Sub_Object_Cursor
* Evas's rendering phase, it will be addressed, finally (see
* _elm_layout_smart_calculate()). */
static void
-_elm_layout_smart_sizing_eval(Evas_Object *obj)
+_elm_layout_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
if (sd->needs_size_calc) return;
sd->needs_size_calc = EINA_TRUE;
@@ -82,9 +85,9 @@ _on_sub_object_size_hint_change(void *data,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
- ELM_LAYOUT_DATA_GET(data, sd);
- if (ELM_WIDGET_DATA(sd)->frozen) return;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
+ if (wd->frozen) return;
+ eo_do(data, elm_obj_layout_sizing_eval());
}
static void
@@ -97,36 +100,13 @@ _part_cursor_free(Elm_Layout_Sub_Object_Cursor *pc)
free(pc);
}
-/* Elementary smart class for all widgets having an Edje layout as a
- * building block */
-EVAS_SMART_SUBCLASS_NEW
- (ELM_LAYOUT_SMART_NAME, _elm_layout, Elm_Layout_Smart_Class,
- Elm_Container_Smart_Class, elm_container_smart_class_get, _smart_callbacks);
-
-EAPI const Elm_Layout_Smart_Class *
-elm_layout_smart_class_get(void)
-{
- static Elm_Layout_Smart_Class _sc =
- ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(ELM_LAYOUT_SMART_NAME);
- static const Elm_Layout_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_layout_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
static void
_sizing_eval(Evas_Object *obj, Elm_Layout_Smart_Data *sd)
{
Evas_Coord minw = -1, minh = -1;
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -153,10 +133,11 @@ _icon_signal_emit(Elm_Layout_Smart_Data *sd,
snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
visible ? "visible" : "hidden");
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, buf, "elm");
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+ edje_object_signal_emit(wd->resize_obj, buf, "elm");
/* themes might need imediate action here */
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
static inline void
@@ -170,6 +151,8 @@ _text_signal_emit(Elm_Layout_Smart_Data *sd,
if (sub_d->type != TEXT || strcmp("elm.text", sub_d->part))
return;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+
if (strncmp(sub_d->part, "elm.text.", sizeof("elm.text.") - 1) == 0)
type = sub_d->part + sizeof("elm.text.") - 1;
else
@@ -177,16 +160,16 @@ _text_signal_emit(Elm_Layout_Smart_Data *sd,
snprintf(buf, sizeof(buf), "elm,state,%s,%s", type,
visible ? "visible" : "hidden");
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, buf, "elm");
+ edje_object_signal_emit(wd->resize_obj, buf, "elm");
/* TODO: is this right? It was like that, but IMO it should be removed: */
snprintf(buf, sizeof(buf),
visible ? "elm,state,text,visible" : "elm,state,text,hidden");
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, buf, "elm");
+ edje_object_signal_emit(wd->resize_obj, buf, "elm");
/* themes might need imediate action here */
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
static void
@@ -207,13 +190,14 @@ _parts_text_fix(Elm_Layout_Smart_Data *sd)
{
const Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
if (sub_d->type == TEXT)
{
edje_object_part_text_escaped_set
- (ELM_WIDGET_DATA(sd)->resize_obj, sub_d->part,
+ (wd->resize_obj, sub_d->part,
sub_d->p.text.text);
}
}
@@ -233,13 +217,14 @@ _parts_cursors_apply(Elm_Layout_Smart_Data *sd)
const Eina_List *l;
const char *file, *group;
Elm_Layout_Sub_Object_Cursor *pc;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_file_get(ELM_WIDGET_DATA(sd)->resize_obj, &file, &group);
+ edje_object_file_get(wd->resize_obj, &file, &group);
EINA_LIST_FOREACH(sd->parts_cursors, l, pc)
{
Evas_Object *obj = (Evas_Object *)edje_object_part_object_get
- (ELM_WIDGET_DATA(sd)->resize_obj, pc->part);
+ (wd->resize_obj, pc->part);
if (!obj)
{
@@ -283,55 +268,72 @@ _visuals_refresh(Evas_Object *obj,
_parts_signals_emit(sd);
_parts_cursors_apply(sd);
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_layout_sizing_eval());
- edje_object_signal_callback_del(ELM_WIDGET_DATA(sd)->resize_obj,
- "edje,change,file", "edje",
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+ edje_object_signal_callback_del(wd->resize_obj,
+ "edje,change,file", "edje",
_reload_theme);
- edje_object_signal_callback_add(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_callback_add(wd->resize_obj,
"edje,change,file", "edje",
_reload_theme, obj);
}
-static Eina_Bool
-_elm_layout_smart_disable(Evas_Object *obj)
+static void
+_elm_layout_smart_disable(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (elm_object_disabled_get(obj))
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,disabled", "elm");
+ (wd->resize_obj, "elm,state,disabled", "elm");
else
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,enabled", "elm");
+ (wd->resize_obj, "elm,state,enabled", "elm");
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_theme(Evas_Object *obj)
+static void
+_elm_layout_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- Eina_Bool ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
const char *fh;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!ELM_WIDGET_CLASS(_elm_layout_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
+ /* The following lines are here to support entry design; the _theme function
+ * of entry needs to call directly the widget _theme function */
+ Eina_Bool enable = EINA_TRUE;
+ eo_do(obj, elm_obj_layout_theme_enable(&enable));
+ if (EINA_TRUE != enable)
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
/* function already prints error messages, if any */
- ret = elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, sd->klass, sd->group,
+ int_ret = elm_widget_theme_object_set
+ (obj, wd->resize_obj, sd->klass, sd->group,
elm_widget_style_get(obj));
edje_object_mirrored_set
- (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));
+ (wd->resize_obj, elm_widget_mirrored_get(obj));
edje_object_scale_set
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
elm_widget_scale_get(obj) * elm_config_scale_get());
fh = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "focus_highlight");
+ (wd->resize_obj, "focus_highlight");
if ((fh) && (!strcmp(fh, "on")))
elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
else
@@ -341,7 +343,7 @@ _elm_layout_smart_theme(Evas_Object *obj)
_visuals_refresh(obj, sd);
- return ret;
+ if (ret) *ret = int_ret;
}
static void *
@@ -352,39 +354,52 @@ _elm_layout_list_data_get(const Eina_List *list)
return sub_d->obj;
}
-static Eina_Bool
-_elm_layout_smart_on_focus(Evas_Object *obj)
+static void
+_elm_layout_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
if (elm_widget_focus_get(obj))
{
elm_layout_signal_emit(obj, "elm,action,focus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
elm_layout_signal_emit(obj, "elm,action,unfocus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
+static void
+_elm_layout_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
/* WARNING: if you're making a widget *not* supposed to have focusable
* child objects, but still inheriting from elm_layout, just set its
* focus_next smart function back to NULL */
-static Eina_Bool
-_elm_layout_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_layout_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
- if (!sd->subs) return EINA_FALSE;
+ if (!sd->subs) return;
if ((items = elm_widget_focus_custom_chain_get(obj)))
list_data_get = eina_list_data_get;
@@ -394,39 +409,54 @@ _elm_layout_smart_focus_next(const Evas_Object *obj,
list_data_get = _elm_layout_list_data_get;
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_layout_smart_sub_object_add(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_layout_smart_sub_object_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_layout_parent_sc)->sub_object_add(obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- evas_object_event_callback_add
- (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _on_sub_object_size_hint_change, obj);
+ Eina_Bool int_ret = EINA_FALSE;
- return EINA_TRUE;
+ eo_do_super(obj, elm_wdg_sub_object_add(sobj, &int_ret));
+ if (!int_ret) return;
+
+ Eina_Bool enable = EINA_TRUE;
+ eo_do(obj, elm_obj_layout_sub_object_add_enable(&enable));
+
+ if (EINA_TRUE == enable)
+ evas_object_event_callback_add
+ (sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _on_sub_object_size_hint_change, obj);
+
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_layout_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_event_callback_del_full
(sobj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_sub_object_size_hint_change, obj);
- if (!ELM_WIDGET_CLASS(_elm_layout_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
@@ -442,25 +472,38 @@ _elm_layout_smart_sub_object_del(Evas_Object *obj,
break;
}
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_layout_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_layout_smart_focus_direction(Eo *obj, void *_pd, va_list *list)
{
+ const Evas_Object *base = va_arg(*list, const Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Eina_Bool int_ret = EINA_FALSE;
+
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
- if (!sd->subs) return EINA_FALSE;
+ if (!sd->subs) return;
/* Focus chain (This block is diferent of elm_win cycle) */
if ((items = elm_widget_focus_custom_chain_get(obj)))
@@ -470,21 +513,23 @@ _elm_layout_smart_focus_direction(const Evas_Object *obj,
items = sd->subs;
list_data_get = _elm_layout_list_data_get;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- return elm_widget_focus_list_direction_get
+ int_ret = elm_widget_focus_list_direction_get
(obj, base, items, list_data_get, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
static void
-_elm_layout_smart_signal(Evas_Object *obj,
- const char *emission,
- const char *source)
+_elm_layout_smart_signal_emit(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj, emission, source);
+ edje_object_signal_emit(wd->resize_obj, emission, source);
}
static void
@@ -499,15 +544,17 @@ _edje_signal_callback(void *data,
}
static void
-_elm_layout_smart_callback_add(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb,
- void *data)
+_elm_layout_smart_signal_callback_add(Eo *obj, void *_pd, va_list *list)
{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func_cb = va_arg(*list, Edje_Signal_Cb);
+ void *data = va_arg(*list, void *);
+
Edje_Signal_Data *esd;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
esd = ELM_NEW(Edje_Signal_Data);
if (!esd) return;
@@ -520,21 +567,25 @@ _elm_layout_smart_callback_add(Evas_Object *obj,
sd->edje_signals = eina_list_append(sd->edje_signals, esd);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(sd)->resize_obj, emission, source,
+ (wd->resize_obj, emission, source,
_edje_signal_callback, esd);
}
-static void *
-_elm_layout_smart_callback_del(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func_cb)
+static void
+_elm_layout_smart_signal_callback_del(Eo *obj, void *_pd, va_list *list)
{
Edje_Signal_Data *esd = NULL;
void *data = NULL;
Eina_List *l;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func_cb = va_arg(*list, Edje_Signal_Cb);
+ void **ret = va_arg(*list, void **);
+ if (ret) *ret = NULL;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
EINA_LIST_FOREACH(sd->edje_signals, l, esd)
{
@@ -548,28 +599,55 @@ _elm_layout_smart_callback_del(Evas_Object *obj,
free(esd);
edje_object_signal_callback_del_full
- (ELM_WIDGET_DATA(sd)->resize_obj, emission, source,
+ (wd->resize_obj, emission, source,
_edje_signal_callback, esd);
- return data; /* stop at 1st match */
+ if (ret) *ret = data;
+ return; /* stop at 1st match */
}
}
+}
+
+static void
+_elm_layout_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = NULL;
+}
+
+static void
+_elm_layout_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = NULL;
+}
+
+static void
+_elm_layout_smart_sub_object_add_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *enable = va_arg(*list, Eina_Bool *);
+ *enable = EINA_TRUE;
+}
- return data;
+static void
+_elm_layout_smart_theme_enable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *enable = va_arg(*list, Eina_Bool *);
+ *enable = EINA_TRUE;
}
static Eina_Bool
-_elm_layout_part_aliasing_eval(Elm_Layout_Smart_Data *sd,
+_elm_layout_part_aliasing_eval(const Evas_Object *obj EINA_UNUSED,
+ Elm_Layout_Smart_Data *sd,
const char **part,
Eina_Bool is_text)
{
-#define ALIAS_LIST(_sd, _list) \
- ((ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(_sd)->api))->_list)
-
- const Elm_Layout_Part_Alias_Description *aliases = is_text ?
- ALIAS_LIST(sd, text_aliases) : ALIAS_LIST(sd, content_aliases);
+ const Elm_Layout_Part_Alias_Description *aliases = NULL;
-#undef ALIAS_LIST
+ if (is_text)
+ eo_do(sd->obj, elm_obj_layout_smart_text_aliases_get(&aliases));
+ else
+ eo_do(sd->obj, elm_obj_layout_smart_content_aliases_get(&aliases));
if (!aliases) return EINA_TRUE;
@@ -587,8 +665,9 @@ _elm_layout_part_aliasing_eval(Elm_Layout_Smart_Data *sd,
if (!*part)
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
ERR("no default content part set for object %p -- "
- "part must not be NULL", ELM_WIDGET_DATA(sd)->obj);
+ "part must not be NULL", wd->obj);
return EINA_FALSE;
}
@@ -597,18 +676,22 @@ _elm_layout_part_aliasing_eval(Elm_Layout_Smart_Data *sd,
return EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_text_set(Evas_Object *obj,
- const char *part,
- const char *text)
+static void
+_elm_layout_smart_text_set(Eo *obj, void *_pd, va_list *list)
{
Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d = NULL;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ const char *text = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- if (!_elm_layout_part_aliasing_eval(sd, &part, EINA_TRUE))
- return EINA_FALSE;
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_TRUE))
+ return;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
@@ -620,9 +703,9 @@ _elm_layout_smart_text_set(Evas_Object *obj,
eina_stringshare_del(sub_d->p.text.text);
free(sub_d);
edje_object_part_text_escaped_set
- (ELM_WIDGET_DATA(sd)->resize_obj, part, NULL);
+ (wd->resize_obj, part, NULL);
sd->subs = eina_list_remove_list(sd->subs, l);
- return EINA_TRUE;
+ goto end;
}
else
break;
@@ -631,13 +714,13 @@ _elm_layout_smart_text_set(Evas_Object *obj,
}
if (!edje_object_part_text_escaped_set
- (ELM_WIDGET_DATA(sd)->resize_obj, part, text))
- return EINA_FALSE;
+ (wd->resize_obj, part, text))
+ return;
if (!sub_d)
{
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
- if (!sub_d) return EINA_FALSE;
+ if (!sub_d) return;
sub_d->type = TEXT;
sub_d->part = eina_stringshare_add(part);
sd->subs = eina_list_append(sd->subs, sub_d);
@@ -647,43 +730,50 @@ _elm_layout_smart_text_set(Evas_Object *obj,
_text_signal_emit(sd, sub_d, !!text);
- if (!ELM_WIDGET_DATA(sd)->frozen)
- {
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
- }
+ if (!wd->frozen)
+ eo_do(obj, elm_obj_layout_sizing_eval());
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON &&
- ELM_WIDGET_DATA(sd)->can_access && !(sub_d->obj))
+ wd->can_access && !(sub_d->obj))
sub_d->obj = _elm_access_edje_object_part_object_register
(obj, elm_layout_edje_get(obj), part);
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static const char *
-_elm_layout_smart_text_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_layout_smart_text_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!_elm_layout_part_aliasing_eval(sd, &part, EINA_TRUE))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ const char **text = va_arg(*list, const char **);
+ *text = NULL;
- return edje_object_part_text_get(ELM_WIDGET_DATA(sd)->resize_obj, part);
+ if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_TRUE))
+ return;
+
+ *text = edje_object_part_text_get(wd->resize_obj, part);
}
-static Eina_Bool
-_elm_layout_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_layout_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
const Eina_List *l;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!_elm_layout_part_aliasing_eval(sd, &part, EINA_FALSE))
- return EINA_FALSE;
+ if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_FALSE))
+ return;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
@@ -691,7 +781,7 @@ _elm_layout_smart_content_set(Evas_Object *obj,
{
if (!strcmp(part, sub_d->part))
{
- if (content == sub_d->obj) return EINA_TRUE;
+ if (content == sub_d->obj) goto end;
evas_object_del(sub_d->obj);
break;
}
@@ -710,14 +800,14 @@ _elm_layout_smart_content_set(Evas_Object *obj,
if (!elm_widget_sub_object_add(obj, content))
{
ERR("could not add %p as sub object of %p", content, obj);
- return EINA_FALSE;
+ return;
}
if (!edje_object_part_swallow
- (ELM_WIDGET_DATA(sd)->resize_obj, part, content))
+ (wd->resize_obj, part, content))
{
ERR("could not swallow %p into part '%s'", content, part);
- return EINA_FALSE;
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -729,43 +819,54 @@ _elm_layout_smart_content_set(Evas_Object *obj,
_icon_signal_emit(sd, sub_d, EINA_TRUE);
}
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
- return EINA_TRUE;
+ eo_do(obj, elm_obj_layout_sizing_eval());
+
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_layout_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_layout_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
const Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **content = va_arg(*list, Evas_Object **);
+ *content = NULL;
- if (!_elm_layout_part_aliasing_eval(sd, &part, EINA_FALSE))
- return EINA_FALSE;
+ Elm_Layout_Smart_Data *sd = _pd;
+
+ if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_FALSE))
+ return;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
if ((sub_d->type == SWALLOW) && !strcmp(part, sub_d->part))
- return sub_d->obj;
+ {
+ *content = sub_d->obj;
+ return;
+ }
}
- return NULL;
}
-static Evas_Object *
-_elm_layout_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_layout_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
const Eina_List *l;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
- if (!_elm_layout_part_aliasing_eval(sd, &part, EINA_FALSE))
- return EINA_FALSE;
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ if (!_elm_layout_part_aliasing_eval(obj, sd, &part, EINA_FALSE))
+ return;
EINA_LIST_FOREACH(sd->subs, l, sub_d)
{
@@ -773,7 +874,7 @@ _elm_layout_smart_content_unset(Evas_Object *obj,
{
Evas_Object *content;
- if (!sub_d->obj) return NULL;
+ if (!sub_d->obj) return;
content = sub_d->obj; /* sub_d will die in
* _elm_layout_smart_sub_object_del */
@@ -781,40 +882,43 @@ _elm_layout_smart_content_unset(Evas_Object *obj,
if (!elm_widget_sub_object_del(obj, content))
{
ERR("could not remove sub object %p from %p", content, obj);
- return NULL;
+ return;
}
edje_object_part_unswallow
- (ELM_WIDGET_DATA(sd)->resize_obj, content);
- return content;
+ (wd->resize_obj, content);
+ if (ret) *ret = content;
+ return;
}
}
-
- return NULL;
}
-static Eina_Bool
-_elm_layout_smart_box_append(Evas_Object *obj,
- const char *part,
- Evas_Object *child)
+static void
+_elm_layout_smart_box_append(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!edje_object_part_box_append
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child))
+ (wd->resize_obj, part, child))
{
ERR("child %p could not be appended to box part '%s'", child, part);
- return EINA_FALSE;
+ return;
}
if (!elm_widget_sub_object_add(obj, child))
{
ERR("could not add %p as sub object of %p", child, obj);
edje_object_part_box_remove
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child);
- return EINA_FALSE;
+ (wd->resize_obj, part, child);
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -823,34 +927,39 @@ _elm_layout_smart_box_append(Evas_Object *obj,
sub_d->obj = child;
sd->subs = eina_list_append(sd->subs, sub_d);
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_box_prepend(Evas_Object *obj,
- const char *part,
- Evas_Object *child)
+static void
+_elm_layout_smart_box_prepend(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!edje_object_part_box_prepend
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child))
+ (wd->resize_obj, part, child))
{
ERR("child %p could not be prepended to box part '%s'", child, part);
- return EINA_FALSE;
+ return;
}
if (!elm_widget_sub_object_add(obj, child))
{
ERR("could not add %p as sub object of %p", child, obj);
edje_object_part_box_remove
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child);
- return EINA_FALSE;
+ (wd->resize_obj, part, child);
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -859,10 +968,11 @@ _elm_layout_smart_box_prepend(Evas_Object *obj,
sub_d->obj = child;
sd->subs = eina_list_prepend(sd->subs, sub_d);
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -875,30 +985,34 @@ _box_reference_del(void *data,
sub_d->p.box.reference = NULL;
}
-static Eina_Bool
-_elm_layout_smart_box_insert_before(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- const Evas_Object *reference)
+static void
+_elm_layout_smart_box_insert_before(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ const Evas_Object *reference = va_arg(*list, const Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!edje_object_part_box_insert_before
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child, reference))
+ (wd->resize_obj, part, child, reference))
{
ERR("child %p could not be inserted before %p inf box part '%s'",
child, reference, part);
- return EINA_FALSE;
+ return;
}
if (!elm_widget_sub_object_add(obj, child))
{
ERR("could not add %p as sub object of %p", child, obj);
edje_object_part_box_remove
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child);
- return EINA_FALSE;
+ (wd->resize_obj, part, child);
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -911,36 +1025,41 @@ _elm_layout_smart_box_insert_before(Evas_Object *obj,
evas_object_event_callback_add
((Evas_Object *)reference, EVAS_CALLBACK_DEL, _box_reference_del, sub_d);
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_box_insert_at(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- unsigned int pos)
+static void
+_elm_layout_smart_box_insert_at(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ unsigned int pos = va_arg(*list, unsigned int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!edje_object_part_box_insert_at
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child, pos))
+ (wd->resize_obj, part, child, pos))
{
ERR("child %p could not be inserted at %u to box part '%s'",
child, pos, part);
- return EINA_FALSE;
+ return;
}
if (!elm_widget_sub_object_add(obj, child))
{
ERR("could not add %p as sub object of %p", child, obj);
edje_object_part_box_remove
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child);
- return EINA_FALSE;
+ (wd->resize_obj, part, child);
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -950,10 +1069,11 @@ _elm_layout_smart_box_insert_at(Evas_Object *obj,
sub_d->p.box.pos = pos;
sd->subs = eina_list_append(sd->subs, sub_d);
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static Evas_Object *
@@ -969,8 +1089,9 @@ _sub_box_remove(Evas_Object *obj,
((Evas_Object *)sub_d->p.box.reference,
EVAS_CALLBACK_DEL, _box_reference_del, sub_d);
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_box_remove
- (ELM_WIDGET_DATA(sd)->resize_obj, sub_d->part, child);
+ (wd->resize_obj, sub_d->part, child);
if (!elm_widget_sub_object_del(obj, child))
{
@@ -997,15 +1118,20 @@ _sub_box_is(const Elm_Layout_Sub_Object_Data *sub_d)
}
}
-static Evas_Object *
-_elm_layout_smart_box_remove(Evas_Object *obj,
- const char *part,
- Evas_Object *child)
+static void
+_elm_layout_smart_box_remove(Eo *obj, void *_pd, va_list *list)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
+ Evas_Object *int_ret = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN(part);
+ EINA_SAFETY_ON_NULL_RETURN(child);
+
+ Elm_Layout_Smart_Data *sd = _pd;
const Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
@@ -1014,20 +1140,26 @@ _elm_layout_smart_box_remove(Evas_Object *obj,
{
if (!_sub_box_is(sub_d)) continue;
if ((sub_d->obj == child) && (!strcmp(sub_d->part, part)))
- return _sub_box_remove(obj, sd, sub_d);
+ {
+ int_ret = _sub_box_remove(obj, sd, sub_d);
+ if (ret) *ret = int_ret;
+ return;
+ }
}
-
- return NULL;
}
-static Eina_Bool
-_elm_layout_smart_box_remove_all(Evas_Object *obj,
- const char *part,
- Eina_Bool clear)
+static void
+_elm_layout_smart_box_remove_all(Eo *obj, void *_pd, va_list *list)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, EINA_FALSE);
+ const char *part = va_arg(*list, const char *);
+ Eina_Bool clear = va_arg(*list, int);
+ Eina_Bool *ret= va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(part);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Elm_Layout_Sub_Object_Data *sub_d;
Eina_List *lst;
@@ -1047,40 +1179,44 @@ _elm_layout_smart_box_remove_all(Evas_Object *obj,
/* eventually something may not be added with elm_layout, delete them
* as well */
edje_object_part_box_remove_all
- (ELM_WIDGET_DATA(sd)->resize_obj, part, clear);
+ (wd->resize_obj, part, clear);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_layout_smart_table_pack(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- unsigned short col,
- unsigned short row,
- unsigned short colspan,
- unsigned short rowspan)
+static void
+_elm_layout_smart_table_pack(Eo *obj, void *_pd, va_list *list)
{
Elm_Layout_Sub_Object_Data *sub_d;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ unsigned short col = va_arg(*list, unsigned int);
+ unsigned short row = va_arg(*list, unsigned int);
+ unsigned short colspan = va_arg(*list, unsigned int);
+ unsigned short rowspan = va_arg(*list, unsigned int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!edje_object_part_table_pack
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child, col,
+ (wd->resize_obj, part, child, col,
row, colspan, rowspan))
{
ERR("child %p could not be packed into box part '%s' col=%uh, row=%hu,"
" colspan=%hu, rowspan=%hu", child, part, col, row, colspan,
rowspan);
- return EINA_FALSE;
+ return;
}
if (!elm_widget_sub_object_add(obj, child))
{
ERR("could not add %p as sub object of %p", child, obj);
edje_object_part_table_unpack
- (ELM_WIDGET_DATA(sd)->resize_obj, part, child);
- return EINA_FALSE;
+ (wd->resize_obj, part, child);
+ return;
}
sub_d = ELM_NEW(Elm_Layout_Sub_Object_Data);
@@ -1093,10 +1229,11 @@ _elm_layout_smart_table_pack(Evas_Object *obj,
sub_d->p.table.rowspan = rowspan;
sd->subs = eina_list_append(sd->subs, sub_d);
- if (ELM_WIDGET_DATA(sd)->frozen) return EINA_TRUE;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ if (wd->frozen) goto end;
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static Evas_Object *
@@ -1105,11 +1242,12 @@ _sub_table_remove(Evas_Object *obj,
Elm_Layout_Sub_Object_Data *sub_d)
{
Evas_Object *child;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
child = sub_d->obj; /* sub_d will die in _elm_layout_smart_sub_object_del */
edje_object_part_table_unpack
- (ELM_WIDGET_DATA(sd)->resize_obj, sub_d->part, child);
+ (wd->resize_obj, sub_d->part, child);
if (!elm_widget_sub_object_del(obj, child))
{
@@ -1120,15 +1258,20 @@ _sub_table_remove(Evas_Object *obj,
return child;
}
-static Evas_Object *
-_elm_layout_smart_table_unpack(Evas_Object *obj,
- const char *part,
- Evas_Object *child)
+static void
+_elm_layout_smart_table_unpack(Eo *obj, void *_pd, va_list *list)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(child, NULL);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
+ Evas_Object *int_ret = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN(part);
+ EINA_SAFETY_ON_NULL_RETURN(child);
+
+ Elm_Layout_Smart_Data *sd = _pd;
const Eina_List *l;
Elm_Layout_Sub_Object_Data *sub_d;
@@ -1137,19 +1280,26 @@ _elm_layout_smart_table_unpack(Evas_Object *obj,
{
if (sub_d->type != TABLE_PACK) continue;
if ((sub_d->obj == child) && (!strcmp(sub_d->part, part)))
- return _sub_table_remove(obj, sd, sub_d);
+ {
+ int_ret = _sub_table_remove(obj, sd, sub_d);
+ if (ret) *ret = int_ret;
+ return;
+ }
}
-
- return NULL;
}
-static Eina_Bool
-_elm_layout_smart_table_clear(Evas_Object *obj,
- const char *part,
- Eina_Bool clear)
+static void
+_elm_layout_smart_table_clear(Eo *obj, void *_pd, va_list *list)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(part, EINA_FALSE);
- ELM_LAYOUT_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Eina_Bool clear = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN(part);
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Elm_Layout_Sub_Object_Data *sub_d;
Eina_List *lst;
@@ -1168,9 +1318,9 @@ _elm_layout_smart_table_clear(Evas_Object *obj,
/* eventually something may not be added with elm_layout, delete them
* as well */
- edje_object_part_table_clear(ELM_WIDGET_DATA(sd)->resize_obj, part, clear);
+ edje_object_part_table_clear(wd->resize_obj, part, clear);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -1179,33 +1329,31 @@ _on_size_evaluate_signal(void *data,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{
- ELM_LAYOUT_DATA_GET(data, sd);
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(data);
+ eo_do(data, elm_obj_layout_sizing_eval());
}
static void
-_elm_layout_smart_add(Evas_Object *obj)
+_elm_layout_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Layout_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
/* has to be there *before* parent's smart_add() */
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_layout_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "size,eval", "elm",
+ (wd->resize_obj, "size,eval", "elm",
_on_size_evaluate_signal, obj);
- if (ELM_WIDGET_DATA(priv)->frozen) return;
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(priv)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_layout_sizing_eval());
}
static void
-_elm_layout_smart_del(Evas_Object *obj)
+_elm_layout_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Layout_Sub_Object_Data *sub_d;
Elm_Layout_Sub_Object_Cursor *pc;
@@ -1213,7 +1361,8 @@ _elm_layout_smart_del(Evas_Object *obj)
Evas_Object *child;
Eina_List *l;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_layout_freeze(obj);
@@ -1242,25 +1391,25 @@ _elm_layout_smart_del(Evas_Object *obj)
/* let's make our Edje object the *last* to be processed, since it
* may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(ELM_WIDGET_DATA(sd)->subobjs, l, child)
+ EINA_LIST_FOREACH(wd->subobjs, l, child)
{
- if (child == ELM_WIDGET_DATA(sd)->resize_obj)
+ if (child == wd->resize_obj)
{
- ELM_WIDGET_DATA(sd)->subobjs =
- eina_list_demote_list(ELM_WIDGET_DATA(sd)->subobjs, l);
+ wd->subobjs =
+ eina_list_demote_list(wd->subobjs, l);
break;
}
}
- ELM_WIDGET_CLASS(_elm_layout_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
/* rewrite or extend this one on your derived class as to suit your
* needs */
static void
-_elm_layout_smart_calculate(Evas_Object *obj)
+_elm_layout_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_LAYOUT_DATA_GET(obj, sd);
+ Elm_Layout_Smart_Data *sd = _pd;
if (sd->needs_size_calc)
{
@@ -1269,43 +1418,6 @@ _elm_layout_smart_calculate(Evas_Object *obj)
}
}
-static void
-_elm_layout_smart_set_user(Elm_Layout_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_layout_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_layout_smart_del;
- ELM_WIDGET_CLASS(sc)->base.calculate = _elm_layout_smart_calculate;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_layout_smart_theme;
- ELM_WIDGET_CLASS(sc)->disable = _elm_layout_smart_disable;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_layout_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_layout_smart_focus_direction;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_layout_smart_on_focus;
-
- ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_layout_smart_sub_object_add;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_layout_smart_sub_object_del;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_layout_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_layout_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_layout_smart_content_unset;
-
- sc->sizing_eval = _elm_layout_smart_sizing_eval;
- sc->signal = _elm_layout_smart_signal;
- sc->callback_add = _elm_layout_smart_callback_add;
- sc->callback_del = _elm_layout_smart_callback_del;
- sc->text_set = _elm_layout_smart_text_set;
- sc->text_get = _elm_layout_smart_text_get;
- sc->box_append = _elm_layout_smart_box_append;
- sc->box_prepend = _elm_layout_smart_box_prepend;
- sc->box_insert_before = _elm_layout_smart_box_insert_before;
- sc->box_insert_at = _elm_layout_smart_box_insert_at;
- sc->box_remove = _elm_layout_smart_box_remove;
- sc->box_remove_all = _elm_layout_smart_box_remove_all;
- sc->table_pack = _elm_layout_smart_table_pack;
- sc->table_unpack = _elm_layout_smart_table_unpack;
- sc->table_clear = _elm_layout_smart_table_clear;
-}
-
static Elm_Layout_Sub_Object_Cursor *
_parts_cursors_find(Elm_Layout_Smart_Data *sd,
const char *part)
@@ -1331,19 +1443,33 @@ elm_layout_file_set(Evas_Object *obj,
const char *group)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_file_set(file, group, &ret));
+ return ret;
+}
- Eina_Bool ret =
- edje_object_file_set(ELM_WIDGET_DATA(sd)->resize_obj, file, group);
+static void
+_elm_layout_smart_file_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (ret) _visuals_refresh(obj, sd);
+ int_ret =
+ edje_object_file_set(wd->resize_obj, file, group);
+
+ if (int_ret) _visuals_refresh(obj, sd);
else
ERR("failed to set edje file '%s', group '%s': %s",
file, group,
edje_load_error_str
- (edje_object_load_error_get(ELM_WIDGET_DATA(sd)->resize_obj)));
+ (edje_object_load_error_get(wd->resize_obj)));
- return ret;
+ if (ret) *ret = int_ret;
}
EAPI Eina_Bool
@@ -1352,34 +1478,46 @@ elm_layout_theme_set(Evas_Object *obj,
const char *group,
const char *style)
{
- Eina_Bool ret;
-
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_theme_set(klass, group, style, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_theme_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *klass = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
+ const char *style = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
eina_stringshare_replace(&(sd->klass), klass);
eina_stringshare_replace(&(sd->group), group);
- eina_stringshare_replace(&(ELM_WIDGET_DATA(sd)->style), style);
+ eina_stringshare_replace(&(wd->style), style);
/* not issuing smart theme directly here, because one may want to
use this function inside a smart theme routine of its own */
- ret = elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, sd->klass, sd->group,
+ int_ret = elm_widget_theme_object_set
+ (obj, wd->resize_obj, sd->klass, sd->group,
elm_widget_style_get(obj));
evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
- return ret;
+ if (ret) *ret = int_ret;
}
+
EAPI void
elm_layout_signal_emit(Evas_Object *obj,
const char *emission,
const char *source)
{
ELM_LAYOUT_CHECK(obj);
- ELM_LAYOUT_DATA_GET_OR_RETURN(obj, sd);
-
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->signal(obj, emission, source);
+ eo_do(obj, elm_obj_layout_signal_emit(emission, source));
}
EAPI void
@@ -1390,10 +1528,7 @@ elm_layout_signal_callback_add(Evas_Object *obj,
void *data)
{
ELM_LAYOUT_CHECK(obj);
- ELM_LAYOUT_DATA_GET_OR_RETURN(obj, sd);
-
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->callback_add
- (obj, emission, source, func, data);
+ eo_do(obj, elm_obj_layout_signal_callback_add(emission, source, func, data));
}
EAPI void *
@@ -1403,10 +1538,9 @@ elm_layout_signal_callback_del(Evas_Object *obj,
Edje_Signal_Cb func)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
-
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->callback_del
- (obj, emission, source, func);
+ void *ret = NULL;
+ eo_do(obj, elm_obj_layout_signal_callback_del(emission, source, func, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1415,10 +1549,9 @@ elm_layout_content_set(Evas_Object *obj,
Evas_Object *content)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
-
- return ELM_CONTAINER_CLASS(ELM_WIDGET_DATA(sd)->api)->content_set
- (obj, swallow, content);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_container_content_set(swallow, content, &ret));
+ return ret;
}
EAPI Evas_Object *
@@ -1426,10 +1559,9 @@ elm_layout_content_get(const Evas_Object *obj,
const char *swallow)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
-
- return ELM_CONTAINER_CLASS(ELM_WIDGET_DATA(sd)->api)->content_get
- (obj, swallow);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_container_content_get(swallow, &ret));
+ return ret;
}
EAPI Evas_Object *
@@ -1437,10 +1569,9 @@ elm_layout_content_unset(Evas_Object *obj,
const char *swallow)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
-
- return ELM_CONTAINER_CLASS(ELM_WIDGET_DATA(sd)->api)->content_unset
- (obj, swallow);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_container_content_unset(swallow, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1449,10 +1580,9 @@ elm_layout_text_set(Evas_Object *obj,
const char *text)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
-
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->text_set
- (obj, part, text);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_text_set(part, text, &ret));
+ return ret;
}
EAPI const char *
@@ -1460,9 +1590,10 @@ elm_layout_text_get(const Evas_Object *obj,
const char *part)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->text_get(obj, part);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_layout_text_get(part, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1471,11 +1602,11 @@ elm_layout_box_append(Evas_Object *obj,
Evas_Object *child)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_append
- (obj, part, child);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_box_append(part, child, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1484,11 +1615,11 @@ elm_layout_box_prepend(Evas_Object *obj,
Evas_Object *child)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_prepend
- (obj, part, child);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_box_prepend(part, child, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1498,12 +1629,12 @@ elm_layout_box_insert_before(Evas_Object *obj,
const Evas_Object *reference)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(reference, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_insert_before
- (obj, part, child, reference);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_box_insert_before(part, child, reference, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1513,11 +1644,11 @@ elm_layout_box_insert_at(Evas_Object *obj,
unsigned int pos)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(child, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_insert_at
- (obj, part, child, pos);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_box_insert_at(part, child, pos, &ret));
+ return ret;
}
EAPI Evas_Object *
@@ -1526,10 +1657,10 @@ elm_layout_box_remove(Evas_Object *obj,
Evas_Object *child)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_remove
- (obj, part, child);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_layout_box_remove(part, child, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1538,10 +1669,10 @@ elm_layout_box_remove_all(Evas_Object *obj,
Eina_Bool clear)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->box_remove_all
- (obj, part, clear);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_box_remove_all(part, clear, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1554,10 +1685,10 @@ elm_layout_table_pack(Evas_Object *obj,
unsigned short rowspan)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->table_pack
- (obj, part, child, col, row, colspan, rowspan);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_table_pack(part, child, col, row, colspan, rowspan, &ret));
+ return ret;
}
EAPI Evas_Object *
@@ -1566,10 +1697,10 @@ elm_layout_table_unpack(Evas_Object *obj,
Evas_Object *child)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->table_unpack
- (obj, part, child);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_layout_table_unpack(part, child, &ret));
+ return ret;
}
EAPI Eina_Bool
@@ -1578,19 +1709,29 @@ elm_layout_table_clear(Evas_Object *obj,
Eina_Bool clear)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- return ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->table_clear
- (obj, part, clear);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_table_clear(part, clear, &ret));
+ return ret;
}
EAPI Evas_Object *
elm_layout_edje_get(const Evas_Object *obj)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_layout_edje_get(&ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_edje_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ELM_WIDGET_DATA(sd)->resize_obj;
+ *ret = wd->resize_obj;
}
EAPI const char *
@@ -1598,48 +1739,87 @@ elm_layout_data_get(const Evas_Object *obj,
const char *key)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_layout_data_get(key, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_data_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *key = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return edje_object_data_get(ELM_WIDGET_DATA(sd)->resize_obj, key);
+ *ret = edje_object_data_get(wd->resize_obj, key);
}
EAPI void
elm_layout_sizing_eval(Evas_Object *obj)
{
ELM_LAYOUT_CHECK(obj);
- ELM_LAYOUT_DATA_GET(obj, sd);
-
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_layout_sizing_eval());
}
EAPI int
elm_layout_freeze(Evas_Object *obj)
{
ELM_LAYOUT_CHECK(obj) 0;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do(obj, elm_obj_layout_freeze(&ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_freeze(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ int int_ret = 1;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if ((ELM_WIDGET_DATA(sd)->frozen)++ != 0)
- return ELM_WIDGET_DATA(sd)->frozen;
+ if ((wd->frozen)++ != 0)
+ {
+ int_ret = wd->frozen;
+ goto end;
+ }
- edje_object_freeze(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_freeze(wd->resize_obj);
- return 1;
+end:
+ if (ret) *ret = int_ret;
}
EAPI int
elm_layout_thaw(Evas_Object *obj)
{
ELM_LAYOUT_CHECK(obj) 0;
- ELM_LAYOUT_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do(obj, elm_obj_layout_thaw(&ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_thaw(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ int int_ret = 0;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (--(ELM_WIDGET_DATA(sd)->frozen) != 0)
- return ELM_WIDGET_DATA(sd)->frozen;
+ if (--(wd->frozen) != 0)
+ {
+ int_ret = wd->frozen;
+ goto end;
+ }
- edje_object_thaw(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_thaw(wd->resize_obj);
- ELM_LAYOUT_CLASS(ELM_WIDGET_DATA(sd)->api)->sizing_eval(obj);
+ eo_do(obj, elm_obj_layout_sizing_eval());
- return 0;
+end:
+ if (ret) *ret = int_ret;
}
EAPI Eina_Bool
@@ -1648,32 +1828,46 @@ elm_layout_part_cursor_set(Evas_Object *obj,
const char *cursor)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_part_cursor_set(part_name, cursor, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ const char *cursor = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Evas_Object *part_obj;
Elm_Layout_Sub_Object_Cursor *pc;
part_obj = (Evas_Object *)edje_object_part_object_get
- (ELM_WIDGET_DATA(sd)->resize_obj, part_name);
+ (wd->resize_obj, part_name);
if (!part_obj)
{
const char *group, *file;
- edje_object_file_get(ELM_WIDGET_DATA(sd)->resize_obj, &file, &group);
+ edje_object_file_get(wd->resize_obj, &file, &group);
ERR("no part '%s' in group '%s' of file '%s'. Cannot set cursor '%s'",
part_name, group, file, cursor);
- return EINA_FALSE;
+ return;
}
if (evas_object_pass_events_get(part_obj))
{
const char *group, *file;
- edje_object_file_get(ELM_WIDGET_DATA(sd)->resize_obj, &file, &group);
+ edje_object_file_get(wd->resize_obj, &file, &group);
ERR("part '%s' in group '%s' of file '%s' has mouse_events: 0. "
"Cannot set cursor '%s'",
part_name, group, file, cursor);
- return EINA_FALSE;
+ return;
}
pc = _parts_cursors_find(sd, part_name);
@@ -1690,7 +1884,7 @@ elm_layout_part_cursor_set(Evas_Object *obj,
pc->obj = part_obj;
elm_object_sub_cursor_set(part_obj, obj, pc->cursor);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI const char *
@@ -1698,14 +1892,26 @@ elm_layout_part_cursor_get(const Evas_Object *obj,
const char *part_name)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_layout_part_cursor_get(part_name, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Elm_Layout_Sub_Object_Cursor *pc = _parts_cursors_find(sd, part_name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->obj);
- return elm_object_cursor_get(pc->obj);
+ *ret = elm_object_cursor_get(pc->obj);
}
EAPI Eina_Bool
@@ -1713,8 +1919,20 @@ elm_layout_part_cursor_unset(Evas_Object *obj,
const char *part_name)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_part_cursor_unset(part_name, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_unset(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Eina_List *l;
Elm_Layout_Sub_Object_Cursor *pc;
@@ -1726,11 +1944,10 @@ elm_layout_part_cursor_unset(Evas_Object *obj,
if (pc->obj) elm_object_cursor_unset(pc->obj);
_part_cursor_free(pc);
sd->parts_cursors = eina_list_remove_list(sd->parts_cursors, l);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
-
- return EINA_FALSE;
}
EAPI Eina_Bool
@@ -1739,17 +1956,30 @@ elm_layout_part_cursor_style_set(Evas_Object *obj,
const char *style)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_part_cursor_style_set(part_name, style, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ const char *style = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Elm_Layout_Sub_Object_Cursor *pc = _parts_cursors_find(sd, part_name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->obj);
eina_stringshare_replace(&pc->style, style);
elm_object_cursor_style_set(pc->obj, pc->style);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI const char *
@@ -1757,14 +1987,26 @@ elm_layout_part_cursor_style_get(const Evas_Object *obj,
const char *part_name)
{
ELM_LAYOUT_CHECK(obj) NULL;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_layout_part_cursor_style_get(part_name, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Elm_Layout_Sub_Object_Cursor *pc = _parts_cursors_find(sd, part_name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->obj);
- return elm_object_cursor_style_get(pc->obj);
+ *ret = elm_object_cursor_style_get(pc->obj);
}
EAPI Eina_Bool
@@ -1773,17 +2015,30 @@ elm_layout_part_cursor_engine_only_set(Evas_Object *obj,
Eina_Bool engine_only)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_part_cursor_engine_only_set(part_name, engine_only, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_engine_only_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ Eina_Bool engine_only = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Elm_Layout_Sub_Object_Cursor *pc = _parts_cursors_find(sd, part_name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->obj);
pc->engine_only = !!engine_only;
elm_object_cursor_theme_search_enabled_set(pc->obj, pc->engine_only);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI Eina_Bool
@@ -1791,66 +2046,211 @@ elm_layout_part_cursor_engine_only_get(const Evas_Object *obj,
const char *part_name)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(part_name, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_layout_part_cursor_engine_only_get(part_name, &ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_part_cursor_engine_only_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part_name = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ Elm_Layout_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(part_name);
Elm_Layout_Sub_Object_Cursor *pc = _parts_cursors_find(sd, part_name);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc, EINA_FALSE);
- EINA_SAFETY_ON_NULL_RETURN_VAL(pc->obj, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->obj);
- return elm_object_cursor_theme_search_enabled_get(pc->obj);
+ *ret = elm_object_cursor_theme_search_enabled_get(pc->obj);
}
-EVAS_SMART_SUBCLASS_NEW
- (ELM_LAYOUT_SMART_NAME, _elm_layout_widget, Elm_Layout_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
-
static const Elm_Layout_Part_Alias_Description _text_aliases[] =
{
{"default", "elm.text"},
{NULL, NULL}
};
-/* the layout widget (not the base layout) has this extra bit */
-static void
-_elm_layout_widget_smart_set_user(Elm_Layout_Smart_Class *sc)
-{
- sc->text_aliases = _text_aliases;
-}
-
EAPI Eina_Bool
elm_layout_edje_object_can_access_set(Evas_Object *obj,
Eina_Bool can_access)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_edje_object_can_access_set(can_access, &ret));
+ return ret;
+}
- ELM_WIDGET_DATA(sd)->can_access = !!can_access;
- return EINA_TRUE;
+static void
+_elm_layout_smart_edje_object_can_access_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool can_access = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ wd->can_access = !!can_access;
+ if (ret) *ret = EINA_TRUE;
}
EAPI Eina_Bool
elm_layout_edje_object_can_access_get(Evas_Object *obj)
{
ELM_LAYOUT_CHECK(obj) EINA_FALSE;
- ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_layout_edje_object_can_access_get(&ret));
+ return ret;
+}
+
+static void
+_elm_layout_smart_edje_object_can_access_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ELM_WIDGET_DATA(sd)->can_access;
+ *ret = wd->can_access;
}
-/* And now the basic layout widget itself */
EAPI Evas_Object *
elm_layout_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_layout_widget_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Layout_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+}
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_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_layout_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_layout_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_layout_smart_calculate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_layout_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_layout_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_layout_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_layout_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_layout_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_layout_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_layout_smart_focus_direction),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_layout_smart_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_layout_smart_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_layout_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_layout_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_layout_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_FILE_SET), _elm_layout_smart_file_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THEME_SET), _elm_layout_smart_theme_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT), _elm_layout_smart_signal_emit),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD), _elm_layout_smart_signal_callback_add),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL), _elm_layout_smart_signal_callback_del),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_layout_smart_text_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), _elm_layout_smart_text_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_APPEND), _elm_layout_smart_box_append),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_PREPEND), _elm_layout_smart_box_prepend),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_BEFORE), _elm_layout_smart_box_insert_before),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_AT), _elm_layout_smart_box_insert_at),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE), _elm_layout_smart_box_remove),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE_ALL), _elm_layout_smart_box_remove_all),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_PACK), _elm_layout_smart_table_pack),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_UNPACK), _elm_layout_smart_table_unpack),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_CLEAR), _elm_layout_smart_table_clear),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_GET), _elm_layout_smart_edje_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_DATA_GET), _elm_layout_smart_data_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_layout_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_SET), _elm_layout_smart_part_cursor_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_GET), _elm_layout_smart_part_cursor_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_UNSET), _elm_layout_smart_part_cursor_unset),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_SET), _elm_layout_smart_part_cursor_style_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_GET), _elm_layout_smart_part_cursor_style_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_SET), _elm_layout_smart_part_cursor_engine_only_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_GET), _elm_layout_smart_part_cursor_engine_only_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_SET), _elm_layout_smart_edje_object_can_access_set),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_GET), _elm_layout_smart_edje_object_can_access_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_layout_smart_text_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_layout_smart_content_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), _elm_layout_smart_sub_object_add_enable),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE), _elm_layout_smart_theme_enable),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_FREEZE), _elm_layout_smart_freeze),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THAW), _elm_layout_smart_thaw),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_FILE_SET, "Set the file that will be used as layout."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_THEME_SET, "Set the edje group from the elementary theme that will be used as layout."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT, "Send a (Edje) signal to a given layout widget's underlying Edje object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD, "Add a callback for a (Edje) signal emitted by a layout widget's underlying Edje object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL, "Remove a signal-triggered callback from a given layout widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET, "Set the text of the given part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET, "Get the text set in the given part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_APPEND, "Append child to layout box part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_PREPEND, "Prepend child to layout box part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_BEFORE, "Insert child to layout box part before a reference object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_AT, "Insert child to layout box part at a given position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE, "Remove a child of the given part box."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE_ALL, "Remove all children of the given part box."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TABLE_PACK, "Insert child to layout table part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TABLE_UNPACK, "Unpack (remove) a child of the given part table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TABLE_CLEAR, "Remove all the child objects of the given part table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_EDJE_GET, "Get the edje layout."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_DATA_GET, "Get the edje data from the given layout."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL, "Eval sizing."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_SET, "Sets a specific cursor for an edje part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_GET, "Get the cursor to be shown when mouse is over an edje part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_UNSET, "Unsets a cursor previously set with elm_layout_part_cursor_set()."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_SET, "Sets a specific cursor style for an edje part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_GET, "Gets a specific cursor style for an edje part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_SET, "Sets if the cursor set should be searched on the theme or should use the provided by the engine, only ."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_GET, "Gets a specific cursor engine_only for an edje part."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_SET, "Checks whenever 'property' is impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_GET, "Checks whenever 'property' is impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET, "Checks whenever 'text aliases' are impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET, "Checks whenever 'content aliases' are impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE, "Checks whenever sub object handling impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE, "Checks whenever 'theme' is impemented in current class."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_FREEZE, "Freezes the Elementary layout object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LAYOUT_SUB_ID_THAW, "Thaws the Elementary layout object."),
+
+
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_LAYOUT_BASE_ID, op_desc, ELM_OBJ_LAYOUT_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Layout_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_layout_class_get, &class_desc, ELM_OBJ_CONTAINER_CLASS, NULL);
- return obj;
-}
diff --git a/src/lib/elm_layout.h b/src/lib/elm_layout.h
index 209b15a95..9ef1bfd9c 100644
--- a/src/lib/elm_layout.h
+++ b/src/lib/elm_layout.h
@@ -165,6 +165,445 @@
*
*/
+#define ELM_OBJ_LAYOUT_CLASS elm_obj_layout_class_get()
+
+ const Eo_Class *elm_obj_layout_class_get(void) EINA_CONST;
+
+ extern EAPI Eo_Op ELM_OBJ_LAYOUT_BASE_ID;
+
+ enum
+{
+ ELM_OBJ_LAYOUT_SUB_ID_FILE_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_THEME_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT,
+ ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD,
+ ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL,
+ ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_APPEND,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_PREPEND,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_BEFORE,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_AT,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE,
+ ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE_ALL,
+ ELM_OBJ_LAYOUT_SUB_ID_TABLE_PACK,
+ ELM_OBJ_LAYOUT_SUB_ID_TABLE_UNPACK,
+ ELM_OBJ_LAYOUT_SUB_ID_TABLE_CLEAR,
+ ELM_OBJ_LAYOUT_SUB_ID_EDJE_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_DATA_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_UNSET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_SET,
+ ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET,
+ ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE,
+ ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE,
+ ELM_OBJ_LAYOUT_SUB_ID_FREEZE,
+ ELM_OBJ_LAYOUT_SUB_ID_THAW,
+ ELM_OBJ_LAYOUT_SUB_ID_LAST
+};
+
+#define ELM_OBJ_LAYOUT_ID(sub_id) (ELM_OBJ_LAYOUT_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_layout_file_set
+ * @since 1.8
+ *
+ * Set the file that will be used as layout
+ *
+ * @param[in] file
+ * @param[in] group
+ * @param[out] ret
+ *
+ * @see elm_layout_file_set
+ */
+#define elm_obj_layout_file_set(file, group, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_theme_set
+ * @since 1.8
+ *
+ * Set the edje group from the elementary theme that will be used as layout
+ *
+ * @param[in] klass
+ * @param[in] group
+ * @param[in] style
+ * @param[out] ret
+ *
+ * @see elm_layout_theme_set
+ */
+#define elm_obj_layout_theme_set(klass, group, style, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THEME_SET), EO_TYPECHECK(const char *, klass), EO_TYPECHECK(const char *, group), EO_TYPECHECK(const char *, style), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_signal_emit
+ * @since 1.8
+ *
+ * Send a (Edje) signal to a given layout widget's underlying Edje
+ *
+ * @param[in] emission
+ * @param[in] source
+ *
+ * @see elm_layout_signal_emit
+ */
+#define elm_obj_layout_signal_emit(emission, source) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_EMIT), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source)
+
+/**
+ * @def elm_obj_layout_signal_callback_add
+ * @since 1.8
+ *
+ * Add a callback for a (Edje) signal emitted by a layout widget's
+ *
+ * @param[in] emission
+ * @param[in] source
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_layout_signal_callback_add
+ */
+#define elm_obj_layout_signal_callback_add(emission, source, func, data) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_ADD), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source), EO_TYPECHECK(Edje_Signal_Cb, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_layout_signal_callback_del
+ * @since 1.8
+ *
+ * Remove a signal-triggered callback from a given layout widget.
+ *
+ * @param[in] emission
+ * @param[in] source
+ * @param[in] func
+ * @param[out] ret
+ *
+ * @see elm_layout_signal_callback_del
+ */
+#define elm_obj_layout_signal_callback_del(emission, source, func, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIGNAL_CALLBACK_DEL), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source), EO_TYPECHECK(Edje_Signal_Cb, func), EO_TYPECHECK(void **, ret)
+
+/**
+ * @def elm_obj_layout_text_set
+ * @since 1.8
+ *
+ * Set the text of the given part
+ *
+ * @param[in] part
+ * @param[in] text
+ * @param[out] ret
+ *
+ * @see elm_layout_text_set
+ */
+#define elm_obj_layout_text_set(part, text, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char *, text), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_text_get
+ * @since 1.8
+ *
+ * Get the text set in the given part
+ *
+ * @param[in] part
+ * @param[out] ret
+ *
+ * @see elm_layout_text_get
+ */
+#define elm_obj_layout_text_get(part, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_layout_box_append
+ * @since 1.8
+ *
+ * Append child to layout box part.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[out] ret
+ *
+ * @see elm_layout_box_append
+ */
+#define elm_obj_layout_box_append(part, child, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_APPEND), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_box_prepend
+ * @since 1.8
+ *
+ * Prepend child to layout box part.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[out] ret
+ *
+ * @see elm_layout_box_prepend
+ */
+#define elm_obj_layout_box_prepend(part, child, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_PREPEND), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_box_insert_before
+ * @since 1.8
+ *
+ * Insert child to layout box part before a reference object.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[in] reference
+ * @param[out] ret
+ *
+ * @see elm_layout_box_insert_before
+ */
+#define elm_obj_layout_box_insert_before(part, child, reference, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_BEFORE), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(const Evas_Object *, reference), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_box_insert_at
+ * @since 1.8
+ *
+ * Insert child to layout box part at a given position.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[in] pos
+ * @param[out] ret
+ *
+ * @see elm_layout_box_insert_at
+ */
+#define elm_obj_layout_box_insert_at(part, child, pos, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_INSERT_AT), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(unsigned int, pos), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_box_remove
+ * @since 1.8
+ *
+ * Remove a child of the given part box.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[out] ret
+ *
+ * @see elm_layout_box_remove
+ */
+#define elm_obj_layout_box_remove(part, child, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_layout_box_remove_all
+ * @since 1.8
+ *
+ * Remove all children of the given part box.
+ *
+ * @param[in] part
+ * @param[in] clear
+ * @param[out] ret
+ *
+ * @see elm_layout_box_remove_all
+ */
+#define elm_obj_layout_box_remove_all(part, clear, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_BOX_REMOVE_ALL), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool, clear), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_table_pack
+ * @since 1.8
+ *
+ * Insert child to layout table part.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[in] col
+ * @param[in] row
+ * @param[in] colspan
+ * @param[in] rowspan
+ * @param[out] ret
+ *
+ * @see elm_layout_table_pack
+ */
+#define elm_obj_layout_table_pack(part, child, col, row, colspan, rowspan, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_PACK), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(unsigned short, col), EO_TYPECHECK(unsigned short, row), EO_TYPECHECK(unsigned short, colspan), EO_TYPECHECK(unsigned short, rowspan), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_table_unpack
+ * @since 1.8
+ *
+ * Unpack (remove) a child of the given part table.
+ *
+ * @param[in] part
+ * @param[in] child
+ * @param[out] ret
+ *
+ * @see elm_layout_table_unpack
+ */
+#define elm_obj_layout_table_unpack(part, child, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_UNPACK), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_layout_table_clear
+ * @since 1.8
+ *
+ * Remove all the child objects of the given part table.
+ *
+ * @param[in] part
+ * @param[in] clear
+ * @param[out] ret
+ *
+ * @see elm_layout_table_clear
+ */
+#define elm_obj_layout_table_clear(part, clear, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TABLE_CLEAR), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Eina_Bool, clear), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_edje_get
+ * @since 1.8
+ *
+ * Get the edje layout
+ *
+ * @param[out] ret
+ *
+ * @see elm_layout_edje_get
+ */
+#define elm_obj_layout_edje_get(ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_layout_data_get
+ * @since 1.8
+ *
+ * Get the edje data from the given layout
+ *
+ * @param[in] key
+ * @param[out] ret
+ *
+ * @see elm_layout_data_get
+ */
+#define elm_obj_layout_data_get(key, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_DATA_GET), EO_TYPECHECK(const char *, key), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_layout_sizing_eval
+ * @since 1.8
+ *
+ * Eval sizing
+ *
+ *
+ * @see elm_layout_sizing_eval
+ */
+#define elm_obj_layout_sizing_eval() ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL)
+
+/**
+ * @def elm_obj_layout_part_cursor_set
+ * @since 1.8
+ *
+ * Sets a specific cursor for an edje part.
+ *
+ * @param[in] part_name
+ * @param[in] cursor
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_set
+ */
+#define elm_obj_layout_part_cursor_set(part_name, cursor, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_SET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(const char *, cursor), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_get
+ * @since 1.8
+ *
+ * Get the cursor to be shown when mouse is over an edje part
+ *
+ * @param[in] part_name
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_get
+ */
+#define elm_obj_layout_part_cursor_get(part_name, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_GET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_unset
+ * @since 1.8
+ *
+ * Unsets a cursor previously set with elm_layout_part_cursor_set().
+ *
+ * @param[in] part_name
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_unset
+ */
+#define elm_obj_layout_part_cursor_unset(part_name, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_UNSET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_style_set
+ * @since 1.8
+ *
+ * Sets a specific cursor style for an edje part.
+ *
+ * @param[in] part_name
+ * @param[in] style
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_style_set
+ */
+#define elm_obj_layout_part_cursor_style_set(part_name, style, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_SET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(const char *, style), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_style_get
+ * @since 1.8
+ *
+ * Gets a specific cursor style for an edje part.
+ *
+ * @param[in] part_name
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_style_get
+ */
+#define elm_obj_layout_part_cursor_style_get(part_name, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_STYLE_GET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_engine_only_set
+ * @since 1.8
+ *
+ * Sets if the cursor set should be searched on the theme or should use
+ *
+ * @param[in] part_name
+ * @param[in] engine_only
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_engine_only_set
+ */
+#define elm_obj_layout_part_cursor_engine_only_set(part_name, engine_only, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_SET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(Eina_Bool, engine_only), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_layout_part_cursor_engine_only_get
+ * @since 1.8
+ *
+ * Gets a specific cursor engine_only for an edje part.
+ *
+ * @param[in] part_name
+ * @param[out] ret
+ *
+ * @see elm_layout_part_cursor_engine_only_get
+ */
+#define elm_obj_layout_part_cursor_engine_only_get(part_name, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_PART_CURSOR_ENGINE_ONLY_GET), EO_TYPECHECK(const char *, part_name), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_layout_edje_object_can_access_set(can_access, ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_SET), EO_TYPECHECK(Eina_Bool, can_access), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_layout_edje_object_can_access_get(ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_EDJE_OBJECT_CAN_ACCESS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_layout_smart_text_aliases_get(aliases) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), EO_TYPECHECK(const Elm_Layout_Part_Alias_Description **, aliases)
+#define elm_obj_layout_smart_content_aliases_get(aliases) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), EO_TYPECHECK(const Elm_Layout_Part_Alias_Description **, aliases)
+#define elm_obj_layout_sub_object_add_enable(enable) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SUB_OBJECT_ADD_ENABLE), EO_TYPECHECK(Eina_Bool *, enable)
+#define elm_obj_layout_theme_enable(enable) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THEME_ENABLE), EO_TYPECHECK(Eina_Bool *, enable)
+
+/**
+ * @def elm_obj_layout_freeze
+ * @since 1.8
+ *
+ * @brief Freezes the Elementary layout object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_layout_freeze
+ */
+#define elm_obj_layout_freeze(ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_FREEZE), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_layout_thaw
+ * @since 1.8
+ *
+ * @brief Thaws the Elementary object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_layout_thaw
+ */
+#define elm_obj_layout_thaw(ret) ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_THAW), EO_TYPECHECK(int *, ret)
+
/**
* Add a new layout to the parent
*
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 7a13dffa6..07e057c8f 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1,8 +1,13 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_list.h"
+#include "elm_interface_scrollable.h"
-EAPI const char ELM_LIST_SMART_NAME[] = "elm_list";
+EAPI Eo_Op ELM_OBJ_LIST_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_LIST_CLASS
+
+#define MY_CLASS_NAME "elm_list"
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
@@ -30,22 +35,12 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
static void _size_hints_changed_cb(void *, Evas *, Evas_Object *, void *);
static void _mouse_up_cb(void *, Evas *, Evas_Object *, void *);
static void _mouse_down_cb(void *, Evas *, Evas_Object *, void *);
static void _mouse_move_cb(void *, Evas *, Evas_Object *, void *);
static void _items_fix(Evas_Object *);
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_LIST_SMART_NAME, _elm_list, Elm_List_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
static inline void
_elm_list_item_free(Elm_List_Item *it)
{
@@ -188,12 +183,16 @@ _item_single_select_down(Elm_List_Smart_Data *sd)
return EINA_TRUE;
}
-static Eina_Bool
-_elm_list_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_list_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord v_w = 0;
@@ -205,17 +204,18 @@ _elm_list_smart_event(Evas_Object *obj,
Elm_List_Item *it = NULL;
Evas_Event_Key_Down *ev = event_info;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_List_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (!sd->items) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (!sd->items) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
/* TODO: fix logic for horizontal mode */
if ((!strcmp(ev->keyname, "Left")) ||
@@ -227,7 +227,8 @@ _elm_list_smart_event(Evas_Object *obj,
|| (_item_single_select_up(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
x -= step_x;
@@ -241,7 +242,8 @@ _elm_list_smart_event(Evas_Object *obj,
|| (_item_single_select_down(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
x += step_x;
@@ -255,7 +257,8 @@ _elm_list_smart_event(Evas_Object *obj,
|| (_item_single_select_up(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y -= step_y;
@@ -269,7 +272,8 @@ _elm_list_smart_event(Evas_Object *obj,
|| (_item_single_select_down(sd))))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else
y += step_y;
@@ -280,7 +284,8 @@ _elm_list_smart_event(Evas_Object *obj,
it = eina_list_data_get(sd->items);
elm_list_item_bring_in((Elm_Object_Item *)it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "End")) ||
((!strcmp(ev->keyname, "KP_End")) && !ev->string))
@@ -288,7 +293,8 @@ _elm_list_smart_event(Evas_Object *obj,
it = eina_list_data_get(eina_list_last(sd->items));
elm_list_item_bring_in((Elm_Object_Item *)it);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "Prior")) ||
((!strcmp(ev->keyname, "KP_Prior")) && !ev->string))
@@ -336,24 +342,26 @@ _elm_list_smart_event(Evas_Object *obj,
}
else if (!strcmp(ev->keyname, "Escape"))
{
- if (!_all_items_unselect(sd)) return EINA_FALSE;
+ if (!_all_items_unselect(sd)) return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_list_smart_translate(Evas_Object *obj)
+static void
+_elm_list_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -376,22 +384,20 @@ _elm_list_deletions_process(Elm_List_Smart_Data *sd)
}
static void
-_elm_list_smart_sizing_eval(Evas_Object *obj)
+_elm_list_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord vw = 0, vh = 0;
Evas_Coord minw, minh, maxw, maxh, w, h, vmw, vmh;
double xw, yw;
- ELM_LIST_DATA_GET(obj, sd);
-
- /* parent class' early call */
- if (!sd->s_iface) return;
+ Elm_List_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_size_hint_min_get(sd->box, &minw, &minh);
evas_object_size_hint_max_get(sd->box, &maxw, &maxh);
evas_object_size_hint_weight_get(sd->box, &xw, &yw);
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (xw > 0.0)
{
if ((minw > 0) && (vw < minw)) vw = minw;
@@ -414,7 +420,7 @@ _elm_list_smart_sizing_eval(Evas_Object *obj)
h = -1;
edje_object_size_min_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &vmw, &vmh);
+ (wd->resize_obj, &vmw, &vmh);
if (sd->scr_minw) w = vmw + minw;
if (sd->scr_minh) h = vmh + minh;
@@ -442,8 +448,10 @@ _elm_list_content_min_limit_cb(Evas_Object *obj,
}
static void
-_elm_list_mode_set_internal(Elm_List_Smart_Data *sd)
+_elm_list_mode_set_internal(Evas_Object *obj)
{
+ Elm_List_Smart_Data *sd = eo_data_get(obj, MY_CLASS);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->mode == ELM_LIST_LIMIT)
{
if (!sd->h_mode)
@@ -468,7 +476,7 @@ _elm_list_mode_set_internal(Elm_List_Smart_Data *sd)
sd->scr_minh = EINA_FALSE;
}
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ elm_layout_sizing_eval(wd->obj);
}
static inline void
@@ -483,7 +491,7 @@ _elm_list_walk(Elm_List_Smart_Data *sd)
}
static inline void
-_elm_list_unwalk(Elm_List_Smart_Data *sd)
+_elm_list_unwalk(Evas_Object *obj, Elm_List_Smart_Data *sd)
{
sd->walking--;
if (sd->walking < 0)
@@ -501,8 +509,8 @@ _elm_list_unwalk(Elm_List_Smart_Data *sd)
if (sd->fix_pending)
{
sd->fix_pending = EINA_FALSE;
- _items_fix(ELM_WIDGET_DATA(sd)->obj);
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ _items_fix(obj);
+ elm_layout_sizing_eval(obj);
}
}
@@ -679,8 +687,8 @@ _items_fix(Evas_Object *obj)
i++;
}
- _elm_list_mode_set_internal(sd);
- _elm_list_unwalk(sd);
+ _elm_list_mode_set_internal(obj);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -701,24 +709,25 @@ _size_hints_changed_cb(void *data,
/* FIXME: take off later. maybe this show region coords belong in the
* interface (new api functions, set/get)? */
static void
-_show_region_hook(void *data,
+_show_region_hook(void *data EINA_UNUSED,
Evas_Object *obj)
{
Evas_Coord x, y, w, h;
- ELM_LIST_DATA_GET(data, sd);
-
elm_widget_show_region_get(obj, &x, &y, &w, &h);
- sd->s_iface->content_region_set(obj, x, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_set(x, y, w, h));
}
-static Eina_Bool
-_elm_list_smart_disable(Evas_Object *obj)
+static void
+_elm_list_smart_disable(Eo *obj, void *_pd, va_list *list)
{
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_List_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_list_parent_sc)->disable(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_disable(&int_ret));
+ if (!int_ret) return;
if (elm_widget_disabled_get(obj))
{
@@ -734,7 +743,7 @@ _elm_list_smart_disable(Evas_Object *obj)
elm_widget_scroll_hold_pop(obj);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -746,21 +755,25 @@ _mirrored_set(Evas_Object *obj,
ELM_LIST_DATA_GET(obj, sd);
- sd->s_iface->mirrored_set(obj, rtl);
+ eo_do(obj, elm_scrollable_interface_mirrored_set(rtl));
EINA_LIST_FOREACH(sd->items, n, it)
edje_object_mirrored_set(VIEW(it), rtl);
}
-static Eina_Bool
-_elm_list_smart_theme(Evas_Object *obj)
+static void
+_elm_list_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Elm_List_Item *it;
Eina_List *n;
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_List_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_list_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -774,34 +787,41 @@ _elm_list_smart_theme(Evas_Object *obj)
_items_fix(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_list_smart_on_focus(Evas_Object *obj)
+static void
+_elm_list_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_List_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_list_parent_sc)->on_focus(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (elm_widget_focus_get(obj) && sd->selected && !sd->last_selected_item)
sd->last_selected_item = eina_list_data_get(sd->selected);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_list_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_list_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
const Eina_List *l;
Elm_List_Item *it;
- ELM_LIST_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ Elm_List_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_list_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if ((sobj == sd->box) || (sobj == obj)) goto end;
@@ -826,7 +846,7 @@ _elm_list_smart_sub_object_del(Evas_Object *obj,
}
end:
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -851,7 +871,7 @@ _item_highlight(Elm_List_Item *it)
evas_object_raise(VIEW(it));
it->highlighted = EINA_TRUE;
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -882,7 +902,7 @@ call:
evas_object_smart_callback_call(obj, SIG_SELECTED, it);
it->sd->last_selected_item = (Elm_Object_Item *)it;
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -915,7 +935,7 @@ _item_unselect(Elm_List_Item *it)
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -1044,7 +1064,7 @@ _mouse_move_cb(void *data,
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -1089,7 +1109,7 @@ _mouse_down_cb(void *data,
sd->swipe = EINA_FALSE;
sd->movements = 0;
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -1171,7 +1191,7 @@ _mouse_up_cb(void *data,
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -1320,7 +1340,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
_elm_list_item_free(item);
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
return EINA_TRUE;
@@ -1411,7 +1431,7 @@ _access_activate_cb(void *data __UNUSED__,
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -1508,19 +1528,35 @@ _resize_cb(void *data,
elm_layout_sizing_eval(data);
}
-static Eina_Bool
-_elm_list_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_list_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_list_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+static void
+_elm_list_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
Eina_List *items = NULL;
Eina_List *elist = NULL;
Elm_List_Item *it;
- ELM_LIST_CHECK(obj) EINA_FALSE;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_List_Smart_Data *sd = _pd;
- if (_elm_config->access_mode != ELM_ACCESS_MODE_ON) return EINA_FALSE;
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_ON) return;
EINA_LIST_FOREACH(sd->items, elist, it)
{
@@ -1529,18 +1565,20 @@ _elm_list_smart_focus_next(const Evas_Object *obj,
if (it->end) items = eina_list_append(items, it->end);
}
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
static void
-_elm_list_smart_add(Evas_Object *obj)
+_elm_list_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw, minh;
- EVAS_SMART_DATA_ALLOC(obj, Elm_List_Smart_Data);
+ Elm_List_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_list_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -1558,32 +1596,25 @@ _elm_list_smart_add(Evas_Object *obj)
evas_object_show(priv->hit_rect);
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->edge_left_cb_set(obj, _edge_left_cb);
- priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
- priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
- priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
-
- priv->s_iface->content_min_limit_cb_set
- (obj, _elm_list_content_min_limit_cb);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj,
+ elm_scrollable_interface_edge_left_cb_set(_edge_left_cb),
+ elm_scrollable_interface_edge_right_cb_set(_edge_right_cb),
+ elm_scrollable_interface_edge_top_cb_set(_edge_top_cb),
+ elm_scrollable_interface_edge_bottom_cb_set(_edge_bottom_cb),
+ elm_scrollable_interface_content_min_limit_cb_set(_elm_list_content_min_limit_cb),
+ elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
/* the scrollable interface may set this */
evas_object_event_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_size_hints_changed_cb, obj);
edje_object_size_min_calc
- (ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
+ (wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj);
- priv->s_iface->bounce_allow_set
- (obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(EINA_FALSE, _elm_config->thumbscroll_bounce_enable));
priv->box = elm_box_add(obj);
elm_box_homogeneous_set(priv->box, EINA_TRUE);
@@ -1594,19 +1625,19 @@ _elm_list_smart_add(Evas_Object *obj)
elm_widget_on_show_region_hook_set(priv->box, _show_region_hook, obj);
elm_widget_sub_object_add(obj, priv->box);
- priv->s_iface->content_set(obj, priv->box);
+ eo_do(obj, elm_scrollable_interface_content_set(priv->box));
evas_object_event_callback_add
(priv->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_size_hints_changed_cb, obj);
}
static void
-_elm_list_smart_del(Evas_Object *obj)
+_elm_list_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
const Eina_List *l;
Elm_List_Item *it;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_List_Smart_Data *sd = _pd;
if (sd->walking)
ERR("ERROR: list deleted while walking.\n");
@@ -1639,125 +1670,96 @@ _elm_list_smart_del(Evas_Object *obj)
elm_widget_item_free(it);
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
if (sd->to_delete)
ERR("ERROR: leaking nodes!\n");
eina_list_free(sd->selected);
- ELM_WIDGET_CLASS(_elm_list_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_list_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_list_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_LIST_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_List_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_list_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_list_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_list_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_LIST_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_List_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_list_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_list_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_list_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_LIST_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_List_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_list_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
static void
-_elm_list_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_list_smart_access(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
+ Elm_List_Smart_Data *sd = _pd;
+ int is_access = va_arg(*list, int);
Eina_List *elist = NULL;
Elm_List_Item *it;
- ELM_LIST_DATA_GET(obj, sd);
-
EINA_LIST_FOREACH(sd->items, elist, it)
_access_widget_item_register(it, is_access);
}
-static void
-_elm_list_smart_set_user(Elm_List_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_list_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_list_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_list_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_list_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_list_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_list_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_list_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_list_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
- ELM_WIDGET_CLASS(sc)->theme = _elm_list_smart_theme;
- ELM_WIDGET_CLASS(sc)->disable = _elm_list_smart_disable;
- ELM_WIDGET_CLASS(sc)->event = _elm_list_smart_event;
- ELM_WIDGET_CLASS(sc)->translate = _elm_list_smart_translate;
- ELM_WIDGET_CLASS(sc)->access = _elm_list_smart_access;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_list_smart_sizing_eval;
-}
-
-EAPI const Elm_List_Smart_Class *
-elm_list_smart_class_get(void)
-{
- static Elm_List_Smart_Class _sc =
- ELM_LIST_SMART_CLASS_INIT_NAME_VERSION(ELM_LIST_SMART_NAME);
- static const Elm_List_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_list_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_list_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_list_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
elm_list_go(Evas_Object *obj)
{
ELM_LIST_CHECK(obj);
+ eo_do(obj, elm_obj_list_go());
+}
+static void
+_go(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
_items_fix(obj);
}
@@ -1766,7 +1768,14 @@ elm_list_multi_select_set(Evas_Object *obj,
Eina_Bool multi)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_list_multi_select_set(multi));
+}
+
+static void
+_multi_select_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool multi = va_arg(*list, int);
+ Elm_List_Smart_Data *sd = _pd;
sd->multi = multi;
}
@@ -1775,9 +1784,18 @@ EAPI Eina_Bool
elm_list_multi_select_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) EINA_FALSE;
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_list_multi_select_get(&ret));
+ return ret;
+}
+
+static void
+_multi_select_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_List_Smart_Data *sd = _pd;
- return sd->multi;
+ *ret = sd->multi;
}
EAPI void
@@ -1785,33 +1803,56 @@ elm_list_mode_set(Evas_Object *obj,
Elm_List_Mode mode)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_list_mode_set(mode));
+}
+
+static void
+_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_List_Mode mode = va_arg(*list, Elm_List_Mode);
+ Elm_List_Smart_Data *sd = _pd;
if (sd->mode == mode)
return;
sd->mode = mode;
- _elm_list_mode_set_internal(sd);
+ _elm_list_mode_set_internal(obj);
}
EAPI Elm_List_Mode
elm_list_mode_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) ELM_LIST_LAST;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_List_Mode ret = ELM_LIST_LAST;
+ eo_do((Eo *) obj, elm_obj_list_mode_get(&ret));
+ return ret;
+}
+
+static void
+_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_List_Mode *ret = va_arg(*list, Elm_List_Mode *);
+ Elm_List_Smart_Data *sd = _pd;
- return sd->mode;
+ *ret = sd->mode;
}
EAPI void
elm_list_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
+ ELM_LIST_CHECK(obj);
+ eo_do(obj, elm_obj_list_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
- ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_List_Smart_Data *sd = _pd;
horizontal = !!horizontal;
@@ -1825,25 +1866,34 @@ elm_list_horizontal_set(Evas_Object *obj,
{
evas_object_size_hint_weight_set(sd->box, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sd->box, 0.0, EVAS_HINT_FILL);
- sd->s_iface->bounce_allow_set(obj, bounce, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(bounce, EINA_FALSE));
}
else
{
evas_object_size_hint_weight_set(sd->box, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(sd->box, EVAS_HINT_FILL, 0.0);
- sd->s_iface->bounce_allow_set(obj, EINA_FALSE, bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(EINA_FALSE, bounce));
}
- _elm_list_mode_set_internal(sd);
+ _elm_list_mode_set_internal(obj);
}
EAPI Eina_Bool
elm_list_horizontal_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) EINA_FALSE;
- ELM_LIST_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_list_horizontal_get(&ret));
+ return ret;
+}
+
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_List_Smart_Data *sd = _pd;
- return sd->h_mode;
+ *ret = sd->h_mode;
}
EAPI void
@@ -1851,7 +1901,14 @@ elm_list_select_mode_set(Evas_Object *obj,
Elm_Object_Select_Mode mode)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_list_select_mode_set(mode));
+}
+
+static void
+_select_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode mode = va_arg(*list, Elm_Object_Select_Mode);
+ Elm_List_Smart_Data *sd = _pd;
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
return;
@@ -1864,9 +1921,18 @@ EAPI Elm_Object_Select_Mode
elm_list_select_mode_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) ELM_OBJECT_SELECT_MODE_MAX;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Select_Mode ret = ELM_OBJECT_SELECT_MODE_MAX;
+ eo_do((Eo *) obj, elm_obj_list_select_mode_get(&ret));
+ return ret;
+}
- return sd->select_mode;
+static void
+_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *);
+ Elm_List_Smart_Data *sd = _pd;
+
+ *ret = sd->select_mode;
}
EAPI void
@@ -1875,9 +1941,8 @@ elm_list_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_set(obj, h_bounce, v_bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
}
EAPI void
@@ -1886,9 +1951,8 @@ elm_list_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -1897,13 +1961,20 @@ elm_list_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_v)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ eo_do(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
+}
+
+static void
+_scroller_policy_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Scroller_Policy policy_h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy policy_v = va_arg(*list, Elm_Scroller_Policy);
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
return;
- sd->s_iface->policy_set(obj, policy_h, policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
}
EAPI void
@@ -1912,18 +1983,22 @@ elm_list_scroller_policy_get(const Evas_Object *obj,
Elm_Scroller_Policy *policy_v)
{
ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
-
- sd->s_iface->policy_get(obj, policy_h, policy_v);
+ eo_do((Eo *) obj, elm_scrollable_interface_policy_get(policy_h, policy_v));
}
EAPI void
elm_list_clear(Evas_Object *obj)
{
+ ELM_LIST_CHECK(obj);
+ eo_do(obj, elm_obj_list_clear());
+}
+
+static void
+_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_List_Item *it;
- ELM_LIST_CHECK(obj);
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_List_Smart_Data *sd = _pd;
if (!sd->items) return;
@@ -1954,7 +2029,7 @@ elm_list_clear(Evas_Object *obj)
elm_widget_item_free(it);
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
_items_fix(obj);
elm_layout_sizing_eval(obj);
@@ -1966,29 +2041,55 @@ EAPI const Eina_List *
elm_list_items_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_list_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_List_Smart_Data *sd = _pd;
+
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
elm_list_selected_item_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_list_selected_item_get(&ret));
+ return ret;
+}
- if (sd->selected) return (Elm_Object_Item *)sd->selected->data;
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
- return NULL;
+ if (sd->selected) *ret = (Elm_Object_Item *)sd->selected->data;
+ else *ret = NULL;
}
EAPI const Eina_List *
elm_list_selected_items_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_list_selected_items_get(&ret));
+ return ret;
+}
+
+static void
+_selected_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_List_Smart_Data *sd = _pd;
- return sd->selected;
+ *ret = sd->selected;
}
EAPI Elm_Object_Item *
@@ -1999,10 +2100,24 @@ elm_list_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_LIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_list_item_append(label, icon, end, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
Elm_List_Item *it;
- ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Object *end = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
it = _item_new(obj, label, icon, end, func, data);
@@ -2010,7 +2125,7 @@ elm_list_item_append(Evas_Object *obj,
it->node = eina_list_last(sd->items);
elm_box_pack_end(sd->box, VIEW(it));
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2021,10 +2136,24 @@ elm_list_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_LIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_list_item_prepend(label, icon, end, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj, void *_pd, va_list *list)
+{
Elm_List_Item *it;
- ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Object *end = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
it = _item_new(obj, label, icon, end, func, data);
@@ -2032,7 +2161,7 @@ elm_list_item_prepend(Evas_Object *obj,
it->node = sd->items;
elm_box_pack_start(sd->box, VIEW(it));
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2044,21 +2173,38 @@ elm_list_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_LIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_list_item_insert_before(before, label, icon, end, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj, void *_pd, va_list *list)
+{
Elm_List_Item *it, *before_it;
- ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_ITEM_CHECK_OR_RETURN(before, NULL);
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Item *before = va_arg(*list, Elm_Object_Item *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Object *end = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ ELM_LIST_ITEM_CHECK(before);
+ Elm_List_Smart_Data *sd = _pd;
before_it = (Elm_List_Item *)before;
- if (!before_it->node) return NULL;
+ if (!before_it->node) return;
it = _item_new(obj, label, icon, end, func, data);
sd->items = eina_list_prepend_relative_list(sd->items, it, before_it->node);
it->node = before_it->node->prev;
elm_box_pack_before(sd->box, VIEW(it), VIEW(before_it));
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2070,21 +2216,38 @@ elm_list_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_LIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_list_item_insert_after(after, label, icon, end, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj, void *_pd, va_list *list)
+{
Elm_List_Item *it, *after_it;
- ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_ITEM_CHECK_OR_RETURN(after, NULL);
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Item *after = va_arg(*list, Elm_Object_Item *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Object *end = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
+ ELM_LIST_ITEM_CHECK(after);
+ Elm_List_Smart_Data *sd = _pd;
after_it = (Elm_List_Item *)after;
- if (!after_it->node) return NULL;
+ if (!after_it->node) return;
it = _item_new(obj, label, icon, end, func, data);
sd->items = eina_list_append_relative_list(sd->items, it, after_it->node);
it->node = after_it->node->next;
elm_box_pack_after(sd->box, VIEW(it), VIEW(after_it));
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2096,11 +2259,26 @@ elm_list_item_sorted_insert(Evas_Object *obj,
const void *data,
Eina_Compare_Cb cmp_func)
{
+ ELM_LIST_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_list_item_sorted_insert(label, icon, end, func, data, cmp_func, &ret));
+ return ret;
+}
+
+static void
+_item_sorted_insert(Eo *obj, void *_pd, va_list *list)
+{
Eina_List *l;
Elm_List_Item *it;
- ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ const char *label = va_arg(*list, const char *);
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Evas_Object *end = va_arg(*list, Evas_Object *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Eina_Compare_Cb cmp_func = va_arg(*list, Eina_Compare_Cb);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
it = _item_new(obj, label, icon, end, func, data);
@@ -2120,7 +2298,7 @@ elm_list_item_sorted_insert(Evas_Object *obj,
elm_box_pack_before(sd->box, VIEW(it), VIEW(before));
}
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI void
@@ -2170,7 +2348,7 @@ elm_list_item_selected_set(Elm_Object_Item *it,
else
_item_unselect(item);
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
@@ -2197,7 +2375,7 @@ elm_list_item_show(Elm_Object_Item *it)
x -= bx;
y -= by;
- sd->s_iface->content_region_show(WIDGET(it), x, y, w, h);
+ eo_do(WIDGET(it), elm_scrollable_interface_content_region_show(x, y, w, h));
}
EAPI void
@@ -2215,7 +2393,7 @@ elm_list_item_bring_in(Elm_Object_Item *it)
x -= bx;
y -= by;
- sd->s_iface->region_bring_in(WIDGET(it), x, y, w, h);
+ eo_do(WIDGET(it), elm_scrollable_interface_region_bring_in(x, y, w, h));
}
EAPI Evas_Object *
@@ -2252,20 +2430,126 @@ EAPI Elm_Object_Item *
elm_list_first_item_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_list_first_item_get(&ret));
+ return ret;
+}
- if (!sd->items) return NULL;
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
- return eina_list_data_get(sd->items);
+ if (!sd->items) *ret = NULL;
+ else *ret = eina_list_data_get(sd->items);
}
EAPI Elm_Object_Item *
elm_list_last_item_get(const Evas_Object *obj)
{
ELM_LIST_CHECK(obj) NULL;
- ELM_LIST_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_list_last_item_get(&ret));
+ return ret;
+}
- if (!sd->items) return NULL;
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_List_Smart_Data *sd = _pd;
- return eina_list_data_get(eina_list_last(sd->items));
+ if (!sd->items) *ret = NULL;
+ else *ret = eina_list_data_get(eina_list_last(sd->items));
}
+
+static void
+_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_MEMBER_ADD), _elm_list_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_list_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_list_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_list_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_list_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_list_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_list_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_list_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_list_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_list_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_list_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_list_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_list_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_list_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_list_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_list_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _scroller_policy_set),
+
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_GO), _go),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET), _multi_select_set),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET), _multi_select_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_SET), _mode_set),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_GET), _mode_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_SET), _select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_GET), _select_mode_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEMS_GET), _selected_items_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_SORTED_INSERT), _item_sorted_insert),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_GO, "Starts the list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET, "Enable or disable multiple items selection on the list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET, "Get a value whether multiple items selection is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MODE_SET, "Set which mode to use for the list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_MODE_GET, "Get the mode the list is at."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET, "Enable or disable horizontal mode on the list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_GET, "Get a value whether horizontal mode is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_SET, "Set the list select mode"),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_GET, "Get the list select mode"),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_CLEAR, "Remove all list's items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEMS_GET, "Get a list of all the list items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEM_GET, "Get the selected item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEMS_GET, "Return a list of the currently selected list items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEM_APPEND, "Append a new item to the list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEM_PREPEND, "Prepend a new item to the list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_BEFORE, "Insert a new item into the list object before item before."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_AFTER, "Insert a new item into the list object after item after."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_ITEM_SORTED_INSERT, "Insert a new item into the sorted list object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_FIRST_ITEM_GET, "Get the first item in the list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_LIST_SUB_ID_LAST_ITEM_GET, "Get the last item in the list."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_LIST_BASE_ID, op_desc, ELM_OBJ_LIST_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_List_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_list_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_list.h b/src/lib/elm_list.h
index c42e50fd2..55501280a 100644
--- a/src/lib/elm_list.h
+++ b/src/lib/elm_list.h
@@ -78,6 +78,336 @@
* @{
*/
+#define ELM_OBJ_LIST_CLASS elm_obj_list_class_get()
+
+ const Eo_Class *elm_obj_list_class_get(void) EINA_CONST;
+
+ extern EAPI Eo_Op ELM_OBJ_LIST_BASE_ID;
+
+ enum
+{
+ ELM_OBJ_LIST_SUB_ID_GO,
+ ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET,
+ ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET,
+ ELM_OBJ_LIST_SUB_ID_MODE_SET,
+ ELM_OBJ_LIST_SUB_ID_MODE_GET,
+ ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_LIST_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_LIST_SUB_ID_SELECT_MODE_SET,
+ ELM_OBJ_LIST_SUB_ID_SELECT_MODE_GET,
+ ELM_OBJ_LIST_SUB_ID_CLEAR,
+ ELM_OBJ_LIST_SUB_ID_ITEMS_GET,
+ ELM_OBJ_LIST_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_LIST_SUB_ID_SELECTED_ITEMS_GET,
+ ELM_OBJ_LIST_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_LIST_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_LIST_SUB_ID_ITEM_SORTED_INSERT,
+ ELM_OBJ_LIST_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_LIST_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_LIST_SUB_ID_LAST
+};
+
+#define ELM_OBJ_LIST_ID(sub_id) (ELM_OBJ_LIST_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_list_go
+ * @since 1.8
+ *
+ * Starts the list.
+ *
+ *
+ * @see elm_list_go
+ */
+#define elm_obj_list_go() ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_GO)
+
+/**
+ * @def elm_obj_list_multi_select_set
+ * @since 1.8
+ *
+ * Enable or disable multiple items selection on the list object.
+ *
+ * @param[in] multi
+ *
+ * @see elm_list_multi_select_set
+ */
+#define elm_obj_list_multi_select_set(multi) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_SET), EO_TYPECHECK(Eina_Bool, multi)
+
+/**
+ * @def elm_obj_list_multi_select_get
+ * @since 1.8
+ *
+ * Get a value whether multiple items selection is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_multi_select_get
+ */
+#define elm_obj_list_multi_select_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MULTI_SELECT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_list_mode_set
+ * @since 1.8
+ *
+ * Set which mode to use for the list object.
+ *
+ * @param[in] mode
+ *
+ * @see elm_list_mode_set
+ */
+#define elm_obj_list_mode_set(mode) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_SET), EO_TYPECHECK(Elm_List_Mode, mode)
+
+/**
+ * @def elm_obj_list_mode_get
+ * @since 1.8
+ *
+ * Get the mode the list is at.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_mode_get
+ */
+#define elm_obj_list_mode_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_MODE_GET), EO_TYPECHECK(Elm_List_Mode *, ret)
+
+/**
+ * @def elm_obj_list_horizontal_set
+ * @since 1.8
+ *
+ * Enable or disable horizontal mode on the list object.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_list_horizontal_set
+ */
+#define elm_obj_list_horizontal_set(horizontal) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_list_horizontal_get
+ * @since 1.8
+ *
+ * Get a value whether horizontal mode is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_horizontal_get
+ */
+#define elm_obj_list_horizontal_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_list_select_mode_set(mode) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode)
+#define elm_obj_list_select_mode_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret)
+
+/**
+ * @def elm_obj_list_bounce_set
+ * @since 1.8
+ *
+ * Set bouncing behaviour when the scrolled content reaches an edge.
+ *
+ * @param[in] h_bounce
+ * @param[in] v_bounce
+ *
+ * @see elm_list_bounce_set
+ */
+#define elm_obj_list_bounce_set(h_bounce, v_bounce) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_BOUNCE_SET), EO_TYPECHECK(Eina_Bool, h_bounce), EO_TYPECHECK(Eina_Bool, v_bounce)
+
+/**
+ * @def elm_obj_list_bounce_get
+ * @since 1.8
+ *
+ * Get the bouncing behaviour of the internal scroller.
+ *
+ * @param[out] h_bounce
+ * @param[out] v_bounce
+ *
+ * @see elm_list_bounce_get
+ */
+#define elm_obj_list_bounce_get(h_bounce, v_bounce) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_BOUNCE_GET), EO_TYPECHECK(Eina_Bool *, h_bounce), EO_TYPECHECK(Eina_Bool *, v_bounce)
+
+/**
+ * @def elm_obj_list_scroller_policy_set
+ * @since 1.8
+ *
+ * Set the scrollbar policy.
+ *
+ * @param[in] policy_h
+ * @param[in] policy_v
+ *
+ * @see elm_list_scroller_policy_set
+ */
+#define elm_obj_list_scroller_policy_set(policy_h, policy_v) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SCROLLER_POLICY_SET), EO_TYPECHECK(Elm_Scroller_Policy, policy_h), EO_TYPECHECK(Elm_Scroller_Policy, policy_v)
+
+/**
+ * @def elm_obj_list_scroller_policy_get
+ * @since 1.8
+ *
+ * Get the scrollbar policy.
+ *
+ * @param[out] policy_h
+ * @param[out] policy_v
+ *
+ * @see elm_list_scroller_policy_get
+ */
+#define elm_obj_list_scroller_policy_get(policy_h, policy_v) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SCROLLER_POLICY_GET), EO_TYPECHECK(Elm_Scroller_Policy *, policy_h), EO_TYPECHECK(Elm_Scroller_Policy *, policy_v)
+
+/**
+ * @def elm_obj_list_clear
+ * @since 1.8
+ *
+ * Remove all list's items.
+ *
+ *
+ * @see elm_list_clear
+ */
+#define elm_obj_list_clear() ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_list_items_get
+ * @since 1.8
+ *
+ * Get a list of all the list items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_items_get
+ */
+#define elm_obj_list_items_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_list_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_selected_item_get
+ */
+#define elm_obj_list_selected_item_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_selected_items_get
+ * @since 1.8
+ *
+ * Return a list of the currently selected list items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_selected_items_get
+ */
+#define elm_obj_list_selected_items_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_SELECTED_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_list_item_append
+ * @since 1.8
+ *
+ * Append a new item to the list object.
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] end
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_list_item_append
+ */
+#define elm_obj_list_item_append(label, icon, end, func, data, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Object *, end), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_item_prepend
+ * @since 1.8
+ *
+ * Prepend a new item to the list object.
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] end
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_list_item_prepend
+ */
+#define elm_obj_list_item_prepend(label, icon, end, func, data, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Object *, end), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_item_insert_before
+ * @since 1.8
+ *
+ * Insert a new item into the list object before item before.
+ *
+ * @param[in] before
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] end
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_list_item_insert_before
+ */
+#define elm_obj_list_item_insert_before(before, label, icon, end, func, data, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Object *, end), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_item_insert_after
+ * @since 1.8
+ *
+ * Insert a new item into the list object after item after.
+ *
+ * @param[in] after
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] end
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_list_item_insert_after
+ */
+#define elm_obj_list_item_insert_after(after, label, icon, end, func, data, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Object *, end), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_item_sorted_insert
+ * @since 1.8
+ *
+ * Insert a new item into the sorted list object.
+ *
+ * @param[in] label
+ * @param[in] icon
+ * @param[in] end
+ * @param[in] func
+ * @param[in] data
+ * @param[in] cmp_func
+ * @param[out] ret
+ *
+ * @see elm_list_item_sorted_insert
+ */
+#define elm_obj_list_item_sorted_insert(label, icon, end, func, data, cmp_func, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Object *, end), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, cmp_func), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in the list
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_first_item_get
+ */
+#define elm_obj_list_first_item_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_list_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in the list
+ *
+ * @param[out] ret
+ *
+ * @see elm_list_last_item_get
+ */
+#define elm_obj_list_last_item_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
/**
* @enum Elm_List_Mode
* @typedef Elm_List_Mode
diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index 603683782..9b5b1bc86 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -1,9 +1,19 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_map.h"
+#include "elm_interface_scrollable.h"
-EAPI const char ELM_MAP_SMART_NAME[] = "elm_map";
-EAPI const char ELM_MAP_PAN_SMART_NAME[] = "elm_map_pan";
+EAPI Eo_Op ELM_OBJ_MAP_PAN_BASE_ID = EO_NOOP;
+
+#define MY_PAN_CLASS ELM_OBJ_MAP_PAN_CLASS
+
+#define MY_PAN_CLASS_NAME "elm_map_pan"
+
+EAPI Eo_Op ELM_OBJ_MAP_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_MAP_CLASS
+
+#define MY_CLASS_NAME "elm_map"
#define OVERLAY_CLASS_ZOOM_MAX 255
#define MAX_CONCURRENT_DOWNLOAD 10
@@ -320,20 +330,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_MAP_SMART_NAME, _elm_map, Elm_Map_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (ELM_MAP_PAN_SMART_NAME, _elm_map_pan, Elm_Map_Pan_Smart_Class,
- Elm_Pan_Smart_Class, elm_pan_smart_class_get, NULL);
-
static void
_edj_overlay_size_get(Elm_Map_Smart_Data *sd,
Evas_Coord *w,
@@ -345,10 +341,10 @@ _edj_overlay_size_get(Elm_Map_Smart_Data *sd,
EINA_SAFETY_ON_NULL_RETURN(w);
EINA_SAFETY_ON_NULL_RETURN(h);
- edj = edje_object_add(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ edj = edje_object_add(evas_object_evas_get(sd->obj));
elm_widget_theme_object_set
- (ELM_WIDGET_DATA(sd)->obj, edj, "map/marker", "radio",
- elm_widget_style_get(ELM_WIDGET_DATA(sd)->obj));
+ (sd->obj, edj, "map/marker", "radio",
+ elm_widget_style_get(sd->obj));
s = edje_object_data_get(edj, "size_w");
if (s) *w = atoi(s);
@@ -429,7 +425,7 @@ _coord_to_region_convert(Elm_Map_Smart_Data *sd,
if ((sd->src_tile) && (sd->src_tile->coord_to_geo))
{
if (sd->src_tile->coord_to_geo
- (ELM_WIDGET_DATA(sd)->obj, zoom, x, y, size, lon, lat))
+ (sd->obj, zoom, x, y, size, lon, lat))
return;
}
@@ -457,7 +453,7 @@ _region_to_coord_convert(Elm_Map_Smart_Data *sd,
if ((sd->src_tile) && (sd->src_tile->geo_to_coord))
{
if (sd->src_tile->geo_to_coord
- (ELM_WIDGET_DATA(sd)->obj, zoom, lon, lat, size, x, y)) return;
+ (sd->obj, zoom, lon, lat, size, x, y)) return;
}
if (x) *x = floor((lon + 180.0) / 360.0 * size);
@@ -478,8 +474,8 @@ _viewport_coord_get(Elm_Map_Smart_Data *sd,
EINA_SAFETY_ON_NULL_RETURN(sd);
- sd->s_iface->content_pos_get(ELM_WIDGET_DATA(sd)->obj, &x, &y);
- sd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(sd)->obj, &w, &h);
+ eo_do(sd->obj, elm_scrollable_interface_content_pos_get(&x, &y));
+ eo_do(sd->obj, elm_scrollable_interface_content_viewport_size_get(&w, &h));
if (w > sd->size.w) x -= ((w - sd->size.w) / 2);
if (h > sd->size.h) y -= ((h - sd->size.h) / 2);
@@ -576,7 +572,7 @@ _loaded_timeout_cb(void *data)
sd->loaded_timer = NULL;
if (!(sd->download_num) && !(sd->download_idler))
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_LOADED, NULL);
+ (sd->obj, SIG_LOADED, NULL);
return ECORE_CALLBACK_CANCEL;
}
@@ -669,7 +665,7 @@ _grid_item_create(Grid *g,
gi->job = NULL;
gi->img = evas_object_image_add
- (evas_object_evas_get(ELM_WIDGET_DATA(g->wsd)->obj));
+ (evas_object_evas_get((g->wsd)->obj));
evas_object_image_smooth_scale_set(gi->img, EINA_FALSE);
evas_object_image_scale_hint_set(gi->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
evas_object_image_filled_set(gi->img, EINA_TRUE);
@@ -695,7 +691,7 @@ _grid_item_create(Grid *g,
if (!ecore_file_exists(buf)) ecore_file_mkpath(buf);
eina_stringshare_replace(&gi->file, buf2);
- url = g->wsd->src_tile->url_cb(ELM_WIDGET_DATA(g->wsd)->obj, x, y, g->zoom);
+ url = g->wsd->src_tile->url_cb((g->wsd)->obj, x, y, g->zoom);
if ((!url) || (!strlen(url)))
{
eina_stringshare_replace(&gi->url, NULL);
@@ -739,7 +735,7 @@ _downloaded_cb(void *data,
_grid_item_update(gi);
gi->wsd->finish_num++;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(gi->wsd)->obj, SIG_TILE_LOADED, NULL);
+ ((gi->wsd)->obj, SIG_TILE_LOADED, NULL);
}
else
{
@@ -748,13 +744,14 @@ _downloaded_cb(void *data,
ecore_file_remove(gi->file);
gi->file_have = EINA_FALSE;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(gi->wsd)->obj, SIG_TILE_LOADED_FAIL, NULL);
+ ((gi->wsd)->obj, SIG_TILE_LOADED_FAIL, NULL);
}
+ Elm_Widget_Smart_Data *wwd = eo_data_get(gi->wsd->obj, ELM_OBJ_WIDGET_CLASS);
gi->job = NULL;
gi->wsd->download_num--;
if (!gi->wsd->download_num)
- edje_object_signal_emit(ELM_WIDGET_DATA(gi->wsd)->resize_obj,
+ edje_object_signal_emit(wwd->resize_obj,
"elm,state,busy,stop", "elm");
}
@@ -765,6 +762,8 @@ _download_job(void *data)
Eina_List *l, *ll;
Grid_Item *gi;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+
if (!eina_list_count(sd->download_list))
{
sd->download_idler = NULL;
@@ -794,9 +793,9 @@ _download_job(void *data)
sd->try_num++;
sd->download_num++;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_TILE_LOAD, NULL);
+ (sd->obj, SIG_TILE_LOAD, NULL);
if (sd->download_num == 1)
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
}
}
@@ -1052,7 +1051,7 @@ _zoom_timeout_cb(void *data)
_smooth_update(sd);
sd->zoom_timer = NULL;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ZOOM_STOP, NULL);
+ (sd->obj, SIG_ZOOM_STOP, NULL);
return ECORE_CALLBACK_CANCEL;
}
@@ -1103,18 +1102,18 @@ _zoom_do(Elm_Map_Smart_Data *sd,
if (y < 0) y = 0;
else if (y > (sd->size.h - vh))
y = sd->size.h - vh;
- sd->s_iface->content_region_show
- (ELM_WIDGET_DATA(sd)->obj, x, y, vw, vh);
+ eo_do(sd->obj, elm_scrollable_interface_content_region_show
+ (x, y, vw, vh));
}
if (sd->zoom_timer) ecore_timer_del(sd->zoom_timer);
else
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ZOOM_START, NULL);
+ (sd->obj, SIG_ZOOM_START, NULL);
sd->zoom_timer = ecore_timer_add(0.25, _zoom_timeout_cb, sd);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ZOOM_CHANGE, NULL);
+ (sd->obj, SIG_ZOOM_CHANGE, NULL);
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
evas_object_smart_changed(sd->pan_obj);
@@ -1161,8 +1160,8 @@ _sizing_eval(Elm_Map_Smart_Data *sd)
{
Evas_Coord maxw = -1, maxh = -1;
- evas_object_size_hint_max_get(ELM_WIDGET_DATA(sd)->obj, &maxw, &maxh);
- evas_object_size_hint_max_set(ELM_WIDGET_DATA(sd)->obj, maxw, maxh);
+ evas_object_size_hint_max_get(sd->obj, &maxw, &maxh);
+ evas_object_size_hint_max_set(sd->obj, maxw, maxh);
}
static void
@@ -1182,7 +1181,7 @@ _scr_timeout_cb(void *data)
_smooth_update(sd);
sd->scr_timer = NULL;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL_DRAG_STOP, NULL);
+ (sd->obj, SIG_SCROLL_DRAG_STOP, NULL);
return ECORE_CALLBACK_CANCEL;
}
@@ -1196,9 +1195,9 @@ _scroll_cb(Evas_Object *obj,
if (sd->scr_timer) ecore_timer_del(sd->scr_timer);
else
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL_DRAG_START, NULL);
+ (sd->obj, SIG_SCROLL_DRAG_START, NULL);
sd->scr_timer = ecore_timer_add(0.25, _scr_timeout_cb, sd);
- evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL, NULL);
+ evas_object_smart_callback_call(sd->obj, SIG_SCROLL, NULL);
}
static void
@@ -1208,7 +1207,7 @@ _scroll_animate_start_cb(Evas_Object *obj,
ELM_MAP_DATA_GET(obj, sd);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL_ANIM_START, NULL);
+ (sd->obj, SIG_SCROLL_ANIM_START, NULL);
}
static void
@@ -1218,7 +1217,7 @@ _scroll_animate_stop_cb(Evas_Object *obj,
ELM_MAP_DATA_GET(obj, sd);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_SCROLL_ANIM_STOP, NULL);
+ (sd->obj, SIG_SCROLL_ANIM_STOP, NULL);
}
static Eina_Bool
@@ -1228,7 +1227,7 @@ _long_press_cb(void *data)
sd->long_timer = NULL;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_LONGPRESSED, &sd->ev);
+ (sd->obj, SIG_LONGPRESSED, &sd->ev);
return ECORE_CALLBACK_CANCEL;
}
@@ -1248,10 +1247,10 @@ _mouse_down_cb(void *data,
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_CLICKED_DOUBLE, ev);
+ (sd->obj, SIG_CLICKED_DOUBLE, ev);
else
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_PRESS, ev);
+ (sd->obj, SIG_PRESS, ev);
if (sd->long_timer) ecore_timer_del(sd->long_timer);
sd->ev = *ev;
@@ -1283,7 +1282,7 @@ _mouse_up_cb(void *data,
if (!sd->on_hold)
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_CLICKED, ev);
+ (sd->obj, SIG_CLICKED, ev);
sd->on_hold = EINA_FALSE;
}
@@ -1395,9 +1394,9 @@ _overlay_clicked_cb(void *data,
EINA_SAFETY_ON_NULL_RETURN(data);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(overlay->wsd)->obj, SIG_OVERLAY_CLICKED, overlay);
+ ((overlay->wsd)->obj, SIG_OVERLAY_CLICKED, overlay);
if (overlay->cb)
- overlay->cb(overlay->cb_data, ELM_WIDGET_DATA(overlay->wsd)->obj, overlay);
+ overlay->cb(overlay->cb_data, (overlay->wsd)->obj, overlay);
}
static void
@@ -1518,7 +1517,7 @@ _overlay_default_layout_update(Overlay_Default *ovl)
evas_object_color_set(ovl->layout, 255, 255, 255, 255);
elm_layout_theme_set
(ovl->layout, "map/marker", "empty",
- elm_widget_style_get(ELM_WIDGET_DATA(ovl->wsd)->obj));
+ elm_widget_style_get((ovl->wsd)->obj));
elm_object_part_content_set(ovl->layout, "elm.icon", ovl->icon);
}
else if (!ovl->icon && ovl->clas_icon)
@@ -1526,7 +1525,7 @@ _overlay_default_layout_update(Overlay_Default *ovl)
evas_object_color_set(ovl->layout, 255, 255, 255, 255);
elm_layout_theme_set
(ovl->layout, "map/marker", "empty",
- elm_widget_style_get(ELM_WIDGET_DATA(ovl->wsd)->obj));
+ elm_widget_style_get((ovl->wsd)->obj));
elm_object_part_content_set(ovl->layout, "elm.icon", ovl->clas_icon);
}
else
@@ -1535,7 +1534,7 @@ _overlay_default_layout_update(Overlay_Default *ovl)
(ovl->layout, ovl->c.r, ovl->c.g, ovl->c.b, ovl->c.a);
elm_layout_theme_set
(ovl->layout, "map/marker", "radio",
- elm_widget_style_get(ELM_WIDGET_DATA(ovl->wsd)->obj));
+ elm_widget_style_get((ovl->wsd)->obj));
}
}
@@ -1614,11 +1613,11 @@ _overlay_default_new(Elm_Map_Overlay *overlay,
_edj_overlay_size_get(ovl->wsd, &(ovl->w), &(ovl->h));
ovl->w *= scale;
ovl->h *= scale;
- ovl->layout = elm_layout_add(ELM_WIDGET_DATA(ovl->wsd)->obj);
+ ovl->layout = elm_layout_add((ovl->wsd)->obj);
evas_object_smart_member_add(ovl->layout, ovl->wsd->pan_obj);
evas_object_stack_above(ovl->layout, ovl->wsd->sep_maps_overlays);
elm_layout_theme_set(ovl->layout, "map/marker", "radio",
- elm_widget_style_get(ELM_WIDGET_DATA(ovl->wsd)->obj));
+ elm_widget_style_get((ovl->wsd)->obj));
evas_object_event_callback_add(ovl->layout, EVAS_CALLBACK_MOUSE_DOWN,
_overlay_clicked_cb, overlay);
ovl->lon = lon;
@@ -1675,7 +1674,7 @@ _overlay_group_icon_update(Overlay_Group *grp,
if (grp->ovl)
_overlay_default_icon_update
- (grp->ovl, _icon_dup(icon, ELM_WIDGET_DATA(grp->wsd)->obj));
+ (grp->ovl, _icon_dup(icon, (grp->wsd)->obj));
}
static void
@@ -1686,7 +1685,7 @@ _overlay_group_content_update(Overlay_Group *grp,
EINA_SAFETY_ON_NULL_RETURN(grp);
_overlay_default_content_update
- (grp->ovl, _icon_dup(content, ELM_WIDGET_DATA(grp->wsd)->obj), overlay);
+ (grp->ovl, _icon_dup(content, grp->wsd->obj), overlay);
return;
}
@@ -1961,10 +1960,10 @@ _overlay_bubble_new(Elm_Map_Overlay *overlay)
bubble->wsd = overlay->wsd;
bubble->obj =
- edje_object_add(evas_object_evas_get(ELM_WIDGET_DATA(overlay->wsd)->obj));
+ edje_object_add(evas_object_evas_get((overlay->wsd)->obj));
elm_widget_theme_object_set
- (ELM_WIDGET_DATA(overlay->wsd)->obj, bubble->obj, "map", "marker_bubble",
- elm_widget_style_get(ELM_WIDGET_DATA(overlay->wsd)->obj));
+ ((overlay->wsd)->obj, bubble->obj, "map", "marker_bubble",
+ elm_widget_style_get((overlay->wsd)->obj));
evas_object_event_callback_add(bubble->obj, EVAS_CALLBACK_MOUSE_DOWN,
_overlay_clicked_cb, overlay);
@@ -2086,7 +2085,7 @@ _overlay_route_new(Elm_Map_Smart_Data *sd,
ovl = ELM_NEW(Overlay_Route);
ovl->wsd = sd;
ovl->obj =
- evas_object_polygon_add(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_object_polygon_add(evas_object_evas_get(sd->obj));
evas_object_smart_member_add(ovl->obj, sd->pan_obj);
_overlay_route_color_update(ovl, c);
@@ -2166,7 +2165,7 @@ _overlay_line_new(Elm_Map_Smart_Data *sd,
ovl->tlon = tlon;
ovl->tlat = tlat;
ovl->obj =
- evas_object_line_add(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_object_line_add(evas_object_evas_get(sd->obj));
evas_object_smart_member_add(ovl->obj, sd->pan_obj);
_overlay_line_color_update(ovl, c);
@@ -2236,7 +2235,7 @@ _overlay_polygon_new(Elm_Map_Smart_Data *sd, Color c)
ovl = ELM_NEW(Overlay_Polygon);
ovl->wsd = sd;
ovl->obj =
- evas_object_polygon_add(evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj));
+ evas_object_polygon_add(evas_object_evas_get(sd->obj));
evas_object_smart_member_add(ovl->obj, sd->pan_obj);
_overlay_polygon_color_update(ovl, c);
@@ -2305,11 +2304,11 @@ _overlay_circle_new(Elm_Map_Smart_Data *sd,
ovl->radius = radius;
ovl->ratio = radius / sd->size.w;
- ovl->obj = elm_layout_add(ELM_WIDGET_DATA(sd)->obj);
+ ovl->obj = elm_layout_add(sd->obj);
evas_object_smart_member_add(ovl->obj, sd->pan_obj);
evas_object_stack_above(ovl->obj, sd->sep_maps_overlays);
elm_layout_theme_set(ovl->obj, "map/circle", "base",
- elm_widget_style_get(ELM_WIDGET_DATA(sd)->obj));
+ elm_widget_style_get(sd->obj));
_overlay_circle_color_update(ovl, c);
return ovl;
@@ -2352,9 +2351,9 @@ _overlay_scale_show(Overlay_Scale *ovl)
return;
}
- elm_map_region_get(ELM_WIDGET_DATA(sd)->obj, &lon, &lat);
+ elm_map_region_get(sd->obj, &lon, &lat);
meter =
- sd->src_tile->scale_cb(ELM_WIDGET_DATA(sd)->obj, lon, lat, sd->zoom);
+ sd->src_tile->scale_cb(sd->obj, lon, lat, sd->zoom);
w = (_scale_tb[sd->zoom] / meter) * (sd->zoom_detail - sd->zoom + 1);
@@ -2389,11 +2388,11 @@ _overlay_scale_new(Elm_Map_Smart_Data *sd,
ovl->x = x;
ovl->y = y;
- ovl->obj = elm_layout_add(ELM_WIDGET_DATA(sd)->obj);
+ ovl->obj = elm_layout_add(sd->obj);
evas_object_smart_member_add(ovl->obj, sd->pan_obj);
evas_object_stack_above(ovl->obj, sd->sep_maps_overlays);
elm_layout_theme_set(ovl->obj, "map/scale", "base",
- elm_widget_style_get(ELM_WIDGET_DATA(sd)->obj));
+ elm_widget_style_get(sd->obj));
s = edje_object_data_get(elm_layout_edje_get(ovl->obj), "size_w");
if (s) ovl->w = atoi(s);
@@ -2960,6 +2959,7 @@ _route_cb(void *data,
route = data;
sd = route->wsd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
route->job = NULL;
if (status == 200)
@@ -2967,19 +2967,19 @@ _route_cb(void *data,
_kml_parse(route);
INF("Route request success from (%lf, %lf) to (%lf, %lf)",
route->flon, route->flat, route->tlon, route->tlat);
- if (route->cb) route->cb(route->data, ELM_WIDGET_DATA(sd)->obj, route);
+ if (route->cb) route->cb(route->data, sd->obj, route);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ROUTE_LOADED, NULL);
+ (sd->obj, SIG_ROUTE_LOADED, NULL);
}
else
{
ERR("Route request failed: %d", status);
- if (route->cb) route->cb(route->data, ELM_WIDGET_DATA(sd)->obj, NULL);
+ if (route->cb) route->cb(route->data, sd->obj, NULL);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ROUTE_LOADED_FAIL, NULL);
+ (sd->obj, SIG_ROUTE_LOADED_FAIL, NULL);
}
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,stop", "elm");
}
@@ -2996,6 +2996,7 @@ _name_cb(void *data,
name = data;
sd = name->wsd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
name->job = NULL;
if (status == 200)
@@ -3003,18 +3004,18 @@ _name_cb(void *data,
_name_parse(name);
INF("Name request success address:%s, lon:%lf, lat:%lf",
name->address, name->lon, name->lat);
- if (name->cb) name->cb(name->data, ELM_WIDGET_DATA(sd)->obj, name);
+ if (name->cb) name->cb(name->data, sd->obj, name);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED, NULL);
+ (sd->obj, SIG_NAME_LOADED, NULL);
}
else
{
ERR("Name request failed: %d", status);
- if (name->cb) name->cb(name->data, ELM_WIDGET_DATA(sd)->obj, NULL);
+ if (name->cb) name->cb(name->data, sd->obj, NULL);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED_FAIL, NULL);
+ (sd->obj, SIG_NAME_LOADED_FAIL, NULL);
}
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,stop", "elm");
}
@@ -3031,6 +3032,7 @@ _name_list_cb(void *data,
name_list = data;
sd = name_list->wsd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
name_list->job = NULL;
if (status == 200)
@@ -3038,20 +3040,21 @@ _name_list_cb(void *data,
_name_list_parse(name_list);
INF("Name List request success address");
if (name_list->cb)
- name_list->cb(name_list->data, ELM_WIDGET_DATA(sd)->obj,
+ name_list->cb(name_list->data, wd->obj,
name_list->names);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED, NULL);
+ (wd->obj, SIG_NAME_LOADED, NULL);
}
else
{
ERR("Name List request failed: %d", status);
if (name_list->cb)
- name_list->cb(name_list->data, ELM_WIDGET_DATA(sd)->obj, NULL);
+ name_list->cb(name_list->data, wd->obj, NULL);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOADED_FAIL, NULL);
+ (wd->obj, SIG_NAME_LOADED_FAIL, NULL);
}
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,stop", "elm");
free(name_list->fname);
free(name_list);
@@ -3095,10 +3098,11 @@ _name_request(const Evas_Object *obj,
ELM_MAP_DATA_GET(obj, sd);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_name, NULL);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
fname = _prepare_download();
url = sd->src_name->url_cb
- (ELM_WIDGET_DATA(sd)->obj, method, address, lon, lat);
+ (sd->obj, method, address, lon, lat);
if (!url)
{
ERR("Name URL is NULL");
@@ -3136,8 +3140,8 @@ _name_request(const Evas_Object *obj,
sd->names = eina_list_append(sd->names, name);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOAD, name);
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ (sd->obj, SIG_NAME_LOAD, name);
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
return name;
}
@@ -3158,10 +3162,11 @@ _name_list_request(const Evas_Object *obj,
ELM_MAP_DATA_GET(obj, sd);
EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_name, NULL);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
fname = _prepare_download();
url = sd->src_name->url_cb
- (ELM_WIDGET_DATA(sd)->obj, method, address, lon, lat);
+ (wd->obj, method, address, lon, lat);
if (!url)
{
ERR("Name URL is NULL");
@@ -3189,8 +3194,8 @@ _name_list_request(const Evas_Object *obj,
free(fname);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_NAME_LOAD, name_list->names);
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->obj, SIG_NAME_LOAD, name_list->names);
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
return name_list->names;
}
@@ -3240,7 +3245,7 @@ _pinch_rotate_cb(void *data,
int x, y, w, h;
Elm_Gesture_Rotate_Info *ei = event_info;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, &x, &y, &w, &h);
+ evas_object_geometry_get(sd->obj, &x, &y, &w, &h);
sd->rotate.d = sd->rotate.a + ei->angle - ei->base_angle;
sd->rotate.cx = x + ((double)w * 0.5);
@@ -3625,8 +3630,8 @@ _region_show_bring_in(Elm_Map_Smart_Data *wsd, double lon, double lat, Eina_Bool
x = x - (w / 2);
y = y - (h / 2);
- if (bring_in) wsd->s_iface->region_bring_in(ELM_WIDGET_DATA(wsd)->obj, x, y, w, h);
- else wsd->s_iface->content_region_show(ELM_WIDGET_DATA(wsd)->obj, x, y, w, h);
+ if (bring_in) eo_do(wsd->obj, elm_scrollable_interface_region_bring_in(x, y, w, h));
+ else eo_do(wsd->obj, elm_scrollable_interface_content_region_show(x, y, w, h));
}
static void
@@ -3667,11 +3672,11 @@ _overlays_show(Elm_Map_Smart_Data *sd, Eina_List *overlays)
}
static void
-_elm_map_pan_smart_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_map_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
@@ -3682,24 +3687,24 @@ _elm_map_pan_smart_pos_set(Evas_Object *obj,
}
static void
-_elm_map_pan_smart_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_map_pan_smart_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
static void
-_elm_map_pan_smart_pos_max_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_map_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
ow = psd->wsd->size.w - ow;
@@ -3712,52 +3717,44 @@ _elm_map_pan_smart_pos_max_get(const Evas_Object *obj,
}
static void
-_elm_map_pan_smart_pos_min_get(const Evas_Object *obj __UNUSED__,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_map_pan_smart_pos_min_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = 0;
if (y) *y = 0;
}
static void
-_elm_map_pan_smart_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_map_pan_smart_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
if (w) *w = psd->wsd->size.w;
if (h) *h = psd->wsd->size.h;
}
static void
-_elm_map_pan_smart_add(Evas_Object *obj)
+_elm_map_pan_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- /* here just to allocate our extended data */
- EVAS_SMART_DATA_ALLOC(obj, Elm_Map_Pan_Smart_Data);
+ va_arg(*list, Evas_Coord);
+ va_arg(*list, Evas_Coord);
- ELM_PAN_CLASS(_elm_map_pan_parent_sc)->base.add(obj);
-}
-
-static void
-_elm_map_pan_smart_resize(Evas_Object *obj,
- Evas_Coord w __UNUSED__,
- Evas_Coord h __UNUSED__)
-{
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
_sizing_eval(psd->wsd);
- elm_map_zoom_mode_set(ELM_WIDGET_DATA(psd->wsd)->obj, psd->wsd->mode);
+ elm_map_zoom_mode_set(psd->wobj, psd->wsd->mode);
evas_object_smart_changed(obj);
}
static void
-_elm_map_pan_smart_calculate(Evas_Object *obj)
+_elm_map_pan_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord w, h;
- ELM_MAP_PAN_DATA_GET(obj, psd);
+ Elm_Map_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (w <= 0 || h <= 0) return;
@@ -3769,87 +3766,108 @@ _elm_map_pan_smart_calculate(Evas_Object *obj)
}
static void
-_elm_map_pan_smart_move(Evas_Object *obj,
- Evas_Coord x __UNUSED__,
- Evas_Coord y __UNUSED__)
+_elm_map_pan_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- EINA_SAFETY_ON_NULL_RETURN(obj);
-
+ va_arg(*list, Evas_Coord);
+ va_arg(*list, Evas_Coord);
evas_object_smart_changed(obj);
}
static void
-_elm_map_pan_smart_set_user(Elm_Map_Pan_Smart_Class *sc)
-{
- ELM_PAN_CLASS(sc)->base.add = _elm_map_pan_smart_add;
- ELM_PAN_CLASS(sc)->base.move = _elm_map_pan_smart_move;
- ELM_PAN_CLASS(sc)->base.resize = _elm_map_pan_smart_resize;
- ELM_PAN_CLASS(sc)->base.calculate = _elm_map_pan_smart_calculate;
-
- ELM_PAN_CLASS(sc)->pos_set = _elm_map_pan_smart_pos_set;
- ELM_PAN_CLASS(sc)->pos_get = _elm_map_pan_smart_pos_get;
- ELM_PAN_CLASS(sc)->pos_max_get = _elm_map_pan_smart_pos_max_get;
- ELM_PAN_CLASS(sc)->pos_min_get = _elm_map_pan_smart_pos_min_get;
- ELM_PAN_CLASS(sc)->content_size_get =
- _elm_map_pan_smart_content_size_get;
-}
-
-
-static Eina_Bool
-_elm_map_smart_on_focus(Evas_Object *obj)
+_elm_map_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_MAP_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,focus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ (wd->resize_obj, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,unfocus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ (wd->resize_obj, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_map_smart_theme(Evas_Object *obj)
+static void
+_elm_map_pan_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_map_pan_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_map_pan_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_map_pan_smart_calculate),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_map_pan_smart_pos_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_map_pan_smart_pos_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_map_pan_smart_pos_max_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_map_pan_smart_pos_min_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_map_pan_smart_content_size_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Class_Description _elm_map_pan_class_desc = {
+ EO_VERSION,
+ MY_PAN_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ sizeof(Elm_Map_Pan_Smart_Data),
+ _elm_map_pan_class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_map_pan_class_get, &_elm_map_pan_class_desc, ELM_OBJ_PAN_CLASS, NULL);
+
+static void
+_elm_map_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAP_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Map_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_map_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_sizing_eval(sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_map_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_map_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Coord vh;
Evas_Coord x, y;
Evas_Event_Key_Down *ev = event_info;
Evas_Coord step_x, step_y, page_x, page_y;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, NULL, &vh);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(NULL, &vh));
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -3890,36 +3908,39 @@ _elm_map_smart_event(Evas_Object *obj,
else if (!strcmp(ev->keyname, "KP_Add"))
{
_zoom_with_animation(sd, sd->zoom + 1, 10);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if (!strcmp(ev->keyname, "KP_Subtract"))
{
_zoom_with_animation(sd, sd->zoom - 1, 10);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_map_smart_add(Evas_Object *obj)
+_elm_map_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw, minh;
Elm_Map_Pan_Smart_Data *pan_data;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Map_Smart_Data);
+ Elm_Map_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_map_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, "map", "base",
+ (obj, wd->resize_obj, "map", "base",
elm_widget_style_get(obj));
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
@@ -3940,31 +3961,29 @@ _elm_map_smart_add(Evas_Object *obj)
evas_object_event_callback_add
(obj, EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel_cb, priv);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
-
- priv->s_iface->wheel_disabled_set(obj, EINA_TRUE);
- priv->s_iface->bounce_allow_set(obj, _elm_config->thumbscroll_bounce_enable,
- _elm_config->thumbscroll_bounce_enable);
+ eo_do(obj,
+ elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect),
+ elm_scrollable_interface_wheel_disabled_set(EINA_TRUE),
+ elm_scrollable_interface_bounce_allow_set(
+ _elm_config->thumbscroll_bounce_enable,
+ _elm_config->thumbscroll_bounce_enable));
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints_cb, priv);
- priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
- priv->s_iface->scroll_cb_set(obj, _scroll_cb);
+ eo_do(obj,
+ elm_scrollable_interface_animate_start_cb_set(_scroll_animate_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_animate_stop_cb),
+ elm_scrollable_interface_scroll_cb_set(_scroll_cb));
- priv->pan_obj = evas_object_smart_add
- (evas_object_evas_get(obj), _elm_map_pan_smart_class_new());
- pan_data = evas_object_smart_data_get(priv->pan_obj);
+ priv->pan_obj = eo_add(MY_PAN_CLASS, evas_object_evas_get(obj));
+ pan_data = eo_data_get(priv->pan_obj, MY_PAN_CLASS);
+ pan_data->wobj = obj;
pan_data->wsd = priv;
- priv->s_iface->extern_pan_set(obj, priv->pan_obj);
+ eo_do(obj, elm_scrollable_interface_extern_pan_set(priv->pan_obj));
- edje_object_size_min_calc(ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
priv->g_layer = elm_gesture_layer_add(obj);
@@ -4016,7 +4035,7 @@ _elm_map_smart_add(Evas_Object *obj)
}
static void
-_elm_map_smart_del(Evas_Object *obj)
+_elm_map_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Map_Route *r;
Elm_Map_Name *na;
@@ -4024,7 +4043,7 @@ _elm_map_smart_del(Evas_Object *obj)
Evas_Object *track;
Elm_Map_Overlay *overlay;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
EINA_LIST_FOREACH_SAFE(sd->routes, l, ll, r)
elm_map_route_del(r);
@@ -4085,99 +4104,81 @@ _elm_map_smart_del(Evas_Object *obj)
}
if (sd->map) evas_map_free(sd->map);
- ELM_WIDGET_CLASS(_elm_map_parent_sc)->base.del(obj);
+ eo_unref(sd->pan_obj);
+ evas_object_del(sd->pan_obj);
+ sd->pan_obj = NULL;
+
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_map_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_map_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAP_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Map_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_map_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_map_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_map_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAP_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Map_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_map_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_map_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_map_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAP_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Map_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_map_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
-
-static void
-_elm_map_smart_set_user(Elm_Map_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_map_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_map_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_map_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_map_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_map_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_map_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_map_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_map_smart_event;
-}
#endif
-EAPI const Elm_Map_Smart_Class *
-elm_map_smart_class_get(void)
+EAPI Evas_Object *
+elm_map_add(Evas_Object *parent)
{
#ifdef HAVE_ELEMENTARY_ECORE_CON
- static Elm_Map_Smart_Class _sc =
- ELM_MAP_SMART_CLASS_INIT_NAME_VERSION(ELM_MAP_SMART_NAME);
- static const Elm_Map_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_map_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
#else
+ (void)parent;
return NULL;
#endif
}
-EAPI Evas_Object *
-elm_map_add(Evas_Object *parent)
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
#ifdef HAVE_ELEMENTARY_ECORE_CON
- Evas_Object *obj;
+ Elm_Map_Smart_Data *sd = _pd;
+ sd->obj = obj;
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_map_smart_class_new(), parent);
- if (!obj) return NULL;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
#else
- (void)parent;
- return NULL;
+ eo_error_set(obj);
#endif
}
@@ -4185,10 +4186,17 @@ EAPI void
elm_map_zoom_set(Evas_Object *obj,
int zoom)
{
+ eo_do(obj, elm_obj_map_zoom_set(zoom));
+}
+
+static void
+_zoom_set(Eo *obj, void *_pd, va_list *list)
+{
+ int zoom = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
if (sd->mode != ELM_MAP_ZOOM_MODE_MANUAL) return;
@@ -4201,6 +4209,7 @@ elm_map_zoom_set(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)zoom;
#endif
}
@@ -4208,14 +4217,24 @@ elm_map_zoom_set(Evas_Object *obj,
EAPI int
elm_map_zoom_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) 0;
- ELM_MAP_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_map_zoom_get(&ret));
+ return ret;
+}
- return sd->zoom;
+static void
+_zoom_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+
+ *ret = sd->zoom;
#else
(void)obj;
- return 0;
+ (void)_pd;
+ *ret = 0;
#endif
}
@@ -4223,9 +4242,16 @@ EAPI void
elm_map_zoom_mode_set(Evas_Object *obj,
Elm_Map_Zoom_Mode mode)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_zoom_mode_set(mode));
+}
+
+static void
+_zoom_mode_set_eo(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Zoom_Mode mode = va_arg(*list, Elm_Map_Zoom_Mode);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
if ((mode == ELM_MAP_ZOOM_MODE_MANUAL) && (sd->mode == !!mode)) return;
@@ -4236,6 +4262,7 @@ elm_map_zoom_mode_set(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)mode;
#endif
}
@@ -4243,14 +4270,24 @@ elm_map_zoom_mode_set(Evas_Object *obj,
EAPI Elm_Map_Zoom_Mode
elm_map_zoom_mode_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) ELM_MAP_ZOOM_MODE_MANUAL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Zoom_Mode ret = ELM_MAP_ZOOM_MODE_MANUAL;
+ eo_do((Eo *) obj, elm_obj_map_zoom_mode_get(&ret));
+ return ret;
+}
- return sd->mode;
+static void
+_zoom_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Zoom_Mode *ret = va_arg(*list, Elm_Map_Zoom_Mode *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+
+ *ret = sd->mode;
#else
(void)obj;
- return ELM_MAP_ZOOM_MODE_MANUAL;
+ (void)_pd;
+ *ret = ELM_MAP_ZOOM_MODE_MANUAL;
#endif
}
@@ -4258,14 +4295,22 @@ EAPI void
elm_map_zoom_max_set(Evas_Object *obj,
int zoom)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_zoom_max_set(zoom));
+}
+
+static void
+_zoom_max_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int zoom = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
sd->zoom_max = zoom;
#else
(void)obj;
+ (void)_pd;
(void)zoom;
#endif
}
@@ -4273,15 +4318,25 @@ elm_map_zoom_max_set(Evas_Object *obj,
EAPI int
elm_map_zoom_max_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) - 1;
- ELM_MAP_DATA_GET(obj, sd);
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_tile, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_map_zoom_max_get(&ret));
+ return ret;
+}
+
+static void
+_zoom_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ *ret = -1;
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
- return sd->zoom_max;
+ *ret = sd->zoom_max;
#else
(void)obj;
- return -1;
+ (void)_pd;
#endif
}
@@ -4289,14 +4344,22 @@ EAPI void
elm_map_zoom_min_set(Evas_Object *obj,
int zoom)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_zoom_min_set(zoom));
+}
+
+static void
+_zoom_min_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int zoom = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
sd->zoom_min = zoom;
#else
(void)obj;
+ (void)_pd;
(void)zoom;
#endif
}
@@ -4304,15 +4367,25 @@ elm_map_zoom_min_set(Evas_Object *obj,
EAPI int
elm_map_zoom_min_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) - 1;
- ELM_MAP_DATA_GET(obj, sd);
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_tile, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_map_zoom_min_get(&ret));
+ return ret;
+}
- return sd->zoom_min;
+static void
+_zoom_min_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ *ret = -1;
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
+
+ *ret = sd->zoom_min;
#else
(void)obj;
- return -1;
+ (void)_pd;
#endif
}
@@ -4321,9 +4394,17 @@ elm_map_region_bring_in(Evas_Object *obj,
double lon,
double lat)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_region_bring_in(lon, lat));
+}
+
+static void
+_region_bring_in(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
sd->calc_job.bring_in = EINA_TRUE;
sd->calc_job.lon = lon;
@@ -4333,6 +4414,7 @@ elm_map_region_bring_in(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
@@ -4343,9 +4425,17 @@ elm_map_region_show(Evas_Object *obj,
double lon,
double lat)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_region_show(lon, lat));
+}
+
+static void
+_region_show(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
sd->calc_job.bring_in = EINA_FALSE;
sd->calc_job.lon = lon;
@@ -4355,6 +4445,7 @@ elm_map_region_show(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
@@ -4365,12 +4456,20 @@ elm_map_region_get(const Evas_Object *obj,
double *lon,
double *lat)
{
+ ELM_MAP_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_map_region_get(lon, lat));
+}
+
+static void
+_region_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *lon = va_arg(*list, double *);
+ double *lat = va_arg(*list, double *);
#ifdef HAVE_ELEMENTARY_ECORE_CON
double tlon, tlat;
Evas_Coord vx, vy, vw, vh;
- ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
_viewport_coord_get(sd, &vx, &vy, &vw, &vh);
_coord_to_region_convert
@@ -4379,6 +4478,7 @@ elm_map_region_get(const Evas_Object *obj,
if (lat) *lat = tlat;
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
@@ -4388,9 +4488,17 @@ EAPI void
elm_map_paused_set(Evas_Object *obj,
Eina_Bool paused)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_paused_set(paused));
+}
+
+static void
+_paused_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool paused = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->paused == !!paused) return;
sd->paused = !!paused;
@@ -4402,17 +4510,18 @@ elm_map_paused_set(Evas_Object *obj,
sd->zoom_animator = NULL;
_zoom_do(sd, sd->zoom);
}
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,stop", "elm");
}
else
{
if (sd->download_num >= 1)
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
}
#else
(void)obj;
+ (void)_pd;
(void)paused;
#endif
}
@@ -4420,14 +4529,24 @@ elm_map_paused_set(Evas_Object *obj,
EAPI Eina_Bool
elm_map_paused_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) EINA_FALSE;
- ELM_MAP_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_map_paused_get(&ret));
+ return ret;
+}
+
+static void
+_paused_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
- return sd->paused;
+ *ret = sd->paused;
#else
(void)obj;
- return EINA_FALSE;
+ (void)_pd;
+ *ret = EINA_FALSE;
#endif
}
@@ -4437,9 +4556,18 @@ elm_map_rotate_set(Evas_Object *obj,
Evas_Coord cx,
Evas_Coord cy)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_rotate_set(degree, cx, cy));
+}
+
+static void
+_rotate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double degree = va_arg(*list, double);
+ Evas_Coord cx = va_arg(*list, Evas_Coord);
+ Evas_Coord cy = va_arg(*list, Evas_Coord);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
sd->rotate.d = degree;
sd->rotate.cx = cx;
@@ -4448,6 +4576,7 @@ elm_map_rotate_set(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)degree;
(void)cx;
(void)cy;
@@ -4460,15 +4589,25 @@ elm_map_rotate_get(const Evas_Object *obj,
Evas_Coord *cx,
Evas_Coord *cy)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_map_rotate_get(degree, cx, cy));
+}
+
+static void
+_rotate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *degree = va_arg(*list, double *);
+ Evas_Coord *cx = va_arg(*list, Evas_Coord *);
+ Evas_Coord *cy = va_arg(*list, Evas_Coord *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
if (degree) *degree = sd->rotate.d;
if (cx) *cx = sd->rotate.cx;
if (cy) *cy = sd->rotate.cy;
#else
(void)obj;
+ (void)_pd;
(void)degree;
(void)cx;
(void)cy;
@@ -4479,9 +4618,16 @@ EAPI void
elm_map_wheel_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_wheel_disabled_set(disabled));
+}
+
+static void
+_wheel_disabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
if ((!sd->wheel_disabled) && (disabled))
evas_object_event_callback_del_full
@@ -4492,6 +4638,7 @@ elm_map_wheel_disabled_set(Evas_Object *obj,
sd->wheel_disabled = !!disabled;
#else
(void)obj;
+ (void)_pd;
(void)disabled;
#endif
}
@@ -4499,14 +4646,24 @@ elm_map_wheel_disabled_set(Evas_Object *obj,
EAPI Eina_Bool
elm_map_wheel_disabled_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) EINA_FALSE;
- ELM_MAP_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_map_wheel_disabled_get(&ret));
+ return ret;
+}
- return sd->wheel_disabled;
+static void
+_wheel_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+
+ *ret = sd->wheel_disabled;
#else
(void)obj;
- return EINA_FALSE;
+ (void)_pd;
+ *ret = EINA_FALSE;
#endif
}
@@ -4515,14 +4672,23 @@ elm_map_tile_load_status_get(const Evas_Object *obj,
int *try_num,
int *finish_num)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_map_tile_load_status_get(try_num, finish_num));
+}
+
+static void
+_tile_load_status_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *try_num = va_arg(*list, int *);
+ int *finish_num = va_arg(*list, int *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
if (try_num) *try_num = sd->try_num;
if (finish_num) *finish_num = sd->finish_num;
#else
(void)obj;
+ (void)_pd;
(void)try_num;
(void)finish_num;
#endif
@@ -4535,9 +4701,19 @@ elm_map_canvas_to_region_convert(const Evas_Object *obj,
double *lon,
double *lat)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_map_canvas_to_region_convert(x, y, lon, lat));
+}
+
+static void
+_canvas_to_region_convert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ double *lon = va_arg(*list, double *);
+ double *lat = va_arg(*list, double *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(lon);
EINA_SAFETY_ON_NULL_RETURN(lat);
@@ -4545,6 +4721,7 @@ elm_map_canvas_to_region_convert(const Evas_Object *obj,
_coord_to_region_convert(sd, x, y, sd->size.w, lon, lat);
#else
(void)obj;
+ (void)_pd;
(void)x;
(void)y;
(void)lon;
@@ -4559,9 +4736,19 @@ elm_map_region_to_canvas_convert(const Evas_Object *obj,
Evas_Coord *x,
Evas_Coord *y)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_map_region_to_canvas_convert(lon, lat, x, y));
+}
+
+static void
+_region_to_canvas_convert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(x);
EINA_SAFETY_ON_NULL_RETURN(y);
@@ -4569,6 +4756,7 @@ elm_map_region_to_canvas_convert(const Evas_Object *obj,
_coord_to_canvas(sd, *x, *y, x, y);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
(void)x;
@@ -4580,9 +4768,16 @@ EAPI void
elm_map_user_agent_set(Evas_Object *obj,
const char *user_agent)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_user_agent_set(user_agent));
+}
+
+static void
+_user_agent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *user_agent = va_arg(*list, const char *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(user_agent);
eina_stringshare_replace(&sd->user_agent, user_agent);
@@ -4591,6 +4786,7 @@ elm_map_user_agent_set(Evas_Object *obj,
eina_hash_set(sd->ua, "User-Agent", sd->user_agent);
#else
(void)obj;
+ (void)_pd;
(void)user_agent;
#endif
}
@@ -4598,14 +4794,24 @@ elm_map_user_agent_set(Evas_Object *obj,
EAPI const char *
elm_map_user_agent_get(const Evas_Object *obj)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_map_user_agent_get(&ret));
+ return ret;
+}
+
+static void
+_user_agent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
- return sd->user_agent;
+ *ret = sd->user_agent;
#else
(void)obj;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -4614,9 +4820,17 @@ elm_map_source_set(Evas_Object *obj,
Elm_Map_Source_Type type,
const char *source_name)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_map_source_set(type, source_name));
+}
+
+static void
+_source_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Source_Type type = va_arg(*list, Elm_Map_Source_Type);
+ const char *source_name = va_arg(*list, const char *);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(source_name);
if (type == ELM_MAP_SOURCE_TYPE_TILE) _source_tile_set(sd, source_name);
@@ -4629,6 +4843,7 @@ elm_map_source_set(Evas_Object *obj,
#else
(void)obj;
(void)type;
+ (void)_pd;
(void)source_name;
#endif
}
@@ -4637,24 +4852,33 @@ EAPI const char *
elm_map_source_get(const Evas_Object *obj,
Elm_Map_Source_Type type)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_map_source_get(type, &ret));
+ return ret;
+}
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_tile, NULL);
+static void
+_source_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Source_Type type = va_arg(*list, Elm_Map_Source_Type);
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
+
+ EINA_SAFETY_ON_NULL_RETURN(sd->src_tile);
- if (type == ELM_MAP_SOURCE_TYPE_TILE) return sd->src_tile->name;
+ if (type == ELM_MAP_SOURCE_TYPE_TILE) *ret = sd->src_tile->name;
else if (type == ELM_MAP_SOURCE_TYPE_ROUTE)
- return sd->src_route->name;
+ *ret = sd->src_route->name;
else if (type == ELM_MAP_SOURCE_TYPE_NAME)
- return sd->src_name->name;
+ *ret = sd->src_name->name;
else ERR("Not supported map source type: %d", type);
-
- return NULL;
#else
(void)obj;
(void)type;
- return NULL;
+ (void)_pd;
#endif
}
@@ -4662,22 +4886,31 @@ EAPI const char **
elm_map_sources_get(const Evas_Object *obj,
Elm_Map_Source_Type type)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ const char **ret = NULL;
+ eo_do((Eo *) obj, elm_obj_map_sources_get(type, &ret));
+ return ret;
+}
+
+static void
+_sources_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Source_Type type = va_arg(*list, Elm_Map_Source_Type);
+ const char ***ret = va_arg(*list, const char ***);
+ *ret = NULL;
+#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Smart_Data *sd = _pd;
- if (type == ELM_MAP_SOURCE_TYPE_TILE) return sd->src_tile_names;
+ if (type == ELM_MAP_SOURCE_TYPE_TILE) *ret = sd->src_tile_names;
else if (type == ELM_MAP_SOURCE_TYPE_ROUTE)
- return sd->src_route_names;
+ *ret = sd->src_route_names;
else if (type == ELM_MAP_SOURCE_TYPE_NAME)
- return sd->src_name_names;
+ *ret = sd->src_name_names;
else ERR("Not supported map source type: %d", type);
-
- return NULL;
#else
(void)obj;
(void)type;
- return NULL;
+ (void)_pd;
#endif
}
@@ -4692,16 +4925,35 @@ elm_map_route_add(Evas_Object *obj,
Elm_Map_Route_Cb route_cb,
void *data)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Route *ret = NULL;
+ eo_do(obj, elm_obj_map_route_add(type, method, flon, flat, tlon, tlat, route_cb, data, &ret));
+ return ret;
+}
+
+static void
+_route_add(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Map_Route_Type type = va_arg(*list, Elm_Map_Route_Type);
+ Elm_Map_Route_Method method = va_arg(*list, Elm_Map_Route_Method);
+ double flon = va_arg(*list, double);
+ double flat = va_arg(*list, double);
+ double tlon = va_arg(*list, double);
+ double tlat = va_arg(*list, double);
+ Elm_Map_Route_Cb route_cb = va_arg(*list, Elm_Map_Route_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Map_Route **ret = va_arg(*list, Elm_Map_Route **);
+ *ret = NULL;
#ifdef HAVE_ELEMENTARY_ECORE_CON
char *url;
char *type_name;
Elm_Map_Route *route;
char fname[PATH_MAX], fname2[PATH_MAX];
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd->src_route, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(sd->src_route);
{
const char *cachedir;
@@ -4731,7 +4983,7 @@ elm_map_route_add(Evas_Object *obj,
{
ERR("Route URL is NULL");
if (type_name) free(type_name);
- return NULL;
+ return;
}
if (type_name) free(type_name);
@@ -4754,19 +5006,20 @@ elm_map_route_add(Evas_Object *obj,
ERR("Can't request Route from %s to %s", url, route->fname);
free(route->fname);
free(route);
- return NULL;
+ return;
}
INF("Route requested from %s to %s", url, route->fname);
free(url);
sd->routes = eina_list_append(sd->routes, route);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_ROUTE_LOAD, route);
- edje_object_signal_emit(ELM_WIDGET_DATA(sd)->resize_obj,
+ (sd->obj, SIG_ROUTE_LOAD, route);
+ edje_object_signal_emit(wd->resize_obj,
"elm,state,busy,start", "elm");
- return route;
+ *ret = route;
#else
(void)obj;
+ (void)_pd;
(void)type;
(void)method;
(void)flon;
@@ -4775,7 +5028,6 @@ elm_map_route_add(Evas_Object *obj,
(void)tlat;
(void)route_cb;
(void)data;
- return NULL;
#endif
}
@@ -4788,7 +5040,7 @@ elm_map_route_del(Elm_Map_Route *route)
EINA_SAFETY_ON_NULL_RETURN(route);
EINA_SAFETY_ON_NULL_RETURN(route->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(route->wsd)->obj);
+ ELM_MAP_CHECK((route->wsd)->obj);
if (route->job) ecore_file_download_abort(route->job);
@@ -4861,23 +5113,38 @@ elm_map_name_add(const Evas_Object *obj,
Elm_Map_Name_Cb name_cb,
void *data)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Name *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_map_name_add(address, lon, lat, name_cb, data, &ret));
+ return ret;
+}
+
+static void
+_name_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *address = va_arg(*list, const char *);
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+ Elm_Map_Name_Cb name_cb = va_arg(*list, Elm_Map_Name_Cb);
+ void *data = va_arg(*list, void *);
+ Elm_Map_Name **ret = va_arg(*list, Elm_Map_Name **);
+#ifdef HAVE_ELEMENTARY_ECORE_CON
if (address)
- return _name_request(obj, ELM_MAP_NAME_METHOD_SEARCH, address, 0, 0,
+ *ret = _name_request(obj, ELM_MAP_NAME_METHOD_SEARCH, address, 0, 0,
name_cb, data);
else
- return _name_request(obj, ELM_MAP_NAME_METHOD_REVERSE, NULL, lon, lat,
+ *ret = _name_request(obj, ELM_MAP_NAME_METHOD_REVERSE, NULL, lon, lat,
name_cb, data);
#else
(void)obj;
+ (void)_pd;
(void)address;
(void)lon;
(void)lat;
(void)name_cb;
(void)data;
- return NULL;
+ *ret = NULL;
#endif
}
@@ -4906,7 +5173,7 @@ elm_map_name_del(Elm_Map_Name *name)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(name);
EINA_SAFETY_ON_NULL_RETURN(name->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(name->wsd)->obj);
+ ELM_MAP_CHECK((name->wsd)->obj);
if (name->job) ecore_file_download_abort(name->job);
if (name->address) free(name->address);
@@ -4929,7 +5196,7 @@ elm_map_name_address_get(const Elm_Map_Name *name)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(name, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(name->wsd, NULL);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(name->wsd)->obj) NULL;
+ ELM_MAP_CHECK((name->wsd)->obj) NULL;
return name->address;
#else
@@ -4946,7 +5213,7 @@ elm_map_name_region_get(const Elm_Map_Name *name,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(name);
EINA_SAFETY_ON_NULL_RETURN(name->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(name->wsd)->obj);
+ ELM_MAP_CHECK((name->wsd)->obj);
if (lon) *lon = name->lon;
if (lat) *lat = name->lat;
@@ -4962,11 +5229,22 @@ elm_map_overlay_add(Evas_Object *obj,
double lon,
double lat)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_add(lon, lat, &ret));
+ return ret;
+}
+
+static void
+_overlay_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -4981,24 +5259,34 @@ elm_map_overlay_add(Evas_Object *obj,
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
- return NULL;
+ *ret = NULL;
#endif
}
EAPI Eina_List *
elm_map_overlays_get(Evas_Object *obj)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Eina_List *ret = NULL;
+ eo_do(obj, elm_obj_map_overlays_get(&ret));
+ return ret;
+}
+
+static void
+_overlays_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Eina_List *l;
Elm_Map_Overlay *ovl;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
eina_list_free(sd->all_overlays);
sd->all_overlays = NULL;
@@ -5008,10 +5296,11 @@ elm_map_overlays_get(Evas_Object *obj)
EINA_LIST_FOREACH(sd->group_overlays, l, ovl)
sd->all_overlays = eina_list_append(sd->all_overlays, ovl);
- return sd->all_overlays;
+ *ret = sd->all_overlays;
#else
(void)obj;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -5021,13 +5310,13 @@ elm_map_overlay_del(Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(overlay->wsd)->obj, SIG_OVERLAY_DEL, overlay);
+ ((overlay->wsd)->obj, SIG_OVERLAY_DEL, overlay);
if (overlay->del_cb)
overlay->del_cb
- (overlay->del_cb_data, ELM_WIDGET_DATA(overlay->wsd)->obj, overlay);
+ (overlay->del_cb_data, (overlay->wsd)->obj, overlay);
if (overlay->grp)
{
@@ -5069,7 +5358,7 @@ elm_map_overlay_type_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, ELM_MAP_OVERLAY_TYPE_NONE);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, ELM_MAP_OVERLAY_TYPE_NONE);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) ELM_MAP_OVERLAY_TYPE_NONE;
+ ELM_MAP_CHECK((overlay->wsd)->obj) ELM_MAP_OVERLAY_TYPE_NONE;
return overlay->type;
#else
@@ -5085,7 +5374,7 @@ elm_map_overlay_data_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
overlay->data = data;
#else
@@ -5100,7 +5389,7 @@ elm_map_overlay_data_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, NULL);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) NULL;
+ ELM_MAP_CHECK((overlay->wsd)->obj) NULL;
return overlay->data;
#else
@@ -5116,7 +5405,7 @@ elm_map_overlay_hide_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->hide == !!hide) return;
overlay->hide = hide;
@@ -5134,7 +5423,7 @@ elm_map_overlay_hide_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, EINA_FALSE);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) EINA_FALSE;
+ ELM_MAP_CHECK((overlay->wsd)->obj) EINA_FALSE;
return overlay->hide;
#else
@@ -5150,7 +5439,7 @@ elm_map_overlay_displayed_zoom_min_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
overlay->zoom_min = zoom;
evas_object_smart_changed(overlay->wsd->pan_obj);
@@ -5166,7 +5455,7 @@ elm_map_overlay_displayed_zoom_min_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, 0);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) 0;
+ ELM_MAP_CHECK((overlay->wsd)->obj) 0;
return overlay->zoom_min;
#else
@@ -5182,7 +5471,7 @@ elm_map_overlay_paused_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->paused == !!paused) return;
overlay->paused = paused;
@@ -5200,7 +5489,7 @@ elm_map_overlay_paused_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, EINA_FALSE);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) EINA_FALSE;
+ ELM_MAP_CHECK((overlay->wsd)->obj) EINA_FALSE;
return overlay->paused;
#else
@@ -5215,7 +5504,7 @@ elm_map_overlay_visible_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, EINA_FALSE);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) EINA_FALSE;
+ ELM_MAP_CHECK((overlay->wsd)->obj) EINA_FALSE;
return overlay->visible;
#else
@@ -5230,21 +5519,21 @@ elm_map_overlay_show(Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
{
Overlay_Default *ovl = overlay->ovl;
elm_map_region_show
- (ELM_WIDGET_DATA(overlay->wsd)->obj, ovl->lon, ovl->lat);
+ ((overlay->wsd)->obj, ovl->lon, ovl->lat);
}
else if (overlay->type == ELM_MAP_OVERLAY_TYPE_BUBBLE)
{
Overlay_Bubble *ovl = overlay->ovl;
elm_map_region_show
- (ELM_WIDGET_DATA(overlay->wsd)->obj, ovl->lon, ovl->lat);
+ ((overlay->wsd)->obj, ovl->lon, ovl->lat);
}
else if (overlay->type == ELM_MAP_OVERLAY_TYPE_CLASS)
{
@@ -5254,7 +5543,7 @@ elm_map_overlay_show(Elm_Map_Overlay *overlay)
_region_max_min_get(ovl->members, &max_lo, &min_lo, &max_la, &min_la);
lon = (max_lo + min_lo) / 2;
lat = (max_la + min_la) / 2;
- elm_map_region_show(ELM_WIDGET_DATA(overlay->wsd)->obj, lon, lat);
+ elm_map_region_show((overlay->wsd)->obj, lon, lat);
}
else ERR("Not supported overlay type: %d", overlay->type);
@@ -5292,7 +5581,7 @@ elm_map_overlay_region_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
{
@@ -5327,7 +5616,7 @@ elm_map_overlay_region_get(const Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_GROUP)
{
@@ -5366,7 +5655,7 @@ elm_map_overlay_icon_set(Elm_Map_Overlay *overlay,
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(icon);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
_overlay_default_icon_update(overlay->ovl, icon);
@@ -5387,7 +5676,7 @@ elm_map_overlay_icon_get(const Elm_Map_Overlay *overlay)
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, NULL);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) NULL;
+ ELM_MAP_CHECK((overlay->wsd)->obj) NULL;
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
{
@@ -5420,7 +5709,7 @@ elm_map_overlay_content_set(Elm_Map_Overlay *overlay,
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(content);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
_overlay_default_content_update(overlay->ovl, content, overlay);
@@ -5442,7 +5731,7 @@ elm_map_overlay_content_get(const Elm_Map_Overlay *overlay)
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(overlay->wsd, NULL);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj) NULL;
+ ELM_MAP_CHECK((overlay->wsd)->obj) NULL;
if (overlay->type == ELM_MAP_OVERLAY_TYPE_DEFAULT)
{
@@ -5475,7 +5764,7 @@ elm_map_overlay_color_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
overlay->c.r = r;
overlay->c.g = g;
@@ -5512,7 +5801,7 @@ elm_map_overlay_color_get(const Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
if (overlay->type == ELM_MAP_OVERLAY_TYPE_ROUTE)
{
@@ -5539,7 +5828,7 @@ elm_map_overlay_get_cb_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
overlay->cb = get_cb;
overlay->cb_data = data;
@@ -5561,7 +5850,7 @@ elm_map_overlay_del_cb_set(Elm_Map_Overlay *overlay,
#ifdef HAVE_ELEMENTARY_ECORE_CON
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(overlay->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
overlay->del_cb = del_cb;
overlay->del_cb_data = data;
@@ -5575,11 +5864,20 @@ elm_map_overlay_del_cb_set(Elm_Map_Overlay *overlay,
EAPI Elm_Map_Overlay *
elm_map_overlay_class_add(Evas_Object *obj)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_class_add(&ret));
+ return ret;
+}
+
+static void
+_overlay_class_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5592,10 +5890,11 @@ elm_map_overlay_class_add(Evas_Object *obj)
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -5609,7 +5908,7 @@ elm_map_overlay_class_append(Elm_Map_Overlay *klass,
EINA_SAFETY_ON_NULL_RETURN(klass);
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(klass->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(klass->wsd)->obj);
+ ELM_MAP_CHECK((klass->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(klass->type == ELM_MAP_OVERLAY_TYPE_CLASS);
class_ovl = klass->ovl;
@@ -5650,7 +5949,7 @@ elm_map_overlay_class_remove(Elm_Map_Overlay *klass,
EINA_SAFETY_ON_NULL_RETURN(klass);
EINA_SAFETY_ON_NULL_RETURN(overlay);
EINA_SAFETY_ON_NULL_RETURN(klass->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(klass->wsd)->obj);
+ ELM_MAP_CHECK((klass->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(klass->type == ELM_MAP_OVERLAY_TYPE_CLASS);
ovl = klass->ovl;
@@ -5681,7 +5980,7 @@ elm_map_overlay_class_zoom_max_set(Elm_Map_Overlay *klass,
EINA_SAFETY_ON_NULL_RETURN(klass);
EINA_SAFETY_ON_NULL_RETURN(klass->wsd);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(klass->wsd)->obj);
+ ELM_MAP_CHECK((klass->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(klass->type == ELM_MAP_OVERLAY_TYPE_CLASS);
ovl = klass->ovl;
@@ -5703,7 +6002,7 @@ elm_map_overlay_class_zoom_max_get(const Elm_Map_Overlay *klass)
EINA_SAFETY_ON_NULL_RETURN_VAL(klass, OVERLAY_CLASS_ZOOM_MAX);
EINA_SAFETY_ON_NULL_RETURN_VAL(klass->wsd, OVERLAY_CLASS_ZOOM_MAX);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(klass->wsd)->obj) OVERLAY_CLASS_ZOOM_MAX;
+ ELM_MAP_CHECK((klass->wsd)->obj) OVERLAY_CLASS_ZOOM_MAX;
EINA_SAFETY_ON_FALSE_RETURN_VAL
(klass->type == ELM_MAP_OVERLAY_TYPE_CLASS, OVERLAY_CLASS_ZOOM_MAX);
@@ -5724,7 +6023,7 @@ elm_map_overlay_group_members_get(const Elm_Map_Overlay *grp)
EINA_SAFETY_ON_NULL_RETURN_VAL(grp, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(grp->wsd, NULL);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(grp->wsd)->obj) NULL;
+ ELM_MAP_CHECK((grp->wsd)->obj) NULL;
EINA_SAFETY_ON_FALSE_RETURN_VAL
(grp->type == ELM_MAP_OVERLAY_TYPE_GROUP, NULL);
@@ -5740,11 +6039,20 @@ elm_map_overlay_group_members_get(const Elm_Map_Overlay *grp)
EAPI Elm_Map_Overlay *
elm_map_overlay_bubble_add(Evas_Object *obj)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_bubble_add(&ret));
+ return ret;
+}
+
+static void
+_overlay_bubble_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5758,10 +6066,11 @@ elm_map_overlay_bubble_add(Evas_Object *obj)
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -5775,7 +6084,7 @@ elm_map_overlay_bubble_follow(Elm_Map_Overlay *bubble,
EINA_SAFETY_ON_NULL_RETURN(bubble);
EINA_SAFETY_ON_NULL_RETURN(parent);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(bubble->wsd)->obj);
+ ELM_MAP_CHECK((bubble->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(bubble->type == ELM_MAP_OVERLAY_TYPE_BUBBLE);
ovl = bubble->ovl;
@@ -5799,7 +6108,7 @@ elm_map_overlay_bubble_content_append(Elm_Map_Overlay *bubble,
EINA_SAFETY_ON_NULL_RETURN(bubble);
EINA_SAFETY_ON_NULL_RETURN(content);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(bubble->wsd)->obj);
+ ELM_MAP_CHECK((bubble->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(bubble->type == ELM_MAP_OVERLAY_TYPE_BUBBLE);
bb = bubble->ovl;
@@ -5819,7 +6128,7 @@ elm_map_overlay_bubble_content_clear(Elm_Map_Overlay *bubble)
Overlay_Bubble *bb;
EINA_SAFETY_ON_NULL_RETURN(bubble);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(bubble->wsd)->obj);
+ ELM_MAP_CHECK((bubble->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(bubble->type == ELM_MAP_OVERLAY_TYPE_BUBBLE);
bb = bubble->ovl;
@@ -5835,16 +6144,27 @@ EAPI Elm_Map_Overlay *
elm_map_overlay_route_add(Evas_Object *obj,
const Elm_Map_Route *route)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_route_add(route, &ret));
+ return ret;
+}
+
+static void
+_overlay_route_add(Eo *obj, void *_pd, va_list *list)
+{
+ const Elm_Map_Route *route = va_arg(*list, const Elm_Map_Route *);
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
+ *ret = NULL;
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
- EINA_SAFETY_ON_NULL_RETURN_VAL(route, NULL);
- EINA_SAFETY_ON_NULL_RETURN_VAL(route->wsd, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL
- (obj == ELM_WIDGET_DATA(route->wsd)->obj, NULL);
+ EINA_SAFETY_ON_NULL_RETURN(route);
+ EINA_SAFETY_ON_NULL_RETURN(route->wsd);
+ EINA_SAFETY_ON_FALSE_RETURN
+ (obj == (route->wsd)->obj);
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5858,11 +6178,11 @@ elm_map_overlay_route_add(Evas_Object *obj,
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
+ (void)_pd;
(void)route;
- return NULL;
#endif
}
@@ -5873,11 +6193,24 @@ elm_map_overlay_line_add(Evas_Object *obj,
double tlon,
double tlat)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_line_add(flon, flat, tlon, tlat, &ret));
+ return ret;
+}
+
+static void
+_overlay_line_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double flon = va_arg(*list, double);
+ double flat = va_arg(*list, double);
+ double tlon = va_arg(*list, double);
+ double tlat = va_arg(*list, double);
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5891,25 +6224,35 @@ elm_map_overlay_line_add(Evas_Object *obj,
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
+ (void)_pd;
(void)flon;
(void)flat;
(void)tlon;
(void)tlat;
- return NULL;
+ *ret = NULL;
#endif
}
EAPI Elm_Map_Overlay *
elm_map_overlay_polygon_add(Evas_Object *obj)
{
+ ELM_MAP_CHECK(obj) NULL;
#ifdef HAVE_ELEMENTARY_ECORE_CON
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_polygon_add(&ret));
+ return ret;
+}
+
+static void
+_overlay_polygon_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5922,10 +6265,11 @@ elm_map_overlay_polygon_add(Evas_Object *obj)
overlay->grp = _overlay_group_new(sd);
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -5939,7 +6283,7 @@ elm_map_overlay_polygon_region_add(Elm_Map_Overlay *overlay,
Region *r;
EINA_SAFETY_ON_NULL_RETURN(overlay);
- ELM_MAP_CHECK(ELM_WIDGET_DATA(overlay->wsd)->obj);
+ ELM_MAP_CHECK((overlay->wsd)->obj);
EINA_SAFETY_ON_FALSE_RETURN(overlay->type == ELM_MAP_OVERLAY_TYPE_POLYGON);
ovl = overlay->ovl;
@@ -5962,11 +6306,23 @@ elm_map_overlay_circle_add(Evas_Object *obj,
double lat,
double radius)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_circle_add(lon, lat, radius, &ret));
+ return ret;
+}
+
+static void
+_overlay_circle_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double lon = va_arg(*list, double);
+ double lat = va_arg(*list, double);
+ double radius = va_arg(*list, double);
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -5980,13 +6336,14 @@ elm_map_overlay_circle_add(Evas_Object *obj,
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
(void)lon;
(void)lat;
(void)radius;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -5995,11 +6352,22 @@ elm_map_overlay_scale_add(Evas_Object *obj,
Evas_Coord x,
Evas_Coord y)
{
+ ELM_MAP_CHECK(obj) NULL;
+ Elm_Map_Overlay *ret = NULL;
+ eo_do(obj, elm_obj_map_overlay_scale_add(x, y, &ret));
+ return ret;
+}
+
+static void
+_overlay_scale_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Map_Overlay **ret = va_arg(*list, Elm_Map_Overlay **);
#ifdef HAVE_ELEMENTARY_ECORE_CON
Elm_Map_Overlay *overlay;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
overlay = ELM_NEW(Elm_Map_Overlay);
overlay->wsd = sd;
@@ -6013,12 +6381,13 @@ elm_map_overlay_scale_add(Evas_Object *obj,
sd->overlays = eina_list_append(sd->overlays, overlay);
evas_object_smart_changed(sd->pan_obj);
- return overlay;
+ *ret = overlay;
#else
(void)obj;
(void)x;
(void)y;
- return NULL;
+ (void)_pd;
+ *ret = NULL;
#endif
}
@@ -6027,52 +6396,186 @@ EAPI Evas_Object *
elm_map_track_add(Evas_Object *obj,
void *emap)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
+ ELM_MAP_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_map_track_add(emap, &ret));
+ return ret;
+}
+
+EAPI void
+elm_map_track_remove(Evas_Object *obj,
+ Evas_Object *route)
+{
+ ELM_MAP_CHECK(obj);
+ eo_do(obj, elm_obj_map_track_remove(route));
+}
+
+#else
+EAPI Evas_Object *
+elm_map_track_add(Evas_Object *obj __UNUSED__,
+ void *emap __UNUSED__)
+{
+ return NULL;
+}
+
+EAPI void
+elm_map_track_remove(Evas_Object *obj __UNUSED__,
+ Evas_Object *route __UNUSED__)
+{
+}
+#endif
+
+static void
+_track_add(Eo *obj, void *_pd, va_list *list)
+{
+ void *emap = va_arg(*list, void *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+#if defined (ELM_EMAP) && defined (HAVE_ELEMENTARY_ECORE_CON)
EMap_Route *emapr = emap;
Evas_Object *route;
- ELM_MAP_CHECK(obj) NULL;
- ELM_MAP_DATA_GET(obj, sd);
+ Elm_Map_Smart_Data *sd = _pd;
route = elm_route_add(obj);
elm_route_emap_set(route, emapr);
sd->track = eina_list_append(sd->track, route);
- return route;
+ *ret = route;
#else
(void)obj;
+ (void)_pd;
(void)emap;
- return NULL;
#endif
}
-EAPI void
-elm_map_track_remove(Evas_Object *obj,
- Evas_Object *route)
+static void
+_track_remove(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
-#ifdef HAVE_ELEMENTARY_ECORE_CON
- ELM_MAP_CHECK(obj);
- ELM_MAP_DATA_GET(obj, sd);
+ Evas_Object *route = va_arg(*list, Evas_Object *);
+#if defined (ELM_EMAP) && defined (HAVE_ELEMENTARY_ECORE_CON)
+ Elm_Map_Smart_Data *sd = _pd;
sd->track = eina_list_remove(sd->track, route);
evas_object_del(route);
#else
(void)obj;
+ (void)_pd;
(void)route;
#endif
}
-#else
-EAPI Evas_Object *
-elm_map_track_add(Evas_Object *obj __UNUSED__,
- void *emap __UNUSED__)
-{
- return NULL;
-}
+static void
+_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_MEMBER_ADD), _elm_map_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_map_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_map_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_map_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_map_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_map_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_map_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_map_smart_event),
+
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_SET), _zoom_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_GET), _zoom_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_SET), _zoom_mode_set_eo),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_GET), _zoom_mode_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_SET), _zoom_max_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_GET), _zoom_max_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_SET), _zoom_min_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_GET), _zoom_min_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_BRING_IN), _region_bring_in),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_SHOW), _region_show),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_GET), _region_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_PAUSED_SET), _paused_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_PAUSED_GET), _paused_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROTATE_SET), _rotate_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROTATE_GET), _rotate_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_SET), _wheel_disabled_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_GET), _wheel_disabled_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TILE_LOAD_STATUS_GET), _tile_load_status_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_CANVAS_TO_REGION_CONVERT), _canvas_to_region_convert),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_TO_CANVAS_CONVERT), _region_to_canvas_convert),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_USER_AGENT_SET), _user_agent_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_USER_AGENT_GET), _user_agent_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCE_SET), _source_set),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCE_GET), _source_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCES_GET), _sources_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROUTE_ADD), _route_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_NAME_ADD), _name_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_ADD), _overlay_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAYS_GET), _overlays_get),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_CLASS_ADD), _overlay_class_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_BUBBLE_ADD), _overlay_bubble_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_ROUTE_ADD), _overlay_route_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_LINE_ADD), _overlay_line_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_POLYGON_ADD), _overlay_polygon_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_CIRCLE_ADD), _overlay_circle_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_SCALE_ADD), _overlay_scale_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TRACK_ADD), _track_add),
+ EO_OP_FUNC(ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TRACK_REMOVE), _track_remove),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_SET, "Set the zoom level of the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_GET, "Get the zoom level of the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_SET, "Set the zoom mode used by the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_GET, "Get the zoom mode used by the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_SET, "Set the maximum zoom of the source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_GET, "Get the maximum zoom of the source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_SET, "Set the minimum zoom of the source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_GET, "Get the minimum zoom of the source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_REGION_BRING_IN, "Animatedly bring in given coordinates to the center of the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_REGION_SHOW, "Show the given coordinates at the center of the map, immediately."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_REGION_GET, "Get the current geographic coordinates of the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_PAUSED_SET, "Pause or unpause the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_PAUSED_GET, "Get a value whether map is paused or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ROTATE_SET, "Rotate the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ROTATE_GET, "Get the rotate degree of the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_SET, "Enable or disable mouse wheel to be used to zoom in / out the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_GET, "Get a value whether mouse wheel is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_TILE_LOAD_STATUS_GET, "Get the information of tile load status."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_CANVAS_TO_REGION_CONVERT, "Convert canvas coordinates into geographic coordinates."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_REGION_TO_CANVAS_CONVERT, "Convert geographic coordinates (longitude, latitude)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_USER_AGENT_SET, "Set the user agent used by the map object to access routing services."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_USER_AGENT_GET, "Get the user agent used by the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_SOURCE_SET, "Set the current source of the map for a specific type."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_SOURCE_GET, "Get the name of currently used source for a specific type."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_SOURCES_GET, "Get the names of available sources for a specific type."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_ROUTE_ADD, "Add a new route to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_NAME_ADD, "Request a address or geographic coordinates(longitude, latitude)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_ADD, "Add a new overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAYS_GET, "Return all overlays in the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_CLASS_ADD, "Add a new class overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_BUBBLE_ADD, "Add a new bubble overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_ROUTE_ADD, "Add a new route overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_LINE_ADD, "Add a new line overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_POLYGON_ADD, "Add a new polygon overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_CIRCLE_ADD, "Add a new circle overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_OVERLAY_SCALE_ADD, "Add a new scale overlay to the map object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_TRACK_ADD, "Add a track on the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAP_SUB_ID_TRACK_REMOVE, "Remove a track from the map."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_MAP_BASE_ID, op_desc, ELM_OBJ_MAP_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Map_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_map_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
-EAPI void
-elm_map_track_remove(Evas_Object *obj __UNUSED__,
- Evas_Object *route __UNUSED__)
-{
-}
-#endif
diff --git a/src/lib/elm_map.h b/src/lib/elm_map.h
index b0720a3a9..bbbcf27a2 100644
--- a/src/lib/elm_map.h
+++ b/src/lib/elm_map.h
@@ -67,6 +67,563 @@
* @li @ref map_example_03
*/
+#define ELM_OBJ_MAP_PAN_CLASS elm_obj_map_pan_class_get()
+
+const Eo_Class *elm_obj_map_pan_class_get(void) EINA_CONST;
+
+#define ELM_OBJ_MAP_CLASS elm_obj_map_class_get()
+
+const Eo_Class *elm_obj_map_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_MAP_BASE_ID;
+
+enum
+{
+ ELM_OBJ_MAP_SUB_ID_ZOOM_SET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_GET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_SET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_GET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_SET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_GET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_SET,
+ ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_GET,
+ ELM_OBJ_MAP_SUB_ID_REGION_BRING_IN,
+ ELM_OBJ_MAP_SUB_ID_REGION_SHOW,
+ ELM_OBJ_MAP_SUB_ID_REGION_GET,
+ ELM_OBJ_MAP_SUB_ID_PAUSED_SET,
+ ELM_OBJ_MAP_SUB_ID_PAUSED_GET,
+ ELM_OBJ_MAP_SUB_ID_ROTATE_SET,
+ ELM_OBJ_MAP_SUB_ID_ROTATE_GET,
+ ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_SET,
+ ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_GET,
+ ELM_OBJ_MAP_SUB_ID_TILE_LOAD_STATUS_GET,
+ ELM_OBJ_MAP_SUB_ID_CANVAS_TO_REGION_CONVERT,
+ ELM_OBJ_MAP_SUB_ID_REGION_TO_CANVAS_CONVERT,
+ ELM_OBJ_MAP_SUB_ID_USER_AGENT_SET,
+ ELM_OBJ_MAP_SUB_ID_USER_AGENT_GET,
+ ELM_OBJ_MAP_SUB_ID_SOURCE_SET,
+ ELM_OBJ_MAP_SUB_ID_SOURCE_GET,
+ ELM_OBJ_MAP_SUB_ID_SOURCES_GET,
+ ELM_OBJ_MAP_SUB_ID_ROUTE_ADD,
+ ELM_OBJ_MAP_SUB_ID_NAME_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAYS_GET,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_CLASS_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_BUBBLE_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_ROUTE_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_LINE_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_POLYGON_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_CIRCLE_ADD,
+ ELM_OBJ_MAP_SUB_ID_OVERLAY_SCALE_ADD,
+ ELM_OBJ_MAP_SUB_ID_TRACK_ADD,
+ ELM_OBJ_MAP_SUB_ID_TRACK_REMOVE,
+ ELM_OBJ_MAP_SUB_ID_LAST
+};
+
+#define ELM_OBJ_MAP_ID(sub_id) (ELM_OBJ_MAP_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_map_zoom_set
+ * @since 1.8
+ *
+ * Set the zoom level of the map.
+ *
+ * @param[in] zoom
+ *
+ * @see elm_map_zoom_set
+ */
+#define elm_obj_map_zoom_set(zoom) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_SET), EO_TYPECHECK(int, zoom)
+
+/**
+ * @def elm_obj_map_zoom_get
+ * @since 1.8
+ *
+ * Get the zoom level of the map.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_zoom_get
+ */
+#define elm_obj_map_zoom_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_map_zoom_mode_set
+ * @since 1.8
+ *
+ * Set the zoom mode used by the map object.
+ *
+ * @param[in] mode
+ *
+ * @see elm_map_zoom_mode_set
+ */
+#define elm_obj_map_zoom_mode_set(mode) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_SET), EO_TYPECHECK(Elm_Map_Zoom_Mode, mode)
+
+/**
+ * @def elm_obj_map_zoom_mode_get
+ * @since 1.8
+ *
+ * Get the zoom mode used by the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_zoom_mode_get
+ */
+#define elm_obj_map_zoom_mode_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MODE_GET), EO_TYPECHECK(Elm_Map_Zoom_Mode *, ret)
+
+/**
+ * @def elm_obj_map_zoom_max_set
+ * @since 1.8
+ *
+ * Set the maximum zoom of the source.
+ *
+ * @param[in] zoom
+ *
+ * @see elm_map_zoom_max_set
+ */
+#define elm_obj_map_zoom_max_set(zoom) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_SET), EO_TYPECHECK(int, zoom)
+
+/**
+ * @def elm_obj_map_zoom_max_get
+ * @since 1.8
+ *
+ * Get the maximum zoom of the source.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_zoom_max_get
+ */
+#define elm_obj_map_zoom_max_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MAX_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_map_zoom_min_set
+ * @since 1.8
+ *
+ * Set the minimum zoom of the source.
+ *
+ * @param[in] zoom
+ *
+ * @see elm_map_zoom_min_set
+ */
+#define elm_obj_map_zoom_min_set(zoom) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_SET), EO_TYPECHECK(int, zoom)
+
+/**
+ * @def elm_obj_map_zoom_min_get
+ * @since 1.8
+ *
+ * Get the minimum zoom of the source.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_zoom_min_get
+ */
+#define elm_obj_map_zoom_min_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ZOOM_MIN_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_map_region_bring_in
+ * @since 1.8
+ *
+ * Animatedly bring in given coordinates to the center of the map.
+ *
+ * @param[in] lon
+ * @param[in] lat
+ *
+ * @see elm_map_region_bring_in
+ */
+#define elm_obj_map_region_bring_in(lon, lat) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_BRING_IN), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat)
+
+/**
+ * @def elm_obj_map_region_show
+ * @since 1.8
+ *
+ * Show the given coordinates at the center of the map, immediately.
+ *
+ * @param[in] lon
+ * @param[in] lat
+ *
+ * @see elm_map_region_show
+ */
+#define elm_obj_map_region_show(lon, lat) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_SHOW), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat)
+
+/**
+ * @def elm_obj_map_region_get
+ * @since 1.8
+ *
+ * Get the current geographic coordinates of the map.
+ *
+ * @param[out] lon
+ * @param[out] lat
+ *
+ * @see elm_map_region_get
+ */
+#define elm_obj_map_region_get(lon, lat) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_GET), EO_TYPECHECK(double *, lon), EO_TYPECHECK(double *, lat)
+
+/**
+ * @def elm_obj_map_paused_set
+ * @since 1.8
+ *
+ * Pause or unpause the map.
+ *
+ * @param[in] paused
+ *
+ * @see elm_map_paused_set
+ */
+#define elm_obj_map_paused_set(paused) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_PAUSED_SET), EO_TYPECHECK(Eina_Bool, paused)
+
+/**
+ * @def elm_obj_map_paused_get
+ * @since 1.8
+ *
+ * Get a value whether map is paused or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_paused_get
+ */
+#define elm_obj_map_paused_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_PAUSED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_map_rotate_set
+ * @since 1.8
+ *
+ * Rotate the map.
+ *
+ * @param[in] degree
+ * @param[in] cx
+ * @param[in] cy
+ *
+ * @see elm_map_rotate_set
+ */
+#define elm_obj_map_rotate_set(degree, cx, cy) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROTATE_SET), EO_TYPECHECK(double, degree), EO_TYPECHECK(Evas_Coord, cx), EO_TYPECHECK(Evas_Coord, cy)
+
+/**
+ * @def elm_obj_map_rotate_get
+ * @since 1.8
+ *
+ * Get the rotate degree of the map
+ *
+ * @param[out] degree
+ * @param[out] cx
+ * @param[out] cy
+ *
+ * @see elm_map_rotate_get
+ */
+#define elm_obj_map_rotate_get(degree, cx, cy) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROTATE_GET), EO_TYPECHECK(double *, degree), EO_TYPECHECK(Evas_Coord *, cx), EO_TYPECHECK(Evas_Coord *, cy)
+
+/**
+ * @def elm_obj_map_wheel_disabled_set
+ * @since 1.8
+ *
+ * Enable or disable mouse wheel to be used to zoom in / out the map.
+ *
+ * @param[in] disabled
+ *
+ * @see elm_map_wheel_disabled_set
+ */
+#define elm_obj_map_wheel_disabled_set(disabled) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+
+/**
+ * @def elm_obj_map_wheel_disabled_get
+ * @since 1.8
+ *
+ * Get a value whether mouse wheel is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_wheel_disabled_get
+ */
+#define elm_obj_map_wheel_disabled_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_WHEEL_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_map_tile_load_status_get
+ * @since 1.8
+ *
+ * Get the information of tile load status.
+ *
+ * @param[out] try_num
+ * @param[out] finish_num
+ *
+ * @see elm_map_tile_load_status_get
+ */
+#define elm_obj_map_tile_load_status_get(try_num, finish_num) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TILE_LOAD_STATUS_GET), EO_TYPECHECK(int *, try_num), EO_TYPECHECK(int *, finish_num)
+
+/**
+ * @def elm_obj_map_canvas_to_region_convert
+ * @since 1.8
+ *
+ * Convert canvas coordinates into geographic coordinates
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[out] lon
+ * @param[out] lat
+ *
+ * @see elm_map_canvas_to_region_convert
+ */
+#define elm_obj_map_canvas_to_region_convert(x, y, lon, lat) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_CANVAS_TO_REGION_CONVERT), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(double *, lon), EO_TYPECHECK(double *, lat)
+
+/**
+ * @def elm_obj_map_region_to_canvas_convert
+ * @since 1.8
+ *
+ * Convert geographic coordinates (longitude, latitude)
+ *
+ * @param[in] lon
+ * @param[in] lat
+ * @param[out] x
+ * @param[out] y
+ *
+ * @see elm_map_region_to_canvas_convert
+ */
+#define elm_obj_map_region_to_canvas_convert(lon, lat, x, y) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_REGION_TO_CANVAS_CONVERT), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y)
+
+/**
+ * @def elm_obj_map_user_agent_set
+ * @since 1.8
+ *
+ * Set the user agent used by the map object to access routing services.
+ *
+ * @param[in] user_agent
+ *
+ * @see elm_map_user_agent_set
+ */
+#define elm_obj_map_user_agent_set(user_agent) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_USER_AGENT_SET), EO_TYPECHECK(const char *, user_agent)
+
+/**
+ * @def elm_obj_map_user_agent_get
+ * @since 1.8
+ *
+ * Get the user agent used by the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_user_agent_get
+ */
+#define elm_obj_map_user_agent_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_USER_AGENT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_map_source_set
+ * @since 1.8
+ *
+ * Set the current source of the map for a specific type.
+ *
+ * @param[in] type
+ * @param[in] source_name
+ *
+ * @see elm_map_source_set
+ */
+#define elm_obj_map_source_set(type, source_name) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCE_SET), EO_TYPECHECK(Elm_Map_Source_Type, type), EO_TYPECHECK(const char *, source_name)
+
+/**
+ * @def elm_obj_map_source_get
+ * @since 1.8
+ *
+ * Get the name of currently used source for a specific type.
+ *
+ * @param[in] type
+ * @param[out] ret
+ *
+ * @see elm_map_source_get
+ */
+#define elm_obj_map_source_get(type, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCE_GET), EO_TYPECHECK(Elm_Map_Source_Type, type), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_map_sources_get
+ * @since 1.8
+ *
+ * Get the names of available sources for a specific type.
+ *
+ * @param[in] type
+ * @param[out] ret
+ *
+ * @see elm_map_sources_get
+ */
+#define elm_obj_map_sources_get(type, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_SOURCES_GET), EO_TYPECHECK(Elm_Map_Source_Type, type), EO_TYPECHECK(const char ***, ret)
+
+/**
+ * @def elm_obj_map_route_add
+ * @since 1.8
+ *
+ * Add a new route to the map object.
+ *
+ * @param[in] type
+ * @param[in] method
+ * @param[in] flon
+ * @param[in] flat
+ * @param[in] tlon
+ * @param[in] tlat
+ * @param[in] route_cb
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_map_route_add
+ */
+#define elm_obj_map_route_add(type, method, flon, flat, tlon, tlat, route_cb, data, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_ROUTE_ADD), EO_TYPECHECK(Elm_Map_Route_Type, type), EO_TYPECHECK(Elm_Map_Route_Method, method), EO_TYPECHECK(double, flon), EO_TYPECHECK(double, flat), EO_TYPECHECK(double, tlon), EO_TYPECHECK(double, tlat), EO_TYPECHECK(Elm_Map_Route_Cb, route_cb), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Map_Route **, ret)
+
+/**
+ * @def elm_obj_map_name_add
+ * @since 1.8
+ *
+ * Request a address or geographic coordinates(longitude, latitude)
+ *
+ * @param[in] address
+ * @param[in] lon
+ * @param[in] lat
+ * @param[in] name_cb
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_map_name_add
+ */
+#define elm_obj_map_name_add(address, lon, lat, name_cb, data, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_NAME_ADD), EO_TYPECHECK(const char *, address), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat), EO_TYPECHECK(Elm_Map_Name_Cb, name_cb), EO_TYPECHECK(void *, data), EO_TYPECHECK(Elm_Map_Name **, ret)
+
+/**
+ * @def elm_obj_map_overlay_add
+ * @since 1.8
+ *
+ * Add a new overlay to the map object. This overlay has a default type.
+ *
+ * @param[in] lon
+ * @param[in] lat
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_add
+ */
+#define elm_obj_map_overlay_add(lon, lat, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_ADD), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlays_get
+ * @since 1.8
+ *
+ * Return all overlays in the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_overlays_get
+ */
+#define elm_obj_map_overlays_get(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAYS_GET), EO_TYPECHECK(Eina_List **, ret)
+
+/**
+ * @def elm_obj_map_overlay_class_add
+ * @since 1.8
+ *
+ * Add a new class overlay to the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_class_add
+ */
+#define elm_obj_map_overlay_class_add(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_CLASS_ADD), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_bubble_add
+ * @since 1.8
+ *
+ * Add a new bubble overlay to the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_bubble_add
+ */
+#define elm_obj_map_overlay_bubble_add(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_BUBBLE_ADD), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_route_add
+ * @since 1.8
+ *
+ * Add a new route overlay to the map object.
+ *
+ * @param[in] route
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_route_add
+ */
+#define elm_obj_map_overlay_route_add(route, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_ROUTE_ADD), EO_TYPECHECK(const Elm_Map_Route *, route), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_line_add
+ * @since 1.8
+ *
+ * Add a new line overlay to the map object.
+ *
+ * @param[in] flon
+ * @param[in] flat
+ * @param[in] tlon
+ * @param[in] tlat
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_line_add
+ */
+#define elm_obj_map_overlay_line_add(flon, flat, tlon, tlat, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_LINE_ADD), EO_TYPECHECK(double, flon), EO_TYPECHECK(double, flat), EO_TYPECHECK(double, tlon), EO_TYPECHECK(double, tlat), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_polygon_add
+ * @since 1.8
+ *
+ * Add a new polygon overlay to the map object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_polygon_add
+ */
+#define elm_obj_map_overlay_polygon_add(ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_POLYGON_ADD), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_circle_add
+ * @since 1.8
+ *
+ * Add a new circle overlay to the map object.
+ *
+ * @param[in] lon
+ * @param[in] lat
+ * @param[in] radius
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_circle_add
+ */
+#define elm_obj_map_overlay_circle_add(lon, lat, radius, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_CIRCLE_ADD), EO_TYPECHECK(double, lon), EO_TYPECHECK(double, lat), EO_TYPECHECK(double, radius), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+
+/**
+ * @def elm_obj_map_overlay_scale_add
+ * @since 1.8
+ *
+ * Add a new scale overlay to the map object.
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[out] ret
+ *
+ * @see elm_map_overlay_scale_add
+ */
+#define elm_obj_map_overlay_scale_add(x, y, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_OVERLAY_SCALE_ADD), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Elm_Map_Overlay **, ret)
+#ifdef ELM_EMAP
+
+/**
+ * @def elm_obj_map_track_add
+ * @since 1.8
+ *
+ * Add a track on the map
+ *
+ * @param[in] emap
+ * @param[out] ret
+ *
+ * @see elm_map_track_add
+ */
+#define elm_obj_map_track_add(emap, ret) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TRACK_ADD), EO_TYPECHECK(void *, emap), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_map_track_remove
+ * @since 1.8
+ *
+ * Remove a track from the map
+ *
+ * @param[in] route
+ *
+ * @see elm_map_track_remove
+ */
+#define elm_obj_map_track_remove(route) ELM_OBJ_MAP_ID(ELM_OBJ_MAP_SUB_ID_TRACK_REMOVE), EO_TYPECHECK(Evas_Object *, route)
+#endif
+
/**
* @addtogroup Map
* @{
diff --git a/src/lib/elm_mapbuf.c b/src/lib/elm_mapbuf.c
index 70ed60fc2..85581fee4 100644
--- a/src/lib/elm_mapbuf.c
+++ b/src/lib/elm_mapbuf.c
@@ -1,12 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_mapbuf.h"
+#include "elm_widget_container.h"
-EAPI const char ELM_MAPBUF_SMART_NAME[] = "elm_mapbuf";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_MAPBUF_SMART_NAME, _elm_mapbuf, Elm_Mapbuf_Smart_Class,
- Elm_Container_Smart_Class, elm_container_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_MAPBUF_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_MAPBUF_CLASS
+
+#define MY_CLASS_NAME "elm_mapbuf"
static void
_sizing_eval(Evas_Object *obj)
@@ -24,14 +27,19 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_mapbuf_smart_theme(Evas_Object *obj)
+static void
+_elm_mapbuf_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -43,14 +51,17 @@ _changed_size_hints_cb(void *data,
_sizing_eval(data);
}
-static Eina_Bool
-_elm_mapbuf_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_mapbuf_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sobj == sd->content)
{
@@ -64,7 +75,7 @@ _elm_mapbuf_smart_sub_object_del(Evas_Object *obj,
_sizing_eval(obj);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -73,8 +84,9 @@ _mapbuf(Evas_Object *obj)
Evas_Coord x, y, w, h;
ELM_MAPBUF_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->resize_obj, &x, &y, &w, &h);
+ evas_object_geometry_get(wd->resize_obj, &x, &y, &w, &h);
evas_object_resize(sd->content, w, h);
if (sd->enabled)
@@ -101,13 +113,14 @@ static void
_configure(Evas_Object *obj)
{
ELM_MAPBUF_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->content)
{
Evas_Coord x, y, w, h, x2, y2;
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &x, &y, &w, &h);
+ (wd->resize_obj, &x, &y, &w, &h);
evas_object_geometry_get(sd->content, &x2, &y2, NULL, NULL);
if ((x != x2) || (y != y2))
{
@@ -128,34 +141,41 @@ _configure(Evas_Object *obj)
}
static void
-_elm_mapbuf_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_mapbuf_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->base.move(obj, x, y);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
_configure(obj);
}
static void
-_elm_mapbuf_smart_resize(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_mapbuf_smart_resize(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->base.resize(obj, x, y);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
_configure(obj);
}
-static Eina_Bool
-_elm_mapbuf_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_mapbuf_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_MAPBUF_DATA_GET(obj, sd);
-
- if (part && strcmp(part, "default")) return EINA_FALSE;
- if (sd->content == content) return EINA_TRUE;
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (part && strcmp(part, "default")) return;
+ if (sd->content == content)
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
if (sd->content) evas_object_del(sd->content);
sd->content = content;
@@ -165,64 +185,70 @@ _elm_mapbuf_smart_content_set(Evas_Object *obj,
evas_object_data_set(content, "_elm_leaveme", (void *)1);
elm_widget_sub_object_add(obj, content);
evas_object_smart_member_add(content, obj);
- evas_object_clip_set(content, ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_clip_set(content, wd->resize_obj);
evas_object_color_set
- (ELM_WIDGET_DATA(sd)->resize_obj, 255, 255, 255, 255);
+ (wd->resize_obj, 255, 255, 255, 255);
evas_object_event_callback_add
(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints_cb, obj);
}
else
- evas_object_color_set(ELM_WIDGET_DATA(sd)->resize_obj, 0, 0, 0, 0);
+ evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
_sizing_eval(obj);
_configure(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_mapbuf_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_mapbuf_smart_content_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
- if (part && strcmp(part, "default")) return NULL;
- return sd->content;
+ if (part && strcmp(part, "default")) return;
+ *ret = sd->content;
}
-static Evas_Object *
-_elm_mapbuf_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_mapbuf_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *content;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (part && strcmp(part, "default")) return NULL;
- if (!sd->content) return NULL;
+ if (part && strcmp(part, "default")) return;
+ if (!sd->content) return;
content = sd->content;
elm_widget_sub_object_del(obj, content);
evas_object_smart_member_del(content);
evas_object_data_del(content, "_elm_leaveme");
- evas_object_color_set(ELM_WIDGET_DATA(sd)->resize_obj, 0, 0, 0, 0);
- return content;
+ evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
+ if (ret) *ret = content;
}
static void
-_elm_mapbuf_smart_add(Evas_Object *obj)
+_elm_mapbuf_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Mapbuf_Smart_Data);
+ Elm_Mapbuf_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
evas_object_rectangle_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_mapbuf_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
- evas_object_static_clip_set(ELM_WIDGET_DATA(priv)->resize_obj, EINA_TRUE);
- evas_object_pass_events_set(ELM_WIDGET_DATA(priv)->resize_obj, EINA_TRUE);
- evas_object_color_set(ELM_WIDGET_DATA(priv)->resize_obj, 0, 0, 0, 0);
+ evas_object_static_clip_set(wd->resize_obj, EINA_TRUE);
+ evas_object_pass_events_set(wd->resize_obj, EINA_TRUE);
+ evas_object_color_set(wd->resize_obj, 0, 0, 0, 0);
priv->enabled = 0;
priv->alpha = 1;
@@ -233,50 +259,24 @@ _elm_mapbuf_smart_add(Evas_Object *obj)
_sizing_eval(obj);
}
-static void
-_elm_mapbuf_smart_set_user(Elm_Mapbuf_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_mapbuf_smart_add;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_mapbuf_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_mapbuf_smart_move;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_mapbuf_smart_theme;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_mapbuf_smart_sub_object_del;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_mapbuf_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_mapbuf_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_mapbuf_smart_content_unset;
-}
-
-EAPI const Elm_Mapbuf_Smart_Class *
-elm_mapbuf_smart_class_get(void)
-{
- static Elm_Mapbuf_Smart_Class _sc =
- ELM_MAPBUF_SMART_CLASS_INIT_NAME_VERSION(ELM_MAPBUF_SMART_NAME);
- static const Elm_Mapbuf_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_mapbuf_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_mapbuf_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_mapbuf_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -284,7 +284,14 @@ elm_mapbuf_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_MAPBUF_CHECK(obj);
- ELM_MAPBUF_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_mapbuf_enabled_set(enabled));
+}
+
+static void
+_enabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
if (sd->enabled == enabled) return;
sd->enabled = enabled;
@@ -297,9 +304,17 @@ EAPI Eina_Bool
elm_mapbuf_enabled_get(const Evas_Object *obj)
{
ELM_MAPBUF_CHECK(obj) EINA_FALSE;
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_mapbuf_enabled_get(&ret));
+ return ret;
+}
- return sd->enabled;
+static void
+_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ *ret = sd->enabled;
}
EAPI void
@@ -307,7 +322,14 @@ elm_mapbuf_smooth_set(Evas_Object *obj,
Eina_Bool smooth)
{
ELM_MAPBUF_CHECK(obj);
- ELM_MAPBUF_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_mapbuf_smooth_set(smooth));
+}
+
+static void
+_smooth_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool smooth = va_arg(*list, int);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
if (sd->smooth == smooth) return;
sd->smooth = smooth;
@@ -318,9 +340,17 @@ EAPI Eina_Bool
elm_mapbuf_smooth_get(const Evas_Object *obj)
{
ELM_MAPBUF_CHECK(obj) EINA_FALSE;
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_mapbuf_smooth_get(&ret));
+ return ret;
+}
- return sd->smooth;
+static void
+_smooth_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ *ret = sd->smooth;
}
EAPI void
@@ -328,7 +358,14 @@ elm_mapbuf_alpha_set(Evas_Object *obj,
Eina_Bool alpha)
{
ELM_MAPBUF_CHECK(obj);
- ELM_MAPBUF_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_mapbuf_alpha_set(alpha));
+}
+
+static void
+_alpha_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool alpha = va_arg(*list, int);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
if (sd->alpha == alpha) return;
sd->alpha = alpha;
@@ -339,7 +376,63 @@ EAPI Eina_Bool
elm_mapbuf_alpha_get(const Evas_Object *obj)
{
ELM_MAPBUF_CHECK(obj) EINA_FALSE;
- ELM_MAPBUF_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_mapbuf_alpha_get(&ret));
+ return ret;
+}
+
+static void
+_alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Mapbuf_Smart_Data *sd = _pd;
+ *ret = sd->alpha;
+}
- return sd->alpha;
+static void
+_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_mapbuf_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_mapbuf_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_mapbuf_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_mapbuf_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_mapbuf_smart_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_mapbuf_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_mapbuf_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_mapbuf_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET), _enabled_set),
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET), _enabled_get),
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET), _smooth_set),
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET), _smooth_get),
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET), _alpha_set),
+ EO_OP_FUNC(ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET), _alpha_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET, "Enable or disable the map."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET, "Get a value whether map is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET, "Enable or disable smooth map rendering."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET, "Get a value whether smooth map rendering is enabled or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET, "Set or unset alpha flag for map rendering."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET, "Get a value whether alpha blending is enabled or not."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_MAPBUF_BASE_ID, op_desc, ELM_OBJ_MAPBUF_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Mapbuf_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_mapbuf_class_get, &class_desc, ELM_OBJ_CONTAINER_CLASS, NULL);
diff --git a/src/lib/elm_mapbuf.h b/src/lib/elm_mapbuf.h
index a95aef215..7eb63a944 100644
--- a/src/lib/elm_mapbuf.h
+++ b/src/lib/elm_mapbuf.h
@@ -31,6 +31,97 @@
* @ref mapbuf_example
*/
+#define ELM_OBJ_MAPBUF_CLASS elm_obj_mapbuf_class_get()
+
+const Eo_Class *elm_obj_mapbuf_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_MAPBUF_BASE_ID;
+
+enum
+{
+ ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET,
+ ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET,
+ ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET,
+ ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET,
+ ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET,
+ ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET,
+ ELM_OBJ_MAPBUF_SUB_ID_LAST
+};
+
+#define ELM_OBJ_MAPBUF_ID(sub_id) (ELM_OBJ_MAPBUF_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_mapbuf_enabled_set
+ * @since 1.8
+ *
+ * Enable or disable the map.
+ *
+ * @param[in] enabled
+ *
+ * @see elm_mapbuf_enabled_set
+ */
+#define elm_obj_mapbuf_enabled_set(enabled) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_mapbuf_enabled_get
+ * @since 1.8
+ *
+ * Get a value whether map is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_mapbuf_enabled_get
+ */
+#define elm_obj_mapbuf_enabled_get(ret) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_mapbuf_smooth_set
+ * @since 1.8
+ *
+ * Enable or disable smooth map rendering.
+ *
+ * @param[in] smooth
+ *
+ * @see elm_mapbuf_smooth_set
+ */
+#define elm_obj_mapbuf_smooth_set(smooth) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_SET), EO_TYPECHECK(Eina_Bool, smooth)
+
+/**
+ * @def elm_obj_mapbuf_smooth_get
+ * @since 1.8
+ *
+ * Get a value whether smooth map rendering is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_mapbuf_smooth_get
+ */
+#define elm_obj_mapbuf_smooth_get(ret) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_SMOOTH_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_mapbuf_alpha_set
+ * @since 1.8
+ *
+ * Set or unset alpha flag for map rendering.
+ *
+ * @param[in] alpha
+ *
+ * @see elm_mapbuf_alpha_set
+ */
+#define elm_obj_mapbuf_alpha_set(alpha) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_SET), EO_TYPECHECK(Eina_Bool, alpha)
+
+/**
+ * @def elm_obj_mapbuf_alpha_get
+ * @since 1.8
+ *
+ * Get a value whether alpha blending is enabled or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_mapbuf_alpha_get
+ */
+#define elm_obj_mapbuf_alpha_get(ret) ELM_OBJ_MAPBUF_ID(ELM_OBJ_MAPBUF_SUB_ID_ALPHA_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @addtogroup Mapbuf
* @{
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index 3bdaa11aa..d55891daa 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_menu.h"
-EAPI const char ELM_MENU_SMART_NAME[] = "elm_menu";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_MENU_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_MENU_CLASS
+
+#define MY_CLASS_NAME "elm_menu"
static const char SIG_CLICKED[] = "clicked";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
@@ -10,10 +16,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_MENU_SMART_NAME, _elm_menu, Elm_Menu_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
static void
_item_del(Elm_Menu_Item *item)
{
@@ -162,15 +164,19 @@ _sizing_eval(Evas_Object *obj)
if (item->submenu.open) _submenu_sizing_eval(item);
}
-static Eina_Bool
-_elm_menu_smart_theme(Evas_Object *obj)
+static void
+_elm_menu_smart_theme(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;
+ Elm_Menu_Smart_Data *sd = _pd;
+
Eina_List *l, *_l, *_ll, *ll = NULL;
Elm_Menu_Item *item;
- ELM_MENU_DATA_GET(obj, sd);
-
- if (!_elm_menu_parent_sc->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
ll = eina_list_append(ll, sd->items);
EINA_LIST_FOREACH(ll, _ll, l)
@@ -216,7 +222,7 @@ _elm_menu_smart_theme(Evas_Object *obj)
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -308,10 +314,11 @@ _parent_del_cb(void *data,
Evas_Object *obj,
void *event_info __UNUSED__)
{
- Elm_Menu_Smart_Data *sd = data;
+ ELM_MENU_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
evas_object_event_callback_del_full
- (obj, EVAS_CALLBACK_RESIZE, _parent_resize_cb, ELM_WIDGET_DATA(sd)->obj);
+ (obj, EVAS_CALLBACK_RESIZE, _parent_resize_cb, wd->obj);
sd->parent = NULL;
}
@@ -428,10 +435,9 @@ _menu_item_inactivate_cb(void *data,
}
static void
-_elm_menu_smart_show(Evas_Object *obj)
+_elm_menu_smart_show(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_MENU_DATA_GET(obj, sd);
-
+ Elm_Menu_Smart_Data *sd = _pd;
evas_object_show(sd->hv);
}
@@ -514,11 +520,11 @@ _item_submenu_obj_create(Elm_Menu_Item *item)
}
static void
-_elm_menu_smart_add(Evas_Object *obj)
+_elm_menu_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Menu_Smart_Data);
+ Elm_Menu_Smart_Data *priv = _pd;
- _elm_menu_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -540,16 +546,15 @@ _elm_menu_smart_add(Evas_Object *obj)
}
static void
-_elm_menu_smart_del(Evas_Object *obj)
+_elm_menu_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Menu_Item *item;
-
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Menu_Smart_Data *sd = _pd;
evas_object_event_callback_del_full
(sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj);
evas_object_event_callback_del_full
- (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, sd);
+ (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj);
EINA_LIST_FREE (sd->items, item)
_item_del(item);
@@ -560,16 +565,31 @@ _elm_menu_smart_del(Evas_Object *obj)
if (sd->hv) evas_object_del(sd->hv);
if (sd->location) evas_object_del(sd->location);
- _elm_menu_parent_sc->base.del(obj); /* handles freeing sd */
+ eo_do_super(obj, evas_obj_smart_del());
+}
+
+EAPI Evas_Object *
+elm_menu_add(Evas_Object *parent)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
}
static void
-_elm_menu_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Menu_Smart_Data *sd = _pd;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- elm_menu_parent_set(obj, parent);
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+
+ elm_menu_parent_set(obj, eo_parent_get(obj));
elm_hover_target_set(sd->hv, sd->location);
elm_layout_content_set
(sd->hv, elm_hover_best_content_location_get
@@ -578,71 +598,29 @@ _elm_menu_smart_parent_set(Evas_Object *obj,
_sizing_eval(obj);
}
-static void
-_elm_menu_smart_set_user(Elm_Menu_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_menu_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_menu_smart_del;
- ELM_WIDGET_CLASS(sc)->base.show = _elm_menu_smart_show;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_menu_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->theme = _elm_menu_smart_theme;
-}
-
-EAPI const Elm_Menu_Smart_Class *
-elm_menu_smart_class_get(void)
-{
- static Elm_Menu_Smart_Class _sc =
- ELM_MENU_SMART_CLASS_INIT_NAME_VERSION(ELM_MENU_SMART_NAME);
- static const Elm_Menu_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_menu_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
-EAPI Evas_Object *
-elm_menu_add(Evas_Object *parent)
-{
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_menu_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
-}
-
EAPI void
elm_menu_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
+ ELM_MENU_CHECK(obj);
+ eo_do(obj, elm_wdg_parent_set(parent));
+}
+
+static void
+_parent_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Menu_Smart_Data *sd = _pd;
Eina_List *l, *_l, *_ll, *ll = NULL;
Elm_Menu_Item *item;
- ELM_MENU_CHECK(obj);
- ELM_MENU_DATA_GET(obj, sd);
-
if (sd->parent == parent) return;
if (sd->parent)
{
evas_object_event_callback_del_full
(sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj);
evas_object_event_callback_del_full
- (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, sd);
+ (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj);
}
sd->parent = parent;
if (sd->parent)
@@ -650,7 +628,7 @@ elm_menu_parent_set(Evas_Object *obj,
evas_object_event_callback_add
(sd->parent, EVAS_CALLBACK_RESIZE, _parent_resize_cb, obj);
evas_object_event_callback_add
- (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, sd);
+ (sd->parent, EVAS_CALLBACK_DEL, _parent_del_cb, obj);
}
elm_hover_parent_set(sd->hv, parent);
@@ -676,9 +654,17 @@ EAPI Evas_Object *
elm_menu_parent_get(const Evas_Object *obj)
{
ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_parent_get(&ret));
+ return ret;
+}
- return sd->parent;
+static void
+_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Menu_Smart_Data *sd = _pd;
+ *ret = sd->parent;
}
EAPI void
@@ -687,7 +673,15 @@ elm_menu_move(Evas_Object *obj,
Evas_Coord y)
{
ELM_MENU_CHECK(obj);
- ELM_MENU_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_menu_move(x, y));
+}
+
+static void
+_move(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Menu_Smart_Data *sd = _pd;
sd->xloc = x;
sd->yloc = y;
@@ -698,8 +692,13 @@ EAPI void
elm_menu_close(Evas_Object *obj)
{
ELM_MENU_CHECK(obj);
- ELM_MENU_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_menu_close());
+}
+static void
+_close(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Menu_Smart_Data *sd = _pd;
_menu_hide(obj, sd->hv, NULL);
}
@@ -809,20 +808,36 @@ elm_menu_item_add(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_MENU_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_menu_item_add(parent, icon, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_add(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ const char *icon = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Menu_Item *subitem;
Evas_Object *icon_obj;
- ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Menu_Smart_Data *sd = _pd;
icon_obj = elm_icon_add(obj);
- if (!icon_obj) return NULL;
+ if (!icon_obj) return;
subitem = elm_widget_item_new(obj, Elm_Menu_Item);
if (!subitem)
{
evas_object_del(icon_obj);
- return NULL;
+ return;
}
elm_widget_item_del_pre_hook_set(subitem, _item_del_pre_hook);
@@ -848,7 +863,7 @@ elm_menu_item_add(Evas_Object *obj,
_elm_menu_item_add_helper(obj, (Elm_Menu_Item *)parent, subitem, sd);
- return (Elm_Object_Item *)subitem;
+ *ret = (Elm_Object_Item *)subitem;
}
EAPI unsigned int
@@ -889,27 +904,39 @@ EAPI Elm_Object_Item *
elm_menu_item_separator_add(Evas_Object *obj,
Elm_Object_Item *parent)
{
+ ELM_MENU_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_menu_item_separator_add(parent, &ret));
+ return ret;
+}
+
+static void
+_item_separator_add(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *parent = va_arg(*list, Elm_Object_Item *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Menu_Item *subitem;
Elm_Menu_Item *p_item = (Elm_Menu_Item *)parent;
- ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Menu_Smart_Data *sd = _pd;
/* don't add a separator as the first item */
- if (!sd->items) return NULL;
+ if (!sd->items) return;
/* don't allow adding more than one separator in a row */
if (p_item)
{
- if (!p_item->submenu.items) return NULL;
+ if (!p_item->submenu.items) return;
subitem = eina_list_last(p_item->submenu.items)->data;
}
else subitem = eina_list_last(sd->items)->data;
- if (subitem->separator) return NULL;
+ if (subitem->separator) return;
subitem = elm_widget_item_new(obj, Elm_Menu_Item);
- if (!subitem) return NULL;
+ if (!subitem) return;
elm_widget_item_del_pre_hook_set(subitem, _item_del_pre_hook);
elm_widget_item_disable_hook_set(subitem, _item_disable_hook);
@@ -934,7 +961,7 @@ elm_menu_item_separator_add(Evas_Object *obj,
}
_sizing_eval(obj);
- return (Elm_Object_Item *)subitem;
+ *ret = (Elm_Object_Item *)subitem;
}
EAPI const char *
@@ -965,9 +992,17 @@ EAPI const Eina_List *
elm_menu_items_get(const Evas_Object *obj)
{
ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_menu_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Menu_Smart_Data *sd = _pd;
+ *ret = sd->items;
}
EAPI void
@@ -1061,37 +1096,115 @@ EAPI Elm_Object_Item *
elm_menu_first_item_get(const Evas_Object *obj)
{
ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_menu_first_item_get(&ret));
+ return ret;
+}
- if (sd->items) return sd->items->data;
- return NULL;
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Menu_Smart_Data *sd = _pd;
+ *ret = (sd->items ? sd->items->data : NULL);
}
EAPI Elm_Object_Item *
elm_menu_last_item_get(const Evas_Object *obj)
{
ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_menu_last_item_get(&ret));
+ return ret;
+}
- Eina_List *l = eina_list_last(sd->items);
- if (l) return l->data;
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Menu_Smart_Data *sd = _pd;
- return NULL;
+ Eina_List *l = eina_list_last(sd->items);
+ *ret = (l ? l->data : NULL);
}
EAPI Elm_Object_Item *
elm_menu_selected_item_get(const Evas_Object *obj)
{
+ ELM_MENU_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_menu_selected_item_get(&ret));
+ return ret;
+}
+
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
Eina_List *l;
Elm_Menu_Item *item;
- ELM_MENU_CHECK(obj) NULL;
- ELM_MENU_DATA_GET(obj, sd);
+ Elm_Menu_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->items, l, item)
{
- if (item->selected) return (Elm_Object_Item *)item;
+ if (item->selected)
+ {
+ *ret = (Elm_Object_Item *)item;
+ return;
+ }
}
+}
- return NULL;
+static void
+_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_menu_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_menu_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_menu_smart_show),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_menu_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), _parent_get),
+
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_MOVE), _move),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_CLOSE), _close),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_ADD), _item_add),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD), _item_separator_add),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEMS_GET), _items_get),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_MOVE, "Move the menu to a new position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_CLOSE, "Close a opened menu."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_ITEM_ADD, "Add an item at the end of the given menu widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD, "Add a separator item to menu obj under parent."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_ITEMS_GET, "Returns a list of item's items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET, "Get the first item in the menu."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET, "Get the last item in the menu."),
+ EO_OP_DESCRIPTION(ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET, "Get the selected item in the menu."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_MENU_BASE_ID, op_desc, ELM_OBJ_MENU_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Menu_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_menu_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_menu.h b/src/lib/elm_menu.h
index 59331831a..1685fc974 100644
--- a/src/lib/elm_menu.h
+++ b/src/lib/elm_menu.h
@@ -34,6 +34,130 @@
* @{
*/
+#define ELM_OBJ_MENU_CLASS elm_obj_menu_class_get()
+
+const Eo_Class *elm_obj_menu_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_MENU_BASE_ID;
+
+enum
+{
+ ELM_OBJ_MENU_SUB_ID_MOVE,
+ ELM_OBJ_MENU_SUB_ID_CLOSE,
+ ELM_OBJ_MENU_SUB_ID_ITEM_ADD,
+ ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD,
+ ELM_OBJ_MENU_SUB_ID_ITEMS_GET,
+ ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_MENU_SUB_ID_LAST
+};
+
+#define ELM_OBJ_MENU_ID(sub_id) (ELM_OBJ_MENU_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_menu_move
+ * @since 1.8
+ *
+ * @brief Move the menu to a new position
+ *
+ * @param[in] x
+ * @param[in] y
+ *
+ * @see elm_menu_move
+ */
+#define elm_obj_menu_move(x, y) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_MOVE), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
+
+/**
+ * @def elm_obj_menu_close
+ * @since 1.8
+ *
+ * @brief Close a opened menu
+ *
+ *
+ * @see elm_menu_close
+ */
+#define elm_obj_menu_close() ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_CLOSE)
+
+/**
+ * @def elm_obj_menu_item_add
+ * @since 1.8
+ *
+ * @brief Add an item at the end of the given menu widget
+ *
+ * @param[in] parent
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_menu_item_add
+ */
+#define elm_obj_menu_item_add(parent, icon, label, func, data, ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_menu_item_separator_add
+ * @since 1.8
+ *
+ * @brief Add a separator item to menu obj under @p parent.
+ *
+ * @param[in] parent
+ * @param[out] ret
+ *
+ * @see elm_menu_item_separator_add
+ */
+#define elm_obj_menu_item_separator_add(parent, ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_menu_items_get
+ * @since 1.8
+ *
+ * @brief Returns a list of item's items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_menu_items_get
+ */
+#define elm_obj_menu_items_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_menu_first_item_get
+ * @since 1.8
+ *
+ * @brief Get the first item in the menu
+ *
+ * @param[out] ret
+ *
+ * @see elm_menu_first_item_get
+ */
+#define elm_obj_menu_first_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_menu_last_item_get
+ * @since 1.8
+ *
+ * @brief Get the last item in the menu
+ *
+ * @param[out] ret
+ *
+ * @see elm_menu_last_item_get
+ */
+#define elm_obj_menu_last_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_menu_selected_item_get
+ * @since 1.8
+ *
+ * @brief Get the selected item in the menu
+ *
+ * @param[out] ret
+ *
+ * @see elm_menu_selected_item_get
+ */
+#define elm_obj_menu_selected_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
/**
* @brief Add a new menu to the parent
*
diff --git a/src/lib/elm_notify.c b/src/lib/elm_notify.c
index 71b262883..9a3a7bbe3 100644
--- a/src/lib/elm_notify.c
+++ b/src/lib/elm_notify.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_notify.h"
+#include "elm_widget_container.h"
-EAPI const char ELM_NOTIFY_SMART_NAME[] = "elm_notify";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_NOTIFY_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_NOTIFY_CLASS
+
+#define MY_CLASS_NAME "elm_notify"
static const char SIG_BLOCK_CLICKED[] = "block,clicked";
static const char SIG_TIMEOUT[] = "timeout";
@@ -12,10 +19,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_NOTIFY_SMART_NAME, _elm_notify, Elm_Notify_Smart_Class,
- Elm_Container_Smart_Class, elm_container_smart_class_get, NULL);
-
static void
_notify_theme_apply(Evas_Object *obj)
{
@@ -109,12 +112,16 @@ _sizing_eval(Evas_Object *obj)
evas_object_resize(obj, w, h);
}
-static Eina_Bool
-_elm_notify_smart_theme(Evas_Object *obj)
+static void
+_elm_notify_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_notify_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
@@ -126,7 +133,7 @@ _elm_notify_smart_theme(Evas_Object *obj)
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -163,14 +170,17 @@ _changed_size_hints_cb(void *data,
_calc(data);
}
-static Eina_Bool
-_elm_notify_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_notify_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_notify_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sobj == sd->content)
{
@@ -180,7 +190,7 @@ _elm_notify_smart_sub_object_del(Evas_Object *obj,
sd->content = NULL;
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -204,21 +214,21 @@ _restack_cb(void *data __UNUSED__,
}
static void
-_elm_notify_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_notify_smart_resize(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.resize(obj, w, h);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
_calc(obj);
}
static void
-_elm_notify_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_notify_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.move(obj, x, y);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
_calc(obj);
}
@@ -254,11 +264,11 @@ _timer_init(Evas_Object *obj,
}
static void
-_elm_notify_smart_show(Evas_Object *obj)
+_elm_notify_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
evas_object_show(sd->notify);
if (!sd->allow_events) evas_object_show(sd->block_events);
@@ -267,11 +277,11 @@ _elm_notify_smart_show(Evas_Object *obj)
}
static void
-_elm_notify_smart_hide(Evas_Object *obj)
+_elm_notify_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.hide(obj);
+ eo_do_super(obj, evas_obj_smart_hide());
evas_object_hide(sd->notify);
if (!sd->allow_events) evas_object_hide(sd->block_events);
@@ -301,52 +311,76 @@ _parent_hide_cb(void *data,
evas_object_hide(data);
}
-static Eina_Bool
-_elm_notify_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_notify_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- Evas_Object *cur;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
- ELM_NOTIFY_DATA_GET(obj, sd);
+static void
+_elm_notify_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object *cur;
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Notify_Smart_Data *sd = _pd;
- if (!sd->content)
- return EINA_FALSE;
+ if (!sd->content) return;
cur = sd->content;
/* Try to cycle focus on content */
- return elm_widget_focus_next_get(cur, dir, next);
+ int_ret = elm_widget_focus_next_get(cur, dir, next);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_notify_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_notify_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_notify_smart_focus_direction(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
Evas_Object *cur;
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!sd->content)
- return EINA_FALSE;
+ Elm_Notify_Smart_Data *sd = _pd;
+
+ if (!sd->content) return;
cur = sd->content;
- return elm_widget_focus_direction_get(cur, base, degree, direction, weight);
+ int_ret = elm_widget_focus_direction_get(cur, base, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
-static Eina_Bool
-_elm_notify_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_notify_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
+
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (part && strcmp(part, "default")) return;
+ if (sd->content == content) goto end;
- if (part && strcmp(part, "default")) return EINA_FALSE;
- if (sd->content == content) return EINA_TRUE;
if (sd->content) evas_object_del(sd->content);
sd->content = content;
@@ -362,44 +396,50 @@ _elm_notify_smart_content_set(Evas_Object *obj,
_sizing_eval(obj);
_calc(obj);
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Evas_Object *
-_elm_notify_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_notify_smart_content_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
- if (part && strcmp(part, "default")) return NULL;
+ if (part && strcmp(part, "default")) return;
- return sd->content;
+ *ret = sd->content;
}
-static Evas_Object *
-_elm_notify_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_notify_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *content;
- ELM_NOTIFY_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
- if (part && strcmp(part, "default")) return NULL;
- if (!sd->content) return NULL;
+ Elm_Notify_Smart_Data *sd = _pd;
+
+ if (part && strcmp(part, "default")) return;
+ if (!sd->content) return;
content = sd->content;
elm_widget_sub_object_del(obj, sd->content);
edje_object_part_unswallow(sd->notify, content);
- return content;
+ if (ret) *ret = content;
}
static void
-_elm_notify_smart_add(Evas_Object *obj)
+_elm_notify_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Notify_Smart_Data);
+ Elm_Notify_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->allow_events = EINA_TRUE;
@@ -415,9 +455,9 @@ _elm_notify_smart_add(Evas_Object *obj)
}
static void
-_elm_notify_smart_del(Evas_Object *obj)
+_elm_notify_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Elm_Notify_Smart_Data *sd = _pd;
elm_notify_parent_set(obj, NULL);
elm_notify_allow_events_set(obj, EINA_FALSE);
@@ -427,72 +467,27 @@ _elm_notify_smart_del(Evas_Object *obj)
sd->timer = NULL;
}
- ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_notify_smart_parent_set(Evas_Object *obj,
- Evas_Object *parent)
-{
- elm_notify_parent_set(obj, parent);
-
- _sizing_eval(obj);
-}
-
-static void
-_elm_notify_smart_set_user(Elm_Notify_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_notify_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_notify_smart_del;
-
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_notify_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_notify_smart_move;
- ELM_WIDGET_CLASS(sc)->base.show = _elm_notify_smart_show;
- ELM_WIDGET_CLASS(sc)->base.hide = _elm_notify_smart_hide;
-
- ELM_WIDGET_CLASS(sc)->parent_set = _elm_notify_smart_parent_set;
- ELM_WIDGET_CLASS(sc)->theme = _elm_notify_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_notify_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_notify_smart_focus_direction;
-
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_notify_smart_sub_object_del;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_notify_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_notify_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_notify_smart_content_unset;
-}
-
-EAPI const Elm_Notify_Smart_Class *
-elm_notify_smart_class_get(void)
-{
- static Elm_Notify_Smart_Class _sc =
- ELM_NOTIFY_SMART_CLASS_INIT_NAME_VERSION(ELM_NOTIFY_SMART_NAME);
- static const Elm_Notify_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_notify_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_notify_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_notify_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -500,7 +495,14 @@ elm_notify_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
ELM_NOTIFY_CHECK(obj);
- ELM_NOTIFY_DATA_GET(obj, sd);
+ eo_do(obj, elm_wdg_parent_set(parent));
+}
+
+static void
+_elm_notify_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Notify_Smart_Data *sd = _pd;
if (sd->parent)
{
@@ -542,15 +544,31 @@ EAPI Evas_Object *
elm_notify_parent_get(const Evas_Object *obj)
{
ELM_NOTIFY_CHECK(obj) NULL;
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_parent_get(&ret));
+ return ret;
+}
- return sd->parent;
+static void
+_elm_notify_smart_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Notify_Smart_Data *sd = _pd;
+ *ret = sd->parent;
}
EINA_DEPRECATED EAPI void
elm_notify_orient_set(Evas_Object *obj,
Elm_Notify_Orient orient)
{
+ ELM_NOTIFY_CHECK(obj);
+ eo_do(obj, elm_obj_notify_orient_set(orient));
+}
+
+static void
+_orient_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Notify_Orient orient = va_arg(*list, Elm_Notify_Orient);
double horizontal = 0, vertical = 0;
switch (orient)
@@ -600,6 +618,16 @@ elm_notify_orient_set(Evas_Object *obj,
EINA_DEPRECATED EAPI Elm_Notify_Orient
elm_notify_orient_get(const Evas_Object *obj)
{
+ ELM_NOTIFY_CHECK(obj) - 1;
+ Elm_Notify_Orient ret = - 1;
+ eo_do((Eo *) obj, elm_obj_notify_orient_get(&ret));
+ return ret;
+}
+
+static void
+_orient_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Notify_Orient *ret = va_arg(*list, Elm_Notify_Orient *);
Elm_Notify_Orient orient;
double horizontal, vertical;
@@ -625,7 +653,7 @@ elm_notify_orient_get(const Evas_Object *obj)
orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
else
orient = ELM_NOTIFY_ORIENT_TOP;
- return orient;
+ *ret = orient;
}
EAPI void
@@ -633,7 +661,14 @@ elm_notify_timeout_set(Evas_Object *obj,
double timeout)
{
ELM_NOTIFY_CHECK(obj);
- ELM_NOTIFY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_notify_timeout_set(timeout));
+}
+
+static void
+_timeout_set(Eo *obj, void *_pd, va_list *list)
+{
+ double timeout = va_arg(*list, double);
+ Elm_Notify_Smart_Data *sd = _pd;
sd->timeout = timeout;
_timer_init(obj, sd);
@@ -643,9 +678,17 @@ EAPI double
elm_notify_timeout_get(const Evas_Object *obj)
{
ELM_NOTIFY_CHECK(obj) 0.0;
- ELM_NOTIFY_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_notify_timeout_get(&ret));
+ return ret;
+}
- return sd->timeout;
+static void
+_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Notify_Smart_Data *sd = _pd;
+ *ret = sd->timeout;
}
EAPI void
@@ -653,7 +696,14 @@ elm_notify_allow_events_set(Evas_Object *obj,
Eina_Bool allow)
{
ELM_NOTIFY_CHECK(obj);
- ELM_NOTIFY_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_notify_allow_events_set(allow));
+}
+
+static void
+_allow_events_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool allow = va_arg(*list, int);
+ Elm_Notify_Smart_Data *sd = _pd;
if (allow == sd->allow_events) return;
sd->allow_events = allow;
@@ -674,9 +724,17 @@ EAPI Eina_Bool
elm_notify_allow_events_get(const Evas_Object *obj)
{
ELM_NOTIFY_CHECK(obj) EINA_FALSE;
- ELM_NOTIFY_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_notify_allow_events_get(&ret));
+ return ret;
+}
- return sd->allow_events;
+static void
+_allow_events_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Notify_Smart_Data *sd = _pd;
+ *ret = sd->allow_events;
}
EAPI void
@@ -701,3 +759,60 @@ elm_notify_align_get(const Evas_Object *obj, double *horizontal, double *vertica
*horizontal = sd->horizontal_align;
*vertical = sd->vertical_align;
}
+
+static void
+_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_notify_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_notify_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_notify_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_notify_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_notify_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_notify_smart_hide),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_notify_smart_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), _elm_notify_smart_parent_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_notify_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_notify_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_notify_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_notify_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_notify_smart_focus_direction),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_notify_smart_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_notify_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_notify_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_notify_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET), _orient_set),
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET), _orient_get),
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET), _timeout_set),
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET), _timeout_get),
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET), _allow_events_set),
+ EO_OP_FUNC(ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET), _allow_events_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET, "Set the orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET, "Return the orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET, "Set the time interval after which the notify window is going to be hidden."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET, "Return the timeout value (in seconds)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET, "Sets whether events should be passed to by a click outside its area."),
+ EO_OP_DESCRIPTION(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET, "Return true if events are allowed below the notify object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_NOTIFY_BASE_ID, op_desc, ELM_OBJ_NOTIFY_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Notify_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_notify_class_get, &class_desc, ELM_OBJ_CONTAINER_CLASS, NULL);
diff --git a/src/lib/elm_notify.h b/src/lib/elm_notify.h
index 0e37b1fd8..eda24fa1d 100644
--- a/src/lib/elm_notify.h
+++ b/src/lib/elm_notify.h
@@ -34,6 +34,76 @@
#define ELM_NOTIFY_ALIGN_FILL -1.0 /**< Use with elm_notify_align_set() @since 1.8 */
+#define ELM_OBJ_NOTIFY_CLASS elm_obj_notify_class_get()
+
+const Eo_Class *elm_obj_notify_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_NOTIFY_BASE_ID;
+
+enum
+{
+ ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET,
+ ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET,
+ ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET,
+ ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET,
+ ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET,
+ ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET,
+ ELM_OBJ_NOTIFY_SUB_ID_LAST
+};
+
+#define ELM_OBJ_NOTIFY_ID(sub_id) (ELM_OBJ_NOTIFY_BASE_ID + sub_id)
+
+#define elm_obj_notify_orient_set(orient) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Notify_Orient, orient)
+#define elm_obj_notify_orient_get(ret) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Notify_Orient *, ret)
+
+/**
+ * @def elm_obj_notify_timeout_set
+ * @since 1.8
+ *
+ * @brief Set the time interval after which the notify window is going to be
+ *
+ * @param[in] timeout
+ *
+ * @see elm_notify_timeout_set
+ */
+#define elm_obj_notify_timeout_set(timeout) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_SET), EO_TYPECHECK(double, timeout)
+
+/**
+ * @def elm_obj_notify_timeout_get
+ * @since 1.8
+ *
+ * @brief Return the timeout value (in seconds)
+ *
+ * @param[out] ret
+ *
+ * @see elm_notify_timeout_get
+ */
+#define elm_obj_notify_timeout_get(ret) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_notify_allow_events_set
+ * @since 1.8
+ *
+ * @brief Sets whether events should be passed to by a click outside
+ *
+ * @param[in] allow
+ *
+ * @see elm_notify_allow_events_set
+ */
+#define elm_obj_notify_allow_events_set(allow) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_SET), EO_TYPECHECK(Eina_Bool, allow)
+
+/**
+ * @def elm_obj_notify_allow_events_get
+ * @since 1.8
+ *
+ * @brief Return true if events are allowed below the notify object
+ *
+ * @param[out] ret
+ *
+ * @see elm_notify_allow_events_get
+ */
+#define elm_obj_notify_allow_events_get(ret) ELM_OBJ_NOTIFY_ID(ELM_OBJ_NOTIFY_SUB_ID_ALLOW_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @brief Add a new notify to the parent
*
diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c
index 7fe0a218b..f43b6cb87 100644
--- a/src/lib/elm_panel.c
+++ b/src/lib/elm_panel.c
@@ -2,11 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_panel.h"
-EAPI const char ELM_PANEL_SMART_NAME[] = "elm_panel";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PANEL_SMART_NAME, _elm_panel, Elm_Panel_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_PANEL_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PANEL_CLASS
+
+#define MY_CLASS_NAME "elm_panel"
static void
_mirrored_set(Evas_Object *obj,
@@ -19,16 +21,17 @@ _mirrored_set(Evas_Object *obj,
}
static void
-_elm_panel_smart_sizing_eval(Evas_Object *obj)
+_elm_panel_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord mw = -1, mh = -1;
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->on_deletion) return;
evas_object_smart_calculate(sd->bx);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &mw, &mh);
+ edje_object_size_min_calc(wd->resize_obj, &mw, &mh);
evas_object_size_hint_min_set(obj, mw, mh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -50,6 +53,7 @@ static void
_orient_set_do(Evas_Object *obj)
{
ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
switch (sd->orient)
{
@@ -86,7 +90,7 @@ _orient_set_do(Evas_Object *obj)
{
Evas_Object *ao;
ao = _elm_access_edje_object_part_object_register
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, "btn_icon");
+ (obj, wd->resize_obj, "btn_icon");
_elm_access_text_set(_elm_access_object_get(ao),
ELM_ACCESS_TYPE, E_("panel button"));
_elm_access_callback_set
@@ -94,20 +98,24 @@ _orient_set_do(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_panel_smart_theme(Evas_Object *obj)
+static void
+_elm_panel_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
const char *str;
- ELM_PANEL_DATA_GET(obj, sd);
+ Eina_Bool int_ret = EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!ELM_WIDGET_CLASS(_elm_panel_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
str = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "focus_highlight");
+ (wd->resize_obj, "focus_highlight");
if ((str) && (!strcmp(str, "on")))
elm_widget_highlight_in_theme_set(obj, EINA_TRUE);
else
@@ -117,40 +125,55 @@ _elm_panel_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_panel_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_panel_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_panel_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *cur;
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!sd->content)
- return EINA_FALSE;
+ if (!sd->content) goto end;
cur = sd->content;
/* Try to Focus cycle in subitem */
if (!sd->hidden)
- return elm_widget_focus_next_get(cur, dir, next);
+ {
+ int_ret = elm_widget_focus_next_get(cur, dir, next);
+ goto end;
+ }
/* access */
if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
{
Evas_Object *ao, *po;
po = (Evas_Object *)edje_object_part_object_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "btn_icon");
+ (wd->resize_obj, "btn_icon");
ao = evas_object_data_get(po, "_part_access_obj");
_elm_access_highlight_set(ao);
}
/* Return */
*next = (Evas_Object *)obj;
- return !elm_widget_focus_get(obj);
+ int_ret = !elm_widget_focus_get(obj);
+
+end:
+ if (ret) *ret = int_ret;
}
static void
@@ -168,6 +191,7 @@ _panel_toggle(void *data __UNUSED__,
const char *source __UNUSED__)
{
ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->hidden)
{
@@ -187,44 +211,53 @@ _panel_toggle(void *data __UNUSED__,
}
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
-static Eina_Bool
-_elm_panel_smart_event(Evas_Object *obj,
- Evas_Object *src,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_panel_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if ((src != obj) || (type != EVAS_CALLBACK_KEY_DOWN)) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if ((src != obj) || (type != EVAS_CALLBACK_KEY_DOWN)) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((strcmp(ev->keyname, "Return")) &&
(strcmp(ev->keyname, "KP_Enter")) &&
(strcmp(ev->keyname, "space")))
- return EINA_FALSE;
+ return;
_panel_toggle(NULL, obj, NULL, NULL);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_panel_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_panel_smart_content_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_PANEL_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_TRUE;
+
+ Elm_Panel_Smart_Data *sd = _pd;
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS(_elm_panel_parent_sc)->content_set
- (obj, part, content);
+ {
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ goto end;
+ }
- if (sd->content == content) return EINA_TRUE;
+ if (sd->content == content) goto end;
if (sd->content)
evas_object_box_remove_all(sd->bx, EINA_TRUE);
sd->content = content;
@@ -236,55 +269,66 @@ _elm_panel_smart_content_set(Evas_Object *obj,
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+end:
+ if (ret) *ret = int_ret;
+
}
-static Evas_Object *
-_elm_panel_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_panel_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Smart_Data *sd = _pd;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS(_elm_panel_parent_sc)->content_get(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_get(part, ret));
+ return;
+ }
- return sd->content;
+ *ret = sd->content;
}
-static Evas_Object *
-_elm_panel_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_panel_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
- Evas_Object *content;
+ Evas_Object *content = NULL;
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Smart_Data *sd = _pd;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS
- (_elm_panel_parent_sc)->content_unset(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_unset(part, &content));
+ goto end;
+ }
- if (!sd->content) return NULL;
+ if (!sd->content) goto end;
content = sd->content;
evas_object_box_remove_all(sd->bx, EINA_FALSE);
sd->content = NULL;
- return content;
+end:
+ if (ret) *ret = content;
}
static void
-_elm_panel_smart_add(Evas_Object *obj)
+_elm_panel_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Panel_Smart_Data);
+ Elm_Panel_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_panel_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
/* just to bootstrap and have theme hook to work */
elm_layout_theme_set(obj, "panel", "top", elm_widget_style_get(obj));
- _elm_panel_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -305,91 +349,63 @@ _elm_panel_smart_add(Evas_Object *obj)
}
static void
-_elm_panel_smart_del(Evas_Object *obj)
+_elm_panel_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *child;
Eina_List *l;
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
sd->on_deletion = EINA_TRUE;
/* let's make our box object the *last* to be processed, since it
* may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(ELM_WIDGET_DATA(sd)->subobjs, l, child)
+ EINA_LIST_FOREACH(wd->subobjs, l, child)
{
if (child == sd->bx)
{
- ELM_WIDGET_DATA(sd)->subobjs =
- eina_list_demote_list(ELM_WIDGET_DATA(sd)->subobjs, l);
+ wd->subobjs =
+ eina_list_demote_list(wd->subobjs, l);
break;
}
}
- ELM_WIDGET_CLASS(_elm_panel_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_panel_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_panel_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_PANEL_CHECK(obj);
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ Eina_Bool is_access = va_arg(*list, int);
if (is_access)
_elm_access_edje_object_part_object_register
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, "btn_icon");
+ (obj, wd->resize_obj, "btn_icon");
else
_elm_access_edje_object_part_object_unregister
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, "btn_icon");
-}
-
-static void
-_elm_panel_smart_set_user(Elm_Panel_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_panel_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_panel_smart_del;
-
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_panel_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->theme = _elm_panel_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_panel_smart_event;
- ELM_WIDGET_CLASS(sc)->access = _elm_panel_smart_access;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_panel_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_panel_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_panel_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_panel_smart_sizing_eval;
-}
-
-EAPI const Elm_Panel_Smart_Class *
-elm_panel_smart_class_get(void)
-{
- static Elm_Panel_Smart_Class _sc =
- ELM_PANEL_SMART_CLASS_INIT_NAME_VERSION(ELM_PANEL_SMART_NAME);
- static const Elm_Panel_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_panel_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ (obj, wd->resize_obj, "btn_icon");
}
EAPI Evas_Object *
elm_panel_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_panel_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
@@ -397,7 +413,14 @@ elm_panel_orient_set(Evas_Object *obj,
Elm_Panel_Orient orient)
{
ELM_PANEL_CHECK(obj);
- ELM_PANEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_panel_orient_set(orient));
+}
+
+static void
+_orient_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Panel_Orient orient = va_arg(*list, Elm_Panel_Orient);
+ Elm_Panel_Smart_Data *sd = _pd;
if (sd->orient == orient) return;
sd->orient = orient;
@@ -411,9 +434,18 @@ EAPI Elm_Panel_Orient
elm_panel_orient_get(const Evas_Object *obj)
{
ELM_PANEL_CHECK(obj) ELM_PANEL_ORIENT_LEFT;
- ELM_PANEL_DATA_GET(obj, sd);
+ Elm_Panel_Orient ret = ELM_PANEL_ORIENT_LEFT;
+ eo_do((Eo *) obj, elm_obj_panel_orient_get(&ret));
+ return ret;
+}
- return sd->orient;
+static void
+_orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Panel_Orient *ret = va_arg(*list, Elm_Panel_Orient *);
+ Elm_Panel_Smart_Data *sd = _pd;
+
+ *ret = sd->orient;
}
EAPI void
@@ -421,7 +453,14 @@ elm_panel_hidden_set(Evas_Object *obj,
Eina_Bool hidden)
{
ELM_PANEL_CHECK(obj);
- ELM_PANEL_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_panel_hidden_set(hidden));
+}
+
+static void
+_hidden_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool hidden = va_arg(*list, int);
+ Elm_Panel_Smart_Data *sd = _pd;
if (sd->hidden == hidden) return;
@@ -432,15 +471,78 @@ EAPI Eina_Bool
elm_panel_hidden_get(const Evas_Object *obj)
{
ELM_PANEL_CHECK(obj) EINA_FALSE;
- ELM_PANEL_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_panel_hidden_get(&ret));
+ return ret;
+}
- return sd->hidden;
+static void
+_hidden_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Panel_Smart_Data *sd = _pd;
+
+ *ret = sd->hidden;
}
EAPI void
elm_panel_toggle(Evas_Object *obj)
{
ELM_PANEL_CHECK(obj);
+ eo_do(obj, elm_obj_panel_toggle());
+}
+static void
+_toggle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
_panel_toggle(NULL, obj, NULL, NULL);
}
+
+static void
+_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_panel_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_panel_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_panel_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_panel_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_panel_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_panel_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_panel_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_panel_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_panel_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_panel_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_panel_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_SET), _orient_set),
+ EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_GET), _orient_get),
+ EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET), _hidden_set),
+ EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET), _hidden_get),
+ EO_OP_FUNC(ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_TOGGLE), _toggle),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_ORIENT_SET, "Sets the orientation of the panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_ORIENT_GET, "Get the orientation of the panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET, "Set the state of the panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET, "Get the state of the panel."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANEL_SUB_ID_TOGGLE, "Toggle the hidden state of the panel from code."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PANEL_BASE_ID, op_desc, ELM_OBJ_PANEL_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Panel_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_panel_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_panel.h b/src/lib/elm_panel.h
index eade37e6e..bd70b1f8d 100644
--- a/src/lib/elm_panel.h
+++ b/src/lib/elm_panel.h
@@ -27,6 +27,87 @@
* @ref tutorial_panel shows one way to use this widget.
* @{
*/
+
+
+
+#define ELM_OBJ_PANEL_CLASS elm_obj_panel_class_get()
+
+const Eo_Class *elm_obj_panel_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PANEL_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PANEL_SUB_ID_ORIENT_SET,
+ ELM_OBJ_PANEL_SUB_ID_ORIENT_GET,
+ ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET,
+ ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET,
+ ELM_OBJ_PANEL_SUB_ID_TOGGLE,
+ ELM_OBJ_PANEL_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PANEL_ID(sub_id) (ELM_OBJ_PANEL_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_panel_orient_set
+ * @since 1.8
+ *
+ * @brief Sets the orientation of the panel
+ *
+ * @param[in] orient
+ *
+ * @see elm_panel_orient_set
+ */
+#define elm_obj_panel_orient_set(orient) ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_SET), EO_TYPECHECK(Elm_Panel_Orient, orient)
+
+/**
+ * @def elm_obj_panel_orient_get
+ * @since 1.8
+ *
+ * @brief Get the orientation of the panel.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panel_orient_get
+ */
+#define elm_obj_panel_orient_get(ret) ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_ORIENT_GET), EO_TYPECHECK(Elm_Panel_Orient *, ret)
+
+/**
+ * @def elm_obj_panel_hidden_set
+ * @since 1.8
+ *
+ * @brief Set the state of the panel.
+ *
+ * @param[in] hidden
+ *
+ * @see elm_panel_hidden_set
+ */
+#define elm_obj_panel_hidden_set(hidden) ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_SET), EO_TYPECHECK(Eina_Bool, hidden)
+
+/**
+ * @def elm_obj_panel_hidden_get
+ * @since 1.8
+ *
+ * @brief Get the state of the panel.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panel_hidden_get
+ */
+#define elm_obj_panel_hidden_get(ret) ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_HIDDEN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_panel_toggle
+ * @since 1.8
+ *
+ * @brief Toggle the hidden state of the panel from code
+ *
+ *
+ * @see elm_panel_toggle
+ */
+#define elm_obj_panel_toggle() ELM_OBJ_PANEL_ID(ELM_OBJ_PANEL_SUB_ID_TOGGLE)
+
typedef enum
{
ELM_PANEL_ORIENT_TOP, /**< Panel (dis)appears from the top */
diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c
index 9f91068ba..c29164137 100644
--- a/src/lib/elm_panes.c
+++ b/src/lib/elm_panes.c
@@ -1,7 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_widget_layout.h"
#include "elm_widget_panes.h"
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_PANES_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PANES_CLASS
+
+#define MY_CLASS_NAME "elm_panes"
/**
* TODO
* Update the minimun height of the bar in the theme.
@@ -9,8 +17,6 @@
* Add events (move, start ...)
*/
-EAPI const char ELM_PANES_SMART_NAME[] = "elm_panes";
-
static const char SIG_CLICKED[] = "clicked";
static const char SIG_PRESS[] = "press";
static const char SIG_UNPRESS[] = "unpress";
@@ -30,23 +36,24 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PANES_SMART_NAME, _elm_panes, Elm_Panes_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_panes_smart_theme(Evas_Object *obj)
+static void
+_elm_panes_smart_theme(Eo *obj, void *_pd, va_list *list)
{
double size;
- ELM_PANES_DATA_GET(obj, sd);
+ Elm_Panes_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
if (sd->horizontal)
- eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->group), "horizontal");
+ eina_stringshare_replace(&ld->group, "horizontal");
else
- eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->group), "vertical");
+ eina_stringshare_replace(&ld->group, "vertical");
- if (!ELM_WIDGET_CLASS(_elm_panes_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
size = elm_panes_content_left_size_get(obj);
@@ -56,13 +63,11 @@ _elm_panes_smart_theme(Evas_Object *obj)
elm_panes_content_left_size_set(obj, size);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_panes_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_panes_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
double w, h;
unsigned char i;
@@ -70,16 +75,27 @@ _elm_panes_smart_focus_next(const Evas_Object *obj,
Evas_Object *chain[2];
Evas_Object *left, *right;
- ELM_PANES_DATA_GET(obj, sd);
+ Elm_Panes_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.bar", &w, &h);
+ (wd->resize_obj, "elm.bar", &w, &h);
left = elm_layout_content_get(obj, "left");
right = elm_layout_content_get(obj, "right");
if (((sd->horizontal) && (h == 0.0)) || ((!sd->horizontal) && (w == 0.0)))
- return elm_widget_focus_next_get(right, dir, next);
+ {
+ int_ret = elm_widget_focus_next_get(right, dir, next);
+ if (ret) *ret = int_ret;
+ return;
+ }
/* Direction */
if (dir == ELM_FOCUS_PREVIOUS)
@@ -92,21 +108,24 @@ _elm_panes_smart_focus_next(const Evas_Object *obj,
chain[0] = left;
chain[1] = right;
}
- else return EINA_FALSE;
+ else return;
i = elm_widget_focus_get(chain[1]);
- if (elm_widget_focus_next_get(chain[i], dir, next)) return EINA_TRUE;
+ if (elm_widget_focus_next_get(chain[i], dir, next))
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
i = !i;
if (elm_widget_focus_next_get(chain[i], dir, &to_focus))
{
*next = to_focus;
- return !!i;
+ if (ret) *ret = !!i;
+ return;
}
-
- return EINA_FALSE;
}
static void
@@ -155,27 +174,27 @@ _on_unpressed(void *data,
}
static void
-_elm_panes_smart_add(Evas_Object *obj)
+_elm_panes_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Panes_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_panes_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "panes", "vertical", elm_widget_style_get(obj));
elm_panes_content_left_size_set(obj, 0.5);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,click", "",
+ (wd->resize_obj, "elm,action,click", "",
_on_clicked, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,click,double", "",
+ (wd->resize_obj, "elm,action,click,double", "",
_double_clicked, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,press", "",
+ (wd->resize_obj, "elm,action,press", "",
_on_pressed, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,unpress", "",
+ (wd->resize_obj, "elm,action,unpress", "",
_on_unpressed, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -183,49 +202,26 @@ _elm_panes_smart_add(Evas_Object *obj)
elm_layout_sizing_eval(obj);
}
-static void
-_elm_panes_smart_set_user(Elm_Panes_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_panes_smart_add;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_panes_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_panes_smart_focus_next;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
-}
-
-EAPI const Elm_Panes_Smart_Class *
-elm_panes_smart_class_get(void)
-{
- static Elm_Panes_Smart_Class _sc =
- ELM_PANES_SMART_CLASS_INIT_NAME_VERSION(ELM_PANES_SMART_NAME);
- static const Elm_Panes_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_panes_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_panes_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_panes_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EINA_DEPRECATED EAPI void
@@ -269,16 +265,26 @@ elm_panes_content_right_unset(Evas_Object *obj)
EAPI double
elm_panes_content_left_size_get(const Evas_Object *obj)
{
+ ELM_PANES_CHECK(obj) 0.0;
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_panes_content_left_size_get(&ret));
+ return ret;
+}
+
+static void
+_elm_panes_smart_content_left_size_get(Eo *obj, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
double w, h;
- ELM_PANES_CHECK(obj) 0.0;
- ELM_PANES_DATA_GET(obj, sd);
+ Elm_Panes_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.bar", &w, &h);
+ (wd->resize_obj, "elm.bar", &w, &h);
- if (sd->horizontal) return h;
- else return w;
+ if (sd->horizontal) *ret = h;
+ else *ret = w;
}
EAPI void
@@ -286,23 +292,40 @@ elm_panes_content_left_size_set(Evas_Object *obj,
double size)
{
ELM_PANES_CHECK(obj);
- ELM_PANES_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_panes_content_left_size_set(size));
+}
+
+static void
+_elm_panes_smart_content_left_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ double size = va_arg(*list, double);
+ Elm_Panes_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (size < 0.0) size = 0.0;
else if (size > 1.0)
size = 1.0;
if (sd->horizontal)
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.bar", 0.0, size);
+ (wd->resize_obj, "elm.bar", 0.0, size);
else
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.bar", size, 0.0);
+ (wd->resize_obj, "elm.bar", size, 0.0);
}
EAPI double
elm_panes_content_right_size_get(const Evas_Object *obj)
{
- return 1.0 - elm_panes_content_left_size_get(obj);
+ double ret = 1.0;
+ eo_do((Eo *) obj, elm_obj_panes_content_right_size_get(&ret));
+ return ret;
+}
+
+static void
+_elm_panes_smart_content_right_size_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = 1.0 - elm_panes_content_left_size_get(obj);
}
EAPI void
@@ -310,6 +333,14 @@ elm_panes_content_right_size_set(Evas_Object *obj,
double size)
{
elm_panes_content_left_size_set(obj, (1.0 - size));
+ eo_do(obj, elm_obj_panes_content_right_size_set(size));
+}
+
+static void
+_elm_panes_smart_content_right_size_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double size = va_arg(*list, double);
+ elm_panes_content_left_size_set(obj, (1.0 - size));
}
EAPI void
@@ -317,10 +348,17 @@ elm_panes_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_PANES_CHECK(obj);
- ELM_PANES_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_panes_horizontal_set(horizontal));
+}
+
+static void
+_elm_panes_smart_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Panes_Smart_Data *sd = _pd;
sd->horizontal = horizontal;
- _elm_panes_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
elm_panes_content_left_size_set(obj, 0.5);
}
@@ -329,16 +367,31 @@ EAPI Eina_Bool
elm_panes_horizontal_get(const Evas_Object *obj)
{
ELM_PANES_CHECK(obj) EINA_FALSE;
- ELM_PANES_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_panes_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_elm_panes_smart_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Panes_Smart_Data *sd = _pd;
+ *ret = sd->horizontal;
}
EAPI void
elm_panes_fixed_set(Evas_Object *obj, Eina_Bool fixed)
{
ELM_PANES_CHECK(obj);
- ELM_PANES_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_panes_fixed_set(fixed));
+}
+
+static void
+_elm_panes_smart_fixed_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool fixed = va_arg(*list, int);
+ Elm_Panes_Smart_Data *sd = _pd;
sd->fixed = !!fixed;
if (sd->fixed == EINA_TRUE)
@@ -351,7 +404,78 @@ EAPI Eina_Bool
elm_panes_fixed_get(const Evas_Object *obj)
{
ELM_PANES_CHECK(obj) EINA_FALSE;
- ELM_PANES_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_panes_fixed_get(&ret));
+ return ret;
+}
+
+static void
+_elm_panes_smart_fixed_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Panes_Smart_Data *sd = _pd;
+ *ret = sd->fixed;
+}
- return sd->fixed;
+static void
+_elm_panes_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
+
+static void
+_elm_panes_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
+}
+
+static void
+_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_panes_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_panes_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_panes_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_panes_smart_focus_next),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_panes_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_GET), _elm_panes_smart_content_left_size_get),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_SET), _elm_panes_smart_content_left_size_set),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_GET), _elm_panes_smart_content_right_size_get),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_SET), _elm_panes_smart_content_right_size_set),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_SET), _elm_panes_smart_horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_GET), _elm_panes_smart_horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_FIXED_SET), _elm_panes_smart_fixed_set),
+ EO_OP_FUNC(ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_FIXED_GET), _elm_panes_smart_fixed_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_GET, "Get the size proportion of panes widget's left side."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_SET, "Set the size proportion of panes widget's left side."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_GET, "Get the size proportion of panes widget's right side."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_SET, "Set the size proportion of panes widget's right side."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_SET, "Set the orientation of a given panes widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_GET, "Retrieve the orientation of a given panes widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_FIXED_SET, "Set whether the left and right panes resize homogeneously or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PANES_SUB_ID_FIXED_GET, "Retrieve the resize mode for the panes of a given panes widget."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PANES_BASE_ID, op_desc, ELM_OBJ_PANES_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Panes_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_panes_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_panes.h b/src/lib/elm_panes.h
index 07686bed4..8e4d09797 100644
--- a/src/lib/elm_panes.h
+++ b/src/lib/elm_panes.h
@@ -46,6 +46,123 @@
* @li @ref panes_example
*/
+#define ELM_OBJ_PANES_CLASS elm_obj_panes_class_get()
+
+const Eo_Class *elm_obj_panes_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PANES_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_GET,
+ ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_SET,
+ ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_GET,
+ ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_SET,
+ ELM_OBJ_PANES_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_PANES_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_PANES_SUB_ID_FIXED_SET,
+ ELM_OBJ_PANES_SUB_ID_FIXED_GET,
+ ELM_OBJ_PANES_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PANES_ID(sub_id) (ELM_OBJ_PANES_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_panes_content_left_size_get
+ * @since 1.8
+ *
+ * Get the size proportion of panes widget's left side.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panes_content_left_size_get
+ */
+#define elm_obj_panes_content_left_size_get(ret) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_panes_content_left_size_set
+ * @since 1.8
+ *
+ * Set the size proportion of panes widget's left side.
+ *
+ * @param[in] size
+ *
+ * @see elm_panes_content_left_size_set
+ */
+#define elm_obj_panes_content_left_size_set(size) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_LEFT_SIZE_SET), EO_TYPECHECK(double, size)
+
+/**
+ * @def elm_obj_panes_content_right_size_get
+ * @since 1.8
+ *
+ * Get the size proportion of panes widget's right side.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panes_content_right_size_get
+ */
+#define elm_obj_panes_content_right_size_get(ret) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_panes_content_right_size_set
+ * @since 1.8
+ *
+ * Set the size proportion of panes widget's right side.
+ *
+ * @param[in] size
+ *
+ * @see elm_panes_content_right_size_set
+ */
+#define elm_obj_panes_content_right_size_set(size) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_CONTENT_RIGHT_SIZE_SET), EO_TYPECHECK(double, size)
+
+/**
+ * @def elm_obj_panes_horizontal_set
+ * @since 1.8
+ *
+ * Set the orientation of a given panes widget.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_panes_horizontal_set
+ */
+#define elm_obj_panes_horizontal_set(horizontal) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_panes_horizontal_get
+ * @since 1.8
+ *
+ * Retrieve the orientation of a given panes widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panes_horizontal_get
+ */
+#define elm_obj_panes_horizontal_get(ret) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_panes_fixed_set
+ * @since 1.8
+ *
+ * Set whether the left and right panes resize homogeneously or not.
+ *
+ * @param[in] fixed
+ *
+ * @see elm_panes_fixed_set
+ */
+#define elm_obj_panes_fixed_set(fixed) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed)
+
+/**
+ * @def elm_obj_panes_fixed_get
+ * @since 1.8
+ *
+ * Retrieve the resize mode for the panes of a given panes widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_panes_fixed_get
+ */
+#define elm_obj_panes_fixed_get(ret) ELM_OBJ_PANES_ID(ELM_OBJ_PANES_SUB_ID_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @addtogroup Panes
* @{
diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c
index 4923cae03..0addae74f 100644
--- a/src/lib/elm_photo.c
+++ b/src/lib/elm_photo.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_photo.h"
-EAPI const char ELM_PHOTO_SMART_NAME[] = "elm_photo";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_PHOTO_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PHOTO_CLASS
+
+#define MY_CLASS_NAME "elm_photo"
static const char SIG_CLICKED[] = "clicked";
static const char SIG_DRAG_START[] = "drag,start";
@@ -14,10 +20,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PHOTO_SMART_NAME, _elm_photo, Elm_Photo_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
static void
_sizing_eval(Evas_Object *obj)
{
@@ -25,6 +27,7 @@ _sizing_eval(Evas_Object *obj)
double scale;
ELM_PHOTO_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->size <= 0) return;
@@ -33,7 +36,7 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_min_set(sd->icon, scale, scale);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
maxw = minw;
maxh = minh;
@@ -41,28 +44,32 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
-static Eina_Bool
-_elm_photo_smart_theme(Evas_Object *obj)
+static void
+_elm_photo_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_PHOTO_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Photo_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!ELM_WIDGET_CLASS(_elm_photo_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
edje_object_mirrored_set
- (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj));
+ (wd->resize_obj, elm_widget_mirrored_get(obj));
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, "photo", "base",
+ (obj, wd->resize_obj, "photo", "base",
elm_widget_style_get(obj));
elm_object_scale_set(sd->icon, elm_widget_scale_get(obj));
- edje_object_scale_set(ELM_WIDGET_DATA(sd)->resize_obj,
+ edje_object_scale_set(wd->resize_obj,
elm_widget_scale_get(obj) * elm_config_scale_get());
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -74,6 +81,7 @@ _icon_move_resize_cb(void *data,
Evas_Coord w, h;
ELM_PHOTO_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->fill_inside)
{
@@ -87,7 +95,7 @@ _icon_move_resize_cb(void *data,
msg->val[1] = (int)h;
edje_object_message_send
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_MESSAGE_INT_SET, 0, msg);
+ (wd->resize_obj, EDJE_MESSAGE_INT_SET, 0, msg);
}
#ifdef HAVE_ELEMENTARY_ETHUMB
@@ -240,11 +248,12 @@ _on_thumb_done(void *data,
}
static void
-_elm_photo_smart_add(Evas_Object *obj)
+_elm_photo_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Photo_Smart_Data);
+ Elm_Photo_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_photo_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -278,88 +287,75 @@ _elm_photo_smart_add(Evas_Object *obj)
(obj, edje_object_add(evas_object_evas_get(obj)));
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, "photo", "base", "default");
+ (obj, wd->resize_obj, "photo", "base", "default");
edje_object_part_swallow
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.swallow.content", priv->icon);
+ (wd->resize_obj, "elm.swallow.content", priv->icon);
elm_photo_file_set(obj, NULL);
}
static void
-_elm_photo_smart_del(Evas_Object *obj)
+_elm_photo_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_PHOTO_DATA_GET(obj, sd);
+ Elm_Photo_Smart_Data * sd = _pd;
if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer);
sd->long_press_timer = NULL;
- ELM_WIDGET_CLASS(_elm_photo_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_photo_smart_set_user(Elm_Photo_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_photo_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_photo_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_photo_smart_theme;
-}
-
-EAPI const Elm_Photo_Smart_Class *
-elm_photo_smart_class_get(void)
-{
- static Elm_Photo_Smart_Class _sc =
- ELM_PHOTO_SMART_CLASS_INIT_NAME_VERSION(ELM_PHOTO_SMART_NAME);
- static const Elm_Photo_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_photo_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_photo_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_photo_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
return obj;
}
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+}
+
EAPI Eina_Bool
elm_photo_file_set(Evas_Object *obj,
const char *file)
{
ELM_PHOTO_CHECK(obj) EINA_FALSE;
- ELM_PHOTO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_photo_file_set(file, &ret));
+ return ret;
+}
+
+static void
+_file_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Elm_Photo_Smart_Data *sd = _pd;
if (!file)
{
if (!elm_icon_standard_set(sd->icon, "no_photo"))
- return EINA_FALSE;
+ return;
}
else
{
if (!elm_image_file_set(sd->icon, file, NULL))
- return EINA_FALSE;
+ return;
}
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI void
@@ -367,7 +363,14 @@ elm_photo_size_set(Evas_Object *obj,
int size)
{
ELM_PHOTO_CHECK(obj);
- ELM_PHOTO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photo_size_set(size));
+}
+
+static void
+_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ int size = va_arg(*list, int);
+ Elm_Photo_Smart_Data *sd = _pd;
sd->size = (size > 0) ? size : 0;
@@ -381,7 +384,14 @@ elm_photo_fill_inside_set(Evas_Object *obj,
Eina_Bool fill)
{
ELM_PHOTO_CHECK(obj);
- ELM_PHOTO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photo_fill_inside_set(fill));
+}
+
+static void
+_fill_inside_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool fill = va_arg(*list, int);
+ Elm_Photo_Smart_Data *sd = _pd;
elm_image_fill_outside_set(sd->icon, !fill);
sd->fill_inside = !!fill;
@@ -391,23 +401,37 @@ elm_photo_fill_inside_set(Evas_Object *obj,
EAPI void
elm_photo_editable_set(Evas_Object *obj,
- Eina_Bool set)
+ Eina_Bool set)
{
ELM_PHOTO_CHECK(obj);
- ELM_PHOTO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photo_editable_set(set));
+}
+static void
+_editable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool set = va_arg(*list, int);
+ Elm_Photo_Smart_Data *sd = _pd;
elm_image_editable_set(sd->icon, set);
}
EAPI void
elm_photo_thumb_set(const Evas_Object *obj,
- const char *file,
- const char *group)
+ const char *file,
+ const char *group)
{
ELM_PHOTO_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_photo_thumb_set(file, group));
+}
+
+static void
+_thumb_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
#ifdef HAVE_ELEMENTARY_ETHUMB
- ELM_PHOTO_DATA_GET(obj, sd);
+ Elm_Photo_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->thumb.file.path, file);
eina_stringshare_replace(&sd->thumb.file.key, group);
@@ -422,19 +446,81 @@ elm_photo_thumb_set(const Evas_Object *obj,
EAPI void
elm_photo_aspect_fixed_set(Evas_Object *obj,
- Eina_Bool fixed)
+ Eina_Bool fixed)
{
ELM_PHOTO_CHECK(obj);
- ELM_PHOTO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photo_aspect_fixed_set(fixed));
+}
- return elm_image_aspect_fixed_set(sd->icon, fixed);
+static void
+_aspect_fixed_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool fixed = va_arg(*list, int);
+ Elm_Photo_Smart_Data *sd = _pd;
+ elm_image_aspect_fixed_set(sd->icon, fixed);
}
EAPI Eina_Bool
elm_photo_aspect_fixed_get(const Evas_Object *obj)
{
ELM_PHOTO_CHECK(obj) EINA_FALSE;
- ELM_PHOTO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_photo_aspect_fixed_get(&ret));
+ return ret;
+}
- return elm_image_aspect_fixed_get(sd->icon);
+static void
+_aspect_fixed_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Photo_Smart_Data *sd = _pd;
+ *ret = elm_image_aspect_fixed_get(sd->icon);
}
+
+static void
+_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_photo_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_photo_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_photo_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_SET), _size_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET), _fill_inside_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET), _editable_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_THUMB_SET), _thumb_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET), _aspect_fixed_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET), _aspect_fixed_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_FILE_SET, "Set the file that will be used as the photo widget's image."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_SIZE_SET, "Set the size that will be used on the photo."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET, "Set if the photo should be completely visible or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET, "Set editability of the photo."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_THUMB_SET, "Set the file that will be used as thumbnail in the photo."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET, "Set whether the original aspect ratio of the photo should be kept on resize."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET, "Get if the object keeps the original aspect ratio."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PHOTO_BASE_ID, op_desc, ELM_OBJ_PHOTO_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Photo_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_photo_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, EVAS_SMART_DRAGGABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_photo.h b/src/lib/elm_photo.h
index 47c8763b9..e0f3b2a12 100644
--- a/src/lib/elm_photo.h
+++ b/src/lib/elm_photo.h
@@ -24,6 +24,125 @@
* @{
*/
+#define ELM_OBJ_PHOTO_CLASS elm_obj_photo_class_get()
+
+const Eo_Class *elm_obj_photo_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PHOTO_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PHOTO_SUB_ID_FILE_SET,
+ ELM_OBJ_PHOTO_SUB_ID_SIZE_SET,
+ ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET,
+ ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_PHOTO_SUB_ID_THUMB_SET,
+ ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET,
+ ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET,
+ ELM_OBJ_PHOTO_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PHOTO_ID(sub_id) (ELM_OBJ_PHOTO_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_photo_add
+ * @since 1.8
+ *
+ * Add a new photo to the parent
+ *
+ * @param[out] ret
+ *
+ * @see elm_photo_add
+ */
+#define elm_obj_photo_add(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ADD), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_photo_file_set
+ * @since 1.8
+ *
+ * Set the file that will be used as the photo widget's image.
+ *
+ * @param[in] file
+ * @param[out] ret
+ *
+ * @see elm_photo_file_set
+ */
+#define elm_obj_photo_file_set(file, ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_photo_size_set
+ * @since 1.8
+ *
+ * Set the size that will be used on the photo
+ *
+ * @param[in] size
+ *
+ * @see elm_photo_size_set
+ */
+#define elm_obj_photo_size_set(size) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_SIZE_SET), EO_TYPECHECK(int, size)
+
+/**
+ * @def elm_obj_photo_fill_inside_set
+ * @since 1.8
+ *
+ * Set if the photo should be completely visible or not.
+ *
+ * @param[in] fill
+ *
+ * @see elm_photo_fill_inside_set
+ */
+#define elm_obj_photo_fill_inside_set(fill) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_FILL_INSIDE_SET), EO_TYPECHECK(Eina_Bool, fill)
+
+/**
+ * @def elm_obj_photo_editable_set
+ * @since 1.8
+ *
+ * Set editability of the photo.
+ *
+ * @param[in] set
+ *
+ * @see elm_photo_editable_set
+ */
+#define elm_obj_photo_editable_set(set) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, set)
+
+/**
+ * @def elm_obj_photo_thumb_set
+ * @since 1.8
+ *
+ * Set the file that will be used as thumbnail in the photo.
+ *
+ * @param[in] file
+ * @param[in] group
+ *
+ * @see elm_photo_thumb_set
+ */
+#define elm_obj_photo_thumb_set(file, group) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_THUMB_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, group)
+
+/**
+ * @def elm_obj_photo_aspect_fixed_set
+ * @since 1.8
+ *
+ * Set whether the original aspect ratio of the photo should be kept on resize.
+ *
+ * @param[in] fixed
+ *
+ * @see elm_photo_aspect_fixed_set
+ */
+#define elm_obj_photo_aspect_fixed_set(fixed) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_SET), EO_TYPECHECK(Eina_Bool, fixed)
+
+/**
+ * @def elm_obj_photo_aspect_fixed_get
+ * @since 1.8
+ *
+ * Get if the object keeps the original aspect ratio.
+ *
+ * @param[out] ret
+ *
+ * @see elm_photo_aspect_fixed_get
+ */
+#define elm_obj_photo_aspect_fixed_get(ret) ELM_OBJ_PHOTO_ID(ELM_OBJ_PHOTO_SUB_ID_ASPECT_FIXED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* Add a new photo to the parent
*
diff --git a/src/lib/elm_photocam.c b/src/lib/elm_photocam.c
index fb8aeb861..1904c4019 100644
--- a/src/lib/elm_photocam.c
+++ b/src/lib/elm_photocam.c
@@ -1,6 +1,19 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_photocam.h"
+#include "elm_interface_scrollable.h"
+
+EAPI Eo_Op ELM_OBJ_PHOTOCAM_PAN_BASE_ID = EO_NOOP;
+
+#define MY_PAN_CLASS ELM_OBJ_PHOTOCAM_PAN_CLASS
+
+#define MY_PAN_CLASS_NAME "elm_photocam_pan"
+
+EAPI Eo_Op ELM_OBJ_PHOTOCAM_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PHOTOCAM_CLASS
+
+#define MY_CLASS_NAME "elm_photocam"
/*
* TODO (maybe - optional future stuff):
@@ -11,9 +24,6 @@
* 3. rotation flags in exif handling (nasty! should have rot in evas)
*/
-EAPI const char ELM_PHOTOCAM_SMART_NAME[] = "elm_photocam";
-EAPI const char ELM_PHOTOCAM_PAN_SMART_NAME[] = "elm_photocam_pan";
-
static const char SIG_CLICKED[] = "clicked";
static const char SIG_PRESS[] = "press";
static const char SIG_LONGPRESSED[] = "longpressed";
@@ -50,30 +60,15 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_PHOTOCAM_SMART_NAME, _elm_photocam, Elm_Photocam_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
-ELM_INTERNAL_SMART_SUBCLASS_NEW
- (ELM_PHOTOCAM_PAN_SMART_NAME, _elm_photocam_pan,
- Elm_Photocam_Pan_Smart_Class, Elm_Pan_Smart_Class, elm_pan_smart_class_get,
- NULL);
-
static void
_sizing_eval(Evas_Object *obj)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_size_hint_max_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &maxw, &maxh);
+ (wd->resize_obj, &maxw, &maxh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
}
@@ -81,7 +76,8 @@ _sizing_eval(Evas_Object *obj)
static void
_calc_job_cb(void *data)
{
- Elm_Photocam_Smart_Data *sd = data;
+ Evas_Object *obj = data;
+ ELM_PHOTOCAM_DATA_GET(obj, sd);
Evas_Coord minw, minh;
minw = sd->size.w;
@@ -93,7 +89,7 @@ _calc_job_cb(void *data)
{
double tz = sd->zoom;
sd->zoom = 0.0;
- elm_photocam_zoom_set(ELM_WIDGET_DATA(sd)->obj, tz);
+ elm_photocam_zoom_set(obj, tz);
}
}
if ((minw != sd->minw) || (minh != sd->minh))
@@ -102,47 +98,38 @@ _calc_job_cb(void *data)
sd->minh = minh;
evas_object_smart_callback_call(sd->pan_obj, "changed", NULL);
- _sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ _sizing_eval(obj);
}
sd->calc_job = NULL;
evas_object_smart_changed(sd->pan_obj);
}
static void
-_elm_photocam_pan_smart_add(Evas_Object *obj)
-{
- /* here just to allocate our extended data */
- EVAS_SMART_DATA_ALLOC(obj, Elm_Photocam_Pan_Smart_Data);
-
- ELM_PAN_CLASS(_elm_photocam_pan_parent_sc)->base.add(obj);
-}
-
-static void
-_elm_photocam_pan_smart_move(Evas_Object *obj,
- Evas_Coord x __UNUSED__,
- Evas_Coord y __UNUSED__)
+_elm_photocam_pan_smart_move(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
+ va_arg(*list, Evas_Coord);
+ va_arg(*list, Evas_Coord);
if (psd->wsd->calc_job) ecore_job_del(psd->wsd->calc_job);
- psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wsd);
+ psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wobj);
}
static void
-_elm_photocam_pan_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_photocam_pan_smart_resize(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
Evas_Coord ow, oh;
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
if ((ow == w) && (oh == h)) return;
psd->wsd->resized = EINA_TRUE;
if (psd->wsd->calc_job) ecore_job_del(psd->wsd->calc_job);
- psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wsd);
+ psd->wsd->calc_job = ecore_job_add(_calc_job_cb, psd->wobj);
}
static void
@@ -173,8 +160,8 @@ _image_place(Evas_Object *obj,
if (sd->show.show)
{
sd->show.show = EINA_FALSE;
- sd->s_iface->content_region_show
- (obj, sd->show.x, sd->show.y, sd->show.w, sd->show.h);
+ eo_do(obj, elm_scrollable_interface_content_region_show
+ (sd->show.x, sd->show.y, sd->show.w, sd->show.h));
}
}
@@ -186,6 +173,7 @@ _grid_load(Evas_Object *obj,
Evas_Coord ox, oy, ow, oh, cvx, cvy, cvw, cvh, gw, gh, tx, ty;
ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_geometry_get(sd->pan_obj, &ox, &oy, &ow, &oh);
evas_output_viewport_get(evas_object_evas_get(obj), &cvx, &cvy, &cvw, &cvh);
@@ -236,7 +224,7 @@ _grid_load(Evas_Object *obj,
if (sd->preload_num == 1)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
"elm,state,busy,start", "elm");
evas_object_smart_callback_call
(obj, SIG_LOAD_DETAIL, NULL);
@@ -248,7 +236,7 @@ _grid_load(Evas_Object *obj,
if (!sd->preload_num)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
"elm,state,busy,stop", "elm");
evas_object_smart_callback_call
(obj, SIG_LOADED_DETAIL, NULL);
@@ -325,36 +313,37 @@ _grid_place(Evas_Object *obj,
}
static void
-_elm_photocam_pan_smart_calculate(Evas_Object *obj)
+_elm_photocam_pan_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Phocam_Grid *g;
Eina_List *l;
Evas_Coord ox, oy, ow, oh;
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(psd->wobj, ELM_OBJ_WIDGET_CLASS);
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
_image_place(
- ELM_WIDGET_DATA(psd->wsd)->obj, psd->wsd->pan_x, psd->wsd->pan_y,
+ wd->obj, psd->wsd->pan_x, psd->wsd->pan_y,
ox - psd->wsd->g_layer_zoom.imx, oy - psd->wsd->g_layer_zoom.imy, ow,
oh);
EINA_LIST_FOREACH(psd->wsd->grids, l, g)
{
- _grid_load(ELM_WIDGET_DATA(psd->wsd)->obj, g);
+ _grid_load(wd->obj, g);
_grid_place(
- ELM_WIDGET_DATA(psd->wsd)->obj, g, psd->wsd->pan_x,
+ wd->obj, g, psd->wsd->pan_x,
psd->wsd->pan_y, ox - psd->wsd->g_layer_zoom.imx,
oy - psd->wsd->g_layer_zoom.imy, ow, oh);
}
}
static void
-_elm_photocam_pan_smart_pos_set(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_photocam_pan_smart_pos_set(Eo *obj, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
if ((x == psd->wsd->pan_x) && (y == psd->wsd->pan_y)) return;
psd->wsd->pan_x = x;
@@ -363,24 +352,23 @@ _elm_photocam_pan_smart_pos_set(Evas_Object *obj,
}
static void
-_elm_photocam_pan_smart_pos_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_photocam_pan_smart_pos_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
if (x) *x = psd->wsd->pan_x;
if (y) *y = psd->wsd->pan_y;
}
static void
-_elm_photocam_pan_smart_pos_max_get(const Evas_Object *obj,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_photocam_pan_smart_pos_max_get(Eo *obj, void *_pd, va_list *list)
{
Evas_Coord ow, oh;
-
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
ow = psd->wsd->minw - ow;
@@ -392,40 +380,54 @@ _elm_photocam_pan_smart_pos_max_get(const Evas_Object *obj,
}
static void
-_elm_photocam_pan_smart_pos_min_get(const Evas_Object *obj __UNUSED__,
- Evas_Coord *x,
- Evas_Coord *y)
+_elm_photocam_pan_smart_pos_min_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
if (x) *x = 0;
if (y) *y = 0;
}
static void
-_elm_photocam_pan_smart_content_size_get(const Evas_Object *obj,
- Evas_Coord *w,
- Evas_Coord *h)
+_elm_photocam_pan_smart_content_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_PAN_DATA_GET(obj, psd);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Elm_Photocam_Pan_Smart_Data *psd = _pd;
if (w) *w = psd->wsd->minw;
if (h) *h = psd->wsd->minh;
}
static void
-_elm_photocam_pan_smart_set_user(Elm_Photocam_Pan_Smart_Class *sc)
-{
- ELM_PAN_CLASS(sc)->base.add = _elm_photocam_pan_smart_add;
- ELM_PAN_CLASS(sc)->base.move = _elm_photocam_pan_smart_move;
- ELM_PAN_CLASS(sc)->base.resize = _elm_photocam_pan_smart_resize;
- ELM_PAN_CLASS(sc)->base.calculate = _elm_photocam_pan_smart_calculate;
+_photocam_pan_class_constructor(Eo_Class *klass)
+{
+ const Eo_Op_Func_Description func_desc[] = {
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_photocam_pan_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_photocam_pan_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_photocam_pan_smart_calculate),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_SET), _elm_photocam_pan_smart_pos_set),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_GET), _elm_photocam_pan_smart_pos_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MAX_GET), _elm_photocam_pan_smart_pos_max_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_POS_MIN_GET), _elm_photocam_pan_smart_pos_min_get),
+ EO_OP_FUNC(ELM_OBJ_PAN_ID(ELM_OBJ_PAN_SUB_ID_CONTENT_SIZE_GET), _elm_photocam_pan_smart_content_size_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Class_Description _elm_photocam_pan_class_desc = {
+ EO_VERSION,
+ MY_PAN_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0),
+ NULL,
+ sizeof(Elm_Photocam_Pan_Smart_Data),
+ _photocam_pan_class_constructor,
+ NULL
+};
- ELM_PAN_CLASS(sc)->pos_set = _elm_photocam_pan_smart_pos_set;
- ELM_PAN_CLASS(sc)->pos_get = _elm_photocam_pan_smart_pos_get;
- ELM_PAN_CLASS(sc)->pos_max_get = _elm_photocam_pan_smart_pos_max_get;
- ELM_PAN_CLASS(sc)->pos_min_get = _elm_photocam_pan_smart_pos_min_get;
- ELM_PAN_CLASS(sc)->content_size_get =
- _elm_photocam_pan_smart_content_size_get;
-}
+EO_DEFINE_CLASS(elm_obj_photocam_pan_class_get, &_elm_photocam_pan_class_desc, ELM_OBJ_PAN_CLASS, NULL);
static int
_nearest_pow2_get(int num)
@@ -448,6 +450,7 @@ _grid_clear(Evas_Object *obj,
int x, y;
ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (!g->grid) return;
for (y = 0; y < g->gh; y++)
@@ -464,7 +467,7 @@ _grid_clear(Evas_Object *obj,
if (!sd->preload_num)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj,
+ (wd->resize_obj,
"elm,state,busy,stop", "elm");
evas_object_smart_callback_call
(obj, SIG_LOAD_DETAIL, NULL);
@@ -486,20 +489,22 @@ _tile_preloaded_cb(void *data,
void *event_info __UNUSED__)
{
Elm_Photocam_Grid_Item *git = data;
+ ELM_PHOTOCAM_DATA_GET(git->obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(git->obj, ELM_OBJ_WIDGET_CLASS);
if (git->want)
{
git->want = 0;
evas_object_show(git->img);
git->have = 1;
- git->sd->preload_num--;
- if (!git->sd->preload_num)
+ sd->preload_num--;
+ if (!sd->preload_num)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(git->sd)->resize_obj, "elm,state,busy,stop",
+ (wd->resize_obj, "elm,state,busy,stop",
"elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(git->sd)->obj, SIG_LOADED_DETAIL, NULL);
+ (wd->obj, SIG_LOADED_DETAIL, NULL);
}
}
}
@@ -580,7 +585,7 @@ _grid_create(Evas_Object *obj)
g->grid[tn].out.w = g->grid[tn].src.w;
g->grid[tn].out.h = g->grid[tn].src.h;
- g->grid[tn].sd = sd;
+ g->grid[tn].obj = obj;
g->grid[tn].img =
evas_object_image_add(evas_object_evas_get(obj));
evas_object_image_load_orientation_set(g->grid[tn].img, EINA_TRUE);
@@ -682,6 +687,7 @@ _main_img_preloaded_cb(void *data,
Elm_Phocam_Grid *g;
ELM_PHOTOCAM_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
evas_object_show(sd->img);
sd->main_load_pending = 0;
@@ -692,13 +698,13 @@ _main_img_preloaded_cb(void *data,
_grid_load(obj, g);
}
if (sd->calc_job) ecore_job_del(sd->calc_job);
- sd->calc_job = ecore_job_add(_calc_job_cb, sd);
+ sd->calc_job = ecore_job_add(_calc_job_cb, data);
evas_object_smart_callback_call(data, SIG_LOADED, NULL);
sd->preload_num--;
if (!sd->preload_num)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,busy,stop", "elm");
+ (wd->resize_obj, "elm,state,busy,stop", "elm");
evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL);
}
}
@@ -713,7 +719,7 @@ _zoom_do(Evas_Object *obj,
sd->size.w = (sd->size.ow * (1.0 - t)) + (sd->size.nw * t);
sd->size.h = (sd->size.oh * (1.0 - t)) + (sd->size.nh * t);
- sd->s_iface->content_viewport_size_get(obj, &ow, &oh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&ow, &oh));
xx = (sd->size.spos.x * sd->size.w) - (ow / 2);
yy = (sd->size.spos.y * sd->size.h) - (oh / 2);
if (xx < 0) xx = 0;
@@ -730,7 +736,7 @@ _zoom_do(Evas_Object *obj,
sd->show.h = oh;
if (sd->calc_job) ecore_job_del(sd->calc_job);
- sd->calc_job = ecore_job_add(_calc_job_cb, sd);
+ sd->calc_job = ecore_job_add(_calc_job_cb, obj);
if (t >= 1.0)
{
Eina_List *l, *l_next;
@@ -839,36 +845,41 @@ _mouse_up_cb(void *data,
sd->on_hold = EINA_FALSE;
}
-static Eina_Bool
-_elm_photocam_smart_on_focus(Evas_Object *obj)
+static void
+_elm_photocam_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (elm_widget_focus_get(obj))
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,focus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ (wd->resize_obj, "elm,action,focus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
}
else
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,action,unfocus", "elm");
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ (wd->resize_obj, "elm,action,unfocus", "elm");
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_photocam_smart_theme(Evas_Object *obj)
+static void
+_elm_photocam_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -917,12 +928,16 @@ _scroll_cb(Evas_Object *obj,
evas_object_smart_callback_call(obj, SIG_SCROLL, NULL);
}
-static Eina_Bool
-_elm_photocam_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_photocam_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
double zoom;
Evas_Coord x = 0;
Evas_Coord y = 0;
@@ -934,17 +949,16 @@ _elm_photocam_smart_event(Evas_Object *obj,
Evas_Coord page_y = 0;
Evas_Event_Key_Down *ev = event_info;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
-
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -988,7 +1002,8 @@ _elm_photocam_smart_event(Evas_Object *obj,
zoom -= 0.5;
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
elm_photocam_zoom_set(obj, zoom);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((!strcmp(ev->keyname, "KP_Subtract")))
{
@@ -996,20 +1011,22 @@ _elm_photocam_smart_event(Evas_Object *obj,
zoom += 0.5;
elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
elm_photocam_zoom_set(obj, zoom);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
Eina_Bool
_bounce_eval(void *data)
{
- Elm_Photocam_Smart_Data *sd = data;
+ Evas_Object *obj = data;
+ ELM_PHOTOCAM_DATA_GET(obj, sd);
double t, tt;
if ((sd->g_layer_zoom.imx == sd->g_layer_zoom.bounce.x_end) &&
@@ -1020,7 +1037,7 @@ _bounce_eval(void *data)
sd->zoom_g_layer = EINA_FALSE;
sd->g_layer_zoom.bounce.animator = NULL;
- sd->s_iface->freeze_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_FALSE));
return ECORE_CALLBACK_CANCEL;
}
@@ -1038,9 +1055,9 @@ _bounce_eval(void *data)
sd->g_layer_zoom.imy = 0;
sd->zoom_g_layer = EINA_FALSE;
- sd->s_iface->freeze_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_FALSE));
- _zoom_do(ELM_WIDGET_DATA(sd)->obj, 1.0);
+ _zoom_do(obj, 1.0);
sd->g_layer_zoom.bounce.animator = NULL;
return ECORE_CALLBACK_CANCEL;
}
@@ -1055,29 +1072,28 @@ _bounce_eval(void *data)
sd->g_layer_zoom.bounce.y_start * (1.0 - tt) +
sd->g_layer_zoom.bounce.y_end * tt;
- _zoom_do(ELM_WIDGET_DATA(sd)->obj, 1.0 - (1.0 - tt));
+ _zoom_do(obj, 1.0 - (1.0 - tt));
return ECORE_CALLBACK_RENEW;
}
static void
-_g_layer_zoom_do(Elm_Photocam_Smart_Data *sd,
+_g_layer_zoom_do(Evas_Object *obj,
Evas_Coord px,
Evas_Coord py,
Elm_Gesture_Zoom_Info *g_layer)
{
int regx, regy, regw, regh, ix, iy, iw, ih;
Evas_Coord rx, ry, rw, rh;
- Evas_Object *obj;
int xx, yy;
- obj = ELM_WIDGET_DATA(sd)->obj;
+ ELM_PHOTOCAM_DATA_GET(obj, sd);
sd->mode = ELM_PHOTOCAM_ZOOM_MODE_MANUAL;
sd->zoom = sd->g_layer_start / g_layer->zoom;
sd->size.ow = sd->size.w;
sd->size.oh = sd->size.h;
- sd->s_iface->content_pos_get(obj, &rx, &ry);
- sd->s_iface->content_viewport_size_get(obj, &rw, &rh);
+ eo_do(obj, elm_scrollable_interface_content_pos_get(&rx, &ry));
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&rw, &rh));
if ((rw <= 0) || (rh <= 0)) return;
sd->size.nw = (double)sd->size.imw / sd->zoom;
@@ -1126,8 +1142,9 @@ static Evas_Event_Flags
_g_layer_zoom_start_cb(void *data,
void *event_info)
{
+ Evas_Object *obj = data;
Elm_Gesture_Zoom_Info *p = event_info;
- Elm_Photocam_Smart_Data *sd = data;
+ ELM_PHOTOCAM_DATA_GET(obj, sd);
double marginx = 0, marginy = 0;
Evas_Coord rw, rh;
int x, y, w, h;
@@ -1139,10 +1156,10 @@ _g_layer_zoom_start_cb(void *data,
}
sd->zoom_g_layer = EINA_TRUE;
- sd->s_iface->freeze_set(ELM_WIDGET_DATA(sd)->obj, EINA_TRUE);
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_TRUE));
- elm_photocam_image_region_get(ELM_WIDGET_DATA(sd)->obj, &x, &y, &w, &h);
- sd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(sd)->obj, &rw, &rh);
+ elm_photocam_image_region_get(obj, &x, &y, &w, &h);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&rw, &rh));
if (rw > sd->size.nw)
marginx = (rw - sd->size.nw) / 2;
@@ -1163,10 +1180,10 @@ static Evas_Event_Flags
_g_layer_zoom_move_cb(void *data,
void *event_info)
{
- Elm_Photocam_Smart_Data *sd = data;
+ Elm_Photocam_Smart_Data *sd = eo_data_get(data, MY_CLASS);
Elm_Gesture_Zoom_Info *p = event_info;
- _g_layer_zoom_do(sd, sd->zoom_point_x, sd->zoom_point_y, p);
+ _g_layer_zoom_do(data, sd->zoom_point_x, sd->zoom_point_y, p);
return EVAS_EVENT_FLAG_NONE;
}
@@ -1175,10 +1192,11 @@ static Evas_Event_Flags
_g_layer_zoom_end_cb(void *data,
void *event_info __UNUSED__)
{
- Elm_Photocam_Smart_Data *sd = data;
+ Evas_Object *obj = data;
+ ELM_PHOTOCAM_DATA_GET(obj, sd);
Evas_Coord rw, rh;
- sd->s_iface->content_viewport_size_get(ELM_WIDGET_DATA(sd)->obj, &rw, &rh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&rw, &rh));
sd->g_layer_start = 1.0;
if (sd->g_layer_zoom.imx || sd->g_layer_zoom.imy)
@@ -1260,7 +1278,7 @@ _g_layer_zoom_end_cb(void *data,
}
else
{
- sd->s_iface->freeze_set(ELM_WIDGET_DATA(sd)->obj, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_FALSE));
sd->zoom_g_layer = EINA_FALSE;
}
@@ -1268,21 +1286,22 @@ _g_layer_zoom_end_cb(void *data,
}
static void
-_elm_photocam_smart_add(Evas_Object *obj)
+_elm_photocam_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw, minh;
Elm_Photocam_Pan_Smart_Data *pan_data;
Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Photocam_Smart_Data);
+ Elm_Photocam_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, "photocam", "base",
+ (obj, wd->resize_obj, "photocam", "base",
elm_widget_style_get(obj));
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
@@ -1296,26 +1315,24 @@ _elm_photocam_smart_add(Evas_Object *obj)
elm_widget_can_focus_set(obj, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set
+ (wd->resize_obj, priv->hit_rect));
- priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
- priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
- priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
- priv->s_iface->scroll_cb_set(obj, _scroll_cb);
+ eo_do(obj,
+ elm_scrollable_interface_animate_start_cb_set(_scroll_animate_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_animate_stop_cb),
+ elm_scrollable_interface_drag_start_cb_set(_scroll_drag_start_cb),
+ elm_scrollable_interface_drag_stop_cb_set(_scroll_drag_stop_cb),
+ elm_scrollable_interface_scroll_cb_set(_scroll_cb));
- priv->s_iface->bounce_allow_set(obj, bounce, bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(bounce, bounce));
- priv->pan_obj = evas_object_smart_add
- (evas_object_evas_get(obj), _elm_photocam_pan_smart_class_new());
- pan_data = evas_object_smart_data_get(priv->pan_obj);
+ priv->pan_obj = eo_add(MY_PAN_CLASS, evas_object_evas_get(obj));
+ pan_data = eo_data_get(priv->pan_obj, MY_PAN_CLASS);
+ pan_data->wobj = obj;
pan_data->wsd = priv;
- priv->s_iface->extern_pan_set(obj, priv->pan_obj);
+ eo_do(obj, elm_scrollable_interface_extern_pan_set(priv->pan_obj));
priv->zoom_g_layer = EINA_FALSE;
priv->g_layer_start = 1.0;
@@ -1340,7 +1357,7 @@ _elm_photocam_smart_add(Evas_Object *obj)
evas_object_event_callback_add
(priv->img, EVAS_CALLBACK_IMAGE_PRELOADED, _main_img_preloaded_cb, obj);
- edje_object_size_min_calc(ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
_sizing_eval(obj);
@@ -1348,17 +1365,18 @@ _elm_photocam_smart_add(Evas_Object *obj)
}
static void
-_elm_photocam_smart_del(Evas_Object *obj)
+_elm_photocam_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Phocam_Grid *g;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Photocam_Smart_Data *sd = _pd;
EINA_LIST_FREE (sd->grids, g)
{
if (g->grid) free(g->grid);
free(g);
}
+ eo_unref(sd->pan_obj);
evas_object_del(sd->pan_obj);
sd->pan_obj = NULL;
@@ -1370,103 +1388,91 @@ _elm_photocam_smart_del(Evas_Object *obj)
ecore_animator_del(sd->g_layer_zoom.bounce.animator);
if (sd->long_timer) ecore_timer_del(sd->long_timer);
- ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_photocam_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_photocam_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Photocam_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_photocam_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_photocam_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Photocam_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_photocam_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_photocam_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Photocam_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_photocam_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
-static void
-_elm_photocam_smart_set_user(Elm_Photocam_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_photocam_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_photocam_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_photocam_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_photocam_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_photocam_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_photocam_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_photocam_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_photocam_smart_event;
-}
-
-EAPI const Elm_Photocam_Smart_Class *
-elm_photocam_smart_class_get(void)
-{
- static Elm_Photocam_Smart_Class _sc =
- ELM_PHOTOCAM_SMART_CLASS_INIT_NAME_VERSION(ELM_PHOTOCAM_SMART_NAME);
- static const Elm_Photocam_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_photocam_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_photocam_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_photocam_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Evas_Load_Error
elm_photocam_file_set(Evas_Object *obj,
const char *file)
{
+ ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_NONE;
+ Evas_Load_Error ret = EVAS_LOAD_ERROR_NONE;
+ eo_do(obj, elm_obj_photocam_file_set(file, &ret));
+ return ret;
+}
+
+static void
+_file_set(Eo *obj, void *_pd, va_list *list)
+{
int w, h;
double tz;
- ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_NONE;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ const char *file = va_arg(*list, const char *);
+ Evas_Load_Error *ret = va_arg(*list, Evas_Load_Error *);
+ if (ret) *ret = EVAS_LOAD_ERROR_NONE;
- if (!eina_stringshare_replace(&sd->file, file)) return EVAS_LOAD_ERROR_NONE;
+ Elm_Photocam_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ if (!eina_stringshare_replace(&sd->file, file)) return;
_grid_clear_all(obj);
evas_object_hide(sd->img);
@@ -1500,36 +1506,52 @@ elm_photocam_file_set(Evas_Object *obj,
sd->main_load_pending = EINA_TRUE;
if (sd->calc_job) ecore_job_del(sd->calc_job);
- sd->calc_job = ecore_job_add(_calc_job_cb, sd);
+ sd->calc_job = ecore_job_add(_calc_job_cb, obj);
evas_object_smart_callback_call(obj, SIG_LOAD, NULL);
sd->preload_num++;
if (sd->preload_num == 1)
{
edje_object_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,busy,start", "elm");
+ (wd->resize_obj, "elm,state,busy,start", "elm");
evas_object_smart_callback_call(obj, SIG_LOAD_DETAIL, NULL);
}
tz = sd->zoom;
sd->zoom = 0.0;
- elm_photocam_zoom_set(ELM_WIDGET_DATA(sd)->obj, tz);
+ elm_photocam_zoom_set(obj, tz);
- return evas_object_image_load_error_get(sd->img);
+ if (ret) *ret = evas_object_image_load_error_get(sd->img);
}
EAPI const char *
elm_photocam_file_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) NULL;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_photocam_file_get(&ret));
+ return ret;
+}
- return sd->file;
+static void
+_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Photocam_Smart_Data *sd = _pd;
+
+ *ret = sd->file;
}
EAPI void
elm_photocam_zoom_set(Evas_Object *obj,
double zoom)
{
+ ELM_PHOTOCAM_CHECK(obj);
+ eo_do(obj, elm_obj_photocam_zoom_set(zoom));
+}
+
+static void
+_zoom_set(Eo *obj, void *_pd, va_list *list)
+{
double z;
Eina_List *l;
Ecore_Animator *an;
@@ -1537,8 +1559,8 @@ elm_photocam_zoom_set(Evas_Object *obj,
Evas_Coord pw, ph, rx, ry, rw, rh;
int zoom_changed = 0, started = 0;
- ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ double zoom = va_arg(*list, double);
+ Elm_Photocam_Smart_Data *sd = _pd;
if (zoom <= (1.0 / 256.0)) zoom = (1.0 / 256.0);
if (zoom == sd->zoom) return;
@@ -1546,8 +1568,8 @@ elm_photocam_zoom_set(Evas_Object *obj,
sd->zoom = zoom;
sd->size.ow = sd->size.w;
sd->size.oh = sd->size.h;
- sd->s_iface->content_pos_get(obj, &rx, &ry);
- sd->s_iface->content_viewport_size_get(obj, &rw, &rh);
+ eo_do(obj, elm_scrollable_interface_content_pos_get(&rx, &ry));
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&rw, &rh));
if ((rw <= 0) || (rh <= 0)) return;
if (sd->mode == ELM_PHOTOCAM_ZOOM_MODE_MANUAL)
@@ -1739,7 +1761,7 @@ done:
}
if (sd->calc_job) ecore_job_del(sd->calc_job);
- sd->calc_job = ecore_job_add(_calc_job_cb, sd);
+ sd->calc_job = ecore_job_add(_calc_job_cb, obj);
if (!sd->paused)
{
if (started)
@@ -1755,35 +1777,60 @@ EAPI double
elm_photocam_zoom_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) 1.0;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ double ret = 1.0;
+ eo_do((Eo *) obj, elm_obj_photocam_zoom_get(&ret));
+ return ret;
+}
+
+static void
+_zoom_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Photocam_Smart_Data *sd = _pd;
- return sd->zoom;
+ *ret = sd->zoom;
}
EAPI void
elm_photocam_zoom_mode_set(Evas_Object *obj,
Elm_Photocam_Zoom_Mode mode)
{
+ ELM_PHOTOCAM_CHECK(obj);
+ eo_do(obj, elm_obj_photocam_zoom_mode_set(mode));
+}
+
+static void
+_zoom_mode_set(Eo *obj, void *_pd, va_list *list)
+{
double tz;
- ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Photocam_Zoom_Mode mode = va_arg(*list, Elm_Photocam_Zoom_Mode);
+ Elm_Photocam_Smart_Data *sd = _pd;
if (sd->mode == mode) return;
sd->mode = mode;
tz = sd->zoom;
sd->zoom = 0.0;
- elm_photocam_zoom_set(ELM_WIDGET_DATA(sd)->obj, tz);
+ elm_photocam_zoom_set(obj, tz);
}
EAPI Elm_Photocam_Zoom_Mode
elm_photocam_zoom_mode_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) ELM_PHOTOCAM_ZOOM_MODE_LAST;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Photocam_Zoom_Mode ret = ELM_PHOTOCAM_ZOOM_MODE_LAST;
+ eo_do((Eo *) obj, elm_obj_photocam_zoom_mode_get(&ret));
+ return ret;
+}
+
+static void
+_zoom_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Photocam_Zoom_Mode *ret = va_arg(*list, Elm_Photocam_Zoom_Mode *);
+ Elm_Photocam_Smart_Data *sd = _pd;
- return sd->mode;
+ *ret = sd->mode;
}
EAPI void
@@ -1792,7 +1839,15 @@ elm_photocam_image_size_get(const Evas_Object *obj,
int *h)
{
ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_photocam_image_size_get(w, h));
+}
+
+static void
+_image_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+ Elm_Photocam_Smart_Data *sd = _pd;
if (w) *w = sd->size.imw;
if (h) *h = sd->size.imh;
@@ -1805,13 +1860,23 @@ elm_photocam_image_region_get(const Evas_Object *obj,
int *w,
int *h)
{
+ ELM_PHOTOCAM_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_photocam_image_region_get(x, y, w, h));
+}
+
+static void
+_image_region_get(Eo *obj, void *_pd, va_list *list)
+{
Evas_Coord sx, sy, sw, sh;
- ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ int *x = va_arg(*list, int *);
+ int *y = va_arg(*list, int *);
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+ Elm_Photocam_Smart_Data *sd = _pd;
- sd->s_iface->content_pos_get(obj, &sx, &sy);
- sd->s_iface->content_viewport_size_get(obj, &sw, &sh);
+ eo_do((Eo *)obj, elm_scrollable_interface_content_pos_get(&sx, &sy));
+ eo_do((Eo *)obj, elm_scrollable_interface_content_viewport_size_get(&sw, &sh));
if (sd->size.w > 0)
{
if (x)
@@ -1860,12 +1925,22 @@ elm_photocam_image_region_show(Evas_Object *obj,
int x,
int y,
int w,
- int h __UNUSED__)
+ int h)
+{
+ ELM_PHOTOCAM_CHECK(obj);
+ eo_do(obj, elm_obj_photocam_image_region_show(x, y, w, h));
+}
+
+static void
+_image_region_show(Eo *obj, void *_pd, va_list *list)
{
int rx, ry, rw, rh;
- ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ Elm_Photocam_Smart_Data *sd = _pd;
if ((sd->size.imw < 1) || (sd->size.imh < 1)) return;
rx = (x * sd->size.w) / sd->size.imw;
@@ -1890,7 +1965,7 @@ elm_photocam_image_region_show(Evas_Object *obj,
_zoom_do(obj, 1.0);
evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
- sd->s_iface->content_region_show(obj, rx, ry, rw, rh);
+ eo_do(obj, elm_scrollable_interface_content_region_show(rx, ry, rw, rh));
}
EAPI void
@@ -1900,10 +1975,20 @@ elm_photocam_image_region_bring_in(Evas_Object *obj,
int w,
int h __UNUSED__)
{
+ ELM_PHOTOCAM_CHECK(obj);
+ eo_do(obj, elm_scrollable_interface_region_bring_in(x, y, w, h));
+}
+
+static void
+_image_region_bring_in(Eo *obj, void *_pd, va_list *list)
+{
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
int rx, ry, rw, rh;
- ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Elm_Photocam_Smart_Data *sd = _pd;
if ((sd->size.imw < 1) || (sd->size.imh < 1)) return;
rx = (x * sd->size.w) / sd->size.imw;
@@ -1929,7 +2014,7 @@ elm_photocam_image_region_bring_in(Evas_Object *obj,
_zoom_do(obj, 1.0);
evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL);
}
- sd->s_iface->region_bring_in(obj, rx, ry, rw, rh);
+ eo_do_super(obj, elm_scrollable_interface_region_bring_in(rx, ry, rw, rh));
}
EAPI void
@@ -1937,7 +2022,14 @@ elm_photocam_paused_set(Evas_Object *obj,
Eina_Bool paused)
{
ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photocam_paused_set(paused));
+}
+
+static void
+_paused_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool paused = va_arg(*list, int);
+ Elm_Photocam_Smart_Data *sd = _pd;
paused = !!paused;
@@ -1964,18 +2056,36 @@ EAPI Eina_Bool
elm_photocam_paused_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) EINA_FALSE;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_photocam_paused_get(&ret));
+ return ret;
+}
+
+static void
+_paused_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Photocam_Smart_Data *sd = _pd;
- return sd->paused;
+ *ret = sd->paused;
}
EAPI Evas_Object *
elm_photocam_internal_image_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) NULL;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_photocam_internal_image_get(&ret));
+ return ret;
+}
- return sd->img;
+static void
+_internal_image_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Photocam_Smart_Data *sd = _pd;
+
+ *ret = sd->img;
}
EAPI void
@@ -1984,9 +2094,8 @@ elm_photocam_bounce_set(Evas_Object *obj,
Eina_Bool v_bounce)
{
ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_set(obj, h_bounce, v_bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
}
EAPI void
@@ -1995,9 +2104,8 @@ elm_photocam_bounce_get(const Evas_Object *obj,
Eina_Bool *v_bounce)
{
ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
- sd->s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *)obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -2005,7 +2113,14 @@ elm_photocam_gesture_enabled_set(Evas_Object *obj,
Eina_Bool gesture)
{
ELM_PHOTOCAM_CHECK(obj);
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_photocam_gesture_enabled_set(gesture));
+}
+
+static void
+_gesture_enabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool gesture = va_arg(*list, int);
+ Elm_Photocam_Smart_Data *sd = _pd;
gesture = !!gesture;
@@ -2027,23 +2142,102 @@ elm_photocam_gesture_enabled_set(Evas_Object *obj,
elm_gesture_layer_attach(sd->g_layer, obj);
elm_gesture_layer_cb_set
(sd->g_layer, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_START,
- _g_layer_zoom_start_cb, sd);
+ _g_layer_zoom_start_cb, obj);
elm_gesture_layer_cb_set
(sd->g_layer, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_MOVE,
- _g_layer_zoom_move_cb, sd);
+ _g_layer_zoom_move_cb, obj);
elm_gesture_layer_cb_set
(sd->g_layer, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_END,
- _g_layer_zoom_end_cb, sd);
+ _g_layer_zoom_end_cb, obj);
elm_gesture_layer_cb_set
(sd->g_layer, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_ABORT,
- _g_layer_zoom_end_cb, sd);
+ _g_layer_zoom_end_cb, obj);
}
EAPI Eina_Bool
elm_photocam_gesture_enabled_get(const Evas_Object *obj)
{
ELM_PHOTOCAM_CHECK(obj) EINA_FALSE;
- ELM_PHOTOCAM_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_photocam_gesture_enabled_get(&ret));
+ return ret;
+}
- return sd->do_gesture;
+static void
+_gesture_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Photocam_Smart_Data *sd = _pd;
+
+ *ret = sd->do_gesture;
}
+
+static void
+_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_MEMBER_ADD), _elm_photocam_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_photocam_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_photocam_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_photocam_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_photocam_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_photocam_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_photocam_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_photocam_smart_on_focus),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_REGION_BRING_IN), _image_region_bring_in),
+
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET), _file_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET), _zoom_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET), _zoom_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET), _zoom_mode_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET), _zoom_mode_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET), _image_size_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET), _image_region_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW), _image_region_show),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET), _paused_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET), _paused_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET), _internal_image_get),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET), _gesture_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET), _gesture_enabled_get),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET, "Set the photo file to be shown."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET, "Returns the path of the current image file."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET, "Set the zoom level of the photo."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET, "Get the zoom level of the photo."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET, "Set the zoom mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET, "Get the zoom mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET, "Get the current image pixel width and height."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET, "Get the region of the image that is currently shown."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW, "Set the viewed region of the image."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET, "Set the paused state for photocam."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET, "Get the paused state for photocam."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET, "Get the internal low-res image used for photocam."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET, "Set the gesture state for photocam."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET, "Get the gesture state for photocam."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PHOTOCAM_BASE_ID, op_desc, ELM_OBJ_PHOTOCAM_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Photocam_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_photocam_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_photocam.h b/src/lib/elm_photocam.h
index 06f6e747e..b2c74fa3b 100644
--- a/src/lib/elm_photocam.h
+++ b/src/lib/elm_photocam.h
@@ -54,6 +54,10 @@
* @{
*/
+#define ELM_OBJ_PHOTOCAM_PAN_CLASS elm_obj_photocam_pan_class_get()
+
+const Eo_Class *elm_obj_photocam_pan_class_get(void) EINA_CONST;
+
/**
* @brief Types of zoom available.
*/
@@ -66,6 +70,210 @@ typedef enum
ELM_PHOTOCAM_ZOOM_MODE_LAST
} Elm_Photocam_Zoom_Mode;
+#define ELM_OBJ_PHOTOCAM_CLASS elm_obj_photocam_class_get()
+
+const Eo_Class *elm_obj_photocam_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PHOTOCAM_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW,
+ ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET,
+ ELM_OBJ_PHOTOCAM_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PHOTOCAM_ID(sub_id) (ELM_OBJ_PHOTOCAM_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_photocam_file_set
+ * @since 1.8
+ *
+ * @brief Set the photo file to be shown
+ *
+ * @param[in] file
+ * @param[out] ret
+ *
+ * @see elm_photocam_file_set
+ */
+#define elm_obj_photocam_file_set(file, ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(Evas_Load_Error *, ret)
+
+/**
+ * @def elm_obj_photocam_file_get
+ * @since 1.8
+ *
+ * @brief Returns the path of the current image file
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_file_get
+ */
+#define elm_obj_photocam_file_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_photocam_zoom_set
+ * @since 1.8
+ *
+ * @brief Set the zoom level of the photo
+ *
+ * @param[in] zoom
+ *
+ * @see elm_photocam_zoom_set
+ */
+#define elm_obj_photocam_zoom_set(zoom) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_SET), EO_TYPECHECK(double, zoom)
+
+/**
+ * @def elm_obj_photocam_zoom_get
+ * @since 1.8
+ *
+ * @brief Get the zoom level of the photo
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_zoom_get
+ */
+#define elm_obj_photocam_zoom_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_photocam_zoom_mode_set
+ * @since 1.8
+ *
+ * @brief Set the zoom mode
+ *
+ * @param[in] mode
+ *
+ * @see elm_photocam_zoom_mode_set
+ */
+#define elm_obj_photocam_zoom_mode_set(mode) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_SET), EO_TYPECHECK(Elm_Photocam_Zoom_Mode, mode)
+
+/**
+ * @def elm_obj_photocam_zoom_mode_get
+ * @since 1.8
+ *
+ * @brief Get the zoom mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_zoom_mode_get
+ */
+#define elm_obj_photocam_zoom_mode_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_ZOOM_MODE_GET), EO_TYPECHECK(Elm_Photocam_Zoom_Mode *, ret)
+
+/**
+ * @def elm_obj_photocam_image_size_get
+ * @since 1.8
+ *
+ * @brief Get the current image pixel width and height
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_photocam_image_size_get
+ */
+#define elm_obj_photocam_image_size_get(w, h) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_photocam_image_region_get
+ * @since 1.8
+ *
+ * @brief Get the region of the image that is currently shown
+ *
+ * @param[out] x
+ * @param[out] y
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_photocam_image_region_get
+ */
+#define elm_obj_photocam_image_region_get(x, y, w, h) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_GET), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_photocam_image_region_show
+ * @since 1.8
+ *
+ * @brief Set the viewed region of the image
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_photocam_image_region_show
+ */
+#define elm_obj_photocam_image_region_show(x, y, w, h) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_IMAGE_REGION_SHOW), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_photocam_paused_set
+ * @since 1.8
+ *
+ * @brief Set the paused state for photocam
+ *
+ * @param[in] paused
+ *
+ * @see elm_photocam_paused_set
+ */
+#define elm_obj_photocam_paused_set(paused) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_SET), EO_TYPECHECK(Eina_Bool, paused)
+
+/**
+ * @def elm_obj_photocam_paused_get
+ * @since 1.8
+ *
+ * @brief Get the paused state for photocam
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_paused_get
+ */
+#define elm_obj_photocam_paused_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_PAUSED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_photocam_internal_image_get
+ * @since 1.8
+ *
+ * @brief Get the internal low-res image used for photocam
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_internal_image_get
+ */
+#define elm_obj_photocam_internal_image_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_INTERNAL_IMAGE_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_photocam_gesture_enabled_set
+ * @since 1.8
+ *
+ * @brief Set the gesture state for photocam.
+ *
+ * @param[in] gesture
+ *
+ * @see elm_photocam_gesture_enabled_set
+ */
+#define elm_obj_photocam_gesture_enabled_set(gesture) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_SET), EO_TYPECHECK(Eina_Bool, gesture)
+
+/**
+ * @def elm_obj_photocam_gesture_enabled_get
+ * @since 1.8
+ *
+ * @brief Get the gesture state for photocam.
+ *
+ * @param[out] ret
+ *
+ * @see elm_photocam_gesture_enabled_get
+ */
+#define elm_obj_photocam_gesture_enabled_get(ret) ELM_OBJ_PHOTOCAM_ID(ELM_OBJ_PHOTOCAM_SUB_ID_GESTURE_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @brief Add a new Photocam object
*
diff --git a/src/lib/elm_plug.c b/src/lib/elm_plug.c
index 2918d673b..88d3ec114 100644
--- a/src/lib/elm_plug.c
+++ b/src/lib/elm_plug.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_plug.h"
-EAPI const char ELM_PLUG_SMART_NAME[] = "elm_plug";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_PLUG_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PLUG_CLASS
+
+#define MY_CLASS_NAME "elm_plug"
static const char PLUG_KEY[] = "__Plug_Ecore_Evas";
@@ -14,10 +20,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PLUG_SMART_NAME, _elm_plug, Elm_Plug_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
static void
_sizing_eval(Evas_Object *obj __UNUSED__)
{
@@ -40,14 +42,19 @@ _elm_plug_disconnected(Ecore_Evas *ee)
evas_object_smart_callback_call(plug, SIG_IMAGE_DELETED, NULL);
}
-static Eina_Bool
-_elm_plug_smart_theme(Evas_Object *obj)
+static void
+_elm_plug_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_plug_parent_sc->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -65,16 +72,16 @@ _on_mouse_up(void *data,
}
static void
-_elm_plug_smart_add(Evas_Object *obj)
+_elm_plug_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Object *p_obj;
Ecore_Evas *ee;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Plug_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_widget_can_focus_set(obj, EINA_FALSE);
- _elm_plug_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
if (!ee) return;
@@ -85,61 +92,49 @@ _elm_plug_smart_add(Evas_Object *obj)
elm_widget_resize_object_set(obj, p_obj);
evas_object_event_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up,
+ (wd->resize_obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up,
obj);
_sizing_eval(obj);
}
-static void
-_elm_plug_smart_set_user(Elm_Plug_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_plug_smart_add;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_plug_smart_theme;
-}
-
-EAPI const Elm_Plug_Smart_Class *
-elm_plug_smart_class_get(void)
-{
- static Elm_Plug_Smart_Class _sc =
- ELM_PLUG_SMART_CLASS_INIT_NAME_VERSION(ELM_PLUG_SMART_NAME);
- static const Elm_Plug_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_plug_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_plug_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_plug_smart_class_new(), parent);
- if (!obj) return NULL;
-
- ELM_PLUG_DATA_GET(obj, sd);
- if (!ELM_WIDGET_DATA(sd)->resize_obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Evas_Object *
elm_plug_image_object_get(const Evas_Object *obj)
{
ELM_PLUG_CHECK(obj) NULL;
- ELM_PLUG_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_plug_image_object_get(&ret));
+ return ret;
+}
- return ELM_WIDGET_DATA(sd)->resize_obj;
+static void
+_image_object_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = wd->resize_obj;
}
EAPI Eina_Bool
@@ -148,23 +143,71 @@ elm_plug_connect(Evas_Object *obj,
int svcnum,
Eina_Bool svcsys)
{
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_plug_connect(svcname, svcnum, svcsys, &ret));
+ return ret;
+}
+
+static void
+_connect(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *svcname = va_arg(*list, const char *);
+ int svcnum = va_arg(*list, int);
+ Eina_Bool svcsys = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Object *plug_img = NULL;
- ELM_PLUG_CHECK(obj) EINA_FALSE;
+ ELM_PLUG_CHECK(obj);
plug_img = elm_plug_image_object_get(obj);
- if (!plug_img) return EINA_FALSE;
+ if (!plug_img) return;
if (ecore_evas_extn_plug_connect(plug_img, svcname, svcnum, svcsys))
{
Ecore_Evas *ee = NULL;
ee = ecore_evas_object_ecore_evas_get(plug_img);
- if (!ee) return EINA_FALSE;
+ if (!ee) return;
ecore_evas_data_set(ee, PLUG_KEY, obj);
ecore_evas_callback_delete_request_set(ee, _elm_plug_disconnected);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
- else
- return EINA_FALSE;
}
+
+static void
+_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_plug_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_plug_smart_theme),
+
+ EO_OP_FUNC(ELM_OBJ_PLUG_ID(ELM_OBJ_PLUG_SUB_ID_IMAGE_OBJECT_GET), _image_object_get),
+ EO_OP_FUNC(ELM_OBJ_PLUG_ID(ELM_OBJ_PLUG_SUB_ID_CONNECT), _connect),
+
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PLUG_SUB_ID_IMAGE_OBJECT_GET, "Get the basic Evas_Image object from this object (widget)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PLUG_SUB_ID_CONNECT, "Connect a plug widget to service provided by socket image."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PLUG_BASE_ID, op_desc, ELM_OBJ_PLUG_SUB_ID_LAST),
+ NULL,
+ 0,
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_plug_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_plug.h b/src/lib/elm_plug.h
index 4e91e0624..1e71e9255 100644
--- a/src/lib/elm_plug.h
+++ b/src/lib/elm_plug.h
@@ -10,6 +10,48 @@
*
*/
+#define ELM_OBJ_PLUG_CLASS elm_obj_plug_class_get()
+
+const Eo_Class *elm_obj_plug_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PLUG_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PLUG_SUB_ID_IMAGE_OBJECT_GET,
+ ELM_OBJ_PLUG_SUB_ID_CONNECT,
+ ELM_OBJ_PLUG_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PLUG_ID(sub_id) (ELM_OBJ_PLUG_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_plug_image_object_get
+ * @since 1.8
+ *
+ * Get the basic Evas_Image object from this object (widget).
+ *
+ * @param[out] ret
+ *
+ * @see elm_plug_image_object_get
+ */
+#define elm_obj_plug_image_object_get(ret) ELM_OBJ_PLUG_ID(ELM_OBJ_PLUG_SUB_ID_IMAGE_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_plug_connect
+ * @since 1.8
+ *
+ * Connect a plug widget to service provided by socket image.
+ *
+ * @param[in] svcname
+ * @param[in] svcnum
+ * @param[in] svcsys
+ * @param[out] ret
+ *
+ * @see elm_plug_connect
+ */
+#define elm_obj_plug_connect(svcname, svcnum, svcsys, ret) ELM_OBJ_PLUG_ID(ELM_OBJ_PLUG_SUB_ID_CONNECT), EO_TYPECHECK(const char *, svcname), EO_TYPECHECK(int, svcnum), EO_TYPECHECK(Eina_Bool, svcsys), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @addtogroup Plug
* @{
diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c
index 9bb01bff8..9d6f784b0 100644
--- a/src/lib/elm_progressbar.c
+++ b/src/lib/elm_progressbar.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_progressbar.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_PROGRESSBAR_SMART_NAME[] = "elm_progressbar";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_PROGRESSBAR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_PROGRESSBAR_CLASS
+
+#define MY_CLASS_NAME "elm_progressbar"
static const char SIG_CHANGED[] = "changed";
@@ -16,10 +23,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_PROGRESSBAR_SMART_NAME, _elm_progressbar, Elm_Progressbar_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
{"icon", "elm.swallow.content"},
@@ -62,6 +65,7 @@ _val_set(Evas_Object *obj)
double pos;
ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
pos = sd->val;
rtl = elm_widget_mirrored_get(obj);
@@ -72,18 +76,18 @@ _val_set(Evas_Object *obj)
pos = MAX_RATIO_LVL - pos;
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.cur.progressbar", pos, pos);
+ (wd->resize_obj, "elm.cur.progressbar", pos, pos);
}
static void
-_elm_progressbar_smart_sizing_eval(Evas_Object *obj)
+_elm_progressbar_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
@@ -105,47 +109,57 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because progressbar's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
* whenever we can changed the theme API */
-static Eina_Bool
-_elm_progressbar_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_progressbar_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_progressbar_parent_sc)->sub_object_del
- (obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if(!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because progressbar's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
* whenever we can changed the theme API */
-static Eina_Bool
-_elm_progressbar_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_progressbar_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_CONTAINER_CLASS(_elm_progressbar_parent_sc)->content_set
- (obj, part, content))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if(!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_progressbar_smart_theme(Evas_Object *obj)
+static void
+_elm_progressbar_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Elm_Progressbar_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->horizontal)
- eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "horizontal");
- else eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "vertical");
+ eina_stringshare_replace(&ld->group, "horizontal");
+ else eina_stringshare_replace(&ld->group, "vertical");
- if (!ELM_WIDGET_CLASS(_elm_progressbar_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (sd->pulse)
elm_layout_signal_emit(obj, "elm,state,pulse", "elm");
@@ -178,11 +192,11 @@ _elm_progressbar_smart_theme(Evas_Object *obj)
* whenever we can changed the theme API */
_icon_signal_emit(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
@@ -225,11 +239,12 @@ _access_state_cb(void *data __UNUSED__,
}
static void
-_elm_progressbar_smart_add(Evas_Object *obj)
+_elm_progressbar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Progressbar_Smart_Data);
+ Elm_Progressbar_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_progressbar_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->horizontal = EINA_TRUE;
priv->inverted = EINA_FALSE;
@@ -255,7 +270,7 @@ _elm_progressbar_smart_add(Evas_Object *obj)
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
elm_widget_can_focus_set(obj, EINA_TRUE);
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("progressbar"));
_elm_access_callback_set
@@ -265,93 +280,90 @@ _elm_progressbar_smart_add(Evas_Object *obj)
}
static void
-_elm_progressbar_smart_del(Evas_Object *obj)
+_elm_progressbar_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Elm_Progressbar_Smart_Data *sd = _pd;
if (sd->units) eina_stringshare_del(sd->units);
- ELM_WIDGET_CLASS(_elm_progressbar_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_progressbar_smart_set_user(Elm_Progressbar_Smart_Class *sc)
+_elm_progressbar_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_progressbar_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_progressbar_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_progressbar_smart_theme;
- ELM_WIDGET_CLASS(sc)->sub_object_del =
- _elm_progressbar_smart_sub_object_del;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_progressbar_smart_content_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_progressbar_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
-EAPI const Elm_Progressbar_Smart_Class *
-elm_progressbar_smart_class_get(void)
+static void
+_elm_progressbar_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Progressbar_Smart_Class _sc =
- ELM_PROGRESSBAR_SMART_CLASS_INIT_NAME_VERSION(ELM_PROGRESSBAR_SMART_NAME);
- static const Elm_Progressbar_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_progressbar_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
EAPI Evas_Object *
elm_progressbar_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_progressbar_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
+
EAPI void
elm_progressbar_pulse_set(Evas_Object *obj,
Eina_Bool pulse)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_pulse_set(pulse));
+}
+
+static void
+_pulse_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool pulse = va_arg(*list, int);
+ Elm_Progressbar_Smart_Data *sd = _pd;
pulse = !!pulse;
if (sd->pulse == pulse) return;
sd->pulse = pulse;
- _elm_progressbar_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_progressbar_pulse_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) EINA_FALSE;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_progressbar_pulse_get(&ret));
+ return ret;
+}
- return sd->pulse;
+static void
+_pulse_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Progressbar_Smart_Data *sd = _pd;
+
+ *ret = sd->pulse;
}
EAPI void
@@ -359,7 +371,14 @@ elm_progressbar_pulse(Evas_Object *obj,
Eina_Bool state)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_pulse(state));
+}
+
+static void
+_pulse(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool state = va_arg(*list, int);
+ Elm_Progressbar_Smart_Data *sd = _pd;
state = !!state;
if ((!sd->pulse) && (sd->pulse_state == state)) return;
@@ -377,7 +396,14 @@ elm_progressbar_value_set(Evas_Object *obj,
double val)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_value_set(val));
+}
+
+static void
+_value_set(Eo *obj, void *_pd, va_list *list)
+{
+ double val = va_arg(*list, double);
+ Elm_Progressbar_Smart_Data *sd = _pd;
if (sd->val == val) return;
@@ -394,9 +420,18 @@ EAPI double
elm_progressbar_value_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) 0.0;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_progressbar_value_get(&ret));
+ return ret;
+}
+
+static void
+_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Progressbar_Smart_Data *sd = _pd;
- return sd->val;
+ *ret = sd->val;
}
EAPI void
@@ -404,7 +439,14 @@ elm_progressbar_span_size_set(Evas_Object *obj,
Evas_Coord size)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_span_size_set(size));
+}
+
+static void
+_span_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Coord size = va_arg(*list, Evas_Coord);
+ Elm_Progressbar_Smart_Data *sd = _pd;
if (sd->size == size) return;
@@ -426,9 +468,18 @@ EAPI Evas_Coord
elm_progressbar_span_size_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) 0;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Evas_Coord ret;
+ eo_do((Eo *) obj, elm_obj_progressbar_span_size_get(&ret));
+ return ret;
+}
+
+static void
+_span_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *ret = va_arg(*list, Evas_Coord *);
+ Elm_Progressbar_Smart_Data *sd = _pd;
- return sd->size;
+ *ret = sd->size;
}
EAPI void
@@ -436,18 +487,26 @@ elm_progressbar_unit_format_set(Evas_Object *obj,
const char *units)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_unit_format_set(units));
+}
+
+static void
+_unit_format_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *units = va_arg(*list, const char *);
+ Elm_Progressbar_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
eina_stringshare_replace(&sd->units, units);
if (units)
{
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
else
{
elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
}
_units_set(obj);
@@ -458,16 +517,34 @@ EAPI const char *
elm_progressbar_unit_format_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) NULL;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_progressbar_unit_format_get(&ret));
+ return ret;
+}
- return sd->units;
+static void
+_unit_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Progressbar_Smart_Data *sd = _pd;
+
+ *ret = sd->units;
}
EAPI void
elm_progressbar_unit_format_function_set(Evas_Object *obj, char *(func)(double), void (*free_func) (char *))
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_unit_format_function_set(func, free_func));
+}
+
+
+EAPI void
+_unit_format_function_set(Eo *obj, void *_pd, va_list *list)
+{
+ progressbar_func_type func = va_arg(*list, progressbar_func_type);
+ progressbar_freefunc_type free_func = va_arg(*list, progressbar_freefunc_type);
+ Elm_Progressbar_Smart_Data *sd = _pd;
sd->unit_format_func = func;
sd->unit_format_free = free_func;
@@ -481,22 +558,37 @@ elm_progressbar_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Progressbar_Smart_Data*sd = _pd;
horizontal = !!horizontal;
if (sd->horizontal == horizontal) return;
sd->horizontal = horizontal;
- _elm_progressbar_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_progressbar_horizontal_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) EINA_FALSE;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_progressbar_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Progressbar_Smart_Data*sd = _pd;
+ *ret = sd->horizontal;
}
EAPI void
@@ -504,7 +596,15 @@ elm_progressbar_inverted_set(Evas_Object *obj,
Eina_Bool inverted)
{
ELM_PROGRESSBAR_CHECK(obj);
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_progressbar_inverted_set(inverted));
+}
+
+static void
+_inverted_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool inverted = va_arg(*list, int);
+ Elm_Progressbar_Smart_Data*sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
inverted = !!inverted;
if (sd->inverted == inverted) return;
@@ -515,7 +615,7 @@ elm_progressbar_inverted_set(Evas_Object *obj,
else
elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
_val_set(obj);
_units_set(obj);
@@ -525,7 +625,97 @@ EAPI Eina_Bool
elm_progressbar_inverted_get(const Evas_Object *obj)
{
ELM_PROGRESSBAR_CHECK(obj) EINA_FALSE;
- ELM_PROGRESSBAR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_progressbar_inverted_get(&ret));
+ return ret;
+}
+
+static void
+_inverted_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Progressbar_Smart_Data*sd = _pd;
+ *ret = sd->inverted;
+}
+
+static void
+_elm_progressbar_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_progressbar_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
- return sd->inverted;
+static void
+_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_progressbar_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_progressbar_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_progressbar_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_progressbar_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_progressbar_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_progressbar_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_progressbar_smart_content_set),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_progressbar_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_progressbar_smart_text_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_progressbar_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_SET), _pulse_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_GET), _pulse_get),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE), _pulse),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_SET), _value_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_GET), _value_get),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_SET), _span_size_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_GET), _span_size_get),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_SET), _unit_format_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_GET), _unit_format_get),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_FUNCTION_SET), _unit_format_function_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_SET), _inverted_set),
+ EO_OP_FUNC(ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_GET), _inverted_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_SET, "Set whether a given progress bar widget is at 'pulsing mode' or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_GET, "Get whether a given progress bar widget is at 'pulsing mode' or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE, "Start/stop a given progress bar 'pulsing' animation, if its under that mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_SET, "Set the progress value (in percentage) on a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_GET, "Get the progress value (in percentage) on a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_SET, "Set the (exact) length of the bar region of a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_GET, "Get the length set for the bar region of a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_SET, "Set the format string for a given progress bar widget's units label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_GET, "Retrieve the format string set for a given progress bar widget's units label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_FUNCTION_SET, "Set the format function pointer for the units label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_SET, "Set the orientation of a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_GET, "Retrieve the orientation of a given progress bar widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_SET, "Invert a given progress bar widget's displaying values order."),
+ EO_OP_DESCRIPTION(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_GET, "Get whether a given progress bar widget's displaying values are inverted or not."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_PROGRESSBAR_BASE_ID, op_desc, ELM_OBJ_PROGRESSBAR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Progressbar_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_progressbar_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
+
diff --git a/src/lib/elm_progressbar.h b/src/lib/elm_progressbar.h
index 7a10da4ff..c72706ece 100644
--- a/src/lib/elm_progressbar.h
+++ b/src/lib/elm_progressbar.h
@@ -60,6 +60,210 @@
* @li @ref progressbar_example
*/
+#define ELM_OBJ_PROGRESSBAR_CLASS elm_obj_progressbar_class_get()
+
+const Eo_Class *elm_obj_progressbar_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PROGRESSBAR_BASE_ID;
+
+typedef char *(*progressbar_func_type)(double);
+typedef void (*progressbar_freefunc_type)(char *);
+
+enum
+{
+ ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_FUNCTION_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_SET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_GET,
+ ELM_OBJ_PROGRESSBAR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PROGRESSBAR_ID(sub_id) (ELM_OBJ_PROGRESSBAR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_progressbar_pulse_set
+ * @since 1.8
+ *
+ * Set whether a given progress bar widget is at "pulsing mode" or
+ * not.
+ *
+ * @param[in] pulse
+ *
+ * @see elm_progressbar_pulse_set
+ */
+#define elm_obj_progressbar_pulse_set(pulse) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_SET), EO_TYPECHECK(Eina_Bool, pulse)
+
+/**
+ * @def elm_obj_progressbar_pulse_get
+ * @since 1.8
+ *
+ * Get whether a given progress bar widget is at "pulsing mode" or
+ * not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_pulse_get
+ */
+#define elm_obj_progressbar_pulse_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_progressbar_pulse
+ * @since 1.8
+ *
+ * Start/stop a given progress bar "pulsing" animation, if its
+ * under that mode
+ *
+ * @param[in] state
+ *
+ * @see elm_progressbar_pulse
+ */
+#define elm_obj_progressbar_pulse(state) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_PULSE), EO_TYPECHECK(Eina_Bool, state)
+
+/**
+ * @def elm_obj_progressbar_value_set
+ * @since 1.8
+ *
+ * Set the progress value (in percentage) on a given progress bar
+ *
+ * @param[in] val
+ *
+ * @see elm_progressbar_value_set
+ */
+#define elm_obj_progressbar_value_set(val) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_SET), EO_TYPECHECK(double, val)
+
+/**
+ * @def elm_obj_progressbar_value_get
+ * @since 1.8
+ *
+ * Get the progress value (in percentage) on a given progress bar
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_value_get
+ */
+#define elm_obj_progressbar_value_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_VALUE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_progressbar_span_size_set
+ * @since 1.8
+ *
+ * Set the (exact) length of the bar region of a given progress bar
+ *
+ * @param[in] size
+ *
+ * @see elm_progressbar_span_size_set
+ */
+#define elm_obj_progressbar_span_size_set(size) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_SET), EO_TYPECHECK(Evas_Coord, size)
+
+/**
+ * @def elm_obj_progressbar_span_size_get
+ * @since 1.8
+ *
+ * Get the length set for the bar region of a given progress bar
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_span_size_get
+ */
+#define elm_obj_progressbar_span_size_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_SPAN_SIZE_GET), EO_TYPECHECK(Evas_Coord *, ret)
+
+/**
+ * @def elm_obj_progressbar_unit_format_set
+ * @since 1.8
+ *
+ * Set the format string for a given progress bar widget's units
+ *
+ * @param[in] units
+ *
+ * @see elm_progressbar_unit_format_set
+ */
+#define elm_obj_progressbar_unit_format_set(units) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_SET), EO_TYPECHECK(const char *, units)
+
+/**
+ * @def elm_obj_progressbar_unit_format_get
+ * @since 1.8
+ *
+ * Retrieve the format string set for a given progress bar widget's
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_unit_format_get
+ */
+#define elm_obj_progressbar_unit_format_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_progressbar_unit_format_function_set
+ * @since 1.8
+ *
+ * Set the format function pointer for the units label
+ *
+ * @param[in] func
+ * @param[in] free_func
+ *
+ * @see elm_progressbar_unit_format_function_set
+ */
+#define elm_obj_progressbar_unit_format_function_set(func, free_func) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_UNIT_FORMAT_FUNCTION_SET), EO_TYPECHECK(progressbar_func_type, func), EO_TYPECHECK(progressbar_freefunc_type, free_func)
+
+/**
+ * @def elm_obj_progressbar_horizontal_set
+ * @since 1.8
+ *
+ * Set the orientation of a given progress bar widget
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_progressbar_horizontal_set
+ */
+#define elm_obj_progressbar_horizontal_set(horizontal) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_progressbar_horizontal_get
+ * @since 1.8
+ *
+ * Retrieve the orientation of a given progress bar widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_horizontal_get
+ */
+#define elm_obj_progressbar_horizontal_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_progressbar_inverted_set
+ * @since 1.8
+ *
+ * Invert a given progress bar widget's displaying values order
+ *
+ * @param[in] inverted
+ *
+ * @see elm_progressbar_inverted_set
+ */
+#define elm_obj_progressbar_inverted_set(inverted) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_SET), EO_TYPECHECK(Eina_Bool, inverted)
+
+/**
+ * @def elm_obj_progressbar_inverted_get
+ * @since 1.8
+ *
+ * Get whether a given progress bar widget's displaying values are
+ * inverted or not
+ *
+ * @param[out] ret
+ *
+ * @see elm_progressbar_inverted_get
+ */
+#define elm_obj_progressbar_inverted_get(ret) ELM_OBJ_PROGRESSBAR_ID(ELM_OBJ_PROGRESSBAR_SUB_ID_INVERTED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* Add a new progress bar widget to the given parent Elementary
* (container) object
diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c
index b1d32fecb..74a44067a 100644
--- a/src/lib/elm_radio.c
+++ b/src/lib/elm_radio.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_radio.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_RADIO_SMART_NAME[] = "elm_radio";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_RADIO_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_RADIO_CLASS
+
+#define MY_CLASS_NAME "elm_radio"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -22,10 +29,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_RADIO_SMART_NAME, _elm_radio, Elm_Radio_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_state_set(Evas_Object *obj, Eina_Bool state)
{
@@ -102,74 +105,89 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because radio's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_radio_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_radio_smart_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_radio_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if(!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
/* FIXME: replicated from elm_layout just because radio's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
-static Eina_Bool
-_elm_radio_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_radio_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_CONTAINER_CLASS(_elm_radio_parent_sc)->content_set
- (obj, part, content))
- return EINA_FALSE;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if(!int_ret) return;
_icon_signal_emit(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_radio_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_radio_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Evas_Event_Key_Down *ev;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if ((strcmp(ev->keyname, "Return")) &&
(strcmp(ev->keyname, "KP_Enter")) &&
(strcmp(ev->keyname, "space")))
- return EINA_FALSE;
+ return;
_activate(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_radio_smart_theme(Evas_Object *obj)
+static void
+_elm_radio_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_RADIO_DATA_GET(obj, sd);
+ Elm_Radio_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_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;
- if (!ELM_WIDGET_CLASS(_elm_radio_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (sd->state) elm_layout_signal_emit(obj, "elm,state,radio,on", "elm");
else elm_layout_signal_emit(obj, "elm,state,radio,off", "elm");
if (elm_widget_disabled_get(obj) && sd->state) _state_set(obj, EINA_FALSE);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
/* FIXME: replicated from elm_layout just because radio's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
@@ -178,32 +196,36 @@ _elm_radio_smart_theme(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_radio_smart_disable(Evas_Object *obj)
+static void
+_elm_radio_smart_disable(Eo *obj, void *_pd, va_list *list)
{
- ELM_RADIO_DATA_GET(obj, sd);
+ Elm_Radio_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
- if (!ELM_WIDGET_CLASS(_elm_radio_parent_sc)->disable(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_disable(&int_ret));
+ if (!int_ret) return;
if (elm_widget_disabled_get(obj) && sd->state) _state_set(obj, EINA_FALSE);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_radio_smart_sizing_eval(Evas_Object *obj)
+_elm_radio_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+
{
Evas_Coord minw = -1, minh = -1;
- ELM_RADIO_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
@@ -245,11 +267,12 @@ _access_state_cb(void *data __UNUSED__,
}
static void
-_elm_radio_smart_add(Evas_Object *obj)
+_elm_radio_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Radio_Smart_Data);
+ Elm_Radio_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_radio_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set(obj, "radio", "base", elm_widget_style_get(obj));
@@ -266,7 +289,7 @@ _elm_radio_smart_add(Evas_Object *obj)
elm_layout_sizing_eval(obj);
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Radio"));
_elm_access_callback_set
@@ -276,71 +299,50 @@ _elm_radio_smart_add(Evas_Object *obj)
}
static void
-_elm_radio_smart_del(Evas_Object *obj)
+_elm_radio_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_RADIO_DATA_GET(obj, sd);
+ Elm_Radio_Smart_Data *sd = _pd;
sd->group->radios = eina_list_remove(sd->group->radios, obj);
if (!sd->group->radios) free(sd->group);
- ELM_WIDGET_CLASS(_elm_radio_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_radio_smart_set_user(Elm_Radio_Smart_Class *sc)
+_elm_radio_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_radio_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_radio_smart_del;
-
- ELM_WIDGET_CLASS(sc)->disable = _elm_radio_smart_disable;
- ELM_WIDGET_CLASS(sc)->theme = _elm_radio_smart_theme;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_radio_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->event = _elm_radio_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_radio_smart_content_set;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_radio_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
-EAPI const Elm_Radio_Smart_Class *
-elm_radio_smart_class_get(void)
+static void
+_elm_radio_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Radio_Smart_Class _sc =
- ELM_RADIO_SMART_CLASS_INIT_NAME_VERSION(ELM_RADIO_SMART_NAME);
- static const Elm_Radio_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_radio_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
EAPI Evas_Object *
elm_radio_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_radio_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -348,7 +350,14 @@ elm_radio_group_add(Evas_Object *obj,
Evas_Object *group)
{
ELM_RADIO_CHECK(obj);
- ELM_RADIO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_radio_group_add(group));
+}
+
+static void
+_group_add(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *group = va_arg(*list, Evas_Object *);
+ Elm_Radio_Smart_Data *sd = _pd;
ELM_RADIO_DATA_GET(group, sdg);
if (!sdg)
@@ -376,7 +385,14 @@ elm_radio_state_value_set(Evas_Object *obj,
int value)
{
ELM_RADIO_CHECK(obj);
- ELM_RADIO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_radio_state_value_set(value));
+}
+
+static void
+_state_value_set(Eo *obj, void *_pd, va_list *list)
+{
+ int value = va_arg(*list, int);
+ Elm_Radio_Smart_Data *sd = _pd;
sd->value = value;
if (sd->value == sd->group->value) _state_set(obj, EINA_TRUE);
@@ -387,9 +403,17 @@ EAPI int
elm_radio_state_value_get(const Evas_Object *obj)
{
ELM_RADIO_CHECK(obj) 0;
- ELM_RADIO_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_radio_state_value_get(&ret));
+ return ret;
+}
- return sd->value;
+static void
+_state_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Radio_Smart_Data *sd = _pd;
+ *ret = sd->value;
}
EAPI void
@@ -397,7 +421,14 @@ elm_radio_value_set(Evas_Object *obj,
int value)
{
ELM_RADIO_CHECK(obj);
- ELM_RADIO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_radio_value_set(value));
+}
+
+static void
+_value_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int value = va_arg(*list, int);
+ Elm_Radio_Smart_Data *sd = _pd;
if (value == sd->group->value) return;
sd->group->value = value;
@@ -409,9 +440,17 @@ EAPI int
elm_radio_value_get(const Evas_Object *obj)
{
ELM_RADIO_CHECK(obj) 0;
- ELM_RADIO_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_radio_value_get(&ret));
+ return ret;
+}
- return sd->group->value;
+static void
+_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Radio_Smart_Data *sd = _pd;
+ *ret = sd->group->value;
}
EAPI void
@@ -419,7 +458,14 @@ elm_radio_value_pointer_set(Evas_Object *obj,
int *valuep)
{
ELM_RADIO_CHECK(obj);
- ELM_RADIO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_radio_value_pointer_set(valuep));
+}
+
+static void
+_value_pointer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *valuep = va_arg(*list, int *);
+ Elm_Radio_Smart_Data *sd = _pd;
if (valuep)
{
@@ -436,18 +482,100 @@ elm_radio_value_pointer_set(Evas_Object *obj,
EAPI Evas_Object *
elm_radio_selected_object_get(Evas_Object *obj)
{
+ ELM_RADIO_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_radio_selected_object_get(&ret));
+ return ret;
+}
+
+static void
+_selected_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
Eina_List *l;
Evas_Object *child;
- ELM_RADIO_CHECK(obj) NULL;
- ELM_RADIO_DATA_GET(obj, sd);
+ Elm_Radio_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->group->radios, l, child)
{
ELM_RADIO_DATA_GET(child, sdc);
- if (sdc->value == sd->group->value) return child;
+ if (sdc->value == sd->group->value)
+ {
+ *ret = child;
+ return;
+ }
}
- return NULL;
+ *ret = NULL;
+}
+
+static void
+_elm_radio_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_elm_radio_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_radio_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_radio_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_radio_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_radio_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_radio_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_radio_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_radio_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_radio_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_radio_smart_content_set),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_radio_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_radio_smart_text_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_radio_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_GROUP_ADD), _group_add),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET), _state_value_set),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET), _state_value_get),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_SET), _value_set),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_GET), _value_get),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET), _value_pointer_set),
+ EO_OP_FUNC(ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET), _selected_object_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_GROUP_ADD, "Add this radio to a group of other radio objects."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET, "Set the integer value that this radio object represents."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET, "Get the integer value that this radio object represents."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_VALUE_SET, "Set the value of the radio group."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_VALUE_GET, "Get the value of the radio group."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET, "Set a convenience pointer to a integer to change when radio group value changes."),
+ EO_OP_DESCRIPTION(ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET, "Get the selected radio object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_RADIO_BASE_ID, op_desc, ELM_OBJ_RADIO_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Radio_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_radio_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_radio.h b/src/lib/elm_radio.h
index a5361af18..13c4c7c1b 100644
--- a/src/lib/elm_radio.h
+++ b/src/lib/elm_radio.h
@@ -60,6 +60,111 @@
* @{
*/
+#define ELM_OBJ_RADIO_CLASS elm_obj_radio_class_get()
+
+const Eo_Class *elm_obj_radio_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_RADIO_BASE_ID;
+
+enum
+{
+ ELM_OBJ_RADIO_SUB_ID_GROUP_ADD,
+ ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET,
+ ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET,
+ ELM_OBJ_RADIO_SUB_ID_VALUE_SET,
+ ELM_OBJ_RADIO_SUB_ID_VALUE_GET,
+ ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET,
+ ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET,
+ ELM_OBJ_RADIO_SUB_ID_LAST
+};
+
+#define ELM_OBJ_RADIO_ID(sub_id) (ELM_OBJ_RADIO_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_radio_group_add
+ * @since 1.8
+ *
+ * @brief Add this radio to a group of other radio objects
+ *
+ * @param[in] group
+ *
+ * @see elm_radio_group_add
+ */
+#define elm_obj_radio_group_add(group) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_GROUP_ADD), EO_TYPECHECK(Evas_Object *, group)
+
+/**
+ * @def elm_obj_radio_state_value_set
+ * @since 1.8
+ *
+ * @brief Set the integer value that this radio object represents
+ *
+ * @param[in] value
+ *
+ * @see elm_radio_state_value_set
+ */
+#define elm_obj_radio_state_value_set(value) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_SET), EO_TYPECHECK(int, value)
+
+/**
+ * @def elm_obj_radio_state_value_get
+ * @since 1.8
+ *
+ * @brief Get the integer value that this radio object represents
+ *
+ * @param[out] ret
+ *
+ * @see elm_radio_state_value_get
+ */
+#define elm_obj_radio_state_value_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_STATE_VALUE_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_radio_value_set
+ * @since 1.8
+ *
+ * @brief Set the value of the radio group.
+ *
+ * @param[in] value
+ *
+ * @see elm_radio_value_set
+ */
+#define elm_obj_radio_value_set(value) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_SET), EO_TYPECHECK(int, value)
+
+/**
+ * @def elm_obj_radio_value_get
+ * @since 1.8
+ *
+ * @brief Get the value of the radio group
+ *
+ * @param[out] ret
+ *
+ * @see elm_radio_value_get
+ */
+#define elm_obj_radio_value_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_radio_value_pointer_set
+ * @since 1.8
+ *
+ * @brief Set a convenience pointer to a integer to change when radio group
+ *
+ * @param[in] valuep
+ *
+ * @see elm_radio_value_pointer_set
+ */
+#define elm_obj_radio_value_pointer_set(valuep) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_VALUE_POINTER_SET), EO_TYPECHECK(int *, valuep)
+
+/**
+ * @def elm_obj_radio_selected_object_get
+ * @since 1.8
+ *
+ * @brief Get the selected radio object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_radio_selected_object_get
+ */
+#define elm_obj_radio_selected_object_get(ret) ELM_OBJ_RADIO_ID(ELM_OBJ_RADIO_SUB_ID_SELECTED_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
/**
* @brief Add a new radio to the parent
*
diff --git a/src/lib/elm_route.c b/src/lib/elm_route.c
index 0d9006c6b..8ece6f51e 100644
--- a/src/lib/elm_route.c
+++ b/src/lib/elm_route.c
@@ -2,11 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_route.h"
-EAPI const char ELM_ROUTE_SMART_NAME[] = "elm_route";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_ROUTE_SMART_NAME, _elm_route, Elm_Route_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_ROUTE_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_ROUTE_CLASS
+
+#define MY_CLASS_NAME "elm_route"
static void
_clear_route(Evas_Object *obj)
@@ -82,16 +84,21 @@ _move_resize_cb(void *data __UNUSED__,
_sizing_eval(obj);
}
-static Eina_Bool
-_elm_route_smart_theme(Evas_Object *obj)
+static void
+_elm_route_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_route_parent_sc->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
//TODO
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
#ifdef ELM_EMAP
@@ -128,11 +135,11 @@ _update_lon_lat_min_max(Evas_Object *obj,
#endif
static void
-_elm_route_smart_add(Evas_Object *obj)
+_elm_route_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Route_Smart_Data);
+ Elm_Route_Smart_Data *priv = _pd;
- _elm_route_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
@@ -146,41 +153,19 @@ _elm_route_smart_add(Evas_Object *obj)
priv->lon_max = EMAP_LON_MIN;
priv->lat_min = EMAP_LAT_MAX;
priv->lat_max = EMAP_LAT_MIN;
+#else
+ (void)priv;
#endif
_sizing_eval(obj);
}
static void
-_elm_route_smart_del(Evas_Object *obj)
+_elm_route_smart_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
_clear_route(obj);
- ELM_WIDGET_CLASS(_elm_route_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_route_smart_set_user(Elm_Route_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_route_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_route_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_route_smart_theme;
-}
-
-EAPI const Elm_Route_Smart_Class *
-elm_route_smart_class_get(void)
-{
- static Elm_Route_Smart_Class _sc =
- ELM_ROUTE_SMART_CLASS_INIT_NAME_VERSION(ELM_ROUTE_SMART_NAME);
- static const Elm_Route_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_route_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
/**
@@ -194,19 +179,22 @@ elm_route_smart_class_get(void)
EAPI Evas_Object *
elm_route_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_route_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
return obj;
}
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+}
+
#ifdef ELM_EMAP
/**
* Set the emap object which describes the route
@@ -220,12 +208,24 @@ EAPI void
elm_route_emap_set(Evas_Object *obj,
EMap_Route *emap)
{
+ ELM_ROUTE_CHECK(obj);
+ eo_do(obj, elm_obj_route_emap_set(emap));
+}
+#endif
+
+static void
+_emap_set(Eo *obj, void *_pd, va_list *list)
+{
+ void *_emap = va_arg(*list, void *);
+
+#ifdef ELM_EMAP
+ EMap_Route *emap = _emap;
+
EMap_Route_Node *node, *node_prev = NULL;
Evas_Object *o;
Eina_List *l;
- ELM_ROUTE_CHECK(obj);
- ELM_ROUTE_DATA_GET(obj, sd);
+ Elm_Route_Smart_Data *sd = _pd;
sd->emap = emap;
@@ -260,9 +260,12 @@ elm_route_emap_set(Evas_Object *obj,
}
_sizing_eval(obj);
-}
-
+#else
+ (void)obj;
+ (void)_pd;
+ (void)_emap;
#endif
+}
EAPI void
elm_route_longitude_min_max_get(const Evas_Object *obj,
@@ -270,7 +273,16 @@ elm_route_longitude_min_max_get(const Evas_Object *obj,
double *max)
{
ELM_ROUTE_CHECK(obj);
- ELM_ROUTE_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_route_longitude_min_max_get(min, max));
+}
+
+static void
+_longitude_min_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *min = va_arg(*list, double *);
+ double *max = va_arg(*list, double *);
+
+ Elm_Route_Smart_Data *sd = _pd;
if (min) *min = sd->lon_min;
if (max) *max = sd->lon_max;
@@ -282,8 +294,54 @@ elm_route_latitude_min_max_get(const Evas_Object *obj,
double *max)
{
ELM_ROUTE_CHECK(obj);
- ELM_ROUTE_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_route_latitude_min_max_get(min, max));
+}
+
+static void
+_latitude_min_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *min = va_arg(*list, double *);
+ double *max = va_arg(*list, double *);
+
+ Elm_Route_Smart_Data *sd = _pd;
if (min) *min = sd->lat_min;
if (max) *max = sd->lat_max;
}
+
+static void
+_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_route_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_route_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_route_smart_theme),
+ EO_OP_FUNC(ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_EMAP_SET), _emap_set),
+ EO_OP_FUNC(ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_LONGITUDE_MIN_MAX_GET), _longitude_min_max_get),
+ EO_OP_FUNC(ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_LATITUDE_MIN_MAX_GET), _latitude_min_max_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_ROUTE_SUB_ID_EMAP_SET, "Set the emap object which describes the route."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ROUTE_SUB_ID_LONGITUDE_MIN_MAX_GET, "Get the minimum and maximum values along the longitude."),
+ EO_OP_DESCRIPTION(ELM_OBJ_ROUTE_SUB_ID_LATITUDE_MIN_MAX_GET, "Get the minimum and maximum values along the latitude."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_ROUTE_BASE_ID, op_desc, ELM_OBJ_ROUTE_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Route_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_route_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_route.h b/src/lib/elm_route.h
index ea10124f7..5bca30b02 100644
--- a/src/lib/elm_route.h
+++ b/src/lib/elm_route.h
@@ -10,6 +10,50 @@
* @{
*/
+#define ELM_OBJ_ROUTE_CLASS elm_obj_route_class_get()
+
+const Eo_Class *elm_obj_route_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_ROUTE_BASE_ID;
+
+enum
+{
+ ELM_OBJ_ROUTE_SUB_ID_EMAP_SET,
+ ELM_OBJ_ROUTE_SUB_ID_LONGITUDE_MIN_MAX_GET,
+ ELM_OBJ_ROUTE_SUB_ID_LATITUDE_MIN_MAX_GET,
+ ELM_OBJ_ROUTE_SUB_ID_LAST
+};
+
+#define ELM_OBJ_ROUTE_ID(sub_id) (ELM_OBJ_ROUTE_BASE_ID + sub_id)
+
+#define elm_obj_route_emap_set(emap) ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_EMAP_SET), EO_TYPECHECK(EMap_Route *, emap)
+
+/**
+ * @def elm_obj_route_longitude_min_max_get
+ * @since 1.8
+ *
+ * Get the minimum and maximum values along the longitude.
+ *
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_route_longitude_min_max_get
+ */
+#define elm_obj_route_longitude_min_max_get(min, max) ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_LONGITUDE_MIN_MAX_GET), EO_TYPECHECK(double *, min), EO_TYPECHECK(double *, max)
+
+/**
+ * @def elm_obj_route_latitude_min_max_get
+ * @since 1.8
+ *
+ * Get the minimum and maximum values along the latitude.
+ *
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_route_latitude_min_max_get
+ */
+#define elm_obj_route_latitude_min_max_get(min, max) ELM_OBJ_ROUTE_ID(ELM_OBJ_ROUTE_SUB_ID_LATITUDE_MIN_MAX_GET), EO_TYPECHECK(double *, min), EO_TYPECHECK(double *, max)
+
/**
* Add a new route object to the parent's canvas
*
diff --git a/src/lib/elm_scroller.c b/src/lib/elm_scroller.c
index 62f24da71..3b044fa50 100644
--- a/src/lib/elm_scroller.c
+++ b/src/lib/elm_scroller.c
@@ -1,7 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_interface_scrollable.h"
+#include "elm_widget_layout.h"
#include "elm_widget_scroller.h"
-EAPI const char ELM_SCROLLER_SMART_NAME[] = "elm_scroller";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_SCROLLER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_SCROLLER_CLASS
+
+#define MY_CLASS_NAME "elm_scroller"
static const char SIG_SCROLL[] = "scroll";
static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start";
@@ -26,22 +34,16 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
+static void
+_elm_scroller_smart_event(Eo *obj, void *_pd, va_list *list)
{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_SCROLLER_SMART_NAME, _elm_scroller, Elm_Scroller_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks,
- _smart_interfaces);
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
-static Eina_Bool
-_elm_scroller_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
-{
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord c_x = 0;
@@ -56,17 +58,20 @@ _elm_scroller_smart_event(Evas_Object *obj,
Evas_Coord step_y = 0;
Evas_Event_Key_Down *ev = event_info;
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Elm_Scroller_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->step_size_get(obj, &step_x, &step_y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
- evas_object_geometry_get(sd->content, &c_x, &c_y, &max_x, &max_y);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_step_size_get(&step_x, &step_y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
+ eo_do(sd->content,
+ evas_obj_position_get(&c_x, &c_y),
+ evas_obj_size_get(&max_x, &max_y));
if (((!strcmp(ev->keyname, "Left")) ||
(!strcmp(ev->keyname, "KP_Left")) ||
@@ -112,7 +117,8 @@ _elm_scroller_smart_event(Evas_Object *obj,
{
elm_widget_focus_steal(cur);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
cur_weight = 1.0 / cur_weight;
if (cur_weight > weight)
@@ -126,7 +132,8 @@ _elm_scroller_smart_event(Evas_Object *obj,
{
elm_widget_focus_steal(new_focus);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
else
@@ -172,7 +179,8 @@ _elm_scroller_smart_event(Evas_Object *obj,
{
elm_widget_focus_steal(new_focus);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
}
@@ -180,25 +188,25 @@ _elm_scroller_smart_event(Evas_Object *obj,
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
{
- if (x <= 0) return EINA_FALSE;
+ if (x <= 0) return;
x -= step_x;
}
else if ((!strcmp(ev->keyname, "Right")) ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
{
- if (x >= (max_x - v_w)) return EINA_FALSE;
+ if (x >= (max_x - v_w)) return;
x += step_x;
}
else if ((!strcmp(ev->keyname, "Up")) ||
((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
{
- if (y == 0) return EINA_FALSE;
+ if (y == 0) return;
y -= step_y;
}
else if ((!strcmp(ev->keyname, "Down")) ||
((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
{
- if (y >= (max_y - v_h)) return EINA_FALSE;
+ if (y >= (max_y - v_h)) return;
y += step_y;
}
else if ((!strcmp(ev->keyname, "Home")) ||
@@ -227,17 +235,21 @@ _elm_scroller_smart_event(Evas_Object *obj,
else
y += page_y;
}
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- sd->s_iface->content_pos_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_scroller_smart_activate(Evas_Object *obj, Elm_Activate act)
+static void
+_elm_scroller_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Activate act = va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord v_w = 0;
@@ -245,14 +257,13 @@ _elm_scroller_smart_activate(Evas_Object *obj, Elm_Activate act)
Evas_Coord page_x = 0;
Evas_Coord page_y = 0;
- ELM_SCROLLER_DATA_GET(obj, sd);
-
if ((elm_widget_disabled_get(obj)) ||
- (act == ELM_ACTIVATE_DEFAULT)) return EINA_FALSE;
+ (act == ELM_ACTIVATE_DEFAULT)) return;
- sd->s_iface->content_pos_get(obj, &x, &y);
- sd->s_iface->page_size_get(obj, &page_x, &page_y);
- sd->s_iface->content_viewport_size_get(obj, &v_w, &v_h);
+ eo_do(obj,
+ elm_scrollable_interface_content_pos_get(&x, &y),
+ elm_scrollable_interface_page_size_get(&page_x, &page_y),
+ elm_scrollable_interface_content_viewport_size_get(&v_w, &v_h));
if (act == ELM_ACTIVATE_UP)
{
@@ -283,21 +294,19 @@ _elm_scroller_smart_activate(Evas_Object *obj, Elm_Activate act)
x += page_x;
}
- sd->s_iface->content_pos_set(obj, x, y);
- return EINA_TRUE;
+ eo_do(obj, elm_scrollable_interface_content_pos_set(x, y));
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_scroller_smart_sizing_eval(Evas_Object *obj)
+_elm_scroller_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord vw = 0, vh = 0, minw = 0, minh = 0, maxw = 0, maxh = 0, w, h,
vmw, vmh;
double xw = 0.0, yw = 0.0;
- ELM_SCROLLER_DATA_GET(obj, sd);
-
- /* parent class' early call */
- if (!sd->s_iface) return;
+ Elm_Scroller_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->content)
{
@@ -306,7 +315,7 @@ _elm_scroller_smart_sizing_eval(Evas_Object *obj)
evas_object_size_hint_weight_get(sd->content, &xw, &yw);
}
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (xw > 0.0)
{
if ((minw > 0) && (vw < minw))
@@ -331,7 +340,7 @@ _elm_scroller_smart_sizing_eval(Evas_Object *obj)
w = -1;
h = -1;
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &vmw, &vmh);
+ edje_object_size_min_calc(wd->resize_obj, &vmw, &vmh);
if (sd->min_w) w = vmw + minw;
if (sd->min_h) h = vmh + minh;
@@ -347,34 +356,46 @@ static void
_mirrored_set(Evas_Object *obj,
Eina_Bool mirrored)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
-
- sd->s_iface->mirrored_set(obj, mirrored);
+ eo_do(obj, elm_scrollable_interface_mirrored_set(mirrored));
}
-static Eina_Bool
-_elm_scroller_smart_theme(Evas_Object *obj)
+static void
+_elm_scroller_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+}
+
+static void
+_elm_scroller_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_scroller_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_scroller_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
Evas_Object *cur;
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Elm_Scroller_Smart_Data *sd = _pd;
- if (!sd->content) return EINA_FALSE;
+ if (!sd->content) return;
cur = sd->content;
@@ -383,13 +404,25 @@ _elm_scroller_smart_focus_next(const Evas_Object *obj,
{
if ((elm_widget_can_focus_get(cur)) ||
(elm_widget_child_can_focus_get(cur)))
- return elm_widget_focus_next_get(cur, dir, next);
+ {
+ int_ret = elm_widget_focus_next_get(cur, dir, next);
+ if (ret) *ret = int_ret;
+ return;
+ }
}
/* Return */
*next = (Evas_Object *)obj;
- return !elm_widget_focus_get(obj);
+ int_ret = !elm_widget_focus_get(obj);
+ if (ret) *ret = int_ret;
+}
+
+static void
+_elm_scroller_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
static void
@@ -398,10 +431,8 @@ _show_region_hook(void *data,
{
Evas_Coord x, y, w, h;
- ELM_SCROLLER_DATA_GET(data, sd);
-
elm_widget_show_region_get(content_obj, &x, &y, &w, &h);
- sd->s_iface->content_region_show(data, x, y, w, h);
+ eo_do(data, elm_scrollable_interface_content_region_show(x, y, w, h));
}
static void
@@ -413,14 +444,17 @@ _changed_size_hints_cb(void *data,
elm_layout_sizing_eval(data);
}
-static Eina_Bool
-_elm_scroller_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_scroller_smart_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Scroller_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->sub_object_del(obj, sobj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ if (!int_ret) return;
if (sobj == sd->content)
{
@@ -429,7 +463,7 @@ _elm_scroller_smart_sub_object_del(Evas_Object *obj,
sd->content = NULL;
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -504,18 +538,25 @@ _scroll_drag_stop_cb(Evas_Object *obj,
evas_object_smart_callback_call(obj, SIG_SCROLL_DRAG_STOP, NULL);
}
-static Eina_Bool
-_elm_scroller_smart_content_set(Evas_Object *obj,
- const char *part,
- Evas_Object *content)
+static void
+_elm_scroller_smart_content_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object *content = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
+ Eina_Bool int_ret;
+
+ Elm_Scroller_Smart_Data *sd = _pd;
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS
- (_elm_scroller_parent_sc)->content_set(obj, part, content);
+ {
+ eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ if (ret) *ret = int_ret;
+ return;
+ }
- if (sd->content == content) return EINA_TRUE;
+ if (sd->content == content) return;
if (sd->content) evas_object_del(sd->content);
sd->content = content;
@@ -525,47 +566,54 @@ _elm_scroller_smart_content_set(Evas_Object *obj,
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
elm_widget_sub_object_add(obj, content);
- sd->s_iface->content_set(obj, content);
+ eo_do(obj, elm_scrollable_interface_content_set(content));
}
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ return;
}
-static Evas_Object *
-_elm_scroller_smart_content_get(const Evas_Object *obj,
- const char *part)
+static void
+_elm_scroller_smart_content_get(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+
+ Elm_Scroller_Smart_Data *sd = _pd;
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS
- (_elm_scroller_parent_sc)->content_get(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_get(part, ret));
+ return;
+ }
- return sd->content;
+ *ret = sd->content;
}
-static Evas_Object *
-_elm_scroller_smart_content_unset(Evas_Object *obj,
- const char *part)
+static void
+_elm_scroller_smart_content_unset(Eo *obj, void *_pd, va_list *list)
{
- Evas_Object *content;
+ const char *part = va_arg(*list, const char *);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ if (ret) *ret = NULL;
+ Evas_Object *int_ret;
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Elm_Scroller_Smart_Data *sd = _pd;
if (part && strcmp(part, "default"))
- return ELM_CONTAINER_CLASS
- (_elm_scroller_parent_sc)->content_unset(obj, part);
+ {
+ eo_do_super(obj, elm_obj_container_content_unset(part, &int_ret));
+ return;
+ }
- if (!sd->content) return NULL;
+ if (!sd->content) return;
- content = sd->content;
+ int_ret = sd->content;
+ if (ret) *ret = int_ret;
elm_widget_sub_object_del(obj, sd->content);
- sd->s_iface->content_set(obj, NULL);
+ eo_do(obj, elm_scrollable_interface_content_set(NULL));
sd->content = NULL;
-
- return content;
}
static void
@@ -582,13 +630,14 @@ _elm_scroller_content_min_limit_cb(Evas_Object *obj,
}
static void
-_elm_scroller_smart_add(Evas_Object *obj)
+_elm_scroller_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw, minh;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Scroller_Smart_Data);
+ Elm_Scroller_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -602,126 +651,84 @@ _elm_scroller_smart_add(Evas_Object *obj)
evas_object_show(priv->hit_rect);
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
evas_object_event_callback_add
(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints_cb, obj);
- edje_object_size_min_calc(ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, obj);
- priv->s_iface->edge_left_cb_set(obj, _edge_left_cb);
- priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
- priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
- priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
- priv->s_iface->scroll_cb_set(obj, _scroll_cb);
- priv->s_iface->animate_start_cb_set(obj, _scroll_anim_start_cb);
- priv->s_iface->animate_stop_cb_set(obj, _scroll_anim_stop_cb);
- priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
- priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
-
- priv->s_iface->content_min_limit_cb_set
- (obj, _elm_scroller_content_min_limit_cb);
+ eo_do(obj,
+ elm_scrollable_interface_edge_left_cb_set(_edge_left_cb),
+ elm_scrollable_interface_edge_right_cb_set(_edge_right_cb),
+ elm_scrollable_interface_edge_top_cb_set(_edge_top_cb),
+ elm_scrollable_interface_edge_bottom_cb_set(_edge_bottom_cb),
+ elm_scrollable_interface_scroll_cb_set(_scroll_cb),
+ elm_scrollable_interface_animate_start_cb_set(_scroll_anim_start_cb),
+ elm_scrollable_interface_animate_stop_cb_set(_scroll_anim_stop_cb),
+ elm_scrollable_interface_drag_start_cb_set(_scroll_drag_start_cb),
+ elm_scrollable_interface_drag_stop_cb_set(_scroll_drag_stop_cb),
+ elm_scrollable_interface_content_min_limit_cb_set(_elm_scroller_content_min_limit_cb));
}
static void
-_elm_scroller_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_scroller_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Scroller_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_scroller_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_scroller_smart_resize(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Scroller_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_scroller_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_scroller_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_SCROLLER_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Scroller_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_scroller_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
}
-static void
-_elm_scroller_smart_set_user(Elm_Scroller_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_scroller_smart_add;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_scroller_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_scroller_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_scroller_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_scroller_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->theme = _elm_scroller_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_scroller_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->event = _elm_scroller_smart_event;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
- ELM_WIDGET_CLASS(sc)->activate = _elm_scroller_smart_activate;
-
- ELM_CONTAINER_CLASS(sc)->content_set = _elm_scroller_smart_content_set;
- ELM_CONTAINER_CLASS(sc)->content_get = _elm_scroller_smart_content_get;
- ELM_CONTAINER_CLASS(sc)->content_unset = _elm_scroller_smart_content_unset;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_scroller_smart_sizing_eval;
-}
-
-EAPI const Elm_Scroller_Smart_Class *
-elm_scroller_smart_class_get(void)
-{
- static Elm_Scroller_Smart_Class _sc =
- ELM_SCROLLER_SMART_CLASS_INIT_NAME_VERSION(ELM_SCROLLER_SMART_NAME);
- static const Elm_Scroller_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_scroller_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_scroller_add(Evas_Object *parent)
{
- Evas *e;
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- e = evas_object_evas_get(parent);
- if (!e) return NULL;
-
- obj = evas_object_smart_add(e, _elm_scroller_smart_class_new());
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
/* deprecated */
@@ -731,14 +738,22 @@ elm_scroller_custom_widget_base_theme_set(Evas_Object *obj,
const char *group)
{
ELM_SCROLLER_CHECK(obj);
- ELM_SCROLLER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_scroller_custom_widget_base_theme_set(klass, group));
+}
+
+static void
+_custom_widget_base_theme_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *klass = va_arg(*list, const char *);
+ const char *group = va_arg(*list, const char *);
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
EINA_SAFETY_ON_NULL_RETURN(klass);
EINA_SAFETY_ON_NULL_RETURN(group);
- if (eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->klass), klass) ||
- eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->group), group))
- _elm_scroller_smart_theme(obj);
+ if (eina_stringshare_replace(&(ld->klass), klass) ||
+ eina_stringshare_replace(&(ld->group), group))
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI void
@@ -748,7 +763,7 @@ elm_scroller_content_min_limit(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->content_min_limit(obj, w, h);
+ eo_do(obj, elm_scrollable_interface_content_min_limit(w, h));
}
EAPI void
@@ -760,7 +775,7 @@ elm_scroller_region_show(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->content_region_show(obj, x, y, w, h);
+ eo_do(obj, elm_scrollable_interface_content_region_show(x, y, w, h));
}
EAPI void
@@ -769,12 +784,20 @@ elm_scroller_policy_set(Evas_Object *obj,
Elm_Scroller_Policy policy_v)
{
ELM_SCROLLABLE_CHECK(obj);
+ eo_do(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
+}
+
+static void
+_policy_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Scroller_Policy policy_h = va_arg(*list, Elm_Scroller_Policy);
+ Elm_Scroller_Policy policy_v = va_arg(*list, Elm_Scroller_Policy);
if ((policy_h >= ELM_SCROLLER_POLICY_LAST) ||
(policy_v >= ELM_SCROLLER_POLICY_LAST))
return;
- s_iface->policy_set(obj, policy_h, policy_v);
+ eo_do_super(obj, elm_scrollable_interface_policy_set(policy_h, policy_v));
}
EAPI void
@@ -784,7 +807,7 @@ elm_scroller_policy_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->policy_get(obj, policy_h, policy_v);
+ eo_do((Eo *) obj, elm_scrollable_interface_policy_get(policy_h, policy_v));
}
EAPI void
@@ -795,9 +818,19 @@ elm_scroller_region_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_SCROLLABLE_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_scroller_region_get(x, y, w, h));
+}
+
+static void
+_region_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
- if ((x) || (y)) s_iface->content_pos_get(obj, x, y);
- if ((w) || (h)) s_iface->content_viewport_size_get(obj, w, h);
+ if ((x) || (y)) eo_do((Eo *) obj, elm_scrollable_interface_content_pos_get(x, y));
+ if ((w) || (h)) eo_do((Eo *) obj, elm_scrollable_interface_content_viewport_size_get(w, h));
}
EAPI void
@@ -806,8 +839,16 @@ elm_scroller_child_size_get(const Evas_Object *obj,
Evas_Coord *h)
{
ELM_SCROLLABLE_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_scroller_child_size_get(w, h));
+}
+
+static void
+_child_size_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
- s_iface->content_size_get(obj, w, h);
+ eo_do((Eo *) obj, elm_scrollable_interface_content_size_get(w, h));
}
EAPI void
@@ -817,7 +858,7 @@ elm_scroller_bounce_set(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->bounce_allow_set(obj, h_bounce, v_bounce);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(h_bounce, v_bounce));
}
EAPI void
@@ -827,7 +868,7 @@ elm_scroller_bounce_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->bounce_allow_get(obj, h_bounce, v_bounce);
+ eo_do((Eo *) obj, elm_scrollable_interface_bounce_allow_get(h_bounce, v_bounce));
}
EAPI void
@@ -835,14 +876,21 @@ elm_scroller_page_relative_set(Evas_Object *obj,
double h_pagerel,
double v_pagerel)
{
+ ELM_SCROLLABLE_CHECK(obj);
+ eo_do(obj, elm_obj_scroller_page_relative_set(h_pagerel, v_pagerel));
+}
+
+static void
+_page_relative_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
Evas_Coord pagesize_h, pagesize_v;
- ELM_SCROLLABLE_CHECK(obj);
+ double h_pagerel = va_arg(*list, double);
+ double v_pagerel = va_arg(*list, double);
- s_iface->paging_get(obj, NULL, NULL, &pagesize_h, &pagesize_v);
+ eo_do(obj, elm_scrollable_interface_paging_get(NULL, NULL, &pagesize_h, &pagesize_v));
- s_iface->paging_set
- (obj, h_pagerel, v_pagerel, pagesize_h, pagesize_v);
+ eo_do(obj, elm_scrollable_interface_paging_set(h_pagerel, v_pagerel, pagesize_h, pagesize_v));
}
EAPI void
@@ -852,7 +900,7 @@ elm_scroller_page_relative_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->paging_get(obj, h_pagerel, v_pagerel, NULL, NULL);
+ eo_do((Eo *)obj, elm_scrollable_interface_paging_get(h_pagerel, v_pagerel, NULL, NULL));
}
EAPI void
@@ -860,14 +908,21 @@ elm_scroller_page_size_set(Evas_Object *obj,
Evas_Coord h_pagesize,
Evas_Coord v_pagesize)
{
+ ELM_SCROLLABLE_CHECK(obj);
+ eo_do(obj, elm_scrollable_interface_page_size_set(h_pagesize, v_pagesize));
+}
+
+static void
+_page_size_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
double pagerel_h, pagerel_v;
- ELM_SCROLLABLE_CHECK(obj);
+ Evas_Coord h_pagesize = va_arg(*list, Evas_Coord);
+ Evas_Coord v_pagesize = va_arg(*list, Evas_Coord);
- s_iface->paging_get(obj, &pagerel_h, &pagerel_v, NULL, NULL);
+ eo_do(obj, elm_scrollable_interface_paging_get(&pagerel_h, &pagerel_v, NULL, NULL));
- s_iface->paging_set
- (obj, pagerel_h, pagerel_v, h_pagesize, v_pagesize);
+ eo_do(obj, elm_scrollable_interface_paging_set(pagerel_h, pagerel_v, h_pagesize, v_pagesize));
}
EAPI void
@@ -877,7 +932,7 @@ elm_scroller_page_size_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->paging_get(obj, NULL, NULL, h_pagesize, v_pagesize);
+ eo_do((Eo *)obj, elm_scrollable_interface_paging_get(NULL, NULL, h_pagesize, v_pagesize));
}
EAPI void
@@ -887,7 +942,7 @@ elm_scroller_current_page_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->current_page_get(obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_current_page_get(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -897,7 +952,7 @@ elm_scroller_last_page_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->last_page_get(obj, h_pagenumber, v_pagenumber);
+ eo_do((Eo *) obj, elm_scrollable_interface_last_page_get(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -907,7 +962,7 @@ elm_scroller_page_show(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->page_show(obj, h_pagenumber, v_pagenumber);
+ eo_do(obj, elm_scrollable_interface_page_show(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -917,7 +972,7 @@ elm_scroller_page_bring_in(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->page_bring_in(obj, h_pagenumber, v_pagenumber);
+ eo_do(obj, elm_scrollable_interface_page_bring_in(h_pagenumber, v_pagenumber));
}
EAPI void
@@ -929,7 +984,7 @@ elm_scroller_region_bring_in(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->region_bring_in(obj, x, y, w, h);
+ eo_do(obj, elm_scrollable_interface_region_bring_in(x, y, w, h));
}
EAPI void
@@ -939,7 +994,7 @@ elm_scroller_gravity_set(Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->gravity_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_gravity_set(x, y));
}
EAPI void
@@ -949,32 +1004,102 @@ elm_scroller_gravity_get(const Evas_Object *obj,
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->gravity_get(obj, x, y);
+ eo_do((Eo *) obj, elm_scrollable_interface_gravity_get(x, y));
}
EAPI void
elm_scroller_propagate_events_set(Evas_Object *obj,
Eina_Bool propagation)
{
- Elm_Widget_Smart_Data *sd;
-
ELM_SCROLLABLE_CHECK(obj);
+ eo_do(obj, elm_obj_scroller_propagate_events_set(propagation));
+}
- sd = evas_object_smart_data_get(obj);
- if (!sd) return; /* just being paranoid */
+static void
+_propagate_events_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool propagation = va_arg(*list, int);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- evas_object_propagate_events_set(sd->resize_obj, propagation);
+ evas_object_propagate_events_set(wd->resize_obj, propagation);
}
EAPI Eina_Bool
elm_scroller_propagate_events_get(const Evas_Object *obj)
{
- Elm_Widget_Smart_Data *sd;
-
ELM_SCROLLABLE_CHECK(obj, EINA_FALSE);
- sd = evas_object_smart_data_get(obj);
- if (!sd) return EINA_FALSE; /* just being paranoid */
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_scroller_propagate_events_get(&ret));
+ return ret;
+}
- return evas_object_propagate_events_get(sd->resize_obj);
+static void
+_propagate_events_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = evas_object_propagate_events_get(wd->resize_obj);
}
+
+static void
+_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_MEMBER_ADD), _elm_scroller_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_scroller_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_scroller_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_scroller_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_scroller_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_scroller_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_scroller_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_scroller_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_scroller_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_scroller_smart_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_scroller_smart_activate),
+
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_scroller_smart_content_set),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_scroller_smart_content_get),
+ EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), _elm_scroller_smart_content_unset),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_scroller_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_POLICY_SET), _policy_set),
+ EO_OP_FUNC(ELM_SCROLLABLE_INTERFACE_ID(ELM_SCROLLABLE_INTERFACE_SUB_ID_PAGE_SIZE_SET), _page_size_set),
+
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_CUSTOM_WIDGET_BASE_THEME_SET), _custom_widget_base_theme_set),
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_REGION_GET), _region_get),
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_CHILD_SIZE_GET), _child_size_get),
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PAGE_RELATIVE_SET), _page_relative_set),
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_SET), _propagate_events_set),
+ EO_OP_FUNC(ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_GET), _propagate_events_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_CUSTOM_WIDGET_BASE_THEME_SET, "DEPRECATED: Set custom theme elements for the scroller"),
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_REGION_GET, "Get the currently visible content region."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_CHILD_SIZE_GET, "Get the size of the content object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_PAGE_RELATIVE_SET, "Set scroll page size relative to viewport size."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_SET, "Set event propagation on a scroller."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_GET, "Get event propagation for a scroller."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SCROLLER_BASE_ID, op_desc, ELM_OBJ_SCROLLER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Scroller_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_scroller_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
diff --git a/src/lib/elm_scroller.h b/src/lib/elm_scroller.h
index 0cf56edf8..6c69db8d1 100644
--- a/src/lib/elm_scroller.h
+++ b/src/lib/elm_scroller.h
@@ -51,6 +51,104 @@
* @{
*/
+#define ELM_OBJ_SCROLLER_CLASS elm_obj_scroller_class_get()
+
+const Eo_Class *elm_obj_scroller_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SCROLLER_BASE_ID;
+
+enum
+{
+ ELM_OBJ_SCROLLER_SUB_ID_CUSTOM_WIDGET_BASE_THEME_SET,
+ ELM_OBJ_SCROLLER_SUB_ID_REGION_GET,
+ ELM_OBJ_SCROLLER_SUB_ID_CHILD_SIZE_GET,
+ ELM_OBJ_SCROLLER_SUB_ID_PAGE_RELATIVE_SET,
+ ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_SET,
+ ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_GET,
+ ELM_OBJ_SCROLLER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SCROLLER_ID(sub_id) (ELM_OBJ_SCROLLER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_scroller_custom_widget_base_theme_set
+ * @since 1.8
+ *
+ * @brief Set custom theme elements for the scroller
+ *
+ * @param[in] klass
+ * @param[in] group
+ *
+ * @see elm_scroller_custom_widget_base_theme_set
+ */
+#define elm_obj_scroller_custom_widget_base_theme_set(klass, group) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_CUSTOM_WIDGET_BASE_THEME_SET), EO_TYPECHECK(const char *, klass), EO_TYPECHECK(const char *, group)
+
+/**
+ * @def elm_obj_scroller_region_get
+ * @since 1.8
+ *
+ * @brief Get the currently visible content region
+ *
+ * @param[out] x
+ * @param[out] y
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_scroller_region_get
+ */
+#define elm_obj_scroller_region_get(x, y, w, h) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_REGION_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+/**
+ * @def elm_obj_scroller_child_size_get
+ * @since 1.8
+ *
+ * @brief Get the size of the content object
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_scroller_child_size_get
+ */
+#define elm_obj_scroller_child_size_get(w, h) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_CHILD_SIZE_GET), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+/**
+ * @def elm_obj_scroller_page_relative_set
+ * @since 1.8
+ *
+ * @brief Set scroll page size relative to viewport size.
+ *
+ * @param[in] h_pagerel
+ * @param[in] v_pagerel
+ *
+ * @see elm_scroller_page_relative_set
+ */
+#define elm_obj_scroller_page_relative_set(h_pagerel, v_pagerel) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PAGE_RELATIVE_SET), EO_TYPECHECK(double, h_pagerel), EO_TYPECHECK(double, v_pagerel)
+
+/**
+ * @def elm_obj_scroller_propagate_events_set
+ * @since 1.8
+ *
+ * @brief Set event propagation on a scroller
+ *
+ * @param[in] propagation
+ *
+ * @see elm_scroller_propagate_events_set
+ */
+#define elm_obj_scroller_propagate_events_set(propagation) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_SET), EO_TYPECHECK(Eina_Bool, propagation)
+
+/**
+ * @def elm_obj_scroller_propagate_events_get
+ * @since 1.8
+ *
+ * @brief Get event propagation for a scroller
+ *
+ * @param[out] ret
+ *
+ * @see elm_scroller_propagate_events_get
+ */
+#define elm_obj_scroller_propagate_events_get(ret) ELM_OBJ_SCROLLER_ID(ELM_OBJ_SCROLLER_SUB_ID_PROPAGATE_EVENTS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @brief Type that controls when scrollbars should appear.
*
diff --git a/src/lib/elm_segment_control.c b/src/lib/elm_segment_control.c
index 5a469d981..e7cccbf38 100644
--- a/src/lib/elm_segment_control.c
+++ b/src/lib/elm_segment_control.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_segment_control.h"
-EAPI const char ELM_SEGMENT_CONTROL_SMART_NAME[] = "elm_segment_control";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_SEGMENT_CONTROL_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_SEGMENT_CONTROL_CLASS
+
+#define MY_CLASS_NAME "elm_segment_control"
static const char SIG_CHANGED[] = "changed";
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
@@ -10,25 +16,21 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_SEGMENT_CONTROL_SMART_NAME, _elm_segment_control,
- Elm_Segment_Control_Smart_Class, Elm_Layout_Smart_Class,
- elm_layout_smart_class_get, _smart_callbacks);
-
static void
-_elm_segment_control_smart_sizing_eval(Evas_Object *obj)
+_elm_segment_control_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
Evas_Coord w, h;
int item_count;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
item_count = eina_list_count(sd->items);
elm_coords_finger_size_adjust(item_count, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(item_count, &minw, 1, &minh);
evas_object_size_hint_min_get(obj, &w, &h);
@@ -60,13 +62,15 @@ _position_items(Elm_Segment_Control_Smart_Data *sd)
Elm_Segment_Item *it;
int bx, by, bw, bh, pos;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+
item_count = eina_list_count(sd->items);
if (item_count <= 0) return;
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &bx, &by, &bw, &bh);
+ (wd->resize_obj, &bx, &by, &bw, &bh);
sd->item_width = bw / item_count;
- rtl = elm_widget_mirrored_get(ELM_WIDGET_DATA(sd)->obj);
+ rtl = elm_widget_mirrored_get(sd->obj);
if (rtl) pos = bx + bw - sd->item_width;
else pos = bx;
@@ -79,7 +83,7 @@ _position_items(Elm_Segment_Control_Smart_Data *sd)
else pos += sd->item_width;
}
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ elm_layout_sizing_eval(sd->obj);
}
static void
@@ -133,7 +137,7 @@ _update_list(Elm_Segment_Control_Smart_Data *sd)
else
edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm");
- if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj))
+ if (elm_widget_disabled_get(sd->obj))
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
else
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
@@ -142,7 +146,7 @@ _update_list(Elm_Segment_Control_Smart_Data *sd)
return;
}
- rtl = elm_widget_mirrored_get(ELM_WIDGET_DATA(sd)->obj);
+ rtl = elm_widget_mirrored_get(sd->obj);
EINA_LIST_FOREACH(sd->items, l, it)
{
it->seg_index = idx;
@@ -176,7 +180,7 @@ _update_list(Elm_Segment_Control_Smart_Data *sd)
else
edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm");
- if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj))
+ if (elm_widget_disabled_get(sd->obj))
edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
else
edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
@@ -186,17 +190,20 @@ _update_list(Elm_Segment_Control_Smart_Data *sd)
}
}
-static Eina_Bool
-_elm_segment_control_smart_theme(Evas_Object *obj)
+static void
+_elm_segment_control_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Eina_List *l;
Eina_Bool rtl;
Elm_Segment_Item *it;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
- if (!ELM_WIDGET_CLASS(_elm_segment_control_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
rtl = elm_widget_mirrored_get(obj);
@@ -212,20 +219,23 @@ _elm_segment_control_smart_theme(Evas_Object *obj)
_update_list(sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_segment_control_smart_disable(Evas_Object *obj)
+static void
+_elm_segment_control_smart_disable(Eo *obj, void *_pd, va_list *list)
{
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
- if (!ELM_WIDGET_CLASS(_elm_segment_control_parent_sc)->disable(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_disable(&int_ret));
+ if (!int_ret) return;
_update_list(sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
// TODO: elm_widget_focus_list_next_get supports only Elm_widget list,
@@ -244,16 +254,20 @@ _elm_list_data_get(const Eina_List *list)
return VIEW(it);
}
-static Eina_Bool
-_elm_segment_control_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_segment_control_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
static int count = 0;
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ Elm_Segment_Control_Smart_Data *sd = _pd;
/* Focus chain */
if ((items = elm_widget_focus_custom_chain_get(obj)))
@@ -262,10 +276,11 @@ _elm_segment_control_smart_focus_next(const Evas_Object *obj,
{
items = sd->items;
list_data_get = _elm_list_data_get;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- return elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
#endif
@@ -292,7 +307,7 @@ _segment_on(Elm_Segment_Item *it)
edje_object_signal_emit(VIEW(it), "elm,state,segment,selected", "elm");
sd->selected_item = it;
- evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_CHANGED, it);
+ evas_object_smart_callback_call(sd->obj, SIG_CHANGED, it);
}
static void
@@ -319,7 +334,8 @@ _on_mouse_up(void *data,
if (ev->button != 1) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
+ if (elm_widget_disabled_get(sd->obj)) return;
+
if (it == sd->selected_item) return;
ev = event_info;
@@ -344,7 +360,8 @@ _on_mouse_down(void *data,
ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
if (ev->button != 1) return;
- if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
+ if (elm_widget_disabled_get(sd->obj)) return;
+
if (it == sd->selected_item) return;
edje_object_signal_emit(VIEW(it), "elm,state,segment,pressed", "elm");
@@ -501,8 +518,9 @@ _access_state_cb(void *data,
Elm_Segment_Item *it = (Elm_Segment_Item *)data;
ELM_SEGMENT_CONTROL_ITEM_CHECK_OR_RETURN(it, NULL);
ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(WIDGET(it), ELM_OBJ_WIDGET_CLASS);
- if (ELM_WIDGET_DATA(sd)->disabled)
+ if (wd->disabled)
return strdup(E_("State: Disabled"));
if (it == sd->selected_item)
@@ -575,11 +593,9 @@ _item_new(Evas_Object *obj,
}
static void
-_elm_segment_control_smart_add(Evas_Object *obj)
+_elm_segment_control_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Segment_Control_Smart_Data);
-
- ELM_WIDGET_CLASS(_elm_segment_control_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_layout_theme_set
(obj, "segment_control", "base", elm_widget_style_get(obj));
@@ -593,11 +609,11 @@ _elm_segment_control_smart_add(Evas_Object *obj)
}
static void
-_elm_segment_control_smart_del(Evas_Object *obj)
+_elm_segment_control_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Segment_Item *it;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
EINA_LIST_FREE (sd->items, it)
{
@@ -605,29 +621,48 @@ _elm_segment_control_smart_del(Evas_Object *obj)
elm_widget_item_free(it);
}
- ELM_WIDGET_CLASS(_elm_segment_control_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_segment_control_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_segment_control_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_segment_control_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_segment_control_smart_focus_next_enable;
+}
+
+static void
+_elm_segment_control_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
Eina_List *items = NULL;
Eina_List *l;
Elm_Segment_Item *it;
- ELM_SEGMENT_CONTROL_CHECK(obj) EINA_FALSE;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ ELM_SEGMENT_CONTROL_CHECK(obj);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->items, l, it)
items = eina_list_append(items, it->base.access_obj);
- return elm_widget_focus_list_next_get
+ *ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
}
static void
+_elm_segment_control_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
_access_obj_process(Elm_Segment_Control_Smart_Data * sd, Eina_Bool is_access)
{
Eina_List *l;
@@ -642,78 +677,36 @@ _access_obj_process(Elm_Segment_Control_Smart_Data * sd, Eina_Bool is_access)
}
static void
-_elm_segment_control_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_SEGMENT_CONTROL_CHECK(obj);
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_segment_control_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(sd, is_access);
-}
-
-static void
-_elm_segment_control_smart_set_user(Elm_Segment_Control_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_segment_control_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_segment_control_smart_del;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_segment_control_smart_theme;
- ELM_WIDGET_CLASS(sc)->disable = _elm_segment_control_smart_disable;
-
-#if 0
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_segment_control_smart_focus_next;
-#else
- ELM_WIDGET_CLASS(sc)->focus_next = NULL; /* not 'focus chain manager' */
-#endif
-
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_segment_control_smart_sizing_eval;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_segment_control_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_segment_control_smart_access;
-}
-
-EAPI const Elm_Segment_Control_Smart_Class *
-elm_segment_control_smart_class_get(void)
+_elm_segment_control_smart_access(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- static Elm_Segment_Control_Smart_Class _sc =
- ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NAME_VERSION
- (ELM_SEGMENT_CONTROL_SMART_NAME);
- static const Elm_Segment_Control_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_segment_control_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ _elm_segment_control_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(sd, _elm_segment_control_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_segment_control_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_segment_control_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Elm_Object_Item *
@@ -721,18 +714,31 @@ elm_segment_control_item_add(Evas_Object *obj,
Evas_Object *icon,
const char *label)
{
+ ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_segment_control_item_add(icon, label, &ret));
+ return ret;
+}
+
+static void
+_item_add(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ const char *label = va_arg(*list, const char *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Segment_Item *it;
- ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
it = _item_new(obj, icon, label);
- if (!it) return NULL;
+ if (!it) return;
sd->items = eina_list_append(sd->items, it);
_update_list(sd);
- return (Elm_Object_Item *)it;
+ *ret =(Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -741,15 +747,29 @@ elm_segment_control_item_insert_at(Evas_Object *obj,
const char *label,
int idx)
{
+ ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_segment_control_item_insert_at(icon, label, idx, &ret));
+ return ret;
+}
+
+static void
+_item_insert_at(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ const char *label = va_arg(*list, const char *);
+ int idx = va_arg(*list, int);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Segment_Item *it, *it_rel;
- ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
if (idx < 0) idx = 0;
it = _item_new(obj, icon, label);
- if (!it) return NULL;
+ if (!it) return;
it_rel = _item_find(obj, idx);
if (it_rel) sd->items = eina_list_prepend_relative(sd->items, it, it_rel);
@@ -757,16 +777,22 @@ elm_segment_control_item_insert_at(Evas_Object *obj,
_update_list(sd);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI void
elm_segment_control_item_del_at(Evas_Object *obj,
int idx)
{
- Elm_Segment_Item *it;
-
ELM_SEGMENT_CONTROL_CHECK(obj);
+ eo_do(obj, elm_obj_segment_control_item_del_at(idx));
+}
+
+static void
+_item_del_at(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
+ Elm_Segment_Item *it;
it = _item_find(obj, idx);
if (!it) return;
@@ -778,14 +804,22 @@ EAPI const char *
elm_segment_control_item_label_get(const Evas_Object *obj,
int idx)
{
- Elm_Segment_Item *it;
-
ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_segment_control_item_label_get(idx, &ret));
+ return ret;
+}
- it = _item_find(obj, idx);
- if (it) return it->label;
+static void
+_item_label_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+ Elm_Segment_Item *it;
- return NULL;
+ it = _item_find(obj, idx);
+ if (it) *ret = it->label;
}
EAPI Evas_Object *
@@ -793,20 +827,38 @@ elm_segment_control_item_icon_get(const Evas_Object *obj,
int idx)
{
ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
+ Evas_Object *ret;
+ eo_do((Eo *) obj, elm_obj_segment_control_item_icon_get(idx, &ret));
+ return ret;
+}
- Elm_Segment_Item *it = _item_find(obj, idx);
- if (it) return it->icon;
+static void
+_item_icon_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
- return NULL;
+ Elm_Segment_Item *it = _item_find(obj, idx);
+ if (it) *ret = it->icon;
}
EAPI int
elm_segment_control_item_count_get(const Evas_Object *obj)
{
ELM_SEGMENT_CONTROL_CHECK(obj) 0;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ int ret;
+ eo_do((Eo *) obj, elm_obj_segment_control_item_count_get(&ret));
+ return ret;
+}
- return eina_list_count(sd->items);
+static void
+_item_count_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ *ret = eina_list_count(sd->items);
}
EAPI Evas_Object *
@@ -821,9 +873,17 @@ EAPI Elm_Object_Item *
elm_segment_control_item_selected_get(const Evas_Object *obj)
{
ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
- ELM_SEGMENT_CONTROL_DATA_GET(obj, sd);
+ Elm_Object_Item *ret;
+ eo_do((Eo *) obj, elm_obj_segment_control_item_selected_get(&ret));
+ return ret;
+}
- return (Elm_Object_Item *)sd->selected_item;
+static void
+_item_selected_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Segment_Control_Smart_Data *sd = _pd;
+ *ret = (Elm_Object_Item *)sd->selected_item;
}
EAPI void
@@ -852,8 +912,17 @@ elm_segment_control_item_get(const Evas_Object *obj,
int idx)
{
ELM_SEGMENT_CONTROL_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do((Eo *) obj, elm_obj_segment_control_item_get(idx, &ret));
+ return ret;
+}
- return (Elm_Object_Item *)_item_find(obj, idx);
+static void
+_item_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = (Elm_Object_Item *)_item_find(obj, idx);
}
EAPI int
@@ -863,3 +932,58 @@ elm_segment_control_item_index_get(const Elm_Object_Item *it)
return ((Elm_Segment_Item *)it)->seg_index;
}
+
+static void
+_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_segment_control_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_segment_control_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_segment_control_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_segment_control_smart_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_segment_control_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_segment_control_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_segment_control_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_segment_control_smart_access),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_segment_control_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ADD), _item_add),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_INSERT_AT), _item_insert_at),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_DEL_AT), _item_del_at),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_LABEL_GET), _item_label_get),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ICON_GET), _item_icon_get),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_COUNT_GET), _item_count_get),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_SELECTED_GET), _item_selected_get),
+ EO_OP_FUNC(ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_GET), _item_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ _elm_segment_control_smart_focus_next_enable = EINA_TRUE;
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ADD, "Append a new item to the segment control object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_INSERT_AT, "Insert a new item to the segment control object at specified position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_DEL_AT, "Remove a segment control item at given index from its parent,."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_LABEL_GET, "Get the label of item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ICON_GET, "Get the icon associated to the item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_COUNT_GET, "Get the Segment items count from segment control."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_SELECTED_GET, "Get the selected item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_GET, "Get the item placed at specified index."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SEGMENT_CONTROL_BASE_ID, op_desc, ELM_OBJ_SEGMENT_CONTROL_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Segment_Control_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_segment_control_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_segment_control.h b/src/lib/elm_segment_control.h
index 5007ec3d0..7cebe6213 100644
--- a/src/lib/elm_segment_control.h
+++ b/src/lib/elm_segment_control.h
@@ -54,6 +54,132 @@
*
*/
+#define ELM_OBJ_SEGMENT_CONTROL_CLASS elm_obj_segment_control_class_get()
+
+const Eo_Class *elm_obj_segment_control_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SEGMENT_CONTROL_BASE_ID;
+
+enum
+{
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ADD,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_INSERT_AT,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_DEL_AT,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_LABEL_GET,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ICON_GET,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_COUNT_GET,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_SELECTED_GET,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_GET,
+ ELM_OBJ_SEGMENT_CONTROL_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SEGMENT_CONTROL_ID(sub_id) (ELM_OBJ_SEGMENT_CONTROL_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_segment_control_item_add
+ * @since 1.8
+ *
+ * Append a new item to the segment control object.
+ *
+ * @param[in] icon
+ * @param[in] label
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_add
+ */
+#define elm_obj_segment_control_item_add(icon, label, ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ADD), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_segment_control_item_insert_at
+ * @since 1.8
+ *
+ * Insert a new item to the segment control object at specified position.
+ *
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] idx
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_insert_at
+ */
+#define elm_obj_segment_control_item_insert_at(icon, label, idx, ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_INSERT_AT), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(int, idx), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_segment_control_item_del_at
+ * @since 1.8
+ *
+ * Remove a segment control item at given index from its parent,
+ *
+ * @param[in] idx
+ *
+ * @see elm_segment_control_item_del_at
+ */
+#define elm_obj_segment_control_item_del_at(idx) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_DEL_AT), EO_TYPECHECK(int, idx)
+
+/**
+ * @def elm_obj_segment_control_item_label_get
+ * @since 1.8
+ *
+ * Get the label of item.
+ *
+ * @param[in] idx
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_label_get
+ */
+#define elm_obj_segment_control_item_label_get(idx, ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_LABEL_GET), EO_TYPECHECK(int, idx), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_segment_control_item_icon_get
+ * @since 1.8
+ *
+ * Get the icon associated to the item.
+ *
+ * @param[in] idx
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_icon_get
+ */
+#define elm_obj_segment_control_item_icon_get(idx, ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_ICON_GET), EO_TYPECHECK(int, idx), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_segment_control_item_count_get
+ * @since 1.8
+ *
+ * Get the Segment items count from segment control.
+ *
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_count_get
+ */
+#define elm_obj_segment_control_item_count_get(ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_COUNT_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_segment_control_item_selected_get
+ * @since 1.8
+ *
+ * Get the selected item.
+ *
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_selected_get
+ */
+#define elm_obj_segment_control_item_selected_get(ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_SELECTED_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_segment_control_item_get
+ * @since 1.8
+ *
+ * Get the item placed at specified index.
+ *
+ * @param[in] idx
+ * @param[out] ret
+ *
+ * @see elm_segment_control_item_get
+ */
+#define elm_obj_segment_control_item_get(idx, ret) ELM_OBJ_SEGMENT_CONTROL_ID(ELM_OBJ_SEGMENT_CONTROL_SUB_ID_ITEM_GET), EO_TYPECHECK(int, idx), EO_TYPECHECK(Elm_Object_Item **, ret)
+
/**
* @addtogroup SegmentControl
* @{
diff --git a/src/lib/elm_separator.c b/src/lib/elm_separator.c
index 1b9e27efd..9b2f6c878 100644
--- a/src/lib/elm_separator.c
+++ b/src/lib/elm_separator.c
@@ -1,48 +1,55 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_separator.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_SEPARATOR_SMART_NAME[] = "elm_separator";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_SEPARATOR_SMART_NAME, _elm_separator, Elm_Separator_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_SEPARATOR_BASE_ID = EO_NOOP;
-static Eina_Bool
-_elm_separator_smart_theme(Evas_Object *obj)
+#define MY_CLASS ELM_OBJ_SEPARATOR_CLASS
+
+#define MY_CLASS_NAME "elm_separator"
+
+static void
+_elm_separator_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_SEPARATOR_DATA_GET(obj, sd);
+ Elm_Separator_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
if (sd->horizontal)
- eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->group), "horizontal");
+ eina_stringshare_replace(&ld->group, "horizontal");
else
- eina_stringshare_replace(&(ELM_LAYOUT_DATA(sd)->group), "vertical");
+ eina_stringshare_replace(&ld->group, "vertical");
- if (!ELM_WIDGET_CLASS(_elm_separator_parent_sc)->theme(obj))
- return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_separator_smart_sizing_eval(Evas_Object *obj)
+_elm_separator_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
- ELM_SEPARATOR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
evas_object_size_hint_align_set(obj, maxw, maxh);
}
static void
-_elm_separator_smart_add(Evas_Object *obj)
+_elm_separator_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Separator_Smart_Data);
+ Elm_Separator_Smart_Data *priv = _pd;
- ELM_WIDGET_CLASS(_elm_separator_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->horizontal = EINA_FALSE;
@@ -54,50 +61,25 @@ _elm_separator_smart_add(Evas_Object *obj)
elm_layout_sizing_eval(obj);
}
-static void
-_elm_separator_smart_set_user(Elm_Separator_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_separator_smart_add;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_separator_smart_theme;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_separator_smart_sizing_eval;
-}
-
-EAPI const Elm_Separator_Smart_Class *
-elm_separator_smart_class_get(void)
-{
- static Elm_Separator_Smart_Class _sc =
- ELM_SEPARATOR_SMART_CLASS_INIT_NAME_VERSION(ELM_SEPARATOR_SMART_NAME);
- static const Elm_Separator_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_separator_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_separator_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_separator_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -105,21 +87,89 @@ elm_separator_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_SEPARATOR_CHECK(obj);
- ELM_SEPARATOR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_separator_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Separator_Smart_Data *sd = _pd;
horizontal = !!horizontal;
if (sd->horizontal == horizontal) return;
sd->horizontal = horizontal;
- _elm_separator_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_separator_horizontal_get(const Evas_Object *obj)
{
ELM_SEPARATOR_CHECK(obj) EINA_FALSE;
- ELM_SEPARATOR_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_separator_horizontal_get(&ret));
+ return ret;
+}
+
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Separator_Smart_Data *sd = _pd;
+ *ret = sd->horizontal;
+}
- return sd->horizontal;
+static void
+_elm_separator_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
}
+
+static void
+_elm_separator_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_separator_smart_add),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_separator_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_separator_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_separator_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_separator_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET, "Set the horizontal mode of a separator object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET, "Get the horizontal mode of a separator object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SEPARATOR_BASE_ID, op_desc, ELM_OBJ_SEPARATOR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Separator_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_separator_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_separator.h b/src/lib/elm_separator.h
index 2f78a3b32..3aef7cb80 100644
--- a/src/lib/elm_separator.h
+++ b/src/lib/elm_separator.h
@@ -18,6 +18,46 @@
* @{
*/
+#define ELM_OBJ_SEPARATOR_CLASS elm_obj_separator_class_get()
+
+const Eo_Class *elm_obj_separator_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SEPARATOR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_SEPARATOR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SEPARATOR_ID(sub_id) (ELM_OBJ_SEPARATOR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_separator_horizontal_set
+ * @since 1.8
+ *
+ * @brief Set the horizontal mode of a separator object
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_separator_horizontal_set
+ */
+#define elm_obj_separator_horizontal_set(horizontal) ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_separator_horizontal_get
+ * @since 1.8
+ *
+ * @brief Get the horizontal mode of a separator object
+ *
+ * @param[out] ret
+ *
+ * @see elm_separator_horizontal_get
+ */
+#define elm_obj_separator_horizontal_get(ret) ELM_OBJ_SEPARATOR_ID(ELM_OBJ_SEPARATOR_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @brief Add a separator object to @p parent
*
diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c
index 9fbd38c46..120c66527 100644
--- a/src/lib/elm_slider.c
+++ b/src/lib/elm_slider.c
@@ -1,8 +1,15 @@
#include <Elementary.h>
#include "elm_priv.h"
#include "elm_widget_slider.h"
+#include "elm_widget_layout.h"
-EAPI const char ELM_SLIDER_SMART_NAME[] = "elm_slider";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_SLIDER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_SLIDER_CLASS
+
+#define MY_CLASS_NAME "elm_slider"
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
@@ -29,10 +36,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_SLIDER_SMART_NAME, _elm_slider, Elm_Slider_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static Eina_Bool
_delay_change(void *data)
{
@@ -51,9 +54,10 @@ _val_fetch(Evas_Object *obj)
double posx = 0.0, posy = 0.0, pos = 0.0, val;
ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", &posx, &posy);
+ (wd->resize_obj, "elm.dragable.slider", &posx, &posy);
if (sd->horizontal) pos = posx;
else pos = posy;
@@ -95,8 +99,9 @@ _val_set(Evas_Object *obj)
(sd->horizontal && !sd->inverted))))
pos = 1.0 - pos;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", pos, pos);
+ (wd->resize_obj, "elm.dragable.slider", pos, pos);
}
static void
@@ -220,8 +225,9 @@ _drag_up(void *data,
if (sd->inverted) step *= -1.0;
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_step
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", step, step);
+ (wd->resize_obj, "elm.dragable.slider", step, step);
}
static void
@@ -237,8 +243,9 @@ _drag_down(void *data,
if (sd->inverted) step *= -1.0;
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_step
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", step, step);
+ (wd->resize_obj, "elm.dragable.slider", step, step);
}
static void
@@ -304,25 +311,29 @@ _popup_emit(void *data,
}
}
-static Eina_Bool
-_elm_slider_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_slider_smart_event(Eo *obj, void *_pd, va_list *list)
{
Evas_Event_Mouse_Wheel *mev;
Evas_Event_Key_Down *ev;
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Slider_Smart_Data *sd = _pd;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (elm_widget_disabled_get(obj)) return;
if (type == EVAS_CALLBACK_KEY_DOWN) goto key_down;
else if (type != EVAS_CALLBACK_MOUSE_WHEEL)
- return EINA_FALSE;
+ return;
mev = event_info;
- if (mev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (mev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (mev->z < 0) _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
@@ -332,12 +343,12 @@ _elm_slider_smart_event(Evas_Object *obj,
key_down:
ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
{
- if (!sd->horizontal) return EINA_FALSE;
+ if (!sd->horizontal) return;
if (!sd->inverted) _drag_down(obj, NULL, NULL, NULL);
else _drag_up(obj, NULL, NULL, NULL);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -346,7 +357,7 @@ key_down:
else if ((!strcmp(ev->keyname, "Right")) ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)))
{
- if (!sd->horizontal) return EINA_FALSE;
+ if (!sd->horizontal) return;
if (!sd->inverted) _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -355,7 +366,7 @@ key_down:
else if ((!strcmp(ev->keyname, "Up")) ||
((!strcmp(ev->keyname, "KP_Up")) && (!ev->string)))
{
- if (sd->horizontal) return EINA_FALSE;
+ if (sd->horizontal) return;
if (sd->inverted) _drag_up(obj, NULL, NULL, NULL);
else _drag_down(obj, NULL, NULL, NULL);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -364,27 +375,30 @@ key_down:
else if ((!strcmp(ev->keyname, "Down")) ||
((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
{
- if (sd->horizontal) return EINA_FALSE;
+ if (sd->horizontal) return;
if (sd->inverted) _drag_down(obj, NULL, NULL, NULL);
else _drag_up(obj, NULL, NULL, NULL);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
goto success;
}
- else return EINA_FALSE;
+ else return;
success:
_slider_update(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_slider_smart_activate(Evas_Object *obj, Elm_Activate act)
+static void
+_elm_slider_smart_activate(Eo *obj, void *_pd, va_list *list)
{
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Activate act = va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Elm_Slider_Smart_Data *sd = _pd;
if ((elm_widget_disabled_get(obj)) ||
- (act == ELM_ACTIVATE_DEFAULT)) return EINA_FALSE;
+ (act == ELM_ACTIVATE_DEFAULT)) return;
if ((act == ELM_ACTIVATE_UP) ||
(act == ELM_ACTIVATE_RIGHT))
@@ -401,7 +415,7 @@ _elm_slider_smart_activate(Evas_Object *obj, Elm_Activate act)
_slider_update(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -411,14 +425,19 @@ _visuals_refresh(Evas_Object *obj)
evas_object_smart_changed(obj);
}
-static Eina_Bool
-_elm_slider_smart_theme(Evas_Object *obj)
+static void
+_elm_slider_smart_theme(Eo *obj, void *_pd, va_list *list)
{
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Slider_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+ Elm_Layout_Smart_Data *ld = eo_data_get(obj, ELM_OBJ_LAYOUT_CLASS);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->horizontal)
{
- eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "horizontal");
+ eina_stringshare_replace(&ld->group, "horizontal");
if (sd->popup)
_elm_theme_set(NULL, sd->popup,
"slider", "horizontal/popup",
@@ -426,14 +445,15 @@ _elm_slider_smart_theme(Evas_Object *obj)
}
else
{
- eina_stringshare_replace(&ELM_LAYOUT_DATA(sd)->group, "vertical");
+ eina_stringshare_replace(&ld->group, "vertical");
if (sd->popup)
_elm_theme_set(NULL, sd->popup,
"slider", "vertical/popup",
elm_widget_style_get(obj));
}
- if (!ELM_WIDGET_CLASS(_elm_slider_parent_sc)->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
if (sd->popup)
edje_object_scale_set(sd->popup, elm_widget_scale_get(obj) *
@@ -460,25 +480,25 @@ _elm_slider_smart_theme(Evas_Object *obj)
_visuals_refresh(obj);
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
if (sd->popup)
edje_object_message_signal_process(sd->popup);
evas_object_smart_changed(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_slider_smart_sizing_eval(Evas_Object *obj)
+_elm_slider_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
@@ -514,8 +534,9 @@ _spacer_down_cb(void *data,
if (button_y < 0) button_y = 0;
}
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider",
+ (wd->resize_obj, "elm.dragable.slider",
button_x, button_y);
_slider_update(data);
evas_object_smart_callback_call(data, SIG_DRAG_START, NULL);
@@ -578,8 +599,9 @@ _spacer_move_cb(void *data,
if (button_y < 0) button_y = 0;
}
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider",
+ (wd->resize_obj, "elm.dragable.slider",
button_x, button_y);
_slider_update(data);
@@ -669,9 +691,9 @@ _min_max_set(Evas_Object *obj)
}
static void
-_elm_slider_smart_calculate(Evas_Object *obj)
+_elm_slider_smart_calculate(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Slider_Smart_Data *sd = _pd;
elm_layout_freeze(obj);
@@ -731,11 +753,12 @@ _access_state_cb(void *data __UNUSED__,
}
static void
-_elm_slider_smart_add(Evas_Object *obj)
+_elm_slider_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Slider_Smart_Data);
+ Elm_Slider_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_slider_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->horizontal = EINA_TRUE;
priv->indicator_show = EINA_TRUE;
@@ -755,7 +778,7 @@ _elm_slider_smart_add(Evas_Object *obj)
elm_layout_signal_callback_add(obj, "popup,hide", "elm", _popup_hide, obj);
elm_layout_signal_callback_add(obj, "*", "popup,emit", _popup_emit, obj);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.dragable.slider", 0.0, 0.0);
+ (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
priv->spacer = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(priv->spacer, 0, 0, 0, 0);
@@ -797,7 +820,7 @@ _elm_slider_smart_add(Evas_Object *obj)
elm_widget_can_focus_set(obj, EINA_TRUE);
- _elm_access_object_register(obj, ELM_WIDGET_DATA(priv)->resize_obj);
+ _elm_access_object_register(obj, wd->resize_obj);
_elm_access_text_set
(_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("slider"));
_elm_access_callback_set
@@ -809,9 +832,9 @@ _elm_slider_smart_add(Evas_Object *obj)
}
static void
-_elm_slider_smart_del(Evas_Object *obj)
+_elm_slider_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Slider_Smart_Data *sd = _pd;
if (sd->indicator) eina_stringshare_del(sd->indicator);
if (sd->units) eina_stringshare_del(sd->units);
@@ -819,62 +842,43 @@ _elm_slider_smart_del(Evas_Object *obj)
if (sd->popup) evas_object_del(sd->popup);
- ELM_WIDGET_CLASS(_elm_slider_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_slider_smart_set_user(Elm_Slider_Smart_Class *sc)
+_elm_slider_smart_text_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_slider_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_slider_smart_del;
- ELM_WIDGET_CLASS(sc)->base.calculate = _elm_slider_smart_calculate;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_slider_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_slider_smart_event;
- ELM_WIDGET_CLASS(sc)->activate = _elm_slider_smart_activate;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_slider_smart_sizing_eval;
-
- ELM_LAYOUT_CLASS(sc)->content_aliases = _content_aliases;
- ELM_LAYOUT_CLASS(sc)->text_aliases = _text_aliases;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _text_aliases;
}
-EAPI const Elm_Slider_Smart_Class *
-elm_slider_smart_class_get(void)
+static void
+_elm_slider_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- static Elm_Slider_Smart_Class _sc =
- ELM_SLIDER_SMART_CLASS_INIT_NAME_VERSION(ELM_SLIDER_SMART_NAME);
- static const Elm_Slider_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_slider_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
+ *aliases = _content_aliases;
}
EAPI Evas_Object *
elm_slider_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_slider_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -882,7 +886,14 @@ elm_slider_span_size_set(Evas_Object *obj,
Evas_Coord size)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_span_size_set(size));
+}
+
+static void
+_elm_slider_span_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Coord size = va_arg(*list, Evas_Coord);
+ Elm_Slider_Smart_Data *sd = _pd;
if (sd->size == size) return;
sd->size = size;
@@ -907,9 +918,17 @@ EAPI Evas_Coord
elm_slider_span_size_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) 0;
- ELM_SLIDER_DATA_GET(obj, sd);
+ Evas_Coord ret;
+ eo_do((Eo *) obj, elm_obj_slider_span_size_get(&ret));
+ return ret;
+}
- return sd->size;
+static void
+_elm_slider_span_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *ret = va_arg(*list, Evas_Coord *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->size;
}
EAPI void
@@ -917,20 +936,28 @@ elm_slider_unit_format_set(Evas_Object *obj,
const char *units)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_unit_format_set(units));
+}
+
+static void
+_elm_slider_unit_format_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *units = va_arg(*list, const char *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
eina_stringshare_replace(&sd->units, units);
if (units)
{
elm_layout_signal_emit(obj, "elm,state,units,visible", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,units,visible", "elm");
}
else
{
elm_layout_signal_emit(obj, "elm,state,units,hidden", "elm");
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,units,hidden", "elm");
}
@@ -942,9 +969,17 @@ EAPI const char *
elm_slider_unit_format_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) NULL;
- ELM_SLIDER_DATA_GET(obj, sd);
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_slider_unit_format_get(&ret));
+ return ret;
+}
- return sd->units;
+static void
+_elm_slider_unit_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->units;
}
EAPI void
@@ -952,7 +987,14 @@ elm_slider_indicator_format_set(Evas_Object *obj,
const char *indicator)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_indicator_format_set(indicator));
+}
+
+static void
+_elm_slider_indicator_format_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *indicator = va_arg(*list, const char *);
+ Elm_Slider_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->indicator, indicator);
evas_object_smart_changed(obj);
@@ -962,9 +1004,17 @@ EAPI const char *
elm_slider_indicator_format_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) NULL;
- ELM_SLIDER_DATA_GET(obj, sd);
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_slider_indicator_format_get(&ret));
+ return ret;
+}
- return sd->indicator;
+static void
+_elm_slider_indicator_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->indicator;
}
EAPI void
@@ -972,22 +1022,37 @@ elm_slider_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_horizontal_set(horizontal));
+}
+
+static void
+_elm_slider_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Slider_Smart_Data *sd = _pd;
horizontal = !!horizontal;
if (sd->horizontal == horizontal) return;
sd->horizontal = horizontal;
- ELM_WIDGET_DATA(sd)->api->theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI Eina_Bool
elm_slider_horizontal_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) EINA_FALSE;
- ELM_SLIDER_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_slider_horizontal_get(&ret));
+ return ret;
+}
- return sd->horizontal;
+static void
+_elm_slider_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->horizontal;
}
EAPI void
@@ -996,7 +1061,15 @@ elm_slider_min_max_set(Evas_Object *obj,
double max)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_min_max_set(min, max));
+}
+
+static void
+_elm_slider_min_max_set(Eo *obj, void *_pd, va_list *list)
+{
+ double min = va_arg(*list, double);
+ double max = va_arg(*list, double);
+ Elm_Slider_Smart_Data *sd = _pd;
if ((sd->val_min == min) && (sd->val_max == max)) return;
sd->val_min = min;
@@ -1012,11 +1085,19 @@ elm_slider_min_max_get(const Evas_Object *obj,
double *min,
double *max)
{
+ ELM_SLIDER_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_slider_min_max_get(min, max));
+}
+
+static void
+_elm_slider_min_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *min = va_arg(*list, double *);
+ double *max = va_arg(*list, double *);
if (min) *min = 0.0;
if (max) *max = 0.0;
- ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ Elm_Slider_Smart_Data *sd = _pd;
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -1027,7 +1108,14 @@ elm_slider_value_set(Evas_Object *obj,
double val)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_value_set(val));
+}
+
+static void
+_elm_slider_value_set(Eo *obj, void *_pd, va_list *list)
+{
+ double val = va_arg(*list, double);
+ Elm_Slider_Smart_Data *sd = _pd;
if (sd->val == val) return;
sd->val = val;
@@ -1042,9 +1130,17 @@ EAPI double
elm_slider_value_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) 0.0;
- ELM_SLIDER_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_slider_value_get(&ret));
+ return ret;
+}
- return sd->val;
+static void
+_elm_slider_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->val;
}
EAPI void
@@ -1052,7 +1148,15 @@ elm_slider_inverted_set(Evas_Object *obj,
Eina_Bool inverted)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_inverted_set(inverted));
+}
+
+static void
+_elm_slider_inverted_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool inverted = va_arg(*list, int);
+ Elm_Slider_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
inverted = !!inverted;
if (sd->inverted == inverted) return;
@@ -1071,7 +1175,7 @@ elm_slider_inverted_set(Evas_Object *obj,
edje_object_signal_emit(sd->popup, "elm,state,inverted,off", "elm");
}
- edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj);
+ edje_object_message_signal_process(wd->resize_obj);
_visuals_refresh(obj);
}
@@ -1080,9 +1184,17 @@ EAPI Eina_Bool
elm_slider_inverted_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) EINA_FALSE;
- ELM_SLIDER_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_slider_inverted_get(&ret));
+ return ret;
+}
- return sd->inverted;
+static void
+_elm_slider_inverted_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->inverted;
}
EAPI void
@@ -1091,7 +1203,15 @@ elm_slider_indicator_format_function_set(Evas_Object *obj,
void (*free_func)(char *))
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_indicator_format_function_set(func, free_func));
+}
+
+static void
+_elm_slider_indicator_format_function_set(Eo *obj, void *_pd, va_list *list)
+{
+ slider_func_type func = va_arg(*list, slider_func_type);
+ slider_freefunc_type free_func = va_arg(*list, slider_freefunc_type);
+ Elm_Slider_Smart_Data *sd = _pd;
sd->indicator_format_func = func;
sd->indicator_format_free = free_func;
@@ -1104,7 +1224,15 @@ elm_slider_units_format_function_set(Evas_Object *obj,
void (*free_func)(char *))
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_units_format_function_set(func, free_func));
+}
+
+static void
+_elm_slider_units_format_function_set(Eo *obj, void *_pd, va_list *list)
+{
+ slider_func_type func = va_arg(*list, slider_func_type);
+ slider_freefunc_type free_func = va_arg(*list, slider_freefunc_type);
+ Elm_Slider_Smart_Data *sd = _pd;
sd->units_format_func = func;
sd->units_format_free = free_func;
@@ -1117,7 +1245,14 @@ elm_slider_indicator_show_set(Evas_Object *obj,
Eina_Bool show)
{
ELM_SLIDER_CHECK(obj);
- ELM_SLIDER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slider_indicator_show_set(show));
+}
+
+static void
+_elm_slider_indicator_show_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool show = va_arg(*list, int);
+ Elm_Slider_Smart_Data *sd = _pd;
if (show)
{
@@ -1140,7 +1275,106 @@ EAPI Eina_Bool
elm_slider_indicator_show_get(const Evas_Object *obj)
{
ELM_SLIDER_CHECK(obj) EINA_FALSE;
- ELM_SLIDER_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_slider_indicator_show_get(&ret));
+ return ret;
+}
- return sd->indicator_show;
+static void
+_elm_slider_indicator_show_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Slider_Smart_Data *sd = _pd;
+ *ret = sd->indicator_show;
}
+
+static void
+_elm_slider_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_slider_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_slider_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_slider_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_slider_smart_calculate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_slider_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_slider_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_slider_smart_activate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_slider_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_slider_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_slider_smart_sizing_eval),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_ALIASES_GET), _elm_slider_smart_text_aliases_get),
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_slider_smart_content_aliases_get),
+
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_SET), _elm_slider_span_size_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_GET), _elm_slider_span_size_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_SET), _elm_slider_unit_format_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_GET), _elm_slider_unit_format_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_SET), _elm_slider_indicator_format_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_GET), _elm_slider_indicator_format_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_SET), _elm_slider_horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_GET), _elm_slider_horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_SET), _elm_slider_min_max_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_GET), _elm_slider_min_max_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_VALUE_SET), _elm_slider_value_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_VALUE_GET), _elm_slider_value_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INVERTED_SET), _elm_slider_inverted_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INVERTED_GET), _elm_slider_inverted_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_FUNCTION_SET), _elm_slider_indicator_format_function_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNITS_FORMAT_FUNCTION_SET), _elm_slider_units_format_function_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_SET), _elm_slider_indicator_show_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_GET), _elm_slider_indicator_show_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_SET, "Set the (exact) length of the bar region of a given slider widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_GET, "Get the length set for the bar region of a given slider widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_SET, "Set the format string for the unit label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_GET, "Get the unit label format of the slider."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_SET, "Set the format string for the indicator label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_GET, "Get the indicator label format of the slider."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_SET, "Set the orientation of a given slider widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_GET, "Retrieve the orientation of a given slider widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_SET, "Set the minimum and maximum values for the slider."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_GET, "Get the minimum and maximum values of the slider."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_VALUE_SET, "Set the value the slider displays."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_VALUE_GET, "Get the value displayed by the spinner."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INVERTED_SET, "Invert a given slider widget's displaying values order."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INVERTED_GET, "Get whether a given slider widget's displaying values are inverted or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_FUNCTION_SET, "Set the format function pointer for the indicator label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_UNITS_FORMAT_FUNCTION_SET, "Set the format function pointer for the units label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_SET, "Set whether to enlarge slider indicator (augmented knob) or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_GET, "Get whether a given slider widget's enlarging indicator or not."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SLIDER_BASE_ID, op_desc, ELM_OBJ_SLIDER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Slider_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_slider_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_slider.h b/src/lib/elm_slider.h
index f589d7a44..b0430853e 100644
--- a/src/lib/elm_slider.h
+++ b/src/lib/elm_slider.h
@@ -66,6 +66,263 @@
* @li @ref slider_example
*/
+#define ELM_OBJ_SLIDER_CLASS elm_obj_slider_class_get()
+
+const Eo_Class *elm_obj_slider_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SLIDER_BASE_ID;
+
+typedef char *(*slider_func_type)(double);
+typedef void (*slider_freefunc_type)(char *);
+
+enum
+{
+ ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_SET,
+ ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_GET,
+ ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_SET,
+ ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_GET,
+ ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_SET,
+ ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_GET,
+ ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_SET,
+ ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_GET,
+ ELM_OBJ_SLIDER_SUB_ID_VALUE_SET,
+ ELM_OBJ_SLIDER_SUB_ID_VALUE_GET,
+ ELM_OBJ_SLIDER_SUB_ID_INVERTED_SET,
+ ELM_OBJ_SLIDER_SUB_ID_INVERTED_GET,
+ ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_FUNCTION_SET,
+ ELM_OBJ_SLIDER_SUB_ID_UNITS_FORMAT_FUNCTION_SET,
+ ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_SET,
+ ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_GET,
+ ELM_OBJ_SLIDER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SLIDER_ID(sub_id) (ELM_OBJ_SLIDER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_slider_span_size_set
+ * @since 1.8
+ *
+ * Set the (exact) length of the bar region of a given slider widget.
+ *
+ * @param[in] size
+ *
+ * @see elm_slider_span_size_set
+ */
+#define elm_obj_slider_span_size_set(size) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_SET), EO_TYPECHECK(Evas_Coord, size)
+
+/**
+ * @def elm_obj_slider_span_size_get
+ * @since 1.8
+ *
+ * Get the length set for the bar region of a given slider widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_span_size_get
+ */
+#define elm_obj_slider_span_size_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_SPAN_SIZE_GET), EO_TYPECHECK(Evas_Coord *, ret)
+
+/**
+ * @def elm_obj_slider_unit_format_set
+ * @since 1.8
+ *
+ * Set the format string for the unit label.
+ *
+ * @param[in] units
+ *
+ * @see elm_slider_unit_format_set
+ */
+#define elm_obj_slider_unit_format_set(units) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_SET), EO_TYPECHECK(const char *, units)
+
+/**
+ * @def elm_obj_slider_unit_format_get
+ * @since 1.8
+ *
+ * Get the unit label format of the slider.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_unit_format_get
+ */
+#define elm_obj_slider_unit_format_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNIT_FORMAT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_slider_indicator_format_set
+ * @since 1.8
+ *
+ * Set the format string for the indicator label.
+ *
+ * @param[in] indicator
+ *
+ * @see elm_slider_indicator_format_set
+ */
+#define elm_obj_slider_indicator_format_set(indicator) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_SET), EO_TYPECHECK(const char *, indicator)
+
+/**
+ * @def elm_obj_slider_indicator_format_get
+ * @since 1.8
+ *
+ * Get the indicator label format of the slider.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_indicator_format_get
+ */
+#define elm_obj_slider_indicator_format_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_slider_horizontal_set
+ * @since 1.8
+ *
+ * Set the orientation of a given slider widget.
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_slider_horizontal_set
+ */
+#define elm_obj_slider_horizontal_set(horizontal) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_slider_horizontal_get
+ * @since 1.8
+ *
+ * Retrieve the orientation of a given slider widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_horizontal_get
+ */
+#define elm_obj_slider_horizontal_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_slider_min_max_set
+ * @since 1.8
+ *
+ * Set the minimum and maximum values for the slider.
+ *
+ * @param[in] min
+ * @param[in] max
+ *
+ * @see elm_slider_min_max_set
+ */
+#define elm_obj_slider_min_max_set(min, max) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_SET), EO_TYPECHECK(double, min), EO_TYPECHECK(double, max)
+
+/**
+ * @def elm_obj_slider_min_max_get
+ * @since 1.8
+ *
+ * Get the minimum and maximum values of the slider.
+ *
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_slider_min_max_get
+ */
+#define elm_obj_slider_min_max_get(min, max) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_MIN_MAX_GET), EO_TYPECHECK(double *, min), EO_TYPECHECK(double *, max)
+
+/**
+ * @def elm_obj_slider_value_set
+ * @since 1.8
+ *
+ * Set the value the slider displays.
+ *
+ * @param[in] val
+ *
+ * @see elm_slider_value_set
+ */
+#define elm_obj_slider_value_set(val) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_VALUE_SET), EO_TYPECHECK(double, val)
+
+/**
+ * @def elm_obj_slider_value_get
+ * @since 1.8
+ *
+ * Get the value displayed by the spinner.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_value_get
+ */
+#define elm_obj_slider_value_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_VALUE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_slider_inverted_set
+ * @since 1.8
+ *
+ * Invert a given slider widget's displaying values order
+ *
+ * @param[in] inverted
+ *
+ * @see elm_slider_inverted_set
+ */
+#define elm_obj_slider_inverted_set(inverted) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INVERTED_SET), EO_TYPECHECK(Eina_Bool, inverted)
+
+/**
+ * @def elm_obj_slider_inverted_get
+ * @since 1.8
+ *
+ * Get whether a given slider widget's displaying values are
+ * inverted or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_inverted_get
+ */
+#define elm_obj_slider_inverted_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INVERTED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_slider_indicator_format_function_set
+ * @since 1.8
+ *
+ * Set the format function pointer for the indicator label
+ *
+ * @param[in] func
+ * @param[in] free_func
+ *
+ * @see elm_slider_indicator_format_function_set
+ */
+#define elm_obj_slider_indicator_format_function_set(func, free_func) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_FORMAT_FUNCTION_SET), EO_TYPECHECK(slider_func_type, func), EO_TYPECHECK(slider_freefunc_type, free_func)
+
+/**
+ * @def elm_obj_slider_units_format_function_set
+ * @since 1.8
+ *
+ * Set the format function pointer for the units label
+ *
+ * @param[in] func
+ * @param[in] free_func
+ *
+ * @see elm_slider_units_format_function_set
+ */
+#define elm_obj_slider_units_format_function_set(func, free_func) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_UNITS_FORMAT_FUNCTION_SET), EO_TYPECHECK(slider_func_type, func), EO_TYPECHECK(slider_freefunc_type, free_func)
+
+/**
+ * @def elm_obj_slider_indicator_show_set
+ * @since 1.8
+ *
+ * Set whether to enlarge slider indicator (augmented knob) or not.
+ *
+ * @param[in] show
+ *
+ * @see elm_slider_indicator_show_set
+ */
+#define elm_obj_slider_indicator_show_set(show) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_SET), EO_TYPECHECK(Eina_Bool, show)
+
+/**
+ * @def elm_obj_slider_indicator_show_get
+ * @since 1.8
+ *
+ * Get whether a given slider widget's enlarging indicator or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slider_indicator_show_get
+ */
+#define elm_obj_slider_indicator_show_get(ret) ELM_OBJ_SLIDER_ID(ELM_OBJ_SLIDER_SUB_ID_INDICATOR_SHOW_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+
/**
* @addtogroup Slider
* @{
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index 56fd0f994..5e532ba41 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -2,7 +2,13 @@
#include "elm_priv.h"
#include "elm_widget_slideshow.h"
-EAPI const char ELM_SLIDESHOW_SMART_NAME[] = "elm_slideshow";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_SLIDESHOW_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_SLIDESHOW_CLASS
+
+#define MY_CLASS_NAME "elm_slideshow"
static const char SIG_CHANGED[] = "changed";
static const char SIG_TRANSITION_END[] = "transition,end";
@@ -13,24 +19,23 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_SLIDESHOW_SMART_NAME, _elm_slideshow, Elm_Slideshow_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
-static Eina_Bool
-_elm_slideshow_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_slideshow_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
Evas_Event_Key_Down *ev = event_info;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -38,7 +43,8 @@ _elm_slideshow_smart_event(Evas_Object *obj,
elm_slideshow_previous(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Right")) ||
@@ -47,7 +53,8 @@ _elm_slideshow_smart_event(Evas_Object *obj,
elm_slideshow_next(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Return")) ||
@@ -66,19 +73,20 @@ _elm_slideshow_smart_event(Evas_Object *obj,
}
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- return EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
}
static void
-_elm_slideshow_smart_sizing_eval(Evas_Object *obj)
+_elm_slideshow_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, minw, minh);
}
@@ -299,11 +307,12 @@ _item_del_pre_hook(Elm_Object_Item *it)
}
static void
-_elm_slideshow_smart_add(Evas_Object *obj)
+_elm_slideshow_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Slideshow_Smart_Data);
- ELM_WIDGET_CLASS(_elm_slideshow_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
+ Elm_Slideshow_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
priv->current = NULL;
priv->previous = NULL;
@@ -314,20 +323,20 @@ _elm_slideshow_smart_add(Evas_Object *obj)
elm_layout_theme_set(obj, "slideshow", "base", elm_widget_style_get(obj));
priv->transitions = elm_widget_stringlist_get
- (edje_object_data_get(ELM_WIDGET_DATA(priv)->resize_obj,
+ (edje_object_data_get(wd->resize_obj,
"transitions"));
if (eina_list_count(priv->transitions) > 0)
priv->transition =
eina_stringshare_add(eina_list_data_get(priv->transitions));
priv->layout.list = elm_widget_stringlist_get
- (edje_object_data_get(ELM_WIDGET_DATA(priv)->resize_obj, "layouts"));
+ (edje_object_data_get(wd->resize_obj, "layouts"));
if (eina_list_count(priv->layout.list) > 0)
priv->layout.current = eina_list_data_get(priv->layout.list);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "end", "slideshow", _on_slideshow_end,
+ (wd->resize_obj, "end", "slideshow", _on_slideshow_end,
obj);
evas_object_event_callback_add
@@ -339,9 +348,9 @@ _elm_slideshow_smart_add(Evas_Object *obj)
}
static void
-_elm_slideshow_smart_del(Evas_Object *obj)
+_elm_slideshow_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
const char *layout;
elm_slideshow_clear(obj);
@@ -351,56 +360,29 @@ _elm_slideshow_smart_del(Evas_Object *obj)
EINA_LIST_FREE (sd->layout.list, layout)
eina_stringshare_del(layout);
- ELM_WIDGET_CLASS(_elm_slideshow_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_slideshow_smart_set_user(Elm_Slideshow_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_slideshow_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_slideshow_smart_del;
-
- ELM_WIDGET_CLASS(sc)->event = _elm_slideshow_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_slideshow_smart_sizing_eval;
-}
-
-EAPI const Elm_Slideshow_Smart_Class *
-elm_slideshow_smart_class_get(void)
-{
- static Elm_Slideshow_Smart_Class _sc =
- ELM_SLIDESHOW_SMART_CLASS_INIT_NAME_VERSION(ELM_SLIDESHOW_SMART_NAME);
- static const Elm_Slideshow_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_slideshow_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_slideshow_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_slideshow_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI Elm_Object_Item *
@@ -408,13 +390,26 @@ elm_slideshow_item_add(Evas_Object *obj,
const Elm_Slideshow_Item_Class *itc,
const void *data)
{
+ ELM_SLIDESHOW_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_slideshow_item_add(itc, data, &ret));
+ return ret;
+}
+
+static void
+_elm_slideshow_item_add(Eo *obj, void *_pd, va_list *list)
+{
Elm_Slideshow_Item *item;
- ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+
+ const Elm_Slideshow_Item_Class *itc = va_arg(*list, const Elm_Slideshow_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
item = elm_widget_item_new(obj, Elm_Slideshow_Item);
- if (!item) return NULL;
+ if (!item) return;
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
item->itc = itc;
@@ -425,7 +420,7 @@ elm_slideshow_item_add(Evas_Object *obj,
if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)item);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI Elm_Object_Item *
@@ -434,13 +429,27 @@ elm_slideshow_item_sorted_insert(Evas_Object *obj,
const void *data,
Eina_Compare_Cb func)
{
+ ELM_SLIDESHOW_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_slideshow_item_sorted_insert(itc, data, func, &ret));
+ return ret;
+}
+
+static void
+_elm_slideshow_item_sorted_insert(Eo *obj, void *_pd, va_list *list)
+{
+ const Elm_Slideshow_Item_Class *itc = va_arg(*list, const Elm_Slideshow_Item_Class *);
+ const void *data = va_arg(*list, const void *);
+ Eina_Compare_Cb func = va_arg(*list, Eina_Compare_Cb);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+
Elm_Slideshow_Item *item;
- ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
item = elm_widget_item_new(obj, Elm_Slideshow_Item);
- if (!item) return NULL;
+ if (!item) return;
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
item->itc = itc;
@@ -451,7 +460,7 @@ elm_slideshow_item_sorted_insert(Evas_Object *obj,
if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)item);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
@@ -492,11 +501,17 @@ elm_slideshow_item_show(Elm_Object_Item *it)
EAPI void
elm_slideshow_next(Evas_Object *obj)
{
+ ELM_SLIDESHOW_CHECK(obj);
+ eo_do(obj, elm_obj_slideshow_next());
+}
+
+static void
+_elm_slideshow_next(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
char buf[1024];
Elm_Slideshow_Item *next = NULL;
- ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
if (sd->current) next = _item_next_get(sd->current);
@@ -527,11 +542,17 @@ elm_slideshow_next(Evas_Object *obj)
EAPI void
elm_slideshow_previous(Evas_Object *obj)
{
+ ELM_SLIDESHOW_CHECK(obj);
+ eo_do(obj, elm_obj_slideshow_previous());
+}
+
+static void
+_elm_slideshow_previous(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
char buf[1024];
Elm_Slideshow_Item *prev = NULL;
- ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
if (sd->current) prev = _item_prev_get(sd->current);
@@ -563,18 +584,35 @@ EAPI const Eina_List *
elm_slideshow_transitions_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ const Eina_List *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_transitions_get(&ret));
+ return ret;
+}
- return sd->transitions;
+static void
+_elm_slideshow_transitions_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->transitions;
}
EAPI const Eina_List *
elm_slideshow_layouts_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
- return sd->layout.list;
+ const Eina_List *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_layouts_get(&ret));
+ return ret;
+}
+
+static void
+_elm_slideshow_layouts_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->layout.list;
}
EAPI void
@@ -582,8 +620,14 @@ elm_slideshow_transition_set(Evas_Object *obj,
const char *transition)
{
ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slideshow_transition_set(transition));
+}
+static void
+_elm_slideshow_transition_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *transition = va_arg(*list, const char *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->transition, transition);
}
@@ -591,9 +635,18 @@ EAPI const char *
elm_slideshow_transition_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
- return sd->transition;
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_transition_get(&ret));
+ return ret;
+}
+
+static void
+_elm_slideshow_transition_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->transition;
}
EAPI void
@@ -601,7 +654,14 @@ elm_slideshow_timeout_set(Evas_Object *obj,
double timeout)
{
ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slideshow_timeout_set(timeout));
+}
+
+static void
+_elm_slideshow_timeout_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double timeout = va_arg(*list, double);
+ Elm_Slideshow_Smart_Data *sd = _pd;
sd->timeout = timeout;
@@ -616,9 +676,17 @@ EAPI double
elm_slideshow_timeout_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) - 1.0;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_timeout_get(&ret));
+ return ret;
+}
- return sd->timeout;
+static void
+_elm_slideshow_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->timeout;
}
EAPI void
@@ -626,8 +694,15 @@ elm_slideshow_loop_set(Evas_Object *obj,
Eina_Bool loop)
{
ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slideshow_loop_set(loop));
+}
+static void
+_elm_slideshow_loop_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool loop = va_arg(*list, int);
+ ELM_SLIDESHOW_CHECK(obj);
+ Elm_Slideshow_Smart_Data *sd = _pd;
sd->loop = loop;
}
@@ -635,19 +710,35 @@ EAPI const char *
elm_slideshow_layout_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) EINA_FALSE;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_layout_get(&ret));
+ return ret;
+}
- return sd->layout.current;
+static void
+_elm_slideshow_layout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->layout.current;
}
EAPI void
elm_slideshow_layout_set(Evas_Object *obj,
const char *layout)
{
+ ELM_SLIDESHOW_CHECK(obj);
+ eo_do(obj, elm_obj_slideshow_layout_set(layout));
+}
+
+static void
+_elm_slideshow_layout_set(Eo *obj, void *_pd, va_list *list)
+{
+
char buf[PATH_MAX];
+ const char *layout = va_arg(*list, const char *);
- ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
sd->layout.current = layout;
snprintf(buf, sizeof(buf), "layout,%s", layout);
@@ -658,18 +749,32 @@ EAPI Eina_Bool
elm_slideshow_loop_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) EINA_FALSE;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_loop_get(&ret));
+ return ret;
+}
- return sd->loop;
+static void
+_elm_slideshow_loop_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->loop;
}
EAPI void
elm_slideshow_clear(Evas_Object *obj)
{
+ ELM_SLIDESHOW_CHECK(obj);
+ eo_do(obj, elm_obj_slideshow_clear());
+}
+
+static void
+_elm_slideshow_clear(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
Elm_Slideshow_Item *item;
- ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Slideshow_Smart_Data *sd = _pd;
sd->previous = NULL;
sd->current = NULL;
@@ -687,18 +792,34 @@ EAPI const Eina_List *
elm_slideshow_items_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ const Eina_List *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_items_get(&ret));
+ return ret;
+}
- return sd->items;
+static void
+_elm_slideshow_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->items;
}
EAPI Elm_Object_Item *
elm_slideshow_item_current_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Object_Item *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_item_current_get(&ret));
+ return ret;
+}
- return (Elm_Object_Item *)sd->current;
+static void
+_elm_slideshow_item_current_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = (Elm_Object_Item *)sd->current;
}
EAPI Evas_Object *
@@ -712,16 +833,32 @@ EAPI int
elm_slideshow_cache_before_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) - 1;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ int ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_cache_before_get(&ret));
+ return ret;
+}
- return sd->count_item_pre_before;
+static void
+_elm_slideshow_cache_before_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->count_item_pre_before;
}
EAPI void
elm_slideshow_cache_before_set(Evas_Object *obj, int count)
{
ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slideshow_cache_before_set(count));
+}
+
+static void
+_elm_slideshow_cache_before_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int count = va_arg(*list, int);
+
+ Elm_Slideshow_Smart_Data *sd = _pd;
if (!sd) return;
if (count < 0) count = 0;
sd->count_item_pre_before = count;
@@ -731,9 +868,17 @@ EAPI int
elm_slideshow_cache_after_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) - 1;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ int ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_cache_after_get(&ret));
+ return ret;
+}
- return sd->count_item_pre_after;
+static void
+_elm_slideshow_cache_after_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = sd->count_item_pre_after;
}
EAPI void
@@ -741,7 +886,14 @@ elm_slideshow_cache_after_set(Evas_Object *obj,
int count)
{
ELM_SLIDESHOW_CHECK(obj);
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_slideshow_cache_after_set(count));
+}
+
+static void
+_elm_slideshow_cache_after_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int count = va_arg(*list, int);
+ Elm_Slideshow_Smart_Data *sd = _pd;
if (count < 0) count = 0;
sd->count_item_pre_after = count;
@@ -752,16 +904,128 @@ elm_slideshow_item_nth_get(const Evas_Object *obj,
unsigned int nth)
{
ELM_SLIDESHOW_CHECK(obj) NULL;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ Elm_Object_Item *ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_item_nth_get(nth, &ret));
+ return ret;
+}
- return eina_list_nth(sd->items, nth);
+static void
+ _elm_slideshow_item_nth_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int nth = va_arg(*list, unsigned int);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = eina_list_nth(sd->items, nth);
}
EAPI unsigned int
elm_slideshow_count_get(const Evas_Object *obj)
{
ELM_SLIDESHOW_CHECK(obj) 0;
- ELM_SLIDESHOW_DATA_GET(obj, sd);
+ unsigned int ret;
+ eo_do((Eo *) obj, elm_obj_slideshow_count_get(&ret));
+ return ret;
+}
+
+static void
+_elm_slideshow_count_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Slideshow_Smart_Data *sd = _pd;
+ *ret = eina_list_count(sd->items);
+}
+
+static void
+_elm_slideshow_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_slideshow_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
- return eina_list_count(sd->items);
+static void
+_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_slideshow_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_slideshow_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_slideshow_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_slideshow_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_slideshow_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_slideshow_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_ADD), _elm_slideshow_item_add),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_SORTED_INSERT), _elm_slideshow_item_sorted_insert),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_NEXT), _elm_slideshow_next),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_PREVIOUS), _elm_slideshow_previous),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITIONS_GET), _elm_slideshow_transitions_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUTS_GET), _elm_slideshow_layouts_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_SET), _elm_slideshow_transition_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_GET), _elm_slideshow_transition_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_SET), _elm_slideshow_timeout_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_GET), _elm_slideshow_timeout_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_SET), _elm_slideshow_loop_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_GET), _elm_slideshow_layout_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_SET), _elm_slideshow_layout_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_GET), _elm_slideshow_loop_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CLEAR), _elm_slideshow_clear),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEMS_GET), _elm_slideshow_items_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_CURRENT_GET), _elm_slideshow_item_current_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_GET), _elm_slideshow_cache_before_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_SET), _elm_slideshow_cache_before_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_GET), _elm_slideshow_cache_after_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_SET), _elm_slideshow_cache_after_set),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_NTH_GET), _elm_slideshow_item_nth_get),
+ EO_OP_FUNC(ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_COUNT_GET), _elm_slideshow_count_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_ADD, "Add (append) a new item in a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_SORTED_INSERT, "Insert a new item into the given slideshow widget, using the func function to sort items (by item handles)."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_NEXT, "Slide to the next item, in a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_PREVIOUS, "Slide to the previous item, in a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITIONS_GET, "Returns the list of sliding transition/effect names available, for a given slideshow widget.."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUTS_GET, "Returns the list of layout names available, for a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_SET, "Set the current slide transition/effect in use for a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_GET, "Get the current slide transition/effect in use for a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_SET, "Set the interval between each image transition on a given slideshow widget, and start the slideshow, itself."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_GET, "Get the interval set for image transitions on a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_SET, "Set if, after a slideshow is started, for a given slideshow widget, its items should be displayed cyclically or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_GET, "Get the current slide layout in use for a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_SET, "Set the current slide layout in use for a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_GET, "Get if, after a slideshow is started, for a given slideshow widget, its items are to be displayed cyclically or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_CLEAR, "Remove all items from a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_ITEMS_GET, "Get the internal list of items in a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_CURRENT_GET, "Returns the currently displayed item, in a given slideshow widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_GET, "Retrieve the number of items to cache, on a given slideshow widget, before the current item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_SET, "Set the number of items to cache, on a given slideshow widget, before the current item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_GET, "Retrieve the number of items to cache, on a given slideshow widget, after the current item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_SET, "Set the number of items to cache, on a given slideshow widget, after the current item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_NTH_GET, "Get the the item, in a given slideshow widget, placed at position nth, in its internal items list."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SLIDESHOW_SUB_ID_COUNT_GET, "Get the number of items stored in a given slideshow widget."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SLIDESHOW_BASE_ID, op_desc, ELM_OBJ_SLIDESHOW_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Slideshow_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_slideshow_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_slideshow.h b/src/lib/elm_slideshow.h
index 7fca0791f..d96e2024d 100644
--- a/src/lib/elm_slideshow.h
+++ b/src/lib/elm_slideshow.h
@@ -67,6 +67,335 @@
* @{
*/
+
+#define ELM_OBJ_SLIDESHOW_CLASS elm_obj_slideshow_class_get()
+
+const Eo_Class *elm_obj_slideshow_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SLIDESHOW_BASE_ID;
+
+enum
+{
+ ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_ADD,
+ ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_SORTED_INSERT,
+ ELM_OBJ_SLIDESHOW_SUB_ID_NEXT,
+ ELM_OBJ_SLIDESHOW_SUB_ID_PREVIOUS,
+ ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITIONS_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUTS_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_CLEAR,
+ ELM_OBJ_SLIDESHOW_SUB_ID_ITEMS_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_CURRENT_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_SET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_NTH_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_COUNT_GET,
+ ELM_OBJ_SLIDESHOW_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SLIDESHOW_ID(sub_id) (ELM_OBJ_SLIDESHOW_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_slideshow_item_add
+ * @since 1.8
+ *
+ * Add (append) a new item in a given slideshow widget.
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_slideshow_item_add
+ */
+#define elm_obj_slideshow_item_add(itc, data, ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_ADD), EO_TYPECHECK(const Elm_Slideshow_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_slideshow_item_sorted_insert
+ * @since 1.8
+ *
+ * Insert a new item into the given slideshow widget, using the func
+ * function to sort items (by item handles).
+ *
+ * @param[in] itc
+ * @param[in] data
+ * @param[in] func
+ * @param[out] ret
+ *
+ * @see elm_slideshow_item_sorted_insert
+ */
+#define elm_obj_slideshow_item_sorted_insert(itc, data, func, ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_SORTED_INSERT), EO_TYPECHECK(const Elm_Slideshow_Item_Class *, itc), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Eina_Compare_Cb, func), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_slideshow_next
+ * @since 1.8
+ *
+ * Slide to the next item, in a given slideshow widget
+ *
+ *
+ * @see elm_slideshow_next
+ */
+#define elm_obj_slideshow_next() ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_NEXT)
+
+/**
+ * @def elm_obj_slideshow_previous
+ * @since 1.8
+ *
+ * Slide to the previous item, in a given slideshow widget
+ *
+ *
+ * @see elm_slideshow_previous
+ */
+#define elm_obj_slideshow_previous() ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_PREVIOUS)
+
+/**
+ * @def elm_obj_slideshow_transitions_get
+ * @since 1.8
+ *
+ * Returns the list of sliding transition/effect names available, for a
+ * given slideshow widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_transitions_get
+ */
+#define elm_obj_slideshow_transitions_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITIONS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_slideshow_layouts_get
+ * @since 1.8
+ *
+ * Returns the list of layout names available, for a given
+ * slideshow widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_layouts_get
+ */
+#define elm_obj_slideshow_layouts_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUTS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_slideshow_transition_set
+ * @since 1.8
+ *
+ * Set the current slide transition/effect in use for a given
+ * slideshow widget.
+ *
+ * @param[in] transition
+ *
+ * @see elm_slideshow_transition_set
+ */
+#define elm_obj_slideshow_transition_set(transition) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_SET), EO_TYPECHECK(const char *, transition)
+
+/**
+ * @def elm_obj_slideshow_transition_get
+ * @since 1.8
+ *
+ * Get the current slide transition/effect in use for a given
+ * slideshow widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_transition_get
+ */
+#define elm_obj_slideshow_transition_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TRANSITION_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_slideshow_timeout_set
+ * @since 1.8
+ *
+ * Set the interval between each image transition on a given
+ * slideshow widget.
+ *
+ * @param[in] timeout
+ *
+ * @see elm_slideshow_timeout_set
+ */
+#define elm_obj_slideshow_timeout_set(timeout) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_SET), EO_TYPECHECK(double, timeout)
+
+/**
+ * @def elm_obj_slideshow_timeout_get
+ * @since 1.8
+ *
+ * Get the interval set for image transitions on a given slideshow
+ * widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_timeout_get
+ */
+#define elm_obj_slideshow_timeout_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_slideshow_loop_set
+ * @since 1.8
+ *
+ * Set if, after a slideshow is started, for a given slideshow
+ * widget.
+ *
+ * @param[in] loop
+ *
+ * @see elm_slideshow_loop_set
+ */
+#define elm_obj_slideshow_loop_set(loop) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_SET), EO_TYPECHECK(Eina_Bool, loop)
+
+/**
+ * @def elm_obj_slideshow_layout_get
+ * @since 1.8
+ *
+ * Get the current slide layout in use for a given slideshow widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_layout_get
+ */
+#define elm_obj_slideshow_layout_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_slideshow_layout_set
+ * @since 1.8
+ *
+ * Set the current slide layout in use for a given slideshow widget
+ *
+ * @param[in] layout
+ *
+ * @see elm_slideshow_layout_set
+ */
+#define elm_obj_slideshow_layout_set(layout) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LAYOUT_SET), EO_TYPECHECK(const char *, layout)
+
+/**
+ * @def elm_obj_slideshow_loop_get
+ * @since 1.8
+ *
+ * Get if, after a slideshow is started, for a given slideshow
+ * widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_loop_get
+ */
+#define elm_obj_slideshow_loop_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_LOOP_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_slideshow_clear
+ * @since 1.8
+ *
+ * Remove all items from a given slideshow widget
+ *
+ *
+ * @see elm_slideshow_clear
+ */
+#define elm_obj_slideshow_clear() ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CLEAR)
+
+/**
+ * @def elm_obj_slideshow_items_get
+ * @since 1.8
+ *
+ * Get the internal list of items in a given slideshow widget.
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_items_get
+ */
+#define elm_obj_slideshow_items_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
+
+/**
+ * @def elm_obj_slideshow_item_current_get
+ * @since 1.8
+ *
+ * Returns the currently displayed item, in a given slideshow widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_item_current_get
+ */
+#define elm_obj_slideshow_item_current_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_CURRENT_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_slideshow_cache_before_get
+ * @since 1.8
+ *
+ * Retrieve the number of items to cache, on a given slideshow widget,
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_cache_before_get
+ */
+#define elm_obj_slideshow_cache_before_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_slideshow_cache_before_set
+ * @since 1.8
+ *
+ * Set the number of items to cache, on a given slideshow widget,
+ *
+ * @param[in] count
+ *
+ * @see elm_slideshow_cache_before_set
+ */
+#define elm_obj_slideshow_cache_before_set(count) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_BEFORE_SET), EO_TYPECHECK(int, count)
+
+/**
+ * @def elm_obj_slideshow_cache_after_get
+ * @since 1.8
+ *
+ * Retrieve the number of items to cache, on a given slideshow widget,
+ * <b>after the current item</b>
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_cache_after_get
+ */
+#define elm_obj_slideshow_cache_after_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_slideshow_cache_after_set
+ * @since 1.8
+ *
+ * Set the number of items to cache, on a given slideshow widget,
+ * <b>after the current item</b>
+ *
+ * @param[in] count
+ *
+ * @see elm_slideshow_cache_after_set
+ */
+#define elm_obj_slideshow_cache_after_set(count) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_CACHE_AFTER_SET), EO_TYPECHECK(int, count)
+
+/**
+ * @def elm_obj_slideshow_item_nth_get
+ * @since 1.8
+ *
+ * Get the the item, in a given slideshow widget, placed at
+ * position @p nth, in its internal items list
+ *
+ * @param[in] nth
+ * @param[out] ret
+ *
+ * @see elm_slideshow_item_nth_get
+ */
+#define elm_obj_slideshow_item_nth_get(nth, ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_ITEM_NTH_GET), EO_TYPECHECK(unsigned int, nth), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_slideshow_count_get
+ * @since 1.8
+ *
+ * Get the number of items stored in a given slideshow widget
+ *
+ * @param[out] ret
+ *
+ * @see elm_slideshow_count_get
+ */
+#define elm_obj_slideshow_count_get(ret) ELM_OBJ_SLIDESHOW_ID(ELM_OBJ_SLIDESHOW_SUB_ID_COUNT_GET), EO_TYPECHECK(unsigned int *, ret)
+
typedef struct _Elm_Slideshow_Item_Class Elm_Slideshow_Item_Class; /**< Slideshow item class definition struct */
typedef struct _Elm_Slideshow_Item_Class_Func Elm_Slideshow_Item_Class_Func; /**< Class functions for slideshow item classes. */
typedef Evas_Object *(*SlideshowItemGetFunc)(void *data, Evas_Object *obj); /**< Image fetching class function for slideshow item classes. */
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index dc2d0d062..898fbbe6f 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -3,7 +3,13 @@
#include "elm_priv.h"
#include "elm_widget_spinner.h"
-EAPI const char ELM_SPINNER_SMART_NAME[] = "elm_spinner";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_SPINNER_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_SPINNER_CLASS
+
+#define MY_CLASS_NAME "elm_spinner"
static const char SIG_CHANGED[] = "changed";
static const char SIG_DELAY_CHANGED[] = "delay,changed";
@@ -13,10 +19,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_SPINNER_SMART_NAME, _elm_spinner, Elm_Spinner_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, _smart_callbacks);
-
static void
_entry_show(Elm_Spinner_Smart_Data *sd)
{
@@ -140,6 +142,7 @@ _val_set(Evas_Object *obj)
double pos = 0.0;
ELM_SPINNER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->val_max > sd->val_min)
pos = ((sd->val - sd->val_min) / (sd->val_max - sd->val_min));
@@ -147,7 +150,7 @@ _val_set(Evas_Object *obj)
else if (pos > 1.0)
pos = 1.0;
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", pos, pos);
+ (wd->resize_obj, "elm.dragable.slider", pos, pos);
}
static void
@@ -160,10 +163,11 @@ _drag_cb(void *data,
Evas_Object *obj = data;
ELM_SPINNER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (sd->entry_visible) return;
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", &pos, NULL);
+ (wd->resize_obj, "elm.dragable.slider", &pos, NULL);
offset = sd->step * _elm_config->scale;
delta = (pos - sd->drag_start_pos) * offset;
@@ -182,9 +186,10 @@ _drag_start_cb(void *data,
double pos;
ELM_SPINNER_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
edje_object_part_drag_value_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", &pos, NULL);
+ (wd->resize_obj, "elm.dragable.slider", &pos, NULL);
sd->drag_start_pos = pos;
}
@@ -195,10 +200,11 @@ _drag_stop_cb(void *data,
const char *source __UNUSED__)
{
ELM_SPINNER_DATA_GET(data, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(data, ELM_OBJ_WIDGET_CLASS);
sd->drag_start_pos = 0;
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.dragable.slider", 0.0, 0.0);
+ (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
}
static void
@@ -395,32 +401,37 @@ _entry_activated_cb(void *data,
}
static void
-_elm_spinner_smart_sizing_eval(Evas_Object *obj)
+_elm_spinner_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
- ELM_SPINNER_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, -1, -1);
}
-static Eina_Bool
-_elm_spinner_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_spinner_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ if (elm_widget_disabled_get(obj)) return;
if (type == EVAS_CALLBACK_KEY_DOWN)
{
Evas_Event_Key_Down *ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
else if (!strcmp(ev->keyname, "Left") ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)) ||
!strcmp(ev->keyname, "Down") ||
@@ -429,7 +440,8 @@ _elm_spinner_smart_event(Evas_Object *obj,
_val_dec_start(obj);
elm_layout_signal_emit(obj, "elm,left,anim,activate", "elm");
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if (!strcmp(ev->keyname, "Right") ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)) ||
@@ -439,14 +451,15 @@ _elm_spinner_smart_event(Evas_Object *obj,
_val_inc_start(obj);
elm_layout_signal_emit(obj, "elm,right,anim,activate", "elm");
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
else if (type == EVAS_CALLBACK_KEY_UP)
{
Evas_Event_Key_Down *ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (!strcmp(ev->keyname, "Right") ||
((!strcmp(ev->keyname, "KP_Right")) && (!ev->string)) ||
!strcmp(ev->keyname, "Up") ||
@@ -457,26 +470,29 @@ _elm_spinner_smart_event(Evas_Object *obj,
!strcmp(ev->keyname, "Down") ||
((!strcmp(ev->keyname, "KP_Down")) && (!ev->string)))
_val_dec_stop(obj);
- else return EINA_FALSE;
+ else return;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
-
- return EINA_FALSE;
}
-static Eina_Bool
-_elm_spinner_smart_on_focus(Evas_Object *obj)
+static void
+_elm_spinner_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!ELM_WIDGET_CLASS(_elm_spinner_parent_sc)->on_focus(obj))
- return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_on_focus(&int_ret));
+ if (!int_ret) return;
if (!elm_widget_focus_get(obj))
_entry_value_apply(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
@@ -487,7 +503,7 @@ _access_info_cb(void *data,
Evas_Object *spinner;
const char *txt = elm_widget_access_info_get(obj);
- spinner = ELM_WIDGET_DATA(data)->obj;
+ spinner = data;
if (!txt) txt = elm_layout_text_get(spinner, "elm.text");
if (txt) return strdup(txt);
@@ -499,7 +515,7 @@ _access_state_cb(void *data,
Evas_Object *obj __UNUSED__,
Elm_Widget_Item *item __UNUSED__)
{
- if (elm_widget_disabled_get(ELM_WIDGET_DATA(data)->obj))
+ if (elm_widget_disabled_get(data))
return strdup(E_("State: Disabled"));
return NULL;
@@ -547,16 +563,17 @@ _access_spinner_register(Evas_Object *obj)
ai = _elm_access_object_get(sd->access_obj);
_elm_access_text_set(ai, ELM_ACCESS_TYPE, E_("spinner"));
- _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, sd);
- _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, sd);
+ _elm_access_callback_set(ai, ELM_ACCESS_INFO, _access_info_cb, obj);
+ _elm_access_callback_set(ai, ELM_ACCESS_STATE, _access_state_cb, obj);
}
static void
-_elm_spinner_smart_add(Evas_Object *obj)
+_elm_spinner_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Spinner_Smart_Data);
+ Elm_Spinner_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_spinner_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
priv->val = 0.0;
priv->val_min = 0.0;
@@ -584,7 +601,7 @@ _elm_spinner_smart_add(Evas_Object *obj)
(obj, "elm,action,decrement,stop", "*", _button_dec_stop_cb, obj);
edje_object_part_drag_value_set
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm.dragable.slider", 0.0, 0.0);
+ (wd->resize_obj, "elm.dragable.slider", 0.0, 0.0);
priv->ent = elm_entry_add(obj);
elm_entry_single_line_set(priv->ent, EINA_TRUE);
@@ -606,11 +623,11 @@ _elm_spinner_smart_add(Evas_Object *obj)
}
static void
-_elm_spinner_smart_del(Evas_Object *obj)
+_elm_spinner_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Spinner_Special_Value *sv;
- ELM_SPINNER_DATA_GET(obj, sd);
+ Elm_Spinner_Smart_Data *sd = _pd;
if (sd->label) eina_stringshare_del(sd->label);
if (sd->delay) ecore_timer_del(sd->delay);
@@ -624,114 +641,98 @@ _elm_spinner_smart_del(Evas_Object *obj)
}
}
- ELM_WIDGET_CLASS(_elm_spinner_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
-static Eina_Bool
-_elm_spinner_smart_theme(Evas_Object *obj)
+static void
+_elm_spinner_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
- ret = elm_layout_theme_set(obj, "spinner", "base",
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret;
+
+ int_ret = elm_layout_theme_set(obj, "spinner", "base",
elm_widget_style_get(obj));
+ if (ret) *ret = int_ret;
if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
_access_spinner_register(obj);
+}
- return ret;
+static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_spinner_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_spinner_smart_focus_next_enable;
}
-static Eina_Bool
-_elm_spinner_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_spinner_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_spinner_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
Eina_List *items = NULL;
- ELM_SPINNER_CHECK(obj) EINA_FALSE;
- ELM_SPINNER_DATA_GET(obj, sd);
+ ELM_SPINNER_CHECK(obj);
+ Elm_Spinner_Smart_Data *sd = _pd;
items = eina_list_append(items, sd->access_obj);
items = eina_list_append(items, sd->decrement_btn_access);
items = eina_list_append(items, sd->increment_btn_access);
- return elm_widget_focus_list_next_get
+ int_ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
+ if (ret) *ret = int_ret;
}
static void
-_elm_spinner_smart_access(Evas_Object *obj, Eina_Bool is_access)
+_elm_spinner_smart_access(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
- if (is_access)
+ _elm_spinner_smart_focus_next_enable = va_arg(*list, int);
+ if (_elm_spinner_smart_focus_next_enable)
{
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_spinner_smart_focus_next;
_access_spinner_register(obj);
}
else
{
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
//TODO: unregister edje part object
}
}
-static void
-_elm_spinner_smart_set_user(Elm_Spinner_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_spinner_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_spinner_smart_del;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_spinner_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->event = _elm_spinner_smart_event;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_spinner_smart_sizing_eval;
-
- ELM_WIDGET_CLASS(sc)->theme = _elm_spinner_smart_theme;
-
- // ACCESS
- if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_spinner_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_spinner_smart_access;
-}
-
-EAPI const Elm_Spinner_Smart_Class *
-elm_spinner_smart_class_get(void)
-{
- static Elm_Spinner_Smart_Class _sc =
- ELM_SPINNER_SMART_CLASS_INIT_NAME_VERSION(ELM_SPINNER_SMART_NAME);
- static const Elm_Spinner_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_spinner_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
-}
-
EAPI Evas_Object *
elm_spinner_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_spinner_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -739,7 +740,14 @@ elm_spinner_label_format_set(Evas_Object *obj,
const char *fmt)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_label_format_set(fmt));
+}
+
+static void
+_elm_spinner_label_format_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *fmt = va_arg(*list, const char *);
+ Elm_Spinner_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->label, fmt);
_label_write(obj);
@@ -750,9 +758,17 @@ EAPI const char *
elm_spinner_label_format_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) NULL;
- ELM_SPINNER_DATA_GET(obj, sd);
+ const char *ret;
+ eo_do((Eo *) obj, elm_obj_spinner_label_format_get(&ret));
+ return ret;
+}
- return sd->label;
+static void
+_elm_spinner_label_format_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->label;
}
EAPI void
@@ -761,7 +777,15 @@ elm_spinner_min_max_set(Evas_Object *obj,
double max)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_min_max_set(min, max));
+}
+
+static void
+_elm_spinner_min_max_set(Eo *obj, void *_pd, va_list *list)
+{
+ double min = va_arg(*list, double);
+ double max = va_arg(*list, double);
+ Elm_Spinner_Smart_Data *sd = _pd;
if ((sd->val_min == min) && (sd->val_max == max)) return;
sd->val_min = min;
@@ -781,7 +805,16 @@ elm_spinner_min_max_get(const Evas_Object *obj,
if (max) *max = 0.0;
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_spinner_min_max_get(min, max));
+}
+
+static void
+_elm_spinner_min_max_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *min = va_arg(*list, double *);
+ double *max = va_arg(*list, double *);
+
+ Elm_Spinner_Smart_Data *sd = _pd;
if (min) *min = sd->val_min;
if (max) *max = sd->val_max;
@@ -792,8 +825,14 @@ elm_spinner_step_set(Evas_Object *obj,
double step)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_step_set(step));
+}
+static void
+_elm_spinner_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double step = va_arg(*list, double);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->step = step;
}
@@ -801,9 +840,17 @@ EAPI double
elm_spinner_step_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) 0.0;
- ELM_SPINNER_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_spinner_step_get(&ret));
+ return ret;
+}
- return sd->step;
+static void
+_elm_spinner_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->step;
}
EAPI void
@@ -811,7 +858,14 @@ elm_spinner_value_set(Evas_Object *obj,
double val)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_value_set(val));
+}
+
+static void
+_elm_spinner_value_set(Eo *obj, void *_pd, va_list *list)
+{
+ double val = va_arg(*list, double);
+ Elm_Spinner_Smart_Data *sd = _pd;
if (sd->val == val) return;
sd->val = val;
@@ -825,9 +879,17 @@ EAPI double
elm_spinner_value_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) 0.0;
- ELM_SPINNER_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_spinner_value_get(&ret));
+ return ret;
+}
- return sd->val;
+static void
+_elm_spinner_value_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->val;
}
EAPI void
@@ -835,8 +897,14 @@ elm_spinner_wrap_set(Evas_Object *obj,
Eina_Bool wrap)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_wrap_set(wrap));
+}
+static void
+_elm_spinner_wrap_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool wrap = va_arg(*list, int);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->wrap = wrap;
}
@@ -844,9 +912,17 @@ EAPI Eina_Bool
elm_spinner_wrap_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) EINA_FALSE;
- ELM_SPINNER_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_spinner_wrap_get(&ret));
+ return ret;
+}
- return sd->wrap;
+static void
+_elm_spinner_wrap_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->wrap;
}
EAPI void
@@ -854,11 +930,18 @@ elm_spinner_special_value_add(Evas_Object *obj,
double value,
const char *label)
{
+ ELM_SPINNER_CHECK(obj);
+ eo_do(obj, elm_obj_spinner_special_value_add(value, label));
+}
+
+static void
+_elm_spinner_special_value_add(Eo *obj, void *_pd, va_list *list)
+{
+ double value = va_arg(*list, double);
+ const char *label = va_arg(*list, const char *);
Elm_Spinner_Special_Value *sv;
Eina_List *l;
-
- ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ Elm_Spinner_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->special_values, l, sv)
{
@@ -926,8 +1009,14 @@ elm_spinner_editable_set(Evas_Object *obj,
Eina_Bool editable)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_editable_set(editable));
+}
+static void
+_elm_spinner_editable_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool editable = va_arg(*list, int);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->editable = editable;
}
@@ -935,9 +1024,17 @@ EAPI Eina_Bool
elm_spinner_editable_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) EINA_FALSE;
- ELM_SPINNER_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_spinner_editable_get(&ret));
+ return ret;
+}
- return sd->editable;
+static void
+_elm_spinner_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->editable;
}
EAPI void
@@ -945,8 +1042,14 @@ elm_spinner_interval_set(Evas_Object *obj,
double interval)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_interval_set(interval));
+}
+static void
+_elm_spinner_interval_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double interval = va_arg(*list, double);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->first_interval = interval;
}
@@ -954,9 +1057,17 @@ EAPI double
elm_spinner_interval_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) 0.0;
- ELM_SPINNER_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_spinner_interval_get(&ret));
+ return ret;
+}
- return sd->first_interval;
+static void
+_elm_spinner_interval_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->first_interval;
}
EAPI void
@@ -964,8 +1075,14 @@ elm_spinner_base_set(Evas_Object *obj,
double base)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_base_set(base));
+}
+static void
+_elm_spinner_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double base = va_arg(*list, double);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->val_base = base;
}
@@ -973,9 +1090,17 @@ EAPI double
elm_spinner_base_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) 0.0;
- ELM_SPINNER_DATA_GET(obj, sd);
+ double ret;
+ eo_do((Eo *) obj, elm_obj_spinner_base_get(&ret));
+ return ret;
+}
- return sd->val_base;
+static void
+_elm_spinner_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->val_base;
}
EAPI void
@@ -983,8 +1108,14 @@ elm_spinner_round_set(Evas_Object *obj,
int rnd)
{
ELM_SPINNER_CHECK(obj);
- ELM_SPINNER_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_spinner_round_set(rnd));
+}
+static void
+_elm_spinner_round_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int rnd = va_arg(*list, int);
+ Elm_Spinner_Smart_Data *sd = _pd;
sd->round = rnd;
}
@@ -992,7 +1123,94 @@ EAPI int
elm_spinner_round_get(const Evas_Object *obj)
{
ELM_SPINNER_CHECK(obj) 0;
- ELM_SPINNER_DATA_GET(obj, sd);
+ int ret;
+ eo_do((Eo *) obj, elm_obj_spinner_round_get(&ret));
+ return ret;
+}
- return sd->round;
+static void
+_elm_spinner_round_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Spinner_Smart_Data *sd = _pd;
+ *ret = sd->round;
+}
+
+static void
+_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_spinner_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_spinner_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_spinner_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_spinner_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_spinner_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_spinner_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_spinner_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_spinner_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_spinner_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_spinner_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_SET), _elm_spinner_label_format_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_GET), _elm_spinner_label_format_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_SET), _elm_spinner_min_max_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_GET), _elm_spinner_min_max_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_STEP_SET), _elm_spinner_step_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_STEP_GET), _elm_spinner_step_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_VALUE_SET), _elm_spinner_value_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_VALUE_GET), _elm_spinner_value_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_WRAP_SET), _elm_spinner_wrap_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_WRAP_GET), _elm_spinner_wrap_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_SPECIAL_VALUE_ADD), _elm_spinner_special_value_add),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_SET), _elm_spinner_editable_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_GET), _elm_spinner_editable_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_SET), _elm_spinner_interval_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_GET), _elm_spinner_interval_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_BASE_SET), _elm_spinner_base_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_BASE_GET), _elm_spinner_base_get),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_ROUND_SET), _elm_spinner_round_set),
+ EO_OP_FUNC(ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_ROUND_GET), _elm_spinner_round_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+
+ if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
+ _elm_spinner_smart_focus_next_enable = EINA_TRUE;
}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_SET, "Set the format string of the displayed label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_GET, "Get the label format of the spinner."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_SET, "Set the minimum and maximum values for the spinner."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_GET, "Get the minimum and maximum values of the spinner."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_STEP_SET, "Set the step used to increment or decrement the spinner value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_STEP_GET, "Get the step used to increment or decrement the spinner value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_VALUE_SET, "Set the value the spinner displays."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_VALUE_GET, "Get the value displayed by the spinner."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_WRAP_SET, "Set whether the spinner should wrap when it reaches its minimum or maximum value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_WRAP_GET, "Get whether the spinner should wrap when it reaches its minimum or maximum value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_SPECIAL_VALUE_ADD, "Set a special string to display in the place of the numerical value."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_SET, "Set whether the spinner can be directly edited by the user or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_GET, "Get whether the spinner can be directly edited by the user or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_SET, "Set the interval on time updates for an user mouse button hold on spinner widgets' arrows."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_GET, "Get the interval on time updates for an user mouse button hold on spinner widgets' arrows."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_BASE_SET, "Set the base for rounding."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_BASE_GET, "Get the base for rounding."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_ROUND_SET, "Set the round value for rounding."),
+ EO_OP_DESCRIPTION(ELM_OBJ_SPINNER_SUB_ID_ROUND_GET, "Get the round value for rounding."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_SPINNER_BASE_ID, op_desc, ELM_OBJ_SPINNER_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Spinner_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_spinner_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_spinner.h b/src/lib/elm_spinner.h
index 63324df2b..5045f1395 100644
--- a/src/lib/elm_spinner.h
+++ b/src/lib/elm_spinner.h
@@ -47,6 +47,269 @@
* @ref spinner_example
*/
+#define ELM_OBJ_SPINNER_CLASS elm_obj_spinner_class_get()
+
+const Eo_Class *elm_obj_spinner_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_SPINNER_BASE_ID;
+
+enum
+{
+ ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_SET,
+ ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_GET,
+ ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_SET,
+ ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_GET,
+ ELM_OBJ_SPINNER_SUB_ID_STEP_SET,
+ ELM_OBJ_SPINNER_SUB_ID_STEP_GET,
+ ELM_OBJ_SPINNER_SUB_ID_VALUE_SET,
+ ELM_OBJ_SPINNER_SUB_ID_VALUE_GET,
+ ELM_OBJ_SPINNER_SUB_ID_WRAP_SET,
+ ELM_OBJ_SPINNER_SUB_ID_WRAP_GET,
+ ELM_OBJ_SPINNER_SUB_ID_SPECIAL_VALUE_ADD,
+ ELM_OBJ_SPINNER_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_SPINNER_SUB_ID_EDITABLE_GET,
+ ELM_OBJ_SPINNER_SUB_ID_INTERVAL_SET,
+ ELM_OBJ_SPINNER_SUB_ID_INTERVAL_GET,
+ ELM_OBJ_SPINNER_SUB_ID_BASE_SET,
+ ELM_OBJ_SPINNER_SUB_ID_BASE_GET,
+ ELM_OBJ_SPINNER_SUB_ID_ROUND_SET,
+ ELM_OBJ_SPINNER_SUB_ID_ROUND_GET,
+ ELM_OBJ_SPINNER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_SPINNER_ID(sub_id) (ELM_OBJ_SPINNER_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_spinner_label_format_set
+ * @since 1.8
+ *
+ * Set the format string of the displayed label.
+ *
+ * @param[in] fmt
+ *
+ * @see elm_spinner_label_format_set
+ */
+#define elm_obj_spinner_label_format_set(fmt) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_SET), EO_TYPECHECK(const char *, fmt)
+
+/**
+ * @def elm_obj_spinner_label_format_get
+ * @since 1.8
+ *
+ * Get the label format of the spinner.
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_label_format_get
+ */
+#define elm_obj_spinner_label_format_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_LABEL_FORMAT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_spinner_min_max_set
+ * @since 1.8
+ *
+ * Set the minimum and maximum values for the spinner.
+ *
+ * @param[in] min
+ * @param[in] max
+ *
+ * @see elm_spinner_min_max_set
+ */
+#define elm_obj_spinner_min_max_set(min, max) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_SET), EO_TYPECHECK(double, min), EO_TYPECHECK(double, max)
+
+/**
+ * @def elm_obj_spinner_min_max_get
+ * @since 1.8
+ *
+ * Get the minimum and maximum values of the spinner.
+ *
+ * @param[out] min
+ * @param[out] max
+ *
+ * @see elm_spinner_min_max_get
+ */
+#define elm_obj_spinner_min_max_get(min, max) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_MIN_MAX_GET), EO_TYPECHECK(double *, min), EO_TYPECHECK(double *, max)
+
+/**
+ * @def elm_obj_spinner_step_set
+ * @since 1.8
+ *
+ * Set the step used to increment or decrement the spinner value.
+ *
+ * @param[in] step
+ *
+ * @see elm_spinner_step_set
+ */
+#define elm_obj_spinner_step_set(step) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_STEP_SET), EO_TYPECHECK(double, step)
+
+/**
+ * @def elm_obj_spinner_step_get
+ * @since 1.8
+ *
+ * Get the step used to increment or decrement the spinner value.
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_step_get
+ */
+#define elm_obj_spinner_step_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_STEP_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_spinner_value_set
+ * @since 1.8
+ *
+ * Set the value the spinner displays.
+ *
+ * @param[in] val
+ *
+ * @see elm_spinner_value_set
+ */
+#define elm_obj_spinner_value_set(val) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_VALUE_SET), EO_TYPECHECK(double, val)
+
+/**
+ * @def elm_obj_spinner_value_get
+ * @since 1.8
+ *
+ * Get the value displayed by the spinner.
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_value_get
+ */
+#define elm_obj_spinner_value_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_VALUE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_spinner_wrap_set
+ * @since 1.8
+ *
+ * Set whether the spinner should wrap when it reaches its
+ *
+ * @param[in] wrap
+ *
+ * @see elm_spinner_wrap_set
+ */
+#define elm_obj_spinner_wrap_set(wrap) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_WRAP_SET), EO_TYPECHECK(Eina_Bool, wrap)
+
+/**
+ * @def elm_obj_spinner_wrap_get
+ * @since 1.8
+ *
+ * Get whether the spinner should wrap when it reaches its
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_wrap_get
+ */
+#define elm_obj_spinner_wrap_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_WRAP_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_spinner_special_value_add
+ * @since 1.8
+ *
+ * Set a special string to display in the place of the numerical value.
+ *
+ * @param[in] value
+ * @param[in] label
+ *
+ * @see elm_spinner_special_value_add
+ */
+#define elm_obj_spinner_special_value_add(value, label) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_SPECIAL_VALUE_ADD), EO_TYPECHECK(double, value), EO_TYPECHECK(const char *, label)
+
+/**
+ * @def elm_obj_spinner_editable_set
+ * @since 1.8
+ *
+ * Set whether the spinner can be directly edited by the user or not.
+ *
+ * @param[in] editable
+ *
+ * @see elm_spinner_editable_set
+ */
+#define elm_obj_spinner_editable_set(editable) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, editable)
+
+/**
+ * @def elm_obj_spinner_editable_get
+ * @since 1.8
+ *
+ * Get whether the spinner can be directly edited by the user or not.
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_editable_get
+ */
+#define elm_obj_spinner_editable_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_spinner_interval_set
+ * @since 1.8
+ *
+ * Set the interval on time updates for an user mouse button hold
+ *
+ * @param[in] interval
+ *
+ * @see elm_spinner_interval_set
+ */
+#define elm_obj_spinner_interval_set(interval) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_SET), EO_TYPECHECK(double, interval)
+
+/**
+ * @def elm_obj_spinner_interval_get
+ * @since 1.8
+ *
+ * Get the interval on time updates for an user mouse button hold
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_interval_get
+ */
+#define elm_obj_spinner_interval_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_INTERVAL_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_spinner_base_set
+ * @since 1.8
+ *
+ * Set the base for rounding
+ *
+ * @param[in] base
+ *
+ * @see elm_spinner_base_set
+ */
+#define elm_obj_spinner_base_set(base) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_BASE_SET), EO_TYPECHECK(double, base)
+
+/**
+ * @def elm_obj_spinner_base_get
+ * @since 1.8
+ *
+ * Get the base for rounding
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_base_get
+ */
+#define elm_obj_spinner_base_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_BASE_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_spinner_round_set
+ * @since 1.8
+ *
+ * Set the round value for rounding
+ *
+ * @param[in] rnd
+ *
+ * @see elm_spinner_round_set
+ */
+#define elm_obj_spinner_round_set(rnd) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_ROUND_SET), EO_TYPECHECK(int, rnd)
+
+/**
+ * @def elm_obj_spinner_round_get
+ * @since 1.8
+ *
+ * Get the round value for rounding
+ *
+ * @param[out] ret
+ *
+ * @see elm_spinner_round_get
+ */
+#define elm_obj_spinner_round_get(ret) ELM_OBJ_SPINNER_ID(ELM_OBJ_SPINNER_SUB_ID_ROUND_GET), EO_TYPECHECK(int *, ret)
/**
* @addtogroup Spinner
* @{
diff --git a/src/lib/elm_table.c b/src/lib/elm_table.c
index 7509c05fd..847789a93 100644
--- a/src/lib/elm_table.c
+++ b/src/lib/elm_table.c
@@ -2,23 +2,35 @@
#include "elm_priv.h"
#include "elm_widget_table.h"
-EAPI const char ELM_TABLE_SMART_NAME[] = "elm_table";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_TABLE_SMART_NAME, _elm_table, Elm_Table_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_TABLE_BASE_ID = EO_NOOP;
-static Eina_Bool
-_elm_table_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+#define MY_CLASS ELM_OBJ_TABLE_CLASS
+
+#define MY_CLASS_NAME "elm_table"
+
+static void
+_elm_table_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_table_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
const Eina_List *items;
Eina_List *(*list_free)(Eina_List *list);
void *(*list_data_get)(const Eina_List *list);
- ELM_TABLE_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
/* Focus chain */
/* TODO: Change this to use other chain */
@@ -30,33 +42,43 @@ _elm_table_smart_focus_next(const Evas_Object *obj,
else
{
items = evas_object_table_children_get
- (ELM_WIDGET_DATA(sd)->resize_obj);
+ (wd->resize_obj);
list_data_get = eina_list_data_get;
list_free = eina_list_free;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
+ int_ret = elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
if (list_free) list_free((Eina_List *)items);
- return ret;
+ if (ret) *ret = int_ret;
+}
+
+static void
+_elm_table_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_table_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_table_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- Eina_Bool ret;
+ Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
const Eina_List *items;
Eina_List *(*list_free)(Eina_List *list);
void *(*list_data_get)(const Eina_List *list);
- ELM_TABLE_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
/* Focus chain */
/* TODO: Change this to use other chain */
@@ -68,38 +90,44 @@ _elm_table_smart_focus_direction(const Evas_Object *obj,
else
{
items = evas_object_table_children_get
- (ELM_WIDGET_DATA(sd)->resize_obj);
+ (wd->resize_obj);
list_data_get = eina_list_data_get;
list_free = eina_list_free;
- if (!items) return EINA_FALSE;
+ if (!items) return;
}
- ret = elm_widget_focus_list_direction_get
+ int_ret = elm_widget_focus_list_direction_get
(obj, base, items, list_data_get, degree, direction, weight);
if (list_free)
list_free((Eina_List *)items);
- return ret;
+ if (ret) *ret = int_ret;
}
static void
_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
{
- ELM_TABLE_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
- evas_object_table_mirrored_set(ELM_WIDGET_DATA(sd)->resize_obj, rtl);
+ evas_object_table_mirrored_set(wd->resize_obj, rtl);
}
-static Eina_Bool
-_elm_table_smart_theme(Evas_Object *obj)
+static void
+_elm_table_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_table_parent_sc->theme(obj)) return EINA_FALSE;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Eina_Bool super_ret;
+ eo_do_super(obj, elm_wdg_theme(&super_ret));
+ if (super_ret == EINA_FALSE)
+ return;
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -108,12 +136,12 @@ _sizing_eval(Evas_Object *obj)
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
Evas_Coord w, h;
- ELM_TABLE_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_size_hint_min_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ (wd->resize_obj, &minw, &minh);
evas_object_size_hint_max_get
- (ELM_WIDGET_DATA(sd)->resize_obj, &maxw, &maxh);
+ (wd->resize_obj, &maxw, &maxh);
evas_object_size_hint_min_set(obj, minw, minh);
evas_object_size_hint_max_set(obj, maxw, maxh);
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
@@ -133,21 +161,26 @@ _on_size_hints_changed(void *data,
_sizing_eval(data);
}
-static Eina_Bool
-_elm_table_smart_sub_object_del(Evas_Object *obj,
- Evas_Object *child)
+static void
+_elm_table_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- if (!_elm_table_parent_sc->sub_object_del(obj, child)) return EINA_FALSE;
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret;
+
+ eo_do_super(obj, elm_wdg_sub_object_del(child, &int_ret));
+ if (!int_ret) return;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
-_elm_table_smart_add(Evas_Object *obj)
+_elm_table_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Widget_Smart_Data);
+ Elm_Widget_Smart_Data *priv = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
priv->resize_obj = evas_object_table_add(evas_object_evas_get(obj));
@@ -155,101 +188,93 @@ _elm_table_smart_add(Evas_Object *obj)
(priv->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_size_hints_changed, obj);
- _elm_table_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_FALSE);
- _elm_table_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
static void
-_elm_table_smart_del(Evas_Object *obj)
+_elm_table_smart_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Eina_List *l;
Evas_Object *child;
- ELM_TABLE_DATA_GET(obj, sd);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_event_callback_del_full
- (ELM_WIDGET_DATA(sd)->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_size_hints_changed, obj);
/* let's make our table object the *last* to be processed, since it
* may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(ELM_WIDGET_DATA(sd)->subobjs, l, child)
+ EINA_LIST_FOREACH(wd->subobjs, l, child)
{
- if (child == ELM_WIDGET_DATA(sd)->resize_obj)
+ if (child == wd->resize_obj)
{
- ELM_WIDGET_DATA(sd)->subobjs =
- eina_list_demote_list(ELM_WIDGET_DATA(sd)->subobjs, l);
+ wd->subobjs =
+ eina_list_demote_list(wd->subobjs, l);
break;
}
}
- _elm_table_parent_sc->base.del(obj);
-}
-
-static void
-_elm_table_smart_set_user(Elm_Table_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_table_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_table_smart_del;
- ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_table_smart_sub_object_del;
- ELM_WIDGET_CLASS(sc)->theme = _elm_table_smart_theme;
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_table_smart_focus_next;
- ELM_WIDGET_CLASS(sc)->focus_direction = _elm_table_smart_focus_direction;
-}
-
-EAPI const Elm_Table_Smart_Class *
-elm_table_smart_class_get(void)
-{
- static Elm_Table_Smart_Class _sc =
- ELM_TABLE_SMART_CLASS_INIT_NAME_VERSION(ELM_TABLE_SMART_NAME);
- static const Elm_Table_Smart_Class *class = NULL;
-
- if (class) return class;
-
- _elm_table_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_table_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
-
- obj = elm_widget_add(_elm_table_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
-
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
return obj;
}
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+}
+
EAPI void
elm_table_homogeneous_set(Evas_Object *obj,
Eina_Bool homogeneous)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_homogeneous_set(homogeneous));
+}
+
+static void
+_homogeneous_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool homogeneous = va_arg(*list, int);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_table_homogeneous_set
- (ELM_WIDGET_DATA(sd)->resize_obj, homogeneous);
+ (wd->resize_obj, homogeneous);
}
EAPI Eina_Bool
elm_table_homogeneous_get(const Evas_Object *obj)
{
ELM_TABLE_CHECK(obj) EINA_FALSE;
- ELM_TABLE_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_table_homogeneous_get(&ret));
+ return ret;
+}
- return evas_object_table_homogeneous_get(ELM_WIDGET_DATA(sd)->resize_obj);
+static void
+_homogeneous_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ ELM_WIDGET_DATA_GET(obj, wd);
+ *ret = evas_object_table_homogeneous_get(wd->resize_obj);
}
EAPI void
@@ -258,10 +283,18 @@ elm_table_padding_set(Evas_Object *obj,
Evas_Coord vertical)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_padding_set(horizontal, vertical));
+}
+
+static void
+_padding_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord horizontal = va_arg(*list, Evas_Coord);
+ Evas_Coord vertical = va_arg(*list, Evas_Coord);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_table_padding_set
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
@@ -270,10 +303,18 @@ elm_table_padding_get(const Evas_Object *obj,
Evas_Coord *vertical)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_table_padding_get(horizontal, vertical));
+}
+
+static void
+_padding_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *horizontal = va_arg(*list, Evas_Coord *);
+ Evas_Coord *vertical = va_arg(*list, Evas_Coord *);
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_table_padding_get
- (ELM_WIDGET_DATA(sd)->resize_obj, horizontal, vertical);
+ (wd->resize_obj, horizontal, vertical);
}
EAPI void
@@ -285,10 +326,21 @@ elm_table_pack(Evas_Object *obj,
int h)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_pack(subobj, x, y, w, h));
+}
+
+static void
+_pack(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ ELM_WIDGET_DATA_GET(obj, wd);
elm_widget_sub_object_add(obj, subobj);
- evas_object_table_pack(ELM_WIDGET_DATA(sd)->resize_obj, subobj, x, y, w, h);
+ evas_object_table_pack(wd->resize_obj, subobj, x, y, w, h);
}
EAPI void
@@ -296,10 +348,17 @@ elm_table_unpack(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_unpack(subobj));
+}
+
+static void
+_unpack(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ ELM_WIDGET_DATA_GET(obj, wd);
elm_widget_sub_object_del(obj, subobj);
- evas_object_table_unpack(ELM_WIDGET_DATA(sd)->resize_obj, subobj);
+ evas_object_table_unpack(wd->resize_obj, subobj);
}
EAPI void
@@ -312,9 +371,21 @@ elm_table_pack_set(Evas_Object *subobj,
Evas_Object *obj = elm_widget_parent_widget_get(subobj);
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_pack_set(subobj, x, y, w, h));
+}
+
+static void
+_pack_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+
+ ELM_WIDGET_DATA_GET(obj, wd);
- evas_object_table_pack(ELM_WIDGET_DATA(sd)->resize_obj, subobj, x, y, w, h);
+ evas_object_table_pack(wd->resize_obj, subobj, x, y, w, h);
}
EAPI void
@@ -325,13 +396,24 @@ elm_table_pack_get(Evas_Object *subobj,
int *h)
{
Evas_Object *obj = elm_widget_parent_widget_get(subobj);
- unsigned short ix, iy, iw, ih;
-
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_pack_get(subobj, x, y, w, h));
+}
+
+static void
+_pack_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ int *x = va_arg(*list, int *);
+ int *y = va_arg(*list, int *);
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+
+ unsigned short ix, iy, iw, ih;
+ ELM_WIDGET_DATA_GET(obj, wd);
evas_object_table_pack_get
- (ELM_WIDGET_DATA(sd)->resize_obj, subobj, &ix, &iy, &iw, &ih);
+ (wd->resize_obj, subobj, &ix, &iy, &iw, &ih);
if (x) *x = ix;
if (y) *y = iy;
if (w) *w = iw;
@@ -343,7 +425,71 @@ elm_table_clear(Evas_Object *obj,
Eina_Bool clear)
{
ELM_TABLE_CHECK(obj);
- ELM_TABLE_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_table_clear(clear));
+}
+
+static void
+_clear(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool clear = va_arg(*list, int);
+ ELM_WIDGET_DATA_GET(obj, wd);
+
+ evas_object_table_clear(wd->resize_obj, clear);
+}
- evas_object_table_clear(ELM_WIDGET_DATA(sd)->resize_obj, clear);
+static void
+_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_table_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_table_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_table_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_table_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_table_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_table_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_table_smart_focus_direction),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_table_sub_object_del),
+
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_SET), _homogeneous_set),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_GET), _homogeneous_get),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PADDING_SET), _padding_set),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PADDING_GET), _padding_get),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK), _pack),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_UNPACK), _unpack),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK_SET), _pack_set),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK_GET), _pack_get),
+ EO_OP_FUNC(ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_CLEAR), _clear),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_SET, "Set the homogeneous layout in the table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_GET, "Get the current table homogeneous mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_PADDING_SET, "Set padding between cells."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_PADDING_GET, "Get padding between cells."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_PACK, "Add a subobject on the table with the coordinates passed."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_UNPACK, "Remove child from table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_PACK_SET, "Set the packing location of an existing child of the table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_PACK_GET, "Get the packing location of an existing child of the table."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TABLE_SUB_ID_CLEAR, "Faster way to remove all child objects from a table object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_TABLE_BASE_ID, op_desc, ELM_OBJ_TABLE_SUB_ID_LAST),
+ NULL,
+ 0,
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_table_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
+
diff --git a/src/lib/elm_table.h b/src/lib/elm_table.h
index 45809a594..e87ae14b5 100644
--- a/src/lib/elm_table.h
+++ b/src/lib/elm_table.h
@@ -29,6 +29,152 @@
* @{
*/
+#define ELM_OBJ_TABLE_CLASS elm_obj_table_class_get()
+
+const Eo_Class *elm_obj_table_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_TABLE_BASE_ID;
+
+enum
+{
+ ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_SET,
+ ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_GET,
+ ELM_OBJ_TABLE_SUB_ID_PADDING_SET,
+ ELM_OBJ_TABLE_SUB_ID_PADDING_GET,
+ ELM_OBJ_TABLE_SUB_ID_PACK,
+ ELM_OBJ_TABLE_SUB_ID_UNPACK,
+ ELM_OBJ_TABLE_SUB_ID_PACK_SET,
+ ELM_OBJ_TABLE_SUB_ID_PACK_GET,
+ ELM_OBJ_TABLE_SUB_ID_CLEAR,
+ ELM_OBJ_TABLE_SUB_ID_LAST
+};
+
+#define ELM_OBJ_TABLE_ID(sub_id) (ELM_OBJ_TABLE_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_table_homogeneous_set
+ * @since 1.8
+ *
+ * @brief Set the homogeneous layout in the table
+ *
+ * @param[in] homogeneous
+ *
+ * @see elm_table_homogeneous_set
+ */
+#define elm_obj_table_homogeneous_set(homogeneous) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous)
+
+/**
+ * @def elm_obj_table_homogeneous_get
+ * @since 1.8
+ *
+ * @brief Get the current table homogeneous mode.
+ *
+ * @param[out] ret
+ *
+ * @see elm_table_homogeneous_get
+ */
+#define elm_obj_table_homogeneous_get(ret) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_table_padding_set
+ * @since 1.8
+ *
+ * @brief Set padding between cells.
+ *
+ * @param[in] horizontal
+ * @param[in] vertical
+ *
+ * @see elm_table_padding_set
+ */
+#define elm_obj_table_padding_set(horizontal, vertical) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PADDING_SET), EO_TYPECHECK(Evas_Coord, horizontal), EO_TYPECHECK(Evas_Coord, vertical)
+
+/**
+ * @def elm_obj_table_padding_get
+ * @since 1.8
+ *
+ * @brief Get padding between cells.
+ *
+ * @param[out] horizontal
+ * @param[out] vertical
+ *
+ * @see elm_table_padding_get
+ */
+#define elm_obj_table_padding_get(horizontal, vertical) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PADDING_GET), EO_TYPECHECK(Evas_Coord *, horizontal), EO_TYPECHECK(Evas_Coord *, vertical)
+
+/**
+ * @def elm_obj_table_pack
+ * @since 1.8
+ *
+ * @brief Add a subobject on the table with the coordinates passed
+ *
+ * @param[in] subobj
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_table_pack
+ */
+#define elm_obj_table_pack(subobj, x, y, w, h) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_table_unpack
+ * @since 1.8
+ *
+ * @brief Remove child from table.
+ *
+ * @param[in] subobj
+ *
+ * @see elm_table_unpack
+ */
+#define elm_obj_table_unpack(subobj) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_table_pack_set
+ * @since 1.8
+ *
+ * @brief Set the packing location of an existing child of the table
+ *
+ * @param[in] subobj
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_table_pack_set
+ */
+#define elm_obj_table_pack_set(subobj, x, y, w, h) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK_SET), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_table_pack_get
+ * @since 1.8
+ *
+ * @brief Get the packing location of an existing child of the table
+ *
+ * @param[in] subobj
+ * @param[out] x
+ * @param[out] y
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_table_pack_get
+ */
+#define elm_obj_table_pack_get(subobj, x, y, w, h) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_PACK_GET), EO_TYPECHECK(Evas_Object *, subobj), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_table_clear
+ * @since 1.8
+ *
+ * @brief Faster way to remove all child objects from a table object.
+ *
+ * @param[in] clear
+ *
+ * @see elm_table_clear
+ */
+#define elm_obj_table_clear(clear) ELM_OBJ_TABLE_ID(ELM_OBJ_TABLE_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear)
+
+
/**
* @brief Add a new table to the parent
*
diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c
index 23ee459ad..ae843cbc8 100644
--- a/src/lib/elm_thumb.c
+++ b/src/lib/elm_thumb.c
@@ -2,7 +2,11 @@
#include "elm_priv.h"
#include "elm_widget_thumb.h"
-EAPI const char ELM_THUMB_SMART_NAME[] = "elm_thumb";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_THUMB_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_THUMB_CLASS
static const char SIG_CLICKED[] = "clicked";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
@@ -40,10 +44,6 @@ static int pending_request = 0;
EAPI int ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
-EVAS_SMART_SUBCLASS_NEW
- (ELM_THUMB_SMART_NAME, _elm_thumb, Elm_Thumb_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
#ifdef HAVE_ELEMENTARY_ETHUMB
static void
_mouse_down_cb(void *data,
@@ -91,23 +91,25 @@ _thumb_ready_inform(Elm_Thumb_Smart_Data *sd,
Evas_Coord mw, mh;
Evas_Coord aw, ah;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+
evas_object_image_size_get(sd->view, &aw, &ah);
evas_object_size_hint_aspect_set
(sd->view, EVAS_ASPECT_CONTROL_BOTH, aw, ah);
elm_layout_content_set
- (ELM_WIDGET_DATA(sd)->resize_obj, "elm.swallow.content", sd->view);
- edje_object_size_min_get(ELM_WIDGET_DATA(sd)->resize_obj, &mw, &mh);
+ (wd->resize_obj, "elm.swallow.content", sd->view);
+ edje_object_size_min_get(wd->resize_obj, &mw, &mh);
edje_object_size_min_restricted_calc
- (ELM_WIDGET_DATA(sd)->resize_obj, &mw, &mh, mw, mh);
- evas_object_size_hint_min_set(ELM_WIDGET_DATA(sd)->obj, mw, mh);
+ (wd->resize_obj, &mw, &mh, mw, mh);
+ evas_object_size_hint_min_set(sd->obj, mw, mh);
eina_stringshare_replace(&(sd->thumb.file), thumb_path);
eina_stringshare_replace(&(sd->thumb.key), thumb_key);
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_PULSE_STOP, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_PULSE_STOP, "elm");
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_GENERATE_STOP, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_GENERATE_STOP, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_GENERATE_STOP, NULL);
+ (sd->obj, SIG_GENERATE_STOP, NULL);
}
static void
@@ -196,7 +198,8 @@ _thumb_finish(Elm_Thumb_Smart_Data *sd,
Evas *evas;
int r;
- evas = evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj);
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+ evas = evas_object_evas_get(sd->obj);
if ((sd->view) && (sd->is_video ^ sd->was_video))
{
evas_object_del(sd->view);
@@ -282,19 +285,20 @@ _thumb_finish(Elm_Thumb_Smart_Data *sd,
evas_object_del(sd->view);
sd->view = NULL;
+ wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_LOAD_ERROR, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_LOAD_ERROR, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_LOAD_ERROR, NULL);
+ (sd->obj, SIG_LOAD_ERROR, NULL);
}
return;
err:
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_LOAD_ERROR, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_LOAD_ERROR, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_LOAD_ERROR, NULL);
+ (sd->obj, SIG_LOAD_ERROR, NULL);
}
static void
@@ -335,10 +339,11 @@ _on_ethumb_thumb_error(Ethumb_Client *client __UNUSED__,
ERR("could not generate thumbnail for %s (key: %s)",
sd->thumb.file, sd->thumb.key ? sd->thumb.key : "");
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_GENERATE_ERROR, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_GENERATE_ERROR, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_GENERATE_ERROR, NULL);
+ (sd->obj, SIG_GENERATE_ERROR, NULL);
}
static void
@@ -357,12 +362,13 @@ _thumb_start(Elm_Thumb_Smart_Data *sd)
if (!sd->file) return;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_PULSE_START, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_PULSE_START, "elm");
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_GENERATE_START, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_GENERATE_START, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_GENERATE_START, NULL);
+ (sd->obj, SIG_GENERATE_START, NULL);
pending_request++;
ethumb_client_file_set(_elm_ethumb_client, sd->file, sd->key);
@@ -383,7 +389,8 @@ _thumbnailing_available_cb(void *data,
static void
_thumb_show(Elm_Thumb_Smart_Data *sd)
{
- evas_object_show(ELM_WIDGET_DATA(sd)->resize_obj);
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+ evas_object_show(wd->resize_obj);
if (elm_thumb_ethumb_client_connected_get())
{
@@ -399,11 +406,11 @@ _thumb_show(Elm_Thumb_Smart_Data *sd)
#endif
static void
-_elm_thumb_smart_show(Evas_Object *obj)
+_elm_thumb_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_THUMB_DATA_GET(obj, sd);
+ Elm_Thumb_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_thumb_parent_sc)->base.show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
#ifdef ELM_ETHUMB
_thumb_show(sd);
@@ -413,13 +420,18 @@ _elm_thumb_smart_show(Evas_Object *obj)
}
static void
-_elm_thumb_smart_hide(Evas_Object *obj)
+_elm_thumb_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_THUMB_DATA_GET(obj, sd);
+#ifdef ELM_ETHUMB
+ Elm_Thumb_Smart_Data *sd = _pd;
+#else
+ (void) _pd;
+#endif
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_thumb_parent_sc)->base.hide(obj);
+ eo_do_super(obj, evas_obj_smart_hide());
- evas_object_hide(ELM_WIDGET_DATA(sd)->resize_obj);
+ evas_object_hide(wd->resize_obj);
#ifdef ELM_ETHUMB
if (sd->thumb.request)
@@ -428,9 +440,9 @@ _elm_thumb_smart_hide(Evas_Object *obj)
sd->thumb.request = NULL;
elm_layout_signal_emit
- (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_SIGNAL_GENERATE_STOP, "elm");
+ (wd->resize_obj, EDJE_SIGNAL_GENERATE_STOP, "elm");
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, SIG_GENERATE_STOP, NULL);
+ (sd->obj, SIG_GENERATE_STOP, NULL);
}
if (sd->thumb.retry)
@@ -519,16 +531,17 @@ elm_need_ethumb(void)
}
static void
-_elm_thumb_smart_add(Evas_Object *obj)
+_elm_thumb_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Thumb_Smart_Data);
+ Elm_Thumb_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_CLASS(_elm_thumb_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_resize_object_set(obj, elm_layout_add(obj));
elm_layout_theme_set
- (ELM_WIDGET_DATA(priv)->resize_obj, "thumb", "base",
+ (wd->resize_obj, "thumb", "base",
elm_widget_style_get(obj));
priv->view = NULL;
@@ -553,9 +566,9 @@ _elm_thumb_smart_add(Evas_Object *obj)
}
static void
-_elm_thumb_smart_del(Evas_Object *obj)
+_elm_thumb_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_THUMB_DATA_GET(obj, sd);
+ Elm_Thumb_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_ETHUMB
if (sd->thumb.request)
@@ -578,57 +591,44 @@ _elm_thumb_smart_del(Evas_Object *obj)
if (sd->eeh) ecore_event_handler_del(sd->eeh);
- ELM_WIDGET_CLASS(_elm_thumb_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_thumb_smart_set_user(Elm_Thumb_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_thumb_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_thumb_smart_del;
-
- ELM_WIDGET_CLASS(sc)->base.show = _elm_thumb_smart_show;
- ELM_WIDGET_CLASS(sc)->base.hide = _elm_thumb_smart_hide;
-}
-
-EAPI const Elm_Thumb_Smart_Class *
-elm_thumb_smart_class_get(void)
-{
- static Elm_Thumb_Smart_Class _sc =
- ELM_THUMB_SMART_CLASS_INIT_NAME_VERSION(ELM_THUMB_SMART_NAME);
- static const Elm_Thumb_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_thumb_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_thumb_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_thumb_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set("Elm_Thumb"),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+ Elm_Thumb_Smart_Data *sd = _pd;
+ sd->obj = obj;
- return obj;
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
elm_thumb_reload(Evas_Object *obj)
{
ELM_THUMB_CHECK(obj);
- ELM_THUMB_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_thumb_reload());
+}
+
+static void
+_reload(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Thumb_Smart_Data *sd = _pd;
eina_stringshare_replace(&(sd->thumb.file), NULL);
eina_stringshare_replace(&(sd->thumb.key), NULL);
@@ -644,10 +644,18 @@ elm_thumb_file_set(Evas_Object *obj,
const char *file,
const char *key)
{
+ ELM_THUMB_CHECK(obj);
+ eo_do(obj, elm_obj_thumb_file_set(file, key));
+}
+
+static void
+_file_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *file = va_arg(*list, const char *);
+ const char *key = va_arg(*list, const char *);
Eina_Bool file_replaced, key_replaced;
- ELM_THUMB_CHECK(obj);
- ELM_THUMB_DATA_GET(obj, sd);
+ Elm_Thumb_Smart_Data *sd = _pd;
file_replaced = eina_stringshare_replace(&(sd->file), file);
key_replaced = eina_stringshare_replace(&(sd->key), key);
@@ -692,7 +700,15 @@ elm_thumb_file_get(const Evas_Object *obj,
const char **key)
{
ELM_THUMB_CHECK(obj);
- ELM_THUMB_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_thumb_file_get(file, key));
+}
+
+static void
+_file_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **file = va_arg(*list, const char **);
+ const char **key = va_arg(*list, const char **);
+ Elm_Thumb_Smart_Data *sd = _pd;
if (file)
*file = sd->file;
@@ -706,7 +722,15 @@ elm_thumb_path_get(const Evas_Object *obj,
const char **key)
{
ELM_THUMB_CHECK(obj);
- ELM_THUMB_DATA_GET(obj, sd);
+ eo_do((Eo *) obj, elm_obj_thumb_path_get(file, key));
+}
+
+static void
+_path_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **file = va_arg(*list, const char **);
+ const char **key = va_arg(*list, const char **);
+ Elm_Thumb_Smart_Data *sd = _pd;
if (file)
*file = sd->thumb.file;
@@ -719,7 +743,14 @@ elm_thumb_animate_set(Evas_Object *obj,
Elm_Thumb_Animation_Setting setting)
{
ELM_THUMB_CHECK(obj);
- ELM_THUMB_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_thumb_animate_set(setting));
+}
+
+static void
+_animate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Thumb_Animation_Setting setting = va_arg(*list, Elm_Thumb_Animation_Setting);
+ Elm_Thumb_Smart_Data *sd = _pd;
EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST);
@@ -736,9 +767,17 @@ EAPI Elm_Thumb_Animation_Setting
elm_thumb_animate_get(const Evas_Object *obj)
{
ELM_THUMB_CHECK(obj) ELM_THUMB_ANIMATION_LAST;
- ELM_THUMB_DATA_GET(obj, sd);
+ Elm_Thumb_Animation_Setting ret;
+ eo_do((Eo *) obj, elm_obj_thumb_animate_get(&ret));
+ return ret;
+}
- return sd->anim_setting;
+static void
+_animate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Thumb_Animation_Setting *ret = va_arg(*list, Elm_Thumb_Animation_Setting *);
+ Elm_Thumb_Smart_Data *sd = _pd;
+ *ret = sd->anim_setting;
}
EAPI void *
@@ -758,25 +797,92 @@ elm_thumb_editable_set(Evas_Object *obj,
Eina_Bool edit)
{
ELM_THUMB_CHECK(obj) EINA_FALSE;
- ELM_THUMB_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_thumb_editable_set(edit, &ret));
+ return ret;
+}
+
+static void
+_editable_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool edit = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Thumb_Smart_Data *sd = _pd;
+ if (ret) *ret = EINA_TRUE;
edit = !!edit;
- if (sd->edit == edit) return EINA_TRUE;
+ if (sd->edit == edit) return;
sd->edit = edit;
if (sd->edit)
elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE, _elm_thumb_dnd_cb, obj);
else
elm_drop_target_del(obj);
-
- return EINA_TRUE;
}
EAPI Eina_Bool
elm_thumb_editable_get(const Evas_Object *obj)
{
ELM_THUMB_CHECK(obj) EINA_FALSE;
- ELM_THUMB_DATA_GET(obj, sd);
+ Eina_Bool ret;
+ eo_do((Eo *) obj, elm_obj_thumb_editable_get(&ret));
+ return ret;
+}
- return sd->edit;
+static void
+_editable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Thumb_Smart_Data *sd = _pd;
+ *ret = sd->edit;
}
+
+static void
+_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_thumb_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_thumb_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_thumb_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_thumb_smart_hide),
+
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_RELOAD), _reload),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_FILE_GET), _file_get),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_PATH_GET), _path_get),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_ANIMATE_SET), _animate_set),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_ANIMATE_GET), _animate_get),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_EDITABLE_SET), _editable_set),
+ EO_OP_FUNC(ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_EDITABLE_GET), _editable_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_RELOAD, "Reload thumbnail if it was generated before."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_FILE_SET, "Set the file that will be used as thumbnail source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_FILE_GET, "Get the image or video path and key used to generate the thumbnail."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_PATH_GET, "Get the path and key to the image or video thumbnail generated by ethumb."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_ANIMATE_SET, "Set the animation state for the thumb object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_ANIMATE_GET, "Get the animation state for the thumb object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_EDITABLE_SET, "Make the thumbnail 'editable'."),
+ EO_OP_DESCRIPTION(ELM_OBJ_THUMB_SUB_ID_EDITABLE_GET, "Make the thumbnail 'editable'."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ "elm_thumb",
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_THUMB_BASE_ID, op_desc, ELM_OBJ_THUMB_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Thumb_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_thumb_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
+
diff --git a/src/lib/elm_thumb.h b/src/lib/elm_thumb.h
index c79e48ac7..28a7299a1 100644
--- a/src/lib/elm_thumb.h
+++ b/src/lib/elm_thumb.h
@@ -51,6 +51,127 @@
* @{
*/
+#define ELM_OBJ_THUMB_CLASS elm_obj_thumb_class_get()
+
+const Eo_Class *elm_obj_thumb_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_THUMB_BASE_ID;
+
+enum
+{
+ ELM_OBJ_THUMB_SUB_ID_RELOAD,
+ ELM_OBJ_THUMB_SUB_ID_FILE_SET,
+ ELM_OBJ_THUMB_SUB_ID_FILE_GET,
+ ELM_OBJ_THUMB_SUB_ID_PATH_GET,
+ ELM_OBJ_THUMB_SUB_ID_ANIMATE_SET,
+ ELM_OBJ_THUMB_SUB_ID_ANIMATE_GET,
+ ELM_OBJ_THUMB_SUB_ID_EDITABLE_SET,
+ ELM_OBJ_THUMB_SUB_ID_EDITABLE_GET,
+ ELM_OBJ_THUMB_SUB_ID_LAST
+};
+
+#define ELM_OBJ_THUMB_ID(sub_id) (ELM_OBJ_THUMB_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_thumb_reload
+ * @since 1.8
+ *
+ * Reload thumbnail if it was generated before.
+ *
+ *
+ * @see elm_thumb_reload
+ */
+#define elm_obj_thumb_reload() ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_RELOAD)
+
+/**
+ * @def elm_obj_thumb_file_set
+ * @since 1.8
+ *
+ * Set the file that will be used as thumbnail source.
+ *
+ * @param[in] file
+ * @param[in] key
+ *
+ * @see elm_thumb_file_set
+ */
+#define elm_obj_thumb_file_set(file, key) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, file), EO_TYPECHECK(const char *, key)
+
+/**
+ * @def elm_obj_thumb_file_get
+ * @since 1.8
+ *
+ * Get the image or video path and key used to generate the thumbnail.
+ *
+ * @param[out] file
+ * @param[out] key
+ *
+ * @see elm_thumb_file_get
+ */
+#define elm_obj_thumb_file_get(file, key) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, key)
+
+/**
+ * @def elm_obj_thumb_path_get
+ * @since 1.8
+ *
+ * Get the path and key to the image or video thumbnail generated by ethumb.
+ *
+ * @param[out] file
+ * @param[out] key
+ *
+ * @see elm_thumb_path_get
+ */
+#define elm_obj_thumb_path_get(file, key) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_PATH_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, key)
+
+/**
+ * @def elm_obj_thumb_animate_set
+ * @since 1.8
+ *
+ * Set the animation state for the thumb object. If its content is an animated
+ *
+ * @param[in] setting
+ *
+ * @see elm_thumb_animate_set
+ */
+#define elm_obj_thumb_animate_set(setting) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_ANIMATE_SET), EO_TYPECHECK(Elm_Thumb_Animation_Setting, setting)
+
+/**
+ * @def elm_obj_thumb_animate_get
+ * @since 1.8
+ *
+ * Get the animation state for the thumb object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_thumb_animate_get
+ */
+#define elm_obj_thumb_animate_get(ret) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_ANIMATE_GET), EO_TYPECHECK(Elm_Thumb_Animation_Setting *, ret)
+
+/**
+ * @def elm_obj_thumb_editable_set
+ * @since 1.8
+ *
+ * Make the thumbnail 'editable'.
+ *
+ * @param[in] edit
+ * @param[out] ret
+ *
+ * @see elm_thumb_editable_set
+ */
+#define elm_obj_thumb_editable_set(edit, ret) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_EDITABLE_SET), EO_TYPECHECK(Eina_Bool, edit), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_thumb_editable_get
+ * @since 1.8
+ *
+ * Make the thumbnail 'editable'.
+ *
+ * @param[out] ret
+ *
+ * @see elm_thumb_editable_get
+ */
+#define elm_obj_thumb_editable_get(ret) ELM_OBJ_THUMB_ID(ELM_OBJ_THUMB_SUB_ID_EDITABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
/**
* @enum Elm_Thumb_Animation_Setting
* @typedef Elm_Thumb_Animation_Setting
diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c
index 0fd97dc8c..810dc423f 100644
--- a/src/lib/elm_toolbar.c
+++ b/src/lib/elm_toolbar.c
@@ -2,7 +2,11 @@
#include "elm_priv.h"
#include "elm_widget_toolbar.h"
-EAPI const char ELM_TOOLBAR_SMART_NAME[] = "elm_toolbar";
+EAPI Eo_Op ELM_OBJ_TOOLBAR_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_TOOLBAR_CLASS
+
+#define MY_CLASS_NAME "elm_toolbar"
#define ELM_TOOLBAR_ITEM_FROM_INLIST(item) \
((item) ? EINA_INLIST_CONTAINER_GET(item, Elm_Toolbar_Item) : NULL)
@@ -19,16 +23,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-static const Evas_Smart_Interface *_smart_interfaces[] =
-{
- (Evas_Smart_Interface *)&ELM_SCROLLABLE_IFACE, NULL
-};
-
-EVAS_SMART_SUBCLASS_IFACE_NEW
- (ELM_TOOLBAR_SMART_NAME, _elm_toolbar, Elm_Toolbar_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks,
- _smart_interfaces);
-
static int
_toolbar_item_prio_compare_cb(const void *i1,
const void *i2)
@@ -187,8 +181,8 @@ _item_show(Elm_Toolbar_Item *it)
evas_object_geometry_get(sd->bx, &bx, &by, NULL, NULL);
evas_object_geometry_get(VIEW(it), &x, &y, &w, &h);
- sd->s_iface->content_region_show
- (ELM_WIDGET_DATA(sd)->obj, x - bx, y - by, w, h);
+ eo_do(WIDGET(it), elm_scrollable_interface_content_region_show
+ (x - bx, y - by, w, h));
}
static void
@@ -279,7 +273,8 @@ _elm_toolbar_item_coordinates_calc(Elm_Object_Item *item,
ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
- sd->s_iface->content_viewport_size_get(WIDGET(item), &vw, &vh);
+ eo_do(WIDGET(item),
+ elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
evas_object_geometry_get(sd->bx, &bx, &by, NULL, NULL);
evas_object_geometry_get(VIEW(item), &ix, &iy, &iw, &ih);
@@ -332,7 +327,7 @@ _resize_job(void *data)
ELM_TOOLBAR_DATA_GET(obj, sd);
sd->resize_job = NULL;
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
evas_object_size_hint_min_get(sd->bx, &mw, &mh);
evas_object_geometry_get(sd->bx, NULL, NULL, &w, &h);
@@ -492,12 +487,14 @@ _resize_job(void *data)
if (sd->vertical)
{
if (h > vh) _items_size_fit(obj, &h, vh);
- sd->s_iface->paging_set(obj, 0.0, 0.0, 0, (h / (sd->item_count - sd->separator_count)));
+ eo_do(obj,
+ elm_scrollable_interface_paging_set(0.0, 0.0, 0, (h / (sd->item_count - sd->separator_count))));
}
else
{
if (w > vw) _items_size_fit(obj, &w, vw);
- sd->s_iface->paging_set(obj, 0.0, 0.0, (w / (sd->item_count - sd->separator_count)), 0);
+ eo_do(obj,
+ elm_scrollable_interface_paging_set(0.0, 0.0, (w / (sd->item_count - sd->separator_count)), 0));
}
}
else
@@ -559,32 +556,36 @@ _resize_job(void *data)
_mirrored_set(obj, elm_widget_mirrored_get(obj));
}
-static Eina_Bool
-_elm_toolbar_smart_on_focus(Evas_Object *obj)
+static void
+_elm_toolbar_smart_on_focus(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
if (elm_widget_focus_get(obj))
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
else
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_toolbar_smart_event(Evas_Object *obj __UNUSED__,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type __UNUSED__,
- void *event_info)
+static void
+_elm_toolbar_smart_event(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ (void) type;
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
//TODO: Key Down Event precess for toolbar
-
- return EINA_FALSE;
}
static void
@@ -644,10 +645,11 @@ end:
}
static int
-_elm_toolbar_icon_size_get(Elm_Toolbar_Smart_Data *sd)
+_elm_toolbar_icon_size_get(Evas_Object *obj)
{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
const char *icon_size = edje_object_data_get
- (ELM_WIDGET_DATA(sd)->resize_obj, "icon_size");
+ (wd->resize_obj, "icon_size");
if (icon_size) return atoi(icon_size);
@@ -921,19 +923,20 @@ _sizing_eval(Evas_Object *obj)
Evas_Coord w, h;
ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
evas_object_smart_need_recalculate_set(sd->bx, EINA_TRUE);
evas_object_smart_calculate(sd->bx);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
+ edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
if (w < minw) w = minw;
if (h < minh) h = minh;
- evas_object_resize(ELM_WIDGET_DATA(sd)->resize_obj, w, h);
+ evas_object_resize(wd->resize_obj, w, h);
evas_object_size_hint_min_get(sd->bx, &minw_bx, &minh_bx);
- sd->s_iface->content_viewport_size_get(obj, &vw, &vh);
+ eo_do(obj, elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_NONE)
{
@@ -985,22 +988,29 @@ _sizing_eval(Evas_Object *obj)
_inform_item_number(obj);
}
-static Eina_Bool
-_elm_toolbar_smart_theme(Evas_Object *obj)
+static void
+_elm_toolbar_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Elm_Toolbar_Item *it;
double scale = 0;
+ Elm_Toolbar_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
if (sd->on_deletion)
- return EINA_TRUE;
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
- if (!ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->theme(obj))
- return EINA_FALSE;
+ Eina_Bool int_ret;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(sd)->resize_obj, "toolbar", "base",
+ (obj, wd->resize_obj, "toolbar", "base",
elm_widget_style_get(obj));
elm_layout_theme_set
@@ -1008,7 +1018,7 @@ _elm_toolbar_smart_theme(Evas_Object *obj)
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- sd->theme_icon_size = _elm_toolbar_icon_size_get(sd);
+ sd->theme_icon_size = _elm_toolbar_icon_size_get(obj);
if (sd->priv_icon_size) sd->icon_size = sd->priv_icon_size;
else sd->icon_size = sd->theme_icon_size;
@@ -1020,7 +1030,7 @@ _elm_toolbar_smart_theme(Evas_Object *obj)
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -1212,12 +1222,13 @@ _item_content_unset_hook(Elm_Object_Item *it,
return o;
}
-static Eina_Bool
-_elm_toolbar_smart_translate(Evas_Object *obj)
+static void
+_elm_toolbar_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -1393,7 +1404,7 @@ _mouse_up_reorder(Elm_Toolbar_Item *it,
}
}
- sd->s_iface->hold_set(obj, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE));
}
static void
@@ -1481,7 +1492,7 @@ _item_reorder_start(Elm_Toolbar_Item *item)
evas_object_move(VIEW(it), x, y);
evas_object_show(VIEW(it));
- sd->s_iface->hold_set(WIDGET(it), EINA_TRUE);
+ eo_do(WIDGET(it), elm_scrollable_interface_hold_set(EINA_TRUE));
}
static Eina_Bool
@@ -1669,7 +1680,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
_item_del(item);
if (item != sd->more_item)
- _elm_toolbar_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
return EINA_TRUE;
}
@@ -2116,17 +2127,18 @@ _elm_toolbar_action_down_cb(void *data,
}
static void
-_elm_toolbar_smart_add(Evas_Object *obj)
+_elm_toolbar_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Toolbar_Smart_Data);
+ Elm_Toolbar_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj =
+ wd->resize_obj =
edje_object_add(evas_object_evas_get(obj));
- ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_theme_object_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, "toolbar", "base",
+ (obj, wd->resize_obj, "toolbar", "base",
elm_widget_style_get(obj));
priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
@@ -2140,38 +2152,35 @@ _elm_toolbar_smart_add(Evas_Object *obj)
elm_widget_can_focus_set(obj, EINA_TRUE);
- priv->s_iface = evas_object_smart_interface_get
- (obj, ELM_SCROLLABLE_IFACE_NAME);
-
- priv->s_iface->objects_set
- (obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
+ eo_do(obj, elm_scrollable_interface_objects_set(wd->resize_obj, priv->hit_rect));
priv->more_item = NULL;
priv->selected_item = NULL;
priv->standard_priority = -99999;
- priv->s_iface->bounce_allow_set
- (obj, _elm_config->thumbscroll_bounce_enable, EINA_FALSE);
- priv->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
- priv->s_iface->drag_start_cb_set(obj, _drag_start_cb);
+ eo_do(obj,
+ elm_scrollable_interface_bounce_allow_set
+ (_elm_config->thumbscroll_bounce_enable, EINA_FALSE),
+ elm_scrollable_interface_policy_set
+ (ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF),
+ elm_scrollable_interface_drag_start_cb_set(_drag_start_cb));
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,left", "elm",
+ (wd->resize_obj, "elm,action,left", "elm",
_elm_toolbar_action_left_cb, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,right", "elm",
+ (wd->resize_obj, "elm,action,right", "elm",
_elm_toolbar_action_right_cb, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,up", "elm",
+ (wd->resize_obj, "elm,action,up", "elm",
_elm_toolbar_action_up_cb, obj);
edje_object_signal_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "elm,action,down", "elm",
+ (wd->resize_obj, "elm,action,down", "elm",
_elm_toolbar_action_down_cb, obj);
priv->shrink_mode = ELM_TOOLBAR_SHRINK_NONE;
priv->priv_icon_size = 0; // unset
- priv->theme_icon_size = _elm_toolbar_icon_size_get(priv);
+ priv->theme_icon_size = _elm_toolbar_icon_size_get(obj);
if (priv->priv_icon_size) priv->icon_size = priv->priv_icon_size;
else priv->icon_size = priv->theme_icon_size;
@@ -2182,7 +2191,7 @@ _elm_toolbar_smart_add(Evas_Object *obj)
evas_object_size_hint_align_set(priv->bx, priv->align, 0.5);
evas_object_box_layout_set(priv->bx, _layout, obj, NULL);
elm_widget_sub_object_add(obj, priv->bx);
- priv->s_iface->content_set(obj, priv->bx);
+ eo_do(obj, elm_scrollable_interface_content_set(priv->bx));
evas_object_show(priv->bx);
priv->more = elm_layout_add(obj);
@@ -2217,11 +2226,11 @@ _elm_toolbar_smart_add(Evas_Object *obj)
}
static void
-_elm_toolbar_smart_del(Evas_Object *obj)
+_elm_toolbar_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
Elm_Toolbar_Item *it, *next;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
sd->on_deletion = EINA_TRUE;
@@ -2248,40 +2257,40 @@ _elm_toolbar_smart_del(Evas_Object *obj)
sd->long_timer = NULL;
}
- ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
-_elm_toolbar_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_toolbar_smart_move(Eo *obj, void *_pd, va_list *list)
{
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
evas_object_move(sd->hit_rect, x, y);
}
static void
-_elm_toolbar_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_toolbar_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->base.resize(obj, w, h);
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
evas_object_resize(sd->hit_rect, w, h);
}
static void
-_elm_toolbar_smart_member_add(Evas_Object *obj,
- Evas_Object *member)
+_elm_toolbar_smart_member_add(Eo *obj, void *_pd, va_list *list)
{
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Evas_Object *member = va_arg(*list, Evas_Object *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- ELM_WIDGET_CLASS(_elm_toolbar_parent_sc)->base.member_add(obj, member);
+ eo_do_super(obj, evas_obj_smart_member_add(member));
if (sd->hit_rect)
evas_object_raise(sd->hit_rect);
@@ -2310,14 +2319,26 @@ _access_item_find_append(const Evas_Object *obj,
return items;
}
-static Eina_Bool
-_elm_toolbar_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static Eina_Bool _elm_toolbar_smart_focus_next_enable = EINA_FALSE;
+
+static void
+_elm_toolbar_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = _elm_toolbar_smart_focus_next_enable;
+}
+
+static void
+_elm_toolbar_smart_focus_next(Eo *obj, void *_pd, va_list *list)
{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Eina_List *items = NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->more_item && sd->more_item->selected)
{
@@ -2334,7 +2355,7 @@ _elm_toolbar_smart_focus_next(const Evas_Object *obj,
items = eina_list_append(items, sd->more_item->base.access_obj);
}
- return elm_widget_focus_list_next_get
+ if (ret) *ret = elm_widget_focus_list_next_get
(obj, items, eina_list_data_get, dir, next);
}
@@ -2351,71 +2372,33 @@ _access_obj_process(Elm_Toolbar_Smart_Data * sd, Eina_Bool is_access)
}
static void
-_elm_toolbar_smart_access(Evas_Object *obj, Eina_Bool is_access)
-{
- ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
-
- if (is_access)
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next =
- _elm_toolbar_smart_focus_next;
- else
- ELM_WIDGET_CLASS(ELM_WIDGET_DATA(sd)->api)->focus_next = NULL;
- _access_obj_process(sd, is_access);
-}
-
-static void
-_elm_toolbar_smart_set_user(Elm_Toolbar_Smart_Class *sc)
+_elm_toolbar_smart_access(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_toolbar_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_toolbar_smart_del;
- ELM_WIDGET_CLASS(sc)->base.move = _elm_toolbar_smart_move;
- ELM_WIDGET_CLASS(sc)->base.resize = _elm_toolbar_smart_resize;
- ELM_WIDGET_CLASS(sc)->base.member_add = _elm_toolbar_smart_member_add;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_toolbar_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->event = _elm_toolbar_smart_event;
- ELM_WIDGET_CLASS(sc)->theme = _elm_toolbar_smart_theme;
- ELM_WIDGET_CLASS(sc)->translate = _elm_toolbar_smart_translate;
-
- if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
- ELM_WIDGET_CLASS(sc)->focus_next = _elm_toolbar_smart_focus_next;
-
- ELM_WIDGET_CLASS(sc)->access = _elm_toolbar_smart_access;
-}
-
-EAPI const Elm_Toolbar_Smart_Class *
-elm_toolbar_smart_class_get(void)
-{
- static Elm_Toolbar_Smart_Class _sc =
- ELM_TOOLBAR_SMART_CLASS_INIT_NAME_VERSION(ELM_TOOLBAR_SMART_NAME);
- static const Elm_Toolbar_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class)
- return class;
-
- _elm_toolbar_smart_set(&_sc);
- esc->callbacks = _smart_callbacks;
- class = &_sc;
-
- return class;
+ Elm_Toolbar_Smart_Data *sd = _pd;
+ _elm_toolbar_smart_focus_next_enable = va_arg(*list, int);
+ _access_obj_process(sd, _elm_toolbar_smart_focus_next_enable);
}
EAPI Evas_Object *
elm_toolbar_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_toolbar_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
}
EAPI void
@@ -2423,7 +2406,14 @@ elm_toolbar_icon_size_set(Evas_Object *obj,
int icon_size)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_icon_size_set(icon_size));
+}
+
+static void
+_icon_size_set(Eo *obj, void *_pd, va_list *list)
+{
+ int icon_size = va_arg(*list, int);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->priv_icon_size == icon_size) return;
sd->priv_icon_size = icon_size;
@@ -2431,16 +2421,24 @@ elm_toolbar_icon_size_set(Evas_Object *obj,
if (sd->priv_icon_size) sd->icon_size = sd->priv_icon_size;
else sd->icon_size = sd->theme_icon_size;
- _elm_toolbar_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
EAPI int
elm_toolbar_icon_size_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) 0;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_toolbar_icon_size_get(&ret));
+ return ret;
+}
- return sd->priv_icon_size;
+static void
+_icon_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+ *ret = sd->priv_icon_size;
}
EAPI Elm_Object_Item *
@@ -2450,14 +2448,29 @@ elm_toolbar_item_append(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_TOOLBAR_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_toolbar_item_append(icon, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_append(Eo *obj, void *_pd, va_list *list)
+{
+ const char *icon = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ if (ret) *ret = NULL;
+
Elm_Toolbar_Item *it;
double scale;
- ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
it = _item_new(obj, icon, label, func, data);
- if (!it) return NULL;
+ if (!it) return;
scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
sd->items = eina_inlist_append(sd->items, EINA_INLIST_GET(it));
@@ -2468,7 +2481,7 @@ elm_toolbar_item_append(Evas_Object *obj,
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2478,14 +2491,29 @@ elm_toolbar_item_prepend(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_TOOLBAR_CHECK(obj) NULL;
+ Elm_Object_Item *ret;
+ eo_do(obj, elm_obj_toolbar_item_prepend(icon, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_prepend(Eo *obj, void *_pd, va_list *list)
+{
+ const char *icon = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ if (ret) *ret = NULL;
+
Elm_Toolbar_Item *it;
double scale;
- ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
it = _item_new(obj, icon, label, func, data);
- if (!it) return NULL;
+ if (!it) return;
scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
sd->items = eina_inlist_prepend(sd->items, EINA_INLIST_GET(it));
@@ -2495,7 +2523,7 @@ elm_toolbar_item_prepend(Evas_Object *obj,
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2506,16 +2534,33 @@ elm_toolbar_item_insert_before(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_TOOLBAR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_toolbar_item_insert_before(before, icon, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_before(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *before = va_arg(*list, Elm_Object_Item *);
+ const char *icon = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+
+ if (ret) *ret = NULL;
+
Elm_Toolbar_Item *it, *_before;
double scale;
- ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(before, NULL);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ ELM_TOOLBAR_ITEM_CHECK(before);
+ Elm_Toolbar_Smart_Data *sd = _pd;
_before = (Elm_Toolbar_Item *)before;
it = _item_new(obj, icon, label, func, data);
- if (!it) return NULL;
+ if (!it) return;
scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
sd->items = eina_inlist_prepend_relative
@@ -2526,7 +2571,7 @@ elm_toolbar_item_insert_before(Evas_Object *obj,
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
@@ -2537,16 +2582,32 @@ elm_toolbar_item_insert_after(Evas_Object *obj,
Evas_Smart_Cb func,
const void *data)
{
+ ELM_TOOLBAR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do(obj, elm_obj_toolbar_item_insert_after(after, icon, label, func, data, &ret));
+ return ret;
+}
+
+static void
+_item_insert_after(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Object_Item *after = va_arg(*list, Elm_Object_Item *);
+ const char *icon = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+ Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
+ const void *data = va_arg(*list, const void *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ if (ret) *ret = NULL;
+
Elm_Toolbar_Item *it, *_after;
double scale;
- ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(after, NULL);
+ ELM_TOOLBAR_ITEM_CHECK(after);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
_after = (Elm_Toolbar_Item *)after;
it = _item_new(obj, icon, label, func, data);
- if (!it) return NULL;
+ if (!it) return;
scale = (elm_widget_scale_get(obj) * elm_config_scale_get());
sd->items = eina_inlist_append_relative
@@ -2557,28 +2618,48 @@ elm_toolbar_item_insert_after(Evas_Object *obj,
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
elm_toolbar_first_item_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_first_item_get(&ret));
+ return ret;
+}
+
+static void
+_first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Toolbar_Smart_Data *sd = _pd;
- if (!sd->items) return NULL;
- return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items);
+ if (!sd->items) return;
+ *ret = (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items);
}
EAPI Elm_Object_Item *
elm_toolbar_last_item_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_last_item_get(&ret));
+ return ret;
+}
- if (!sd->items) return NULL;
+static void
+_last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
+ Elm_Toolbar_Smart_Data *sd = _pd;
- return (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items->last);
+ if (!sd->items) return;
+
+ *ret = (Elm_Object_Item *)ELM_TOOLBAR_ITEM_FROM_INLIST(sd->items->last);
}
EAPI Elm_Object_Item *
@@ -2624,18 +2705,30 @@ EAPI Elm_Object_Item *
elm_toolbar_item_find_by_label(const Evas_Object *obj,
const char *label)
{
+ ELM_TOOLBAR_CHECK(obj) NULL;
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_item_find_by_label(label, &ret));
+ return ret;
+}
+
+static void
+_item_find_by_label(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *label = va_arg(*list, const char *);
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ *ret = NULL;
Elm_Toolbar_Item *it;
- ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
EINA_INLIST_FOREACH(sd->items, it)
{
if (!strcmp(it->label, label))
- return (Elm_Object_Item *)it;
+ {
+ *ret = (Elm_Object_Item *)it;
+ return;
+ }
}
-
- return NULL;
}
EAPI void
@@ -2663,18 +2756,36 @@ EAPI Elm_Object_Item *
elm_toolbar_selected_item_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_selected_item_get(&ret));
+ return ret;
+}
- return (Elm_Object_Item *)sd->selected_item;
+static void
+_selected_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = (Elm_Object_Item *)sd->selected_item;
}
EAPI Elm_Object_Item *
elm_toolbar_more_item_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Object_Item *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_more_item_get(&ret));
+ return ret;
+}
+
+static void
+_more_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- return (Elm_Object_Item *)sd->more_item;
+ *ret = (Elm_Object_Item *)sd->more_item;
}
EAPI void
@@ -2832,16 +2943,23 @@ EAPI void
elm_toolbar_shrink_mode_set(Evas_Object *obj,
Elm_Toolbar_Shrink_Mode shrink_mode)
{
+ ELM_TOOLBAR_CHECK(obj);
+ eo_do(obj, elm_obj_toolbar_shrink_mode_set(shrink_mode));
+}
+
+static void
+_shrink_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Toolbar_Shrink_Mode shrink_mode = va_arg(*list, Elm_Toolbar_Shrink_Mode);
Eina_Bool bounce;
- ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->shrink_mode == shrink_mode) return;
sd->shrink_mode = shrink_mode;
bounce = (_elm_config->thumbscroll_bounce_enable) &&
(shrink_mode == ELM_TOOLBAR_SHRINK_SCROLL);
- sd->s_iface->bounce_allow_set(obj, bounce, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_bounce_allow_set(bounce, EINA_FALSE));
if (sd->more_item)
{
@@ -2852,26 +2970,26 @@ elm_toolbar_shrink_mode_set(Evas_Object *obj,
if (shrink_mode == ELM_TOOLBAR_SHRINK_MENU)
{
elm_toolbar_homogeneous_set(obj, EINA_FALSE);
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set
+ (ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF));
sd->more_item = _item_new(obj, "more_menu", "More", NULL, NULL);
}
else if (shrink_mode == ELM_TOOLBAR_SHRINK_HIDE)
{
elm_toolbar_homogeneous_set(obj, EINA_FALSE);
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set
+ (ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF));
}
else if (shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND)
{
elm_toolbar_homogeneous_set(obj, EINA_FALSE);
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set
+ (ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF));
sd->more_item = _item_new(obj, "more_menu", "More", NULL, NULL);
}
else
- sd->s_iface->policy_set
- (obj, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF);
+ eo_do(obj, elm_scrollable_interface_policy_set
+ (ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF));
_sizing_eval(obj);
}
@@ -2880,9 +2998,18 @@ EAPI Elm_Toolbar_Shrink_Mode
elm_toolbar_shrink_mode_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) ELM_TOOLBAR_SHRINK_NONE;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Shrink_Mode ret = ELM_TOOLBAR_SHRINK_NONE;
+ eo_do((Eo *) obj, elm_obj_toolbar_shrink_mode_get(&ret));
+ return ret;
+}
- return sd->shrink_mode;
+static void
+_shrink_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Toolbar_Shrink_Mode *ret = va_arg(*list, Elm_Toolbar_Shrink_Mode *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = sd->shrink_mode;
}
EAPI void
@@ -2911,7 +3038,14 @@ elm_toolbar_homogeneous_set(Evas_Object *obj,
Eina_Bool homogeneous)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_homogeneous_set(homogeneous));
+}
+
+static void
+_homogeneous_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool homogeneous = va_arg(*list, int);
+ Elm_Toolbar_Smart_Data *sd = _pd;
homogeneous = !!homogeneous;
if (homogeneous == sd->homogeneous) return;
@@ -2924,19 +3058,35 @@ EAPI Eina_Bool
elm_toolbar_homogeneous_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) EINA_FALSE;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_toolbar_homogeneous_get(&ret));
+ return ret;
+}
- return sd->homogeneous;
+static void
+_homogeneous_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = sd->homogeneous;
}
EAPI void
elm_toolbar_menu_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
+ ELM_TOOLBAR_CHECK(obj);
+ eo_do(obj, elm_obj_toolbar_menu_parent_set(parent));
+}
+
+static void
+_menu_parent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
Elm_Toolbar_Item *it;
- ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
EINA_SAFETY_ON_NULL_RETURN(parent);
sd->menu_parent = parent;
@@ -2953,9 +3103,18 @@ EAPI Evas_Object *
elm_toolbar_menu_parent_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) NULL;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_toolbar_menu_parent_get(&ret));
+ return ret;
+}
+
+static void
+_menu_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- return sd->menu_parent;
+ *ret = sd->menu_parent;
}
EAPI void
@@ -2963,7 +3122,14 @@ elm_toolbar_align_set(Evas_Object *obj,
double align)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_align_set(align));
+}
+
+static void
+_align_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double align = va_arg(*list, double);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->vertical)
{
@@ -2982,9 +3148,18 @@ EAPI double
elm_toolbar_align_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) 0.0;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_toolbar_align_get(&ret));
+ return ret;
+}
+
+static void
+_align_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- return sd->align;
+ *ret = sd->align;
}
EAPI void
@@ -3214,10 +3389,17 @@ EAPI void
elm_toolbar_icon_order_lookup_set(Evas_Object *obj,
Elm_Icon_Lookup_Order order)
{
+ ELM_TOOLBAR_CHECK(obj);
+ eo_do(obj, elm_obj_toolbar_icon_order_lookup_set(order));
+}
+
+static void
+_icon_order_lookup_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Icon_Lookup_Order order = va_arg(*list, Elm_Icon_Lookup_Order);
Elm_Toolbar_Item *it;
- ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->lookup_order == order) return;
sd->lookup_order = order;
@@ -3231,9 +3413,18 @@ EAPI Elm_Icon_Lookup_Order
elm_toolbar_icon_order_lookup_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) ELM_ICON_LOOKUP_THEME_FDO;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Icon_Lookup_Order ret = ELM_ICON_LOOKUP_THEME_FDO;
+ eo_do((Eo *) obj, elm_obj_toolbar_icon_order_lookup_get(&ret));
+ return ret;
+}
+
+static void
+_icon_order_lookup_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Icon_Lookup_Order *ret = va_arg(*list, Elm_Icon_Lookup_Order *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
- return sd->lookup_order;
+ *ret = sd->lookup_order;
}
EAPI void
@@ -3241,7 +3432,14 @@ elm_toolbar_horizontal_set(Evas_Object *obj,
Eina_Bool horizontal)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_horizontal_set(horizontal));
+}
+
+static void
+_horizontal_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool horizontal = va_arg(*list, int);
+ Elm_Toolbar_Smart_Data *sd = _pd;
horizontal = !!horizontal;
if (!horizontal == sd->vertical) return;
@@ -3258,18 +3456,36 @@ EAPI Eina_Bool
elm_toolbar_horizontal_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) EINA_FALSE;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_toolbar_horizontal_get(&ret));
+ return ret;
+}
- return !sd->vertical;
+static void
+_horizontal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = !sd->vertical;
}
EAPI unsigned int
elm_toolbar_items_count(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) 0;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ unsigned int ret = 0;
+ eo_do((Eo *) obj, elm_obj_toolbar_items_count(&ret));
+ return ret;
+}
- return sd->item_count;
+static void
+_items_count(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = sd->item_count;
}
EAPI void
@@ -3277,7 +3493,14 @@ elm_toolbar_standard_priority_set(Evas_Object *obj,
int priority)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_standard_priority_set(priority));
+}
+
+static void
+_standard_priority_set(Eo *obj, void *_pd, va_list *list)
+{
+ int priority = va_arg(*list, int);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (sd->standard_priority == priority) return;
sd->standard_priority = priority;
@@ -3288,9 +3511,18 @@ EAPI int
elm_toolbar_standard_priority_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) 0;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_toolbar_standard_priority_get(&ret));
+ return ret;
+}
- return sd->standard_priority;
+static void
+_standard_priority_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = sd->standard_priority;
}
EAPI void
@@ -3298,7 +3530,14 @@ elm_toolbar_select_mode_set(Evas_Object *obj,
Elm_Object_Select_Mode mode)
{
ELM_TOOLBAR_CHECK(obj);
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_toolbar_select_mode_set(mode));
+}
+
+static void
+_select_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode mode = va_arg(*list, Elm_Object_Select_Mode);
+ Elm_Toolbar_Smart_Data *sd = _pd;
if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
return;
@@ -3318,9 +3557,18 @@ EAPI Elm_Object_Select_Mode
elm_toolbar_select_mode_get(const Evas_Object *obj)
{
ELM_TOOLBAR_CHECK(obj) ELM_OBJECT_SELECT_MODE_MAX;
- ELM_TOOLBAR_DATA_GET(obj, sd);
+ Elm_Object_Select_Mode ret = ELM_OBJECT_SELECT_MODE_MAX;
+ eo_do((Eo *) obj, elm_obj_toolbar_select_mode_get(&ret));
+ return ret;
+}
- return sd->select_mode;
+static void
+_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *);
+ Elm_Toolbar_Smart_Data *sd = _pd;
+
+ *ret = sd->select_mode;
}
EAPI void
@@ -3349,10 +3597,10 @@ elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type)
Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it);
- ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
if (_elm_toolbar_item_coordinates_calc(it, type, &x, &y, &w, &h))
- sd->s_iface->content_region_show(WIDGET(item), x, y, w, h);
+ eo_do(WIDGET(item), elm_scrollable_interface_content_region_show
+ (x, y, w, h));
}
EAPI void
@@ -3362,8 +3610,106 @@ elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type ty
Elm_Toolbar_Item *item = (Elm_Toolbar_Item *)it;
ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it);
- ELM_TOOLBAR_DATA_GET(WIDGET(item), sd);
if (_elm_toolbar_item_coordinates_calc(it, type, &x, &y, &w, &h))
- sd->s_iface->region_bring_in(WIDGET(item), x, y, w, h);
+ eo_do(WIDGET(item), elm_scrollable_interface_region_bring_in
+ (x, y, w, h));
}
+
+static void
+_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_MEMBER_ADD), _elm_toolbar_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_toolbar_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_toolbar_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_toolbar_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_toolbar_smart_move),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_toolbar_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_toolbar_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_toolbar_smart_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_toolbar_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_toolbar_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_toolbar_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_toolbar_smart_access),
+
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_SET), _icon_size_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_GET), _icon_size_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_APPEND), _item_append),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_PREPEND), _item_prepend),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_BEFORE), _item_insert_before),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_AFTER), _item_insert_after),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_FIRST_ITEM_GET), _first_item_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_LAST_ITEM_GET), _last_item_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_FIND_BY_LABEL), _item_find_by_label),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECTED_ITEM_GET), _selected_item_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MORE_ITEM_GET), _more_item_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_SET), _shrink_mode_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_GET), _shrink_mode_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_SET), _homogeneous_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_GET), _homogeneous_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_SET), _menu_parent_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_GET), _menu_parent_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_SET), _align_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_GET), _align_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_SET), _icon_order_lookup_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_GET), _icon_order_lookup_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_SET), _horizontal_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_GET), _horizontal_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEMS_COUNT), _items_count),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_SET), _standard_priority_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_GET), _standard_priority_get),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_SET), _select_mode_set),
+ EO_OP_FUNC(ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_GET), _select_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_SET, "Set the icon size, in pixels, to be used by toolbar items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_GET, "Get the icon size, in pixels, to be used by toolbar items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_APPEND, "Append item to the toolbar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_PREPEND, "Prepend item to the toolbar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_BEFORE, "Insert a new item into the toolbar object before item before."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_AFTER, "Insert a new item into the toolbar object after item after."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_FIRST_ITEM_GET, "Get the first item in the given toolbar widget's list of items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_LAST_ITEM_GET, "Get the last item in the given toolbar widget's list of items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_FIND_BY_LABEL, "Returns a pointer to a toolbar item by its label."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_SELECTED_ITEM_GET, "Get the selected item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_MORE_ITEM_GET, "Get the more item."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_SET, "Set the item displaying mode of a given toolbar widget obj."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_GET, "Get the shrink mode of toolbar obj."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_SET, "Enable/disable homogeneous mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_GET, "Get whether the homogeneous mode is enabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_SET, "Set the parent object of the toolbar items' menus."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_GET, "Get the parent object of the toolbar items' menus."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_SET, "Set the alignment of the items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_GET, "Get the alignment of the items."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_SET, "Sets icon lookup order, for toolbar items' icons."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_GET, "Gets the icon lookup order."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_SET, "Change a toolbar's orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_GET, "Get a toolbar's orientation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_ITEMS_COUNT, "Get the number of items in a toolbar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_SET, "Set the standard priority of visible items in a toolbar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_GET, "Get the standard_priority of visible items in a toolbar."),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_SET, "Set the toolbar select mode"),
+ EO_OP_DESCRIPTION(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_GET, "Get the toolbar select mode"),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_TOOLBAR_BASE_ID, op_desc, ELM_OBJ_TOOLBAR_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Toolbar_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_toolbar_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, ELM_SCROLLABLE_INTERFACE, NULL);
diff --git a/src/lib/elm_toolbar.h b/src/lib/elm_toolbar.h
index b0a855ea9..cea342a41 100644
--- a/src/lib/elm_toolbar.h
+++ b/src/lib/elm_toolbar.h
@@ -989,6 +989,384 @@ elm_toolbar_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode);
EAPI Elm_Object_Select_Mode
elm_toolbar_select_mode_get(const Evas_Object *obj);
+#define ELM_OBJ_TOOLBAR_CLASS elm_obj_toolbar_class_get()
+
+const Eo_Class *elm_obj_toolbar_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_TOOLBAR_BASE_ID;
+
+enum
+{
+ ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEM_APPEND,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEM_PREPEND,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_BEFORE,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_AFTER,
+ ELM_OBJ_TOOLBAR_SUB_ID_FIRST_ITEM_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_LAST_ITEM_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEM_FIND_BY_LABEL,
+ ELM_OBJ_TOOLBAR_SUB_ID_SELECTED_ITEM_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_MORE_ITEM_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_ITEMS_COUNT,
+ ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_SET,
+ ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_GET,
+ ELM_OBJ_TOOLBAR_SUB_ID_LAST
+};
+
+#define ELM_OBJ_TOOLBAR_ID(sub_id) (ELM_OBJ_TOOLBAR_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_toolbar_icon_size_set
+ * @since 1.8
+ *
+ * Set the icon size, in pixels, to be used by toolbar items.
+ *
+ * @param[in] icon_size
+ *
+ * @see elm_toolbar_icon_size_set
+ */
+#define elm_obj_toolbar_icon_size_set(icon_size) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_SET), EO_TYPECHECK(int, icon_size)
+
+/**
+ * @def elm_obj_toolbar_icon_size_get
+ * @since 1.8
+ *
+ * Get the icon size, in pixels, to be used by toolbar items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_icon_size_get
+ */
+#define elm_obj_toolbar_icon_size_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_SIZE_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_toolbar_item_append
+ * @since 1.8
+ *
+ * Append item to the toolbar.
+ *
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_toolbar_item_append
+ */
+#define elm_obj_toolbar_item_append(icon, label, func, data, ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_item_prepend
+ * @since 1.8
+ *
+ * Prepend item to the toolbar.
+ *
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_toolbar_item_prepend
+ */
+#define elm_obj_toolbar_item_prepend(icon, label, func, data, ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_PREPEND), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_item_insert_before
+ * @since 1.8
+ *
+ * Insert a new item into the toolbar object before item before.
+ *
+ * @param[in] before
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_toolbar_item_insert_before
+ */
+#define elm_obj_toolbar_item_insert_before(before, icon, label, func, data, ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_BEFORE), EO_TYPECHECK(Elm_Object_Item *, before), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_item_insert_after
+ * @since 1.8
+ *
+ * Insert a new item into the toolbar object after item after.
+ *
+ * @param[in] after
+ * @param[in] icon
+ * @param[in] label
+ * @param[in] func
+ * @param[in] data
+ * @param[out] ret
+ *
+ * @see elm_toolbar_item_insert_after
+ */
+#define elm_obj_toolbar_item_insert_after(after, icon, label, func, data, ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_INSERT_AFTER), EO_TYPECHECK(Elm_Object_Item *, after), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_first_item_get
+ * @since 1.8
+ *
+ * Get the first item in the given toolbar widget's list of
+ * items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_first_item_get
+ */
+#define elm_obj_toolbar_first_item_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_last_item_get
+ * @since 1.8
+ *
+ * Get the last item in the given toolbar widget's list of
+ * items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_last_item_get
+ */
+#define elm_obj_toolbar_last_item_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_item_find_by_label
+ * @since 1.8
+ *
+ * Returns a pointer to a toolbar item by its label.
+ *
+ * @param[in] label
+ * @param[out] ret
+ *
+ * @see elm_toolbar_item_find_by_label
+ */
+#define elm_obj_toolbar_item_find_by_label(label, ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEM_FIND_BY_LABEL), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_selected_item_get
+ * @since 1.8
+ *
+ * Get the selected item.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_selected_item_get
+ */
+#define elm_obj_toolbar_selected_item_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_more_item_get
+ * @since 1.8
+ *
+ * Get the more item.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_more_item_get
+ */
+#define elm_obj_toolbar_more_item_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MORE_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
+
+/**
+ * @def elm_obj_toolbar_shrink_mode_set
+ * @since 1.8
+ *
+ * Set the item displaying mode of a given toolbar widget obj.
+ *
+ * @param[in] shrink_mode
+ *
+ * @see elm_toolbar_shrink_mode_set
+ */
+#define elm_obj_toolbar_shrink_mode_set(shrink_mode) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_SET), EO_TYPECHECK(Elm_Toolbar_Shrink_Mode, shrink_mode)
+
+/**
+ * @def elm_obj_toolbar_shrink_mode_get
+ * @since 1.8
+ *
+ * Get the shrink mode of toolbar obj.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_shrink_mode_get
+ */
+#define elm_obj_toolbar_shrink_mode_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SHRINK_MODE_GET), EO_TYPECHECK(Elm_Toolbar_Shrink_Mode *, ret)
+
+/**
+ * @def elm_obj_toolbar_homogeneous_set
+ * @since 1.8
+ *
+ * Enable/disable homogeneous mode.
+ *
+ * @param[in] homogeneous
+ *
+ * @see elm_toolbar_homogeneous_set
+ */
+#define elm_obj_toolbar_homogeneous_set(homogeneous) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_SET), EO_TYPECHECK(Eina_Bool, homogeneous)
+
+/**
+ * @def elm_obj_toolbar_homogeneous_get
+ * @since 1.8
+ *
+ * Get whether the homogeneous mode is enabled.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_homogeneous_get
+ */
+#define elm_obj_toolbar_homogeneous_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HOMOGENEOUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_toolbar_menu_parent_set
+ * @since 1.8
+ *
+ * Set the parent object of the toolbar items' menus.
+ *
+ * @param[in] parent
+ *
+ * @see elm_toolbar_menu_parent_set
+ */
+#define elm_obj_toolbar_menu_parent_set(parent) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+
+/**
+ * @def elm_obj_toolbar_menu_parent_get
+ * @since 1.8
+ *
+ * Get the parent object of the toolbar items' menus.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_menu_parent_get
+ */
+#define elm_obj_toolbar_menu_parent_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_MENU_PARENT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_toolbar_align_set
+ * @since 1.8
+ *
+ * Set the alignment of the items.
+ *
+ * @param[in] align
+ *
+ * @see elm_toolbar_align_set
+ */
+#define elm_obj_toolbar_align_set(align) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_SET), EO_TYPECHECK(double, align)
+
+/**
+ * @def elm_obj_toolbar_align_get
+ * @since 1.8
+ *
+ * Get the alignment of the items.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_align_get
+ */
+#define elm_obj_toolbar_align_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ALIGN_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_toolbar_icon_order_lookup_set
+ * @since 1.8
+ *
+ * Sets icon lookup order, for toolbar items' icons.
+ *
+ * @param[in] order
+ *
+ * @see elm_toolbar_icon_order_lookup_set
+ */
+#define elm_obj_toolbar_icon_order_lookup_set(order) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_SET), EO_TYPECHECK(Elm_Icon_Lookup_Order, order)
+
+/**
+ * @def elm_obj_toolbar_icon_order_lookup_get
+ * @since 1.8
+ *
+ * Gets the icon lookup order.
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_icon_order_lookup_get
+ */
+#define elm_obj_toolbar_icon_order_lookup_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ICON_ORDER_LOOKUP_GET), EO_TYPECHECK(Elm_Icon_Lookup_Order *, ret)
+
+/**
+ * @def elm_obj_toolbar_horizontal_set
+ * @since 1.8
+ *
+ * Change a toolbar's orientation
+ *
+ * @param[in] horizontal
+ *
+ * @see elm_toolbar_horizontal_set
+ */
+#define elm_obj_toolbar_horizontal_set(horizontal) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_SET), EO_TYPECHECK(Eina_Bool, horizontal)
+
+/**
+ * @def elm_obj_toolbar_horizontal_get
+ * @since 1.8
+ *
+ * Get a toolbar's orientation
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_horizontal_get
+ */
+#define elm_obj_toolbar_horizontal_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_HORIZONTAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_toolbar_items_count
+ * @since 1.8
+ *
+ * Get the number of items in a toolbar
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_items_count
+ */
+#define elm_obj_toolbar_items_count(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_ITEMS_COUNT), EO_TYPECHECK(unsigned int *, ret)
+
+/**
+ * @def elm_obj_toolbar_standard_priority_set
+ * @since 1.8
+ *
+ * Set the standard priority of visible items in a toolbar
+ *
+ * @param[in] priority
+ *
+ * @see elm_toolbar_standard_priority_set
+ */
+#define elm_obj_toolbar_standard_priority_set(priority) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_SET), EO_TYPECHECK(int, priority)
+
+/**
+ * @def elm_obj_toolbar_standard_priority_get
+ * @since 1.8
+ *
+ * Get the standard_priority of visible items in a toolbar
+ *
+ * @param[out] ret
+ *
+ * @see elm_toolbar_standard_priority_get
+ */
+#define elm_obj_toolbar_standard_priority_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_STANDARD_PRIORITY_GET), EO_TYPECHECK(int *, ret)
+#define elm_obj_toolbar_select_mode_set(mode) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_SET), EO_TYPECHECK(Elm_Object_Select_Mode, mode)
+#define elm_obj_toolbar_select_mode_get(ret) ELM_OBJ_TOOLBAR_ID(ELM_OBJ_TOOLBAR_SUB_ID_SELECT_MODE_GET), EO_TYPECHECK(Elm_Object_Select_Mode *, ret)
+
+
/**
* Set reorder mode
*
diff --git a/src/lib/elm_video.c b/src/lib/elm_video.c
index 23ee22f1c..8568a8848 100644
--- a/src/lib/elm_video.c
+++ b/src/lib/elm_video.c
@@ -1,5 +1,6 @@
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_widget_layout.h"
#include "elm_widget_video.h"
#ifdef HAVE_EMOTION
@@ -9,24 +10,30 @@
/* TODO: add buffering support to Emotion and display buffering
* progress in the theme when needed */
-EAPI const char ELM_VIDEO_SMART_NAME[] = "elm_video";
+#include "Eo.h"
-EVAS_SMART_SUBCLASS_NEW
- (ELM_VIDEO_SMART_NAME, _elm_video, Elm_Video_Smart_Class,
- Elm_Layout_Smart_Class, elm_layout_smart_class_get, NULL);
+EAPI Eo_Op ELM_OBJ_VIDEO_BASE_ID = EO_NOOP;
-static Eina_Bool
-_elm_video_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+#define MY_CLASS ELM_OBJ_VIDEO_CLASS
+
+#define MY_CLASS_NAME "elm_video"
+
+static void
+_elm_video_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
#ifdef HAVE_EMOTION
Evas_Event_Key_Down *ev = event_info;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
if ((!strcmp(ev->keyname, "Left")) ||
((!strcmp(ev->keyname, "KP_Left")) && (!ev->string)))
@@ -44,7 +51,8 @@ _elm_video_smart_event(Evas_Object *obj,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Right")) ||
@@ -64,7 +72,8 @@ _elm_video_smart_event(Evas_Object *obj,
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if (!strcmp(ev->keyname, "space"))
@@ -75,27 +84,26 @@ _elm_video_smart_event(Evas_Object *obj,
elm_video_play(obj);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
INF("keyname: '%s' not handled", ev->keyname);
- return EINA_FALSE;
#else
(void) obj;
(void) type;
(void) event_info;
-
- return EINA_FALSE;
#endif
}
static void
-_elm_video_smart_sizing_eval(Evas_Object *obj)
+_elm_video_smart_sizing_eval(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
#ifdef HAVE_EMOTION
- ELM_VIDEO_DATA_GET(obj, sd);
+ Elm_Video_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
Evas_Coord w, h;
@@ -103,7 +111,7 @@ _elm_video_smart_sizing_eval(Evas_Object *obj)
evas_object_size_hint_request_get(sd->emotion, &minw, &minh);
evas_object_size_hint_aspect_set
(sd->emotion, EVAS_ASPECT_CONTROL_BOTH, minw, minh);
- edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &w, &h);
+ edje_object_size_min_calc(wd->resize_obj, &w, &h);
if (w != 0 && h != 0)
{
@@ -115,6 +123,7 @@ _elm_video_smart_sizing_eval(Evas_Object *obj)
#else
(void) obj;
+ (void) _pd;
#endif
}
@@ -223,13 +232,13 @@ _elm_video_check(Evas_Object *video)
}
static void
-_elm_video_smart_add(Evas_Object *obj)
+_elm_video_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Video_Smart_Data);
+ Elm_Video_Smart_Data *priv = _pd;
_elm_emotion_init();
- ELM_WIDGET_CLASS(_elm_video_parent_sc)->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -260,13 +269,15 @@ _elm_video_smart_add(Evas_Object *obj)
(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL);
priv->timer = ecore_timer_add(20.0, _suspend_cb, obj);
+#else
+ (void) priv;
#endif
}
static void
-_elm_video_smart_del(Evas_Object *obj)
+_elm_video_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_VIDEO_DATA_GET(obj, sd);
+ Elm_Video_Smart_Data *sd = _pd;
#ifdef HAVE_EMOTION
if (sd->timer) ecore_timer_del(sd->timer);
@@ -275,60 +286,36 @@ _elm_video_smart_del(Evas_Object *obj)
(void) sd;
#endif
- ELM_WIDGET_CLASS(_elm_video_parent_sc)->base.del(obj);
-}
-
-static void
-_elm_video_smart_set_user(Elm_Video_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_video_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_video_smart_del;
-
- ELM_WIDGET_CLASS(sc)->event = _elm_video_smart_event;
-
- /* not a 'focus chain manager' */
- ELM_WIDGET_CLASS(sc)->focus_next = NULL;
- ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
- ELM_LAYOUT_CLASS(sc)->sizing_eval = _elm_video_smart_sizing_eval;
-}
-
-EAPI const Elm_Video_Smart_Class *
-elm_video_smart_class_get(void)
-{
- static Elm_Video_Smart_Class _sc =
- ELM_VIDEO_SMART_CLASS_INIT_NAME_VERSION(ELM_VIDEO_SMART_NAME);
- static const Elm_Video_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_video_smart_set(&_sc);
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_video_add(Evas_Object *parent)
{
#ifdef HAVE_EMOTION
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+#else
+ (void) parent;
+ return NULL;
+#endif
+}
- obj = elm_widget_add(_elm_video_smart_class_new(), parent);
- if (!obj) return NULL;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+#ifdef HAVE_EMOTION
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME));
+ Evas_Object *parent = eo_parent_get(obj);
if (!elm_widget_sub_object_add(parent, obj))
ERR("could not add %p as sub object of %p", obj, parent);
-
- return obj;
#else
- (void) parent;
- (void) _elm_video_smart_class_new;
-
- return NULL;
+ eo_error_set(obj);
#endif
}
@@ -336,48 +323,72 @@ EAPI Eina_Bool
elm_video_file_set(Evas_Object *obj,
const char *filename)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) EINA_FALSE;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_video_file_set(filename, &ret));
+ return ret;
+}
+
+static void
+_file_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *filename = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
if (sd->remember) emotion_object_last_position_save(sd->emotion);
sd->stop = EINA_FALSE;
- if (!emotion_object_file_set(sd->emotion, filename)) return EINA_FALSE;
+ if (!emotion_object_file_set(sd->emotion, filename)) return;
if (filename && ((!strncmp(filename, "file://", 7)) || (!strstr(filename, "://"))))
emotion_object_last_position_load(sd->emotion);
elm_layout_signal_emit(obj, "elm,video,load", "elm");
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
#else
- (void)obj;
- (void)filename;
-
- return EINA_FALSE;
+ (void) obj;
+ (void) _pd;
+ (void) filename;
#endif
}
EAPI Evas_Object *
elm_video_emotion_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) NULL;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_video_emotion_get(&ret));
+ return ret;
+}
- return sd->emotion;
+static void
+_emotion_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = sd->emotion;
#else
- (void)obj;
- return NULL;
+ (void) _pd;
#endif
}
EAPI void
elm_video_play(Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_play());
+}
+
+static void
+_play(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
if (emotion_object_play_get(sd->emotion)) return;
@@ -386,7 +397,7 @@ elm_video_play(Evas_Object *obj)
sd->stop = EINA_FALSE;
emotion_object_play_set(sd->emotion, EINA_TRUE);
#else
- (void)obj;
+ (void) _pd;
#endif
}
@@ -396,9 +407,15 @@ elm_video_play(Evas_Object *obj)
EAPI void
elm_video_pause(Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_pause());
+}
+
+static void
+_pause(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
if (!emotion_object_play_get(sd->emotion)) return;
@@ -406,7 +423,8 @@ elm_video_pause(Evas_Object *obj)
emotion_object_play_set(sd->emotion, EINA_FALSE);
elm_layout_signal_emit(obj, "elm,video,pause", "elm");
#else
- (void)obj;
+ (void) obj;
+ (void) _pd;
#endif
}
@@ -415,9 +433,15 @@ elm_video_pause(Evas_Object *obj)
EAPI void
elm_video_stop(Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_stop());
+}
+
+static void
+_stop(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
if (!emotion_object_play_get(sd->emotion) && sd->stop) return;
@@ -429,78 +453,118 @@ elm_video_stop(Evas_Object *obj)
elm_layout_signal_emit(obj, "elm,video,stop", "elm");
emotion_object_suspend_set(sd->emotion, EMOTION_HIBERNATE);
#else
- (void)obj;
+ (void) obj;
+ (void) _pd;
#endif
}
EAPI Eina_Bool
elm_video_is_playing_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) EINA_FALSE;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_video_is_playing_get(&ret));
+ return ret;
+}
- return emotion_object_play_get(sd->emotion);
+static void
+_is_playing_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_play_get(sd->emotion);
#else
- (void)obj;
- return EINA_FALSE;
+ (void) _pd;
#endif
}
EAPI Eina_Bool
elm_video_is_seekable_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) EINA_FALSE;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_video_is_seekable_get(&ret));
+ return ret;
+}
- return emotion_object_seekable_get(sd->emotion);
+static void
+_is_seekable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_seekable_get(sd->emotion);
#else
- (void)obj;
- return EINA_FALSE;
+ (void) _pd;
+ (void) ret;
#endif
}
EAPI Eina_Bool
elm_video_audio_mute_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) EINA_FALSE;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_video_audio_mute_get(&ret));
+ return ret;
+}
- return emotion_object_audio_mute_get(sd->emotion);
+static void
+_audio_mute_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_audio_mute_get(sd->emotion);
#else
- (void)obj;
- return EINA_FALSE;
+ (void) _pd;
#endif
}
+
EAPI void
elm_video_audio_mute_set(Evas_Object *obj,
Eina_Bool mute)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_audio_mute_set(mute));
+}
+static void
+_audio_mute_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool mute = va_arg(*list, int);
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
emotion_object_audio_mute_set(sd->emotion, mute);
#else
- (void)obj;
- (void)mute;
+ (void) _pd;
+ (void) mute;
#endif
}
EAPI double
elm_video_audio_level_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) 0.0;
- ELM_VIDEO_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_video_audio_level_get(&ret));
+ return ret;
+}
- return emotion_object_audio_volume_get(sd->emotion);
+static void
+_audio_level_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = 0.0;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_audio_volume_get(sd->emotion);
#else
- (void)obj;
- return 0.0;
+ (void) _pd;
#endif
}
@@ -508,28 +572,42 @@ EAPI void
elm_video_audio_level_set(Evas_Object *obj,
double volume)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_audio_level_set(volume));
+}
+static void
+_audio_level_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double volume = va_arg(*list, double);
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
emotion_object_audio_volume_set(sd->emotion, volume);
#else
- (void)obj;
- (void)volume;
+ (void) _pd;
+ (void) volume;
#endif
}
EAPI double
elm_video_play_position_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) 0.0;
- ELM_VIDEO_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_video_play_position_get(&ret));
+ return ret;
+}
- return emotion_object_position_get(sd->emotion);
+static void
+_play_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = 0.0;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_position_get(sd->emotion);
#else
- (void)obj;
- return 0.0;
+ (void) _pd;
#endif
}
@@ -537,42 +615,64 @@ EAPI void
elm_video_play_position_set(Evas_Object *obj,
double position)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_play_position_set(position));
+}
+static void
+_play_position_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double position = va_arg(*list, double);
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
emotion_object_position_set(sd->emotion, position);
#else
- (void)obj;
- (void)position;
+ (void) _pd;
+ (void) position;
#endif
}
EAPI double
elm_video_play_length_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) 0.0;
- ELM_VIDEO_DATA_GET(obj, sd);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_video_play_length_get(&ret));
+ return ret;
+}
- return emotion_object_play_length_get(sd->emotion);
+static void
+_play_length_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = 0.0;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_play_length_get(sd->emotion);
#else
- (void)obj;
- return 0.0;
+ (void) _pd;
#endif
}
EAPI const char *
elm_video_title_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) NULL;
- ELM_VIDEO_DATA_GET(obj, sd);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_video_title_get(&ret));
+ return ret;
+}
- return emotion_object_title_get(sd->emotion);
+static void
+_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = emotion_object_title_get(sd->emotion);
#else
- (void)obj;
- return NULL;
+ (void) _pd;
#endif
}
@@ -580,27 +680,123 @@ EAPI void
elm_video_remember_position_set(Evas_Object *obj,
Eina_Bool remember)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj);
- ELM_VIDEO_DATA_GET(obj, sd);
+ eo_do(obj, elm_obj_video_remember_position_set(remember));
+}
+static void
+_remember_position_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool remember = va_arg(*list, int);
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
sd->remember = remember;
#else
- (void)obj;
- (void)remember;
+ (void) _pd;
+ (void) remember;
#endif
}
EAPI Eina_Bool
elm_video_remember_position_get(const Evas_Object *obj)
{
-#ifdef HAVE_EMOTION
ELM_VIDEO_CHECK(obj) EINA_FALSE;
- ELM_VIDEO_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_video_remember_position_get(&ret));
+ return ret;
+}
- return sd->remember;
+static void
+_remember_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_EMOTION
+ Elm_Video_Smart_Data *sd = _pd;
+ *ret = sd->remember;
#else
- (void)obj;
- return EINA_FALSE;
+ (void) _pd;
#endif
}
+
+static void
+_elm_video_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_elm_video_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+}
+
+static void
+_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_video_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_video_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_video_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_video_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_video_smart_focus_direction_manager_is),
+
+ EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_video_smart_sizing_eval),
+
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_FILE_SET), _file_set),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_EMOTION_GET), _emotion_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY), _play),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PAUSE), _pause),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_STOP), _stop),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_IS_PLAYING_GET), _is_playing_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_IS_SEEKABLE_GET), _is_seekable_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_GET), _audio_mute_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_SET), _audio_mute_set),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_GET), _audio_level_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_SET), _audio_level_set),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_GET), _play_position_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_SET), _play_position_set),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_LENGTH_GET), _play_length_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_TITLE_GET), _title_get),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_SET), _remember_position_set),
+ EO_OP_FUNC(ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_GET), _remember_position_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_FILE_SET, "Define the file or URI that will be the video source."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_EMOTION_GET, "Get the underlying Emotion object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_PLAY, "Start to play the video."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_PAUSE, "Pause the video."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_STOP, "Stop the video."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_IS_PLAYING_GET, "Is the video actually playing."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_IS_SEEKABLE_GET, "Is it possible to seek inside the video."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_GET, "Is the audio muted."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_SET, "Change the mute state of the Elm_Video object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_GET, "Get the audio level of the current video ."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_SET, "Set the audio level of an Elm_Video object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_GET, "Get the current position (in seconds) being played in the Elm_Video object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_SET, "Set the current position (in seconds) to be played in the Elm_Video object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_PLAY_LENGTH_GET, "Get the total playing time (in seconds) of the Elm_Video object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_TITLE_GET, "Get the title (for instance DVD title) from this emotion object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_SET, "Set whether the object can remember the last played position."),
+ EO_OP_DESCRIPTION(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_GET, "Set whether the object can remember the last played position."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_VIDEO_BASE_ID, op_desc, ELM_OBJ_VIDEO_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Video_Smart_Data),
+ _class_constructor,
+ NULL
+};
+EO_DEFINE_CLASS(elm_obj_video_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
diff --git a/src/lib/elm_video.h b/src/lib/elm_video.h
index f5599b23c..4d68022df 100644
--- a/src/lib/elm_video.h
+++ b/src/lib/elm_video.h
@@ -46,6 +46,260 @@
*/
/**
+ * ELM_OBJ_PLAYER_CLASS
+ */
+#define ELM_OBJ_PLAYER_CLASS elm_obj_player_class_get()
+
+const Eo_Class *elm_obj_player_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_PLAYER_BASE_ID;
+
+enum
+{
+ ELM_OBJ_PLAYER_SUB_ID_LAST
+};
+
+#define ELM_OBJ_PLAYER_ID(sub_id) (ELM_OBJ_PLAYER_BASE_ID + sub_id)
+
+/**
+ * ELM_OBJ_VIDEO_CLASS
+ */
+#define ELM_OBJ_VIDEO_CLASS elm_obj_video_class_get()
+
+const Eo_Class *elm_obj_video_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_VIDEO_BASE_ID;
+
+enum
+{
+ ELM_OBJ_VIDEO_SUB_ID_FILE_SET,
+ ELM_OBJ_VIDEO_SUB_ID_EMOTION_GET,
+ ELM_OBJ_VIDEO_SUB_ID_PLAY,
+ ELM_OBJ_VIDEO_SUB_ID_PAUSE,
+ ELM_OBJ_VIDEO_SUB_ID_STOP,
+ ELM_OBJ_VIDEO_SUB_ID_IS_PLAYING_GET,
+ ELM_OBJ_VIDEO_SUB_ID_IS_SEEKABLE_GET,
+ ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_GET,
+ ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_SET,
+ ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_GET,
+ ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_SET,
+ ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_GET,
+ ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_SET,
+ ELM_OBJ_VIDEO_SUB_ID_PLAY_LENGTH_GET,
+ ELM_OBJ_VIDEO_SUB_ID_TITLE_GET,
+ ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_SET,
+ ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_GET,
+ ELM_OBJ_VIDEO_SUB_ID_LAST
+};
+
+#define ELM_OBJ_VIDEO_ID(sub_id) (ELM_OBJ_VIDEO_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_video_file_set
+ * @since 1.8
+ *
+ * @brief Define the file or URI that will be the video source.
+ *
+ * @param[in] filename
+ * @param[out] ret
+ *
+ * @see elm_video_file_set
+ */
+#define elm_obj_video_file_set(filename, ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_FILE_SET), EO_TYPECHECK(const char *, filename), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_video_emotion_get
+ * @since 1.8
+ *
+ * @brief Get the underlying Emotion object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_emotion_get
+ */
+#define elm_obj_video_emotion_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_EMOTION_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_video_play
+ * @since 1.8
+ *
+ * @brief Start to play the video
+ *
+ *
+ * @see elm_video_play
+ */
+#define elm_obj_video_play() ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY)
+
+/**
+ * @def elm_obj_video_pause
+ * @since 1.8
+ *
+ * @brief Pause the video
+ *
+ *
+ * @see elm_video_pause
+ */
+#define elm_obj_video_pause() ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PAUSE)
+
+/**
+ * @def elm_obj_video_stop
+ * @since 1.8
+ *
+ * @brief Stop the video
+ *
+ *
+ * @see elm_video_stop
+ */
+#define elm_obj_video_stop() ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_STOP)
+
+/**
+ * @def elm_obj_video_is_playing_get
+ * @since 1.8
+ *
+ * @brief Is the video actually playing.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_is_playing_get
+ */
+#define elm_obj_video_is_playing_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_IS_PLAYING_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_video_is_seekable_get
+ * @since 1.8
+ *
+ * @brief Is it possible to seek inside the video.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_is_seekable_get
+ */
+#define elm_obj_video_is_seekable_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_IS_SEEKABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_video_audio_mute_get
+ * @since 1.8
+ *
+ * @brief Is the audio muted.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_audio_mute_get
+ */
+#define elm_obj_video_audio_mute_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_video_audio_mute_set
+ * @since 1.8
+ *
+ * @brief Change the mute state of the Elm_Video object.
+ *
+ * @param[in] mute
+ *
+ * @see elm_video_audio_mute_set
+ */
+#define elm_obj_video_audio_mute_set(mute) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_MUTE_SET), EO_TYPECHECK(Eina_Bool, mute)
+
+/**
+ * @def elm_obj_video_audio_level_get
+ * @since 1.8
+ *
+ * @brief Get the audio level of the current video.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_audio_level_get
+ */
+#define elm_obj_video_audio_level_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_video_audio_level_set
+ * @since 1.8
+ *
+ * @brief Set the audio level of an Elm_Video object.
+ *
+ * @param[in] volume
+ *
+ * @see elm_video_audio_level_set
+ */
+#define elm_obj_video_audio_level_set(volume) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_AUDIO_LEVEL_SET), EO_TYPECHECK(double, volume)
+
+/**
+ * @def elm_obj_video_play_position_get
+ * @since 1.8
+ *
+ * @brief Get the current position (in seconds) being played in the
+ * Elm_Video object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_play_position_get
+ */
+#define elm_obj_video_play_position_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_video_play_position_set
+ * @since 1.8
+ *
+ * @brief Set the current position (in seconds) to be played in the
+ * Elm_Video object.
+ *
+ * @param[in] position
+ *
+ * @see elm_video_play_position_set
+ */
+#define elm_obj_video_play_position_set(position) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_POSITION_SET), EO_TYPECHECK(double, position)
+
+/**
+ * @def elm_obj_video_play_length_get
+ * @since 1.8
+ *
+ * @brief Get the total playing time (in seconds) of the Elm_Video object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_play_length_get
+ */
+#define elm_obj_video_play_length_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_PLAY_LENGTH_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_video_title_get
+ * @since 1.8
+ *
+ * @brief Get the title (for instance DVD title) from this emotion object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_title_get
+ */
+#define elm_obj_video_title_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_TITLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_video_remember_position_set
+ * @since 1.8
+ *
+ * @brief Set whether the object can remember the last played position.
+ *
+ * @param[in] remember
+ *
+ * @see elm_video_remember_position_set
+ */
+#define elm_obj_video_remember_position_set(remember) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_SET), EO_TYPECHECK(Eina_Bool, remember)
+
+/**
+ * @def elm_obj_video_remember_position_get
+ * @since 1.8
+ *
+ * @brief Set whether the object can remember the last played position.
+ *
+ * @param[out] ret
+ *
+ * @see elm_video_remember_position_get
+ */
+#define elm_obj_video_remember_position_get(ret) ELM_OBJ_VIDEO_ID(ELM_OBJ_VIDEO_SUB_ID_REMEMBER_POSITION_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
* @brief Add a new Elm_Player object to the given parent Elementary (container) object.
*
* @param parent The parent object
diff --git a/src/lib/elm_web.c b/src/lib/elm_web.c
index ba7e11836..779dd9552 100644
--- a/src/lib/elm_web.c
+++ b/src/lib/elm_web.c
@@ -2,6 +2,8 @@
#include "elm_priv.h"
#include "elm_widget_web.h"
+#include "Eo.h"
+
// TODO:
// 1 - easy to use zoom like elm_photocam API
// 2 - review scrolling to match elm_scroller. Maybe in future use
@@ -9,6 +11,12 @@
#if !defined(HAVE_ELEMENTARY_WEB) || !defined(USE_WEBKIT2)
+EAPI Eo_Op ELM_OBJ_WEB_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_WEB_CLASS
+
+#define MY_CLASS_NAME "elm_web"
+
#ifdef HAVE_ELEMENTARY_WEB
#include <EWebKit.h>
@@ -22,8 +30,6 @@
" Safari/419.3 " PACKAGE_NAME "/" PACKAGE_VERSION
#endif
-EAPI const char ELM_WEB_SMART_NAME[] = "elm_web";
-
#ifdef HAVE_ELEMENTARY_WEB
static Ewk_View_Smart_Class _ewk_view_parent_sc =
EWK_VIEW_SMART_CLASS_INIT_NULL;
@@ -68,10 +74,6 @@ static const Evas_Smart_Cb_Description _elm_web_smart_callbacks[] = {
{ NULL, NULL }
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_WEB_SMART_NAME, _elm_web, Elm_Web_Smart_Class, Elm_Widget_Smart_Class,
- elm_widget_smart_class_get, _elm_web_smart_callbacks);
-
#ifdef HAVE_ELEMENTARY_WEB
static char *
_webkit_theme_find(const Eina_List *list)
@@ -95,17 +97,21 @@ _webkit_theme_find(const Eina_List *list)
#endif
-static Eina_Bool
-_elm_web_smart_theme(Evas_Object *obj)
+static void
+_elm_web_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
+ Eina_Bool int_ret = EINA_FALSE;
Elm_Theme *theme;
const Eina_List *themes;
char *view_theme = NULL;
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- if (!_elm_web_parent_sc->theme(obj)) return EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
theme = elm_object_theme_get(obj);
themes = elm_theme_overlay_list_get(theme);
@@ -122,73 +128,78 @@ _elm_web_smart_theme(Evas_Object *obj)
set:
if (view_theme)
{
- ewk_view_theme_set(ELM_WIDGET_DATA(sd)->resize_obj, view_theme);
+ ewk_view_theme_set(wd->resize_obj, view_theme);
free(view_theme);
}
else
ewk_view_theme_set
- (ELM_WIDGET_DATA(sd)->resize_obj, WEBKIT_DATADIR "/themes/default.edj");
-#endif
-
+ (wd->resize_obj, WEBKIT_DATADIR "/themes/default.edj");
+#else
(void)obj;
+#endif
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_web_smart_on_focus(Evas_Object *obj)
+static void
+_elm_web_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
#ifdef HAVE_ELEMENTARY_WEB
Evas_Object *top;
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
top = elm_widget_top_get(obj);
if (elm_object_focus_get(obj))
{
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_TRUE);
+ evas_object_focus_set(wd->resize_obj, EINA_TRUE);
if (top) elm_win_keyboard_mode_set(top, sd->input_method);
}
else
{
- evas_object_focus_set(ELM_WIDGET_DATA(sd)->resize_obj, EINA_FALSE);
+ evas_object_focus_set(wd->resize_obj, EINA_FALSE);
if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
}
#else
(void)obj;
+ (void)_pd;
+ (void)list;
#endif
-
- return EINA_TRUE;
}
-static Eina_Bool
-_elm_web_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_web_smart_event(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *src = va_arg(*list, Evas_Object *);
+ (void) src;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
#ifdef HAVE_ELEMENTARY_WEB
Evas_Event_Key_Down *ev = event_info;
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
- if (type != EVAS_CALLBACK_KEY_DOWN) return EINA_FALSE;
- if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return EINA_FALSE;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (type != EVAS_CALLBACK_KEY_DOWN) return;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
+ if (elm_widget_disabled_get(obj)) return;
if ((!strcmp(ev->keyname, "Tab")) && (!sd->tab_propagate))
{
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
- else return EINA_FALSE;
#else
(void)obj;
+ (void)_pd;
(void)type;
(void)event_info;
-
- return EINA_FALSE;
#endif
}
@@ -814,7 +825,7 @@ _ewk_view_inputmethod_change_cb(void *data,
void *event_info)
{
Elm_Web_Smart_Data *sd = data;
- Evas_Object *top = elm_widget_top_get(ELM_WIDGET_DATA(sd)->obj);
+ Evas_Object *top = elm_widget_top_get(sd->obj);
if (!top) return;
if (event_info)
@@ -845,7 +856,7 @@ _ewk_view_load_finished_cb(void *data,
{
float tz = sd->zoom.current;
sd->zoom.current = 0.0;
- elm_web_zoom_set(ELM_WIDGET_DATA(sd)->obj, tz);
+ elm_web_zoom_set(sd->obj, tz);
}
}
@@ -872,7 +883,7 @@ _restore_zoom_mode_timer_cb(void *data)
sd->zoom.timer = NULL;
sd->zoom.current = 0.0;
sd->zoom.no_anim = EINA_TRUE;
- elm_web_zoom_set(ELM_WIDGET_DATA(sd)->obj, tz);
+ elm_web_zoom_set(sd->obj, tz);
return EINA_FALSE;
}
@@ -881,9 +892,10 @@ static Eina_Bool
_reset_zoom_timer_cb(void *data)
{
Elm_Web_Smart_Data *sd = data;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
sd->zoom.timer = ecore_timer_add(0.0, _restore_zoom_mode_timer_cb, sd);
- ewk_view_zoom_set(ELM_WIDGET_DATA(sd)->resize_obj, 1.0, 0, 0);
+ ewk_view_zoom_set(wd->resize_obj, 1.0, 0, 0);
return EINA_FALSE;
}
@@ -968,7 +980,7 @@ _ewk_view_popup_create_cb(void *data,
m2.height = m->height;
m2.handled = EINA_FALSE;
evas_object_smart_callback_call
- (ELM_WIDGET_DATA(sd)->obj, "popup,create", &m2);
+ (sd->obj, "popup,create", &m2);
if (m2.handled) return;
notify = elm_notify_add(obj);
@@ -1061,8 +1073,10 @@ _bring_in_anim_cb(void *data,
double pos)
{
Elm_Web_Smart_Data *sd = data;
+ Elm_Widget_Smart_Data *wd = eo_data_get(sd->obj, ELM_OBJ_WIDGET_CLASS);
+
Evas_Object *frame =
- ewk_view_frame_main_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ ewk_view_frame_main_get(wd->resize_obj);
int sx, sy, rx, ry;
sx = sd->bring_in.start.x;
@@ -1112,65 +1126,68 @@ elm_need_web(void)
}
static void
-_elm_web_smart_add(Evas_Object *obj)
+_elm_web_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Web_Smart_Data);
+ Elm_Web_Smart_Data *priv = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WIDGET_DATA(priv)->resize_obj = _view_add(obj);
+ wd->resize_obj = _view_add(obj);
#else
- ELM_WIDGET_DATA(priv)->resize_obj = elm_label_add(obj);
+ wd->resize_obj = elm_label_add(obj);
elm_object_text_set
- (ELM_WIDGET_DATA(priv)->resize_obj, "WebKit not supported!");
- evas_object_show(ELM_WIDGET_DATA(priv)->resize_obj);
+ (wd->resize_obj, "WebKit not supported!");
+ evas_object_show(wd->resize_obj);
#endif
- _elm_web_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
#ifdef HAVE_ELEMENTARY_WEB
ewk_view_setting_user_agent_set
- (ELM_WIDGET_DATA(priv)->resize_obj, ELM_WEB_USER_AGENT);
+ (wd->resize_obj, ELM_WEB_USER_AGENT);
priv->input_method = ELM_WIN_KEYBOARD_OFF;
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "inputmethod,changed",
+ (wd->resize_obj, "inputmethod,changed",
_ewk_view_inputmethod_change_cb, priv);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "load,started",
+ (wd->resize_obj, "load,started",
_ewk_view_load_started_cb, priv);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "popup,create",
+ (wd->resize_obj, "popup,create",
_ewk_view_popup_create_cb, priv);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "load,finished",
+ (wd->resize_obj, "load,finished",
_ewk_view_load_finished_cb, priv);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "viewport,changed",
+ (wd->resize_obj, "viewport,changed",
_ewk_view_viewport_changed_cb, priv);
evas_object_smart_callback_add
- (ELM_WIDGET_DATA(priv)->resize_obj, "view,resized",
+ (wd->resize_obj, "view,resized",
_ewk_view_resized_cb, priv);
priv->tab_propagate = EINA_FALSE;
priv->inwin_mode = _elm_config->inwin_dialogs_enable;
priv->zoom.min =
- ewk_view_zoom_range_min_get(ELM_WIDGET_DATA(priv)->resize_obj);
+ ewk_view_zoom_range_min_get(wd->resize_obj);
priv->zoom.max =
- ewk_view_zoom_range_max_get(ELM_WIDGET_DATA(priv)->resize_obj);
+ ewk_view_zoom_range_max_get(wd->resize_obj);
priv->zoom.current = 1.0;
- _view_smart_callback_proxy(ELM_WIDGET_DATA(priv)->resize_obj, obj);
- _elm_web_smart_theme(obj);
+ _view_smart_callback_proxy(wd->resize_obj, obj);
+ eo_do(obj, elm_wdg_theme(NULL));
elm_widget_can_focus_set(obj, EINA_TRUE);
+#else
+ (void)priv;
#endif
}
static void
-_elm_web_smart_del(Evas_Object *obj)
+_elm_web_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
if (sd->zoom.timer)
{
@@ -1183,67 +1200,57 @@ _elm_web_smart_del(Evas_Object *obj)
ecore_animator_del(sd->bring_in.animator);
sd->bring_in.animator = NULL;
}
+#else
+ (void)_pd;
#endif
- _elm_web_parent_sc->base.del(obj); /* handles freeing sd */
-}
-
-static void
-_elm_web_smart_set_user(Elm_Web_Smart_Class *sc)
-{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_web_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_web_smart_del;
-
- ELM_WIDGET_CLASS(sc)->on_focus = _elm_web_smart_on_focus;
- ELM_WIDGET_CLASS(sc)->theme = _elm_web_smart_theme;
- ELM_WIDGET_CLASS(sc)->event = _elm_web_smart_event;
-}
-
-EAPI const Elm_Web_Smart_Class *
-elm_web_smart_class_get(void)
-{
- static Elm_Web_Smart_Class _sc =
- ELM_WEB_SMART_CLASS_INIT_NAME_VERSION(ELM_WEB_SMART_NAME);
- static const Elm_Web_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_web_smart_set(&_sc);
- esc->callbacks = _elm_web_smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_web_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_web_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
- return obj;
+ Elm_Web_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_elm_web_smart_callbacks, NULL));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Evas_Object *
elm_web_webkit_view_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_webkit_view_get(&ret));
+ return ret;
+}
+static void
+_webkit_view_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ELM_WIDGET_DATA(sd)->resize_obj;
+ *ret = wd->resize_obj;
#else
ERR("Elementary not compiled with EWebKit support.");
- return NULL;
+ *ret = NULL;
+ (void)obj;
#endif
}
@@ -1253,15 +1260,22 @@ elm_web_window_create_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_window_create_hook_set(func, data));
+}
+static void
+_window_create_hook_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Web_Window_Open func = va_arg(*list, Elm_Web_Window_Open);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.window_create = func;
sd->hook.window_create_data = data;
#else
- (void)func;
- (void)data;
+ (void)func;
+ (void)data;
#endif
}
@@ -1271,15 +1285,24 @@ elm_web_dialog_alert_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_alert_hook_set(func, data));
+}
+
+static void
+_dialog_alert_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Alert func = va_arg(*list, Elm_Web_Dialog_Alert);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.alert = func;
sd->hook.alert_data = data;
#else
(void)func;
(void)data;
+ (void)_pd;
#endif
}
@@ -1289,15 +1312,24 @@ elm_web_dialog_confirm_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_confirm_hook_set(func, data));
+}
+
+static void
+_dialog_confirm_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Confirm func = va_arg(*list, Elm_Web_Dialog_Confirm);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.confirm = func;
sd->hook.confirm_data = data;
#else
(void)func;
(void)data;
+ (void)_pd;
#endif
}
@@ -1307,15 +1339,23 @@ elm_web_dialog_prompt_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_prompt_hook_set(func, data));
+}
+static void
+_dialog_prompt_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Prompt func = va_arg(*list, Elm_Web_Dialog_Prompt);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.prompt = func;
sd->hook.prompt_data = data;
#else
(void)func;
(void)data;
+ (void)_pd;
#endif
}
@@ -1325,15 +1365,23 @@ elm_web_dialog_file_selector_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_file_selector_hook_set(func, data));
+}
+static void
+_dialog_file_selector_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_File_Selector func = va_arg(*list, Elm_Web_Dialog_File_Selector);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.file_selector = func;
sd->hook.file_selector_data = data;
#else
(void)func;
(void)data;
+ (void)_pd;
#endif
}
@@ -1343,15 +1391,24 @@ elm_web_console_message_hook_set(Evas_Object *obj,
void *data)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_console_message_hook_set(func, data));
+}
+
+static void
+_console_message_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Console_Message func = va_arg(*list, Elm_Web_Console_Message);
+ void *data = va_arg(*list, void *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->hook.console_message = func;
sd->hook.console_message_data = data;
#else
(void)func;
(void)data;
+ (void)_pd;
#endif
}
@@ -1360,14 +1417,21 @@ elm_web_useragent_set(Evas_Object *obj,
const char *user_agent)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_useragent_set(user_agent));
+}
+static void
+_useragent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *user_agent = va_arg(*list, const char *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
ewk_view_setting_user_agent_set
- (ELM_WIDGET_DATA(sd)->resize_obj, user_agent);
+ (wd->resize_obj, user_agent);
#else
(void)user_agent;
+ (void)obj;
#endif
}
@@ -1375,13 +1439,23 @@ EAPI const char *
elm_web_useragent_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_useragent_get(&ret));
+ return ret;
+}
+
+static void
+_useragent_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_setting_user_agent_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_setting_user_agent_get(wd->resize_obj);
#else
- return NULL;
+ *ret = NULL;
+ (void)obj;
#endif
}
@@ -1389,13 +1463,22 @@ EAPI Eina_Bool
elm_web_tab_propagate_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_tab_propagate_get(&ret));
+ return ret;
+}
+static void
+_tab_propagate_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
- return sd->tab_propagate;
+ *ret = sd->tab_propagate;
#else
- return EINA_FALSE;
+ *ret = EINA_FALSE;
+ (void)_pd;
#endif
}
@@ -1404,13 +1487,21 @@ elm_web_tab_propagate_set(Evas_Object *obj,
Eina_Bool propagate)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_tab_propagate_set(propagate));
+}
+
+static void
+_tab_propagate_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool propagate = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->tab_propagate = propagate;
#else
(void)propagate;
+ (void)_pd;
#endif
}
@@ -1419,14 +1510,28 @@ elm_web_uri_set(Evas_Object *obj,
const char *uri)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_uri_set(uri, &ret));
+ return ret;
+}
+
+static void
+_uri_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *uri = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_uri_set(ELM_WIDGET_DATA(sd)->resize_obj, uri);
+ int_ret = ewk_view_uri_set(wd->resize_obj, uri);
+ if (ret) *ret = int_ret;
#else
(void)uri;
- return EINA_FALSE;
+ *ret = EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1434,13 +1539,22 @@ EAPI const char *
elm_web_uri_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_uri_get(&ret));
+ return ret;
+}
+static void
+_uri_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_uri_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_uri_get(wd->resize_obj);
#else
- return NULL;
+ *ret = NULL;
+ (void)obj;
#endif
}
@@ -1448,18 +1562,26 @@ EAPI const char *
elm_web_title_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_title_get(&ret));
+ return ret;
+}
+static void
+_title_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
#ifdef HAVE_ELEMENTARY_WEB
const Ewk_Text_With_Direction *txt;
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- txt = ewk_view_title_get(ELM_WIDGET_DATA(sd)->resize_obj);
- if (txt) return txt->string;
+ txt = ewk_view_title_get(wd->resize_obj);
+ if (txt) *ret = txt->string;
- return NULL;
#else
- return NULL;
+ (void)obj;
#endif
}
@@ -1471,12 +1593,23 @@ elm_web_bg_color_set(Evas_Object *obj,
int a)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_bg_color_set(r, g, b, a));
+
+}
+static void
+_bg_color_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ewk_view_bg_color_set(ELM_WIDGET_DATA(sd)->resize_obj, r, g, b, a);
+ ewk_view_bg_color_set(wd->resize_obj, r, g, b, a);
#else
+ (void)obj;
(void)r;
(void)g;
(void)b;
@@ -1491,17 +1624,28 @@ elm_web_bg_color_get(const Evas_Object *obj,
int *b,
int *a)
{
+ ELM_WEB_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_web_bg_color_get(r, g, b, a));
+}
+
+static void
+_bg_color_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+
if (r) *r = 0;
if (g) *g = 0;
if (b) *b = 0;
if (a) *a = 0;
-
- ELM_WEB_CHECK(obj);
-
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_bg_color_get(ELM_WIDGET_DATA(sd)->resize_obj, r, g, b, a);
+ return ewk_view_bg_color_get(wd->resize_obj, r, g, b, a);
+#else
+ (void)obj;
#endif
}
@@ -1509,13 +1653,22 @@ EAPI const char *
elm_web_selection_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_selection_get(&ret));
+ return ret;
+}
+static void
+_selection_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_selection_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_selection_get(wd->resize_obj);
#else
- return NULL;
+ *ret = NULL;
+ (void)obj;
#endif
}
@@ -1524,12 +1677,19 @@ elm_web_popup_selected_set(Evas_Object *obj,
int idx)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_popup_selected_set(idx));
+}
+static void
+_popup_selected_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
- ewk_view_popup_selected_set(ELM_WIDGET_DATA(sd)->resize_obj, idx);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ ewk_view_popup_selected_set(wd->resize_obj, idx);
#else
(void)idx;
+ (void)obj;
#endif
}
@@ -1537,12 +1697,23 @@ EAPI Eina_Bool
elm_web_popup_destroy(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_popup_destroy(&ret));
+ return ret;
+}
+static void
+_popup_destroy(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
- return ewk_view_popup_destroy(ELM_WIDGET_DATA(sd)->resize_obj);
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ int_ret = ewk_view_popup_destroy(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1554,19 +1725,35 @@ elm_web_text_search(const Evas_Object *obj,
Eina_Bool wrap)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_text_search(string, case_sensitive, forward, wrap, &ret));
+ return ret;
+}
+
+static void
+_text_search(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *string = va_arg(*list, const char *);
+ Eina_Bool case_sensitive = va_arg(*list, int);
+ Eina_Bool forward = va_arg(*list, int);
+ Eina_Bool wrap = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_text_search
- (ELM_WIDGET_DATA(sd)->resize_obj, string,
+ int_ret = ewk_view_text_search
+ (wd->resize_obj, string,
case_sensitive, forward, wrap);
+ if (ret) *ret = int_ret;
#else
(void)string;
(void)case_sensitive;
(void)forward;
(void)wrap;
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1578,19 +1765,34 @@ elm_web_text_matches_mark(Evas_Object *obj,
unsigned int limit)
{
ELM_WEB_CHECK(obj) 0;
+ unsigned int ret = 0;
+ eo_do(obj, elm_obj_web_text_matches_mark(string, case_sensitive, highlight, limit, &ret));
+ return ret;
+}
+
+static void
+_text_matches_mark(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *string = va_arg(*list, const char *);
+ Eina_Bool case_sensitive = va_arg(*list, int);
+ Eina_Bool highlight = va_arg(*list, int);
+ unsigned int limit = va_arg(*list, unsigned int);
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ if (ret) *ret = 0;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
- if (!sd) return 0;
- return ewk_view_text_matches_mark
- (ELM_WIDGET_DATA(sd)->resize_obj, string,
+ unsigned int int_ret = 0;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ int_ret = ewk_view_text_matches_mark
+ (wd->resize_obj, string,
case_sensitive, highlight, limit);
+ if (ret) *ret = int_ret;
#else
(void)string;
(void)case_sensitive;
(void)highlight;
(void)limit;
- return 0;
+ (void)obj;
#endif
}
@@ -1598,13 +1800,24 @@ EAPI Eina_Bool
elm_web_text_matches_unmark_all(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_text_matches_unmark_all(&ret));
+ return ret;
+}
+static void
+_text_matches_unmark_all(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_text_matches_unmark_all(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_text_matches_unmark_all(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1613,15 +1826,28 @@ elm_web_text_matches_highlight_set(Evas_Object *obj,
Eina_Bool highlight)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_text_matches_highlight_set(highlight, &ret));
+ return ret;
+}
+
+static void
+_text_matches_highlight_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool highlight = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_text_matches_highlight_set
- (ELM_WIDGET_DATA(sd)->resize_obj, highlight);
+ int_ret = ewk_view_text_matches_highlight_set
+ (wd->resize_obj, highlight);
+ if (ret) *ret = int_ret;
#else
+ (void)obj;
(void)highlight;
- return EINA_FALSE;
#endif
}
@@ -1629,13 +1855,24 @@ EAPI Eina_Bool
elm_web_text_matches_highlight_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_text_matches_highlight_get(&ret));
+ return ret;
+}
+static void
+_text_matches_highlight_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_text_matches_highlight_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_text_matches_highlight_get(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1643,13 +1880,22 @@ EAPI double
elm_web_load_progress_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) - 1.0;
+ double ret = - 1.0;
+ eo_do((Eo *) obj, elm_obj_web_load_progress_get(&ret));
+ return ret;
+}
+static void
+_load_progress_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = -1.0;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_load_progress_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_load_progress_get(wd->resize_obj);
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1657,13 +1903,24 @@ EAPI Eina_Bool
elm_web_stop(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_stop(&ret));
+ return ret;
+}
+static void
+_stop(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_stop(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_stop(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1671,13 +1928,24 @@ EAPI Eina_Bool
elm_web_reload(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_reload(&ret));
+ return ret;
+}
+static void
+_reload(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_reload(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_reload(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1685,13 +1953,24 @@ EAPI Eina_Bool
elm_web_reload_full(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_reload_full(&ret));
+ return ret;
+}
+static void
+_reload_full(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_reload_full(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_reload_full(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1699,13 +1978,24 @@ EAPI Eina_Bool
elm_web_back(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_back(&ret));
+ return ret;
+}
+static void
+_back(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_back(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_back(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1713,13 +2003,24 @@ EAPI Eina_Bool
elm_web_forward(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_forward(&ret));
+ return ret;
+}
+static void
+_forward(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_forward(ELM_WIDGET_DATA(sd)->resize_obj);
+ int_ret = ewk_view_forward(wd->resize_obj);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1728,14 +2029,27 @@ elm_web_navigate(Evas_Object *obj,
int steps)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_navigate(steps, &ret));
+ return ret;
+}
+
+static void
+_navigate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int steps = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Eina_Bool int_ret;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_navigate(ELM_WIDGET_DATA(sd)->resize_obj, steps);
+ int_ret = ewk_view_navigate(wd->resize_obj, steps);
+ if (ret) *ret = int_ret;
#else
- return EINA_FALSE;
(void)steps;
+ (void)obj;
#endif
}
@@ -1749,13 +2063,22 @@ EAPI Eina_Bool
elm_web_back_possible_get(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_back_possible_get(&ret));
+ return ret;
+}
+static void
+_back_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_back_possible(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_back_possible(wd->resize_obj);
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1763,13 +2086,22 @@ EAPI Eina_Bool
elm_web_forward_possible_get(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_forward_possible_get(&ret));
+ return ret;
+}
+static void
+_forward_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_forward_possible(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_forward_possible(wd->resize_obj);
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1778,14 +2110,25 @@ elm_web_navigate_possible_get(Evas_Object *obj,
int steps)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_navigate_possible_get(steps, &ret));
+ return ret;
+}
+
+static void
+_navigate_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int steps = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_navigate_possible(ELM_WIDGET_DATA(sd)->resize_obj, steps);
+ *ret = ewk_view_navigate_possible(wd->resize_obj, steps);
#else
- return EINA_FALSE;
(void)steps;
+ (void)obj;
#endif
}
@@ -1793,13 +2136,23 @@ EAPI Eina_Bool
elm_web_history_enabled_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_history_enabled_get(&ret));
+ return ret;
+}
+
+static void
+_history_enabled_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- return ewk_view_history_enable_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ *ret = ewk_view_history_enable_get(wd->resize_obj);
#else
- return EINA_FALSE;
+ (void)obj;
#endif
}
@@ -1808,13 +2161,20 @@ elm_web_history_enabled_set(Evas_Object *obj,
Eina_Bool enable)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_history_enabled_set(enable));
+}
+static void
+_history_enabled_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool enable = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ewk_view_history_enable_set(ELM_WIDGET_DATA(sd)->resize_obj, enable);
+ ewk_view_history_enable_set(wd->resize_obj, enable);
#else
(void)enable;
+ (void)obj;
#endif
}
@@ -1825,15 +2185,23 @@ elm_web_zoom_set(Evas_Object *obj,
double zoom)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_zoom_set(zoom));
+}
+
+static void
+_zoom_set(Eo *obj, void *_pd, va_list *list)
+{
+ double zoom = va_arg(*list, double);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
int vw, vh, cx, cy;
float z = 1.0;
evas_object_geometry_get
- (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL, &vw, &vh);
+ (wd->resize_obj, NULL, NULL, &vw, &vh);
cx = vw / 2;
cy = vh / 2;
if (zoom > sd->zoom.max) zoom = sd->zoom.max;
@@ -1846,7 +2214,7 @@ elm_web_zoom_set(Evas_Object *obj,
else if (sd->zoom.mode == ELM_WEB_ZOOM_MODE_AUTO_FIT)
{
Evas_Object *frame =
- ewk_view_frame_main_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ ewk_view_frame_main_get(wd->resize_obj);
Evas_Coord fw, fh, pw, ph;
if (!ewk_frame_contents_size_get(frame, &fw, &fh)) return;
@@ -1872,7 +2240,7 @@ elm_web_zoom_set(Evas_Object *obj,
else if (sd->zoom.mode == ELM_WEB_ZOOM_MODE_AUTO_FILL)
{
Evas_Object *frame =
- ewk_view_frame_main_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ ewk_view_frame_main_get(wd->resize_obj);
Evas_Coord fw, fh, pw, ph;
if (!ewk_frame_contents_size_get(frame, &fw, &fh)) return;
@@ -1896,13 +2264,15 @@ elm_web_zoom_set(Evas_Object *obj,
}
}
if (sd->zoom.no_anim)
- ewk_view_zoom_set(ELM_WIDGET_DATA(sd)->resize_obj, z, cx, cy);
+ ewk_view_zoom_set(wd->resize_obj, z, cx, cy);
else
ewk_view_zoom_animated_set
- (ELM_WIDGET_DATA(sd)->resize_obj, z,
+ (wd->resize_obj, z,
_elm_config->zoom_friction, cx, cy);
sd->zoom.no_anim = EINA_FALSE;
#else
+ (void)obj;
+ (void)_pd;
(void)zoom;
#endif
}
@@ -1911,13 +2281,22 @@ EAPI double
elm_web_zoom_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) - 1.0;
+ double ret = - 1.0;
+ eo_do((Eo *) obj, elm_obj_web_zoom_get(&ret));
+ return ret;
+}
+static void
+_zoom_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = -1.0;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
- return sd->zoom.current;
+ *ret = sd->zoom.current;
#else
- return -1.0;
+ (void)_pd;
#endif
}
@@ -1926,9 +2305,16 @@ elm_web_zoom_mode_set(Evas_Object *obj,
Elm_Web_Zoom_Mode mode)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_zoom_mode_set(mode));
+}
+
+static void
+_zoom_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Web_Zoom_Mode mode = va_arg(*list, Elm_Web_Zoom_Mode);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
float tz;
@@ -1942,6 +2328,8 @@ elm_web_zoom_mode_set(Evas_Object *obj,
sd->zoom.current = 0.0;
elm_web_zoom_set(obj, tz);
#else
+ (void)obj;
+ (void)_pd;
(void)mode;
#endif
}
@@ -1950,13 +2338,22 @@ EAPI Elm_Web_Zoom_Mode
elm_web_zoom_mode_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) ELM_WEB_ZOOM_MODE_LAST;
+ Elm_Web_Zoom_Mode ret = ELM_WEB_ZOOM_MODE_LAST;
+ eo_do((Eo *) obj, elm_obj_web_zoom_mode_get(&ret));
+ return ret;
+}
+static void
+_zoom_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Zoom_Mode *ret = va_arg(*list, Elm_Web_Zoom_Mode *);
+ *ret = ELM_WEB_ZOOM_MODE_LAST;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
- return sd->zoom.mode;
+ *ret = sd->zoom.mode;
#else
- return ELM_WEB_ZOOM_MODE_LAST;
+ (void)_pd;
#endif
}
@@ -1968,12 +2365,25 @@ elm_web_region_show(Evas_Object *obj,
int h __UNUSED__)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_region_show(x, y, w, h));
+}
+
+static void
+_region_show(Eo *obj, void *_pd, va_list *list)
+{
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ (void)w;
+ (void)h;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Object *frame =
- ewk_view_frame_main_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ ewk_view_frame_main_get(wd->resize_obj);
int fw, fh, zw, zh, rx, ry;
float zoom;
@@ -1990,6 +2400,8 @@ elm_web_region_show(Evas_Object *obj,
}
ewk_frame_scroll_set(frame, rx, ry);
#else
+ (void)obj;
+ (void)_pd;
(void)x;
(void)y;
#endif
@@ -2003,12 +2415,25 @@ elm_web_region_bring_in(Evas_Object *obj,
int h __UNUSED__)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_region_bring_in(x, y, w, h));
+}
+
+static void
+_region_bring_in(Eo *obj, void *_pd, va_list *list)
+{
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ (void)w;
+ (void)h;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Object *frame =
- ewk_view_frame_main_get(ELM_WIDGET_DATA(sd)->resize_obj);
+ ewk_view_frame_main_get(wd->resize_obj);
int fw, fh, zw, zh, rx, ry, sx, sy;
float zoom;
@@ -2030,6 +2455,8 @@ elm_web_region_bring_in(Evas_Object *obj,
sd->bring_in.animator = ecore_animator_timeline_add(
_elm_config->bring_in_scroll_friction, _bring_in_anim_cb, sd);
#else
+ (void)obj;
+ (void)_pd;
(void)x;
(void)y;
#endif
@@ -2040,12 +2467,19 @@ elm_web_inwin_mode_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_inwin_mode_set(value));
+}
+static void
+_inwin_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
sd->inwin_mode = value;
#else
+ (void)_pd;
(void)value;
#endif
}
@@ -2054,13 +2488,22 @@ EAPI Eina_Bool
elm_web_inwin_mode_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_inwin_mode_get(&ret));
+ return ret;
+}
+static void
+_inwin_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_WEB
- ELM_WEB_DATA_GET(obj, sd);
+ Elm_Web_Smart_Data *sd = _pd;
- return sd->inwin_mode;
+ *ret = sd->inwin_mode;
#else
- return EINA_FALSE;
+ (void)_pd;
#endif
}
@@ -2177,3 +2620,130 @@ elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
// expose every single bit to users!
#endif
+//
+//
+//
+//
+#if !defined(HAVE_ELEMENTARY_WEB) || !defined(USE_WEBKIT2)
+static void
+_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_web_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_web_smart_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_web_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_web_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_web_smart_event),
+
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET), _webkit_view_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET), _window_create_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET), _dialog_alert_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET), _dialog_confirm_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET), _dialog_prompt_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET), _dialog_file_selector_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET), _console_message_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_SET), _useragent_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_GET), _useragent_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_GET), _tab_propagate_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_SET), _tab_propagate_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_SET), _uri_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_GET), _uri_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TITLE_GET), _title_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET), _bg_color_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET), _bg_color_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_SELECTION_GET), _selection_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET), _popup_selected_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY), _popup_destroy),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH), _text_search),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK), _text_matches_mark),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL), _text_matches_unmark_all),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET), _text_matches_highlight_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET), _text_matches_highlight_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET), _load_progress_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_STOP), _stop),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD), _reload),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD_FULL), _reload_full),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK), _back),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD), _forward),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE), _navigate),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET), _back_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET), _forward_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET), _navigate_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET), _history_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET), _history_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_SET), _zoom_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_GET), _zoom_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET), _zoom_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET), _zoom_mode_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_SHOW), _region_show),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN), _region_bring_in),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET), _inwin_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET), _inwin_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET, "Get internal ewk_view object from web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET, "Sets the function to call when a new window is requested."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET, "Sets the function to call when an alert dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET, "Sets the function to call when an confirm dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET, "Sets the function to call when an prompt dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET, "Sets the function to call when an file selector dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET, "Sets the function to call when a console message is emitted from JS."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_USERAGENT_SET, "Change useragent of a elm_web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_USERAGENT_GET, "Return current useragent of elm_web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_GET, "Gets the status of the tab propagation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_SET, "Sets whether to use tab propagation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_URI_SET, "Sets the URI for the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_URI_GET, "Gets the current URI for the object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TITLE_GET, "Gets the current title."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET, "Sets the background color to be used by the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET, "Gets the background color to be used by the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_SELECTION_GET, "Gets a copy of the currently selected text."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET, "Tells the web object which index in the currently open popup was selected."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY, "Dismisses an open dropdown popup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH, "Searches the given string in a document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK, "Marks matches of the given string in a document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL, "Clears all marked matches in the document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET, "Sets whether to highlight the matched marks."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET, "Gets whether highlighting marks is enabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET, "Gets the overall loading progress of the page."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_STOP, "Stops loading the current page."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_RELOAD, "Requests a reload of the current document in the object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_RELOAD_FULL, "Requests a reload of the current document, avoiding any existing caches."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BACK, "Goes back one step in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_FORWARD, "Goes forward one step in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_NAVIGATE, "Jumps the given number of steps in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET, "Queries whether it's possible to go back in history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET, "Queries whether it's possible to go forward in history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET, "Queries whether it's possible to jump the given number of steps."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET, "Gets whether browsing history is enabled for the given object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET, "Enables or disables the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_SET, "Sets the zoom level of the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_GET, "Gets the current zoom level set on the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET, "Sets the zoom mode to use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET, "Gets the currently set zoom mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_REGION_SHOW, "Shows the given region in the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN, "Brings in the region to the visible area."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET, "Sets the default dialogs to use an Inwin instead of a normal window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET, "Gets whether Inwin mode is set for the current object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WEB_BASE_ID, op_desc, ELM_OBJ_WEB_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Web_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_web_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
+#endif
diff --git a/src/lib/elm_web.h b/src/lib/elm_web.h
index 36263bb61..c3eca551a 100644
--- a/src/lib/elm_web.h
+++ b/src/lib/elm_web.h
@@ -84,6 +84,623 @@
* - @ref web_example_02
*/
+#define ELM_OBJ_WEB_CLASS elm_obj_web_class_get()
+
+const Eo_Class *elm_obj_web_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_WEB_BASE_ID;
+
+enum
+{
+ ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET,
+ ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET,
+ ELM_OBJ_WEB_SUB_ID_USERAGENT_SET,
+ ELM_OBJ_WEB_SUB_ID_USERAGENT_GET,
+ ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_GET,
+ ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_SET,
+ ELM_OBJ_WEB_SUB_ID_URI_SET,
+ ELM_OBJ_WEB_SUB_ID_URI_GET,
+ ELM_OBJ_WEB_SUB_ID_TITLE_GET,
+ ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET,
+ ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET,
+ ELM_OBJ_WEB_SUB_ID_SELECTION_GET,
+ ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET,
+ ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY,
+ ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH,
+ ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK,
+ ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL,
+ ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET,
+ ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET,
+ ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET,
+ ELM_OBJ_WEB_SUB_ID_STOP,
+ ELM_OBJ_WEB_SUB_ID_RELOAD,
+ ELM_OBJ_WEB_SUB_ID_RELOAD_FULL,
+ ELM_OBJ_WEB_SUB_ID_BACK,
+ ELM_OBJ_WEB_SUB_ID_FORWARD,
+ ELM_OBJ_WEB_SUB_ID_NAVIGATE,
+ ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET,
+ ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET,
+ ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET,
+ ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET,
+ ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET,
+ ELM_OBJ_WEB_SUB_ID_ZOOM_SET,
+ ELM_OBJ_WEB_SUB_ID_ZOOM_GET,
+ ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET,
+ ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET,
+ ELM_OBJ_WEB_SUB_ID_REGION_SHOW,
+ ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN,
+ ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET,
+ ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET,
+ ELM_OBJ_WEB_SUB_ID_LAST
+};
+
+#define ELM_OBJ_WEB_ID(sub_id) (ELM_OBJ_WEB_BASE_ID + sub_id)
+
+
+/**
+ * @def elm_obj_web_webkit_view_get
+ * @since 1.8
+ *
+ * Get internal ewk_view object from web object.
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_webkit_view_get
+ */
+#define elm_obj_web_webkit_view_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_web_window_create_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when a new window is requested
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_window_create_hook_set
+ */
+#define elm_obj_web_window_create_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET), EO_TYPECHECK(Elm_Web_Window_Open, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_dialog_alert_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when an alert dialog
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_dialog_alert_hook_set
+ */
+#define elm_obj_web_dialog_alert_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET), EO_TYPECHECK(Elm_Web_Dialog_Alert, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_dialog_confirm_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when an confirm dialog
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_dialog_confirm_hook_set
+ */
+#define elm_obj_web_dialog_confirm_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET), EO_TYPECHECK(Elm_Web_Dialog_Confirm, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_dialog_prompt_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when an prompt dialog
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_dialog_prompt_hook_set
+ */
+#define elm_obj_web_dialog_prompt_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET), EO_TYPECHECK(Elm_Web_Dialog_Prompt, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_dialog_file_selector_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when an file selector dialog
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_dialog_file_selector_hook_set
+ */
+#define elm_obj_web_dialog_file_selector_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET), EO_TYPECHECK(Elm_Web_Dialog_File_Selector, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_console_message_hook_set
+ * @since 1.8
+ *
+ * Sets the function to call when a console message is emitted from JS
+ *
+ * @param[in] func
+ * @param[in] data
+ *
+ * @see elm_web_console_message_hook_set
+ */
+#define elm_obj_web_console_message_hook_set(func, data) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET), EO_TYPECHECK(Elm_Web_Console_Message, func), EO_TYPECHECK(void *, data)
+
+/**
+ * @def elm_obj_web_useragent_set
+ * @since 1.8
+ *
+ * Change useragent of a elm_web object
+ *
+ * @param[in] user_agent
+ *
+ * @see elm_web_useragent_set
+ */
+#define elm_obj_web_useragent_set(user_agent) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_SET), EO_TYPECHECK(const char *, user_agent)
+
+/**
+ * @def elm_obj_web_useragent_get
+ * @since 1.8
+ *
+ * Return current useragent of elm_web object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_useragent_get
+ */
+#define elm_obj_web_useragent_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_web_tab_propagate_get
+ * @since 1.8
+ *
+ * Gets the status of the tab propagation
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_tab_propagate_get
+ */
+#define elm_obj_web_tab_propagate_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_tab_propagate_set
+ * @since 1.8
+ *
+ * Sets whether to use tab propagation
+ *
+ * @param[in] propagate
+ *
+ * @see elm_web_tab_propagate_set
+ */
+#define elm_obj_web_tab_propagate_set(propagate) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_SET), EO_TYPECHECK(Eina_Bool, propagate)
+
+/**
+ * @def elm_obj_web_uri_set
+ * @since 1.8
+ *
+ * Sets the URI for the web object
+ *
+ * @param[in] uri
+ * @param[out] ret
+ *
+ * @see elm_web_uri_set
+ */
+#define elm_obj_web_uri_set(uri, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_SET), EO_TYPECHECK(const char *, uri), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_uri_get
+ * @since 1.8
+ *
+ * Gets the current URI for the object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_uri_get
+ */
+#define elm_obj_web_uri_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_web_title_get
+ * @since 1.8
+ *
+ * Gets the current title
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_title_get
+ */
+#define elm_obj_web_title_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TITLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_web_bg_color_set
+ * @since 1.8
+ *
+ * Sets the background color to be used by the web object
+ *
+ * @param[in] r
+ * @param[in] g
+ * @param[in] b
+ * @param[in] a
+ *
+ * @see elm_web_bg_color_set
+ */
+#define elm_obj_web_bg_color_set(r, g, b, a) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET), EO_TYPECHECK(int, r), EO_TYPECHECK(int, g), EO_TYPECHECK(int, b), EO_TYPECHECK(int, a)
+
+/**
+ * @def elm_obj_web_bg_color_get
+ * @since 1.8
+ *
+ * Gets the background color to be used by the web object
+ *
+ * @param[out] r
+ * @param[out] g
+ * @param[out] b
+ * @param[out] a
+ *
+ * @see elm_web_bg_color_get
+ */
+#define elm_obj_web_bg_color_get(r, g, b, a) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET), EO_TYPECHECK(int *, r), EO_TYPECHECK(int *, g), EO_TYPECHECK(int *, b), EO_TYPECHECK(int *, a)
+
+/**
+ * @def elm_obj_web_selection_get
+ * @since 1.8
+ *
+ * Gets a copy of the currently selected text
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_selection_get
+ */
+#define elm_obj_web_selection_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_SELECTION_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_web_popup_selected_set
+ * @since 1.8
+ *
+ * Tells the web object which index in the currently open popup was selected
+ *
+ * @param[in] idx
+ *
+ * @see elm_web_popup_selected_set
+ */
+#define elm_obj_web_popup_selected_set(idx) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET), EO_TYPECHECK(int, idx)
+
+/**
+ * @def elm_obj_web_popup_destroy
+ * @since 1.8
+ *
+ * Dismisses an open dropdown popup
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_popup_destroy
+ */
+#define elm_obj_web_popup_destroy(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_text_search
+ * @since 1.8
+ *
+ * Searches the given string in a document.
+ *
+ * @param[in] string
+ * @param[in] case_sensitive
+ * @param[in] forward
+ * @param[in] wrap
+ * @param[out] ret
+ *
+ * @see elm_web_text_search
+ */
+#define elm_obj_web_text_search(string, case_sensitive, forward, wrap, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH), EO_TYPECHECK(const char *, string), EO_TYPECHECK(Eina_Bool, case_sensitive), EO_TYPECHECK(Eina_Bool, forward), EO_TYPECHECK(Eina_Bool, wrap), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_text_matches_mark
+ * @since 1.8
+ *
+ * Marks matches of the given string in a document.
+ *
+ * @param[in] string
+ * @param[in] case_sensitive
+ * @param[in] highlight
+ * @param[in] limit
+ * @param[out] ret
+ *
+ * @see elm_web_text_matches_mark
+ */
+#define elm_obj_web_text_matches_mark(string, case_sensitive, highlight, limit, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK), EO_TYPECHECK(const char *, string), EO_TYPECHECK(Eina_Bool, case_sensitive), EO_TYPECHECK(Eina_Bool, highlight), EO_TYPECHECK(unsigned int, limit), EO_TYPECHECK(unsigned int *, ret)
+
+/**
+ * @def elm_obj_web_text_matches_unmark_all
+ * @since 1.8
+ *
+ * Clears all marked matches in the document
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_text_matches_unmark_all
+ */
+#define elm_obj_web_text_matches_unmark_all(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_text_matches_highlight_set
+ * @since 1.8
+ *
+ * Sets whether to highlight the matched marks
+ *
+ * @param[in] highlight
+ * @param[out] ret
+ *
+ * @see elm_web_text_matches_highlight_set
+ */
+#define elm_obj_web_text_matches_highlight_set(highlight, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET), EO_TYPECHECK(Eina_Bool, highlight), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_text_matches_highlight_get
+ * @since 1.8
+ *
+ * Gets whether highlighting marks is enabled
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_text_matches_highlight_get
+ */
+#define elm_obj_web_text_matches_highlight_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_load_progress_get
+ * @since 1.8
+ *
+ * Gets the overall loading progress of the page
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_load_progress_get
+ */
+#define elm_obj_web_load_progress_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_web_stop
+ * @since 1.8
+ *
+ * Stops loading the current page
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_stop
+ */
+#define elm_obj_web_stop(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_STOP), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_reload
+ * @since 1.8
+ *
+ * Requests a reload of the current document in the object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_reload
+ */
+#define elm_obj_web_reload(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_reload_full
+ * @since 1.8
+ *
+ * Requests a reload of the current document, avoiding any existing caches
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_reload_full
+ */
+#define elm_obj_web_reload_full(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD_FULL), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_back
+ * @since 1.8
+ *
+ * Goes back one step in the browsing history
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_back
+ */
+#define elm_obj_web_back(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_forward
+ * @since 1.8
+ *
+ * Goes forward one step in the browsing history
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_forward
+ */
+#define elm_obj_web_forward(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_navigate
+ * @since 1.8
+ *
+ * Jumps the given number of steps in the browsing history
+ *
+ * @param[in] steps
+ * @param[out] ret
+ *
+ * @see elm_web_navigate
+ */
+#define elm_obj_web_navigate(steps, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE), EO_TYPECHECK(int, steps), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_back_possible_get
+ * @since 1.8
+ *
+ * Queries whether it's possible to go back in history
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_back_possible_get
+ */
+#define elm_obj_web_back_possible_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_forward_possible_get
+ * @since 1.8
+ *
+ * Queries whether it's possible to go forward in history
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_forward_possible_get
+ */
+#define elm_obj_web_forward_possible_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_navigate_possible_get
+ * @since 1.8
+ *
+ * Queries whether it's possible to jump the given number of steps
+ *
+ * @param[in] steps
+ * @param[out] ret
+ *
+ * @see elm_web_navigate_possible_get
+ */
+#define elm_obj_web_navigate_possible_get(steps, ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET), EO_TYPECHECK(int, steps), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_history_enabled_get
+ * @since 1.8
+ *
+ * Gets whether browsing history is enabled for the given object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_history_enabled_get
+ */
+#define elm_obj_web_history_enabled_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_web_history_enabled_set
+ * @since 1.8
+ *
+ * Enables or disables the browsing history
+ *
+ * @param[in] enable
+ *
+ * @see elm_web_history_enabled_set
+ */
+#define elm_obj_web_history_enabled_set(enable) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enable)
+
+/**
+ * @def elm_obj_web_zoom_set
+ * @since 1.8
+ *
+ * Sets the zoom level of the web object
+ *
+ * @param[in] zoom
+ *
+ * @see elm_web_zoom_set
+ */
+#define elm_obj_web_zoom_set(zoom) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_SET), EO_TYPECHECK(double, zoom)
+
+/**
+ * @def elm_obj_web_zoom_get
+ * @since 1.8
+ *
+ * Gets the current zoom level set on the web object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_zoom_get
+ */
+#define elm_obj_web_zoom_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_web_zoom_mode_set
+ * @since 1.8
+ *
+ * Sets the zoom mode to use
+ *
+ * @param[in] mode
+ *
+ * @see elm_web_zoom_mode_set
+ */
+#define elm_obj_web_zoom_mode_set(mode) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET), EO_TYPECHECK(Elm_Web_Zoom_Mode, mode)
+
+/**
+ * @def elm_obj_web_zoom_mode_get
+ * @since 1.8
+ *
+ * Gets the currently set zoom mode
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_zoom_mode_get
+ */
+#define elm_obj_web_zoom_mode_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET), EO_TYPECHECK(Elm_Web_Zoom_Mode *, ret)
+
+/**
+ * @def elm_obj_web_region_show
+ * @since 1.8
+ *
+ * Shows the given region in the web object
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_web_region_show
+ */
+#define elm_obj_web_region_show(x, y, w, h) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_SHOW), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_web_region_bring_in
+ * @since 1.8
+ *
+ * Brings in the region to the visible area
+ *
+ * @param[in] x
+ * @param[in] y
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_web_region_bring_in
+ */
+#define elm_obj_web_region_bring_in(x, y, w, h) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_web_inwin_mode_set
+ * @since 1.8
+ *
+ * Sets the default dialogs to use an Inwin instead of a normal window
+ *
+ * @param[in] value
+ *
+ * @see elm_web_inwin_mode_set
+ */
+#define elm_obj_web_inwin_mode_set(value) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET), EO_TYPECHECK(Eina_Bool, value)
+
+/**
+ * @def elm_obj_web_inwin_mode_get
+ * @since 1.8
+ *
+ * Gets whether Inwin mode is set for the current object
+ *
+ * @param[out] ret
+ *
+ * @see elm_web_inwin_mode_get
+ */
+#define elm_obj_web_inwin_mode_get(ret) ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+
/**
* @addtogroup Web
* @{
diff --git a/src/lib/elm_web2.c b/src/lib/elm_web2.c
index 564e3ad8c..896dfe6ab 100644
--- a/src/lib/elm_web2.c
+++ b/src/lib/elm_web2.c
@@ -5,7 +5,13 @@
#if defined(HAVE_ELEMENTARY_WEB) && defined(USE_WEBKIT2)
#include <EWebKit2.h>
-EAPI const char ELM_WEB_SMART_NAME[] = "elm_web";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_WEB_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_WEB_CLASS
+
+#define MY_CLASS_NAME "elm_web"
static Ewk_View_Smart_Class _ewk_view_parent_sc =
EWK_VIEW_SMART_CLASS_INIT_NULL;
@@ -15,10 +21,6 @@ static const Evas_Smart_Cb_Description _elm_web_smart_callbacks[] = {
{ NULL, NULL }
};
-EVAS_SMART_SUBCLASS_NEW
- (ELM_WEB_SMART_NAME, _elm_web, Elm_Web_Smart_Class, Elm_Widget_Smart_Class,
- elm_widget_smart_class_get, _elm_web_smart_callbacks);
-
static void
_view_smart_add(Evas_Object *obj)
{
@@ -96,71 +98,63 @@ elm_need_web(void)
}
static void
-_elm_web_smart_add(Evas_Object *obj)
+_elm_web_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Web_Smart_Data);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- ELM_WIDGET_DATA(priv)->resize_obj = _view_add(obj);
+#ifdef HAVE_ELEMENTARY_WEB
+ wd->resize_obj = _view_add(obj);
- _elm_web_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
+#endif
}
static void
-_elm_web_smart_del(Evas_Object *obj)
-{
- _elm_web_parent_sc->base.del(obj); /* handles freeing sd */
-}
-
-static void
-_elm_web_smart_set_user(Elm_Web_Smart_Class *sc)
+_elm_web_smart_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- ELM_WIDGET_CLASS(sc)->base.add = _elm_web_smart_add;
- ELM_WIDGET_CLASS(sc)->base.del = _elm_web_smart_del;
-}
-
-EAPI const Elm_Web_Smart_Class *
-elm_web_smart_class_get(void)
-{
- static Elm_Web_Smart_Class _sc =
- ELM_WEB_SMART_CLASS_INIT_NAME_VERSION(ELM_WEB_SMART_NAME);
- static const Elm_Web_Smart_Class *class = NULL;
- Evas_Smart_Class *esc = (Evas_Smart_Class *)&_sc;
-
- if (class) return class;
-
- _elm_web_smart_set(&_sc);
- esc->callbacks = _elm_web_smart_callbacks;
- class = &_sc;
-
- return class;
+ eo_do_super(obj, evas_obj_smart_del());
}
EAPI Evas_Object *
elm_web_add(Evas_Object *parent)
{
- Evas_Object *obj;
-
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+ Evas_Object *obj = eo_add(MY_CLASS, parent);
+ eo_unref(obj);
+ return obj;
+}
- obj = elm_widget_add(_elm_web_smart_class_new(), parent);
- if (!obj) return NULL;
-
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
+static void
+_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
- return obj;
+ Elm_Web_Smart_Data *sd = _pd;
+ sd->obj = obj;
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_elm_web_smart_callbacks, NULL));
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI Evas_Object *
elm_web_webkit_view_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_webkit_view_get(&ret));
+ return ret;
+}
- ELM_WEB_DATA_GET(obj, sd);
-
- return ELM_WIDGET_DATA(sd)->resize_obj;
+static void
+_webkit_view_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = wd->resize_obj;
}
EAPI void
@@ -170,8 +164,21 @@ elm_web_window_create_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
- (void)func;
- (void)data;
+ eo_do(obj, elm_obj_web_window_create_hook_set(func, data));
+}
+
+static void
+_window_create_hook_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Web_Window_Open func = va_arg(*list, Elm_Web_Window_Open);
+ void *data = va_arg(*list, void *);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)func;
+ (void)data;
+#else
+ (void)func;
+ (void)data;
+#endif
}
EAPI void
@@ -181,8 +188,24 @@ elm_web_dialog_alert_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_alert_hook_set(func, data));
+}
+
+static void
+_dialog_alert_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Alert func = va_arg(*list, Elm_Web_Dialog_Alert);
+ void *data = va_arg(*list, void *);
+
+#ifdef HAVE_ELEMENTARY_WEB
(void)func;
(void)data;
+ (void)_pd;
+#else
+ (void)func;
+ (void)data;
+ (void)_pd;
+#endif
}
EAPI void
@@ -192,8 +215,24 @@ elm_web_dialog_confirm_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_confirm_hook_set(func, data));
+}
+
+static void
+_dialog_confirm_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Confirm func = va_arg(*list, Elm_Web_Dialog_Confirm);
+ void *data = va_arg(*list, void *);
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)func;
+ (void)data;
+ (void)_pd;
+#else
(void)func;
(void)data;
+ (void)_pd;
+#endif
}
EAPI void
@@ -203,8 +242,23 @@ elm_web_dialog_prompt_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_prompt_hook_set(func, data));
+}
+
+static void
+_dialog_prompt_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_Prompt func = va_arg(*list, Elm_Web_Dialog_Prompt);
+ void *data = va_arg(*list, void *);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)func;
+ (void)data;
+ (void)_pd;
+#else
(void)func;
(void)data;
+ (void)_pd;
+#endif
}
EAPI void
@@ -214,8 +268,23 @@ elm_web_dialog_file_selector_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_dialog_file_selector_hook_set(func, data));
+}
+
+static void
+_dialog_file_selector_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Dialog_File_Selector func = va_arg(*list, Elm_Web_Dialog_File_Selector);
+ void *data = va_arg(*list, void *);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)func;
+ (void)data;
+ (void)_pd;
+#else
(void)func;
(void)data;
+ (void)_pd;
+#endif
}
EAPI void
@@ -225,8 +294,24 @@ elm_web_console_message_hook_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_console_message_hook_set(func, data));
+}
+
+static void
+_console_message_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Console_Message func = va_arg(*list, Elm_Web_Console_Message);
+ void *data = va_arg(*list, void *);
+
+#ifdef HAVE_ELEMENTARY_WEB
(void)func;
(void)data;
+ (void)_pd;
+#else
+ (void)func;
+ (void)data;
+ (void)_pd;
+#endif
}
EAPI void
@@ -235,17 +320,43 @@ elm_web_useragent_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
- // FIXME : need to implement
+ eo_do(obj, elm_obj_web_useragent_set(user_agent));
+}
+
+static void
+_useragent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *user_agent = va_arg(*list, const char *);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)user_agent;
+ (void)obj;
+#else
(void)user_agent;
+ (void)obj;
+#endif
}
EAPI const char *
elm_web_useragent_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_useragent_get(&ret));
+ return ret;
+}
- // FIXME : need to implement
- return NULL;
+static void
+_useragent_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+
+#ifdef HAVE_ELEMENTARY_WEB
+ *ret = NULL;
+ (void)obj;
+#else
+ *ret = NULL;
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -253,30 +364,56 @@ elm_web_uri_set(Evas_Object *obj,
const char *uri)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_uri_set(uri, &ret));
+ return ret;
+}
- ELM_WEB_DATA_GET(obj, sd);
-
- return ewk_view_url_set(ELM_WIDGET_DATA(sd)->resize_obj, uri);
+static void
+_uri_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ const char *uri = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ int_ret = ewk_view_url_set(wd->resize_obj, uri);
+ if (ret) *ret = int_ret;
}
EAPI const char *
elm_web_uri_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_uri_get(&ret));
+ return ret;
+}
- ELM_WEB_DATA_GET(obj, sd);
-
- return ewk_view_url_get(ELM_WIDGET_DATA(sd)->resize_obj);
+static void
+_uri_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = ewk_view_url_get(wd->resize_obj);
}
EAPI const char *
elm_web_title_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_title_get(&ret));
+ return ret;
+}
- ELM_WEB_DATA_GET(obj, sd);
-
- return ewk_view_title_get(ELM_WIDGET_DATA(sd)->resize_obj);
+static void
+_title_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ *ret = ewk_view_title_get(wd->resize_obj);
}
EAPI void
@@ -288,10 +425,30 @@ elm_web_bg_color_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_bg_color_set(r, g, b, a));
+}
+
+
+static void
+_bg_color_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int r = va_arg(*list, int);
+ int g = va_arg(*list, int);
+ int b = va_arg(*list, int);
+ int a = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+ (void)r;
+ (void)g;
+ (void)b;
+ (void)a;
+#else
+ (void)obj;
(void)r;
(void)g;
(void)b;
(void)a;
+#endif
}
EAPI void
@@ -303,18 +460,48 @@ elm_web_bg_color_get(const Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do((Eo *) obj, elm_obj_web_bg_color_get(r, g, b, a));
+}
+
+static void
+_bg_color_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int *r = va_arg(*list, int *);
+ int *g = va_arg(*list, int *);
+ int *b = va_arg(*list, int *);
+ int *a = va_arg(*list, int *);
+
if (r) *r = 0;
if (g) *g = 0;
if (b) *b = 0;
if (a) *a = 0;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI const char *
elm_web_selection_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_web_selection_get(&ret));
+ return ret;
+}
- return NULL;
+static void
+_selection_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+#ifdef HAVE_ELEMENTARY_WEB
+ *ret = NULL;
+ (void)obj;
+#else
+ *ret = NULL;
+ (void)obj;
+#endif
}
EAPI void
@@ -323,15 +510,41 @@ elm_web_popup_selected_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_popup_selected_set(idx));
+}
+
+static void
+_popup_selected_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int idx = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)idx;
+ (void)obj;
+#else
(void)idx;
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_popup_destroy(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_popup_destroy(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_popup_destroy(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -342,12 +555,34 @@ elm_web_text_search(const Evas_Object *obj,
Eina_Bool wrap)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_text_search(string, case_sensitive, forward, wrap, &ret));
+ return ret;
+}
+static void
+_text_search(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *string = va_arg(*list, const char *);
+ Eina_Bool case_sensitive = va_arg(*list, int);
+ Eina_Bool forward = va_arg(*list, int);
+ Eina_Bool wrap = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WEB
(void)string;
(void)case_sensitive;
(void)forward;
(void)wrap;
- return EINA_FALSE;
+ (void)obj;
+#else
+ (void)string;
+ (void)case_sensitive;
+ (void)forward;
+ (void)wrap;
+ (void)obj;
+#endif
}
EAPI unsigned int
@@ -358,12 +593,34 @@ elm_web_text_matches_mark(Evas_Object *obj,
unsigned int limit)
{
ELM_WEB_CHECK(obj) 0;
+ unsigned int ret = 0;
+ eo_do(obj, elm_obj_web_text_matches_mark(string, case_sensitive, highlight, limit, &ret));
+ return ret;
+}
+static void
+_text_matches_mark(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *string = va_arg(*list, const char *);
+ Eina_Bool case_sensitive = va_arg(*list, int);
+ Eina_Bool highlight = va_arg(*list, int);
+ unsigned int limit = va_arg(*list, unsigned int);
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ if (ret) *ret = 0;
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)string;
+ (void)case_sensitive;
+ (void)highlight;
+ (void)limit;
+ (void)obj;
+#else
(void)string;
(void)case_sensitive;
(void)highlight;
(void)limit;
- return 0;
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -371,7 +628,21 @@ elm_web_text_matches_unmark_all(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
- return EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_text_matches_unmark_all(&ret));
+ return ret;
+}
+
+static void
+_text_matches_unmark_all(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -380,64 +651,172 @@ elm_web_text_matches_highlight_set(Evas_Object *obj,
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_text_matches_highlight_set(highlight, &ret));
+ return ret;
+}
+
+static void
+_text_matches_highlight_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool highlight = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
(void)highlight;
- return EINA_FALSE;
+#else
+ (void)obj;
+ (void)highlight;
+#endif
}
EAPI Eina_Bool
elm_web_text_matches_highlight_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *)obj, elm_obj_web_text_matches_highlight_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_text_matches_highlight_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI double
elm_web_load_progress_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) - 1.0;
+ double ret = - 1.0;
+ eo_do((Eo *) obj, elm_obj_web_load_progress_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_load_progress_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = -1.0;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_stop(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_stop(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_stop(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_reload(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_reload(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_reload(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_reload_full(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_reload_full(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_reload_full(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_back(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_back(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_back(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_forward(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_forward(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_forward(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -445,25 +824,67 @@ elm_web_navigate(Evas_Object *obj,
int steps)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_navigate(steps, &ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_navigate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int steps = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WEB
(void)steps;
+ (void)obj;
+#else
+ (void)steps;
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_back_possible_get(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_back_possible_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_back_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_forward_possible_get(Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_forward_possible_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_forward_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI Eina_Bool
@@ -471,17 +892,47 @@ elm_web_navigate_possible_get(Evas_Object *obj,
int steps)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_web_navigate_possible_get(steps, &ret));
+ return ret;
+}
+static void
+_navigate_possible_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ int steps = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WEB
(void)steps;
- return EINA_FALSE;
+ (void)obj;
+#else
+ (void)steps;
+ (void)obj;
+#endif
}
EAPI Eina_Bool
elm_web_history_enabled_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_history_enabled_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_history_enabled_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+#else
+ (void)obj;
+#endif
}
EAPI void
@@ -489,8 +940,20 @@ elm_web_history_enabled_set(Evas_Object *obj,
Eina_Bool enable)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_history_enabled_set(enable));
+}
+static void
+_history_enabled_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool enable = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)enable;
+ (void)obj;
+#else
(void)enable;
+ (void)obj;
+#endif
}
EAPI void
@@ -498,16 +961,44 @@ elm_web_zoom_set(Evas_Object *obj,
double zoom)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_zoom_set(zoom));
+}
+static void
+_zoom_set(Eo *obj, void *_pd, va_list *list)
+{
+ double zoom = va_arg(*list, double);
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+ (void)_pd;
(void)zoom;
+#else
+ (void)obj;
+ (void)_pd;
+ (void)zoom;
+#endif
}
EAPI double
elm_web_zoom_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) - 1.0;
+ double ret = - 1.0;
+ eo_do((Eo *) obj, elm_obj_web_zoom_get(&ret));
+ return ret;
+}
- return -1.0;
+static void
+_zoom_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ *ret = -1.0;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)_pd;
+#else
+ (void)_pd;
+#endif
}
EAPI void
@@ -515,16 +1006,44 @@ elm_web_zoom_mode_set(Evas_Object *obj,
Elm_Web_Zoom_Mode mode)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_zoom_mode_set(mode));
+}
+static void
+_zoom_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Web_Zoom_Mode mode = va_arg(*list, Elm_Web_Zoom_Mode);
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+ (void)_pd;
+ (void)mode;
+#else
+ (void)obj;
+ (void)_pd;
(void)mode;
+#endif
}
EAPI Elm_Web_Zoom_Mode
elm_web_zoom_mode_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) ELM_WEB_ZOOM_MODE_LAST;
+ Elm_Web_Zoom_Mode ret = ELM_WEB_ZOOM_MODE_LAST;
+ eo_do((Eo *) obj, elm_obj_web_zoom_mode_get(&ret));
+ return ret;
+}
- return ELM_WEB_ZOOM_MODE_LAST;
+static void
+_zoom_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Web_Zoom_Mode *ret = va_arg(*list, Elm_Web_Zoom_Mode *);
+ *ret = ELM_WEB_ZOOM_MODE_LAST;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)_pd;
+#else
+ (void)_pd;
+#endif
}
EAPI void
@@ -535,9 +1054,30 @@ elm_web_region_show(Evas_Object *obj,
int h __UNUSED__)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_region_show(x, y, w, h));
+}
+static void
+_region_show(Eo *obj, void *_pd, va_list *list)
+{
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ (void)w;
+ (void)h;
+
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+ (void)_pd;
(void)x;
(void)y;
+#else
+ (void)obj;
+ (void)_pd;
+ (void)x;
+ (void)y;
+#endif
}
EAPI void
@@ -548,9 +1088,30 @@ elm_web_region_bring_in(Evas_Object *obj,
int h __UNUSED__)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_region_bring_in(x, y, w, h));
+}
+
+static void
+_region_bring_in(Eo *obj, void *_pd, va_list *list)
+{
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ (void)w;
+ (void)h;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)obj;
+ (void)_pd;
(void)x;
(void)y;
+#else
+ (void)obj;
+ (void)_pd;
+ (void)x;
+ (void)y;
+#endif
}
EAPI void
@@ -558,16 +1119,41 @@ elm_web_inwin_mode_set(Evas_Object *obj,
Eina_Bool value)
{
ELM_WEB_CHECK(obj);
+ eo_do(obj, elm_obj_web_inwin_mode_set(value));
+}
+static void
+_inwin_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool value = va_arg(*list, int);
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)_pd;
+ (void)value;
+#else
+ (void)_pd;
(void)value;
+#endif
}
EAPI Eina_Bool
elm_web_inwin_mode_get(const Evas_Object *obj)
{
ELM_WEB_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_web_inwin_mode_get(&ret));
+ return ret;
+}
- return EINA_FALSE;
+static void
+_inwin_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+#ifdef HAVE_ELEMENTARY_WEB
+ (void)_pd;
+#else
+ (void)_pd;
+#endif
}
EAPI void
@@ -610,3 +1196,124 @@ elm_web_window_features_region_get(const Elm_Web_Window_Features *wf,
return;
}
#endif
+
+
+#if defined(HAVE_ELEMENTARY_WEB) && defined(USE_WEBKIT2)
+static void
+_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_web_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_web_smart_del),
+
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET), _webkit_view_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET), _window_create_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET), _dialog_alert_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET), _dialog_confirm_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET), _dialog_prompt_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET), _dialog_file_selector_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET), _console_message_hook_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_SET), _useragent_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_USERAGENT_GET), _useragent_get),
+
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_SET), _uri_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_URI_GET), _uri_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TITLE_GET), _title_get),
+
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET), _bg_color_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET), _bg_color_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_SELECTION_GET), _selection_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET), _popup_selected_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY), _popup_destroy),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH), _text_search),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK), _text_matches_mark),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL), _text_matches_unmark_all),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET), _text_matches_highlight_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET), _text_matches_highlight_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET), _load_progress_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_STOP), _stop),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD), _reload),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_RELOAD_FULL), _reload_full),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK), _back),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD), _forward),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE), _navigate),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET), _back_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET), _forward_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET), _navigate_possible_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET), _history_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET), _history_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_SET), _zoom_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_GET), _zoom_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET), _zoom_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET), _zoom_mode_get),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_SHOW), _region_show),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN), _region_bring_in),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET), _inwin_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WEB_ID(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET), _inwin_mode_get),
+ EO_OP_FUNC_SENTINEL
+ };
+ eo_class_funcs_set(klass, func_desc);
+}
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_WEBKIT_VIEW_GET, "Get internal ewk_view object from web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_WINDOW_CREATE_HOOK_SET, "Sets the function to call when a new window is requested."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_ALERT_HOOK_SET, "Sets the function to call when an alert dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_CONFIRM_HOOK_SET, "Sets the function to call when an confirm dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_PROMPT_HOOK_SET, "Sets the function to call when an prompt dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_DIALOG_FILE_SELECTOR_HOOK_SET, "Sets the function to call when an file selector dialog."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_CONSOLE_MESSAGE_HOOK_SET, "Sets the function to call when a console message is emitted from JS."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_USERAGENT_SET, "Change useragent of a elm_web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_USERAGENT_GET, "Return current useragent of elm_web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_GET, "Gets the status of the tab propagation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TAB_PROPAGATE_SET, "Sets whether to use tab propagation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_URI_SET, "Sets the URI for the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_URI_GET, "Gets the current URI for the object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TITLE_GET, "Gets the current title."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BG_COLOR_SET, "Sets the background color to be used by the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BG_COLOR_GET, "Gets the background color to be used by the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_SELECTION_GET, "Gets a copy of the currently selected text."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_POPUP_SELECTED_SET, "Tells the web object which index in the currently open popup was selected."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_POPUP_DESTROY, "Dismisses an open dropdown popup."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_SEARCH, "Searches the given string in a document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_MARK, "Marks matches of the given string in a document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_UNMARK_ALL, "Clears all marked matches in the document."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_SET, "Sets whether to highlight the matched marks."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_TEXT_MATCHES_HIGHLIGHT_GET, "Gets whether highlighting marks is enabled."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_LOAD_PROGRESS_GET, "Gets the overall loading progress of the page."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_STOP, "Stops loading the current page."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_RELOAD, "Requests a reload of the current document in the object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_RELOAD_FULL, "Requests a reload of the current document, avoiding any existing caches."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BACK, "Goes back one step in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_FORWARD, "Goes forward one step in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_NAVIGATE, "Jumps the given number of steps in the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_BACK_POSSIBLE_GET, "Queries whether it's possible to go back in history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_FORWARD_POSSIBLE_GET, "Queries whether it's possible to go forward in history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_NAVIGATE_POSSIBLE_GET, "Queries whether it's possible to jump the given number of steps."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_GET, "Gets whether browsing history is enabled for the given object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_HISTORY_ENABLED_SET, "Enables or disables the browsing history."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_SET, "Sets the zoom level of the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_GET, "Gets the current zoom level set on the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_SET, "Sets the zoom mode to use."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_ZOOM_MODE_GET, "Gets the currently set zoom mode."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_REGION_SHOW, "Shows the given region in the web object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_REGION_BRING_IN, "Brings in the region to the visible area."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_SET, "Sets the default dialogs to use an Inwin instead of a normal window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WEB_SUB_ID_INWIN_MODE_GET, "Gets whether Inwin mode is set for the current object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WEB_BASE_ID, op_desc, ELM_OBJ_WEB_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Web_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_web_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
+#endif
diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 4d5440a85..19ddd538c 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -3,15 +3,21 @@
#include "elm_widget_container.h"
#include "elm_interface_scrollable.h"
-static const char ELM_WIDGET_SMART_NAME[] = "elm_widget";
+#include "Eo.h"
-#define API_ENTRY \
- Elm_Widget_Smart_Data * sd = evas_object_smart_data_get(obj); \
+EAPI Eo_Op ELM_WIDGET_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_WIDGET_CLASS
+
+#define MY_CLASS_NAME "elm_widget"
+
+#define API_ENTRY \
+ ELM_WIDGET_DATA_GET(obj, sd); \
if ((!sd) || (!_elm_widget_is(obj)))
-#define INTERNAL_ENTRY \
- Elm_Widget_Smart_Data * sd = evas_object_smart_data_get(obj); \
- if (!sd) \
- return
+#define INTERNAL_ENTRY \
+ ELM_WIDGET_DATA_GET(obj, sd); \
+ if (!sd) return
+
typedef struct _Elm_Event_Cb_Data Elm_Event_Cb_Data;
typedef struct _Elm_Translate_String_Data Elm_Translate_String_Data;
@@ -35,7 +41,7 @@ static unsigned int focus_order = 0;
static inline Eina_Bool
_elm_widget_is(const Evas_Object *obj)
{
- return evas_object_smart_type_check_ptr(obj, ELM_WIDGET_SMART_NAME);
+ return eo_isa(obj, MY_CLASS);
}
static inline Eina_Bool
@@ -49,24 +55,10 @@ static inline Eina_Bool
_elm_scrollable_is(const Evas_Object *obj)
{
INTERNAL_ENTRY EINA_FALSE;
- return !!evas_object_smart_interface_get(obj, ELM_SCROLLABLE_IFACE_NAME);
+ return
+ eo_isa(obj, ELM_SCROLLABLE_INTERFACE);
}
-/* what follows are basic (unimplemented) smart class functions */
-#define UNIMPLEMENTED_MAKE(_prefix) \
- static Eina_Bool \
- _elm_widget_##_prefix##_func_unimplemented(Evas_Object * obj) \
- { \
- WRN("The %s widget does not implement the \"" #_prefix "\" function.", \
- elm_widget_type_get(obj)); \
- return EINA_FALSE; \
- }
-
-UNIMPLEMENTED_MAKE(disable);
-UNIMPLEMENTED_MAKE(translate);
-
-#undef UNIMPLEMENTED_MAKE
-
/**
* @internal
* Resets the mirrored mode from the system mirror mode for widgets that are in
@@ -87,67 +79,29 @@ _elm_widget_mirrored_reload(Evas_Object *obj)
}
}
-static Eina_Bool
-_elm_widget_theme_func(Evas_Object *obj)
+static void
+_elm_widget_theme_func(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
_elm_widget_mirrored_reload(obj);
elm_widget_disabled_set(obj, elm_widget_disabled_get(obj));
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_widget_on_focus_region_func_unimplemented(const Evas_Object *obj __UNUSED__,
- Evas_Coord *x __UNUSED__,
- Evas_Coord *y __UNUSED__,
- Evas_Coord *w __UNUSED__,
- Evas_Coord *h __UNUSED__)
-{
- WRN("The %s widget does not implement the \"on_focus_region\" function.",
- elm_widget_type_get(obj));
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_elm_widget_on_focus_func_unimplemented(Evas_Object *obj)
-{
- WRN("The %s widget does not implement the \"on_focus\" function.",
- elm_widget_type_get(obj));
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_elm_widget_event_func_unimplemented(Evas_Object *obj,
- Evas_Object *source __UNUSED__,
- Evas_Callback_Type type __UNUSED__,
- void *event_info __UNUSED__)
-{
- WRN("The %s widget does not implement the \"event\" function.",
- elm_widget_type_get(obj));
- return EINA_FALSE;
-}
-
-static Eina_Bool
-_elm_widget_focus_next_func_unimplemented(const Evas_Object *obj,
- Elm_Focus_Direction dir __UNUSED__,
- Evas_Object **next __UNUSED__)
+static void
+_elm_widget_on_focus_region(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- WRN("The %s widget does not implement the \"focus_next\" function.",
- elm_widget_type_get(obj));
- return EINA_FALSE;
-}
+ va_arg(*list, Evas_Coord *);
+ va_arg(*list, Evas_Coord *);
+ va_arg(*list, Evas_Coord *);
+ va_arg(*list, Evas_Coord *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
-static Eina_Bool
-_elm_widget_focus_direction_func_unimplemented(const Evas_Object *obj,
- const Evas_Object *b __UNUSED__,
- double degree __UNUSED__,
- Evas_Object **target __UNUSED__,
- double *weight __UNUSED__)
-{
- WRN("The %s widget does not implement the \"focus_direction\" function.",
- elm_widget_type_get(obj));
- return EINA_FALSE;
+ WRN("The %s widget does not implement the \"on_focus_region\" function.",
+ eo_class_name_get(eo_class_get(obj)));
}
static void
@@ -211,24 +165,27 @@ _on_sub_obj_del(void *data,
}
}
-static Eina_Bool
-_elm_widget_sub_object_add_func(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_widget_sub_object_add(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
double scale, pscale = elm_widget_scale_get(sobj);
Elm_Theme *th, *pth = elm_widget_theme_get(sobj);
Eina_Bool mirrored, pmirrored = elm_widget_mirrored_get(obj);
- ELM_WIDGET_DATA_GET(obj, sd);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE);
+ Elm_Widget_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_TRUE_RETURN(obj == sobj);
if (sobj == sd->parent_obj)
{
/* in this case, sobj must be an elm widget, or something
* very wrong is happening */
- if (!_elm_widget_is(sobj)) return EINA_FALSE;
+ if (!_elm_widget_is(sobj)) return;
- if (!elm_widget_sub_object_del(sobj, obj)) return EINA_FALSE;
+ if (!elm_widget_sub_object_del(sobj, obj)) return;
WRN("You passed a parent object of obj = %p as the sub object = %p!",
obj, sobj);
}
@@ -237,11 +194,11 @@ _elm_widget_sub_object_add_func(Evas_Object *obj,
{
ELM_WIDGET_DATA_GET(sobj, sdc);
- if (sdc->parent_obj == obj) return EINA_TRUE;
+ if (sdc->parent_obj == obj) goto end;;
if (sdc->parent_obj)
{
if (!elm_widget_sub_object_del(sdc->parent_obj, sobj))
- return EINA_FALSE;
+ return;
}
sdc->parent_obj = obj;
_elm_widget_top_win_focused_set(sobj, sd->top_win_focused);
@@ -255,7 +212,7 @@ _elm_widget_sub_object_add_func(Evas_Object *obj,
sdp->child_can_focus = EINA_TRUE;
while (sdp->parent_obj)
{
- sdp = evas_object_smart_data_get(sdp->parent_obj);
+ ELM_WIDGET_DATA_GET_NO_INST(sdp->parent_obj, sdp);
if (sdp->child_can_focus) break;
@@ -269,8 +226,8 @@ _elm_widget_sub_object_add_func(Evas_Object *obj,
if (data)
{
- if (data == obj) return EINA_TRUE;
- if (!elm_widget_sub_object_del(data, sobj)) return EINA_FALSE;
+ if (data == obj) goto end;
+ if (!elm_widget_sub_object_del(data, sobj)) return;
}
}
@@ -293,19 +250,22 @@ _elm_widget_sub_object_add_func(Evas_Object *obj,
if (elm_widget_focus_get(sobj)) _parents_focus(obj);
}
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
-static Eina_Bool
-_elm_widget_sub_object_del_func(Evas_Object *obj,
- Evas_Object *sobj)
+static void
+_elm_widget_sub_object_del(Eo *obj, void *_pd, va_list *list)
{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
Evas_Object *sobj_parent;
- if (!sobj) return EINA_FALSE;
+ if (!sobj) return;
- ELM_WIDGET_DATA_GET(obj, sd);
- EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE);
+ Elm_Widget_Smart_Data *sd = _pd;
+ EINA_SAFETY_ON_TRUE_RETURN(obj == sobj);
sobj_parent = evas_object_data_del(sobj, "elm-parent");
if (sobj_parent != obj)
@@ -324,7 +284,7 @@ _elm_widget_sub_object_del_func(Evas_Object *obj,
}
if (abort_on_warn == 1) abort();
- return EINA_FALSE;
+ return;
}
if (_elm_widget_is(sobj))
@@ -378,7 +338,7 @@ _elm_widget_sub_object_del_func(Evas_Object *obj,
evas_object_event_callback_del_full
(sobj, EVAS_CALLBACK_HIDE, _on_sub_obj_hide, sd);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static const Evas_Smart_Cb_Description _smart_callbacks[] =
@@ -388,16 +348,11 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
};
static void
-_smart_add(Evas_Object *obj)
+_elm_widget_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- const Evas_Smart_Class *sc;
- const Evas_Smart *smart;
- EVAS_SMART_DATA_ALLOC(obj, Elm_Widget_Smart_Data);
+ Elm_Widget_Smart_Data *priv = _pd;
- smart = evas_object_smart_smart_get(obj);
- sc = evas_smart_class_get(smart);
- priv->api = (const Elm_Widget_Smart_Class *)sc;
priv->obj = obj;
priv->x = priv->y = priv->w = priv->h = 0;
priv->mirrored_auto_mode = EINA_TRUE; /* will follow system locale
@@ -478,13 +433,13 @@ _if_focused_revert(Evas_Object *obj,
}
static void
-_smart_del(Evas_Object *obj)
+_elm_widget_smart_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
{
Evas_Object *sobj;
Elm_Translate_String_Data *ts;
Elm_Event_Cb_Data *ecb;
- ELM_WIDGET_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->hover_obj)
{
@@ -524,7 +479,6 @@ _smart_del(Evas_Object *obj)
if (sd->theme) elm_theme_free(sd->theme);
_if_focused_revert(obj, EINA_TRUE);
if (sd->access_info) eina_stringshare_del(sd->access_info);
- free(sd);
evas_object_smart_data_set(obj, NULL);
}
@@ -544,11 +498,11 @@ _smart_reconfigure(Elm_Widget_Smart_Data *sd)
}
static void
-_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_widget_smart_move(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_WIDGET_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->x = x;
sd->y = y;
@@ -557,11 +511,11 @@ _smart_move(Evas_Object *obj,
}
static void
-_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_widget_smart_resize(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
{
- ELM_WIDGET_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->w = w;
sd->h = h;
@@ -570,7 +524,7 @@ _smart_resize(Evas_Object *obj,
}
static void
-_smart_show(Evas_Object *obj)
+_elm_widget_smart_show(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list EINA_UNUSED)
{
Eina_List *list;
Evas_Object *o;
@@ -586,7 +540,7 @@ _smart_show(Evas_Object *obj)
}
static void
-_smart_hide(Evas_Object *obj)
+_elm_widget_smart_hide(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list EINA_UNUSED)
{
Eina_List *list;
Evas_Object *o;
@@ -600,12 +554,12 @@ _smart_hide(Evas_Object *obj)
}
static void
-_smart_color_set(Evas_Object *obj,
- int r,
- int g,
- int b,
- int a)
+_elm_widget_smart_color_set(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list)
{
+ int r = va_arg(*params_list, int);
+ int g = va_arg(*params_list, int);
+ int b = va_arg(*params_list, int);
+ int a = va_arg(*params_list, int);
Eina_List *list;
Evas_Object *o;
@@ -620,9 +574,9 @@ _smart_color_set(Evas_Object *obj,
}
static void
-_smart_clip_set(Evas_Object *obj,
- Evas_Object *clip)
+_elm_widget_smart_clip_set(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list)
{
+ Evas_Object *clip = va_arg(*params_list, Evas_Object *);
Eina_List *list;
Evas_Object *o;
@@ -637,7 +591,7 @@ _smart_clip_set(Evas_Object *obj,
}
static void
-_smart_clip_unset(Evas_Object *obj)
+_elm_widget_smart_clip_unset(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list EINA_UNUSED)
{
Eina_List *list;
Evas_Object *o;
@@ -653,16 +607,17 @@ _smart_clip_unset(Evas_Object *obj)
}
static void
-_smart_calculate(Evas_Object *obj __UNUSED__)
+_elm_widget_smart_calculate(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *params_list EINA_UNUSED)
{
/* a NO-OP, on the base */
}
static void
-_smart_member_add(Evas_Object *obj,
- Evas_Object *child)
+_elm_widget_smart_member_add(Eo *obj, void *_pd EINA_UNUSED, va_list *params_list)
{
int r, g, b, a;
+ Evas_Object *child = va_arg(*params_list, Evas_Object *);
+ eo_do_super(obj, evas_obj_smart_member_add(child));
if (evas_object_data_get(child, "_elm_leaveme")) return;
@@ -678,68 +633,12 @@ _smart_member_add(Evas_Object *obj,
}
static void
-_smart_member_del(Evas_Object *obj __UNUSED__,
- Evas_Object *child)
+_elm_widget_smart_member_del(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- if (evas_object_data_get(child, "_elm_leaveme")) return;
- evas_object_clip_unset(child);
-}
-
-static void
-_elm_widget_smart_set(Elm_Widget_Smart_Class *api)
-{
- Evas_Smart_Class *sc;
-
- if (!(sc = (Evas_Smart_Class *)api))
- return;
-
- sc->add = _smart_add;
- sc->del = _smart_del;
- sc->move = _smart_move;
- sc->resize = _smart_resize;
- sc->show = _smart_show;
- sc->hide = _smart_hide;
- sc->color_set = _smart_color_set;
- sc->clip_set = _smart_clip_set;
- sc->clip_unset = _smart_clip_unset;
- sc->calculate = _smart_calculate;
- sc->member_add = _smart_member_add;
- sc->member_del = _smart_member_del;
-
-#define API_DEFAULT_SET_UNIMPLEMENTED(_prefix) \
- api->_prefix = _elm_widget_##_prefix##_func_unimplemented;
-
- /* NB: always remember to call these parent versions on children,
- * except for the unimplemented ones and calculate, which is moot */
-
-#define API_DEFAULT_SET(_prefix) \
- api->_prefix = _elm_widget_##_prefix##_func;
-
- /* base api */
- API_DEFAULT_SET_UNIMPLEMENTED(on_focus);
- API_DEFAULT_SET_UNIMPLEMENTED(disable);
-
- API_DEFAULT_SET(theme);
- API_DEFAULT_SET_UNIMPLEMENTED(on_focus_region);
-
- API_DEFAULT_SET_UNIMPLEMENTED(translate);
- API_DEFAULT_SET_UNIMPLEMENTED(event);
- API_DEFAULT_SET_UNIMPLEMENTED(focus_next);
- API_DEFAULT_SET_UNIMPLEMENTED(focus_direction);
-
- /* NB: because those two weren't hooks before, translate the
- * individual calls to them on the widgets as we bring them to the
- * new class hierarchy. also, sub_object_{add,del} must be
- * different than member_{add,del} here, because widget parenting
- * on elm does not always imply parent and child will live on the
- * same Evas layer */
- API_DEFAULT_SET(sub_object_add);
- API_DEFAULT_SET(sub_object_del);
-
-#undef API_DEFAULT_SET
-#undef API_DEFAULT_SET_UNIMPLEMENTED
-
- sc->callbacks = _smart_callbacks;
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ if (!evas_object_data_get(child, "_elm_leaveme"))
+ evas_object_clip_unset(child);
+ eo_do_super(obj, evas_obj_smart_member_del(child));
}
// internal funcs
@@ -754,22 +653,21 @@ _elm_widget_smart_set(Elm_Widget_Smart_Class *api)
static inline Eina_Bool
_elm_widget_focus_chain_manager_is(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
- if (!sd->api) return EINA_FALSE;
- return sd->api->focus_next &&
- (sd->api->focus_next != _elm_widget_focus_next_func_unimplemented);
+ Eina_Bool manager_is = EINA_FALSE;
+ eo_do((Eo *)obj, elm_wdg_focus_next_manager_is(&manager_is));
+ return manager_is;
}
static inline Eina_Bool
_elm_widget_focus_direction_manager_is(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
- if (!sd->api) return EINA_FALSE;
- return sd->api->focus_direction &&
- (sd->api->focus_direction !=
- _elm_widget_focus_direction_func_unimplemented);
+ Eina_Bool manager_is = EINA_FALSE;
+ eo_do((Eo *)obj, elm_wdg_focus_direction_manager_is(&manager_is));
+ return manager_is;
}
static void
@@ -826,7 +724,7 @@ _propagate_x_drag_lock(Evas_Object *obj,
INTERNAL_ENTRY;
if (sd->parent_obj)
{
- Elm_Widget_Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
+ ELM_WIDGET_DATA_GET(sd->parent_obj, sd2);
if (sd2)
{
sd2->child_drag_x_locked += dir;
@@ -842,7 +740,7 @@ _propagate_y_drag_lock(Evas_Object *obj,
INTERNAL_ENTRY;
if (sd->parent_obj)
{
- Elm_Widget_Smart_Data *sd2 = evas_object_smart_data_get(sd->parent_obj);
+ ELM_WIDGET_DATA_GET(sd->parent_obj, sd2);
if (sd2)
{
sd2->child_drag_y_locked += dir;
@@ -917,9 +815,7 @@ _elm_widget_focus_region_show(const Evas_Object *obj)
if (_elm_scrollable_is(o))
{
- ELM_SCROLLABLE_IFACE_GET(o, s_iface);
-
- s_iface->content_region_show(o, x, y, w, h);
+ eo_do(o, elm_scrollable_interface_content_region_show(x, y, w, h));
if (!elm_widget_focus_region_get(o, &x, &y, &w, &h))
{
@@ -958,11 +854,11 @@ _parent_focus(Evas_Object *obj)
focus_order++;
sd->focus_order = focus_order;
- if (!sd->api) return;
+
if (sd->top_win_focused)
{
sd->focused = EINA_TRUE;
- sd->api->on_focus(obj);
+ eo_do(obj, elm_wdg_on_focus(NULL));
_elm_widget_focus_region_show(obj);
}
sd->focus_order_on_calc = EINA_FALSE;
@@ -982,47 +878,11 @@ _elm_object_focus_chain_del_cb(void *data,
sd->focus_chain = eina_list_remove(sd->focus_chain, obj);
}
-EAPI const Elm_Widget_Smart_Class *
-elm_widget_smart_class_get(void)
-{
- static Elm_Widget_Smart_Class _sc =
- ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(ELM_WIDGET_SMART_NAME);
- static const Elm_Widget_Smart_Class *class = NULL;
-
- if (class)
- return class;
-
- _elm_widget_smart_set(&_sc);
- class = &_sc;
-
- return class;
-}
-
-EAPI Evas_Object *
-elm_widget_add(Evas_Smart *smart,
- Evas_Object *parent)
-{
- Evas *e;
- Evas_Object *o;
-
- e = evas_object_evas_get(parent);
- if (!e) return NULL;
-
- o = evas_object_smart_add(e, smart);
- elm_widget_parent_set(o, parent);
-
- return o;
-}
-
EAPI void
elm_widget_parent_set(Evas_Object *obj,
Evas_Object *parent)
{
- ELM_WIDGET_DATA_GET(obj, sd);
-
- if (!sd->api->parent_set) return;
-
- sd->api->parent_set(obj, parent);
+ eo_do(obj, elm_wdg_parent_set(parent));
}
EAPI Eina_Bool
@@ -1048,10 +908,7 @@ elm_widget_access(Evas_Object *obj,
EINA_LIST_FOREACH(sd->subobjs, l, child)
ret &= elm_widget_access(child, is_access);
- if (sd->api && sd->api->access)
- sd->api->access(obj, is_access);
- else
- return EINA_FALSE;
+ eo_do(obj, elm_wdg_access(is_access));
return ret;
}
@@ -1078,9 +935,9 @@ elm_widget_theme(Evas_Object *obj)
EINA_LIST_FOREACH(sd->cursors, l, cur)
elm_cursor_theme(cur);
- if (!sd->api) return EINA_FALSE;
-
- ret &= sd->api->theme(obj);
+ Eina_Bool ret2;
+ eo_do(obj, elm_wdg_theme(&ret2));
+ ret &= ret2;
return ret;
}
@@ -1125,8 +982,7 @@ elm_widget_theme_specific(Evas_Object *obj,
elm_tooltip_theme(tt);
EINA_LIST_FOREACH(sd->cursors, l, cur)
elm_cursor_theme(cur);
- if (!sd->api) return;
- sd->api->theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
/**
@@ -1139,8 +995,19 @@ elm_widget_theme_specific(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_mirrored_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->is_mirrored;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_mirrored_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_mirrored_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->is_mirrored;
}
/**
@@ -1153,7 +1020,17 @@ EAPI void
elm_widget_mirrored_set(Evas_Object *obj,
Eina_Bool mirrored)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+
+ eo_do(obj, elm_wdg_mirrored_set(mirrored));
+}
+
+static void
+_elm_widget_mirrored_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool mirrored = va_arg(*list, int);
+
+ Elm_Widget_Smart_Data *sd = _pd;
mirrored = !!mirrored;
@@ -1173,8 +1050,18 @@ elm_widget_mirrored_set(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_mirrored_automatic_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->mirrored_auto_mode;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_mirrored_automatic_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_mirrored_automatic_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->mirrored_auto_mode;
}
/**
@@ -1188,7 +1075,15 @@ EAPI void
elm_widget_mirrored_automatic_set(Evas_Object *obj,
Eina_Bool automatic)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_mirrored_automatic_set(automatic));
+}
+
+static void
+_elm_widget_mirrored_automatic_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool automatic = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->mirrored_auto_mode != automatic)
{
sd->mirrored_auto_mode = automatic;
@@ -1206,8 +1101,17 @@ elm_widget_on_show_region_hook_set(Evas_Object *obj,
Evas_Object *obj),
void *data)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_on_show_region_hook_set(func, data));
+}
+
+static void
+_elm_widget_on_show_region_hook_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ region_hook_func_type func = va_arg(*list, region_hook_func_type);
+ void *data = va_arg(*list, void *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->on_show_region = func;
sd->on_show_region_data = data;
}
@@ -1216,24 +1120,28 @@ EAPI Eina_Bool
elm_widget_sub_object_add(Evas_Object *obj,
Evas_Object *sobj)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE);
- if (!sd->api) return EINA_FALSE;
- return sd->api->sub_object_add(obj, sobj);
+ if (!sobj) return EINA_FALSE;
+
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_sub_object_add(sobj, &ret));
+ return ret;
}
EAPI Eina_Bool
elm_widget_sub_object_del(Evas_Object *obj,
Evas_Object *sobj)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE);
if (!sobj) return EINA_FALSE;
- if (!sd->api) return EINA_FALSE;
- return sd->api->sub_object_del(obj, sobj);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_sub_object_del(sobj, &ret));
+ return ret;
}
/* a resize object is a sub object with some more callbacks on it and
@@ -1243,9 +1151,17 @@ EAPI void
elm_widget_resize_object_set(Evas_Object *obj,
Evas_Object *sobj)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_resize_object_set(sobj));
+}
+
+static void
+_elm_widget_resize_object_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
Evas_Object *parent;
- API_ENTRY return;
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->resize_obj == sobj) return;
@@ -1313,7 +1229,16 @@ EAPI void
elm_widget_hover_object_set(Evas_Object *obj,
Evas_Object *sobj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_hover_object_set(sobj));
+}
+
+static void
+_elm_widget_hover_object_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *sd = _pd;
+
if (sd->hover_obj)
{
evas_object_event_callback_del_full(sd->hover_obj, EVAS_CALLBACK_DEL,
@@ -1332,8 +1257,17 @@ EAPI void
elm_widget_can_focus_set(Evas_Object *obj,
Eina_Bool can_focus)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_can_focus_set(can_focus));
+}
+
+
+static void
+_elm_widget_can_focus_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool can_focus = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
can_focus = !!can_focus;
if (sd->can_focus == can_focus) return;
@@ -1364,15 +1298,35 @@ elm_widget_can_focus_set(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_can_focus_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->can_focus;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_can_focus_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_can_focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->can_focus;
}
EAPI Eina_Bool
elm_widget_child_can_focus_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->child_can_focus;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_child_can_focus_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_child_can_focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->child_can_focus;
}
/**
@@ -1394,7 +1348,15 @@ EAPI void
elm_widget_tree_unfocusable_set(Evas_Object *obj,
Eina_Bool tree_unfocusable)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_tree_unfocusable_set(tree_unfocusable));
+}
+
+static void
+_elm_widget_tree_unfocusable_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool tree_unfocusable = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
tree_unfocusable = !!tree_unfocusable;
if (sd->tree_unfocusable == tree_unfocusable) return;
@@ -1415,8 +1377,18 @@ elm_widget_tree_unfocusable_set(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_tree_unfocusable_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->tree_unfocusable;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_tree_unfocusable_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_tree_unfocusable_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->tree_unfocusable;
}
/**
@@ -1434,11 +1406,21 @@ elm_widget_tree_unfocusable_get(const Evas_Object *obj)
EAPI Eina_List *
elm_widget_can_focus_child_list_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_can_focus_child_list_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_can_focus_child_list_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
const Eina_List *l;
Eina_List *child_list = NULL;
Evas_Object *child;
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->subobjs)
{
@@ -1457,29 +1439,55 @@ elm_widget_can_focus_child_list_get(const Evas_Object *obj)
}
}
}
- return child_list;
+ *ret = child_list;
}
EAPI void
elm_widget_highlight_ignore_set(Evas_Object *obj,
Eina_Bool ignore)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_highlight_ignore_set(ignore));
+}
+
+static void
+_elm_widget_highlight_ignore_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool ignore = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->highlight_ignore = !!ignore;
}
EAPI Eina_Bool
elm_widget_highlight_ignore_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->highlight_ignore;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_highlight_ignore_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_highlight_ignore_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->highlight_ignore;
}
EAPI void
elm_widget_highlight_in_theme_set(Evas_Object *obj,
Eina_Bool highlight)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_highlight_in_theme_set(highlight));
+}
+
+static void
+_elm_widget_highlight_in_theme_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool highlight = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->highlight_in_theme = !!highlight;
/* FIXME: if focused, it should switch from one mode to the other */
}
@@ -1487,39 +1495,93 @@ elm_widget_highlight_in_theme_set(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_highlight_in_theme_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->highlight_in_theme;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_highlight_in_theme_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_highlight_in_theme_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->highlight_in_theme;
}
EAPI Eina_Bool
elm_widget_focus_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->focused;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->focused;
}
EAPI Evas_Object *
elm_widget_focused_object_get(const Evas_Object *obj)
{
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_focused_object_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_focused_object_get(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+ Elm_Widget_Smart_Data *sd = _pd;
+
const Evas_Object *subobj;
const Eina_List *l;
- API_ENTRY return NULL;
- if (!sd->focused) return NULL;
+ if (!sd->focused) return;
EINA_LIST_FOREACH(sd->subobjs, l, subobj)
{
- Evas_Object *fobj = elm_widget_focused_object_get(subobj);
- if (fobj) return fobj;
+ Evas_Object *fobj;
+ fobj = elm_widget_focused_object_get(subobj);
+ if (fobj)
+ {
+ *ret = fobj;
+ return;
+ }
}
- return (Evas_Object *)obj;
+ *ret = (Evas_Object *)obj;
}
EAPI Evas_Object *
elm_widget_top_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
- if (sd->parent_obj) return elm_widget_top_get(sd->parent_obj);
- return (Evas_Object *)obj;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_top_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_top_get(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Widget_Smart_Data *sd = _pd;
+ Evas_Object *int_ret = NULL;
+
+ if (sd->parent_obj)
+ {
+ eo_do((Eo *) sd->parent_obj, elm_wdg_top_get(&int_ret));
+ *ret = int_ret;
+ return;
+ }
+ *ret = (Evas_Object *)obj;
}
EAPI Eina_Bool
@@ -1535,7 +1597,7 @@ elm_widget_parent_widget_get(const Evas_Object *obj)
if (_elm_widget_is(obj))
{
- Elm_Widget_Smart_Data *sd = evas_object_smart_data_get(obj);
+ ELM_WIDGET_DATA_GET(obj, sd);
if (!sd) return NULL;
parent = sd->parent_obj;
}
@@ -1559,18 +1621,33 @@ elm_widget_parent_widget_get(const Evas_Object *obj)
EAPI Evas_Object *
elm_widget_parent2_get(const Evas_Object *obj)
{
- if (_elm_widget_is(obj))
- {
- Elm_Widget_Smart_Data *sd = evas_object_smart_data_get(obj);
- if (sd) return sd->parent2;
- }
- return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_parent2_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_parent2_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->parent2;
}
EAPI void
elm_widget_parent2_set(Evas_Object *obj, Evas_Object *parent)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_parent2_set(parent));
+}
+
+static void
+_elm_widget_parent2_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object *parent = va_arg(*list, Evas_Object *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->parent2 = parent;
}
@@ -1579,8 +1656,19 @@ elm_widget_event_callback_add(Evas_Object *obj,
Elm_Event_Cb func,
const void *data)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(func);
+ eo_do(obj, elm_wdg_event_callback_add(func, data));
+}
+
+static void
+_elm_widget_event_callback_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Event_Cb func = va_arg(*list, Elm_Event_Cb);
EINA_SAFETY_ON_NULL_RETURN(func);
+ const void *data = va_arg(*list, const void *);
+ Elm_Widget_Smart_Data *sd = _pd;
+
Elm_Event_Cb_Data *ecb = ELM_NEW(Elm_Event_Cb_Data);
ecb->func = func;
ecb->data = data;
@@ -1592,18 +1680,33 @@ elm_widget_event_callback_del(Evas_Object *obj,
Elm_Event_Cb func,
const void *data)
{
- API_ENTRY return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(func, NULL);
+ void *ret = NULL;
+ eo_do(obj, elm_wdg_event_callback_del(func, data, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_event_callback_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Event_Cb func = va_arg(*list, Elm_Event_Cb);
+ const void *data = va_arg(*list, const void *);
+ void **ret = va_arg(*list, void **);
+ if (ret) *ret = NULL;
+
+ EINA_SAFETY_ON_NULL_RETURN(func);
Eina_List *l;
Elm_Event_Cb_Data *ecd;
+ Elm_Widget_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->event_cb, l, ecd)
if ((ecd->func == func) && (ecd->data == data))
{
free(ecd);
sd->event_cb = eina_list_remove_list(sd->event_cb, l);
- return (void *)data;
+ if (ret) *ret = (void *)data;
+ return;
}
- return NULL;
}
EAPI Eina_Bool
@@ -1612,9 +1715,21 @@ elm_widget_event_propagate(Evas_Object *obj,
void *event_info,
Evas_Event_Flags *event_flags)
{
- API_ENTRY return EINA_FALSE; //TODO reduce.
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_event_propagate(type, event_info, event_flags, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_event_propagate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Evas_Event_Flags *event_flags = va_arg(*list, Evas_Event_Flags *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
- if (!_elm_widget_is(obj)) return EINA_FALSE;
Evas_Object *parent = obj;
Elm_Event_Cb_Data *ecd;
Eina_List *l, *l_prev;
@@ -1622,24 +1737,28 @@ elm_widget_event_propagate(Evas_Object *obj,
while (parent &&
(!(event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD))))
{
- sd = evas_object_smart_data_get(parent);
- if ((!sd) || (!_elm_widget_is(obj)))
- return EINA_FALSE; //Not Elm Widget
- if (!sd->api) return EINA_FALSE;
+ ELM_WIDGET_CHECK(parent);
+ Elm_Widget_Smart_Data *sd = eo_data_get(parent, ELM_OBJ_WIDGET_CLASS);
- if (sd->api->event(parent, obj, type, event_info))
- return EINA_TRUE;
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do(parent, elm_wdg_event(obj, type, event_info, &int_ret));
+ if (int_ret)
+ {
+ if (ret) *ret = EINA_TRUE;
+ return ;
+ }
EINA_LIST_FOREACH_SAFE(sd->event_cb, l, l_prev, ecd)
{
if (ecd->func((void *)ecd->data, parent, obj, type, event_info) ||
(event_flags && ((*event_flags) & EVAS_EVENT_FLAG_ON_HOLD)))
- return EINA_TRUE;
+ {
+ if (ret) *ret = EINA_TRUE;
+ return ;
+ }
}
parent = sd->parent_obj;
}
-
- return EINA_FALSE;
}
/**
@@ -1661,14 +1780,21 @@ EAPI void
elm_widget_focus_custom_chain_set(Evas_Object *obj,
Eina_List *objs)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_custom_chain_set(objs));
+}
+static void
+_elm_widget_focus_custom_chain_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_List *objs = va_arg(*list, Eina_List *);
if (!_elm_widget_focus_chain_manager_is(obj)) return;
elm_widget_focus_custom_chain_unset(obj);
Eina_List *l;
Evas_Object *o;
+ Elm_Widget_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(objs, l, o)
{
@@ -1690,8 +1816,18 @@ elm_widget_focus_custom_chain_set(Evas_Object *obj,
EAPI const Eina_List *
elm_widget_focus_custom_chain_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
- return (const Eina_List *)sd->focus_chain;
+ ELM_WIDGET_CHECK(obj) NULL;
+ const Eina_List *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_focus_custom_chain_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_custom_chain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Eina_List **ret = va_arg(*list, const Eina_List **);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = (const Eina_List *)sd->focus_chain;
}
/**
@@ -1705,9 +1841,16 @@ elm_widget_focus_custom_chain_get(const Evas_Object *obj)
EAPI void
elm_widget_focus_custom_chain_unset(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_custom_chain_unset());
+}
+
+static void
+_elm_widget_focus_custom_chain_unset(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
Eina_List *l, *l_next;
Evas_Object *o;
+ Elm_Widget_Smart_Data *sd = _pd;
EINA_LIST_FOREACH_SAFE(sd->focus_chain, l, l_next, o)
{
@@ -1737,9 +1880,22 @@ elm_widget_focus_custom_chain_append(Evas_Object *obj,
Evas_Object *child,
Evas_Object *relative_child)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
EINA_SAFETY_ON_NULL_RETURN(child);
+ eo_do(obj, elm_wdg_focus_custom_chain_append(child, relative_child));
+}
+
+static void
+_elm_widget_focus_custom_chain_append(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Evas_Object *relative_child = va_arg(*list, Evas_Object *);
+
+ EINA_SAFETY_ON_NULL_RETURN(child);
+
+ Elm_Widget_Smart_Data *sd = _pd;
+
if (!_elm_widget_focus_chain_manager_is(obj)) return;
evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL,
@@ -1772,8 +1928,19 @@ elm_widget_focus_custom_chain_prepend(Evas_Object *obj,
Evas_Object *child,
Evas_Object *relative_child)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
EINA_SAFETY_ON_NULL_RETURN(child);
+ eo_do(obj, elm_wdg_focus_custom_chain_prepend(child, relative_child));
+}
+
+static void
+_elm_widget_focus_custom_chain_prepend(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *child = va_arg(*list, Evas_Object *);
+ Evas_Object *relative_child = va_arg(*list, Evas_Object *);
+
+ EINA_SAFETY_ON_NULL_RETURN(child);
+ Elm_Widget_Smart_Data *sd = _pd;
if (!_elm_widget_focus_chain_manager_is(obj)) return;
@@ -1805,6 +1972,15 @@ EAPI void
elm_widget_focus_cycle(Evas_Object *obj,
Elm_Focus_Direction dir)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_cycle(dir));
+}
+
+static void
+_elm_widget_focus_cycle(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+
Evas_Object *target = NULL;
if (!_elm_widget_is(obj))
return;
@@ -1833,12 +2009,25 @@ EAPI Eina_Bool
elm_widget_focus_direction_go(Evas_Object *obj,
double degree)
{
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_focus_direction_go(degree, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_direction_go(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ double degree = va_arg(*list, double);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Object *target = NULL;
Evas_Object *current_focused = NULL;
double weight = 0.0;
- if (!_elm_widget_is(obj)) return EINA_FALSE;
- if (!elm_widget_focus_get(obj)) return EINA_FALSE;
+ if (!_elm_widget_is(obj)) return;
+ if (!elm_widget_focus_get(obj)) return;
current_focused = elm_widget_focused_object_get(obj);
@@ -1846,9 +2035,9 @@ elm_widget_focus_direction_go(Evas_Object *obj,
(obj, current_focused, degree, &target, &weight))
{
elm_widget_focus_steal(target);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
- return EINA_FALSE;
}
static double
@@ -2192,6 +2381,7 @@ _direction_weight_get(const Evas_Object *obj1,
*
* @ingroup Widget
*/
+
EAPI Eina_Bool
elm_widget_focus_direction_get(const Evas_Object *obj,
const Evas_Object *base,
@@ -2199,28 +2389,49 @@ elm_widget_focus_direction_get(const Evas_Object *obj,
Evas_Object **direction,
double *weight)
{
+
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_direction_get(base, degree, direction, weight, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_direction_get(Eo *obj, void *_pd, va_list *list)
+{
+ const Evas_Object *base = va_arg(*list, const Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ Elm_Widget_Smart_Data *sd = _pd;
double c_weight;
- API_ENTRY return EINA_FALSE;
/* -1 means the best was already decided. Don't need any more searching. */
if (!direction || !weight || !base || (obj == base))
- return EINA_FALSE;
+ return;
/* Ignore if disabled */
if ((!evas_object_visible_get(obj))
|| (elm_widget_disabled_get(obj))
|| (elm_widget_tree_unfocusable_get(obj)))
- return EINA_FALSE;
-
- if (!sd->api) return EINA_FALSE;
+ return;
/* Try use hook */
if (_elm_widget_focus_direction_manager_is(obj))
- return sd->api->focus_direction(obj, base, degree, direction, weight);
+ {
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do((Eo *)obj, elm_wdg_focus_direction(base, degree, direction, weight, &int_ret));
+ *ret = int_ret;
+ return;
+ }
+
if (!elm_widget_can_focus_get(obj) || elm_widget_focus_get(obj))
- return EINA_FALSE;
+ return;
c_weight = _direction_weight_get(base, obj, degree);
if ((c_weight == -1.0) ||
@@ -2234,14 +2445,13 @@ elm_widget_focus_direction_get(const Evas_Object *obj,
if (sd1)
{
if (sd->focus_order <= sd1->focus_order)
- return EINA_FALSE;
+ return;
}
}
*direction = (Evas_Object *)obj;
*weight = c_weight;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
- return EINA_FALSE;
}
/**
@@ -2277,9 +2487,28 @@ elm_widget_focus_list_direction_get(const Evas_Object *obj,
Evas_Object **direction,
double *weight)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_list_direction_get(base, items, list_data_get, degree, direction, weight, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_list_direction_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Evas_Object *base = va_arg(*list, const Evas_Object *);
+ const Eina_List *items = va_arg(*list, const Eina_List *);
+ list_data_get_func_type list_data_get = va_arg(*list, list_data_get_func_type);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+
+
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
if (!direction || !weight || !base || !items)
- return EINA_FALSE;
+ return;
const Eina_List *l = items;
Evas_Object *current_best = *direction;
@@ -2290,9 +2519,7 @@ elm_widget_focus_list_direction_get(const Evas_Object *obj,
elm_widget_focus_direction_get(cur, base, degree, direction, weight);
}
if (current_best != *direction)
- return EINA_TRUE;
- else
- return EINA_FALSE;
+ *ret = EINA_TRUE;
}
/**
@@ -2321,26 +2548,45 @@ elm_widget_focus_next_get(const Evas_Object *obj,
return EINA_FALSE;
*next = NULL;
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_next_get(dir, next, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_next_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+
+ if (!next)
+ return;
+ *next = NULL;
/* Ignore if disabled */
if ((!evas_object_visible_get(obj))
|| (elm_widget_disabled_get(obj))
|| (elm_widget_tree_unfocusable_get(obj)))
- return EINA_FALSE;
-
- if (!sd->api) return EINA_FALSE;
+ return;
/* Try use hook */
if (_elm_widget_focus_chain_manager_is(obj))
- return sd->api->focus_next(obj, dir, next);
+ {
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do((Eo *)obj, elm_wdg_focus_next(dir, next, &int_ret));
+ *ret = int_ret;
+ return;
+ }
if (!elm_widget_can_focus_get(obj))
- return EINA_FALSE;
+ return;
/* Return */
*next = (Evas_Object *)obj;
- return !elm_widget_focus_get(obj);
+ *ret = !elm_widget_focus_get(obj);
}
/**
@@ -2369,17 +2615,33 @@ elm_widget_focus_list_next_get(const Evas_Object *obj,
Elm_Focus_Direction dir,
Evas_Object **next)
{
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_list_next_get(items, list_data_get, dir, next, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_list_next_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const Eina_List *items = va_arg(*list, const Eina_List *);
+ list_data_get_func_type list_data_get = va_arg(*list, list_data_get_func_type);
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Eina_List *(*list_next)(const Eina_List *list) = NULL;
if (!next)
- return EINA_FALSE;
+ return;
*next = NULL;
if (!_elm_widget_is(obj))
- return EINA_FALSE;
+ return;
if (!items)
- return EINA_FALSE;
+ return;
/* Direction */
if (dir == ELM_FOCUS_PREVIOUS)
@@ -2390,7 +2652,7 @@ elm_widget_focus_list_next_get(const Evas_Object *obj,
else if (dir == ELM_FOCUS_NEXT)
list_next = eina_list_next;
else
- return EINA_FALSE;
+ return;
const Eina_List *l = items;
@@ -2424,7 +2686,8 @@ elm_widget_focus_list_next_get(const Evas_Object *obj,
if (elm_widget_focus_next_get(cur, dir, &tmp))
{
*next = tmp;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
else if ((tmp) && (!to_focus))
to_focus = tmp;
@@ -2446,12 +2709,12 @@ elm_widget_focus_list_next_get(const Evas_Object *obj,
if (tmp)
{
*next = tmp;
- return EINA_FALSE;
+ return;
}
}
*next = to_focus;
- return EINA_FALSE;
+ return;
}
EAPI void
@@ -2459,8 +2722,15 @@ elm_widget_signal_emit(Evas_Object *obj,
const char *emission,
const char *source)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_signal_emit(emission, source));
+}
+static void
+_elm_widget_signal_emit(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
if (evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_signal_emit(obj, emission, source);
else if (evas_object_smart_type_check(obj, "elm_icon"))
@@ -2478,9 +2748,19 @@ elm_widget_signal_callback_add(Evas_Object *obj,
Edje_Signal_Cb func,
void *data)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ EINA_SAFETY_ON_NULL_RETURN(func);
+ eo_do(obj, elm_wdg_signal_callback_add(emission, source, func, data));
+}
+static void
+_elm_widget_signal_callback_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func = va_arg(*list, Edje_Signal_Cb);
EINA_SAFETY_ON_NULL_RETURN(func);
+ void *data = va_arg(*list, void *);
if (evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_signal_callback_add(obj, emission, source, func, data);
@@ -2499,9 +2779,22 @@ elm_widget_signal_callback_del(Evas_Object *obj,
const char *source,
Edje_Signal_Cb func)
{
- void *data = NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ void *ret = NULL;
+ eo_do(obj, elm_wdg_signal_callback_del(emission, source, func, &ret));
+ return ret;
+}
- API_ENTRY return NULL;
+static void
+_elm_widget_signal_callback_del(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *emission = va_arg(*list, const char *);
+ const char *source = va_arg(*list, const char *);
+ Edje_Signal_Cb func = va_arg(*list, Edje_Signal_Cb);
+ void **ret = va_arg(*list, void **);
+ if (ret) *ret = NULL;
+
+ void *data = NULL;
if (evas_object_smart_type_check(obj, "elm_layout"))
data = elm_layout_signal_callback_del(obj, emission, source, func);
@@ -2513,23 +2806,30 @@ elm_widget_signal_callback_del(Evas_Object *obj,
data = _elm_icon_signal_callback_del(obj, emission, source, func);
}
- return data;
+ if (ret) *ret = data;
}
EAPI void
elm_widget_focus_set(Evas_Object *obj,
int first)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_set(first));
+}
- if (!sd->api) return;
+static void
+_elm_widget_focus_set(Eo *obj, void *_pd, va_list *list)
+{
+ int first = va_arg(*list, int);
+
+ Elm_Widget_Smart_Data *sd = _pd;
if (!sd->focused)
{
focus_order++;
sd->focus_order = focus_order;
sd->focused = EINA_TRUE;
- sd->api->on_focus(obj);
+ eo_do(obj, elm_wdg_on_focus(NULL));
}
if (first)
@@ -2583,20 +2883,35 @@ elm_widget_focus_set(Evas_Object *obj,
EAPI Evas_Object *
elm_widget_parent_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
- return sd->parent_obj;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_parent_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_parent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->parent_obj;
}
EAPI void
elm_widget_focused_object_clear(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focused_object_clear());
+}
- if (!sd->api) return;
+static void
+_elm_widget_focused_object_clear(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *sd = _pd;
if (!sd->focused) return;
if (sd->resize_obj && elm_widget_focus_get(sd->resize_obj))
- elm_widget_focused_object_clear(sd->resize_obj);
+ eo_do(sd->resize_obj, elm_wdg_focused_object_clear());
else
{
const Eina_List *l;
@@ -2605,20 +2920,27 @@ elm_widget_focused_object_clear(Evas_Object *obj)
{
if (elm_widget_focus_get(child))
{
- elm_widget_focused_object_clear(child);
+ eo_do(child, elm_wdg_focused_object_clear());
break;
}
}
}
sd->focused = EINA_FALSE;
- sd->api->on_focus(obj);
+ eo_do(obj, elm_wdg_on_focus(NULL));
}
EAPI void
elm_widget_focus_steal(Evas_Object *obj)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_steal());
+}
+
+static void
+_elm_widget_focus_steal(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
Evas_Object *parent, *parent2, *o;
- API_ENTRY return;
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->focused) return;
if (sd->disabled) return;
@@ -2629,24 +2951,24 @@ elm_widget_focus_steal(Evas_Object *obj)
{
o = elm_widget_parent_get(parent);
if (!o) break;
- sd = evas_object_smart_data_get(o);
+ ELM_WIDGET_DATA_GET_NO_INST(o, sd);
if (sd->disabled || sd->tree_unfocusable) return;
if (sd->focused) break;
parent = o;
}
if ((!elm_widget_parent_get(parent)) &&
(!elm_widget_parent2_get(parent)))
- elm_widget_focused_object_clear(parent);
+ eo_do(parent, elm_wdg_focused_object_clear());
else
{
parent2 = elm_widget_parent_get(parent);
if (!parent2) parent2 = elm_widget_parent2_get(parent);
parent = parent2;
- sd = evas_object_smart_data_get(parent);
+ ELM_WIDGET_DATA_GET_NO_INST(parent, sd);
if (sd)
{
if ((sd->resize_obj) && (elm_widget_focus_get(sd->resize_obj)))
- elm_widget_focused_object_clear(sd->resize_obj);
+ eo_do(sd->resize_obj, elm_wdg_focused_object_clear());
else
{
const Eina_List *l;
@@ -2655,7 +2977,7 @@ elm_widget_focus_steal(Evas_Object *obj)
{
if (elm_widget_focus_get(child))
{
- elm_widget_focused_object_clear(child);
+ eo_do(child, elm_wdg_focused_object_clear());
break;
}
}
@@ -2669,9 +2991,15 @@ elm_widget_focus_steal(Evas_Object *obj)
EAPI void
elm_widget_focus_restore(Evas_Object *obj)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_restore());
+}
+
+static void
+_elm_widget_focus_restore(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
Evas_Object *newest = NULL;
unsigned int newest_focus_order = 0;
- API_ENTRY return;
newest = _newest_focus_order_get(obj, &newest_focus_order, EINA_TRUE);
if (newest)
@@ -2710,20 +3038,36 @@ EAPI void
elm_widget_disabled_set(Evas_Object *obj,
Eina_Bool disabled)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_disabled_set(disabled));
+}
+static void
+_elm_widget_disabled_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool disabled = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->disabled == disabled) return;
sd->disabled = !!disabled;
elm_widget_focus_disabled_handle(obj);
- if (!sd->api) return;
- sd->api->disable(obj);
+ eo_do(obj, elm_wdg_disable(NULL));
}
EAPI Eina_Bool
elm_widget_disabled_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->disabled;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_disabled_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_disabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->disabled;
}
EAPI void
@@ -2734,10 +3078,23 @@ elm_widget_show_region_set(Evas_Object *obj,
Evas_Coord h,
Eina_Bool forceshow)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_show_region_set(x, y, w, h, forceshow));
+}
+
+static void
+_elm_widget_show_region_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
+ Eina_Bool forceshow = va_arg(*list, int);
+
Evas_Object *parent_obj, *child_obj;
Evas_Coord px, py, cx, cy;
- API_ENTRY return;
+ Elm_Widget_Smart_Data *sd = _pd;
evas_smart_objects_calculate(evas_object_evas_get(obj));
@@ -2757,7 +3114,7 @@ elm_widget_show_region_set(Evas_Object *obj,
parent_obj = sd->parent_obj;
child_obj = sd->obj;
if ((!parent_obj) || (!_elm_widget_is(parent_obj))) break;
- sd = evas_object_smart_data_get(parent_obj);
+ ELM_WIDGET_DATA_GET_NO_INST(parent_obj, sd);
if (!sd) break;
evas_object_geometry_get(parent_obj, &px, &py, NULL, NULL);
@@ -2786,7 +3143,20 @@ elm_widget_show_region_get(const Evas_Object *obj,
Evas_Coord *w,
Evas_Coord *h)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do((Eo *) obj, elm_wdg_show_region_get(x, y, w, h));
+}
+
+static void
+_elm_widget_show_region_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+
+ Elm_Widget_Smart_Data *sd = _pd;
+
if (x) *x = sd->rx;
if (y) *y = sd->ry;
if (w) *w = sd->rw;
@@ -2829,40 +3199,68 @@ elm_widget_focus_region_get(const Evas_Object *obj,
return EINA_FALSE;
}
- ELM_WIDGET_DATA_GET(obj, sd);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_focus_region_get(x, y, w, h, &ret));
+ return ret;
+}
- return sd->api->on_focus_region(obj, x, y, w, h);
+static void
+_elm_widget_focus_region_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Coord *x = va_arg(*list, Evas_Coord *);
+ Evas_Coord *y = va_arg(*list, Evas_Coord *);
+ Evas_Coord *w = va_arg(*list, Evas_Coord *);
+ Evas_Coord *h = va_arg(*list, Evas_Coord *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do((Eo *)obj, elm_wdg_on_focus_region(x, y, w, h, &int_ret));
+ *ret = int_ret;
}
EAPI Eina_List *
elm_widget_scrollable_children_get(Evas_Object *obj)
{
- Eina_List *l, *ret = NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Eina_List *ret = NULL;
+ eo_do(obj, elm_wdg_scrollable_children_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_scrollable_children_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_List **ret = va_arg(*list, Eina_List **);
+ *ret = NULL;
+
+ Eina_List *l;
Evas_Object *child;
- API_ENTRY return NULL;
+ Elm_Widget_Smart_Data *sd = _pd;
EINA_LIST_FOREACH(sd->subobjs, l, child)
{
if (_elm_scrollable_is(child))
- ret = eina_list_append(ret, child);
+ *ret = eina_list_append(*ret, child);
}
-
- return ret;
}
EAPI void
elm_widget_scroll_hold_push(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_scroll_hold_push());
+}
+
+static void
+_elm_widget_scroll_hold_push(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *sd = _pd;
sd->scroll_hold++;
if (sd->scroll_hold == 1)
{
if (_elm_scrollable_is(obj))
- {
- ELM_SCROLLABLE_IFACE_GET(obj, s_iface);
- s_iface->hold_set(obj, EINA_TRUE);
- }
+ eo_do(obj, elm_scrollable_interface_hold_set(EINA_TRUE));
else
{
Eina_List *scr_children, *l;
@@ -2871,28 +3269,31 @@ elm_widget_scroll_hold_push(Evas_Object *obj)
scr_children = elm_widget_scrollable_children_get(obj);
EINA_LIST_FOREACH(scr_children, l, child)
{
- ELM_SCROLLABLE_IFACE_GET(child, s_iface);
- s_iface->hold_set(child, EINA_TRUE);
+ eo_do(child, elm_scrollable_interface_hold_set(EINA_TRUE));
}
eina_list_free(scr_children);
}
}
- if (sd->parent_obj) elm_widget_scroll_hold_push(sd->parent_obj);
+ if (sd->parent_obj) eo_do(sd->parent_obj, elm_wdg_scroll_hold_push());
// FIXME: on delete/reparent hold pop
}
EAPI void
elm_widget_scroll_hold_pop(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_scroll_hold_pop());
+}
+
+static void
+_elm_widget_scroll_hold_pop(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *sd = _pd;
sd->scroll_hold--;
if (!sd->scroll_hold)
{
if (_elm_scrollable_is(obj))
- {
- ELM_SCROLLABLE_IFACE_GET(obj, s_iface);
- s_iface->hold_set(obj, EINA_FALSE);
- }
+ eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE));
else
{
Eina_List *scr_children, *l;
@@ -2901,35 +3302,48 @@ elm_widget_scroll_hold_pop(Evas_Object *obj)
scr_children = elm_widget_scrollable_children_get(obj);
EINA_LIST_FOREACH(scr_children, l, child)
{
- ELM_SCROLLABLE_IFACE_GET(child, s_iface);
- s_iface->hold_set(child, EINA_FALSE);
+ eo_do(child, elm_scrollable_interface_hold_set(EINA_FALSE));
}
eina_list_free(scr_children);
}
}
- if (sd->parent_obj) elm_widget_scroll_hold_pop(sd->parent_obj);
+ if (sd->parent_obj) eo_do(sd->parent_obj, elm_wdg_scroll_hold_pop());
if (sd->scroll_hold < 0) sd->scroll_hold = 0;
}
EAPI int
elm_widget_scroll_hold_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->scroll_hold;
+ ELM_WIDGET_CHECK(obj) 0;
+ int ret = 0;
+ eo_do((Eo *) obj, elm_wdg_scroll_hold_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_scroll_hold_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->scroll_hold;
}
EAPI void
elm_widget_scroll_freeze_push(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_scroll_freeze_push());
+}
+
+static void
+_elm_widget_scroll_freeze_push(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *sd = _pd;
sd->scroll_freeze++;
if (sd->scroll_freeze == 1)
{
if (_elm_scrollable_is(obj))
- {
- ELM_SCROLLABLE_IFACE_GET(obj, s_iface);
- s_iface->freeze_set(obj, EINA_TRUE);
- }
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_TRUE));
else
{
Eina_List *scr_children, *l;
@@ -2938,28 +3352,31 @@ elm_widget_scroll_freeze_push(Evas_Object *obj)
scr_children = elm_widget_scrollable_children_get(obj);
EINA_LIST_FOREACH(scr_children, l, child)
{
- ELM_SCROLLABLE_IFACE_GET(child, s_iface);
- s_iface->freeze_set(child, EINA_TRUE);
+ eo_do(child, elm_scrollable_interface_freeze_set(EINA_TRUE));
}
eina_list_free(scr_children);
}
}
- if (sd->parent_obj) elm_widget_scroll_freeze_push(sd->parent_obj);
+ if (sd->parent_obj) eo_do(sd->parent_obj, elm_wdg_scroll_freeze_push());
// FIXME: on delete/reparent freeze pop
}
EAPI void
elm_widget_scroll_freeze_pop(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_scroll_freeze_pop());
+}
+
+static void
+_elm_widget_scroll_freeze_pop(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Widget_Smart_Data *sd = _pd;
sd->scroll_freeze--;
if (!sd->scroll_freeze)
{
if (_elm_scrollable_is(obj))
- {
- ELM_SCROLLABLE_IFACE_GET(obj, s_iface);
- s_iface->freeze_set(obj, EINA_FALSE);
- }
+ eo_do(obj, elm_scrollable_interface_freeze_set(EINA_FALSE));
else
{
Eina_List *scr_children, *l;
@@ -2968,28 +3385,46 @@ elm_widget_scroll_freeze_pop(Evas_Object *obj)
scr_children = elm_widget_scrollable_children_get(obj);
EINA_LIST_FOREACH(scr_children, l, child)
{
- ELM_SCROLLABLE_IFACE_GET(child, s_iface);
- s_iface->freeze_set(child, EINA_FALSE);
+ eo_do(child, elm_scrollable_interface_freeze_set(EINA_FALSE));
}
eina_list_free(scr_children);
}
}
- if (sd->parent_obj) elm_widget_scroll_freeze_pop(sd->parent_obj);
+ if (sd->parent_obj) eo_do(sd->parent_obj, elm_wdg_scroll_freeze_pop());
if (sd->scroll_freeze < 0) sd->scroll_freeze = 0;
}
EAPI int
elm_widget_scroll_freeze_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->scroll_freeze;
+ ELM_WIDGET_CHECK(obj) 0;
+ int ret = 0;
+ eo_do((Eo *) obj, elm_wdg_scroll_freeze_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_scroll_freeze_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->scroll_freeze;
}
EAPI void
elm_widget_scale_set(Evas_Object *obj,
double scale)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_scale_set(scale));
+}
+
+static void
+_elm_widget_scale_set(Eo *obj, void *_pd, va_list *list)
+{
+ double scale = va_arg(*list, double);
+ Elm_Widget_Smart_Data *sd = _pd;
+
if (scale <= 0.0) scale = 0.0;
if (sd->scale != scale)
{
@@ -3001,23 +3436,48 @@ elm_widget_scale_set(Evas_Object *obj,
EAPI double
elm_widget_scale_get(const Evas_Object *obj)
{
- API_ENTRY return 1.0;
+ ELM_WIDGET_CHECK(obj) 1.0;
+ double ret = 1.0;
+ eo_do((Eo *) obj, elm_wdg_scale_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_scale_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Widget_Smart_Data *sd = _pd;
+
// FIXME: save walking up the tree by storing/caching parent scale
if (sd->scale == 0.0)
{
if (sd->parent_obj)
- return elm_widget_scale_get(sd->parent_obj);
+ {
+ *ret = elm_widget_scale_get(sd->parent_obj);
+ return;
+ }
else
- return 1.0;
+ {
+ *ret = 1.0;
+ return;
+ }
}
- return sd->scale;
+ *ret = sd->scale;
}
EAPI void
elm_widget_theme_set(Evas_Object *obj,
Elm_Theme *th)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_theme_set(th));
+}
+
+static void
+_elm_widget_theme_set(Eo *obj, void *_pd, va_list *list)
+{
+ Elm_Theme *th = va_arg(*list, Elm_Theme *);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->theme != th)
{
if (sd->theme) elm_theme_free(sd->theme);
@@ -3032,8 +3492,15 @@ elm_widget_text_part_set(Evas_Object *obj,
const char *part,
const char *label)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_text_part_set(part, label));
+}
+static void
+_elm_widget_text_part_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *part = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
if (evas_object_smart_type_check(obj, "elm_layout"))
elm_layout_text_set(obj, part, label);
}
@@ -3042,12 +3509,19 @@ EAPI const char *
elm_widget_text_part_get(const Evas_Object *obj,
const char *part)
{
- API_ENTRY return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_text_part_get(part, &ret));
+ return ret;
+}
+static void
+_elm_widget_text_part_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *part = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
if (evas_object_smart_type_check(obj, "elm_layout"))
- return elm_layout_text_get(obj, part);
-
- return NULL;
+ *ret = elm_layout_text_get(obj, part);
}
EAPI void
@@ -3056,10 +3530,21 @@ elm_widget_domain_translatable_text_part_set(Evas_Object *obj,
const char *domain,
const char *label)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_domain_translatable_text_part_set(part, domain, label));
+}
+
+static void
+_elm_widget_domain_translatable_text_part_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *part = va_arg(*list, const char *);
+ const char *domain = va_arg(*list, const char *);
+ const char *label = va_arg(*list, const char *);
+
const char *str;
Eina_List *l;
Elm_Translate_String_Data *ts = NULL;
- API_ENTRY return;
+ Elm_Widget_Smart_Data *sd = _pd;
str = eina_stringshare_add(part);
EINA_LIST_FOREACH(sd->translate_strings, l, ts)
@@ -3110,20 +3595,33 @@ EAPI const char *
elm_widget_translatable_text_part_get(const Evas_Object *obj,
const char *part)
{
- const char *str, *ret = NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_translatable_text_part_get(part, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_translatable_text_part_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *part = va_arg(*list, const char *);
+ const char **ret = va_arg(*list, const char **);
+ *ret = NULL;
+
+ const char *str;
Eina_List *l;
Elm_Translate_String_Data *ts;
- API_ENTRY return NULL;
+
+ Elm_Widget_Smart_Data *sd = _pd;
str = eina_stringshare_add(part);
EINA_LIST_FOREACH(sd->translate_strings, l, ts)
if (ts->id == str)
{
- ret = ts->string;
+ *ret = ts->string;
break;
}
eina_stringshare_del(str);
- return ret;
}
EAPI void
@@ -3141,8 +3639,7 @@ elm_widget_translate(Evas_Object *obj)
elm_widget_translate(child);
if (sd->resize_obj) elm_widget_translate(sd->resize_obj);
if (sd->hover_obj) elm_widget_translate(sd->hover_obj);
- if (!sd->api) return;
- sd->api->translate(obj);
+ eo_do(obj, elm_wdg_translate(NULL));
#ifdef HAVE_GETTEXT
EINA_LIST_FOREACH(sd->translate_strings, l, ts)
@@ -3158,45 +3655,43 @@ elm_widget_content_part_set(Evas_Object *obj,
const char *part,
Evas_Object *content)
{
- API_ENTRY return;
-
- if (!sd->api) return;
- if (evas_object_smart_type_check(obj, "elm_container"))
- ELM_CONTAINER_CLASS(sd->api)->content_set(obj, part, content);
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_obj_container_content_set(part, content, NULL));
}
EAPI Evas_Object *
elm_widget_content_part_get(const Evas_Object *obj,
const char *part)
{
- API_ENTRY return NULL;
-
- if (!sd->api) return NULL;
-
- if (evas_object_smart_type_check(obj, "elm_container"))
- return ELM_CONTAINER_CLASS(sd->api)->content_get(obj, part);
-
- return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_container_content_get(part, &ret));
+ return ret;
}
EAPI Evas_Object *
elm_widget_content_part_unset(Evas_Object *obj,
const char *part)
{
- API_ENTRY return NULL;
-
- if (!sd->api) return NULL;
- if (evas_object_smart_type_check(obj, "elm_container"))
- return ELM_CONTAINER_CLASS(sd->api)->content_unset(obj, part);
-
- return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_container_content_unset(part, &ret));
+ return ret;
}
EAPI void
elm_widget_access_info_set(Evas_Object *obj,
const char *txt)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_access_info_set(txt));
+}
+
+static void
+_elm_widget_access_info_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *txt = va_arg(*list, const char *);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->access_info) eina_stringshare_del(sd->access_info);
if (!txt) sd->access_info = NULL;
else sd->access_info = eina_stringshare_add(txt);
@@ -3205,49 +3700,108 @@ elm_widget_access_info_set(Evas_Object *obj,
EAPI const char *
elm_widget_access_info_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
- return sd->access_info;
+ ELM_WIDGET_CHECK(obj) NULL;
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_access_info_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_access_info_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->access_info;
}
EAPI Elm_Theme *
elm_widget_theme_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
+ ELM_WIDGET_CHECK(obj) NULL;
+ Elm_Theme *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_theme_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_theme_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Theme **ret = va_arg(*list, Elm_Theme **);
+ *ret = NULL;
+ Elm_Widget_Smart_Data *sd = _pd;
+
if (!sd->theme)
{
if (sd->parent_obj)
- return elm_widget_theme_get(sd->parent_obj);
+ {
+ *ret = elm_widget_theme_get(sd->parent_obj);
+ return;
+ }
else
- return NULL;
+ return;
}
- return sd->theme;
+ *ret = sd->theme;
}
EAPI Eina_Bool
elm_widget_style_set(Evas_Object *obj,
const char *style)
{
- API_ENTRY return EINA_FALSE;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_style_set(style, &ret));
+ return ret;
+}
+static void
+_elm_widget_style_set(Eo *obj, void *_pd, va_list *list)
+{
+ const char *style = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+ Elm_Widget_Smart_Data *sd = _pd;
if (eina_stringshare_replace(&sd->style, style))
- return elm_widget_theme(obj);
+ {
+ int_ret = elm_widget_theme(obj);
+ if (ret) *ret = int_ret;
+ return;
+ }
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI const char *
elm_widget_style_get(const Evas_Object *obj)
{
- API_ENTRY return NULL;
- if (sd->style) return sd->style;
- return "default";
+ ELM_WIDGET_CHECK(obj) NULL;
+ const char *ret = "default";
+ eo_do((Eo *) obj, elm_wdg_style_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ *ret = "default";
+ Elm_Widget_Smart_Data *sd = _pd;
+ if (sd->style) *ret = sd->style;
}
EAPI void
elm_widget_tooltip_add(Evas_Object *obj,
Elm_Tooltip *tt)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_tooltip_add(tt));
+}
+
+static void
+_elm_widget_tooltip_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Tooltip *tt = va_arg(*list, Elm_Tooltip *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->tooltips = eina_list_append(sd->tooltips, tt);
}
@@ -3255,7 +3809,15 @@ EAPI void
elm_widget_tooltip_del(Evas_Object *obj,
Elm_Tooltip *tt)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_tooltip_del(tt));
+}
+
+static void
+_elm_widget_tooltip_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Tooltip *tt = va_arg(*list, Elm_Tooltip *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->tooltips = eina_list_remove(sd->tooltips, tt);
}
@@ -3263,7 +3825,15 @@ EAPI void
elm_widget_cursor_add(Evas_Object *obj,
Elm_Cursor *cur)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_cursor_add(cur));
+}
+
+static void
+_elm_widget_cursor_add(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Cursor *cur = va_arg(*list, Elm_Cursor *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->cursors = eina_list_append(sd->cursors, cur);
}
@@ -3271,7 +3841,15 @@ EAPI void
elm_widget_cursor_del(Evas_Object *obj,
Elm_Cursor *cur)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_cursor_del(cur));
+}
+
+static void
+_elm_widget_cursor_del(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Cursor *cur = va_arg(*list, Elm_Cursor *);
+ Elm_Widget_Smart_Data *sd = _pd;
sd->cursors = eina_list_remove(sd->cursors, cur);
}
@@ -3279,7 +3857,15 @@ EAPI void
elm_widget_drag_lock_x_set(Evas_Object *obj,
Eina_Bool lock)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_drag_lock_x_set(lock));
+}
+
+static void
+_elm_widget_drag_lock_x_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool lock = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->drag_x_locked == lock) return;
sd->drag_x_locked = lock;
if (sd->drag_x_locked) _propagate_x_drag_lock(obj, 1);
@@ -3290,7 +3876,15 @@ EAPI void
elm_widget_drag_lock_y_set(Evas_Object *obj,
Eina_Bool lock)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_drag_lock_y_set(lock));
+}
+
+static void
+_elm_widget_drag_lock_y_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool lock = va_arg(*list, int);
+ Elm_Widget_Smart_Data *sd = _pd;
if (sd->drag_y_locked == lock) return;
sd->drag_y_locked = lock;
if (sd->drag_y_locked) _propagate_y_drag_lock(obj, 1);
@@ -3300,29 +3894,69 @@ elm_widget_drag_lock_y_set(Evas_Object *obj,
EAPI Eina_Bool
elm_widget_drag_lock_x_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->drag_x_locked;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_drag_lock_x_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_drag_lock_x_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->drag_x_locked;
}
EAPI Eina_Bool
elm_widget_drag_lock_y_get(const Evas_Object *obj)
{
- API_ENTRY return EINA_FALSE;
- return sd->drag_y_locked;
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_wdg_drag_lock_y_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_drag_lock_y_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->drag_y_locked;
}
EAPI int
elm_widget_drag_child_locked_x_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->child_drag_x_locked;
+ ELM_WIDGET_CHECK(obj) 0;
+ int ret = 0;
+ eo_do((Eo *) obj, elm_wdg_drag_child_locked_x_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_drag_child_locked_x_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->child_drag_x_locked;
}
EAPI int
elm_widget_drag_child_locked_y_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->child_drag_y_locked;
+ ELM_WIDGET_CHECK(obj) 0;
+ int ret = 0;
+ eo_do((Eo *) obj, elm_wdg_drag_child_locked_y_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_drag_child_locked_y_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->child_drag_y_locked;
}
EAPI Eina_Bool
@@ -3332,8 +3966,22 @@ elm_widget_theme_object_set(Evas_Object *obj,
const char *welement,
const char *wstyle)
{
- API_ENTRY return EINA_FALSE;
- return _elm_theme_object_set(obj, edj, wname, welement, wstyle);
+ ELM_WIDGET_CHECK(obj) EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_wdg_theme_object_set(edj, wname, welement, wstyle, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_theme_object_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *edj = va_arg(*list, Evas_Object *);
+ const char *wname = va_arg(*list, const char *);
+ const char *welement = va_arg(*list, const char *);
+ const char *wstyle = va_arg(*list, const char *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+
+ *ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
}
EAPI Eina_Bool
@@ -3358,7 +4006,7 @@ elm_widget_type_get(const Evas_Object *obj)
{
API_ENTRY return NULL;
- return evas_object_type_get(obj);
+ return eo_class_name_get(eo_class_get(obj));
}
EAPI Eina_Bool
@@ -3433,9 +4081,21 @@ elm_widget_name_find(const Evas_Object *obj,
const char *name,
int recurse)
{
- API_ENTRY return NULL;
- if (!name) return NULL;
- return _widget_name_find(obj, name, recurse);
+ ELM_WIDGET_CHECK(obj) NULL;
+ Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_wdg_name_find(name, recurse, &ret));
+ return ret;
+}
+
+static void
+_elm_widget_name_find(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ const char *name = va_arg(*list, const char *);
+ int recurse = va_arg(*list, int);
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ *ret = NULL;
+ if (!name) return;
+ *ret = _widget_name_find(obj, name, recurse);
}
/**
@@ -3485,6 +4145,13 @@ elm_widget_stringlist_free(Eina_List *list)
EAPI void
elm_widget_focus_hide_handle(Evas_Object *obj)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_hide_handle());
+}
+
+static void
+_elm_widget_focus_hide_handle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
if (!_elm_widget_is(obj))
return;
_if_focused_revert(obj, EINA_TRUE);
@@ -3500,18 +4167,28 @@ elm_widget_focus_mouse_up_handle(Evas_Object *obj)
o = evas_object_smart_parent_get(o);
}
while (o);
- if (!o) return;
- if (!_is_focusable(o)) return;
- elm_widget_focus_steal(o);
+
+ eo_do(o, elm_wdg_focus_mouse_up_handle());
+}
+
+static void
+_elm_widget_focus_mouse_up_handle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ if (!obj) return;
+ if (!_is_focusable(obj)) return;
+ elm_widget_focus_steal(obj);
}
EAPI void
elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj)
{
- API_ENTRY return;
-
- //FIXME: Need to check whether the object is unfocusable or not.
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_tree_unfocusable_handle());
+}
+static void
+_elm_widget_focus_tree_unfocusable_handle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
if (!elm_widget_parent_get(obj))
elm_widget_focused_object_clear(obj);
else
@@ -3521,16 +4198,31 @@ elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj)
EAPI void
elm_widget_focus_disabled_handle(Evas_Object *obj)
{
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_focus_disabled_handle());
+}
+static void
+_elm_widget_focus_disabled_handle(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
elm_widget_focus_tree_unfocusable_handle(obj);
}
EAPI unsigned int
elm_widget_focus_order_get(const Evas_Object *obj)
{
- API_ENTRY return 0;
- return sd->focus_order;
+ ELM_WIDGET_CHECK(obj) 0;
+ unsigned int ret = 0;
+ eo_do((Eo *) obj, elm_wdg_focus_order_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_focus_order_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ unsigned int *ret = va_arg(*list, unsigned int *);
+ Elm_Widget_Smart_Data *sd = _pd;
+ *ret = sd->focus_order;
}
EAPI void
@@ -3539,11 +4231,11 @@ elm_widget_activate(Evas_Object *obj, Elm_Activate act)
Evas_Object *parent;
Eina_Bool ret;
- API_ENTRY return;
+ ELM_WIDGET_CHECK(obj);
ret = EINA_FALSE;
- if (sd->api->activate)
- ret = sd->api->activate(obj, act);
+
+ eo_do(obj, elm_wdg_activate(act, &ret));
if (ret) return;
@@ -3568,18 +4260,30 @@ elm_widget_activate(Evas_Object *obj, Elm_Activate act)
EAPI Evas_Display_Mode
elm_widget_display_mode_get(const Evas_Object *obj)
{
+ ELM_WIDGET_CHECK(obj) EVAS_DISPLAY_MODE_NONE;
+ Evas_Display_Mode ret = EVAS_DISPLAY_MODE_NONE;
+ eo_do((Eo *) obj, elm_wdg_display_mode_get(&ret));
+ return ret;
+}
+
+static void
+_elm_widget_display_mode_get(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Display_Mode *ret = va_arg(*list, Evas_Display_Mode *);
+ *ret = EVAS_DISPLAY_MODE_NONE;
+
Evas_Display_Mode new_mode;
Evas_Object *parent;
- API_ENTRY return EVAS_DISPLAY_MODE_NONE;
-
new_mode = evas_object_size_hint_display_mode_get(obj);
parent = elm_widget_parent_get(obj);
if ((new_mode == EVAS_DISPLAY_MODE_INHERIT) && parent)
- return elm_widget_display_mode_get(parent);
- return new_mode;
-
+ {
+ *ret = elm_widget_display_mode_get(parent);
+ return;
+ }
+ *ret = new_mode;
}
/**
@@ -3599,11 +4303,20 @@ elm_widget_display_mode_get(const Evas_Object *obj)
EAPI void
elm_widget_display_mode_set(Evas_Object *obj, Evas_Display_Mode dispmode)
{
+ ELM_WIDGET_CHECK(obj);
+ eo_do(obj, elm_wdg_display_mode_set(dispmode));
+}
+
+static void
+_elm_widget_display_mode_set(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Display_Mode dispmode = va_arg(*list, Evas_Display_Mode);
+
Evas_Display_Mode child_mode;
Evas_Object *child;
Eina_List *l;
- API_ENTRY return;
+ Elm_Widget_Smart_Data *sd = _pd;
if (elm_widget_display_mode_get(obj) == dispmode) return;
evas_object_size_hint_display_mode_set(obj, dispmode);
@@ -4463,3 +5176,373 @@ elm_widget_tree_dot_dump(const Evas_Object *top,
(void)output;
#endif
}
+
+static void
+_constructor(Eo *obj, void *class_data EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj, evas_obj_type_set(MY_CLASS_NAME));
+ eo_do(obj, elm_wdg_parent_set(eo_parent_get(obj)));
+}
+
+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;
+}
+
+static void
+_elm_widget_disable(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+}
+
+static void
+_elm_widget_translate(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+}
+
+static void
+_elm_widget_event(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ va_arg(*list, Evas_Object *);
+ va_arg(*list, Evas_Callback_Type);
+ va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+}
+
+static void
+_elm_widget_focus_next_manager_is_unimplemented(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+ WRN("The %s widget does not implement the \"focus_next/focus_next_manager_is\" functions.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+static void
+_elm_widget_focus_direction_manager_is_unimplemented(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_FALSE;
+ WRN("The %s widget does not implement the \"focus_direction/focus_direction_manager_is\" functions.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+static void
+_elm_widget_access(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ va_arg(*list, int);
+}
+
+static void
+_elm_widget_parent_set(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ va_arg(*list, Evas_Object *);
+}
+
+static void
+_elm_widget_activate(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ va_arg(*list, Elm_Activate);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+ WRN("The %s widget does not implement the \"activate\" functions.",
+ eo_class_name_get(eo_class_get(obj)));
+}
+
+static void
+_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_MEMBER_ADD), _elm_widget_smart_member_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_DEL), _elm_widget_smart_member_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_widget_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_widget_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_widget_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_widget_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_widget_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_widget_smart_hide),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_COLOR_SET), _elm_widget_smart_color_set),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_SET), _elm_widget_smart_clip_set),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET), _elm_widget_smart_clip_unset),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CALCULATE), _elm_widget_smart_calculate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_widget_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_widget_disable),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_widget_theme_func),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_widget_translate),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_widget_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS_REGION), _elm_widget_on_focus_region),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_widget_focus_next_manager_is_unimplemented),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_widget_focus_direction_manager_is_unimplemented),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), _elm_widget_sub_object_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), _elm_widget_sub_object_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_widget_access),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), _elm_widget_parent_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), _elm_widget_parent_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT2_SET), _elm_widget_parent2_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT2_GET), _elm_widget_parent2_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_widget_activate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_GET), _elm_widget_mirrored_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_SET), _elm_widget_mirrored_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_GET), _elm_widget_mirrored_automatic_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_SET), _elm_widget_mirrored_automatic_set),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_SET), _elm_widget_highlight_ignore_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET), _elm_widget_highlight_ignore_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET), _elm_widget_highlight_in_theme_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), _elm_widget_highlight_in_theme_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH), _elm_widget_scroll_hold_push),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP), _elm_widget_scroll_hold_pop),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_GET), _elm_widget_scroll_hold_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_PUSH), _elm_widget_scroll_freeze_push),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_POP), _elm_widget_scroll_freeze_pop),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_GET), _elm_widget_scroll_freeze_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_SHOW_REGION_HOOK_SET), _elm_widget_on_show_region_hook_set),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET), _elm_widget_resize_object_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HOVER_OBJECT_SET), _elm_widget_hover_object_set),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_SET), _elm_widget_can_focus_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_GET), _elm_widget_can_focus_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET), _elm_widget_child_can_focus_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_GET), _elm_widget_focus_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET), _elm_widget_focused_object_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOP_GET), _elm_widget_top_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_SET), _elm_widget_focus_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_CLEAR), _elm_widget_focused_object_clear),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_STEAL), _elm_widget_focus_steal),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_RESTORE), _elm_widget_focus_restore),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLED_SET), _elm_widget_disabled_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLED_GET), _elm_widget_disabled_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_SET), _elm_widget_show_region_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_GET), _elm_widget_show_region_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET), _elm_widget_scrollable_children_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_SET), _elm_widget_scale_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_GET), _elm_widget_scale_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TEXT_PART_SET), _elm_widget_text_part_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TEXT_PART_GET), _elm_widget_text_part_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DOMAIN_TRANSLATABLE_TEXT_PART_SET), _elm_widget_domain_translatable_text_part_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATABLE_TEXT_PART_GET), _elm_widget_translatable_text_part_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_INFO_SET), _elm_widget_access_info_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_INFO_GET), _elm_widget_access_info_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_SET), _elm_widget_theme_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_GET), _elm_widget_theme_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_STYLE_SET), _elm_widget_style_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_STYLE_GET), _elm_widget_style_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOOLTIP_ADD), _elm_widget_tooltip_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOOLTIP_DEL), _elm_widget_tooltip_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CURSOR_ADD), _elm_widget_cursor_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CURSOR_DEL), _elm_widget_cursor_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_SET), _elm_widget_drag_lock_x_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_SET), _elm_widget_drag_lock_y_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_GET), _elm_widget_drag_lock_x_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_GET), _elm_widget_drag_lock_y_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_X_GET), _elm_widget_drag_child_locked_x_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_Y_GET), _elm_widget_drag_child_locked_y_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_ADD), _elm_widget_event_callback_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_DEL), _elm_widget_event_callback_del),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_PROPAGATE), _elm_widget_event_propagate),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_EMIT), _elm_widget_signal_emit),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_ADD), _elm_widget_signal_callback_add),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_DEL), _elm_widget_signal_callback_del),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_NAME_FIND), _elm_widget_name_find),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_HIDE_HANDLE), _elm_widget_focus_hide_handle),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_MOUSE_UP_HANDLE), _elm_widget_focus_mouse_up_handle),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_TREE_UNFOCUSABLE_HANDLE), _elm_widget_focus_tree_unfocusable_handle),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DISABLED_HANDLE), _elm_widget_focus_disabled_handle),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_ORDER_GET), _elm_widget_focus_order_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_REGION_GET), _elm_widget_focus_region_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_OBJECT_SET), _elm_widget_theme_object_set),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_SET), _elm_widget_focus_custom_chain_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_GET), _elm_widget_focus_custom_chain_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_UNSET), _elm_widget_focus_custom_chain_unset),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_APPEND), _elm_widget_focus_custom_chain_append),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_PREPEND), _elm_widget_focus_custom_chain_prepend),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CYCLE), _elm_widget_focus_cycle),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GO), _elm_widget_focus_direction_go),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GET), _elm_widget_focus_direction_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET), _elm_widget_focus_list_direction_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET), _elm_widget_focus_next_get),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET), _elm_widget_focus_list_next_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET), _elm_widget_display_mode_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET), _elm_widget_display_mode_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_SET), _elm_widget_tree_unfocusable_set),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_GET), _elm_widget_tree_unfocusable_get),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_CHILD_LIST_GET), _elm_widget_can_focus_child_list_get),
+
+ EO_OP_FUNC_SENTINEL
+ };
+
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ON_FOCUS, "'Virtual' function handling focus in/out events on the widget."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISABLE, "'Virtual' function on the widget being disabled."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_THEME, "'Virtual' function on the widget being re-themed."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TRANSLATE, "'Virtual' function handling language changes on Elementary."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_EVENT, "'Virtual' function handling input events on the widget."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ON_FOCUS_REGION, "'Virtual' function returning an inner area of a widget that should be brought into the visible are of a broader viewport, may this context arise."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS, "'Virtual' function which checks if handling of passing focus to sub-objects is supported by widget."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_NEXT, "'Virtual' function handling passing focus to sub-objects."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS, "'Virtual' function which checks if handling of passing focus to sub-objects in given direction is supported by widget."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION,"'Virtual' function handling passing focus to sub-objects given a direction, in degrees."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD, "'Virtual' function handling sub objects being added."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL, "'Virtual' function handling sub objects being removed."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACCESS, "'Virtual' function on the widget being set access."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT_SET, "'Virtual' function handling parent widget attachment to new object."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT_GET, "'Virtual' function handling getting object's parent widget."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT2_SET, ""),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT2_GET, ""),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACTIVATE, "'Virtual' function to activate widget."),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_MIRRORED_GET, "Returns the widget's mirrored mode."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_MIRRORED_SET, "Sets the widget's mirrored mode."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_GET, "Returns the widget's mirrored mode setting."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_SET, "Sets the widget's mirrored mode setting."),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_HOLD_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_PUSH, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_POP, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ON_SHOW_REGION_HOOK_SET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_HOVER_OBJECT_SET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CAN_FOCUS_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CAN_FOCUS_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TOP_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_PARENT_WIDGET_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_CLEAR, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_STEAL, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_RESTORE, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISABLED_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISABLED_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SHOW_REGION_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SHOW_REGION_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCALE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SCALE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TEXT_PART_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TEXT_PART_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DOMAIN_TRANSLATABLE_TEXT_PART_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TRANSLATABLE_TEXT_PART_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACCESS_INFO_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_ACCESS_INFO_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_THEME_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_THEME_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_STYLE_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_STYLE_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TOOLTIP_ADD, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TOOLTIP_DEL, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CURSOR_ADD, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CURSOR_DEL, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_SET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_X_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_Y_GET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_ADD, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_DEL, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_EVENT_PROPAGATE, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SIGNAL_EMIT, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_ADD, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_DEL, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_NAME_FIND, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_HIDE_HANDLE, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_MOUSE_UP_HANDLE, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_TREE_UNFOCUSABLE_HANDLE, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_DISABLED_HANDLE, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_ORDER_GET, "description here"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_REGION_GET, "Get the focus region of the given widget."),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_THEME_OBJECT_SET, "description here"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_SET, "Set custom focus chain."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_GET, "Get custom focus chain."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_UNSET, "Unset custom focus chain."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_APPEND, "Append object to custom focus chain."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_PREPEND, "Prepend object to custom focus chain."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_CYCLE, "Give focus to next object in object tree."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GO, "Give focus to near object(in object tree) in one direction."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GET, "Get near object in one direction of base object."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET, "Get near object in one direction of base object in list."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET, "Get next object in focus chain of object tree."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET, "Get next object in focus chain of object tree in list."),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET, "Sets the widget and child widget's Evas_Display_Mode."),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET, "Returns the widget's Evas_Display_Mode"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_SET, "Sets the widget object and its children to be unfocusable"),
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_GET, "Returns true, if the object sub-tree is unfocusable"),
+
+ EO_OP_DESCRIPTION(ELM_WIDGET_SUB_ID_CAN_FOCUS_CHILD_LIST_GET, "Get the list of focusable child objects."),
+
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR_NO_INSTANT,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_WIDGET_BASE_ID, op_desc, ELM_WIDGET_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Widget_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_widget_class_get, &class_desc, EVAS_OBJ_SMART_CLASS, NULL);
+
diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h
index 1a70143b5..b3b733f77 100644
--- a/src/lib/elm_widget.h
+++ b/src/lib/elm_widget.h
@@ -302,93 +302,6 @@
* @{
*/
-/**
- * @def ELM_WIDGET_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Widget_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_WIDGET_CLASS(x) ((Elm_Widget_Smart_Class *) x)
-
-/**
- * @def ELM_WIDGET_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Widget_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_WIDGET_DATA(x) ((Elm_Widget_Smart_Data *) x)
-
-/**
- * @def ELM_WIDGET_SMART_CLASS_VERSION
- *
- * Current version for Elementary widget @b base smart class, a value
- * which goes to _Elm_Widget_Smart_Class::version.
- *
- * @ingroup Wiget
- */
-#define ELM_WIDGET_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_WIDGET_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Widget_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_VERSION
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_WIDGET_SMART_CLASS_INIT_NULL
- * @see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_WIDGET_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_WIDGET_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
-
-/**
- * @def ELM_WIDGET_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Widget_Smart_Class structure.
- *
- * @see ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_WIDGET_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_WIDGET_SMART_CLASS_INIT_NULL \
- ELM_WIDGET_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Widget_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_WIDGET_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Widget_Smart_Class (base field)
- * to the latest #ELM_WIDGET_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_WIDGET_SMART_CLASS_INIT_NULL
- * @see ELM_WIDGET_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_WIDGET_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name))
-
/* Elm_Activate is used in 'Virtual' function Eina_Bool (*activate)
* (Evas_Object *obj, Elm_Activate act); of Elm_Widget_Smart_Class */
typedef enum
@@ -456,8 +369,6 @@ typedef struct _Elm_Widget_Smart_Class
*/
typedef struct _Elm_Widget_Smart_Data
{
- const Elm_Widget_Smart_Class *api; /**< This is the pointer to the object's class, from where we can reach/call its class functions */
-
Evas_Object *obj;
Evas_Object *parent_obj;
Evas_Object *parent2;
@@ -827,8 +738,15 @@ EAPI Eina_List *elm_widget_scrollable_children_get(Evas_Object *obj);
EAPI void elm_widget_tree_dump(const Evas_Object *top);
EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *output);
-#define ELM_WIDGET_DATA_GET(o, sd) \
- Elm_Widget_Smart_Data * sd = evas_object_smart_data_get(o)
+
+#define ELM_WIDGET_DATA_GET_NO_INST(o, wd) \
+ wd = (o && eo_isa(o, ELM_OBJ_WIDGET_CLASS) ? \
+ eo_data_get(o, ELM_OBJ_WIDGET_CLASS) : \
+ NULL)
+
+#define ELM_WIDGET_DATA_GET(o, wd) \
+ Elm_Widget_Smart_Data *wd; \
+ ELM_WIDGET_DATA_GET_NO_INST(o, wd)
#define ELM_WIDGET_DATA_GET_OR_RETURN(o, ptr) \
ELM_WIDGET_DATA_GET(o, ptr); \
@@ -839,6 +757,10 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
return; \
}
+#define ELM_WIDGET_CHECK(obj) \
+ if (!obj || !eo_isa((obj), ELM_OBJ_WIDGET_CLASS)) \
+ return
+
/**
* Convenience macro to create new widget item, doing casts for you.
* @see _elm_widget_item_new()
@@ -1078,4 +1000,287 @@ EAPI Eina_Bool elm_drop_target_del(Evas_Object *widget);
EAPI Eina_Bool elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data, void (*dragdone) (void *data, Evas_Object *), void *donecbdata);
EAPI Eina_Bool elm_selection_selection_has_owner(Evas_Object *obj);
+#define ELM_OBJ_WIDGET_CLASS elm_widget_class_get()
+
+const Eo_Class *elm_widget_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_WIDGET_BASE_ID;
+
+enum
+{
+ ELM_WIDGET_SUB_ID_ON_FOCUS,
+ ELM_WIDGET_SUB_ID_DISABLE,
+ ELM_WIDGET_SUB_ID_THEME,
+ ELM_WIDGET_SUB_ID_TRANSLATE,
+ ELM_WIDGET_SUB_ID_EVENT,
+ ELM_WIDGET_SUB_ID_ON_FOCUS_REGION,
+ ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS,
+ ELM_WIDGET_SUB_ID_FOCUS_NEXT,
+ ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS,
+ ELM_WIDGET_SUB_ID_FOCUS_DIRECTION,
+ ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD,
+ ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL,
+ ELM_WIDGET_SUB_ID_ACCESS,
+ ELM_WIDGET_SUB_ID_PARENT_SET,
+ ELM_WIDGET_SUB_ID_PARENT_GET,
+ ELM_WIDGET_SUB_ID_PARENT2_SET,
+ ELM_WIDGET_SUB_ID_PARENT2_GET,
+ ELM_WIDGET_SUB_ID_ACTIVATE,
+
+ ELM_WIDGET_SUB_ID_MIRRORED_GET,
+ ELM_WIDGET_SUB_ID_MIRRORED_SET,
+ ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_GET,
+ ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_SET,
+
+ ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_SET,
+ ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET,
+ ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET,
+ ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET,
+
+ ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH,
+ ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP,
+ ELM_WIDGET_SUB_ID_SCROLL_HOLD_GET,
+ ELM_WIDGET_SUB_ID_SCROLL_FREEZE_PUSH,
+ ELM_WIDGET_SUB_ID_SCROLL_FREEZE_POP,
+ ELM_WIDGET_SUB_ID_SCROLL_FREEZE_GET,
+
+ ELM_WIDGET_SUB_ID_ON_SHOW_REGION_HOOK_SET,
+ ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET,
+ ELM_WIDGET_SUB_ID_HOVER_OBJECT_SET,
+
+ ELM_WIDGET_SUB_ID_CAN_FOCUS_SET,
+ ELM_WIDGET_SUB_ID_CAN_FOCUS_GET,
+ ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_GET,
+ ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET,
+ ELM_WIDGET_SUB_ID_TOP_GET,
+
+ ELM_WIDGET_SUB_ID_PARENT_WIDGET_GET,
+
+ ELM_WIDGET_SUB_ID_FOCUS_SET,
+ ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_CLEAR,
+ ELM_WIDGET_SUB_ID_FOCUS_STEAL,
+ ELM_WIDGET_SUB_ID_FOCUS_RESTORE,
+
+ ELM_WIDGET_SUB_ID_DISABLED_SET,
+ ELM_WIDGET_SUB_ID_DISABLED_GET,
+ ELM_WIDGET_SUB_ID_SHOW_REGION_SET,
+ ELM_WIDGET_SUB_ID_SHOW_REGION_GET,
+
+ ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET,
+ ELM_WIDGET_SUB_ID_SCALE_SET,
+ ELM_WIDGET_SUB_ID_SCALE_GET,
+
+ ELM_WIDGET_SUB_ID_TEXT_PART_SET,
+ ELM_WIDGET_SUB_ID_TEXT_PART_GET,
+ ELM_WIDGET_SUB_ID_DOMAIN_TRANSLATABLE_TEXT_PART_SET,
+ ELM_WIDGET_SUB_ID_TRANSLATABLE_TEXT_PART_GET,
+ ELM_WIDGET_SUB_ID_ACCESS_INFO_SET,
+ ELM_WIDGET_SUB_ID_ACCESS_INFO_GET,
+
+ ELM_WIDGET_SUB_ID_THEME_SET,
+ ELM_WIDGET_SUB_ID_THEME_GET,
+
+ ELM_WIDGET_SUB_ID_STYLE_SET,
+ ELM_WIDGET_SUB_ID_STYLE_GET,
+ ELM_WIDGET_SUB_ID_TOOLTIP_ADD,
+ ELM_WIDGET_SUB_ID_TOOLTIP_DEL,
+ ELM_WIDGET_SUB_ID_CURSOR_ADD,
+ ELM_WIDGET_SUB_ID_CURSOR_DEL,
+
+ ELM_WIDGET_SUB_ID_DRAG_LOCK_X_SET,
+ ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_SET,
+ ELM_WIDGET_SUB_ID_DRAG_LOCK_X_GET,
+ ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_GET,
+ ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_X_GET,
+ ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_Y_GET,
+
+ ELM_WIDGET_SUB_ID_EVENT_CALLBACK_ADD,
+ ELM_WIDGET_SUB_ID_EVENT_CALLBACK_DEL,
+ ELM_WIDGET_SUB_ID_EVENT_PROPAGATE,
+
+ ELM_WIDGET_SUB_ID_SIGNAL_EMIT,
+ ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_ADD,
+ ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_DEL,
+
+ ELM_WIDGET_SUB_ID_NAME_FIND,
+
+ ELM_WIDGET_SUB_ID_FOCUS_HIDE_HANDLE,
+ ELM_WIDGET_SUB_ID_FOCUS_MOUSE_UP_HANDLE,
+ ELM_WIDGET_SUB_ID_FOCUS_TREE_UNFOCUSABLE_HANDLE,
+ ELM_WIDGET_SUB_ID_FOCUS_DISABLED_HANDLE,
+ ELM_WIDGET_SUB_ID_FOCUS_ORDER_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_REGION_GET,
+
+ ELM_WIDGET_SUB_ID_THEME_OBJECT_SET,
+/* internal */
+ ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_SET,
+ ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_UNSET,
+ ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_APPEND,
+ ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_PREPEND,
+ ELM_WIDGET_SUB_ID_FOCUS_CYCLE,
+ ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GO,
+ ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET,
+ ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET,
+
+ ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET,
+ ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET,
+
+ ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_SET,
+ ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_GET,
+
+ ELM_WIDGET_SUB_ID_CAN_FOCUS_CHILD_LIST_GET,
+#if 0
+ ELM_WIDGET_SUB_ID_THEME, /* API + virtual*/
+ ELM_WIDGET_SUB_ID_THEME_SPECIFIC,
+ ELM_WIDGET_SUB_ID_TRANSLATE, /* API + virtual*/
+#endif
+
+
+ ELM_WIDGET_SUB_ID_LAST
+};
+
+typedef void (*region_hook_func_type)(void *data, Evas_Object *obj);
+typedef void * (*list_data_get_func_type)(const Eina_List * l);
+#define ELM_WIDGET_ID(sub_id) (ELM_WIDGET_BASE_ID + sub_id)
+
+#define elm_wdg_on_focus(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_disable(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_theme(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_translate(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_event(source, type, event_info, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), EO_TYPECHECK(Evas_Object *, source), EO_TYPECHECK(Evas_Callback_Type, type), EO_TYPECHECK(void *, event_info), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_on_focus_region(x, y, w, h, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS_REGION), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focus_next_manager_is(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focus_next(dir, next, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), EO_TYPECHECK(Elm_Focus_Direction, dir), EO_TYPECHECK(Evas_Object **, next), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focus_direction_manager_is(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focus_direction(base, degree, direction, weight, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), EO_TYPECHECK(const Evas_Object *, base), EO_TYPECHECK(double, degree), EO_TYPECHECK(Evas_Object **, direction), EO_TYPECHECK(double *, weight), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_sub_object_add(sobj, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_ADD), EO_TYPECHECK(Evas_Object *, sobj), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_sub_object_del(sobj, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SUB_OBJECT_DEL), EO_TYPECHECK(Evas_Object *, sobj), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_access(is_access) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), EO_TYPECHECK(Eina_Bool, is_access)
+
+#define elm_wdg_parent_set(parent) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+#define elm_wdg_parent_get(parent) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), EO_TYPECHECK(Evas_Object **, parent)
+
+#define elm_wdg_parent2_set(parent) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_SET), EO_TYPECHECK(Evas_Object *, parent)
+#define elm_wdg_parent2_get(parent) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_GET), EO_TYPECHECK(Evas_Object **, parent)
+
+#define elm_wdg_activate(act, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), EO_TYPECHECK(Elm_Activate, act), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_mirrored_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_mirrored_set(mirrored) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_SET), EO_TYPECHECK(Eina_Bool, mirrored)
+#define elm_wdg_mirrored_automatic_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_mirrored_automatic_set(automatic) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_MIRRORED_AUTOMATIC_SET), EO_TYPECHECK(Eina_Bool, automatic)
+
+#define elm_wdg_highlight_ignore_set(ignore) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_SET), EO_TYPECHECK(Eina_Bool, ignore)
+#define elm_wdg_highlight_ignore_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IGNORE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_highlight_in_theme_set(highlight) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_SET), EO_TYPECHECK(Eina_Bool, highlight)
+#define elm_wdg_highlight_in_theme_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HIGHLIGHT_IN_THEME_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_scroll_hold_push() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_PUSH)
+#define elm_wdg_scroll_hold_pop() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_POP)
+#define elm_wdg_scroll_hold_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_HOLD_GET), EO_TYPECHECK(int *, ret)
+#define elm_wdg_scroll_freeze_push() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_PUSH)
+#define elm_wdg_scroll_freeze_pop() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_POP)
+#define elm_wdg_scroll_freeze_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLL_FREEZE_GET), EO_TYPECHECK(int *, ret)
+
+#define elm_wdg_on_show_region_hook_set(func, data) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_SHOW_REGION_HOOK_SET), EO_TYPECHECK(region_hook_func_type, func), EO_TYPECHECK(void *, data)
+#define elm_wdg_resize_object_set(sobj) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET), EO_TYPECHECK(Evas_Object *, sobj)
+#define elm_wdg_hover_object_set(sobj) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_HOVER_OBJECT_SET), EO_TYPECHECK(Evas_Object *, sobj)
+
+#define elm_wdg_can_focus_set(can_focus) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_SET), EO_TYPECHECK(Eina_Bool, can_focus)
+#define elm_wdg_can_focus_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_child_can_focus_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CHILD_CAN_FOCUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_focus_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focused_object_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+#define elm_wdg_top_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOP_GET), EO_TYPECHECK(Evas_Object **, ret)
+#define elm_wdg_parent_widget_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_PARENT_WIDGET_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+#define elm_wdg_focus_set(first) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_SET), EO_TYPECHECK(int, first)
+#define elm_wdg_focused_object_clear() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUSED_OBJECT_CLEAR)
+#define elm_wdg_focus_steal() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_STEAL)
+#define elm_wdg_focus_restore() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_RESTORE)
+
+#define elm_wdg_disabled_set(disabled) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLED_SET), EO_TYPECHECK(Eina_Bool, disabled)
+#define elm_wdg_disabled_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_show_region_set(x, y, w, h, forceshow) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_SET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h), EO_TYPECHECK(Eina_Bool, forceshow)
+#define elm_wdg_show_region_get(x, y, w, h) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SHOW_REGION_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h)
+
+#define elm_wdg_scrollable_children_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCROLLABLE_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret)
+#define elm_wdg_scale_set(scale) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_SET), EO_TYPECHECK(double, scale)
+#define elm_wdg_scale_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SCALE_GET), EO_TYPECHECK(double *, ret)
+
+#define elm_wdg_text_part_set(part, label) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TEXT_PART_SET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char *, label)
+#define elm_wdg_text_part_get(part, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TEXT_PART_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char **, ret)
+
+#define elm_wdg_domain_translatable_text_part_set(part, domain, label) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DOMAIN_TRANSLATABLE_TEXT_PART_SET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char *, domain), EO_TYPECHECK(const char *, label)
+#define elm_wdg_translatable_text_part_get(part, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATABLE_TEXT_PART_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(const char **, ret)
+
+#define elm_wdg_access_info_set(txt) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_INFO_SET), EO_TYPECHECK(const char *, txt)
+#define elm_wdg_access_info_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS_INFO_GET), EO_TYPECHECK(const char **, ret)
+
+#define elm_wdg_theme_set(th) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_SET), EO_TYPECHECK(Elm_Theme *, th)
+#define elm_wdg_theme_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_GET), EO_TYPECHECK(Elm_Theme **, ret)
+
+#define elm_wdg_style_set(style, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_STYLE_SET), EO_TYPECHECK(const char *, style), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_style_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_STYLE_GET), EO_TYPECHECK(const char **, ret)
+#define elm_wdg_tooltip_add(tt) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOOLTIP_ADD), EO_TYPECHECK(Elm_Tooltip *, tt)
+#define elm_wdg_tooltip_del(tt) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TOOLTIP_DEL), EO_TYPECHECK(Elm_Tooltip *, tt)
+#define elm_wdg_cursor_add(cur) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CURSOR_ADD), EO_TYPECHECK(Elm_Cursor *, cur)
+#define elm_wdg_cursor_del(cur) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CURSOR_DEL), EO_TYPECHECK(Elm_Cursor *, cur)
+
+#define elm_wdg_drag_lock_x_set(lock) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_SET), EO_TYPECHECK(Eina_Bool, lock)
+#define elm_wdg_drag_lock_y_set(lock) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_SET), EO_TYPECHECK(Eina_Bool, lock)
+#define elm_wdg_drag_lock_x_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_X_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_drag_lock_y_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_LOCK_Y_GET), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_drag_child_locked_x_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_X_GET), EO_TYPECHECK(int *, ret)
+#define elm_wdg_drag_child_locked_y_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DRAG_CHILD_LOCKED_Y_GET), EO_TYPECHECK(int *, ret)
+
+#define elm_wdg_event_callback_add(func, data) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_ADD), EO_TYPECHECK(Elm_Event_Cb, func), EO_TYPECHECK(const void *, data)
+#define elm_wdg_event_callback_del(func, data, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_CALLBACK_DEL), EO_TYPECHECK(Elm_Event_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(void **, ret)
+#define elm_wdg_event_propagate(type, event_info, event_flags, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT_PROPAGATE), EO_TYPECHECK(Evas_Callback_Type, type), EO_TYPECHECK(void *, event_info), EO_TYPECHECK(Evas_Event_Flags *, event_flags), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_signal_emit(emission, source) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_EMIT), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source)
+#define elm_wdg_signal_callback_add(emission, source, func, data) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_ADD), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source), EO_TYPECHECK(Edje_Signal_Cb, func), EO_TYPECHECK(void *, data)
+#define elm_wdg_signal_callback_del(emission, source, func, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_SIGNAL_CALLBACK_DEL), EO_TYPECHECK(const char *, emission), EO_TYPECHECK(const char *, source), EO_TYPECHECK(Edje_Signal_Cb, func), EO_TYPECHECK(void **, ret)
+
+#define elm_wdg_name_find(name, recurse, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_NAME_FIND), EO_TYPECHECK(const char *, name), EO_TYPECHECK(int, recurse), EO_TYPECHECK(Evas_Object **, ret)
+
+#define elm_wdg_focus_hide_handle() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_HIDE_HANDLE)
+#define elm_wdg_focus_mouse_up_handle() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_MOUSE_UP_HANDLE)
+#define elm_wdg_focus_tree_unfocusable_handle() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_TREE_UNFOCUSABLE_HANDLE)
+#define elm_wdg_focus_disabled_handle() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DISABLED_HANDLE)
+#define elm_wdg_focus_order_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_ORDER_GET), EO_TYPECHECK(unsigned int *, ret)
+#define elm_wdg_focus_region_get(x, y, w, h, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_REGION_GET), EO_TYPECHECK(Evas_Coord *, x), EO_TYPECHECK(Evas_Coord *, y), EO_TYPECHECK(Evas_Coord *, w), EO_TYPECHECK(Evas_Coord *, h), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_theme_object_set(edj, wname, welement, wstyle, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME_OBJECT_SET), EO_TYPECHECK(Evas_Object *, edj), EO_TYPECHECK(const char *, wname), EO_TYPECHECK(const char *, welement), EO_TYPECHECK(const char *, wstyle), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_focus_custom_chain_set(objs) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_SET), EO_TYPECHECK(Eina_List *, objs)
+#define elm_wdg_focus_custom_chain_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_GET), EO_TYPECHECK(const Eina_List **, ret)
+#define elm_wdg_focus_custom_chain_unset() ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_UNSET)
+#define elm_wdg_focus_custom_chain_append(child, relative_child) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_APPEND), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Evas_Object *, relative_child)
+#define elm_wdg_focus_custom_chain_prepend(child, relative_child) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CUSTOM_CHAIN_PREPEND), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Evas_Object *, relative_child)
+#define elm_wdg_focus_cycle(dir) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_CYCLE), EO_TYPECHECK(Elm_Focus_Direction, dir)
+#define elm_wdg_focus_direction_go(degree, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GO), EO_TYPECHECK(double, degree), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_wdg_focus_direction_get(base, degree, direction, weight, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_GET), EO_TYPECHECK(const Evas_Object *, base), EO_TYPECHECK(double, degree), EO_TYPECHECK(Evas_Object **, direction), EO_TYPECHECK(double *, weight), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_focus_list_direction_get(base, items, list_data_get, degree, direction, weight, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_DIRECTION_GET), EO_TYPECHECK(const Evas_Object *, base), EO_TYPECHECK(const Eina_List *, items), EO_TYPECHECK(list_data_get_func_type, list_data_get), EO_TYPECHECK(double, degree), EO_TYPECHECK(Evas_Object **, direction), EO_TYPECHECK(double *, weight), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_focus_next_get(dir, next, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_GET), EO_TYPECHECK(Elm_Focus_Direction, dir), EO_TYPECHECK(Evas_Object **, next), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_focus_list_next_get(items, list_data_get, dir, next, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_LIST_NEXT_GET), EO_TYPECHECK(const Eina_List *, items), EO_TYPECHECK(list_data_get_func_type, list_data_get), EO_TYPECHECK(Elm_Focus_Direction, dir), EO_TYPECHECK(Evas_Object **, next), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_display_mode_set(dispmode) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_SET), EO_TYPECHECK(Evas_Display_Mode, dispmode)
+#define elm_wdg_display_mode_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISPLAY_MODE_GET), EO_TYPECHECK(Evas_Display_Mode *, ret)
+
+#define elm_wdg_tree_unfocusable_set(tree_unfocusable) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_SET), EO_TYPECHECK(Eina_Bool, tree_unfocusable)
+#define elm_wdg_tree_unfocusable_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TREE_UNFOCUSABLE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+#define elm_wdg_can_focus_child_list_get(ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_CAN_FOCUS_CHILD_LIST_GET), EO_TYPECHECK(Eina_List **, ret)
+
#endif
+
diff --git a/src/lib/elm_widget_actionslider.h b/src/lib/elm_widget_actionslider.h
index 0eb29600b..cd3943760 100644
--- a/src/lib/elm_widget_actionslider.h
+++ b/src/lib/elm_widget_actionslider.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_ACTIONSLIDER_H
#define ELM_WIDGET_ACTIONSLIDER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_ACTIONSLIDER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Actionslider_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_CLASS(x) ((Elm_Actionslider_Smart_Class *)x)
-
-/**
- * @def ELM_ACTIONSLIDER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Actionslider_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_DATA(x) ((Elm_Actionslider_Smart_Data *)x)
-
-/**
- * @def ELM_ACTIONSLIDER_SMART_CLASS_VERSION
- *
- * Current version for Elementary actionslider @b base smart class, a value
- * which goes to _Elm_Actionslider_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_ACTIONSLIDER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Actionslider_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT_NULL
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_ACTIONSLIDER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_ACTIONSLIDER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Actionslider_Smart_Class structure.
- *
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_SMART_CLASS_INIT_NULL \
- ELM_ACTIONSLIDER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_ACTIONSLIDER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Actionslider_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_ACTIONSLIDER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Actionslider_Smart_Class (base field)
- * to the latest #ELM_ACTIONSLIDER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT_NULL
- * @see ELM_ACTIONSLIDER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ACTIONSLIDER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_ACTIONSLIDER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary actionslider base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a actionslider.
- *
- * All of the functions listed on @ref Actionslider namespace will work for
- * objects deriving from #Elm_Actionslider_Smart_Class.
- */
-typedef struct _Elm_Actionslider_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Actionslider_Smart_Class;
-
-/**
* Base layout smart data extended with actionslider instance data.
*/
typedef struct _Elm_Actionslider_Smart_Data Elm_Actionslider_Smart_Data;
struct _Elm_Actionslider_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *drag_button_base;
Elm_Actionslider_Pos magnet_position, enabled_position;
Ecore_Animator *button_animator;
@@ -135,11 +32,8 @@ struct _Elm_Actionslider_Smart_Data
* @}
*/
-EAPI extern const char ELM_ACTIONSLIDER_SMART_NAME[];
-EAPI const Elm_Actionslider_Smart_Class *elm_actionslider_smart_class_get(void);
-
#define ELM_ACTIONSLIDER_DATA_GET(o, sd) \
- Elm_Actionslider_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Actionslider_Smart_Data * sd = eo_data_get(o, ELM_OBJ_ACTIONSLIDER_CLASS)
#define ELM_ACTIONSLIDER_DATA_GET_OR_RETURN(o, ptr) \
ELM_ACTIONSLIDER_DATA_GET(o, ptr); \
@@ -159,9 +53,8 @@ EAPI const Elm_Actionslider_Smart_Class *elm_actionslider_smart_class_get(void);
return val; \
}
-#define ELM_ACTIONSLIDER_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_ACTIONSLIDER_SMART_NAME, __func__)) \
+#define ELM_ACTIONSLIDER_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_ACTIONSLIDER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_bg.h b/src/lib/elm_widget_bg.h
index f5d347aa2..77ff381eb 100644
--- a/src/lib/elm_widget_bg.h
+++ b/src/lib/elm_widget_bg.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_BG_H
#define ELM_WIDGET_BG_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_BG_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Bg_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BG_CLASS(x) ((Elm_Bg_Smart_Class *)x)
-
-/**
- * @def ELM_BG_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Bg_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BG_DATA(x) ((Elm_Bg_Smart_Data *)x)
-
-/**
- * @def ELM_BG_SMART_CLASS_VERSION
- *
- * Current version for Elementary bg @b base smart class, a value
- * which goes to _Elm_Bg_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_BG_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_BG_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Bg_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BG_SMART_CLASS_INIT_NULL
- * @see ELM_BG_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_BG_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_BG_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_BG_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Bg_Smart_Class structure.
- *
- * @see ELM_BG_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BG_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BG_SMART_CLASS_INIT_NULL \
- ELM_BG_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_BG_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Bg_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_BG_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Bg_Smart_Class (base field)
- * to the latest #ELM_BG_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_BG_SMART_CLASS_INIT_NULL
- * @see ELM_BG_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BG_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_BG_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary bg base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a bg.
- *
- * All of the functions listed on @ref Bg namespace will work for
- * objects deriving from #Elm_Bg_Smart_Class.
- */
-typedef struct _Elm_Bg_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Bg_Smart_Class;
-
-/**
* Base layout smart data extended with bg instance data.
*/
typedef struct _Elm_Bg_Smart_Data Elm_Bg_Smart_Data;
struct _Elm_Bg_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
/* the basic background's edje object has three swallow spots, namely:
* - "elm.swallow.rectangle" (elm_bg_color_set),
* - "elm.swallow.background" (elm_bg_file_set) and
@@ -144,11 +41,8 @@ struct _Elm_Bg_Smart_Data
* @}
*/
-EAPI extern const char ELM_BG_SMART_NAME[];
-EAPI const Elm_Bg_Smart_Class *elm_bg_smart_class_get(void);
-
#define ELM_BG_DATA_GET(o, sd) \
- Elm_Bg_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Bg_Smart_Data * sd = eo_data_get(o, ELM_OBJ_BG_CLASS)
#define ELM_BG_DATA_GET_OR_RETURN(o, ptr) \
ELM_BG_DATA_GET(o, ptr); \
@@ -168,9 +62,8 @@ EAPI const Elm_Bg_Smart_Class *elm_bg_smart_class_get(void);
return val; \
}
-#define ELM_BG_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_BG_SMART_NAME, \
- __func__)) \
+#define ELM_BG_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_BG_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_box.h b/src/lib/elm_widget_box.h
index 3c25c95d7..f83b6fbfa 100644
--- a/src/lib/elm_widget_box.h
+++ b/src/lib/elm_widget_box.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_BOX_H
#define ELM_WIDGET_BOX_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,115 +15,11 @@
*/
/**
- * @def ELM_BOX_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Box_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BOX_CLASS(x) ((Elm_Box_Smart_Class *) x)
-
-/**
- * @def ELM_BOX_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Box_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BOX_DATA(x) ((Elm_Box_Smart_Data *) x)
-
-/**
- * @def ELM_BOX_SMART_CLASS_VERSION
- *
- * Current version for Elementary box @b base smart class, a value
- * which goes to _Elm_Box_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_BOX_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_BOX_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Box_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BOX_SMART_CLASS_INIT_NULL
- * @see ELM_BOX_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_BOX_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_BOX_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_BOX_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Box_Smart_Class structure.
- *
- * @see ELM_BOX_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BOX_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BOX_SMART_CLASS_INIT_NULL \
- ELM_BOX_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_BOX_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Box_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_BOX_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Box_Smart_Class (base field)
- * to the latest #ELM_BOX_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_BOX_SMART_CLASS_INIT_NULL
- * @see ELM_BOX_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BOX_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_BOX_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary box base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a box.
- *
- * All of the functions listed on @ref Box namespace will work for
- * objects deriving from #Elm_Box_Smart_Class.
- */
-typedef struct _Elm_Box_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Box_Smart_Class;
-
-/**
* Base widget smart data extended with box instance data.
*/
typedef struct _Elm_Box_Smart_Data Elm_Box_Smart_Data;
struct _Elm_Box_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Eina_Bool homogeneous : 1;
Eina_Bool on_deletion : 1;
Eina_Bool horizontal : 1;
@@ -165,11 +63,8 @@ struct _Transition_Animation_Data
* @}
*/
-EAPI extern const char ELM_BOX_SMART_NAME[];
-EAPI const Elm_Box_Smart_Class *elm_box_smart_class_get(void);
-
#define ELM_BOX_DATA_GET(o, sd) \
- Elm_Box_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Box_Smart_Data * sd = eo_data_get(o, ELM_OBJ_BOX_CLASS)
#define ELM_BOX_DATA_GET_OR_RETURN(o, ptr) \
ELM_BOX_DATA_GET(o, ptr); \
@@ -189,8 +84,8 @@ EAPI const Elm_Box_Smart_Class *elm_box_smart_class_get(void);
return val; \
}
-#define ELM_BOX_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_BOX_SMART_NAME, __func__)) \
+#define ELM_BOX_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_BOX_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_bubble.h b/src/lib/elm_widget_bubble.h
index 10429cd0b..2d7cacd6e 100644
--- a/src/lib/elm_widget_bubble.h
+++ b/src/lib/elm_widget_bubble.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_BUBBLE_H
#define ELM_WIDGET_BUBBLE_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -14,106 +14,6 @@
* widgets which are a bubble with some more logic on top.
*/
-/**
- * @def ELM_BUBBLE_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Bubble_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_CLASS(x) ((Elm_Bubble_Smart_Class *)x)
-
-/**
- * @def ELM_BUBBLE_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Bubble_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_DATA(x) ((Elm_Bubble_Smart_Data *)x)
-
-/**
- * @def ELM_BUBBLE_SMART_CLASS_VERSION
- *
- * Current version for Elementary bubble @b base smart class, a value
- * which goes to _Elm_Bubble_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_BUBBLE_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Bubble_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BUBBLE_SMART_CLASS_INIT_NULL
- * @see ELM_BUBBLE_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_BUBBLE_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_BUBBLE_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Bubble_Smart_Class structure.
- *
- * @see ELM_BUBBLE_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BUBBLE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_SMART_CLASS_INIT_NULL \
- ELM_BUBBLE_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_BUBBLE_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Bubble_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_BUBBLE_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Bubble_Smart_Class (base field)
- * to the latest #ELM_BUBBLE_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_BUBBLE_SMART_CLASS_INIT_NULL
- * @see ELM_BUBBLE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BUBBLE_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_BUBBLE_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary bubble base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a bubble.
- *
- * All of the functions listed on @ref Bubble namespace will work for
- * objects deriving from #Elm_Bubble_Smart_Class.
- */
-typedef struct _Elm_Bubble_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Bubble_Smart_Class;
/**
* Base layout smart data extended with bubble instance data.
@@ -121,8 +21,6 @@ typedef struct _Elm_Bubble_Smart_Class
typedef struct _Elm_Bubble_Smart_Data Elm_Bubble_Smart_Data;
struct _Elm_Bubble_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Elm_Bubble_Pos pos;
};
@@ -130,12 +28,8 @@ struct _Elm_Bubble_Smart_Data
* @}
*/
-EAPI extern const char ELM_BUBBLE_SMART_NAME[];
-EAPI const Elm_Bubble_Smart_Class
-*elm_bubble_smart_class_get(void);
-
#define ELM_BUBBLE_DATA_GET(o, sd) \
- Elm_Bubble_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Bubble_Smart_Data * sd = eo_data_get(o, ELM_OBJ_BUBBLE_CLASS)
#define ELM_BUBBLE_DATA_GET_OR_RETURN(o, ptr) \
ELM_BUBBLE_DATA_GET(o, ptr); \
@@ -156,8 +50,7 @@ EAPI const Elm_Bubble_Smart_Class
}
#define ELM_BUBBLE_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_BUBBLE_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_BUBBLE_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_button.h b/src/lib/elm_widget_button.h
index a091b5d7f..94a3fe1f4 100644
--- a/src/lib/elm_widget_button.h
+++ b/src/lib/elm_widget_button.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_BUTTON_H
#define ELM_WIDGET_BUTTON_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -16,114 +16,10 @@
*/
/**
- * @def ELM_BUTTON_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Button_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_CLASS(x) ((Elm_Button_Smart_Class *)x)
-
-/**
- * @def ELM_BUTTON_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Button_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_DATA(x) ((Elm_Button_Smart_Data *)x)
-
-/**
- * @def ELM_BUTTON_SMART_CLASS_VERSION
- *
- * Current version for Elementary button @b base smart class, a value
- * which goes to _Elm_Button_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_BUTTON_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Button_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BUTTON_SMART_CLASS_INIT_NULL
- * @see ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_BUTTON_SMART_CLASS_VERSION, EINA_TRUE}
-
-/**
- * @def ELM_BUTTON_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Button_Smart_Class structure.
- *
- * @see ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_BUTTON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_SMART_CLASS_INIT_NULL \
- ELM_BUTTON_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Button_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_BUTTON_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Button_Smart_Class (base field)
- * to the latest #ELM_BUTTON_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_BUTTON_SMART_CLASS_INIT_NULL
- * @see ELM_BUTTON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_BUTTON_SMART_CLASS_INIT(ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary button base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a button.
- *
- * All of the functions listed on @ref Button namespace will work for
- * objects deriving from #Elm_Button_Smart_Class.
- */
-typedef struct _Elm_Button_Smart_Class
-{
- Elm_Layout_Smart_Class base; /**< Layout widget class struct, since we're inheriting from it */
-
- int version; /**< Version of this smart class definition */
-
- Eina_Bool admits_autorepeat : 1; /**< Whether the button objects of this class admit auto-repetition of click events, when one holds the click on them. This is true by default. */
-} Elm_Button_Smart_Class;
-
-/**
* Base widget smart data extended with button instance data.
*/
typedef struct _Elm_Button_Smart_Data
{
- Elm_Layout_Smart_Data base; /**< Base widget smart data as first member obligatory, as we're inheriting from it */
-
/* auto-repeat stuff */
double ar_threshold; /**< Time to wait until first auto-repeated click is generated */
double ar_interval; /**< Time frame for subsequent auto-repeated clicks, after the first automatic one is triggerred */
@@ -138,10 +34,8 @@ typedef struct _Elm_Button_Smart_Data
* @}
*/
-EAPI const Elm_Button_Smart_Class *elm_button_smart_class_get(void);
-
#define ELM_BUTTON_DATA_GET(o, sd) \
- Elm_Button_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Button_Smart_Data * sd = eo_data_get(o, ELM_OBJ_BUTTON_CLASS)
#define ELM_BUTTON_DATA_GET_OR_RETURN(o, ptr) \
ELM_BUTTON_DATA_GET(o, ptr); \
@@ -161,9 +55,8 @@ EAPI const Elm_Button_Smart_Class *elm_button_smart_class_get(void);
return val; \
}
-#define ELM_BUTTON_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_BUTTON_SMART_NAME, __func__)) \
+#define ELM_BUTTON_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_BUTTON_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_calendar.h b/src/lib/elm_widget_calendar.h
index a6fe78eff..dd79f8e68 100644
--- a/src/lib/elm_widget_calendar.h
+++ b/src/lib/elm_widget_calendar.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_CALENDAR_H
#define ELM_WIDGET_CALENDAR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,107 +15,6 @@
*/
/**
- * @def ELM_CALENDAR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Calendar_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_CLASS(x) ((Elm_Calendar_Smart_Class *)x)
-
-/**
- * @def ELM_CALENDAR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Calendar_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_DATA(x) ((Elm_Calendar_Smart_Data *)x)
-
-/**
- * @def ELM_CALENDAR_SMART_CLASS_VERSION
- *
- * Current version for Elementary calendar @b base smart class, a value
- * which goes to _Elm_Calendar_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CALENDAR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Calendar_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CALENDAR_SMART_CLASS_INIT_NULL
- * @see ELM_CALENDAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CALENDAR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_CALENDAR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Calendar_Smart_Class structure.
- *
- * @see ELM_CALENDAR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CALENDAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_SMART_CLASS_INIT_NULL \
- ELM_CALENDAR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_CALENDAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Calendar_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CALENDAR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Calendar_Smart_Class (base field)
- * to the latest #ELM_CALENDAR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CALENDAR_SMART_CLASS_INIT_NULL
- * @see ELM_CALENDAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CALENDAR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CALENDAR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary calendar base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a calendar.
- *
- * All of the functions listed on @ref Calendar namespace will work for
- * objects deriving from #Elm_Calendar_Smart_Class.
- */
-typedef struct _Elm_Calendar_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Calendar_Smart_Class;
-
-/**
* Base layout smart data extended with calendar instance data.
*/
typedef struct _Elm_Calendar_Smart_Data Elm_Calendar_Smart_Data;
@@ -129,8 +28,7 @@ typedef enum _Day_Color // EINA_DEPRECATED
struct _Elm_Calendar_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
+ Evas_Object *obj; // the object itself
Eina_List *marks;
double interval, first_interval;
int year_min, year_max, spin_speed;
@@ -162,33 +60,11 @@ struct _Elm_Calendar_Mark
* @}
*/
-EAPI extern const char ELM_CALENDAR_SMART_NAME[];
-EAPI const Elm_Calendar_Smart_Class *elm_calendar_smart_class_get(void);
-
#define ELM_CALENDAR_DATA_GET(o, sd) \
- Elm_Calendar_Smart_Data * sd = evas_object_smart_data_get(o)
-
-#define ELM_CALENDAR_DATA_GET_OR_RETURN(o, ptr) \
- ELM_CALENDAR_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
- }
-
-#define ELM_CALENDAR_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_CALENDAR_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
- }
+ Elm_Calendar_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CALENDAR_CLASS)
-#define ELM_CALENDAR_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_CALENDAR_SMART_NAME, \
- __func__)) \
+#define ELM_CALENDAR_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_CALENDAR_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_check.h b/src/lib/elm_widget_check.h
index c439fc291..79edc78b4 100644
--- a/src/lib/elm_widget_check.h
+++ b/src/lib/elm_widget_check.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_CHECK_H
#define ELM_WIDGET_CHECK_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_CHECK_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Check_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_CLASS(x) ((Elm_Check_Smart_Class *)x)
-
-/**
- * @def ELM_CHECK_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Check_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_DATA(x) ((Elm_Check_Smart_Data *)x)
-
-/**
- * @def ELM_CHECK_SMART_CLASS_VERSION
- *
- * Current version for Elementary check @b base smart class, a value
- * which goes to _Elm_Check_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CHECK_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Check_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CHECK_SMART_CLASS_INIT_NULL
- * @see ELM_CHECK_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CHECK_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_CHECK_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Check_Smart_Class structure.
- *
- * @see ELM_CHECK_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CHECK_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_SMART_CLASS_INIT_NULL \
- ELM_CHECK_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_CHECK_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Check_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CHECK_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Check_Smart_Class (base field)
- * to the latest #ELM_CHECK_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CHECK_SMART_CLASS_INIT_NULL
- * @see ELM_CHECK_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CHECK_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CHECK_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary check base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a check.
- *
- * All of the functions listed on @ref Check namespace will work for
- * objects deriving from #Elm_Check_Smart_Class.
- */
-typedef struct _Elm_Check_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Check_Smart_Class;
-
-/**
* Base layout smart data extended with check instance data.
*/
typedef struct _Elm_Check_Smart_Data Elm_Check_Smart_Data;
struct _Elm_Check_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Eina_Bool state;
Eina_Bool *statep;
};
@@ -131,11 +28,8 @@ struct _Elm_Check_Smart_Data
* @}
*/
-EAPI extern const char ELM_CHECK_SMART_NAME[];
-EAPI const Elm_Check_Smart_Class *elm_check_smart_class_get(void);
-
#define ELM_CHECK_DATA_GET(o, sd) \
- Elm_Check_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Check_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CHECK_CLASS)
#define ELM_CHECK_DATA_GET_OR_RETURN(o, ptr) \
ELM_CHECK_DATA_GET(o, ptr); \
@@ -155,9 +49,8 @@ EAPI const Elm_Check_Smart_Class *elm_check_smart_class_get(void);
return val; \
}
-#define ELM_CHECK_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_CHECK_SMART_NAME, \
- __func__)) \
+#define ELM_CHECK_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_CHECK_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_clock.h b/src/lib/elm_widget_clock.h
index 54f043c90..36b8e0496 100644
--- a/src/lib/elm_widget_clock.h
+++ b/src/lib/elm_widget_clock.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_CLOCK_H
#define ELM_WIDGET_CLOCK_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
@@ -19,114 +19,11 @@
*/
/**
- * @def ELM_CLOCK_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Clock_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_CLASS(x) ((Elm_Clock_Smart_Class *)x)
-
-/**
- * @def ELM_CLOCK_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Clock_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_DATA(x) ((Elm_Clock_Smart_Data *)x)
-
-/**
- * @def ELM_CLOCK_SMART_CLASS_VERSION
- *
- * Current version for Elementary clock @b base smart class, a value
- * which goes to _Elm_Clock_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CLOCK_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Clock_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CLOCK_SMART_CLASS_INIT_NULL
- * @see ELM_CLOCK_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CLOCK_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_CLOCK_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Clock_Smart_Class structure.
- *
- * @see ELM_CLOCK_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CLOCK_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_SMART_CLASS_INIT_NULL \
- ELM_CLOCK_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_CLOCK_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Clock_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CLOCK_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Clock_Smart_Class (base field)
- * to the latest #ELM_CLOCK_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CLOCK_SMART_CLASS_INIT_NULL
- * @see ELM_CLOCK_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CLOCK_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CLOCK_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary clock base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a clock.
- *
- * All of the functions listed on @ref Clock namespace will work for
- * objects deriving from #Elm_Clock_Smart_Class.
- */
-typedef struct _Elm_Clock_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Clock_Smart_Class;
-
-/**
* Base layout smart data extended with clock instance data.
*/
typedef struct _Elm_Clock_Smart_Data Elm_Clock_Smart_Data;
struct _Elm_Clock_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
double interval, first_interval;
Elm_Clock_Edit_Mode digedit;
int hrs, min, sec, timediff;
@@ -155,11 +52,8 @@ struct _Elm_Clock_Smart_Data
* @}
*/
-EAPI extern const char ELM_CLOCK_SMART_NAME[];
-EAPI const Elm_Clock_Smart_Class *elm_clock_smart_class_get(void);
-
#define ELM_CLOCK_DATA_GET(o, sd) \
- Elm_Clock_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Clock_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CLOCK_CLASS)
#define ELM_CLOCK_DATA_GET_OR_RETURN(o, ptr) \
ELM_CLOCK_DATA_GET(o, ptr); \
@@ -179,9 +73,8 @@ EAPI const Elm_Clock_Smart_Class *elm_clock_smart_class_get(void);
return val; \
}
-#define ELM_CLOCK_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_CLOCK_SMART_NAME, __func__)) \
+#define ELM_CLOCK_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_CLOCK_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_colorselector.h b/src/lib/elm_widget_colorselector.h
index 35b960c95..ee7c00fe8 100644
--- a/src/lib/elm_widget_colorselector.h
+++ b/src/lib/elm_widget_colorselector.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_COLORSELECTOR_H
#define ELM_WIDGET_COLORSELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -14,107 +14,6 @@
* widgets which are a colorselector with some more logic on top.
*/
-/**
- * @def ELM_COLORSELECTOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Colorselector_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_CLASS(x) ((Elm_Colorselector_Smart_Class *)x)
-
-/**
- * @def ELM_COLORSELECTOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Colorselector_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_DATA(x) ((Elm_Colorselector_Smart_Data *)x)
-
-/**
- * @def ELM_COLORSELECTOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary colorselector @b base smart class, a value
- * which goes to _Elm_Colorselector_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_COLORSELECTOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Colorselector_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_COLORSELECTOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_COLORSELECTOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Colorselector_Smart_Class structure.
- *
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_SMART_CLASS_INIT_NULL \
- ELM_COLORSELECTOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_COLORSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Colorselector_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_COLORSELECTOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Colorselector_Smart_Class (base field)
- * to the latest #ELM_COLORSELECTOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_COLORSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_COLORSELECTOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_COLORSELECTOR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary colorselector base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a colorselector.
- *
- * All of the functions listed on @ref Colorselector namespace will work for
- * objects deriving from #Elm_Colorselector_Smart_Class.
- */
-typedef struct _Elm_Colorselector_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Colorselector_Smart_Class;
-
typedef struct _Color_Bar_Data Color_Bar_Data;
/**
@@ -123,8 +22,6 @@ typedef struct _Color_Bar_Data Color_Bar_Data;
typedef struct _Elm_Colorselector_Smart_Data Elm_Colorselector_Smart_Data;
struct _Elm_Colorselector_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
/* for the 3 displaying modes of the widget */
Evas_Object *col_bars_area;
Evas_Object *palette_box;
@@ -200,12 +97,8 @@ struct _Elm_Color_Item
* @}
*/
-EAPI extern const char ELM_COLORSELECTOR_SMART_NAME[];
-EAPI const Elm_Colorselector_Smart_Class
-*elm_colorselector_smart_class_get(void);
-
#define ELM_COLORSELECTOR_DATA_GET(o, sd) \
- Elm_Colorselector_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Colorselector_Smart_Data * sd = eo_data_get(o, ELM_OBJ_COLORSELECTOR_CLASS)
#define ELM_COLORSELECTOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_COLORSELECTOR_DATA_GET(o, ptr); \
@@ -226,8 +119,7 @@ EAPI const Elm_Colorselector_Smart_Class
}
#define ELM_COLORSELECTOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_COLORSELECTOR_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_COLORSELECTOR_CLASS)) \
return
#define ELM_COLORSELECTOR_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_conform.h b/src/lib/elm_widget_conform.h
index d1b61c47f..665656177 100644
--- a/src/lib/elm_widget_conform.h
+++ b/src/lib/elm_widget_conform.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_CONFORMANT_H
#define ELM_WIDGET_CONFORMANT_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,113 +15,11 @@
*/
/**
- * @def ELM_CONFORMANT_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Conformant_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_CLASS(x) ((Elm_Conformant_Smart_Class *)x)
-
-/**
- * @def ELM_CONFORMANT_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Conformant_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_DATA(x) ((Elm_Conformant_Smart_Data *)x)
-
-/**
- * @def ELM_CONFORMANT_SMART_CLASS_VERSION
- *
- * Current version for Elementary conformant @b base smart class, a value
- * which goes to _Elm_Conformant_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CONFORMANT_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Conformant_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CONFORMANT_SMART_CLASS_INIT_NULL
- * @see ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CONFORMANT_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_CONFORMANT_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Conformant_Smart_Class structure.
- *
- * @see ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CONFORMANT_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_SMART_CLASS_INIT_NULL \
- ELM_CONFORMANT_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Conformant_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CONFORMANT_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Conformant_Smart_Class (base field)
- * to the latest #ELM_CONFORMANT_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CONFORMANT_SMART_CLASS_INIT_NULL
- * @see ELM_CONFORMANT_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CONFORMANT_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CONFORMANT_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary conformant base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a conformant.
- *
- * All of the functions listed on @ref Conformant namespace will work for
- * objects deriving from #Elm_Conformant_Smart_Class.
- */
-typedef struct _Elm_Conformant_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Conformant_Smart_Class;
-
-/**
* Base layout smart data extended with conformant instance data.
*/
typedef struct _Elm_Conformant_Smart_Data Elm_Conformant_Smart_Data;
struct _Elm_Conformant_Smart_Data
{
- Elm_Layout_Smart_Data base;
Evas_Object *portrait_indicator;
Evas_Object *landscape_indicator;
Evas_Object *softkey;
@@ -163,11 +61,8 @@ enum _Conformant_Part_Type
* @}
*/
-EAPI extern const char ELM_CONFORMANT_SMART_NAME[];
-EAPI const Elm_Conformant_Smart_Class *elm_conformant_smart_class_get(void);
-
#define ELM_CONFORMANT_DATA_GET(o, sd) \
- Elm_Conformant_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Conformant_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CONFORMANT_CLASS)
#define ELM_CONFORMANT_DATA_GET_OR_RETURN(o, ptr) \
ELM_CONFORMANT_DATA_GET(o, ptr); \
@@ -187,9 +82,8 @@ EAPI const Elm_Conformant_Smart_Class *elm_conformant_smart_class_get(void);
return val; \
}
-#define ELM_CONFORMANT_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_CONFORMANT_SMART_NAME, __func__)) \
+#define ELM_CONFORMANT_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_CONFORMANT_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_container.h b/src/lib/elm_widget_container.h
index 859e823a7..6c241971a 100644
--- a/src/lib/elm_widget_container.h
+++ b/src/lib/elm_widget_container.h
@@ -30,109 +30,27 @@
* - elm_object_part_content_unset()
*/
- /**
- * @def ELM_CONTAINER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Container_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
- #define ELM_CONTAINER_CLASS(x) ((Elm_Container_Smart_Class *) x)
+#define ELM_OBJ_CONTAINER_CLASS elm_obj_container_class_get()
-/**
- * @def ELM_CONTAINER_SMART_CLASS_VERSION
- *
- * Current version for Elementary container @b base smart class, a value
- * which goes to _Elm_Container_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CONTAINER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CONTAINER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Container_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CONTAINER_SMART_CLASS_INIT_NULL
- * @see ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CONTAINER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CONTAINER_SMART_CLASS_VERSION, NULL, NULL, NULL}
-
-/**
- * @def ELM_CONTAINER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Container_Smart_Class structure.
- *
- * @see ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CONTAINER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CONTAINER_SMART_CLASS_INIT_NULL \
- ELM_CONTAINER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
+const Eo_Class *elm_obj_container_class_get(void) EINA_CONST;
-/**
- * @def ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Container_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CONTAINER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Container_Smart_Class (base field)
- * to the latest #ELM_CONTAINER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CONTAINER_SMART_CLASS_INIT_NULL
- * @see ELM_CONTAINER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CONTAINER_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
+extern EAPI Eo_Op ELM_OBJ_CONTAINER_BASE_ID;
-/**
- * Elementary container base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets exposing
- * "parts" to hold child elements at.
- */
-typedef struct _Elm_Container_Smart_Class
+enum
{
- Elm_Widget_Smart_Class base; /**< Base Elementary widget class struct, since we're inheriting from it */
-
- int version; /**< Version of this smart class definition */
- Eina_Bool (*content_set)(Evas_Object *obj,
- const char *part,
- Evas_Object *content); /* 'Virtual' function on setting content on the object, at the given @a part part */
- Evas_Object *(*content_get)(const Evas_Object * obj,
- const char *part); /* 'Virtual' function on retrieving content from the object, at the given @a part part */
- Evas_Object *(*content_unset)(Evas_Object * obj,
- const char *part); /* 'Virtual' function on unsetting content from the object, at the given @a part part. Meant to return the content's pointer. */
-} Elm_Container_Smart_Class;
-
-typedef struct _Elm_Container_Smart_Data Elm_Container_Smart_Data;
-struct _Elm_Container_Smart_Data
-{
- Elm_Widget_Smart_Data base;
+ ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET,
+ ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET,
+ ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET,
+ ELM_OBJ_CONTAINER_SUB_ID_LAST
};
/**
* @}
*/
-EAPI const Elm_Container_Smart_Class *elm_container_smart_class_get(void);
+#define ELM_OBJ_CONTAINER_ID(sub_id) (ELM_OBJ_CONTAINER_BASE_ID + sub_id)
+
+#define elm_obj_container_content_set(name, content, ret) ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), EO_TYPECHECK(const char*, name), EO_TYPECHECK(Evas_Object *,content), EO_TYPECHECK(Eina_Bool *, ret)
+#define elm_obj_container_content_get(name, ret) ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), EO_TYPECHECK(const char*, name), EO_TYPECHECK(Evas_Object **,ret)
+#define elm_obj_container_content_unset(name, ret) ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_UNSET), EO_TYPECHECK(const char*, name), EO_TYPECHECK(Evas_Object **,ret)
#endif
diff --git a/src/lib/elm_widget_ctxpopup.h b/src/lib/elm_widget_ctxpopup.h
index 5269ab833..1c166c497 100644
--- a/src/lib/elm_widget_ctxpopup.h
+++ b/src/lib/elm_widget_ctxpopup.h
@@ -14,106 +14,6 @@
* widgets which are a ctxpopup with some more logic on top.
*/
-/**
- * @def ELM_CTXPOPUP_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Ctxpopup_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_CLASS(x) ((Elm_Ctxpopup_Smart_Class *)x)
-
-/**
- * @def ELM_CTXPOPUP_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Ctxpopup_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_DATA(x) ((Elm_Ctxpopup_Smart_Data *)x)
-
-/**
- * @def ELM_CTXPOPUP_SMART_CLASS_VERSION
- *
- * Current version for Elementary ctxpopup @b base smart class, a value
- * which goes to _Elm_Ctxpopup_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_CTXPOPUP_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Ctxpopup_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT_NULL
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_CTXPOPUP_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_CTXPOPUP_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Ctxpopup_Smart_Class structure.
- *
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_SMART_CLASS_INIT_NULL \
- ELM_CTXPOPUP_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Ctxpopup_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_CTXPOPUP_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Ctxpopup_Smart_Class (base field)
- * to the latest #ELM_CTXPOPUP_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT_NULL
- * @see ELM_CTXPOPUP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_CTXPOPUP_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_CTXPOPUP_SMART_CLASS_INIT(ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary ctxpopup base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a ctxpopup.
- *
- * All of the functions listed on @ref Ctxpopup namespace will work for
- * objects deriving from #Elm_Ctxpopup_Smart_Class.
- */
-typedef struct _Elm_Ctxpopup_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Ctxpopup_Smart_Class;
-
typedef struct _Elm_Ctxpopup_Item Elm_Ctxpopup_Item;
/**
@@ -129,8 +29,6 @@ struct _Elm_Ctxpopup_Item
struct _Elm_Ctxpopup_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *parent;
Evas_Object *list;
Evas_Object *box;
@@ -152,12 +50,8 @@ struct _Elm_Ctxpopup_Smart_Data
* @}
*/
-EAPI extern const char ELM_CTXPOPUP_SMART_NAME[];
-EAPI const Elm_Ctxpopup_Smart_Class
-*elm_ctxpopup_smart_class_get(void);
-
#define ELM_CTXPOPUP_DATA_GET(o, sd) \
- Elm_Ctxpopup_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Ctxpopup_Smart_Data * sd = eo_data_get(o, ELM_OBJ_CTXPOPUP_CLASS)
#define ELM_CTXPOPUP_DATA_GET_OR_RETURN(o, ptr) \
ELM_CTXPOPUP_DATA_GET(o, ptr); \
@@ -178,8 +72,7 @@ EAPI const Elm_Ctxpopup_Smart_Class
}
#define ELM_CTXPOPUP_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), \
- ELM_CTXPOPUP_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_CTXPOPUP_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_datetime.h b/src/lib/elm_widget_datetime.h
index 6a7611a7f..8078dcbe0 100644
--- a/src/lib/elm_widget_datetime.h
+++ b/src/lib/elm_widget_datetime.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_DATETIME_H
#define ELM_WIDGET_DATETIME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,107 +15,6 @@
*/
/**
- * @def ELM_DATETIME_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Datetime_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_CLASS(x) ((Elm_Datetime_Smart_Class *)x)
-
-/**
- * @def ELM_DATETIME_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Datetime_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_DATA(x) ((Elm_Datetime_Smart_Data *)x)
-
-/**
- * @def ELM_DATETIME_SMART_CLASS_VERSION
- *
- * Current version for Elementary datetime @b base smart class, a value
- * which goes to _Elm_Datetime_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_DATETIME_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Datetime_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DATETIME_SMART_CLASS_INIT_NULL
- * @see ELM_DATETIME_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_DATETIME_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_DATETIME_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Datetime_Smart_Class structure.
- *
- * @see ELM_DATETIME_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DATETIME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_SMART_CLASS_INIT_NULL \
- ELM_DATETIME_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_DATETIME_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Datetime_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_DATETIME_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Datetime_Smart_Class (base field)
- * to the latest #ELM_DATETIME_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_DATETIME_SMART_CLASS_INIT_NULL
- * @see ELM_DATETIME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DATETIME_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_DATETIME_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary datetime base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a datetime.
- *
- * All of the functions listed on @ref Datetime namespace will work for
- * objects deriving from #Elm_Datetime_Smart_Class.
- */
-typedef struct _Elm_Datetime_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Datetime_Smart_Class;
-
-/**
* Base layout smart data extended with datetime instance data.
*/
typedef struct _Elm_Datetime_Smart_Data Elm_Datetime_Smart_Data;
@@ -156,8 +55,6 @@ struct _Datetime_Mod_Api
struct _Elm_Datetime_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
/* fixed set of fields. */
Datetime_Field field_list[ELM_DATETIME_TYPE_COUNT];
struct tm curr_time, min_limit, max_limit;
@@ -181,11 +78,8 @@ struct _Format_Map
* @}
*/
-EAPI extern const char ELM_DATETIME_SMART_NAME[];
-EAPI const Elm_Datetime_Smart_Class *elm_datetime_smart_class_get(void);
-
#define ELM_DATETIME_DATA_GET(o, sd) \
- Elm_Datetime_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Datetime_Smart_Data * sd = eo_data_get(o, ELM_OBJ_DATETIME_CLASS)
#define ELM_DATETIME_DATA_GET_OR_RETURN(o, ptr) \
ELM_DATETIME_DATA_GET(o, ptr); \
@@ -206,8 +100,7 @@ EAPI const Elm_Datetime_Smart_Class *elm_datetime_smart_class_get(void);
}
#define ELM_DATETIME_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_DATETIME_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_DATETIME_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_dayselector.h b/src/lib/elm_widget_dayselector.h
index 0feb8561c..2178d210a 100644
--- a/src/lib/elm_widget_dayselector.h
+++ b/src/lib/elm_widget_dayselector.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_DAYSELECTOR_H
#define ELM_WIDGET_DAYSELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_DAYSELECTOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Dayselector_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_CLASS(x) ((Elm_Dayselector_Smart_Class *)x)
-
-/**
- * @def ELM_DAYSELECTOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Dayselector_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_DATA(x) ((Elm_Dayselector_Smart_Data *)x)
-
-/**
- * @def ELM_DAYSELECTOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary dayselector @b base smart class, a value
- * which goes to _Elm_Dayselector_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_DAYSELECTOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Dayselector_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_DAYSELECTOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_DAYSELECTOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Dayselector_Smart_Class structure.
- *
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_SMART_CLASS_INIT_NULL \
- ELM_DAYSELECTOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_DAYSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Dayselector_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_DAYSELECTOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Dayselector_Smart_Class (base field)
- * to the latest #ELM_DAYSELECTOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_DAYSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DAYSELECTOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_DAYSELECTOR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary dayselector base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a dayselector.
- *
- * All of the functions listed on @ref Dayselector namespace will work for
- * objects deriving from #Elm_Dayselector_Smart_Class.
- */
-typedef struct _Elm_Dayselector_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Dayselector_Smart_Class;
-
-/**
* Base layout smart data extended with dayselector instance data.
*/
typedef struct _Elm_Dayselector_Smart_Data Elm_Dayselector_Smart_Data;
struct _Elm_Dayselector_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Eina_List *items;
Elm_Dayselector_Day week_start;
Elm_Dayselector_Day weekend_start;
@@ -141,12 +38,8 @@ struct _Elm_Dayselector_Item
* @}
*/
-EAPI extern const char ELM_DAYSELECTOR_SMART_NAME[];
-EAPI const Elm_Dayselector_Smart_Class
-*elm_dayselector_smart_class_get(void);
-
#define ELM_DAYSELECTOR_DATA_GET(o, sd) \
- Elm_Dayselector_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Dayselector_Smart_Data * sd = eo_data_get(o, ELM_OBJ_DAYSELECTOR_CLASS)
#define ELM_DAYSELECTOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_DAYSELECTOR_DATA_GET(o, ptr); \
@@ -166,9 +59,8 @@ EAPI const Elm_Dayselector_Smart_Class
return val; \
}
-#define ELM_DAYSELECTOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_DAYSELECTOR_SMART_NAME, __func__)) \
+#define ELM_DAYSELECTOR_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_DAYSELECTOR_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_diskselector.h b/src/lib/elm_widget_diskselector.h
index 975935a87..029fba903 100644
--- a/src/lib/elm_widget_diskselector.h
+++ b/src/lib/elm_widget_diskselector.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_DISKSELECTOR_H
#define ELM_WIDGET_DISKSELECTOR_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,106 +15,6 @@
*/
/**
- * @def ELM_DISKSELECTOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Diskselector_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_CLASS(x) ((Elm_Diskselector_Smart_Class *)x)
-
-/**
- * @def ELM_DISKSELECTOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Diskselector_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_DATA(x) ((Elm_Diskselector_Smart_Data *)x)
-
-/**
- * @def ELM_DISKSELECTOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary diskselector @b base smart class, a value
- * which goes to _Elm_Diskselector_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_DISKSELECTOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Diskselector_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_DISKSELECTOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_DISKSELECTOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Diskselector_Smart_Class structure.
- *
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_SMART_CLASS_INIT_NULL \
- ELM_DISKSELECTOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_DISKSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Diskselector_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_DISKSELECTOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Diskselector_Smart_Class (base field)
- * to the latest #ELM_DISKSELECTOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_DISKSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_DISKSELECTOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_DISKSELECTOR_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary diskselector base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a diskselector.
- *
- * All of the functions listed on @ref Diskselector namespace will work for
- * objects deriving from #Elm_Diskselector_Smart_Class.
- */
-typedef struct _Elm_Diskselector_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Diskselector_Smart_Class;
-
-/**
* Base widget smart data extended with diskselector instance data.
*/
typedef struct _Elm_Diskselector_Smart_Data Elm_Diskselector_Smart_Data;
@@ -122,12 +22,7 @@ typedef struct _Elm_Diskselector_Item Elm_Diskselector_Item;
struct _Elm_Diskselector_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hit_rect;
- const Elm_Scrollable_Smart_Interface *s_iface;
Evas_Object *main_box;
Elm_Diskselector_Item *selected_item;
@@ -169,12 +64,8 @@ struct _Elm_Diskselector_Item
* @}
*/
-EAPI extern const char ELM_DISKSELECTOR_SMART_NAME[];
-EAPI const Elm_Diskselector_Smart_Class
-*elm_diskselector_smart_class_get(void);
-
#define ELM_DISKSELECTOR_DATA_GET(o, sd) \
- Elm_Diskselector_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Diskselector_Smart_Data * sd = eo_data_get(o, ELM_OBJ_DISKSELECTOR_CLASS)
#define ELM_DISKSELECTOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_DISKSELECTOR_DATA_GET(o, ptr); \
@@ -194,9 +85,8 @@ EAPI const Elm_Diskselector_Smart_Class
return val; \
}
-#define ELM_DISKSELECTOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), \
- ELM_DISKSELECTOR_SMART_NAME, __func__)) \
+#define ELM_DISKSELECTOR_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_DISKSELECTOR_CLASS)) \
return
#define ELM_DISKSELECTOR_ITEM_CHECK(it) \
@@ -209,7 +99,7 @@ EAPI const Elm_Diskselector_Smart_Class
#define ELM_DISKSELECTOR_ITEM_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
- if (!it->base.widget || !elm_widget_type_check \
- ((it->base.widget), ELM_DISKSELECTOR_SMART_NAME, __func__)) goto label;
+ if (!it->base.widget || !eo_isa((it->base.widget), ELM_OBJ_DISKSELECTOR_CLASS)) \
+ goto label;
#endif
diff --git a/src/lib/elm_widget_entry.h b/src/lib/elm_widget_entry.h
index 1c4912169..2e1c0eea4 100644
--- a/src/lib/elm_widget_entry.h
+++ b/src/lib/elm_widget_entry.h
@@ -15,107 +15,6 @@
* other widgets which are a entry with some more logic on top.
*/
-/**
- * @def ELM_ENTRY_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Entry_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_CLASS(x) ((Elm_Entry_Smart_Class *)x)
-
-/**
- * @def ELM_ENTRY_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Entry_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_DATA(x) ((Elm_Entry_Smart_Data *)x)
-
-/**
- * @def ELM_ENTRY_SMART_CLASS_VERSION
- *
- * Current version for Elementary entry @b base smart class, a value
- * which goes to _Elm_Entry_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_ENTRY_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Entry_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_ENTRY_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_ENTRY_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Entry_Smart_Class structure.
- *
- * @see ELM_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_SMART_CLASS_INIT_NULL \
- ELM_ENTRY_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Entry_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_ENTRY_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Entry_Smart_Class (base field)
- * to the latest #ELM_ENTRY_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_ENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_ENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ENTRY_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_ENTRY_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary entry base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a entry.
- *
- * All of the functions listed on @ref Entry namespace will work for
- * objects deriving from #Elm_Entry_Smart_Class.
- */
-typedef struct _Elm_Entry_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Entry_Smart_Class;
-
typedef struct _Mod_Api Mod_Api;
/**
@@ -124,12 +23,7 @@ typedef struct _Mod_Api Mod_Api;
typedef struct _Elm_Entry_Smart_Data Elm_Entry_Smart_Data;
struct _Elm_Entry_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hit_rect, *entry_edje, *scr_edje;
- const Elm_Scrollable_Smart_Interface *s_iface;
Evas_Object *hoversel;
Ecore_Job *deferred_recalc_job;
@@ -236,11 +130,8 @@ typedef enum _Length_Unit
* @}
*/
-EAPI extern const char ELM_ENTRY_SMART_NAME[];
-EAPI const Elm_Entry_Smart_Class *elm_entry_smart_class_get(void);
-
#define ELM_ENTRY_DATA_GET(o, sd) \
- Elm_Entry_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Entry_Smart_Data * sd = eo_data_get(o, ELM_OBJ_ENTRY_CLASS)
#define ELM_ENTRY_DATA_GET_OR_RETURN(o, ptr) \
ELM_ENTRY_DATA_GET(o, ptr); \
@@ -261,8 +152,7 @@ EAPI const Elm_Entry_Smart_Class *elm_entry_smart_class_get(void);
}
#define ELM_ENTRY_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_ENTRY_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_ENTRY_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_fileselector.h b/src/lib/elm_widget_fileselector.h
index c1e20880b..9650c1a60 100644
--- a/src/lib/elm_widget_fileselector.h
+++ b/src/lib/elm_widget_fileselector.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_FILESELECTOR_H
#define ELM_WIDGET_FILESELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,116 +15,14 @@
*/
/**
- * @def ELM_FILESELECTOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Fileselector_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_CLASS(x) ((Elm_Fileselector_Smart_Class *)x)
-
-/**
- * @def ELM_FILESELECTOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Fileselector_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_DATA(x) ((Elm_Fileselector_Smart_Data *)x)
-
-/**
- * @def ELM_FILESELECTOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary fileselector @b base smart class, a value
- * which goes to _Elm_Fileselector_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FILESELECTOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Fileselector_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FILESELECTOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FILESELECTOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Fileselector_Smart_Class structure.
- *
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_SMART_CLASS_INIT_NULL \
- ELM_FILESELECTOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Fileselector_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_FILESELECTOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Fileselector_Smart_Class (base field)
- * to the latest #ELM_FILESELECTOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FILESELECTOR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary fileselector base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a fileselector.
- *
- * All of the functions listed on @ref Fileselector namespace will work for
- * objects deriving from #Elm_Fileselector_Smart_Class.
- */
-typedef struct _Elm_Fileselector_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Fileselector_Smart_Class;
-
-/**
* Base layout smart data extended with fileselector instance data.
*/
typedef struct _Elm_Fileselector_Smart_Data Elm_Fileselector_Smart_Data;
struct _Elm_Fileselector_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
EINA_REFCOUNT;
+ Evas_Object *obj;
Evas_Object *filename_entry;
Evas_Object *path_entry;
Evas_Object *files_list;
@@ -179,11 +77,8 @@ typedef enum {
* @}
*/
-EAPI extern const char ELM_FILESELECTOR_SMART_NAME[];
-EAPI const Elm_Fileselector_Smart_Class *elm_fileselector_smart_class_get(void);
-
#define ELM_FILESELECTOR_DATA_GET(o, sd) \
- Elm_Fileselector_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Fileselector_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FILESELECTOR_CLASS)
#define ELM_FILESELECTOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_FILESELECTOR_DATA_GET(o, ptr); \
@@ -204,8 +99,7 @@ EAPI const Elm_Fileselector_Smart_Class *elm_fileselector_smart_class_get(void);
}
#define ELM_FILESELECTOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_FILESELECTOR_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_FILESELECTOR_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_fileselector_button.h b/src/lib/elm_widget_fileselector_button.h
index 30624ed0a..2b2e9c0bc 100644
--- a/src/lib/elm_widget_fileselector_button.h
+++ b/src/lib/elm_widget_fileselector_button.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_FILESELECTOR_BUTTON_H
#define ELM_WIDGET_FILESELECTOR_BUTTON_H
-#include "elm_widget_button.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
@@ -20,120 +20,13 @@
*/
/**
- * @def ELM_FILESELECTOR_BUTTON_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Fileselector_Button_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_CLASS(x) ((Elm_Fileselector_Button_Smart_Class *)x)
-
-/**
- * @def ELM_FILESELECTOR_BUTTON_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Fileselector_Button_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_DATA(x) ((Elm_Fileselector_Button_Smart_Data *)x)
-
-/**
- * @def ELM_FILESELECTOR_BUTTON_SMART_CLASS_VERSION
- *
- * Current version for Elementary fileselector_button @b base smart
- * class, a value which goes to
- * _Elm_Fileselector_Button_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Fileselector_Button_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FILESELECTOR_BUTTON_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole
- * #Elm_Fileselector_Button_Smart_Class structure.
- *
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NULL \
- ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole
- * #Elm_Fileselector_Button_Smart_Class structure and set its name and
- * version.
- *
- * This is similar to #ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NULL,
- * but it will also set the version field of
- * #Elm_Fileselector_Button_Smart_Class (base field) to the latest
- * #ELM_FILESELECTOR_BUTTON_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FILESELECTOR_BUTTON_SMART_CLASS_INIT \
- (ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary fileselector_button base smart class. This inherits directly from
- * #Elm_Button_Smart_Class and is meant to build widgets extending the
- * behavior of a fileselector_button.
- *
- * All of the functions listed on @ref Fileselector_Button namespace
- * will work for objects deriving from
- * #Elm_Fileselector_Button_Smart_Class.
- */
-typedef struct _Elm_Fileselector_Button_Smart_Class
-{
- Elm_Button_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Fileselector_Button_Smart_Class;
-
-/**
* Base button smart data extended with fileselector_button instance data.
*/
typedef struct _Elm_Fileselector_Button_Smart_Data \
Elm_Fileselector_Button_Smart_Data;
struct _Elm_Fileselector_Button_Smart_Data
{
- Elm_Button_Smart_Data base;
-
+ Evas_Object *obj; // the object itself
Evas_Object *fs, *fsw;
const char *window_title;
Evas_Coord w, h;
@@ -153,12 +46,8 @@ struct _Elm_Fileselector_Button_Smart_Data
* @}
*/
-EAPI extern const char ELM_FILESELECTOR_BUTTON_SMART_NAME[];
-EAPI const Elm_Fileselector_Button_Smart_Class
-*elm_fileselector_button_smart_class_get(void);
-
#define ELM_FILESELECTOR_BUTTON_DATA_GET(o, sd) \
- Elm_Fileselector_Button_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Fileselector_Button_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FILESELECTOR_BUTTON_CLASS)
#define ELM_FILESELECTOR_BUTTON_DATA_GET_OR_RETURN(o, ptr) \
ELM_FILESELECTOR_BUTTON_DATA_GET(o, ptr); \
@@ -179,8 +68,7 @@ EAPI const Elm_Fileselector_Button_Smart_Class
}
#define ELM_FILESELECTOR_BUTTON_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_FILESELECTOR_BUTTON_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_FILESELECTOR_BUTTON_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_fileselector_entry.h b/src/lib/elm_widget_fileselector_entry.h
index 33b387bb0..955d0969e 100644
--- a/src/lib/elm_widget_fileselector_entry.h
+++ b/src/lib/elm_widget_fileselector_entry.h
@@ -20,120 +20,12 @@
*/
/**
- * @def ELM_FILESELECTOR_ENTRY_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Fileselector_Entry_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_CLASS(x) ((Elm_Fileselector_Entry_Smart_Class *)x)
-
-/**
- * @def ELM_FILESELECTOR_ENTRY_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Fileselector_Entry_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_DATA(x) ((Elm_Fileselector_Entry_Smart_Data *)x)
-
-/**
- * @def ELM_FILESELECTOR_ENTRY_SMART_CLASS_VERSION
- *
- * Current version for Elementary fileselector_entry @b base smart
- * class, a value which goes to
- * _Elm_Fileselector_Entry_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Fileselector_Entry_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FILESELECTOR_ENTRY_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole
- * #Elm_Fileselector_Entry_Smart_Class structure.
- *
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NULL \
- ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole
- * #Elm_Fileselector_Entry_Smart_Class structure and set its name and
- * version.
- *
- * This is similar to #ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NULL,
- * but it will also set the version field of
- * #Elm_Fileselector_Entry_Smart_Class (base field) to the latest
- * #ELM_FILESELECTOR_ENTRY_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FILESELECTOR_ENTRY_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary fileselector_entry base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a fileselector_entry.
- *
- * All of the functions listed on @ref Fileselector_Entry namespace
- * will work for objects deriving from
- * #Elm_Fileselector_Entry_Smart_Class.
- */
-typedef struct _Elm_Fileselector_Entry_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Fileselector_Entry_Smart_Class;
-
-/**
* Base entry smart data extended with fileselector_entry instance data.
*/
typedef struct _Elm_Fileselector_Entry_Smart_Data \
Elm_Fileselector_Entry_Smart_Data;
struct _Elm_Fileselector_Entry_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *button;
Evas_Object *entry;
char *path;
@@ -143,12 +35,9 @@ struct _Elm_Fileselector_Entry_Smart_Data
* @}
*/
-EAPI extern const char ELM_FILESELECTOR_ENTRY_SMART_NAME[];
-EAPI const Elm_Fileselector_Entry_Smart_Class
-*elm_fileselector_entry_smart_class_get(void);
#define ELM_FILESELECTOR_ENTRY_DATA_GET(o, sd) \
- Elm_Fileselector_Entry_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Fileselector_Entry_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FILESELECTOR_ENTRY_CLASS)
#define ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(o, ptr) \
ELM_FILESELECTOR_ENTRY_DATA_GET(o, ptr); \
@@ -169,8 +58,7 @@ EAPI const Elm_Fileselector_Entry_Smart_Class
}
#define ELM_FILESELECTOR_ENTRY_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_FILESELECTOR_ENTRY_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_FILESELECTOR_ENTRY_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_flip.h b/src/lib/elm_widget_flip.h
index fca58265c..b5daa8c3f 100644
--- a/src/lib/elm_widget_flip.h
+++ b/src/lib/elm_widget_flip.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_FLIP_H
#define ELM_WIDGET_FLIP_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -14,106 +14,6 @@
* widgets which are a flip with some more logic on top.
*/
-/**
- * @def ELM_FLIP_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Flip_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_CLASS(x) ((Elm_Flip_Smart_Class *)x)
-
-/**
- * @def ELM_FLIP_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Flip_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_DATA(x) ((Elm_Flip_Smart_Data *)x)
-
-/**
- * @def ELM_FLIP_SMART_CLASS_VERSION
- *
- * Current version for Elementary flip @b base smart class, a value
- * which goes to _Elm_Flip_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FLIP_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Flip_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FLIP_SMART_CLASS_INIT_NULL
- * @see ELM_FLIP_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FLIP_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FLIP_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Flip_Smart_Class structure.
- *
- * @see ELM_FLIP_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FLIP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_SMART_CLASS_INIT_NULL \
- ELM_FLIP_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FLIP_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Flip_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_FLIP_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Flip_Smart_Class (base field)
- * to the latest #ELM_FLIP_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FLIP_SMART_CLASS_INIT_NULL
- * @see ELM_FLIP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FLIP_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FLIP_SMART_CLASS_INIT(ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary flip base smart class. This inherits directly from
- * #Elm_Container_Smart_Class and is meant to build widgets extending the
- * behavior of a flip.
- *
- * All of the functions listed on @ref Flip namespace will work for
- * objects deriving from #Elm_Flip_Smart_Class.
- */
-typedef struct _Elm_Flip_Smart_Class
-{
- Elm_Container_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Flip_Smart_Class;
-
typedef struct _Slice Slice;
/**
@@ -122,8 +22,7 @@ typedef struct _Slice Slice;
typedef struct _Elm_Flip_Smart_Data Elm_Flip_Smart_Data;
struct _Elm_Flip_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
+ Evas_Object *obj;
Evas_Object *clip;
Evas_Object *event[4];
struct
@@ -176,11 +75,8 @@ struct _Vertex3
* @}
*/
-EAPI extern const char ELM_FLIP_SMART_NAME[];
-EAPI const Elm_Flip_Smart_Class *elm_flip_smart_class_get(void);
-
#define ELM_FLIP_DATA_GET(o, sd) \
- Elm_Flip_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Flip_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FLIP_CLASS)
#define ELM_FLIP_DATA_GET_OR_RETURN(o, ptr) \
ELM_FLIP_DATA_GET(o, ptr); \
@@ -200,8 +96,8 @@ EAPI const Elm_Flip_Smart_Class *elm_flip_smart_class_get(void);
return val; \
}
-#define ELM_FLIP_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_FLIP_SMART_NAME, __func__)) \
+#define ELM_FLIP_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_FLIP_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_flipselector.h b/src/lib/elm_widget_flipselector.h
index 4240a85d9..feaa22254 100644
--- a/src/lib/elm_widget_flipselector.h
+++ b/src/lib/elm_widget_flipselector.h
@@ -15,114 +15,12 @@
*/
/**
- * @def ELM_FLIPSELECTOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Flipselector_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_CLASS(x) ((Elm_Flipselector_Smart_Class *)x)
-
-/**
- * @def ELM_FLIPSELECTOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Flipselector_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_DATA(x) ((Elm_Flipselector_Smart_Data *)x)
-
-/**
- * @def ELM_FLIPSELECTOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary flipselector @b base smart class, a value
- * which goes to _Elm_Flipselector_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FLIPSELECTOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Flipselector_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FLIPSELECTOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FLIPSELECTOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Flipselector_Smart_Class structure.
- *
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_SMART_CLASS_INIT_NULL \
- ELM_FLIPSELECTOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FLIPSELECTOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Flipselector_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_FLIPSELECTOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Flipselector_Smart_Class (base field)
- * to the latest #ELM_FLIPSELECTOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT_NULL
- * @see ELM_FLIPSELECTOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FLIPSELECTOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FLIPSELECTOR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary flipselector base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a flipselector.
- *
- * All of the functions listed on @ref Flipselector namespace will work for
- * objects deriving from #Elm_Flipselector_Smart_Class.
- */
-typedef struct _Elm_Flipselector_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Flipselector_Smart_Class;
-
-/**
* Base layout smart data extended with flipselector instance data.
*/
typedef struct _Elm_Flipselector_Smart_Data Elm_Flipselector_Smart_Data;
struct _Elm_Flipselector_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
+ Evas_Object *obj;
Eina_List *items;
Eina_List *current;
Eina_List *sentinel; /* item containing the largest
@@ -148,15 +46,8 @@ struct _Elm_Flipselector_Item
int deleted : 1;
};
-/**
- * @}
- */
-
-EAPI extern const char ELM_FLIPSELECTOR_SMART_NAME[];
-EAPI const Elm_Flipselector_Smart_Class *elm_flipselector_smart_class_get(void);
-
#define ELM_FLIPSELECTOR_DATA_GET(o, sd) \
- Elm_Flipselector_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Flipselector_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FLIPSELECTOR_CLASS)
#define ELM_FLIPSELECTOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_FLIPSELECTOR_DATA_GET(o, ptr); \
@@ -177,8 +68,7 @@ EAPI const Elm_Flipselector_Smart_Class *elm_flipselector_smart_class_get(void);
}
#define ELM_FLIPSELECTOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_FLIPSELECTOR_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_FLIPSELECTOR_CLASS)) \
return
#define ELM_FLIPSELECTOR_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_frame.h b/src/lib/elm_widget_frame.h
index b0c7eb56c..210c48a95 100644
--- a/src/lib/elm_widget_frame.h
+++ b/src/lib/elm_widget_frame.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_FRAME_H
#define ELM_WIDGET_FRAME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_FRAME_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Frame_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_CLASS(x) ((Elm_Frame_Smart_Class *)x)
-
-/**
- * @def ELM_FRAME_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Frame_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_DATA(x) ((Elm_Frame_Smart_Data *)x)
-
-/**
- * @def ELM_FRAME_SMART_CLASS_VERSION
- *
- * Current version for Elementary frame @b base smart class, a value
- * which goes to _Elm_Frame_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_FRAME_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Frame_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FRAME_SMART_CLASS_INIT_NULL
- * @see ELM_FRAME_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_FRAME_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_FRAME_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Frame_Smart_Class structure.
- *
- * @see ELM_FRAME_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_FRAME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_SMART_CLASS_INIT_NULL \
- ELM_FRAME_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_FRAME_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Frame_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_FRAME_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Frame_Smart_Class (base field)
- * to the latest #ELM_FRAME_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_FRAME_SMART_CLASS_INIT_NULL
- * @see ELM_FRAME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_FRAME_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_FRAME_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary frame base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a frame.
- *
- * All of the functions listed on @ref Frame namespace will work for
- * objects deriving from #Elm_Frame_Smart_Class.
- */
-typedef struct _Elm_Frame_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Frame_Smart_Class;
-
-/**
* Base layout smart data extended with frame instance data.
*/
typedef struct _Elm_Frame_Smart_Data Elm_Frame_Smart_Data;
struct _Elm_Frame_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Eina_Bool collapsed : 1;
Eina_Bool collapsible : 1;
Eina_Bool anim : 1;
@@ -132,11 +29,8 @@ struct _Elm_Frame_Smart_Data
* @}
*/
-EAPI extern const char ELM_FRAME_SMART_NAME[];
-EAPI const Elm_Frame_Smart_Class *elm_frame_smart_class_get(void);
-
#define ELM_FRAME_DATA_GET(o, sd) \
- Elm_Frame_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Frame_Smart_Data * sd = eo_data_get(o, ELM_OBJ_FRAME_CLASS)
#define ELM_FRAME_DATA_GET_OR_RETURN(o, ptr) \
ELM_FRAME_DATA_GET(o, ptr); \
@@ -156,9 +50,8 @@ EAPI const Elm_Frame_Smart_Class *elm_frame_smart_class_get(void);
return val; \
}
-#define ELM_FRAME_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_FRAME_SMART_NAME, \
- __func__)) \
+#define ELM_FRAME_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_FRAME_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_gengrid.h b/src/lib/elm_widget_gengrid.h
index 9d01e5a5a..7fb25aff1 100644
--- a/src/lib/elm_widget_gengrid.h
+++ b/src/lib/elm_widget_gengrid.h
@@ -2,8 +2,7 @@
#define ELM_WIDGET_GENGRID_H
#include "elm_gen_common.h"
-#include "elm_interface_scrollable.h"
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -17,121 +16,15 @@
*/
/**
- * @def ELM_GENGRID_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Gengrid_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_CLASS(x) ((Elm_Gengrid_Smart_Class *)x)
-
-/**
- * @def ELM_GENGRID_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Gengrid_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_DATA(x) ((Elm_Gengrid_Smart_Data *)x)
-
-/**
- * @def ELM_GENGRID_SMART_CLASS_VERSION
- *
- * Current version for Elementary gengrid @b base smart class, a value
- * which goes to _Elm_Gengrid_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_GENGRID_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Gengrid_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GENGRID_SMART_CLASS_INIT_NULL
- * @see ELM_GENGRID_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_GENGRID_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_GENGRID_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Gengrid_Smart_Class structure.
- *
- * @see ELM_GENGRID_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GENGRID_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_SMART_CLASS_INIT_NULL \
- ELM_GENGRID_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_GENGRID_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Gengrid_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_GENGRID_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Gengrid_Smart_Class (base field)
- * to the latest #ELM_GENGRID_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_GENGRID_SMART_CLASS_INIT_NULL
- * @see ELM_GENGRID_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GENGRID_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_GENGRID_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary gengrid base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a gengrid.
- *
- * All of the functions listed on @ref Gengrid namespace will work for
- * objects deriving from #Elm_Gengrid_Smart_Class.
- */
-typedef struct _Elm_Gengrid_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Gengrid_Smart_Class;
-
-/**
* Base widget smart data extended with gengrid instance data.
*/
typedef struct _Elm_Gengrid_Smart_Data Elm_Gengrid_Smart_Data;
struct _Elm_Gengrid_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
- const Elm_Scrollable_Smart_Interface *s_iface;
-
Eina_Inlist_Sorted_State *state;
Evas_Object *hit_rect;
Evas_Object *pan_obj;
+ Evas_Object *obj; // the object itself
Eina_List *selected; /* a list of
* selected
@@ -223,15 +116,10 @@ struct Elm_Gen_Item_Type
Eina_Bool moving : 1;
};
-typedef struct _Elm_Gengrid_Pan_Smart_Class
-{
- Elm_Pan_Smart_Class base;
-} Elm_Gengrid_Pan_Smart_Class;
-
typedef struct _Elm_Gengrid_Pan_Smart_Data Elm_Gengrid_Pan_Smart_Data;
struct _Elm_Gengrid_Pan_Smart_Data
{
- Elm_Pan_Smart_Data base;
+ Evas_Object *wobj;
Elm_Gengrid_Smart_Data *wsd;
Ecore_Job *resize_job;
};
@@ -240,14 +128,11 @@ struct _Elm_Gengrid_Pan_Smart_Data
* @}
*/
-EAPI extern const char ELM_GENGRID_SMART_NAME[];
-EAPI const Elm_Gengrid_Smart_Class *elm_gengrid_smart_class_get(void);
-
#define ELM_GENGRID_DATA_GET(o, sd) \
- Elm_Gengrid_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Gengrid_Smart_Data * sd = eo_data_get(o, ELM_OBJ_GENGRID_CLASS)
#define ELM_GENGRID_PAN_DATA_GET(o, sd) \
- Elm_Gengrid_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Gengrid_Pan_Smart_Data * sd = eo_data_get(o, ELM_OBJ_GENGRID_PAN_CLASS)
#define ELM_GENGRID_DATA_GET_OR_RETURN(o, ptr) \
ELM_GENGRID_DATA_GET(o, ptr); \
@@ -267,8 +152,8 @@ EAPI const Elm_Gengrid_Smart_Class *elm_gengrid_smart_class_get(void);
return val; \
}
-#define ELM_GENGRID_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_GENGRID_SMART_NAME, __func__)) \
+#define ELM_GENGRID_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_GENGRID_CLASS)) \
return
#define ELM_GENGRID_ITEM_CHECK(it) \
@@ -281,7 +166,7 @@ EAPI const Elm_Gengrid_Smart_Class *elm_gengrid_smart_class_get(void);
#define ELM_GENGRID_ITEM_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
- if (!it->base.widget || !elm_widget_type_check \
- ((it->base.widget), ELM_GENGRID_SMART_NAME, __func__)) goto label;
+ if (!it->base.widget || !eo_isa \
+ ((it->base.widget), ELM_OBJ_GENGRID_CLASS)) goto label;
#endif
diff --git a/src/lib/elm_widget_genlist.h b/src/lib/elm_widget_genlist.h
index 9b2f8cefc..14ae3f49c 100644
--- a/src/lib/elm_widget_genlist.h
+++ b/src/lib/elm_widget_genlist.h
@@ -2,8 +2,7 @@
#define ELM_WIDGET_GENLIST_H
#include "elm_gen_common.h"
-#include "elm_interface_scrollable.h"
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -17,107 +16,6 @@
*/
/**
- * @def ELM_GENLIST_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Genlist_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_CLASS(x) ((Elm_Genlist_Smart_Class *)x)
-
-/**
- * @def ELM_GENLIST_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Genlist_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_DATA(x) ((Elm_Genlist_Smart_Data *)x)
-
-/**
- * @def ELM_GENLIST_SMART_CLASS_VERSION
- *
- * Current version for Elementary genlist @b base smart class, a value
- * which goes to _Elm_Genlist_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_GENLIST_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Genlist_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GENLIST_SMART_CLASS_INIT_NULL
- * @see ELM_GENLIST_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_GENLIST_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_GENLIST_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Genlist_Smart_Class structure.
- *
- * @see ELM_GENLIST_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GENLIST_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_SMART_CLASS_INIT_NULL \
- ELM_GENLIST_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_GENLIST_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Genlist_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_GENLIST_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Genlist_Smart_Class (base field)
- * to the latest #ELM_GENLIST_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_GENLIST_SMART_CLASS_INIT_NULL
- * @see ELM_GENLIST_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GENLIST_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_GENLIST_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary genlist base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a genlist.
- *
- * All of the functions listed on @ref Genlist namespace will work for
- * objects deriving from #Elm_Genlist_Smart_Class.
- */
-typedef struct _Elm_Genlist_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Genlist_Smart_Class;
-
-/**
* Base widget smart data extended with genlist instance data.
*/
typedef struct _Elm_Genlist_Smart_Data Elm_Genlist_Smart_Data;
@@ -131,15 +29,10 @@ typedef enum
struct _Elm_Genlist_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
- const Elm_Scrollable_Smart_Interface *s_iface;
-
Eina_Inlist_Sorted_State *state;
Evas_Object *hit_rect;
Evas_Object *pan_obj;
+ Evas_Object *obj; // the object itself
Eina_List *selected; /* a list of
* selected
@@ -368,15 +261,10 @@ struct _Item_Cache
Eina_Bool tree : 1; // it->group
};
-typedef struct _Elm_Genlist_Pan_Smart_Class
-{
- Elm_Pan_Smart_Class base;
-} Elm_Genlist_Pan_Smart_Class;
-
typedef struct _Elm_Genlist_Pan_Smart_Data Elm_Genlist_Pan_Smart_Data;
struct _Elm_Genlist_Pan_Smart_Data
{
- Elm_Pan_Smart_Data base;
+ Evas_Object *wobj;
Elm_Genlist_Smart_Data *wsd;
Ecore_Job *resize_job;
};
@@ -385,14 +273,11 @@ struct _Elm_Genlist_Pan_Smart_Data
* @}
*/
-EAPI extern const char ELM_GENLIST_SMART_NAME[];
-EAPI const Elm_Genlist_Smart_Class *elm_genlist_smart_class_get(void);
-
#define ELM_GENLIST_DATA_GET(o, sd) \
- Elm_Genlist_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Genlist_Smart_Data * sd = eo_data_get(o, ELM_OBJ_GENLIST_CLASS)
#define ELM_GENLIST_PAN_DATA_GET(o, sd) \
- Elm_Genlist_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Genlist_Pan_Smart_Data * sd = eo_data_get(o, ELM_OBJ_GENLIST_PAN_CLASS)
#define ELM_GENLIST_DATA_GET_OR_RETURN(o, ptr) \
ELM_GENLIST_DATA_GET(o, ptr); \
@@ -412,8 +297,8 @@ EAPI const Elm_Genlist_Smart_Class *elm_genlist_smart_class_get(void);
return val; \
}
-#define ELM_GENLIST_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_GENLIST_SMART_NAME, __func__)) \
+#define ELM_GENLIST_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_GENLIST_CLASS)) \
return
#define ELM_GENLIST_ITEM_CHECK(it) \
@@ -426,7 +311,7 @@ EAPI const Elm_Genlist_Smart_Class *elm_genlist_smart_class_get(void);
#define ELM_GENLIST_ITEM_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
- if (!it->base.widget || !elm_widget_type_check \
- ((it->base.widget), ELM_GENLIST_SMART_NAME, __func__)) goto label;
+ if (!it->base.widget || !eo_isa \
+ ((it->base.widget), ELM_OBJ_GENLIST_CLASS)) goto label;
#endif
diff --git a/src/lib/elm_widget_glview.h b/src/lib/elm_widget_glview.h
index 1cc6ebfc6..ca4d7d3c7 100644
--- a/src/lib/elm_widget_glview.h
+++ b/src/lib/elm_widget_glview.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_GLVIEW_H
#define ELM_WIDGET_GLVIEW_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,115 +15,11 @@
*/
/**
- * @def ELM_GLVIEW_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Glview_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_CLASS(x) ((Elm_Glview_Smart_Class *) x)
-
-/**
- * @def ELM_GLVIEW_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Glview_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_DATA(x) ((Elm_Glview_Smart_Data *) x)
-
-/**
- * @def ELM_GLVIEW_SMART_CLASS_VERSION
- *
- * Current version for Elementary glview @b base smart class, a value
- * which goes to _Elm_Glview_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_GLVIEW_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Glview_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GLVIEW_SMART_CLASS_INIT_NULL
- * @see ELM_GLVIEW_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_GLVIEW_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_GLVIEW_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Glview_Smart_Class structure.
- *
- * @see ELM_GLVIEW_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GLVIEW_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_SMART_CLASS_INIT_NULL \
- ELM_GLVIEW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_GLVIEW_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Glview_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_GLVIEW_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Glview_Smart_Class (base field)
- * to the latest #ELM_GLVIEW_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_GLVIEW_SMART_CLASS_INIT_NULL
- * @see ELM_GLVIEW_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GLVIEW_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_GLVIEW_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary glview base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a glview.
- *
- * All of the functions listed on @ref Glview namespace will work for
- * objects deriving from #Elm_Glview_Smart_Class.
- */
-typedef struct _Elm_Glview_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Glview_Smart_Class;
-
-/**
* Base widget smart data extended with glview instance data.
*/
typedef struct _Elm_Glview_Smart_Data Elm_Glview_Smart_Data;
struct _Elm_Glview_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Elm_GLView_Mode mode;
Elm_GLView_Resize_Policy scale_policy;
Elm_GLView_Render_Policy render_policy;
@@ -148,11 +46,8 @@ struct _Elm_Glview_Smart_Data
* @}
*/
-EAPI extern const char ELM_GLVIEW_SMART_NAME[];
-EAPI const Elm_Glview_Smart_Class *elm_glview_smart_class_get(void);
-
#define ELM_GLVIEW_DATA_GET(o, sd) \
- Elm_Glview_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Glview_Smart_Data * sd = eo_data_get(o, ELM_OBJ_GLVIEW_CLASS)
#define ELM_GLVIEW_DATA_GET_OR_RETURN(o, ptr) \
ELM_GLVIEW_DATA_GET(o, ptr); \
@@ -172,8 +67,8 @@ EAPI const Elm_Glview_Smart_Class *elm_glview_smart_class_get(void);
return val; \
}
-#define ELM_GLVIEW_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_GLVIEW_SMART_NAME, __func__)) \
+#define ELM_GLVIEW_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_GLVIEW_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_grid.h b/src/lib/elm_widget_grid.h
index f55703830..f717d31e4 100644
--- a/src/lib/elm_widget_grid.h
+++ b/src/lib/elm_widget_grid.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_GRID_H
#define ELM_WIDGET_GRID_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,146 +15,10 @@
*/
/**
- * @def ELM_GRID_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Grid_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GRID_CLASS(x) ((Elm_Grid_Smart_Class *)x)
-
-/**
- * @def ELM_GRID_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Grid_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_GRID_DATA(x) ((Elm_Grid_Smart_Data *)x)
-
-/**
- * @def ELM_GRID_SMART_CLASS_VERSION
- *
- * Current version for Elementary grid @b base smart class, a value
- * which goes to _Elm_Grid_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_GRID_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_GRID_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Grid_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GRID_SMART_CLASS_INIT_NULL
- * @see ELM_GRID_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_GRID_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_GRID_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_GRID_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Grid_Smart_Class structure.
- *
- * @see ELM_GRID_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_GRID_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GRID_SMART_CLASS_INIT_NULL \
- ELM_GRID_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_GRID_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Grid_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_GRID_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Grid_Smart_Class (base field)
- * to the latest #ELM_GRID_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_GRID_SMART_CLASS_INIT_NULL
- * @see ELM_GRID_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_GRID_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_GRID_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary grid base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a grid.
- *
- * All of the functions listed on @ref Grid namespace will work for
- * objects deriving from #Elm_Grid_Smart_Class.
- */
-typedef struct _Elm_Grid_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Grid_Smart_Class;
-
-/**
- * Base widget smart data extended with grid instance data.
- */
-typedef struct _Elm_Grid_Smart_Data Elm_Grid_Smart_Data;
-struct _Elm_Grid_Smart_Data
-{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-};
-/**
* @}
*/
-EAPI extern const char ELM_GRID_SMART_NAME[];
-EAPI const Elm_Grid_Smart_Class
-*elm_grid_smart_class_get(void);
-
-#define ELM_GRID_DATA_GET(o, sd) \
- Elm_Grid_Smart_Data * sd = evas_object_smart_data_get(o)
-
-#define ELM_GRID_DATA_GET_OR_RETURN(o, ptr) \
- ELM_GRID_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
- }
-
-#define ELM_GRID_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_GRID_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
- }
-
-#define ELM_GRID_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_GRID_SMART_NAME, __func__)) \
+#define ELM_GRID_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_GRID_CLASS)) \
return
-
#endif
diff --git a/src/lib/elm_widget_hover.h b/src/lib/elm_widget_hover.h
index a59af475f..e070ca226 100644
--- a/src/lib/elm_widget_hover.h
+++ b/src/lib/elm_widget_hover.h
@@ -1,6 +1,7 @@
#ifndef ELM_WIDGET_HOVER_H
#define ELM_WIDGET_HOVER_H
+#include "Elementary.h"
#include "elm_widget_layout.h"
/**
@@ -15,107 +16,6 @@
*/
/**
- * @def ELM_HOVER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Hover_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_CLASS(x) ((Elm_Hover_Smart_Class *)x)
-
-/**
- * @def ELM_HOVER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Hover_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_DATA(x) ((Elm_Hover_Smart_Data *)x)
-
-/**
- * @def ELM_HOVER_SMART_CLASS_VERSION
- *
- * Current version for Elementary hover @b base smart class, a value
- * which goes to _Elm_Hover_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_HOVER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Hover_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_HOVER_SMART_CLASS_INIT_NULL
- * @see ELM_HOVER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_HOVER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_HOVER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Hover_Smart_Class structure.
- *
- * @see ELM_HOVER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_HOVER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_SMART_CLASS_INIT_NULL \
- ELM_HOVER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_HOVER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Hover_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_HOVER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Hover_Smart_Class (base field)
- * to the latest #ELM_HOVER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_HOVER_SMART_CLASS_INIT_NULL
- * @see ELM_HOVER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_HOVER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_HOVER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary hover base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a hover.
- *
- * All of the functions listed on @ref Hover namespace will work for
- * objects deriving from #Elm_Hover_Smart_Class.
- */
-typedef struct _Elm_Hover_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Hover_Smart_Class;
-
-/**
* Base widget smart data extended with hover instance data.
*/
typedef struct _Elm_Hover_Smart_Data Elm_Hover_Smart_Data;
@@ -132,8 +32,6 @@ extern const Elm_Layout_Part_Alias_Description _content_aliases[10];
struct _Elm_Hover_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *offset, *size;
Evas_Object *parent, *target;
@@ -148,11 +46,8 @@ struct _Elm_Hover_Smart_Data
* @}
*/
-EAPI extern const char ELM_HOVER_SMART_NAME[];
-EAPI const Elm_Hover_Smart_Class *elm_hover_smart_class_get(void);
-
#define ELM_HOVER_DATA_GET(o, sd) \
- Elm_Hover_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Hover_Smart_Data * sd = eo_data_get(o, ELM_OBJ_HOVER_CLASS)
#define ELM_HOVER_DATA_GET_OR_RETURN(o, ptr) \
ELM_HOVER_DATA_GET(o, ptr); \
@@ -172,8 +67,8 @@ EAPI const Elm_Hover_Smart_Class *elm_hover_smart_class_get(void);
return val; \
}
-#define ELM_HOVER_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_HOVER_SMART_NAME, __func__)) \
+#define ELM_HOVER_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_HOVER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_hoversel.h b/src/lib/elm_widget_hoversel.h
index 9f7b91952..8a03fd934 100644
--- a/src/lib/elm_widget_hoversel.h
+++ b/src/lib/elm_widget_hoversel.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_HOVERSEL_H
#define ELM_WIDGET_HOVERSEL_H
-#include "elm_widget_button.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
@@ -19,114 +19,11 @@
*/
/**
- * @def ELM_HOVERSEL_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Hoversel_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_CLASS(x) ((Elm_Hoversel_Smart_Class *)x)
-
-/**
- * @def ELM_HOVERSEL_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Hoversel_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_DATA(x) ((Elm_Hoversel_Smart_Data *)x)
-
-/**
- * @def ELM_HOVERSEL_SMART_CLASS_VERSION
- *
- * Current version for Elementary hoversel @b base smart class, a value
- * which goes to _Elm_Hoversel_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_HOVERSEL_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Hoversel_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_HOVERSEL_SMART_CLASS_INIT_NULL
- * @see ELM_HOVERSEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_HOVERSEL_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_HOVERSEL_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Hoversel_Smart_Class structure.
- *
- * @see ELM_HOVERSEL_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_HOVERSEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_SMART_CLASS_INIT_NULL \
- ELM_HOVERSEL_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_HOVERSEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Hoversel_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_HOVERSEL_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Hoversel_Smart_Class (base field)
- * to the latest #ELM_HOVERSEL_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_HOVERSEL_SMART_CLASS_INIT_NULL
- * @see ELM_HOVERSEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_HOVERSEL_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_HOVERSEL_SMART_CLASS_INIT \
- (ELM_BUTTON_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary hoversel base smart class. This inherits directly from
- * #Elm_Button_Smart_Class and is meant to build widgets extending the
- * behavior of a hoversel.
- *
- * All of the functions listed on @ref Hoversel namespace will work for
- * objects deriving from #Elm_Hoversel_Smart_Class.
- */
-typedef struct _Elm_Hoversel_Smart_Class
-{
- Elm_Button_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Hoversel_Smart_Class;
-
-/**
* Base button smart data extended with hoversel instance data.
*/
typedef struct _Elm_Hoversel_Smart_Data Elm_Hoversel_Smart_Data;
struct _Elm_Hoversel_Smart_Data
{
- Elm_Button_Smart_Data base;
-
/* aggregates a hover */
Evas_Object *hover;
Evas_Object *hover_parent;
@@ -154,11 +51,8 @@ struct _Elm_Hoversel_Item
* @}
*/
-EAPI extern const char ELM_HOVERSEL_SMART_NAME[];
-EAPI const Elm_Hoversel_Smart_Class *elm_hoversel_smart_class_get(void);
-
#define ELM_HOVERSEL_DATA_GET(o, sd) \
- Elm_Hoversel_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Hoversel_Smart_Data * sd = eo_data_get(o, ELM_OBJ_HOVERSEL_CLASS)
#define ELM_HOVERSEL_DATA_GET_OR_RETURN(o, ptr) \
ELM_HOVERSEL_DATA_GET(o, ptr); \
@@ -179,8 +73,7 @@ EAPI const Elm_Hoversel_Smart_Class *elm_hoversel_smart_class_get(void);
}
#define ELM_HOVERSEL_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_HOVERSEL_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_HOVERSEL_CLASS)) \
return
#define ELM_HOVERSEL_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_icon.h b/src/lib/elm_widget_icon.h
index ae5be5efb..5285859cb 100644
--- a/src/lib/elm_widget_icon.h
+++ b/src/lib/elm_widget_icon.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_ICON_H
#define ELM_WIDGET_ICON_H
-#include "elm_widget_image.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -13,108 +13,10 @@
* an icon as their basic graphics.
*/
- /**
- * @def ELM_ICON_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Icon_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
- #define ELM_ICON_CLASS(x) ((Elm_Icon_Smart_Class *) x)
-
-/**
- * @def ELM_ICON_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Icon_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ICON_DATA(x) ((Elm_Icon_Smart_Data *) x)
-
-/**
- * @def ELM_ICON_SMART_CLASS_VERSION
- *
- * Current version for Elementary icon @b base smart class, a value
- * which goes to _Elm_Icon_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_ICON_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_ICON_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Icon_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ICON_SMART_CLASS_INIT_NULL
- * @see ELM_ICON_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_ICON_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_ICON_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_ICON_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Icon_Smart_Class structure.
- *
- * @see ELM_ICON_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ICON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ICON_SMART_CLASS_INIT_NULL \
- ELM_ICON_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_ICON_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Icon_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_ICON_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Icon_Smart_Class (base field)
- * to the latest #ELM_ICON_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_ICON_SMART_CLASS_INIT_NULL
- * @see ELM_ICON_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ICON_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_ICON_SMART_CLASS_INIT(ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary icon base smart class. This inherits directly from
- * #Elm_Image_Smart_Class and is meant to build widgets relying on an
- * icon as the building block of its visuals.
- */
-typedef struct _Elm_Icon_Smart_Class
-{
- Elm_Image_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Icon_Smart_Class;
-
typedef struct _Elm_Icon_Smart_Data Elm_Icon_Smart_Data;
struct _Elm_Icon_Smart_Data
{
- Elm_Image_Smart_Data base;
-
+ Evas_Object *obj; // the object itself
const char *stdicon;
Elm_Icon_Lookup_Order lookup_order;
@@ -157,11 +59,8 @@ struct _Elm_Icon_Smart_Data
* @}
*/
-EAPI extern const char ELM_ICON_SMART_NAME[];
-EAPI const Elm_Icon_Smart_Class *elm_icon_smart_class_get(void);
-
#define ELM_ICON_DATA_GET(o, sd) \
- Elm_Icon_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Icon_Smart_Data * sd = eo_data_get(o, ELM_OBJ_ICON_CLASS)
#define ELM_ICON_DATA_GET_OR_RETURN(o, ptr) \
ELM_ICON_DATA_GET(o, ptr); \
@@ -182,7 +81,7 @@ EAPI const Elm_Icon_Smart_Class *elm_icon_smart_class_get(void);
}
#define ELM_ICON_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_ICON_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_ICON_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_image.h b/src/lib/elm_widget_image.h
index f0f5e3a71..4b9e2b4c5 100644
--- a/src/lib/elm_widget_image.h
+++ b/src/lib/elm_widget_image.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_IMAGE_H
#define ELM_WIDGET_IMAGE_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -20,169 +22,12 @@
* changeable anymore.
*/
- /**
- * @def ELM_IMAGE_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Image_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
- #define ELM_IMAGE_CLASS(x) ((Elm_Image_Smart_Class *) x)
-
-/**
- * @def ELM_IMAGE_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Image_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_IMAGE_DATA(x) ((Elm_Image_Smart_Data *) x)
-
-/**
- * @def ELM_IMAGE_SMART_CLASS_VERSION
- *
- * Current version for Elementary image @b base smart class, a value
- * which goes to _Elm_Image_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_IMAGE_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_IMAGE_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Image_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_IMAGE_SMART_CLASS_INIT_NULL
- * @see ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_IMAGE_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_IMAGE_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
-
-/**
- * @def ELM_IMAGE_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Image_Smart_Class structure.
- *
- * @see ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_IMAGE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_IMAGE_SMART_CLASS_INIT_NULL \
- ELM_IMAGE_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Image_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_IMAGE_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Image_Smart_Class (base field)
- * to the latest #ELM_IMAGE_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_IMAGE_SMART_CLASS_INIT_NULL
- * @see ELM_IMAGE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_IMAGE_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_IMAGE_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary image base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets relying on an
- * image as the building block of its visuals.
- */
-
-typedef struct _Elm_Image_Smart_Class
-{
- Elm_Widget_Smart_Class base; /**< Base Elementary widget class struct, since we're inheriting from it */
-
- int version; /**< Version of this smart class definition */
-
- void (*sizing_eval)(Evas_Object *obj); /* 'Virtual' function on evalutating the object's final geometry */
- Eina_Bool (*memfile_set)(Evas_Object *obj,
- const void *img,
- size_t size,
- const char *format,
- const char *key); /* 'Virtual' function on setting the image content on the object via a memory buffer */
- Eina_Bool (*file_set)(Evas_Object *obj,
- const char *file,
- const char *key); /* 'Virtual' function on setting the image content on the object via a file. It may be a direct image, an EET-encoded image or an Edje file. They @a key argument will be used for the last two cases mentioned (@c NULL must be used on the first). Beware that the Edje case will only be detected by an @c "edj" extension on the file name. */
- void (*file_get)(const Evas_Object *obj,
- const char **file,
- const char **key); /* 'Virtual' function on retrieving back the image object's file path and key */
-
- Evas_Object *(*image_object_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving the object's internal image file, which may me an Evas image or an Edje file */
-
- void (*size_get)(const Evas_Object *obj,
- int *w,
- int *h); /* 'Virtual' function on retrieving the size of the object's internal image. */
-
- void (*preload_set)(Evas_Object *obj,
- Eina_Bool disable); /* 'Virtual' function on enabling/disabling pre-loading for the object's image data. */
- void (*fill_inside_set)(Evas_Object *obj,
- Eina_Bool fill_inside); /* 'Virtual' function on how to resize the object's internal image, when maintaining a given aspect ratio -- leave blank spaces or scale to fill all space, with pixels out of bounds. */
- Eina_Bool (*fill_inside_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving how the object's internal image is to be resized, when maintaining a given aspect ratio. */
-
- void (*scale_set)(Evas_Object *obj,
- double scale); /* 'Virtual' function on setting the scale for the object's image size (@c 1.0 meaning original size). */
- double (*scale_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving the scale for the object's image size. */
-
- void (*smooth_scale_set)(Evas_Object *obj,
- Eina_Bool smooth); /* 'Virtual' function on setting whether the object's image should be scaled smoothly or not. */
- Eina_Bool (*smooth_scale_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving whether the object's image is to scaled smoothly or not. */
- void (*resize_up_set)(Evas_Object *obj,
- Eina_Bool resize_up); /* 'Virtual' function on setting whether the object's image can be resized to a size greater than the original one. */
- Eina_Bool (*resize_up_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving whether the object's image can be resized to a size greater than the original one. */
- void (*resize_down_set)(Evas_Object *obj,
- Eina_Bool resize_down); /* 'Virtual' function on setting whether the object's image can be resized to a size smaller than the original one. */
- Eina_Bool (*resize_down_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving whether the object's image can be resized to a size smaller than the original one. */
- void (*load_size_set)(Evas_Object *obj,
- int size); /* 'Virtual' function on setting the object's image loading size (in pixels, applied to both axis). */
- int (*load_size_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving the object's image loading size. */
-
- void (*orient_set)(Evas_Object *obj,
- Elm_Image_Orient orient); /* 'Virtual' function on setting the object's image orientation. */
- Elm_Image_Orient (*orient_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving the object's image orientation. */
-
- void (*aspect_fixed_set)(Evas_Object *obj,
- Eina_Bool fixed); /* 'Virtual' function on setting whether the original aspect ratio of the object's image should be kept if it's resized. */
- Eina_Bool (*aspect_fixed_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving whether the original aspect ratio of the object's image is to be kept if it's resized. */
-
- void (*edit_set)(Evas_Object *obj,
- Eina_Bool edit,
- Evas_Object *parent); /* 'Virtual' function on setting whether the object is a valid target/source for drag and drop actions. */
- Eina_Bool (*edit_get)(const Evas_Object *obj); /* 'Virtual' function on retrieving whether the object is a valid target/source for drag and drop actions. */
-} Elm_Image_Smart_Class;
-
/**
* Base widget smart data extended with image instance data.
*/
typedef struct _Elm_Image_Smart_Data Elm_Image_Smart_Data;
struct _Elm_Image_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
Evas_Object *img;
Evas_Object *prev_img;
@@ -216,11 +61,8 @@ struct _Elm_Image_Smart_Data
* @}
*/
-EAPI extern const char ELM_IMAGE_SMART_NAME[];
-EAPI const Elm_Image_Smart_Class *elm_image_smart_class_get(void);
-
#define ELM_IMAGE_DATA_GET(o, sd) \
- Elm_Image_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Image_Smart_Data * sd = eo_data_get(o, ELM_OBJ_IMAGE_CLASS)
#define ELM_IMAGE_DATA_GET_OR_RETURN(o, ptr) \
ELM_IMAGE_DATA_GET(o, ptr); \
@@ -241,7 +83,7 @@ EAPI const Elm_Image_Smart_Class *elm_image_smart_class_get(void);
}
#define ELM_IMAGE_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_IMAGE_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_IMAGE_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_index.h b/src/lib/elm_widget_index.h
index 3029575c7..730cc7412 100644
--- a/src/lib/elm_widget_index.h
+++ b/src/lib/elm_widget_index.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_INDEX_H
#define ELM_WIDGET_INDEX_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_INDEX_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Index_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_CLASS(x) ((Elm_Index_Smart_Class *)x)
-
-/**
- * @def ELM_INDEX_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Index_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_DATA(x) ((Elm_Index_Smart_Data *)x)
-
-/**
- * @def ELM_INDEX_SMART_CLASS_VERSION
- *
- * Current version for Elementary index @b base smart class, a value
- * which goes to _Elm_Index_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_INDEX_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Index_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_INDEX_SMART_CLASS_INIT_NULL
- * @see ELM_INDEX_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_INDEX_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_INDEX_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Index_Smart_Class structure.
- *
- * @see ELM_INDEX_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_INDEX_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_SMART_CLASS_INIT_NULL \
- ELM_INDEX_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_INDEX_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Index_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_INDEX_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Index_Smart_Class (base field)
- * to the latest #ELM_INDEX_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_INDEX_SMART_CLASS_INIT_NULL
- * @see ELM_INDEX_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_INDEX_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_INDEX_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary index base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a index.
- *
- * All of the functions listed on @ref Index namespace will work for
- * objects deriving from #Elm_Index_Smart_Class.
- */
-typedef struct _Elm_Index_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Index_Smart_Class;
-
-/**
* Base layout smart data extended with index instance data.
*/
typedef struct _Elm_Index_Smart_Data Elm_Index_Smart_Data;
struct _Elm_Index_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *event[2];
Evas_Object *bx[2]; // 2 - for now all that's supported
Eina_List *items; /* 1 list. N levels, but only 2
@@ -154,12 +51,8 @@ struct _Elm_Index_Item
/**
* @}
*/
-
-EAPI extern const char ELM_INDEX_SMART_NAME[];
-EAPI const Elm_Index_Smart_Class *elm_index_smart_class_get(void);
-
#define ELM_INDEX_DATA_GET(o, sd) \
- Elm_Index_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Index_Smart_Data * sd = eo_data_get(o, ELM_OBJ_INDEX_CLASS)
#define ELM_INDEX_DATA_GET_OR_RETURN(o, ptr) \
ELM_INDEX_DATA_GET(o, ptr); \
@@ -180,7 +73,7 @@ EAPI const Elm_Index_Smart_Class *elm_index_smart_class_get(void);
}
#define ELM_INDEX_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_INDEX_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_INDEX_CLASS)) \
return
#define ELM_INDEX_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_inwin.h b/src/lib/elm_widget_inwin.h
index 05118c614..31d6c3eba 100644
--- a/src/lib/elm_widget_inwin.h
+++ b/src/lib/elm_widget_inwin.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_INWIN_H
#define ELM_WIDGET_INWIN_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,124 +15,19 @@
*/
/**
- * @def ELM_INWIN_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Inwin_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_CLASS(x) ((Elm_Inwin_Smart_Class *)x)
-
-/**
- * @def ELM_INWIN_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Inwin_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_DATA(x) ((Elm_Inwin_Smart_Data *)x)
-
-/**
- * @def ELM_INWIN_SMART_CLASS_VERSION
- *
- * Current version for Elementary inwin @b base smart class, a value
- * which goes to _Elm_Inwin_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_INWIN_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Inwin_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_INWIN_SMART_CLASS_INIT_NULL
- * @see ELM_INWIN_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_INWIN_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_INWIN_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Inwin_Smart_Class structure.
- *
- * @see ELM_INWIN_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_INWIN_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_SMART_CLASS_INIT_NULL \
- ELM_INWIN_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_INWIN_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Inwin_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_INWIN_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Inwin_Smart_Class (base field)
- * to the latest #ELM_INWIN_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_INWIN_SMART_CLASS_INIT_NULL
- * @see ELM_INWIN_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_INWIN_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_INWIN_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary inwin base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a inwin.
- *
- * All of the functions listed on @ref Inwin namespace will work for
- * objects deriving from #Elm_Inwin_Smart_Class.
- */
-typedef struct _Elm_Inwin_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Inwin_Smart_Class;
-
-/**
* Base layout smart data extended with inwin instance data.
*/
typedef struct _Elm_Inwin_Smart_Data Elm_Inwin_Smart_Data;
struct _Elm_Inwin_Smart_Data
{
- Elm_Layout_Smart_Data base;
};
/**
* @}
*/
-EAPI extern const char ELM_INWIN_SMART_NAME[];
-EAPI const Elm_Inwin_Smart_Class *elm_inwin_smart_class_get(void);
-
#define ELM_INWIN_DATA_GET(o, sd) \
- Elm_Inwin_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Inwin_Smart_Data * sd = eo_data_get(o, ELM_OBJ_WIN_INWIN_CLASS)
#define ELM_INWIN_DATA_GET_OR_RETURN(o, ptr) \
ELM_INWIN_DATA_GET(o, ptr); \
@@ -152,9 +47,8 @@ EAPI const Elm_Inwin_Smart_Class *elm_inwin_smart_class_get(void);
return val; \
}
-#define ELM_INWIN_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_INWIN_SMART_NAME, \
- __func__)) \
+#define ELM_INWIN_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_WIN_INWIN_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_label.h b/src/lib/elm_widget_label.h
index bec5d229a..b8cf6b578 100644
--- a/src/lib/elm_widget_label.h
+++ b/src/lib/elm_widget_label.h
@@ -1,132 +1,18 @@
#ifndef ELM_WIDGET_LABEL_H
#define ELM_WIDGET_LABEL_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
#endif
/**
- * @addtogroup Widget
- * @{
- *
- * @section elm-label-class The Elementary Label Class
- *
- * Elementary, besides having the @ref Label widget, exposes its
- * foundation -- the Elementary Label Class -- in order to create other
- * widgets which are a label with some more logic on top.
- */
-
-/**
- * @def ELM_LABEL_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Label_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_CLASS(x) ((Elm_Label_Smart_Class *)x)
-
-/**
- * @def ELM_LABEL_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Label_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_DATA(x) ((Elm_Label_Smart_Data *)x)
-
-/**
- * @def ELM_LABEL_SMART_CLASS_VERSION
- *
- * Current version for Elementary label @b base smart class, a value
- * which goes to _Elm_Label_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_LABEL_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Label_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LABEL_SMART_CLASS_INIT_NULL
- * @see ELM_LABEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_LABEL_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_LABEL_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Label_Smart_Class structure.
- *
- * @see ELM_LABEL_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LABEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_SMART_CLASS_INIT_NULL \
- ELM_LABEL_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_LABEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Label_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_LABEL_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Label_Smart_Class (base field)
- * to the latest #ELM_LABEL_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_LABEL_SMART_CLASS_INIT_NULL
- * @see ELM_LABEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LABEL_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_LABEL_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary label base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a label.
- *
- * All of the functions listed on @ref Label namespace will work for
- * objects deriving from #Elm_Label_Smart_Class.
- */
-typedef struct _Elm_Label_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Label_Smart_Class;
-
-/**
* Base layout smart data extended with label instance data.
*/
typedef struct _Elm_Label_Smart_Data Elm_Label_Smart_Data;
struct _Elm_Label_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
const char *format;
double slide_duration;
Evas_Coord lastw;
@@ -138,15 +24,8 @@ struct _Elm_Label_Smart_Data
Eina_Bool slidingellipsis : 1;
};
-/**
- * @}
- */
-
-EAPI extern const char ELM_LABEL_SMART_NAME[];
-EAPI const Elm_Label_Smart_Class *elm_label_smart_class_get(void);
-
#define ELM_LABEL_DATA_GET(o, sd) \
- Elm_Label_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Label_Smart_Data * sd = eo_data_get(o, ELM_OBJ_LABEL_CLASS)
#define ELM_LABEL_DATA_GET_OR_RETURN(o, ptr) \
ELM_LABEL_DATA_GET(o, ptr); \
@@ -167,8 +46,7 @@ EAPI const Elm_Label_Smart_Class *elm_label_smart_class_get(void);
}
#define ELM_LABEL_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_LABEL_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_LABEL_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_layout.h b/src/lib/elm_widget_layout.h
index bcd31cd7c..c5412cbb0 100644
--- a/src/lib/elm_widget_layout.h
+++ b/src/lib/elm_widget_layout.h
@@ -39,94 +39,6 @@
*/
/**
- * @def ELM_LAYOUT_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Layout_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_CLASS(x) ((Elm_Layout_Smart_Class *) x)
-
-/**
- * @def ELM_LAYOUT_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Layout_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_DATA(x) ((Elm_Layout_Smart_Data *) x)
-
-/**
- * @def ELM_LAYOUT_SMART_CLASS_VERSION
- *
- * Current version for Elementary layout @b base smart class, a value
- * which goes to _Elm_Layout_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_LAYOUT_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Layout_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LAYOUT_SMART_CLASS_INIT_NULL
- * @see ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_LAYOUT_SMART_CLASS_VERSION, NULL, NULL, NULL, NULL, \
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \
- NULL}
-
-/**
- * @def ELM_LAYOUT_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Layout_Smart_Class structure.
- *
- * @see ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LAYOUT_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_SMART_CLASS_INIT_NULL \
- ELM_LAYOUT_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Layout_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_LAYOUT_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Layout_Smart_Class (base field)
- * to the latest #ELM_LAYOUT_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_LAYOUT_SMART_CLASS_INIT_NULL
- * @see ELM_LAYOUT_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_LAYOUT_SMART_CLASS_INIT \
- (ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
* @typedef Elm_Layout_Part_Alias_Description
*
* A layout part aliasing (proxying) description, used to get part
@@ -160,86 +72,11 @@ struct _Elm_Layout_Part_Alias_Description
};
/**
- * Elementary layout base smart class. This inherits directly from
- * #Elm_Container_Smart_Class and is meant to build widgets relying on
- * an Edje layout as a building block of its visuals.
- *
- * For instance, the elm_layout @b widget itself is just a realization
- * of this smart class (see the code for elm_layout_add()). All of the
- * functions listed on @ref Layout namespace will work for objects
- * deriving from #Elm_Layout_Smart_Class.
- */
-typedef struct _Elm_Layout_Smart_Class
-{
- Elm_Container_Smart_Class base; /**< Elementary container widget class struct, since we're inheriting from it */
-
- int version; /**< Version of this smart class definition */
-
- void (*sizing_eval)(Evas_Object *obj); /* 'Virtual' function on evalutating the object's final geometry, accounting for its sub-objects */
- void (*signal)(Evas_Object *obj,
- const char *emission,
- const char *source); /* 'Virtual' function on emitting an (Edje) signal to the object, acting on its internal layout */
- void (*callback_add)(Evas_Object *obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func,
- void *data); /* 'Virtual' function on adding an (Edje) signal callback to the object, proxyed from its internal layout */
- void * (*callback_del)(Evas_Object * obj,
- const char *emission,
- const char *source,
- Edje_Signal_Cb func); /* 'Virtual' function on deleting an (Edje) signal callback on the object, proxyed from its internal layout */
- Eina_Bool (*text_set)(Evas_Object *obj,
- const char *part,
- const char *text); /* 'Virtual' function on setting text on an (Edje) part of the object, from its internal layout */
- const char *(*text_get)(const Evas_Object * obj,
- const char *part); /* 'Virtual' function on fetching text from an (Edje) part of the object, on its internal layout */
-
- Eina_Bool (*box_append)(Evas_Object *obj,
- const char *part,
- Evas_Object *child); /* 'Virtual' function on appending an object to an (Edje) box part of the object, from its internal layout */
- Eina_Bool (*box_prepend)(Evas_Object *obj,
- const char *part,
- Evas_Object *child); /* 'Virtual' function on prepending an object to an (Edje) box part of the object, from its internal layout */
- Eina_Bool (*box_insert_before)(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- const Evas_Object *reference); /* 'Virtual' function on inserting an object to an (Edje) box part of the object, from its internal layout. The new child's position in the box is be prior to the one of a relative child already in the box */
- Eina_Bool (*box_insert_at)(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- unsigned int pos); /* 'Virtual' function on inserting an object to an (Edje) box part of the object, from its internal layout. The new child's position number is passed explicitly */
- Evas_Object *(*box_remove)(Evas_Object * obj,
- const char *part,
- Evas_Object * child); /* 'Virtual' function on removing an object from an (Edje) box part of the object, on its internal layout */
- Eina_Bool (*box_remove_all)(Evas_Object *obj,
- const char *part,
- Eina_Bool clear); /* 'Virtual' function on removing @b all objects from an (Edje) box part of the object, on its internal layout */
- Eina_Bool (*table_pack)(Evas_Object *obj,
- const char *part,
- Evas_Object *child,
- unsigned short col,
- unsigned short row,
- unsigned short colspan,
- unsigned short rowspan); /* 'Virtual' function on inserting an object to an (Edje) table part of the object, from its internal layout */
- Evas_Object *(*table_unpack)(Evas_Object * obj,
- const char *part,
- Evas_Object * child); /* 'Virtual' function on removing an object from an (Edje) table part of the object, on its internal layout */
- Eina_Bool (*table_clear)(Evas_Object *obj,
- const char *part,
- Eina_Bool clear); /* 'Virtual' function on removing @b all objects from an (Edje) table part of the object, on its internal layout */
-
- const Elm_Layout_Part_Alias_Description *content_aliases; /**< List of (@c 'SWALLOW') part aliases, <b>@c NULL terminated</b>. If @c NULL is passed as part name, it will be translated to the 1st _Elm_Layout_Part_Proxies_Description::real_part field in the list. */
-
- const Elm_Layout_Part_Alias_Description *text_aliases; /**< List of (@c 'TEXT' or 'TEXTBLOCK') part aliases, <b>@c NULL terminated</b>. If @c NULL is passed as part name, it will be translated to the 1st _Elm_Layout_Part_Proxies_Description::real_part field in the list. */
-} Elm_Layout_Smart_Class;
-
-/**
* Base widget smart data extended with layout instance data.
*/
typedef struct _Elm_Layout_Smart_Data
{
- Elm_Widget_Smart_Data base; /**< Base widget smart data as first member obligatory */
-
+ Evas_Object *obj; /* The object itself */
Eina_List *subs; /**< List of Elm_Layout_Sub_Object_Data structs, to hold the actual sub objects */
Eina_List *edje_signals;
Eina_List *parts_cursors;
@@ -252,32 +89,11 @@ typedef struct _Elm_Layout_Smart_Data
* @}
*/
-EAPI extern const char ELM_LAYOUT_SMART_NAME[];
-EAPI const Elm_Layout_Smart_Class *elm_layout_smart_class_get(void);
-
#define ELM_LAYOUT_DATA_GET(o, sd) \
- Elm_Layout_Smart_Data * sd = evas_object_smart_data_get(o)
-
-#define ELM_LAYOUT_DATA_GET_OR_RETURN(o, ptr) \
- ELM_LAYOUT_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
- }
-
-#define ELM_LAYOUT_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_LAYOUT_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
- }
+ Elm_Layout_Smart_Data * sd = eo_data_get(o, ELM_OBJ_LAYOUT_CLASS)
#define ELM_LAYOUT_CHECK(obj) \
- if (!elm_widget_type_check((obj), ELM_LAYOUT_SMART_NAME, __func__)) \
+ if (!eo_isa(obj, ELM_OBJ_LAYOUT_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_list.h b/src/lib/elm_widget_list.h
index 8bd51c5ea..a40fb8453 100644
--- a/src/lib/elm_widget_list.h
+++ b/src/lib/elm_widget_list.h
@@ -15,107 +15,6 @@
* other widgets which are a list with some more logic on top.
*/
-/**
- * @def ELM_LIST_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_List_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LIST_CLASS(x) ((Elm_List_Smart_Class *)x)
-
-/**
- * @def ELM_LIST_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_List_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_LIST_DATA(x) ((Elm_List_Smart_Data *)x)
-
-/**
- * @def ELM_LIST_SMART_CLASS_VERSION
- *
- * Current version for Elementary list @b base smart class, a value
- * which goes to _Elm_List_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_LIST_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_LIST_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_List_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LIST_SMART_CLASS_INIT_NULL
- * @see ELM_LIST_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_LIST_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_LIST_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_LIST_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_List_Smart_Class structure.
- *
- * @see ELM_LIST_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_LIST_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LIST_SMART_CLASS_INIT_NULL \
- ELM_LIST_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_LIST_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_List_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_LIST_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_List_Smart_Class (base field)
- * to the latest #ELM_LIST_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_LIST_SMART_CLASS_INIT_NULL
- * @see ELM_LIST_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_LIST_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_LIST_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary list base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a list.
- *
- * All of the functions listed on @ref List namespace will work for
- * objects deriving from #Elm_List_Smart_Class.
- */
-typedef struct _Elm_List_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_List_Smart_Class;
-
#define ELM_LIST_SWIPE_MOVES 12
/**
@@ -124,12 +23,7 @@ typedef struct _Elm_List_Smart_Class
typedef struct _Elm_List_Smart_Data Elm_List_Smart_Data;
struct _Elm_List_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *box, *hit_rect;
- const Elm_Scrollable_Smart_Interface *s_iface;
Eina_List *items, *selected, *to_delete;
Elm_Object_Item *last_selected_item;
@@ -186,11 +80,8 @@ struct _Elm_List_Item
* @}
*/
-EAPI extern const char ELM_LIST_SMART_NAME[];
-EAPI const Elm_List_Smart_Class *elm_list_smart_class_get(void);
-
#define ELM_LIST_DATA_GET(o, sd) \
- Elm_List_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_List_Smart_Data * sd = eo_data_get(o, ELM_OBJ_LIST_CLASS)
#define ELM_LIST_DATA_GET_OR_RETURN(o, ptr) \
ELM_LIST_DATA_GET(o, ptr); \
@@ -210,8 +101,8 @@ EAPI const Elm_List_Smart_Class *elm_list_smart_class_get(void);
return val; \
}
-#define ELM_LIST_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_LIST_SMART_NAME, __func__)) \
+#define ELM_LIST_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_LIST_CLASS)) \
return
#define ELM_LIST_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_map.h b/src/lib/elm_widget_map.h
index 4fba3f1b8..e124c2798 100644
--- a/src/lib/elm_widget_map.h
+++ b/src/lib/elm_widget_map.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_MAP_H
#define ELM_WIDGET_MAP_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,106 +15,6 @@
*/
/**
- * @def ELM_MAP_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Map_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MAP_CLASS(x) ((Elm_Map_Smart_Class *) x)
-
-/**
- * @def ELM_MAP_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Map_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MAP_DATA(x) ((Elm_Map_Smart_Data *) x)
-
-/**
- * @def ELM_MAP_SMART_CLASS_VERSION
- *
- * Current version for Elementary map @b base smart class, a value
- * which goes to _Elm_Map_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_MAP_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_MAP_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Map_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MAP_SMART_CLASS_INIT_NULL
- * @see ELM_MAP_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_MAP_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_MAP_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_MAP_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Map_Smart_Class structure.
- *
- * @see ELM_MAP_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MAP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MAP_SMART_CLASS_INIT_NULL \
- ELM_MAP_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_MAP_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Map_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_MAP_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Map_Smart_Class (base field)
- * to the latest #ELM_MAP_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_MAP_SMART_CLASS_INIT_NULL
- * @see ELM_MAP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MAP_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_MAP_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary map base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a map.
- *
- * All of the functions listed on @ref Map namespace will work for
- * objects deriving from #Elm_Map_Smart_Class.
- */
-typedef struct _Elm_Map_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Map_Smart_Class;
-
-/**
* Base widget smart data extended with map instance data.
*/
typedef struct _Elm_Map_Smart_Data Elm_Map_Smart_Data;
@@ -490,14 +390,10 @@ struct _Calc_Job
struct _Elm_Map_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hit_rect;
- const Elm_Scrollable_Smart_Interface *s_iface;
Evas_Object *pan_obj;
Evas_Object *g_layer;
+ Evas_Object *obj; // The object itself
/* Tiles are below this and overlays are on top */
Evas_Object *sep_maps_overlays;
@@ -581,15 +477,10 @@ struct _Elm_Map_Smart_Data
Calc_Job calc_job;
};
-typedef struct _Elm_Map_Pan_Smart_Class
-{
- Elm_Pan_Smart_Class base;
-} Elm_Map_Pan_Smart_Class;
-
typedef struct _Elm_Map_Pan_Smart_Data Elm_Map_Pan_Smart_Data;
struct _Elm_Map_Pan_Smart_Data
{
- Elm_Pan_Smart_Data base;
+ Evas_Object *wobj;
Elm_Map_Smart_Data *wsd;
};
@@ -597,15 +488,11 @@ struct _Elm_Map_Pan_Smart_Data
* @}
*/
-EAPI extern const char ELM_MAP_SMART_NAME[];
-EAPI extern const char ELM_MAP_PAN_SMART_NAME[];
-EAPI const Elm_Map_Smart_Class *elm_map_smart_class_get(void);
-
#define ELM_MAP_DATA_GET(o, sd) \
- Elm_Map_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Map_Smart_Data * sd = eo_data_get(o, ELM_OBJ_MAP_CLASS)
#define ELM_MAP_PAN_DATA_GET(o, sd) \
- Elm_Map_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Map_Pan_Smart_Data * sd = eo_data_get(o, ELM_OBJ_MAP_PAN_CLASS)
#define ELM_MAP_DATA_GET_OR_RETURN(o, ptr) \
ELM_MAP_DATA_GET(o, ptr); \
@@ -626,8 +513,7 @@ EAPI const Elm_Map_Smart_Class *elm_map_smart_class_get(void);
}
#define ELM_MAP_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_MAP_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_MAP_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_mapbuf.h b/src/lib/elm_widget_mapbuf.h
index 7d4d8e625..9e00d876c 100644
--- a/src/lib/elm_widget_mapbuf.h
+++ b/src/lib/elm_widget_mapbuf.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_MAPBUF_H
#define ELM_WIDGET_MAPBUF_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_MAPBUF_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Mapbuf_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_CLASS(x) ((Elm_Mapbuf_Smart_Class *)x)
-
-/**
- * @def ELM_MAPBUF_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Mapbuf_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_DATA(x) ((Elm_Mapbuf_Smart_Data *)x)
-
-/**
- * @def ELM_MAPBUF_SMART_CLASS_VERSION
- *
- * Current version for Elementary mapbuf @b base smart class, a value
- * which goes to _Elm_Mapbuf_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_MAPBUF_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Mapbuf_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MAPBUF_SMART_CLASS_INIT_NULL
- * @see ELM_MAPBUF_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_MAPBUF_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_MAPBUF_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Mapbuf_Smart_Class structure.
- *
- * @see ELM_MAPBUF_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MAPBUF_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_SMART_CLASS_INIT_NULL \
- ELM_MAPBUF_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_MAPBUF_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Mapbuf_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_MAPBUF_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Mapbuf_Smart_Class (base field)
- * to the latest #ELM_MAPBUF_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_MAPBUF_SMART_CLASS_INIT_NULL
- * @see ELM_MAPBUF_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MAPBUF_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_MAPBUF_SMART_CLASS_INIT \
- (ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary mapbuf base smart class. This inherits directly from
- * #Elm_Container_Smart_Class and is meant to build widgets extending the
- * behavior of a mapbuf.
- *
- * All of the functions listed on @ref Mapbuf namespace will work for
- * objects deriving from #Elm_Mapbuf_Smart_Class.
- */
-typedef struct _Elm_Mapbuf_Smart_Class
-{
- Elm_Container_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Mapbuf_Smart_Class;
-
-/**
* Base widget smart data extended with mapbuf instance data.
*/
typedef struct _Elm_Mapbuf_Smart_Data Elm_Mapbuf_Smart_Data;
struct _Elm_Mapbuf_Smart_Data
{
- Elm_Container_Smart_Data base;
-
Evas_Object *content;
Eina_Bool enabled : 1;
@@ -134,11 +31,8 @@ struct _Elm_Mapbuf_Smart_Data
* @}
*/
-EAPI extern const char ELM_MAPBUF_SMART_NAME[];
-EAPI const Elm_Mapbuf_Smart_Class *elm_mapbuf_smart_class_get(void);
-
#define ELM_MAPBUF_DATA_GET(o, sd) \
- Elm_Mapbuf_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Mapbuf_Smart_Data * sd = eo_data_get(o, ELM_OBJ_MAPBUF_CLASS)
#define ELM_MAPBUF_DATA_GET_OR_RETURN(o, ptr) \
ELM_MAPBUF_DATA_GET(o, ptr); \
@@ -159,7 +53,7 @@ EAPI const Elm_Mapbuf_Smart_Class *elm_mapbuf_smart_class_get(void);
}
#define ELM_MAPBUF_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_MAPBUF_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_MAPBUF_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_menu.h b/src/lib/elm_widget_menu.h
index 237760ea4..45befaeaf 100644
--- a/src/lib/elm_widget_menu.h
+++ b/src/lib/elm_widget_menu.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_MENU_H
#define ELM_WIDGET_MENU_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,115 +15,11 @@
*/
/**
- * @def ELM_MENU_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Menu_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MENU_CLASS(x) ((Elm_Menu_Smart_Class *) x)
-
-/**
- * @def ELM_MENU_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Menu_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MENU_DATA(x) ((Elm_Menu_Smart_Data *) x)
-
-/**
- * @def ELM_MENU_SMART_CLASS_VERSION
- *
- * Current version for Elementary menu @b base smart class, a value
- * which goes to _Elm_Menu_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_MENU_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_MENU_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Menu_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MENU_SMART_CLASS_INIT_NULL
- * @see ELM_MENU_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_MENU_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_MENU_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_MENU_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Menu_Smart_Class structure.
- *
- * @see ELM_MENU_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MENU_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MENU_SMART_CLASS_INIT_NULL \
- ELM_MENU_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_MENU_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Menu_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_MENU_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Menu_Smart_Class (base field)
- * to the latest #ELM_MENU_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_MENU_SMART_CLASS_INIT_NULL
- * @see ELM_MENU_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MENU_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_MENU_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary menu base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a menu.
- *
- * All of the functions listed on @ref Menu namespace will work for
- * objects deriving from #Elm_Menu_Smart_Class.
- */
-typedef struct _Elm_Menu_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Menu_Smart_Class;
-
-/**
* Base widget smart data extended with menu instance data.
*/
typedef struct _Elm_Menu_Smart_Data Elm_Menu_Smart_Data;
struct _Elm_Menu_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hv, *bx, *location, *parent;
Eina_List *items;
@@ -156,11 +54,8 @@ struct _Elm_Menu_Item
* @}
*/
-EAPI extern const char ELM_MENU_SMART_NAME[];
-EAPI const Elm_Menu_Smart_Class *elm_menu_smart_class_get(void);
-
#define ELM_MENU_DATA_GET(o, sd) \
- Elm_Menu_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Menu_Smart_Data * sd = eo_data_get(o, ELM_OBJ_MENU_CLASS)
#define ELM_MENU_DATA_GET_OR_RETURN(o, ptr) \
ELM_MENU_DATA_GET(o, ptr); \
@@ -181,7 +76,7 @@ EAPI const Elm_Menu_Smart_Class *elm_menu_smart_class_get(void);
}
#define ELM_MENU_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_MENU_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_MENU_CLASS)) \
return
#define ELM_MENU_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_multibuttonentry.h b/src/lib/elm_widget_multibuttonentry.h
index 3abc86538..712cc4f3d 100644
--- a/src/lib/elm_widget_multibuttonentry.h
+++ b/src/lib/elm_widget_multibuttonentry.h
@@ -16,108 +16,6 @@
*/
/**
- * @def ELM_MULTIBUTTONENTRY_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Multibuttonentry_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_CLASS(x) ((Elm_Multibuttonentry_Smart_Class *)x)
-
-/**
- * @def ELM_MULTIBUTTONENTRY_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Multibuttonentry_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_DATA(x) ((Elm_Multibuttonentry_Smart_Data *)x)
-
-/**
- * @def ELM_MULTIBUTTONENTRY_SMART_CLASS_VERSION
- *
- * Current version for Elementary multibuttonentry @b base smart class, a value
- * which goes to _Elm_Multibuttonentry_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Multibuttonentry_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_MULTIBUTTONENTRY_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Multibuttonentry_Smart_Class structure.
- *
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NULL \
- ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Multibuttonentry_Smart_Class
- * structure and set its name and version.
- *
- * This is similar to #ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NULL, but
- * it will also set the version field of
- * #Elm_Multibuttonentry_Smart_Class (base field) to the latest
- * #ELM_MULTIBUTTONENTRY_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NULL
- * @see ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_MULTIBUTTONENTRY_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary multibuttonentry base smart class. This inherits
- * directly from #Elm_Layout_Smart_Class and is meant to build widgets
- * extending the behavior of a multibuttonentry.
- *
- * All of the functions listed on @ref Multibuttonentry namespace will
- * work for objects deriving from #Elm_Multibuttonentry_Smart_Class.
- */
-typedef struct _Elm_Multibuttonentry_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Multibuttonentry_Smart_Class;
-
-/**
* Base widget smart data extended with multibuttonentry instance data.
*/
@@ -171,8 +69,6 @@ typedef struct _Elm_Multibuttonentry_Smart_Data
Elm_Multibuttonentry_Smart_Data;
struct _Elm_Multibuttonentry_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *box;
Evas_Object *entry;
Evas_Object *label;
@@ -209,12 +105,8 @@ struct _Elm_Multibuttonentry_Smart_Data
* @}
*/
-EAPI extern const char ELM_MULTIBUTTONENTRY_SMART_NAME[];
-EAPI const Elm_Multibuttonentry_Smart_Class
-*elm_multibuttonentry_smart_class_get(void);
-
#define ELM_MULTIBUTTONENTRY_DATA_GET(o, sd) \
- Elm_Multibuttonentry_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Multibuttonentry_Smart_Data * sd = eo_data_get(o, ELM_OBJ_MULTIBUTTONENTRY_CLASS)
#define ELM_MULTIBUTTONENTRY_DATA_GET_OR_RETURN(o, ptr) \
ELM_MULTIBUTTONENTRY_DATA_GET(o, ptr); \
@@ -235,9 +127,7 @@ EAPI const Elm_Multibuttonentry_Smart_Class
}
#define ELM_MULTIBUTTONENTRY_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), \
- ELM_MULTIBUTTONENTRY_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_MULTIBUTTONENTRY_CLASS)) \
return
#define ELM_MULTIBUTTONENTRY_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_naviframe.h b/src/lib/elm_widget_naviframe.h
index f1ef432e2..5a36e09b2 100644
--- a/src/lib/elm_widget_naviframe.h
+++ b/src/lib/elm_widget_naviframe.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_NAVIFRAME_H
#define ELM_WIDGET_NAVIFRAME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_NAVIFRAME_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Naviframe_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_CLASS(x) ((Elm_Naviframe_Smart_Class *)x)
-
-/**
- * @def ELM_NAVIFRAME_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Naviframe_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_DATA(x) ((Elm_Naviframe_Smart_Data *)x)
-
-/**
- * @def ELM_NAVIFRAME_SMART_CLASS_VERSION
- *
- * Current version for Elementary naviframe @b base smart class, a value
- * which goes to _Elm_Naviframe_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_NAVIFRAME_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Naviframe_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT_NULL
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_NAVIFRAME_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_NAVIFRAME_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Naviframe_Smart_Class structure.
- *
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_SMART_CLASS_INIT_NULL \
- ELM_NAVIFRAME_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_NAVIFRAME_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Naviframe_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_NAVIFRAME_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Naviframe_Smart_Class (base field)
- * to the latest #ELM_NAVIFRAME_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT_NULL
- * @see ELM_NAVIFRAME_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_NAVIFRAME_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_NAVIFRAME_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary naviframe base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a naviframe.
- *
- * All of the functions listed on @ref Naviframe namespace will work for
- * objects deriving from #Elm_Naviframe_Smart_Class.
- */
-typedef struct _Elm_Naviframe_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Naviframe_Smart_Class;
-
-/**
* Base layout smart data extended with naviframe instance data.
*/
typedef struct _Elm_Naviframe_Smart_Data Elm_Naviframe_Smart_Data;
struct _Elm_Naviframe_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Eina_Inlist *stack; /* top item is the list's LAST item */
Evas_Object *dummy_edje;
Ecore_Animator *animator;
@@ -176,11 +73,8 @@ struct _Elm_Naviframe_Text_Item_Pair
* @}
*/
-EAPI extern const char ELM_NAVIFRAME_SMART_NAME[];
-EAPI const Elm_Naviframe_Smart_Class *elm_naviframe_smart_class_get(void);
-
#define ELM_NAVIFRAME_DATA_GET(o, sd) \
- Elm_Naviframe_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Naviframe_Smart_Data * sd = eo_data_get(o, ELM_OBJ_NAVIFRAME_CLASS)
#define ELM_NAVIFRAME_DATA_GET_OR_RETURN(o, ptr) \
ELM_NAVIFRAME_DATA_GET(o, ptr); \
@@ -201,8 +95,7 @@ EAPI const Elm_Naviframe_Smart_Class *elm_naviframe_smart_class_get(void);
}
#define ELM_NAVIFRAME_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_NAVIFRAME_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_NAVIFRAME_CLASS)) \
return
#define ELM_NAVIFRAME_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_notify.h b/src/lib/elm_widget_notify.h
index 202335aa0..0344a1473 100644
--- a/src/lib/elm_widget_notify.h
+++ b/src/lib/elm_widget_notify.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_NOTIFY_H
#define ELM_WIDGET_NOTIFY_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -14,105 +14,6 @@
* widgets which are a notify with some more logic on top.
*/
-/**
- * @def ELM_NOTIFY_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Notify_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_CLASS(x) ((Elm_Notify_Smart_Class *)x)
-
-/**
- * @def ELM_NOTIFY_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Notify_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_DATA(x) ((Elm_Notify_Smart_Data *)x)
-
-/**
- * @def ELM_NOTIFY_SMART_CLASS_VERSION
- *
- * Current version for Elementary notify @b base smart class, a value
- * which goes to _Elm_Notify_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_NOTIFY_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Notify_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_NOTIFY_SMART_CLASS_INIT_NULL
- * @see ELM_NOTIFY_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_NOTIFY_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_NOTIFY_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Notify_Smart_Class structure.
- *
- * @see ELM_NOTIFY_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_NOTIFY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_SMART_CLASS_INIT_NULL \
- ELM_NOTIFY_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_NOTIFY_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Notify_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_NOTIFY_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Notify_Smart_Class (base field)
- * to the latest #ELM_NOTIFY_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_NOTIFY_SMART_CLASS_INIT_NULL
- * @see ELM_NOTIFY_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_NOTIFY_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_NOTIFY_SMART_CLASS_INIT(ELM_CONTAINER_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary notify base smart class. This inherits directly from
- * #Elm_Container_Smart_Class and is meant to build widgets extending the
- * behavior of a notify.
- *
- * All of the functions listed on @ref Notify namespace will work for
- * objects deriving from #Elm_Notify_Smart_Class.
- */
-typedef struct _Elm_Notify_Smart_Class
-{
- Elm_Container_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Notify_Smart_Class;
/**
* Base widget smart data extended with notify instance data.
@@ -120,8 +21,6 @@ typedef struct _Elm_Notify_Smart_Class
typedef struct _Elm_Notify_Smart_Data Elm_Notify_Smart_Data;
struct _Elm_Notify_Smart_Data
{
- Elm_Container_Smart_Data base;
-
Evas_Object *notify, *content, *parent;
Evas_Object *block_events;
double timeout;
@@ -135,11 +34,8 @@ struct _Elm_Notify_Smart_Data
* @}
*/
-EAPI extern const char ELM_NOTIFY_SMART_NAME[];
-EAPI const Elm_Notify_Smart_Class *elm_notify_smart_class_get(void);
-
#define ELM_NOTIFY_DATA_GET(o, sd) \
- Elm_Notify_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Notify_Smart_Data * sd = eo_data_get(o, ELM_OBJ_NOTIFY_CLASS)
#define ELM_NOTIFY_DATA_GET_OR_RETURN(o, ptr) \
ELM_NOTIFY_DATA_GET(o, ptr); \
@@ -160,7 +56,7 @@ EAPI const Elm_Notify_Smart_Class *elm_notify_smart_class_get(void);
}
#define ELM_NOTIFY_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_NOTIFY_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_NOTIFY_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_panel.h b/src/lib/elm_widget_panel.h
index 889d55137..2b835bce8 100644
--- a/src/lib/elm_widget_panel.h
+++ b/src/lib/elm_widget_panel.h
@@ -16,116 +16,11 @@
*/
/**
- * @def ELM_PANEL_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Panel_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_CLASS(x) ((Elm_Panel_Smart_Class *)x)
-
-/**
- * @def ELM_PANEL_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Panel_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_DATA(x) ((Elm_Panel_Smart_Data *)x)
-
-/**
- * @def ELM_PANEL_SMART_CLASS_VERSION
- *
- * Current version for Elementary panel @b base smart class, a value
- * which goes to _Elm_Panel_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PANEL_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Panel_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PANEL_SMART_CLASS_INIT_NULL
- * @see ELM_PANEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PANEL_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PANEL_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Panel_Smart_Class structure.
- *
- * @see ELM_PANEL_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PANEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_SMART_CLASS_INIT_NULL \
- ELM_PANEL_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PANEL_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Panel_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PANEL_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Panel_Smart_Class (base field)
- * to the latest #ELM_PANEL_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PANEL_SMART_CLASS_INIT_NULL
- * @see ELM_PANEL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PANEL_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PANEL_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary panel base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a panel.
- *
- * All of the functions listed on @ref Panel namespace will work for
- * objects deriving from #Elm_Panel_Smart_Class.
- */
-typedef struct _Elm_Panel_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Panel_Smart_Class;
-
-/**
* Base layout smart data extended with panel instance data.
*/
typedef struct _Elm_Panel_Smart_Data Elm_Panel_Smart_Data;
struct _Elm_Panel_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *bx, *content;
Elm_Panel_Orient orient;
@@ -138,11 +33,8 @@ struct _Elm_Panel_Smart_Data
* @}
*/
-EAPI extern const char ELM_PANEL_SMART_NAME[];
-EAPI const Elm_Panel_Smart_Class *elm_panel_smart_class_get(void);
-
#define ELM_PANEL_DATA_GET(o, sd) \
- Elm_Panel_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Panel_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PANEL_CLASS)
#define ELM_PANEL_DATA_GET_OR_RETURN(o, ptr) \
ELM_PANEL_DATA_GET(o, ptr); \
@@ -163,8 +55,7 @@ EAPI const Elm_Panel_Smart_Class *elm_panel_smart_class_get(void);
}
#define ELM_PANEL_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_PANEL_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PANEL_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_panes.h b/src/lib/elm_widget_panes.h
index 8afe99a1c..6b329e7d1 100644
--- a/src/lib/elm_widget_panes.h
+++ b/src/lib/elm_widget_panes.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_PANES_H
#define ELM_WIDGET_PANES_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_PANES_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Panes_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PANES_CLASS(x) ((Elm_Panes_Smart_Class *)x)
-
-/**
- * @def ELM_PANES_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Panes_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PANES_DATA(x) ((Elm_Panes_Smart_Data *)x)
-
-/**
- * @def ELM_PANES_SMART_CLASS_VERSION
- *
- * Current version for Elementary panes @b base smart class, a value
- * which goes to _Elm_Panes_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PANES_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PANES_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Panes_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PANES_SMART_CLASS_INIT_NULL
- * @see ELM_PANES_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PANES_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PANES_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PANES_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Panes_Smart_Class structure.
- *
- * @see ELM_PANES_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PANES_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PANES_SMART_CLASS_INIT_NULL \
- ELM_PANES_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PANES_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Panes_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PANES_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Panes_Smart_Class (base field)
- * to the latest #ELM_PANES_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PANES_SMART_CLASS_INIT_NULL
- * @see ELM_PANES_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PANES_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PANES_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary panes base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a panes.
- *
- * All of the functions listed on @ref Panes namespace will work for
- * objects deriving from #Elm_Panes_Smart_Class.
- */
-typedef struct _Elm_Panes_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Panes_Smart_Class;
-
-/**
* Base layout smart data extended with panes instance data.
*/
typedef struct _Elm_Panes_Smart_Data Elm_Panes_Smart_Data;
struct _Elm_Panes_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
struct
{
int x_diff;
@@ -139,12 +36,8 @@ struct _Elm_Panes_Smart_Data
* @}
*/
-EAPI extern const char ELM_PANES_SMART_NAME[];
-EAPI const Elm_Panes_Smart_Class
-*elm_panes_smart_class_get(void);
-
#define ELM_PANES_DATA_GET(o, sd) \
- Elm_Panes_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Panes_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PANES_CLASS)
#define ELM_PANES_DATA_GET_OR_RETURN(o, ptr) \
ELM_PANES_DATA_GET(o, ptr); \
@@ -165,8 +58,7 @@ EAPI const Elm_Panes_Smart_Class
}
#define ELM_PANES_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_PANES_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PANES_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_photo.h b/src/lib/elm_widget_photo.h
index 217fe31c9..c0f1258d3 100644
--- a/src/lib/elm_widget_photo.h
+++ b/src/lib/elm_widget_photo.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_PHOTO_H
#define ELM_WIDGET_PHOTO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,12 @@
*/
/**
- * @def ELM_PHOTO_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Photo_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_CLASS(x) ((Elm_Photo_Smart_Class *) x)
-
-/**
- * @def ELM_PHOTO_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Photo_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_DATA(x) ((Elm_Photo_Smart_Data *) x)
-
-/**
- * @def ELM_PHOTO_SMART_CLASS_VERSION
- *
- * Current version for Elementary photo @b base smart class, a value
- * which goes to _Elm_Photo_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PHOTO_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Photo_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PHOTO_SMART_CLASS_INIT_NULL
- * @see ELM_PHOTO_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PHOTO_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PHOTO_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Photo_Smart_Class structure.
- *
- * @see ELM_PHOTO_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PHOTO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_SMART_CLASS_INIT_NULL \
- ELM_PHOTO_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PHOTO_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Photo_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PHOTO_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Photo_Smart_Class (base field)
- * to the latest #ELM_PHOTO_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PHOTO_SMART_CLASS_INIT_NULL
- * @see ELM_PHOTO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PHOTO_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PHOTO_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary photo base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a photo.
- *
- * All of the functions listed on @ref Photo namespace will work for
- * objects deriving from #Elm_Photo_Smart_Class.
- */
-typedef struct _Elm_Photo_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Photo_Smart_Class;
-
-/**
* Base widget smart data extended with photo instance data.
*/
typedef struct _Elm_Photo_Smart_Data Elm_Photo_Smart_Data;
struct _Elm_Photo_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
Evas_Object *icon;
int size;
Eina_Bool fill_inside;
@@ -144,11 +42,8 @@ struct _Elm_Photo_Smart_Data
* @}
*/
-EAPI extern const char ELM_PHOTO_SMART_NAME[];
-EAPI const Elm_Photo_Smart_Class *elm_photo_smart_class_get(void);
-
#define ELM_PHOTO_DATA_GET(o, sd) \
- Elm_Photo_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Photo_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PHOTO_CLASS)
#define ELM_PHOTO_DATA_GET_OR_RETURN(o, ptr) \
ELM_PHOTO_DATA_GET(o, ptr); \
@@ -169,7 +64,7 @@ EAPI const Elm_Photo_Smart_Class *elm_photo_smart_class_get(void);
}
#define ELM_PHOTO_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_PHOTO_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PHOTO_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_photocam.h b/src/lib/elm_widget_photocam.h
index 9caf18125..8c68eefc2 100644
--- a/src/lib/elm_widget_photocam.h
+++ b/src/lib/elm_widget_photocam.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_PHOTOCAM_H
#define ELM_WIDGET_PHOTOCAM_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,106 +15,6 @@
*/
/**
- * @def ELM_PHOTOCAM_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Photocam_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_CLASS(x) ((Elm_Photocam_Smart_Class *) x)
-
-/**
- * @def ELM_PHOTOCAM_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Photocam_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_DATA(x) ((Elm_Photocam_Smart_Data *) x)
-
-/**
- * @def ELM_PHOTOCAM_SMART_CLASS_VERSION
- *
- * Current version for Elementary photocam @b base smart class, a value
- * which goes to _Elm_Photocam_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PHOTOCAM_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Photocam_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT_NULL
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PHOTOCAM_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PHOTOCAM_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Photocam_Smart_Class structure.
- *
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_SMART_CLASS_INIT_NULL \
- ELM_PHOTOCAM_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PHOTOCAM_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Photocam_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PHOTOCAM_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Photocam_Smart_Class (base field)
- * to the latest #ELM_PHOTOCAM_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT_NULL
- * @see ELM_PHOTOCAM_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PHOTOCAM_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PHOTOCAM_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary photocam base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a photocam.
- *
- * All of the functions listed on @ref Photocam namespace will work for
- * objects deriving from #Elm_Photocam_Smart_Class.
- */
-typedef struct _Elm_Photocam_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Photocam_Smart_Class;
-
-/**
* Base widget smart data extended with photocam instance data.
*/
typedef struct _Elm_Photocam_Smart_Data Elm_Photocam_Smart_Data;
@@ -124,6 +24,7 @@ typedef struct _Elm_Photocam_Grid_Item Elm_Photocam_Grid_Item;
struct _Elm_Photocam_Grid_Item
{
+ Evas_Object *obj;
Elm_Photocam_Smart_Data *sd;
Evas_Object *img;
@@ -152,15 +53,9 @@ struct _Elm_Phocam_Grid
struct _Elm_Photocam_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hit_rect;
Evas_Object *g_layer;
- const Elm_Scrollable_Smart_Interface *s_iface;
-
Evas_Object *pan_obj;
Evas_Coord pan_x, pan_y, minw, minh;
@@ -226,14 +121,9 @@ struct _Elm_Photocam_Smart_Data
Eina_Bool paused : 1;
};
-typedef struct _Elm_Photocam_Pan_Smart_Class
-{
- Elm_Pan_Smart_Class base;
-} Elm_Photocam_Pan_Smart_Class;
-
struct _Elm_Photocam_Pan_Smart_Data
{
- Elm_Pan_Smart_Data base;
+ Evas_Object *wobj;
Elm_Photocam_Smart_Data *wsd;
};
@@ -241,15 +131,11 @@ struct _Elm_Photocam_Pan_Smart_Data
* @}
*/
-EAPI extern const char ELM_PHOTOCAM_SMART_NAME[];
-EAPI extern const char ELM_PHOTOCAM_PAN_SMART_NAME[];
-EAPI const Elm_Photocam_Smart_Class *elm_photocam_smart_class_get(void);
-
#define ELM_PHOTOCAM_DATA_GET(o, sd) \
- Elm_Photocam_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Photocam_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PHOTOCAM_CLASS)
#define ELM_PHOTOCAM_PAN_DATA_GET(o, sd) \
- Elm_Photocam_Pan_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Photocam_Pan_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PHOTOCAM_PAN_CLASS)
#define ELM_PHOTOCAM_DATA_GET_OR_RETURN(o, ptr) \
ELM_PHOTOCAM_DATA_GET(o, ptr); \
@@ -270,8 +156,7 @@ EAPI const Elm_Photocam_Smart_Class *elm_photocam_smart_class_get(void);
}
#define ELM_PHOTOCAM_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_PHOTOCAM_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PHOTOCAM_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_player.h b/src/lib/elm_widget_player.h
index bc8180d5c..96571b2e3 100644
--- a/src/lib/elm_widget_player.h
+++ b/src/lib/elm_widget_player.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_PLAYER_H
#define ELM_WIDGET_PLAYER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_PLAYER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Player_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_CLASS(x) ((Elm_Player_Smart_Class *)x)
-
-/**
- * @def ELM_PLAYER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Player_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_DATA(x) ((Elm_Player_Smart_Data *)x)
-
-/**
- * @def ELM_PLAYER_SMART_CLASS_VERSION
- *
- * Current version for Elementary player @b base smart class, a value
- * which goes to _Elm_Player_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PLAYER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Player_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PLAYER_SMART_CLASS_INIT_NULL
- * @see ELM_PLAYER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PLAYER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PLAYER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Player_Smart_Class structure.
- *
- * @see ELM_PLAYER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PLAYER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_SMART_CLASS_INIT_NULL \
- ELM_PLAYER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PLAYER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Player_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PLAYER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Player_Smart_Class (base field)
- * to the latest #ELM_PLAYER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PLAYER_SMART_CLASS_INIT_NULL
- * @see ELM_PLAYER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PLAYER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PLAYER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary player base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a player.
- *
- * All of the functions listed on @ref Player namespace will work for
- * objects deriving from #Elm_Player_Smart_Class.
- */
-typedef struct _Elm_Player_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Player_Smart_Class;
-
-/**
* Base layout smart data extended with player instance data.
*/
typedef struct _Elm_Player_Smart_Data Elm_Player_Smart_Data;
struct _Elm_Player_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *video;
Evas_Object *emotion;
@@ -142,11 +39,8 @@ struct _Elm_Player_Smart_Data
* @}
*/
-EAPI extern const char ELM_PLAYER_SMART_NAME[];
-EAPI const Elm_Player_Smart_Class *elm_player_smart_class_get(void);
-
#define ELM_PLAYER_DATA_GET(o, sd) \
- Elm_Player_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Player_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PLAYER_CLASS)
#define ELM_PLAYER_DATA_GET_OR_RETURN(o, ptr) \
ELM_PLAYER_DATA_GET(o, ptr); \
@@ -167,8 +61,7 @@ EAPI const Elm_Player_Smart_Class *elm_player_smart_class_get(void);
}
#define ELM_PLAYER_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_PLAYER_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PLAYER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_plug.h b/src/lib/elm_widget_plug.h
index cc61957be..abbddc06e 100644
--- a/src/lib/elm_widget_plug.h
+++ b/src/lib/elm_widget_plug.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_PLUG_H
#define ELM_WIDGET_PLUG_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -11,126 +13,12 @@
* foundation -- the Elementary Plug Class -- in order to create other
* widgets which are a plug with some more logic on top.
*/
-
-/**
- * @def ELM_PLUG_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Plug_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_CLASS(x) ((Elm_Plug_Smart_Class *)x)
-
-/**
- * @def ELM_PLUG_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Plug_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_DATA(x) ((Elm_Plug_Smart_Data *)x)
-
-/**
- * @def ELM_PLUG_SMART_CLASS_VERSION
- *
- * Current version for Elementary plug @b base smart class, a value
- * which goes to _Elm_Plug_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PLUG_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Plug_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PLUG_SMART_CLASS_INIT_NULL
- * @see ELM_PLUG_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PLUG_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PLUG_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Plug_Smart_Class structure.
- *
- * @see ELM_PLUG_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PLUG_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_SMART_CLASS_INIT_NULL \
- ELM_PLUG_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PLUG_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Plug_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PLUG_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Plug_Smart_Class (base field)
- * to the latest #ELM_PLUG_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PLUG_SMART_CLASS_INIT_NULL
- * @see ELM_PLUG_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PLUG_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PLUG_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary plug base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a plug.
- *
- * All of the functions listed on @ref Plug namespace will work for
- * objects deriving from #Elm_Plug_Smart_Class.
- */
-typedef struct _Elm_Plug_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Plug_Smart_Class;
-
-/**
- * Base widget smart data extended with plug instance data.
- */
-typedef struct _Elm_Plug_Smart_Data Elm_Plug_Smart_Data;
-struct _Elm_Plug_Smart_Data
-{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-};
/**
* @}
*/
-EAPI extern const char ELM_PLUG_SMART_NAME[];
-EAPI const Elm_Plug_Smart_Class *elm_plug_smart_class_get(void);
-
#define ELM_PLUG_DATA_GET(o, sd) \
- Elm_Plug_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Plug_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PLUG_CLASS)
#define ELM_PLUG_DATA_GET_OR_RETURN(o, ptr) \
ELM_PLUG_DATA_GET(o, ptr); \
@@ -151,7 +39,7 @@ EAPI const Elm_Plug_Smart_Class *elm_plug_smart_class_get(void);
}
#define ELM_PLUG_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_PLUG_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PLUG_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_popup.h b/src/lib/elm_widget_popup.h
index 42096bc5d..8bef548b1 100644
--- a/src/lib/elm_widget_popup.h
+++ b/src/lib/elm_widget_popup.h
@@ -14,107 +14,6 @@
* widgets which are a popup with some more logic on top.
*/
-/**
- * @def ELM_POPUP_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Popup_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_CLASS(x) ((Elm_Popup_Smart_Class *)x)
-
-/**
- * @def ELM_POPUP_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Popup_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_DATA(x) ((Elm_Popup_Smart_Data *)x)
-
-/**
- * @def ELM_POPUP_SMART_CLASS_VERSION
- *
- * Current version for Elementary popup @b base smart class, a value
- * which goes to _Elm_Popup_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_POPUP_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Popup_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_POPUP_SMART_CLASS_INIT_NULL
- * @see ELM_POPUP_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_POPUP_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_POPUP_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Popup_Smart_Class structure.
- *
- * @see ELM_POPUP_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_POPUP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_SMART_CLASS_INIT_NULL \
- ELM_POPUP_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_POPUP_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Popup_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_POPUP_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Popup_Smart_Class (base field)
- * to the latest #ELM_POPUP_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_POPUP_SMART_CLASS_INIT_NULL
- * @see ELM_POPUP_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_POPUP_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_POPUP_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary popup base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a popup.
- *
- * All of the functions listed on @ref Popup namespace will work for
- * objects deriving from #Elm_Popup_Smart_Class.
- */
-typedef struct _Elm_Popup_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Popup_Smart_Class;
-
#define ELM_POPUP_ACTION_BUTTON_MAX 3
typedef struct _Action_Area_Data Action_Area_Data;
@@ -125,8 +24,6 @@ typedef struct _Action_Area_Data Action_Area_Data;
typedef struct _Elm_Popup_Smart_Data Elm_Popup_Smart_Data;
struct _Elm_Popup_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *notify;
Evas_Object *title_icon;
Evas_Object *title_access_obj;
@@ -173,11 +70,8 @@ struct _Action_Area_Data
* @}
*/
-EAPI extern const char ELM_POPUP_SMART_NAME[];
-EAPI const Elm_Popup_Smart_Class *elm_popup_smart_class_get(void);
-
#define ELM_POPUP_DATA_GET(o, sd) \
- Elm_Popup_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Popup_Smart_Data * sd = eo_data_get(o, ELM_OBJ_POPUP_CLASS)
#define ELM_POPUP_DATA_GET_OR_RETURN(o, ptr) \
ELM_POPUP_DATA_GET(o, ptr); \
@@ -198,8 +92,7 @@ EAPI const Elm_Popup_Smart_Class *elm_popup_smart_class_get(void);
}
#define ELM_POPUP_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_POPUP_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_POPUP_CLASS)) \
return
#define ELM_POPUP_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_progressbar.h b/src/lib/elm_widget_progressbar.h
index e061936a0..6b24fd1a6 100644
--- a/src/lib/elm_widget_progressbar.h
+++ b/src/lib/elm_widget_progressbar.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_PROGRESSBAR_H
#define ELM_WIDGET_PROGRESSBAR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_PROGRESSBAR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Progressbar_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_CLASS(x) ((Elm_Progressbar_Smart_Class *)x)
-
-/**
- * @def ELM_PROGRESSBAR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Progressbar_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_DATA(x) ((Elm_Progressbar_Smart_Data *)x)
-
-/**
- * @def ELM_PROGRESSBAR_SMART_CLASS_VERSION
- *
- * Current version for Elementary progressbar @b base smart class, a value
- * which goes to _Elm_Progressbar_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_PROGRESSBAR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Progressbar_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT_NULL
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_PROGRESSBAR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_PROGRESSBAR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Progressbar_Smart_Class structure.
- *
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_SMART_CLASS_INIT_NULL \
- ELM_PROGRESSBAR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_PROGRESSBAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Progressbar_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_PROGRESSBAR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Progressbar_Smart_Class (base field)
- * to the latest #ELM_PROGRESSBAR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT_NULL
- * @see ELM_PROGRESSBAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_PROGRESSBAR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_PROGRESSBAR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary progressbar base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a progressbar.
- *
- * All of the functions listed on @ref Progressbar namespace will work for
- * objects deriving from #Elm_Progressbar_Smart_Class.
- */
-typedef struct _Elm_Progressbar_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Progressbar_Smart_Class;
-
-/**
* Base layout smart data extended with progressbar instance data.
*/
typedef struct _Elm_Progressbar_Smart_Data Elm_Progressbar_Smart_Data;
struct _Elm_Progressbar_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *spacer;
const char *units;
@@ -142,11 +39,8 @@ struct _Elm_Progressbar_Smart_Data
* @}
*/
-EAPI extern const char ELM_PROGRESSBAR_SMART_NAME[];
-EAPI const Elm_Progressbar_Smart_Class *elm_progressbar_smart_class_get(void);
-
#define ELM_PROGRESSBAR_DATA_GET(o, sd) \
- Elm_Progressbar_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Progressbar_Smart_Data * sd = eo_data_get(o, ELM_OBJ_PROGRESSBAR_CLASS)
#define ELM_PROGRESSBAR_DATA_GET_OR_RETURN(o, ptr) \
ELM_PROGRESSBAR_DATA_GET(o, ptr); \
@@ -167,8 +61,7 @@ EAPI const Elm_Progressbar_Smart_Class *elm_progressbar_smart_class_get(void);
}
#define ELM_PROGRESSBAR_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_PROGRESSBAR_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_PROGRESSBAR_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_radio.h b/src/lib/elm_widget_radio.h
index b25ea3491..6952be3fd 100644
--- a/src/lib/elm_widget_radio.h
+++ b/src/lib/elm_widget_radio.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_RADIO_H
#define ELM_WIDGET_RADIO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,107 +15,6 @@
*/
/**
- * @def ELM_RADIO_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Radio_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_CLASS(x) ((Elm_Radio_Smart_Class *)x)
-
-/**
- * @def ELM_RADIO_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Radio_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_DATA(x) ((Elm_Radio_Smart_Data *)x)
-
-/**
- * @def ELM_RADIO_SMART_CLASS_VERSION
- *
- * Current version for Elementary radio @b base smart class, a value
- * which goes to _Elm_Radio_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_RADIO_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Radio_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_RADIO_SMART_CLASS_INIT_NULL
- * @see ELM_RADIO_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_RADIO_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_RADIO_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Radio_Smart_Class structure.
- *
- * @see ELM_RADIO_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_RADIO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_SMART_CLASS_INIT_NULL \
- ELM_RADIO_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_RADIO_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Radio_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_RADIO_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Radio_Smart_Class (base field)
- * to the latest #ELM_RADIO_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_RADIO_SMART_CLASS_INIT_NULL
- * @see ELM_RADIO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_RADIO_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_RADIO_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary radio base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a radio.
- *
- * All of the functions listed on @ref Radio namespace will work for
- * objects deriving from #Elm_Radio_Smart_Class.
- */
-typedef struct _Elm_Radio_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Radio_Smart_Class;
-
-/**
* Base layout smart data extended with radio instance data.
*/
typedef struct _Elm_Radio_Smart_Data Elm_Radio_Smart_Data;
@@ -130,8 +29,6 @@ struct _Group
struct _Elm_Radio_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
int value;
Eina_Bool state;
@@ -142,11 +39,8 @@ struct _Elm_Radio_Smart_Data
* @}
*/
-EAPI extern const char ELM_RADIO_SMART_NAME[];
-EAPI const Elm_Radio_Smart_Class *elm_radio_smart_class_get(void);
-
#define ELM_RADIO_DATA_GET(o, sd) \
- Elm_Radio_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Radio_Smart_Data * sd = eo_data_get(o, ELM_OBJ_RADIO_CLASS)
#define ELM_RADIO_DATA_GET_OR_RETURN(o, ptr) \
ELM_RADIO_DATA_GET(o, ptr); \
@@ -167,8 +61,7 @@ EAPI const Elm_Radio_Smart_Class *elm_radio_smart_class_get(void);
}
#define ELM_RADIO_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_RADIO_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_RADIO_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_route.h b/src/lib/elm_widget_route.h
index 6c920e1ab..96b0eebe4 100644
--- a/src/lib/elm_widget_route.h
+++ b/src/lib/elm_widget_route.h
@@ -13,106 +13,6 @@
*/
/**
- * @def ELM_ROUTE_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Route_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_CLASS(x) ((Elm_Route_Smart_Class *)x)
-
-/**
- * @def ELM_ROUTE_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Route_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_DATA(x) ((Elm_Route_Smart_Data *)x)
-
-/**
- * @def ELM_ROUTE_SMART_CLASS_VERSION
- *
- * Current version for Elementary route @b base smart class, a value
- * which goes to _Elm_Route_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_ROUTE_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Route_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ROUTE_SMART_CLASS_INIT_NULL
- * @see ELM_ROUTE_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_ROUTE_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_ROUTE_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Route_Smart_Class structure.
- *
- * @see ELM_ROUTE_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_ROUTE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_SMART_CLASS_INIT_NULL \
- ELM_ROUTE_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_ROUTE_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Route_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_ROUTE_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Route_Smart_Class (base field)
- * to the latest #ELM_ROUTE_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_ROUTE_SMART_CLASS_INIT_NULL
- * @see ELM_ROUTE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_ROUTE_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_ROUTE_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary route base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a route.
- *
- * All of the functions listed on @ref Route namespace will work for
- * objects deriving from #Elm_Route_Smart_Class.
- */
-typedef struct _Elm_Route_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Route_Smart_Class;
-
-/**
* Base widget smart data extended with route instance data.
*/
typedef struct _Elm_Route_Smart_Data Elm_Route_Smart_Data;
@@ -120,8 +20,6 @@ typedef struct Segment Segment;
struct _Elm_Route_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
#ifdef ELM_EMAP
EMap_Route *emap;
#endif
@@ -152,11 +50,8 @@ struct Segment
* @}
*/
-EAPI extern const char ELM_ROUTE_SMART_NAME[];
-EAPI const Elm_Route_Smart_Class *elm_route_smart_class_get(void);
-
#define ELM_ROUTE_DATA_GET(o, sd) \
- Elm_Route_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Route_Smart_Data * sd = eo_data_get(o, ELM_OBJ_ROUTE_CLASS)
#define ELM_ROUTE_DATA_GET_OR_RETURN(o, ptr) \
ELM_ROUTE_DATA_GET(o, ptr); \
@@ -176,8 +71,8 @@ EAPI const Elm_Route_Smart_Class *elm_route_smart_class_get(void);
return val; \
}
-#define ELM_ROUTE_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_ROUTE_SMART_NAME, __func__)) \
+#define ELM_ROUTE_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_ROUTE_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_scroller.h b/src/lib/elm_widget_scroller.h
index 7b2241cbe..5bc931fe3 100644
--- a/src/lib/elm_widget_scroller.h
+++ b/src/lib/elm_widget_scroller.h
@@ -1,8 +1,7 @@
#ifndef ELM_WIDGET_SCROLLER_H
#define ELM_WIDGET_SCROLLER_H
-#include "elm_interface_scrollable.h"
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -16,118 +15,11 @@
*/
/**
- * @def ELM_SCROLLER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Scroller_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_CLASS(x) ((Elm_Scroller_Smart_Class *)x)
-
-/**
- * @def ELM_SCROLLER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Scroller_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_DATA(x) ((Elm_Scroller_Smart_Data *)x)
-
-/**
- * @def ELM_SCROLLER_SMART_CLASS_VERSION
- *
- * Current version for Elementary scroller @b base smart class, a value
- * which goes to _Elm_Scroller_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SCROLLER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Scroller_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SCROLLER_SMART_CLASS_INIT_NULL
- * @see ELM_SCROLLER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SCROLLER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SCROLLER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Scroller_Smart_Class structure.
- *
- * @see ELM_SCROLLER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SCROLLER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_SMART_CLASS_INIT_NULL \
- ELM_SCROLLER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SCROLLER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Scroller_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_SCROLLER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Scroller_Smart_Class (base field)
- * to the latest #ELM_SCROLLER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SCROLLER_SMART_CLASS_INIT_NULL
- * @see ELM_SCROLLER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SCROLLER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SCROLLER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary scroller base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a scroller.
- *
- * All of the functions listed on @ref Scroller namespace will work for
- * objects deriving from #Elm_Scroller_Smart_Class.
- */
-typedef struct _Elm_Scroller_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Scroller_Smart_Class;
-
-/**
* Base widget smart data extended with scroller instance data.
*/
typedef struct _Elm_Scroller_Smart_Data Elm_Scroller_Smart_Data;
struct _Elm_Scroller_Smart_Data
{
- Elm_Layout_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
- const Elm_Scrollable_Smart_Interface *s_iface;
-
Evas_Object *hit_rect;
Evas_Object *g_layer;
@@ -141,11 +33,8 @@ struct _Elm_Scroller_Smart_Data
* @}
*/
-EAPI extern const char ELM_SCROLLER_SMART_NAME[];
-EAPI const Elm_Scroller_Smart_Class *elm_scroller_smart_class_get(void);
-
#define ELM_SCROLLER_DATA_GET(o, sd) \
- Elm_Scroller_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Scroller_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SCROLLER_CLASS)
#define ELM_SCROLLER_DATA_GET_OR_RETURN(o, ptr) \
ELM_SCROLLER_DATA_GET(o, ptr); \
@@ -166,8 +55,7 @@ EAPI const Elm_Scroller_Smart_Class *elm_scroller_smart_class_get(void);
}
#define ELM_SCROLLER_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_SCROLLER_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SCROLLER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_segment_control.h b/src/lib/elm_widget_segment_control.h
index 4c3fe506c..f4ae299dc 100644
--- a/src/lib/elm_widget_segment_control.h
+++ b/src/lib/elm_widget_segment_control.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_SEGMENT_CONTROL_H
#define ELM_WIDGET_SEGMENT_CONTROL_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -14,109 +14,6 @@
* to create other widgets which are a segment control with some more
* logic on top.
*/
-
-/**
- * @def ELM_SEGMENT_CONTROL_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Segment_Control_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_CLASS(x) ((Elm_Segment_Control_Smart_Class *)x)
-
-/**
- * @def ELM_SEGMENT_CONTROL_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Segment_Control_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_DATA(x) ((Elm_Segment_Control_Smart_Data *)x)
-
-/**
- * @def ELM_SEGMENT_CONTROL_SMART_CLASS_VERSION
- *
- * Current version for Elementary segment control @b base smart class, a value
- * which goes to _Elm_Segment_Control_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SEGMENT_CONTROL_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Segment_Control_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NULL
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SEGMENT_CONTROL_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Segment_Control_Smart_Class structure.
- *
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NULL \
- ELM_SEGMENT_CONTROL_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Segment_Control_Smart_Class
- * structure and set its name and version.
- *
- * This is similar to #ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NULL, but
- * it will also set the version field of
- * #Elm_Segment_Control_Smart_Class (base field) to the latest
- * #ELM_SEGMENT_CONTROL_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NULL
- * @see ELM_SEGMENT_CONTROL_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SEGMENT_CONTROL_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SEGMENT_CONTROL_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary segment control base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a segment control.
- *
- * All of the functions listed on @ref SegmentControl namespace will work for
- * objects deriving from #Elm_Segment_Control_Smart_Class.
- */
-typedef struct _Elm_Segment_Control_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Segment_Control_Smart_Class;
-
/**
* Base layout smart data extended with segment control instance data.
*/
@@ -125,8 +22,7 @@ typedef struct _Elm_Segment_Item Elm_Segment_Item;
struct _Elm_Segment_Control_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
+ Evas_Object *obj;
Eina_List *items;
Elm_Segment_Item *selected_item;
@@ -146,13 +42,8 @@ struct _Elm_Segment_Item
* @}
*/
-EAPI extern const char ELM_SEGMENT_CONTROL_SMART_NAME[];
-EAPI const Elm_Segment_Control_Smart_Class
-*elm_segment_control_smart_class_get(void);
-
-
#define ELM_SEGMENT_CONTROL_DATA_GET(o, sd) \
- Elm_Segment_Control_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Segment_Control_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SEGMENT_CONTROL_CLASS)
#define ELM_SEGMENT_CONTROL_DATA_GET_OR_RETURN(o, ptr) \
ELM_SEGMENT_CONTROL_DATA_GET(o, ptr); \
@@ -173,8 +64,7 @@ EAPI const Elm_Segment_Control_Smart_Class
}
#define ELM_SEGMENT_CONTROL_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_SEGMENT_CONTROL_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SEGMENT_CONTROL_CLASS)) \
return
#define ELM_SEGMENT_CONTROL_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_separator.h b/src/lib/elm_widget_separator.h
index 182159cf7..8aae6df6a 100644
--- a/src/lib/elm_widget_separator.h
+++ b/src/lib/elm_widget_separator.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_SEPARATOR_H
#define ELM_WIDGET_SEPARATOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_SEPARATOR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Separator_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_CLASS(x) ((Elm_Separator_Smart_Class *)x)
-
-/**
- * @def ELM_SEPARATOR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Separator_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_DATA(x) ((Elm_Separator_Smart_Data *)x)
-
-/**
- * @def ELM_SEPARATOR_SMART_CLASS_VERSION
- *
- * Current version for Elementary separator @b base smart class, a value
- * which goes to _Elm_Separator_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SEPARATOR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Separator_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SEPARATOR_SMART_CLASS_INIT_NULL
- * @see ELM_SEPARATOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SEPARATOR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SEPARATOR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Separator_Smart_Class structure.
- *
- * @see ELM_SEPARATOR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SEPARATOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_SMART_CLASS_INIT_NULL \
- ELM_SEPARATOR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SEPARATOR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Separator_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_SEPARATOR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Separator_Smart_Class (base field)
- * to the latest #ELM_SEPARATOR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SEPARATOR_SMART_CLASS_INIT_NULL
- * @see ELM_SEPARATOR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SEPARATOR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SEPARATOR_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary separator base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a separator.
- *
- * All of the functions listed on @ref Separator namespace will work for
- * objects deriving from #Elm_Separator_Smart_Class.
- */
-typedef struct _Elm_Separator_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Separator_Smart_Class;
-
-/**
* Base layout smart data extended with separator instance data.
*/
typedef struct _Elm_Separator_Smart_Data Elm_Separator_Smart_Data;
struct _Elm_Separator_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Eina_Bool horizontal : 1;
};
@@ -130,11 +27,8 @@ struct _Elm_Separator_Smart_Data
* @}
*/
-EAPI extern const char ELM_SEPARATOR_SMART_NAME[];
-EAPI const Elm_Separator_Smart_Class *elm_separator_smart_class_get(void);
-
#define ELM_SEPARATOR_DATA_GET(o, sd) \
- Elm_Separator_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Separator_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SEPARATOR_CLASS)
#define ELM_SEPARATOR_DATA_GET_OR_RETURN(o, ptr) \
ELM_SEPARATOR_DATA_GET(o, ptr); \
@@ -155,8 +49,7 @@ EAPI const Elm_Separator_Smart_Class *elm_separator_smart_class_get(void);
}
#define ELM_SEPARATOR_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_SEPARATOR_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SEPARATOR_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_slider.h b/src/lib/elm_widget_slider.h
index 48c61e029..342f84ab5 100644
--- a/src/lib/elm_widget_slider.h
+++ b/src/lib/elm_widget_slider.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_SLIDER_H
#define ELM_WIDGET_SLIDER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_SLIDER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Slider_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_CLASS(x) ((Elm_Slider_Smart_Class *)x)
-
-/**
- * @def ELM_SLIDER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Slider_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_DATA(x) ((Elm_Slider_Smart_Data *)x)
-
-/**
- * @def ELM_SLIDER_SMART_CLASS_VERSION
- *
- * Current version for Elementary slider @b base smart class, a value
- * which goes to _Elm_Slider_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SLIDER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Slider_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SLIDER_SMART_CLASS_INIT_NULL
- * @see ELM_SLIDER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SLIDER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SLIDER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Slider_Smart_Class structure.
- *
- * @see ELM_SLIDER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SLIDER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_SMART_CLASS_INIT_NULL \
- ELM_SLIDER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SLIDER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Slider_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_SLIDER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Slider_Smart_Class (base field)
- * to the latest #ELM_SLIDER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SLIDER_SMART_CLASS_INIT_NULL
- * @see ELM_SLIDER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SLIDER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SLIDER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary slider base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a slider.
- *
- * All of the functions listed on @ref Slider namespace will work for
- * objects deriving from #Elm_Slider_Smart_Class.
- */
-typedef struct _Elm_Slider_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Slider_Smart_Class;
-
-/**
* Base layout smart data extended with slider instance data.
*/
typedef struct _Elm_Slider_Smart_Data Elm_Slider_Smart_Data;
struct _Elm_Slider_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *spacer, *popup, *track;
Ecore_Timer *delay;
@@ -151,11 +48,8 @@ struct _Elm_Slider_Smart_Data
* @}
*/
-EAPI extern const char ELM_SLIDER_SMART_NAME[];
-EAPI const Elm_Slider_Smart_Class *elm_slider_smart_class_get(void);
-
#define ELM_SLIDER_DATA_GET(o, sd) \
- Elm_Slider_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Slider_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SLIDER_CLASS)
#define ELM_SLIDER_DATA_GET_OR_RETURN(o, ptr) \
ELM_SLIDER_DATA_GET(o, ptr); \
@@ -176,8 +70,7 @@ EAPI const Elm_Slider_Smart_Class *elm_slider_smart_class_get(void);
}
#define ELM_SLIDER_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_SLIDER_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SLIDER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_slideshow.h b/src/lib/elm_widget_slideshow.h
index 6f96372f5..0a89dbb45 100644
--- a/src/lib/elm_widget_slideshow.h
+++ b/src/lib/elm_widget_slideshow.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_SLIDESHOW_H
#define ELM_WIDGET_SLIDESHOW_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,107 +15,6 @@
*/
/**
- * @def ELM_SLIDESHOW_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Slideshow_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_CLASS(x) ((Elm_Slideshow_Smart_Class *)x)
-
-/**
- * @def ELM_SLIDESHOW_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Slideshow_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_DATA(x) ((Elm_Slideshow_Smart_Data *)x)
-
-/**
- * @def ELM_SLIDESHOW_SMART_CLASS_VERSION
- *
- * Current version for Elementary slideshow @b base smart class, a value
- * which goes to _Elm_Slideshow_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SLIDESHOW_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Slideshow_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT_NULL
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SLIDESHOW_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SLIDESHOW_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Slideshow_Smart_Class structure.
- *
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_SMART_CLASS_INIT_NULL \
- ELM_SLIDESHOW_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SLIDESHOW_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Slideshow_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_SLIDESHOW_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Slideshow_Smart_Class (base field)
- * to the latest #ELM_SLIDESHOW_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT_NULL
- * @see ELM_SLIDESHOW_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SLIDESHOW_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SLIDESHOW_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary slideshow base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a slideshow.
- *
- * All of the functions listed on @ref Slideshow namespace will work for
- * objects deriving from #Elm_Slideshow_Smart_Class.
- */
-typedef struct _Elm_Slideshow_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Slideshow_Smart_Class;
-
-/**
* Base layout smart data extended with slideshow instance data.
*/
typedef struct _Elm_Slideshow_Smart_Data Elm_Slideshow_Smart_Data;
@@ -132,8 +31,6 @@ struct _Elm_Slideshow_Item
struct _Elm_Slideshow_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
// list of Elm_Slideshow_Item*
Eina_List *items;
Eina_List *items_built;
@@ -161,11 +58,8 @@ struct _Elm_Slideshow_Smart_Data
* @}
*/
-EAPI extern const char ELM_SLIDESHOW_SMART_NAME[];
-EAPI const Elm_Slideshow_Smart_Class *elm_slideshow_smart_class_get(void);
-
#define ELM_SLIDESHOW_DATA_GET(o, sd) \
- Elm_Slideshow_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Slideshow_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SLIDESHOW_CLASS)
#define ELM_SLIDESHOW_DATA_GET_OR_RETURN(o, ptr) \
ELM_SLIDESHOW_DATA_GET(o, ptr); \
@@ -186,8 +80,7 @@ EAPI const Elm_Slideshow_Smart_Class *elm_slideshow_smart_class_get(void);
}
#define ELM_SLIDESHOW_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_SLIDESHOW_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SLIDESHOW_CLASS)) \
return
#define ELM_SLIDESHOW_ITEM_CHECK(it) \
diff --git a/src/lib/elm_widget_spinner.h b/src/lib/elm_widget_spinner.h
index 55028c8b3..f610e9f10 100644
--- a/src/lib/elm_widget_spinner.h
+++ b/src/lib/elm_widget_spinner.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_SPINNER_H
#define ELM_WIDGET_SPINNER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
@@ -19,114 +19,11 @@
*/
/**
- * @def ELM_SPINNER_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Spinner_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_CLASS(x) ((Elm_Spinner_Smart_Class *)x)
-
-/**
- * @def ELM_SPINNER_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Spinner_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_DATA(x) ((Elm_Spinner_Smart_Data *)x)
-
-/**
- * @def ELM_SPINNER_SMART_CLASS_VERSION
- *
- * Current version for Elementary spinner @b base smart class, a value
- * which goes to _Elm_Spinner_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_SPINNER_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Spinner_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SPINNER_SMART_CLASS_INIT_NULL
- * @see ELM_SPINNER_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_SPINNER_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_SPINNER_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Spinner_Smart_Class structure.
- *
- * @see ELM_SPINNER_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_SPINNER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_SMART_CLASS_INIT_NULL \
- ELM_SPINNER_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_SPINNER_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Spinner_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_SPINNER_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Spinner_Smart_Class (base field)
- * to the latest #ELM_SPINNER_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_SPINNER_SMART_CLASS_INIT_NULL
- * @see ELM_SPINNER_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_SPINNER_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_SPINNER_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary spinner base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a spinner.
- *
- * All of the functions listed on @ref Spinner namespace will work for
- * objects deriving from #Elm_Spinner_Smart_Class.
- */
-typedef struct _Elm_Spinner_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Spinner_Smart_Class;
-
-/**
* Base layout smart data extended with spinner instance data.
*/
typedef struct _Elm_Spinner_Smart_Data Elm_Spinner_Smart_Data;
struct _Elm_Spinner_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *ent;
const char *label;
double val, val_min, val_max, orig_val, step, val_base;
@@ -155,11 +52,8 @@ struct _Elm_Spinner_Special_Value
* @}
*/
-EAPI extern const char ELM_SPINNER_SMART_NAME[];
-EAPI const Elm_Spinner_Smart_Class *elm_spinner_smart_class_get(void);
-
#define ELM_SPINNER_DATA_GET(o, sd) \
- Elm_Spinner_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Spinner_Smart_Data * sd = eo_data_get(o, ELM_OBJ_SPINNER_CLASS)
#define ELM_SPINNER_DATA_GET_OR_RETURN(o, ptr) \
ELM_SPINNER_DATA_GET(o, ptr); \
@@ -180,8 +74,7 @@ EAPI const Elm_Spinner_Smart_Class *elm_spinner_smart_class_get(void);
}
#define ELM_SPINNER_CHECK(obj) \
- if (!obj || !elm_widget_type_check \
- ((obj), ELM_SPINNER_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_SPINNER_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_table.h b/src/lib/elm_widget_table.h
index 867788a25..29b313970 100644
--- a/src/lib/elm_widget_table.h
+++ b/src/lib/elm_widget_table.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_TABLE_H
#define ELM_WIDGET_TABLE_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,146 +15,11 @@
*/
/**
- * @def ELM_TABLE_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Table_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_CLASS(x) ((Elm_Table_Smart_Class *) x)
-
-/**
- * @def ELM_TABLE_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Table_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_DATA(x) ((Elm_Table_Smart_Data *) x)
-
-/**
- * @def ELM_TABLE_SMART_CLASS_VERSION
- *
- * Current version for Elementary table @b base smart class, a value
- * which goes to _Elm_Table_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_TABLE_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Table_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_TABLE_SMART_CLASS_INIT_NULL
- * @see ELM_TABLE_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_TABLE_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_TABLE_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Table_Smart_Class structure.
- *
- * @see ELM_TABLE_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_TABLE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_SMART_CLASS_INIT_NULL \
- ELM_TABLE_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_TABLE_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Table_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_TABLE_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Table_Smart_Class (base field)
- * to the latest #ELM_TABLE_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_TABLE_SMART_CLASS_INIT_NULL
- * @see ELM_TABLE_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_TABLE_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_TABLE_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary table base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a table.
- *
- * All of the functions listed on @ref Table namespace will work for
- * objects deriving from #Elm_Table_Smart_Class.
- */
-typedef struct _Elm_Table_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Table_Smart_Class;
-
-/**
- * Base widget smart data extended with table instance data.
- */
-typedef struct _Elm_Table_Smart_Data Elm_Table_Smart_Data;
-struct _Elm_Table_Smart_Data
-{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-};
-
-/**
* @}
*/
-EAPI extern const char ELM_TABLE_SMART_NAME[];
-EAPI const Elm_Table_Smart_Class *elm_table_smart_class_get(void);
-
-#define ELM_TABLE_DATA_GET(o, sd) \
- Elm_Table_Smart_Data * sd = evas_object_smart_data_get(o)
-
-#define ELM_TABLE_DATA_GET_OR_RETURN(o, ptr) \
- ELM_TABLE_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return; \
- }
-
-#define ELM_TABLE_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
- ELM_TABLE_DATA_GET(o, ptr); \
- if (!ptr) \
- { \
- CRITICAL("No widget data for object %p (%s)", \
- o, evas_object_type_get(o)); \
- return val; \
- }
-
-#define ELM_TABLE_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_TABLE_SMART_NAME, __func__)) \
+#define ELM_TABLE_CHECK(obj) \
+ if (!eo_isa((obj), ELM_OBJ_TABLE_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_thumb.h b/src/lib/elm_widget_thumb.h
index ce92a79bc..0b4be8e1f 100644
--- a/src/lib/elm_widget_thumb.h
+++ b/src/lib/elm_widget_thumb.h
@@ -1,6 +1,8 @@
#ifndef ELM_WIDGET_THUMB_H
#define ELM_WIDGET_THUMB_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
@@ -13,113 +15,12 @@
*/
/**
- * @def ELM_THUMB_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Thumb_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_CLASS(x) ((Elm_Thumb_Smart_Class *) x)
-
-/**
- * @def ELM_THUMB_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Thumb_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_DATA(x) ((Elm_Thumb_Smart_Data *) x)
-
-/**
- * @def ELM_THUMB_SMART_CLASS_VERSION
- *
- * Current version for Elementary thumb @b base smart class, a value
- * which goes to _Elm_Thumb_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_THUMB_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Thumb_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_THUMB_SMART_CLASS_INIT_NULL
- * @see ELM_THUMB_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_THUMB_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_THUMB_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Thumb_Smart_Class structure.
- *
- * @see ELM_THUMB_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_THUMB_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_SMART_CLASS_INIT_NULL \
- ELM_THUMB_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_THUMB_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Thumb_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_THUMB_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Thumb_Smart_Class (base field)
- * to the latest #ELM_THUMB_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_THUMB_SMART_CLASS_INIT_NULL
- * @see ELM_THUMB_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_THUMB_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_THUMB_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary thumb base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a thumb.
- *
- * All of the functions listed on @ref Thumb namespace will work for
- * objects deriving from #Elm_Thumb_Smart_Class.
- */
-typedef struct _Elm_Thumb_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Thumb_Smart_Class;
-
-/**
* Base widget smart data extended with thumb instance data.
*/
typedef struct _Elm_Thumb_Smart_Data Elm_Thumb_Smart_Data;
struct _Elm_Thumb_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
+ Evas_Object *obj; // the object itself
Evas_Object *view; /* actual thumbnail, to be swallowed
* at the thumb frame */
@@ -156,11 +57,8 @@ struct _Elm_Thumb_Smart_Data
* @}
*/
-EAPI extern const char ELM_THUMB_SMART_NAME[];
-EAPI const Elm_Thumb_Smart_Class *elm_thumb_smart_class_get(void);
-
#define ELM_THUMB_DATA_GET(o, sd) \
- Elm_Thumb_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Thumb_Smart_Data * sd = eo_data_get(o, ELM_OBJ_THUMB_CLASS)
#define ELM_THUMB_DATA_GET_OR_RETURN(o, ptr) \
ELM_THUMB_DATA_GET(o, ptr); \
@@ -181,7 +79,7 @@ EAPI const Elm_Thumb_Smart_Class *elm_thumb_smart_class_get(void);
}
#define ELM_THUMB_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_THUMB_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_THUMB_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_toolbar.h b/src/lib/elm_widget_toolbar.h
index 893719b0c..d453fa2b7 100644
--- a/src/lib/elm_widget_toolbar.h
+++ b/src/lib/elm_widget_toolbar.h
@@ -15,106 +15,6 @@
* widgets which are a toolbar with some more logic on top.
*/
-/**
- * @def ELM_TOOLBAR_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Toolbar_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_CLASS(x) ((Elm_Toolbar_Smart_Class *)x)
-
-/**
- * @def ELM_TOOLBAR_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Toolbar_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_DATA(x) ((Elm_Toolbar_Smart_Data *)x)
-
-/**
- * @def ELM_TOOLBAR_SMART_CLASS_VERSION
- *
- * Current version for Elementary toolbar @b base smart class, a value
- * which goes to _Elm_Toolbar_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_TOOLBAR_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Toolbar_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_TOOLBAR_SMART_CLASS_INIT_NULL
- * @see ELM_TOOLBAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_TOOLBAR_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_TOOLBAR_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Toolbar_Smart_Class structure.
- *
- * @see ELM_TOOLBAR_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_TOOLBAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_SMART_CLASS_INIT_NULL \
- ELM_TOOLBAR_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_TOOLBAR_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Toolbar_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_TOOLBAR_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Toolbar_Smart_Class (base field)
- * to the latest #ELM_TOOLBAR_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_TOOLBAR_SMART_CLASS_INIT_NULL
- * @see ELM_TOOLBAR_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_TOOLBAR_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_TOOLBAR_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary toolbar base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a toolbar.
- *
- * All of the functions listed on @ref Toolbar namespace will work for
- * objects deriving from #Elm_Toolbar_Smart_Class.
- */
-typedef struct _Elm_Toolbar_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Toolbar_Smart_Class;
-
typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item;
/**
@@ -123,12 +23,7 @@ typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item;
typedef struct _Elm_Toolbar_Smart_Data Elm_Toolbar_Smart_Data;
struct _Elm_Toolbar_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Evas_Object *hit_rect;
- const Elm_Scrollable_Smart_Interface *s_iface;
Evas_Object *bx, *more, *bx_more, *bx_more2;
Evas_Object *menu_parent;
@@ -194,12 +89,8 @@ struct _Elm_Toolbar_Item_State
* @}
*/
-EAPI extern const char ELM_TOOLBAR_SMART_NAME[];
-EAPI const Elm_Toolbar_Smart_Class
-*elm_toolbar_smart_class_get(void);
-
#define ELM_TOOLBAR_DATA_GET(o, sd) \
- Elm_Toolbar_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Toolbar_Smart_Data * sd = eo_data_get(o, ELM_OBJ_TOOLBAR_CLASS)
#define ELM_TOOLBAR_DATA_GET_OR_RETURN(o, ptr) \
ELM_TOOLBAR_DATA_GET(o, ptr); \
@@ -220,8 +111,7 @@ EAPI const Elm_Toolbar_Smart_Class
}
#define ELM_TOOLBAR_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), \
- ELM_TOOLBAR_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_TOOLBAR_CLASS)) \
return
#define ELM_TOOLBAR_ITEM_CHECK(it) \
@@ -234,7 +124,6 @@ EAPI const Elm_Toolbar_Smart_Class
#define ELM_TOOLBAR_ITEM_CHECK_OR_GOTO(it, label) \
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item *)it, label); \
- if (!it->base.widget || !elm_widget_type_check \
- ((it->base.widget), ELM_TOOLBAR_SMART_NAME, __func__)) goto label;
+ if (!it->base.widget || !eo_isa ((it->base.widget), ELM_OBJ_TOOLBAR_CLASS)) goto label;
#endif
diff --git a/src/lib/elm_widget_video.h b/src/lib/elm_widget_video.h
index 272e61258..8307b63eb 100644
--- a/src/lib/elm_widget_video.h
+++ b/src/lib/elm_widget_video.h
@@ -1,7 +1,7 @@
#ifndef ELM_WIDGET_VIDEO_H
#define ELM_WIDGET_VIDEO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
@@ -15,114 +15,11 @@
*/
/**
- * @def ELM_VIDEO_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Video_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_CLASS(x) ((Elm_Video_Smart_Class *)x)
-
-/**
- * @def ELM_VIDEO_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Video_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_DATA(x) ((Elm_Video_Smart_Data *)x)
-
-/**
- * @def ELM_VIDEO_SMART_CLASS_VERSION
- *
- * Current version for Elementary video @b base smart class, a value
- * which goes to _Elm_Video_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_VIDEO_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Video_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_VIDEO_SMART_CLASS_INIT_NULL
- * @see ELM_VIDEO_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_VIDEO_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_VIDEO_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Video_Smart_Class structure.
- *
- * @see ELM_VIDEO_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_VIDEO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_SMART_CLASS_INIT_NULL \
- ELM_VIDEO_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_VIDEO_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Video_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_VIDEO_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Video_Smart_Class (base field)
- * to the latest #ELM_VIDEO_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_VIDEO_SMART_CLASS_INIT_NULL
- * @see ELM_VIDEO_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_VIDEO_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_VIDEO_SMART_CLASS_INIT \
- (ELM_LAYOUT_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary video base smart class. This inherits directly from
- * #Elm_Layout_Smart_Class and is meant to build widgets extending the
- * behavior of a video.
- *
- * All of the functions listed on @ref Video namespace will work for
- * objects deriving from #Elm_Video_Smart_Class.
- */
-typedef struct _Elm_Video_Smart_Class
-{
- Elm_Layout_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Video_Smart_Class;
-
-/**
* Base layout smart data extended with video instance data.
*/
typedef struct _Elm_Video_Smart_Data Elm_Video_Smart_Data;
struct _Elm_Video_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *emotion;
Ecore_Timer *timer;
@@ -134,11 +31,8 @@ struct _Elm_Video_Smart_Data
* @}
*/
-EAPI extern const char ELM_VIDEO_SMART_NAME[];
-EAPI const Elm_Video_Smart_Class *elm_video_smart_class_get(void);
-
#define ELM_VIDEO_DATA_GET(o, sd) \
- Elm_Video_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Video_Smart_Data * sd = eo_data_get(o, ELM_OBJ_VIDEO_CLASS)
#define ELM_VIDEO_DATA_GET_OR_RETURN(o, ptr) \
ELM_VIDEO_DATA_GET(o, ptr); \
@@ -159,8 +53,7 @@ EAPI const Elm_Video_Smart_Class *elm_video_smart_class_get(void);
}
#define ELM_VIDEO_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_VIDEO_SMART_NAME, \
- __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_VIDEO_CLASS)) \
return
#endif
diff --git a/src/lib/elm_widget_web.h b/src/lib/elm_widget_web.h
index 3fa3e1038..ede3bd98a 100644
--- a/src/lib/elm_widget_web.h
+++ b/src/lib/elm_widget_web.h
@@ -21,115 +21,12 @@
*/
/**
- * @def ELM_WEB_CLASS
- *
- * Use this macro to cast whichever subclass of
- * #Elm_Web_Smart_Class into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_WEB_CLASS(x) ((Elm_Web_Smart_Class *) x)
-
-/**
- * @def ELM_WEB_DATA
- *
- * Use this macro to cast whichever subdata of
- * #Elm_Web_Smart_Data into it, so to access its fields.
- *
- * @ingroup Widget
- */
-#define ELM_WEB_DATA(x) ((Elm_Web_Smart_Data *) x)
-
-/**
- * @def ELM_WEB_SMART_CLASS_VERSION
- *
- * Current version for Elementary web @b base smart class, a value
- * which goes to _Elm_Web_Smart_Class::version.
- *
- * @ingroup Widget
- */
-#define ELM_WEB_SMART_CLASS_VERSION 1
-
-/**
- * @def ELM_WEB_SMART_CLASS_INIT
- *
- * Initializer for a whole #Elm_Web_Smart_Class structure, with
- * @c NULL values on its specific fields.
- *
- * @param smart_class_init initializer to use for the "base" field
- * (#Evas_Smart_Class).
- *
- * @see EVAS_SMART_CLASS_INIT_NULL
- * @see EVAS_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_WEB_SMART_CLASS_INIT_NULL
- * @see ELM_WEB_SMART_CLASS_INIT_NAME_VERSION
- *
- * @ingroup Widget
- */
-#define ELM_WEB_SMART_CLASS_INIT(smart_class_init) \
- {smart_class_init, ELM_WEB_SMART_CLASS_VERSION}
-
-/**
- * @def ELM_WEB_SMART_CLASS_INIT_NULL
- *
- * Initializer to zero out a whole #Elm_Web_Smart_Class structure.
- *
- * @see ELM_WEB_SMART_CLASS_INIT_NAME_VERSION
- * @see ELM_WEB_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_WEB_SMART_CLASS_INIT_NULL \
- ELM_WEB_SMART_CLASS_INIT(EVAS_SMART_CLASS_INIT_NULL)
-
-/**
- * @def ELM_WEB_SMART_CLASS_INIT_NAME_VERSION
- *
- * Initializer to zero out a whole #Elm_Web_Smart_Class structure and
- * set its name and version.
- *
- * This is similar to #ELM_WEB_SMART_CLASS_INIT_NULL, but it will
- * also set the version field of #Elm_Web_Smart_Class (base field)
- * to the latest #ELM_WEB_SMART_CLASS_VERSION and name it to the
- * specific value.
- *
- * It will keep a reference to the name field as a <c>"const char *"</c>,
- * i.e., the name must be available while the structure is
- * used (hint: static or global variable!) and must not be modified.
- *
- * @see ELM_WEB_SMART_CLASS_INIT_NULL
- * @see ELM_WEB_SMART_CLASS_INIT
- *
- * @ingroup Widget
- */
-#define ELM_WEB_SMART_CLASS_INIT_NAME_VERSION(name) \
- ELM_WEB_SMART_CLASS_INIT(ELM_WIDGET_SMART_CLASS_INIT_NAME_VERSION(name))
-
-/**
- * Elementary web base smart class. This inherits directly from
- * #Elm_Widget_Smart_Class and is meant to build widgets extending the
- * behavior of a web.
- *
- * All of the functions listed on @ref Web namespace will work for
- * objects deriving from #Elm_Web_Smart_Class.
- */
-typedef struct _Elm_Web_Smart_Class
-{
- Elm_Widget_Smart_Class base;
-
- int version; /**< Version of this smart class definition */
-} Elm_Web_Smart_Class;
-
-/**
* Base widget smart data extended with web instance data.
*/
typedef struct _Elm_Web_Smart_Data Elm_Web_Smart_Data;
struct _Elm_Web_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
+ Evas_Object *obj;
#ifdef HAVE_ELEMENTARY_WEB
struct
{
@@ -225,11 +122,8 @@ struct _View_Smart_Data
* @}
*/
-EAPI extern const char ELM_WEB_SMART_NAME[];
-EAPI const Elm_Web_Smart_Class *elm_web_smart_class_get(void);
-
#define ELM_WEB_DATA_GET(o, sd) \
- Elm_Web_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Web_Smart_Data * sd = eo_data_get(o, ELM_OBJ_WEB_CLASS)
#define ELM_WEB_DATA_GET_OR_RETURN(o, ptr) \
ELM_WEB_DATA_GET(o, ptr); \
@@ -250,7 +144,7 @@ EAPI const Elm_Web_Smart_Class *elm_web_smart_class_get(void);
}
#define ELM_WEB_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), ELM_WEB_SMART_NAME, __func__)) \
+ if (!eo_isa((obj), ELM_OBJ_WEB_CLASS)) \
return
#endif
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 2b4862a81..3481ef294 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -2,7 +2,13 @@
#include <Elementary_Cursor.h>
#include "elm_priv.h"
-static const char WIN_SMART_NAME[] = "elm_win";
+#include "Eo.h"
+
+EAPI Eo_Op ELM_OBJ_WIN_BASE_ID = EO_NOOP;
+
+#define MY_CLASS ELM_OBJ_WIN_CLASS
+
+#define MY_CLASS_NAME "elm_win"
static const Elm_Win_Trap *trap = NULL;
@@ -11,13 +17,13 @@ static const Elm_Win_Trap *trap = NULL;
{ \
if ((!trap) || (!trap->name) || \
((trap->name) && \
- (trap->name(sd->trap_data, sd->base.obj, ## __VA_ARGS__)))) \
+ (trap->name(sd->trap_data, sd->obj, ## __VA_ARGS__)))) \
ecore_evas_##name(sd->ee, ##__VA_ARGS__); \
} \
while (0)
#define ELM_WIN_DATA_GET(o, sd) \
- Elm_Win_Smart_Data * sd = evas_object_smart_data_get(o)
+ Elm_Win_Smart_Data * sd = eo_data_get(o, MY_CLASS)
#define ELM_WIN_DATA_GET_OR_RETURN(o, ptr) \
ELM_WIN_DATA_GET(o, ptr); \
@@ -38,7 +44,7 @@ static const Elm_Win_Trap *trap = NULL;
}
#define ELM_WIN_CHECK(obj) \
- if (!obj || !elm_widget_type_check((obj), WIN_SMART_NAME, __func__)) \
+ if (!obj || !eo_isa(obj, MY_CLASS)) \
return
#define ENGINE_GET() (_elm_preferred_engine ? _elm_preferred_engine : (_elm_config->engine ? _elm_config->engine : ""))
@@ -48,10 +54,6 @@ typedef struct _Elm_Win_Smart_Data Elm_Win_Smart_Data;
struct _Elm_Win_Smart_Data
{
- Elm_Widget_Smart_Data base; /* base widget smart data as
- * first member obligatory, as
- * we're inheriting from it */
-
Ecore_Evas *ee;
Evas *evas;
Evas_Object *parent; /* parent *window* object*/
@@ -60,6 +62,7 @@ struct _Elm_Win_Smart_Data
Eina_List *resize_objs; /* a window may have
* *multiple* resize
* objects */
+ Evas_Object *obj; /* The object itself */
#ifdef HAVE_ELEMENTARY_X
struct
{
@@ -186,10 +189,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{NULL, NULL}
};
-EVAS_SMART_SUBCLASS_NEW
- (WIN_SMART_NAME, _elm_win, Elm_Widget_Smart_Class,
- Elm_Widget_Smart_Class, elm_widget_smart_class_get, _smart_callbacks);
-
Eina_List *_elm_win_list = NULL;
int _elm_win_deferred_free = 0;
@@ -549,7 +548,7 @@ _elm_win_move(Ecore_Evas *ee)
ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
sd->screen.x = x;
sd->screen.y = y;
- evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_MOVED, NULL);
+ evas_object_smart_callback_call(sd->obj, SIG_MOVED, NULL);
}
static void
@@ -577,7 +576,7 @@ _elm_win_resize_job(void *data)
/* { */
/* } */
- evas_object_resize(ELM_WIDGET_DATA(sd)->obj, w, h);
+ evas_object_resize(sd->obj, w, h);
EINA_LIST_FOREACH(sd->resize_objs, l, obj)
{
evas_object_move(obj, sd->fx, sd->fy);
@@ -644,7 +643,7 @@ _elm_win_focus_highlight_anim_setup(Elm_Win_Smart_Data *sd,
Evas_Object *previous = sd->focus_highlight.prev.target;
Evas_Object *target = sd->focus_highlight.cur.target;
- evas_object_geometry_get(ELM_WIDGET_DATA(sd)->obj, NULL, NULL, &w, &h);
+ evas_object_geometry_get(sd->obj, NULL, NULL, &w, &h);
evas_object_geometry_get(target, &tx, &ty, &tw, &th);
evas_object_geometry_get(previous, &px, &py, &pw, &ph);
evas_object_move(obj, 0, 0);
@@ -730,7 +729,7 @@ _elm_win_focus_highlight_reconfigure(Elm_Win_Smart_Data *sd)
else
str = "default";
elm_widget_theme_object_set
- (ELM_WIDGET_DATA(sd)->obj, top, "focus_highlight", "top", str);
+ (sd->obj, top, "focus_highlight", "top", str);
sd->focus_highlight.changed_theme = EINA_FALSE;
if (_elm_config->focus_highlight_animate)
@@ -776,7 +775,7 @@ _elm_win_focus_in(Ecore_Evas *ee)
EINA_SAFETY_ON_NULL_RETURN(sd);
- obj = ELM_WIDGET_DATA(sd)->obj;
+ obj = sd->obj;
_elm_widget_top_win_focused_set(obj, EINA_TRUE);
if (!elm_widget_focus_order_get(obj))
@@ -808,7 +807,7 @@ _elm_win_focus_out(Ecore_Evas *ee)
EINA_SAFETY_ON_NULL_RETURN(sd);
- obj = ELM_WIDGET_DATA(sd)->obj;
+ obj = sd->obj;
elm_object_focus_set(obj, EINA_FALSE);
_elm_widget_top_win_focused_set(obj, EINA_FALSE);
@@ -839,7 +838,7 @@ _elm_win_state_change(Ecore_Evas *ee)
EINA_SAFETY_ON_NULL_RETURN(sd);
- obj = ELM_WIDGET_DATA(sd)->obj;
+ obj = sd->obj;
if (sd->withdrawn) _elm_win_count_withdrawn--;
if (sd->iconified) _elm_win_count_iconified--;
@@ -906,89 +905,117 @@ _elm_win_state_change(Ecore_Evas *ee)
}
}
-static Eina_Bool
-_elm_win_smart_focus_next(const Evas_Object *obj,
- Elm_Focus_Direction dir,
- Evas_Object **next)
+static void
+_elm_win_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_win_smart_focus_next(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
+ Evas_Object **next = va_arg(*list, Evas_Object **);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
/* Focus chain */
- if (ELM_WIDGET_DATA(sd)->subobjs)
+ if (wd->subobjs)
{
if (!(items = elm_widget_focus_custom_chain_get(obj)))
{
- items = ELM_WIDGET_DATA(sd)->subobjs;
+ items = wd->subobjs;
if (!items)
- return EINA_FALSE;
+ return;
}
list_data_get = eina_list_data_get;
elm_widget_focus_list_next_get(obj, items, list_data_get, dir, next);
if (*next)
- return EINA_TRUE;
+ {
+ if (ret) *ret = EINA_TRUE;
+ return;
+ }
}
*next = (Evas_Object *)obj;
- return EINA_FALSE;
+ return;
}
-static Eina_Bool
-_elm_win_smart_focus_direction(const Evas_Object *obj,
- const Evas_Object *base,
- double degree,
- Evas_Object **direction,
- double *weight)
+static void
+_elm_win_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ *ret = EINA_TRUE;
+}
+
+static void
+_elm_win_smart_focus_direction(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ const Evas_Object *base = va_arg(*list, Evas_Object *);
+ double degree = va_arg(*list, double);
+ Evas_Object **direction = va_arg(*list, Evas_Object **);
+ double *weight = va_arg(*list, double *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_FALSE;
+
const Eina_List *items;
void *(*list_data_get)(const Eina_List *list);
- ELM_WIN_DATA_GET(obj, sd);
+ Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
/* Focus chain */
- if (ELM_WIDGET_DATA(sd)->subobjs)
+ if (wd->subobjs)
{
if (!(items = elm_widget_focus_custom_chain_get(obj)))
- items = ELM_WIDGET_DATA(sd)->subobjs;
+ items = wd->subobjs;
list_data_get = eina_list_data_get;
- return elm_widget_focus_list_direction_get
+ int_ret = elm_widget_focus_list_direction_get
(obj, base, items, list_data_get, degree, direction, weight);
+ if (ret) *ret = int_ret;
}
-
- return EINA_FALSE;
}
-static Eina_Bool
-_elm_win_smart_on_focus(Evas_Object *obj)
+static void
+_elm_win_smart_on_focus(Eo *obj, void *_pd, va_list *list)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_TRUE;
+
+ Elm_Win_Smart_Data *sd = _pd;
if (sd->img_obj)
evas_object_focus_set(sd->img_obj, elm_widget_focus_get(obj));
else
evas_object_focus_set(obj, elm_widget_focus_get(obj));
-
- return EINA_TRUE;
}
-static Eina_Bool
-_elm_win_smart_event(Evas_Object *obj,
- Evas_Object *src __UNUSED__,
- Evas_Callback_Type type,
- void *event_info)
+static void
+_elm_win_smart_event(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
+ Evas_Object *source = va_arg(*list, Evas_Object *);
+ (void) source;
+ Evas_Callback_Type type = va_arg(*list, Evas_Callback_Type);
+ void *event_info = va_arg(*list, void *);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ if (ret) *ret = EINA_FALSE;
+
Evas_Event_Key_Down *ev = event_info;
Evas_Object *current_focused;
- if (elm_widget_disabled_get(obj)) return EINA_FALSE;
+ if (elm_widget_disabled_get(obj)) return;
if (type != EVAS_CALLBACK_KEY_DOWN)
- return EINA_FALSE;
+ return;
current_focused = elm_widget_focused_object_get(obj);
if ((!strcmp(ev->keyname, "Tab")) ||
@@ -1042,11 +1069,11 @@ _elm_win_smart_event(Evas_Object *obj,
goto success;
}
- return EINA_FALSE;
+ return;
success:
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
@@ -1057,16 +1084,16 @@ _deferred_ecore_evas_free(void *data)
}
static void
-_elm_win_smart_show(Evas_Object *obj)
+_elm_win_smart_show(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Elm_Win_Smart_Data *sd = _pd;
if (!evas_object_visible_get(obj))
{
_elm_win_count_shown++;
_elm_win_state_eval_queue();
}
- _elm_win_parent_sc->base.show(obj);
+ eo_do_super(obj, evas_obj_smart_show());
TRAP(sd, show);
@@ -1075,16 +1102,16 @@ _elm_win_smart_show(Evas_Object *obj)
}
static void
-_elm_win_smart_hide(Evas_Object *obj)
+_elm_win_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Elm_Win_Smart_Data *sd = _pd;
if (evas_object_visible_get(obj))
{
_elm_win_count_shown--;
_elm_win_state_eval_queue();
}
- _elm_win_parent_sc->base.hide(obj);
+ eo_do_super(obj, evas_obj_smart_hide());
TRAP(sd, hide);
@@ -1278,9 +1305,9 @@ _elm_win_on_img_obj_del(void *data,
}
static void
-_elm_win_smart_del(Evas_Object *obj)
+_elm_win_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Elm_Win_Smart_Data *sd = _pd;
/* NB: child deletion handled by parent's smart del */
@@ -1352,7 +1379,7 @@ _elm_win_smart_del(Evas_Object *obj)
ecore_evas_callback_move_set(sd->ee, NULL);
ecore_evas_callback_state_change_set(sd->ee, NULL);
- _elm_win_parent_sc->base.del(obj); /* handles freeing sd */
+ eo_do_super(obj, evas_obj_smart_del());
if ((!_elm_win_list) &&
(elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED))
@@ -1392,11 +1419,11 @@ _elm_win_obj_intercept_show(void *data,
}
static void
-_elm_win_smart_move(Evas_Object *obj,
- Evas_Coord x,
- Evas_Coord y)
+_elm_win_smart_move(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Evas_Coord x = va_arg(*list, Evas_Coord);
+ Evas_Coord y = va_arg(*list, Evas_Coord);
+ Elm_Win_Smart_Data *sd = _pd;
if (sd->img_obj)
{
@@ -1414,7 +1441,7 @@ _elm_win_smart_move(Evas_Object *obj,
if (!ecore_evas_override_get(sd->ee)) return;
}
- _elm_win_parent_sc->base.move(obj, x, y);
+ eo_do_super(obj, evas_obj_smart_move(x, y));
if (ecore_evas_override_get(sd->ee))
{
@@ -1436,13 +1463,14 @@ _elm_win_smart_move(Evas_Object *obj,
}
static void
-_elm_win_smart_resize(Evas_Object *obj,
- Evas_Coord w,
- Evas_Coord h)
+_elm_win_smart_resize(Eo *obj, void *_pd, va_list *list)
{
- ELM_WIN_DATA_GET(obj, sd);
+ Evas_Coord w = va_arg(*list, Evas_Coord);
+ Evas_Coord h = va_arg(*list, Evas_Coord);
- _elm_win_parent_sc->base.resize(obj, w, h);
+ Elm_Win_Smart_Data *sd = _pd;
+
+ eo_do_super(obj, evas_obj_smart_resize(w, h));
if (sd->img_obj)
{
@@ -1471,7 +1499,7 @@ _elm_win_delete_request(Ecore_Evas *ee)
EINA_SAFETY_ON_NULL_RETURN(sd);
- obj = ELM_WIDGET_DATA(sd)->obj;
+ obj = sd->obj;
int autodel = sd->autodel;
sd->autodel_clear = &autodel;
@@ -1816,7 +1844,7 @@ _elm_win_client_message(void *data,
{
if ((unsigned int)e->data.l[0] == sd->x.xwin)
{
- Evas *evas = evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj);
+ Evas *evas = evas_object_evas_get(sd->obj);
if (evas)
{
edje_file_cache_flush();
@@ -1830,7 +1858,7 @@ _elm_win_client_message(void *data,
{
if ((unsigned int)e->data.l[0] == sd->x.xwin)
{
- Evas *evas = evas_object_evas_get(ELM_WIDGET_DATA(sd)->obj);
+ Evas *evas = evas_object_evas_get(sd->obj);
if (evas)
{
edje_file_cache_flush();
@@ -1859,7 +1887,7 @@ _elm_win_client_message(void *data,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE)
{
_elm_access_highlight_object_activate
- (ELM_WIDGET_DATA(sd)->obj, ELM_ACTIVATE_DEFAULT);
+ (sd->obj, ELM_ACTIVATE_DEFAULT);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_READ)
@@ -1880,13 +1908,13 @@ _elm_win_client_message(void *data,
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
{
_elm_access_highlight_object_activate
- (ELM_WIDGET_DATA(sd)->obj, ELM_ACTIVATE_UP);
+ (sd->obj, ELM_ACTIVATE_UP);
}
else if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
{
_elm_access_highlight_object_activate
- (ELM_WIDGET_DATA(sd)->obj, ELM_ACTIVATE_DOWN);
+ (sd->obj, ELM_ACTIVATE_DOWN);
}
}
}
@@ -1906,7 +1934,7 @@ _elm_win_property_change(void *data,
if (e->win == sd->x.xwin)
{
sd->indmode = ecore_x_e_illume_indicator_state_get(e->win);
- evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
+ evas_object_smart_callback_call(sd->obj, SIG_INDICATOR_PROP_CHANGED, NULL);
}
}
return ECORE_CALLBACK_PASS_ON;
@@ -2117,7 +2145,7 @@ _elm_win_frame_cb_close(void *data,
if (!(sd = data)) return;
- win = ELM_WIDGET_DATA(sd)->obj;
+ win = sd->obj;
int autodel = sd->autodel;
sd->autodel_clear = &autodel;
@@ -2133,7 +2161,7 @@ static void
_elm_win_frame_add(Elm_Win_Smart_Data *sd,
const char *style)
{
- Evas_Object *obj = ELM_WIDGET_DATA(sd)->obj;
+ Evas_Object *obj = sd->obj;
short layer;
// FIXME: Don't use hardcoded framespace values, get it from theme
@@ -2146,7 +2174,7 @@ _elm_win_frame_add(Elm_Win_Smart_Data *sd,
layer = evas_object_layer_get(obj);
evas_object_layer_set(sd->frame_obj, layer + 1);
elm_widget_theme_object_set
- (ELM_WIDGET_DATA(sd)->obj, sd->frame_obj, "border", "base", style);
+ (sd->obj, sd->frame_obj, "border", "base", style);
evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
evas_object_move(sd->frame_obj, 0, 0);
@@ -2242,7 +2270,7 @@ _win_img_hide(void *data,
{
Elm_Win_Smart_Data *sd = data;
- elm_widget_focus_hide_handle(ELM_WIDGET_DATA(sd)->obj);
+ elm_widget_focus_hide_handle(sd->obj);
}
static void
@@ -2254,7 +2282,7 @@ _win_img_mouse_up(void *data,
Elm_Win_Smart_Data *sd = data;
Evas_Event_Mouse_Up *ev = event_info;
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
- elm_widget_focus_mouse_up_handle(ELM_WIDGET_DATA(sd)->obj);
+ elm_widget_focus_mouse_up_handle(sd->obj);
}
static void
@@ -2264,7 +2292,7 @@ _win_img_focus_in(void *data,
void *event_info __UNUSED__)
{
Elm_Win_Smart_Data *sd = data;
- elm_widget_focus_steal(ELM_WIDGET_DATA(sd)->obj);
+ elm_widget_focus_steal(sd->obj);
}
static void
@@ -2274,7 +2302,7 @@ _win_img_focus_out(void *data,
void *event_info __UNUSED__)
{
Elm_Win_Smart_Data *sd = data;
- elm_widget_focused_object_clear(ELM_WIDGET_DATA(sd)->obj);
+ elm_widget_focused_object_clear(sd->obj);
}
static void
@@ -2307,33 +2335,15 @@ _elm_win_on_icon_del(void *data,
}
static void
-_elm_win_smart_add(Evas_Object *obj)
+_elm_win_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- EVAS_SMART_DATA_ALLOC(obj, Elm_Win_Smart_Data);
-
- _elm_win_parent_sc->base.add(obj);
+ eo_do_super(obj, evas_obj_smart_add());
elm_widget_can_focus_set(obj, EINA_TRUE);
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
}
-static void
-_elm_win_smart_set_user(Elm_Widget_Smart_Class *sc)
-{
- sc->base.add = _elm_win_smart_add;
- sc->base.del = _elm_win_smart_del;
- sc->base.show = _elm_win_smart_show;
- sc->base.hide = _elm_win_smart_hide;
- sc->base.move = _elm_win_smart_move;
- sc->base.resize = _elm_win_smart_resize;
-
- sc->focus_next = _elm_win_smart_focus_next;
- sc->focus_direction = _elm_win_smart_focus_direction;
- sc->on_focus = _elm_win_smart_on_focus;
- sc->event = _elm_win_smart_event;
-}
-
#ifdef HAVE_ELEMENTARY_X
static void
_elm_x_io_err(void *data __UNUSED__)
@@ -2352,8 +2362,21 @@ elm_win_add(Evas_Object *parent,
const char *name,
Elm_Win_Type type)
{
+ Evas_Object *obj = eo_add_custom(MY_CLASS, parent, elm_obj_win_constructor(name, type));
+ eo_unref(obj);
+ return obj;
+}
+
+static void
+_win_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Elm_Win_Smart_Data *sd = _pd;
+ sd->obj = obj; // in ctor
+
+ const char *name = va_arg(*list, const char *);
+ Elm_Win_Type type = va_arg(*list, Elm_Win_Type);
+ Evas_Object *parent = eo_parent_get(obj);
Evas *e;
- Evas_Object *obj;
const Eina_List *l;
const char *fontpath, *fallback = NULL;
@@ -2592,13 +2615,15 @@ elm_win_add(Evas_Object *parent,
if (!tmp_sd.ee)
{
ERR("Cannot create window.");
- return NULL;
+ eo_error_set(obj);
+ return;
}
- obj = evas_object_smart_add
- (ecore_evas_get(tmp_sd.ee), _elm_win_smart_class_new());
-
- ELM_WIN_DATA_GET(obj, sd);
+ eo_parent_set(obj, ecore_evas_get(tmp_sd.ee));
+ eo_do_super(obj, eo_constructor());
+ eo_do(obj,
+ evas_obj_type_set(MY_CLASS_NAME),
+ evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
/* copying possibly altered fields back */
#define SD_CPY(_field) \
@@ -2771,8 +2796,13 @@ elm_win_add(Evas_Object *parent,
{
// do nothing
}
+}
- return obj;
+static void
+_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+{
+ eo_error_set(obj);
+ ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
}
EAPI Evas_Object *
@@ -2802,14 +2832,21 @@ EAPI void
elm_win_resize_object_add(Evas_Object *obj,
Evas_Object *subobj)
{
+ ELM_WIN_CHECK(obj);
+ eo_do(obj, elm_obj_win_resize_object_add(subobj));
+}
+
+static void
+_resize_object_add(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
Evas_Coord w, h;
- ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ Elm_Win_Smart_Data *sd = _pd;
if (eina_list_data_find(sd->resize_objs, subobj)) return;
- if (!ELM_WIDGET_DATA(sd)->api->sub_object_add(obj, subobj))
+ if (!elm_widget_sub_object_add(obj, subobj))
ERR("could not add %p as sub object of %p", subobj, obj);
sd->resize_objs = eina_list_append(sd->resize_objs, subobj);
@@ -2832,9 +2869,16 @@ elm_win_resize_object_del(Evas_Object *obj,
Evas_Object *subobj)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_resize_object_del(subobj));
+}
+
+static void
+_resize_object_del(Eo *obj, void *_pd, va_list *list)
+{
+ Evas_Object *subobj = va_arg(*list, Evas_Object *);
+ Elm_Win_Smart_Data *sd = _pd;
- if (!ELM_WIDGET_DATA(sd)->api->sub_object_del(obj, subobj))
+ if (!elm_widget_sub_object_del(obj, subobj))
ERR("could not remove sub object %p from %p", subobj, obj);
sd->resize_objs = eina_list_remove(sd->resize_objs, subobj);
@@ -2853,7 +2897,14 @@ elm_win_title_set(Evas_Object *obj,
const char *title)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_title_set(title));
+}
+
+static void
+_title_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *title = va_arg(*list, const char *);
+ Elm_Win_Smart_Data *sd = _pd;
if (!title) return;
eina_stringshare_replace(&(sd->title), title);
@@ -2867,9 +2918,17 @@ EAPI const char *
elm_win_title_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_title_get(&ret));
+ return ret;
+}
- return sd->title;
+static void
+_title_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->title;
}
EAPI void
@@ -2877,7 +2936,14 @@ elm_win_icon_name_set(Evas_Object *obj,
const char *icon_name)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_icon_name_set(icon_name));
+}
+
+static void
+_icon_name_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *icon_name = va_arg(*list, const char *);
+ Elm_Win_Smart_Data *sd = _pd;
if (!icon_name) return;
eina_stringshare_replace(&(sd->icon_name), icon_name);
@@ -2890,16 +2956,31 @@ EAPI const char *
elm_win_icon_name_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_icon_name_get(&ret));
+ return ret;
+}
- return sd->icon_name;
+static void
+_icon_name_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->icon_name;
}
EAPI void
elm_win_role_set(Evas_Object *obj, const char *role)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_role_set(role));
+}
+
+static void
+_role_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *role = va_arg(*list, const char *);
+ Elm_Win_Smart_Data *sd = _pd;
if (!role) return;
eina_stringshare_replace(&(sd->role), role);
@@ -2912,9 +2993,17 @@ EAPI const char *
elm_win_role_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_role_get(&ret));
+ return ret;
+}
- return sd->role;
+static void
+_role_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->role;
}
EAPI void
@@ -2922,7 +3011,14 @@ elm_win_icon_object_set(Evas_Object *obj,
Evas_Object *icon)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_icon_object_set(icon));
+}
+
+static void
+_icon_object_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object *icon = va_arg(*list, Evas_Object *);
+ Elm_Win_Smart_Data *sd = _pd;
if (sd->icon)
evas_object_event_callback_del_full
@@ -2940,9 +3036,17 @@ EAPI const Evas_Object *
elm_win_icon_object_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const Evas_Object *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_icon_object_get(&ret));
+ return ret;
+}
- return sd->icon;
+static void
+_icon_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const Evas_Object **ret = va_arg(*list, const Evas_Object **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->icon;
}
EAPI void
@@ -2950,8 +3054,14 @@ elm_win_autodel_set(Evas_Object *obj,
Eina_Bool autodel)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_autodel_set(autodel));
+}
+static void
+_autodel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool autodel = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->autodel = autodel;
}
@@ -2959,17 +3069,30 @@ EAPI Eina_Bool
elm_win_autodel_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_autodel_get(&ret));
+ return ret;
+}
- return sd->autodel;
+static void
+_autodel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->autodel;
}
EAPI void
elm_win_activate(Evas_Object *obj)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_activate());
+}
+static void
+_activate(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, activate);
}
@@ -2977,8 +3100,13 @@ EAPI void
elm_win_lower(Evas_Object *obj)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_lower());
+}
+static void
+_lower(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, lower);
}
@@ -2986,8 +3114,13 @@ EAPI void
elm_win_raise(Evas_Object *obj)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_raise());
+}
+static void
+_raise(Eo *obj EINA_UNUSED, void *_pd, va_list *list EINA_UNUSED)
+{
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, raise);
}
@@ -2996,10 +3129,18 @@ elm_win_center(Evas_Object *obj,
Eina_Bool h,
Eina_Bool v)
{
+ ELM_WIN_CHECK(obj);
+ eo_do(obj, elm_obj_win_center(h, v));
+}
+
+static void
+_center(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool h = va_arg(*list, int);
+ Eina_Bool v = va_arg(*list, int);
int win_w, win_h, screen_w, screen_h, nx, ny;
- ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ Elm_Win_Smart_Data *sd = _pd;
if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
return;
@@ -3025,7 +3166,14 @@ elm_win_borderless_set(Evas_Object *obj,
Eina_Bool borderless)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_borderless_set(borderless));
+}
+
+static void
+_borderless_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool borderless = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, borderless_set, borderless);
#ifdef HAVE_ELEMENTARY_X
@@ -3037,9 +3185,17 @@ EAPI Eina_Bool
elm_win_borderless_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_borderless_get(&ret));
+ return ret;
+}
- return ecore_evas_borderless_get(sd->ee);
+static void
+_borderless_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = ecore_evas_borderless_get(sd->ee);
}
EAPI void
@@ -3047,7 +3203,14 @@ elm_win_shaped_set(Evas_Object *obj,
Eina_Bool shaped)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_shaped_set(shaped));
+}
+
+static void
+_shaped_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool shaped = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, shaped_set, shaped);
#ifdef HAVE_ELEMENTARY_X
@@ -3059,9 +3222,17 @@ EAPI Eina_Bool
elm_win_shaped_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_shaped_get(&ret));
+ return ret;
+}
- return ecore_evas_shaped_get(sd->ee);
+static void
+_shaped_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = ecore_evas_shaped_get(sd->ee);
}
EAPI void
@@ -3069,7 +3240,14 @@ elm_win_alpha_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_alpha_set(enabled));
+}
+
+static void
+_alpha_set(Eo *obj, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
if (sd->img_obj)
{
@@ -3102,14 +3280,25 @@ EAPI Eina_Bool
elm_win_alpha_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_alpha_get(&ret));
+ return ret;
+}
+
+static void
+_alpha_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
if (sd->img_obj)
{
- return evas_object_image_alpha_get(sd->img_obj);
+ *ret = evas_object_image_alpha_get(sd->img_obj);
+ }
+ else
+ {
+ *ret = ecore_evas_alpha_get(sd->ee);
}
-
- return ecore_evas_alpha_get(sd->ee);
}
EAPI void
@@ -3117,7 +3306,14 @@ elm_win_override_set(Evas_Object *obj,
Eina_Bool override)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_override_set(override));
+}
+
+static void
+_override_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool override = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, override_set, override);
#ifdef HAVE_ELEMENTARY_X
@@ -3129,9 +3325,17 @@ EAPI Eina_Bool
elm_win_override_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_override_get(&ret));
+ return ret;
+}
- return ecore_evas_override_get(sd->ee);
+static void
+_override_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = ecore_evas_override_get(sd->ee);
}
EAPI void
@@ -3139,7 +3343,14 @@ elm_win_fullscreen_set(Evas_Object *obj,
Eina_Bool fullscreen)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_fullscreen_set(fullscreen));
+}
+
+static void
+_fullscreen_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool fullscreen = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
// YYY: handle if sd->img_obj
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
@@ -3177,17 +3388,26 @@ EAPI Eina_Bool
elm_win_fullscreen_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_fullscreen_get(&ret));
+ return ret;
+}
+
+static void
+_fullscreen_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
{
// these engines... can ONLY be fullscreen
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
else
{
- return sd->fullscreen;
+ *ret = sd->fullscreen;
}
}
@@ -3196,7 +3416,14 @@ elm_win_maximized_set(Evas_Object *obj,
Eina_Bool maximized)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_maximized_set(maximized));
+}
+
+static void
+_maximized_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool maximized = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->maximized = maximized;
// YYY: handle if sd->img_obj
@@ -3210,9 +3437,17 @@ EAPI Eina_Bool
elm_win_maximized_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_maximized_get(&ret));
+ return ret;
+}
- return sd->maximized;
+static void
+_maximized_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->maximized;
}
EAPI void
@@ -3220,7 +3455,14 @@ elm_win_iconified_set(Evas_Object *obj,
Eina_Bool iconified)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_iconified_set(iconified));
+}
+
+static void
+_iconified_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool iconified = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->iconified = iconified;
TRAP(sd, iconified_set, iconified);
@@ -3233,9 +3475,17 @@ EAPI Eina_Bool
elm_win_iconified_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_iconified_get(&ret));
+ return ret;
+}
- return sd->iconified;
+static void
+_iconified_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->iconified;
}
EAPI void
@@ -3243,7 +3493,14 @@ elm_win_withdrawn_set(Evas_Object *obj,
Eina_Bool withdrawn)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_withdrawn_set(withdrawn));
+}
+
+static void
+_withdrawn_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool withdrawn = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->withdrawn = withdrawn;
TRAP(sd, withdrawn_set, withdrawn);
@@ -3256,9 +3513,17 @@ EAPI Eina_Bool
elm_win_withdrawn_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_withdrawn_get(&ret));
+ return ret;
+}
- return sd->withdrawn;
+static void
+_withdrawn_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->withdrawn;
}
EAPI void
@@ -3266,7 +3531,14 @@ elm_win_urgent_set(Evas_Object *obj,
Eina_Bool urgent)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_urgent_set(urgent));
+}
+
+static void
+_urgent_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool urgent = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->urgent = urgent;
TRAP(sd, urgent_set, urgent);
@@ -3279,9 +3551,17 @@ EAPI Eina_Bool
elm_win_urgent_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_urgent_get(&ret));
+ return ret;
+}
- return sd->urgent;
+static void
+_urgent_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->urgent;
}
EAPI void
@@ -3289,7 +3569,14 @@ elm_win_demand_attention_set(Evas_Object *obj,
Eina_Bool demand_attention)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_demand_attention_set(demand_attention));
+}
+
+static void
+_demand_attention_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool demand_attention = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->demand_attention = demand_attention;
TRAP(sd, demand_attention_set, demand_attention);
@@ -3302,9 +3589,17 @@ EAPI Eina_Bool
elm_win_demand_attention_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_demand_attention_get(&ret));
+ return ret;
+}
- return sd->demand_attention;
+static void
+_demand_attention_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->demand_attention;
}
EAPI void
@@ -3312,7 +3607,14 @@ elm_win_modal_set(Evas_Object *obj,
Eina_Bool modal)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_modal_set(modal));
+}
+
+static void
+_modal_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool modal = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->modal = modal;
TRAP(sd, modal_set, modal);
@@ -3325,9 +3627,17 @@ EAPI Eina_Bool
elm_win_modal_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_modal_get(&ret));
+ return ret;
+}
- return sd->modal;
+static void
+_modal_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->modal;
}
EAPI void
@@ -3335,7 +3645,14 @@ elm_win_aspect_set(Evas_Object *obj,
double aspect)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_aspect_set(aspect));
+}
+
+static void
+_aspect_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double aspect = va_arg(*list, double);
+ Elm_Win_Smart_Data *sd = _pd;
sd->aspect = aspect;
TRAP(sd, aspect_set, aspect);
@@ -3348,16 +3665,32 @@ EAPI double
elm_win_aspect_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) 0.0;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, 0.0);
+ double ret = 0.0;
+ eo_do((Eo *) obj, elm_obj_win_aspect_get(&ret));
+ return ret;
+}
- return sd->aspect;
+static void
+_aspect_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ double *ret = va_arg(*list, double *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->aspect;
}
EAPI void
elm_win_size_base_set(Evas_Object *obj, int w, int h)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_size_base_set(w, h));
+}
+
+static void
+_size_base_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->size_base_w = w;
sd->size_base_h = h;
TRAP(sd, size_base_set, w, h);
@@ -3370,7 +3703,16 @@ EAPI void
elm_win_size_base_get(Evas_Object *obj, int *w, int *h)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_size_base_get(w, h));
+}
+
+static void
+_size_base_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+
+ Elm_Win_Smart_Data *sd = _pd;
if (w) *w = sd->size_base_w;
if (w) *h = sd->size_base_h;
}
@@ -3379,7 +3721,15 @@ EAPI void
elm_win_size_step_set(Evas_Object *obj, int w, int h)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_size_step_set(w, h));
+}
+
+static void
+_size_step_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int w = va_arg(*list, int);
+ int h = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->size_step_w = w;
sd->size_step_h = h;
TRAP(sd, size_step_set, w, h);
@@ -3392,7 +3742,15 @@ EAPI void
elm_win_size_step_get(Evas_Object *obj, int *w, int *h)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_size_step_get(w, h));
+}
+
+static void
+_size_step_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
if (w) *w = sd->size_step_w;
if (w) *h = sd->size_step_h;
}
@@ -3402,7 +3760,14 @@ elm_win_layer_set(Evas_Object *obj,
int layer)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_layer_set(layer));
+}
+
+static void
+_layer_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int layer = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
TRAP(sd, layer_set, layer);
#ifdef HAVE_ELEMENTARY_X
@@ -3414,9 +3779,17 @@ EAPI int
elm_win_layer_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) - 1;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_win_layer_get(&ret));
+ return ret;
+}
- return ecore_evas_layer_get(sd->ee);
+static void
+_layer_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = ecore_evas_layer_get(sd->ee);
}
EAPI void
@@ -3474,7 +3847,14 @@ elm_win_rotation_set(Evas_Object *obj,
int rotation)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_rotation_set(rotation));
+}
+
+static void
+_rotation_set(Eo *obj, void *_pd, va_list *list)
+{
+ int rotation = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
rotation = _win_rotation_degree_check(rotation);
if (sd->rot == rotation) return;
@@ -3494,7 +3874,14 @@ elm_win_rotation_with_resize_set(Evas_Object *obj,
int rotation)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_rotation_with_resize_set(rotation));
+}
+
+static void
+_rotation_with_resize_set(Eo *obj, void *_pd, va_list *list)
+{
+ int rotation = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
rotation = _win_rotation_degree_check(rotation);
if (sd->rot == rotation) return;
@@ -3514,9 +3901,17 @@ EAPI int
elm_win_rotation_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) - 1;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_win_rotation_get(&ret));
+ return ret;
+}
- return sd->rot;
+static void
+_rotation_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->rot;
}
EAPI void
@@ -3524,7 +3919,14 @@ elm_win_sticky_set(Evas_Object *obj,
Eina_Bool sticky)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_sticky_set(sticky));
+}
+
+static void
+_sticky_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool sticky = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->sticky = sticky;
TRAP(sd, sticky_set, sticky);
@@ -3537,9 +3939,17 @@ EAPI Eina_Bool
elm_win_sticky_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_sticky_get(&ret));
+ return ret;
+}
- return sd->sticky;
+static void
+_sticky_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->sticky;
}
EAPI void
@@ -3547,7 +3957,14 @@ elm_win_keyboard_mode_set(Evas_Object *obj,
Elm_Win_Keyboard_Mode mode)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_keyboard_mode_set(mode));
+}
+
+static void
+_keyboard_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Keyboard_Mode mode = va_arg(*list, Elm_Win_Keyboard_Mode);
+ Elm_Win_Smart_Data *sd = _pd;
if (mode == sd->kbdmode) return;
#ifdef HAVE_ELEMENTARY_X
@@ -3565,9 +3982,17 @@ EAPI Elm_Win_Keyboard_Mode
elm_win_keyboard_mode_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) ELM_WIN_KEYBOARD_UNKNOWN;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_WIN_KEYBOARD_UNKNOWN);
+ Elm_Win_Keyboard_Mode ret = ELM_WIN_KEYBOARD_UNKNOWN;
+ eo_do((Eo *) obj, elm_obj_win_keyboard_mode_get(&ret));
+ return ret;
+}
- return sd->kbdmode;
+static void
+_keyboard_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Keyboard_Mode *ret = va_arg(*list, Elm_Win_Keyboard_Mode *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->kbdmode;
}
EAPI void
@@ -3575,7 +4000,14 @@ elm_win_keyboard_win_set(Evas_Object *obj,
Eina_Bool is_keyboard)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_keyboard_win_set(is_keyboard));
+}
+
+static void
+_keyboard_win_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool is_keyboard = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3590,22 +4022,41 @@ EAPI Eina_Bool
elm_win_keyboard_win_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_keyboard_win_get(&ret));
+ return ret;
+}
+
+static void
+_keyboard_win_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_virtual_keyboard_get(sd->x.xwin);
+ {
+ *ret = ecore_x_e_virtual_keyboard_get(sd->x.xwin);
+ return;
+ }
#endif
- return EINA_FALSE;
+ *ret = EINA_FALSE;
}
EAPI void
elm_win_indicator_mode_set(Evas_Object *obj,
- Elm_Win_Indicator_Mode mode)
+ Elm_Win_Indicator_Mode mode)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_indicator_mode_set(mode));
+}
+
+static void
+_indicator_mode_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Indicator_Mode mode = va_arg(*list, Elm_Win_Indicator_Mode);
+ Elm_Win_Smart_Data *sd = _pd;
if (mode == sd->indmode) return;
#ifdef HAVE_ELEMENTARY_X
@@ -3630,9 +4081,17 @@ EAPI Elm_Win_Indicator_Mode
elm_win_indicator_mode_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_UNKNOWN;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_WIN_INDICATOR_UNKNOWN);
+ Elm_Win_Indicator_Mode ret = ELM_WIN_INDICATOR_UNKNOWN;
+ eo_do((Eo *) obj, elm_obj_win_indicator_mode_get(&ret));
+ return ret;
+}
- return sd->indmode;
+static void
+_indicator_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Indicator_Mode *ret = va_arg(*list, Elm_Win_Indicator_Mode *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->indmode;
}
EAPI void
@@ -3640,7 +4099,14 @@ elm_win_indicator_opacity_set(Evas_Object *obj,
Elm_Win_Indicator_Opacity_Mode mode)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_indicator_opacity_set(mode));
+}
+
+static void
+_indicator_opacity_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Indicator_Opacity_Mode mode = va_arg(*list, Elm_Win_Indicator_Opacity_Mode);
+ Elm_Win_Smart_Data *sd = _pd;
if (mode == sd->ind_o_mode) return;
sd->ind_o_mode = mode;
@@ -3666,9 +4132,17 @@ EAPI Elm_Win_Indicator_Opacity_Mode
elm_win_indicator_opacity_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, ELM_WIN_INDICATOR_OPACITY_UNKNOWN);
+ Elm_Win_Indicator_Opacity_Mode ret = ELM_WIN_INDICATOR_OPACITY_UNKNOWN;
+ eo_do((Eo *) obj, elm_obj_win_indicator_opacity_get(&ret));
+ return ret;
+}
- return sd->ind_o_mode;
+static void
+_indicator_opacity_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Win_Indicator_Opacity_Mode *ret = va_arg(*list, Elm_Win_Indicator_Opacity_Mode *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->ind_o_mode;
}
EAPI void
@@ -3677,7 +4151,15 @@ elm_win_screen_position_get(const Evas_Object *obj,
int *y)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do((Eo *) obj, elm_obj_win_screen_position_get(x, y));
+}
+
+static void
+_screen_position_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *x = va_arg(*list, int *);
+ int *y = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
if (x) *x = sd->screen.x;
if (y) *y = sd->screen.y;
@@ -3687,9 +4169,17 @@ EAPI Eina_Bool
elm_win_focus_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_focus_get(&ret));
+ return ret;
+}
- return ecore_evas_focus_get(sd->ee);
+static void
+_focus_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = ecore_evas_focus_get(sd->ee);
}
EAPI void
@@ -3697,8 +4187,14 @@ elm_win_screen_constrain_set(Evas_Object *obj,
Eina_Bool constrain)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_screen_constrain_set(constrain));
+}
+static void
+_screen_constrain_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool constrain = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->constrain = !!constrain;
}
@@ -3706,9 +4202,17 @@ EAPI Eina_Bool
elm_win_screen_constrain_get(Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_win_screen_constrain_get(&ret));
+ return ret;
+}
- return sd->constrain;
+static void
+_screen_constrain_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->constrain;
}
EAPI void
@@ -3719,7 +4223,17 @@ elm_win_screen_size_get(const Evas_Object *obj,
int *h)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do((Eo *) obj, elm_obj_win_screen_size_get(x, y, w, h));
+}
+
+static void
+_screen_size_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *x = va_arg(*list, int *);
+ int *y = va_arg(*list, int *);
+ int *w = va_arg(*list, int *);
+ int *h = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
ecore_evas_screen_geometry_get(sd->ee, x, y, w, h);
}
@@ -3730,7 +4244,15 @@ elm_win_screen_dpi_get(const Evas_Object *obj,
int *ydpi)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do((Eo *) obj, elm_obj_win_screen_dpi_get(xdpi, ydpi));
+}
+
+static void
+_screen_dpi_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *xdpi = va_arg(*list, int *);
+ int *ydpi = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
ecore_evas_screen_dpi_get(sd->ee, xdpi, ydpi);
}
@@ -3740,7 +4262,14 @@ elm_win_conformant_set(Evas_Object *obj,
Eina_Bool conformant)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_conformant_set(conformant));
+}
+
+static void
+_conformant_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool conformant = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3755,14 +4284,23 @@ EAPI Eina_Bool
elm_win_conformant_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_conformant_get(&ret));
+ return ret;
+}
+
+static void
+_conformant_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_illume_conformant_get(sd->x.xwin);
+ *ret = ecore_x_e_illume_conformant_get(sd->x.xwin);
#endif
- return EINA_FALSE;
}
EAPI void
@@ -3770,7 +4308,14 @@ elm_win_quickpanel_set(Evas_Object *obj,
Eina_Bool quickpanel)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_quickpanel_set(quickpanel));
+}
+
+static void
+_quickpanel_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool quickpanel = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
@@ -3795,14 +4340,23 @@ EAPI Eina_Bool
elm_win_quickpanel_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_quickpanel_get(&ret));
+ return ret;
+}
+
+static void
+_quickpanel_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = EINA_FALSE;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_illume_quickpanel_get(sd->x.xwin);
+ *ret = ecore_x_e_illume_quickpanel_get(sd->x.xwin);
#endif
- return EINA_FALSE;
}
EAPI void
@@ -3810,7 +4364,14 @@ elm_win_quickpanel_priority_major_set(Evas_Object *obj,
int priority)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_quickpanel_priority_major_set(priority));
+}
+
+static void
+_quickpanel_priority_major_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int priority = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3825,14 +4386,23 @@ EAPI int
elm_win_quickpanel_priority_major_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) - 1;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_major_get(&ret));
+ return ret;
+}
+
+static void
+_quickpanel_priority_major_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = -1;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
+ *ret = ecore_x_e_illume_quickpanel_priority_major_get(sd->x.xwin);
#endif
- return -1;
}
EAPI void
@@ -3840,7 +4410,14 @@ elm_win_quickpanel_priority_minor_set(Evas_Object *obj,
int priority)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_quickpanel_priority_minor_set(priority));
+}
+
+static void
+_quickpanel_priority_minor_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int priority = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3855,14 +4432,23 @@ EAPI int
elm_win_quickpanel_priority_minor_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) - 1;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, -1);
+ int ret = - 1;
+ eo_do((Eo *) obj, elm_obj_win_quickpanel_priority_minor_get(&ret));
+ return ret;
+}
+
+static void
+_quickpanel_priority_minor_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = -1;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
+ *ret = ecore_x_e_illume_quickpanel_priority_minor_get(sd->x.xwin);
#endif
- return -1;
}
EAPI void
@@ -3870,7 +4456,14 @@ elm_win_quickpanel_zone_set(Evas_Object *obj,
int zone)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_quickpanel_zone_set(zone));
+}
+
+static void
+_quickpanel_zone_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int zone = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3885,14 +4478,23 @@ EAPI int
elm_win_quickpanel_zone_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) 0;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
+ int ret = 0;
+ eo_do((Eo *) obj, elm_obj_win_quickpanel_zone_get(&ret));
+ return ret;
+}
+
+static void
+_quickpanel_zone_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ int *ret = va_arg(*list, int *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = 0;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
if (sd->x.xwin)
- return ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
+ *ret = ecore_x_e_illume_quickpanel_zone_get(sd->x.xwin);
#endif
- return 0;
}
EAPI void
@@ -3900,7 +4502,14 @@ elm_win_prop_focus_skip_set(Evas_Object *obj,
Eina_Bool skip)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_prop_focus_skip_set(skip));
+}
+
+static void
+_prop_focus_skip_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool skip = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
sd->skip_focus = skip;
TRAP(sd, focus_skip_set, skip);
@@ -3909,10 +4518,19 @@ elm_win_prop_focus_skip_set(Evas_Object *obj,
EAPI void
elm_win_illume_command_send(Evas_Object *obj,
Elm_Illume_Command command,
- void *params __UNUSED__)
+ void *params)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_illume_command_send(command, params));
+}
+
+static void
+_illume_command_send(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Elm_Illume_Command command = va_arg(*list, Elm_Illume_Command);
+ void *params = va_arg(*list, void *);
+ (void) params;
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
_elm_win_xwindow_get(sd);
@@ -3949,9 +4567,17 @@ EAPI Evas_Object *
elm_win_inlined_image_object_get(Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Evas_Object *ret = NULL;
+ eo_do(obj, elm_obj_win_inlined_image_object_get(&ret));
+ return ret;
+}
- return sd->img_obj;
+static void
+_inlined_image_object_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Evas_Object **ret = va_arg(*list, Evas_Object **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->img_obj;
}
EAPI void
@@ -3959,7 +4585,14 @@ elm_win_focus_highlight_enabled_set(Evas_Object *obj,
Eina_Bool enabled)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_focus_highlight_enabled_set(enabled));
+}
+
+static void
+_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool enabled = va_arg(*list, int);
+ Elm_Win_Smart_Data *sd = _pd;
enabled = !!enabled;
if (sd->focus_highlight.enabled == enabled)
@@ -3977,9 +4610,17 @@ EAPI Eina_Bool
elm_win_focus_highlight_enabled_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_win_focus_highlight_enabled_get(&ret));
+ return ret;
+}
- return sd->focus_highlight.enabled;
+static void
+_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->focus_highlight.enabled;
}
EAPI void
@@ -3987,7 +4628,14 @@ elm_win_focus_highlight_style_set(Evas_Object *obj,
const char *style)
{
ELM_WIN_CHECK(obj);
- ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
+ eo_do(obj, elm_obj_win_focus_highlight_style_set(style));
+}
+
+static void
+_focus_highlight_style_set(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *style = va_arg(*list, const char *);
+ Elm_Win_Smart_Data *sd = _pd;
eina_stringshare_replace(&sd->focus_highlight.style, style);
sd->focus_highlight.changed_theme = EINA_TRUE;
@@ -3998,9 +4646,17 @@ EAPI const char *
elm_win_focus_highlight_style_get(const Evas_Object *obj)
{
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ const char *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_focus_highlight_style_get(&ret));
+ return ret;
+}
- return sd->focus_highlight.style;
+static void
+_focus_highlight_style_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char **ret = va_arg(*list, const char **);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = sd->focus_highlight.style;
}
EAPI Eina_Bool
@@ -4010,14 +4666,27 @@ elm_win_socket_listen(Evas_Object *obj,
Eina_Bool svcsys)
{
ELM_WIN_CHECK(obj) EINA_FALSE;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do(obj, elm_obj_win_socket_listen(svcname, svcnum, svcsys, &ret));
+ return ret;
+}
- if (!sd->ee) return EINA_FALSE;
+static void
+_socket_listen(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ const char *svcname = va_arg(*list, const char *);
+ int svcnum = va_arg(*list, int);
+ Eina_Bool svcsys = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Elm_Win_Smart_Data *sd = _pd;
+ *ret = EINA_FALSE;
+
+ if (!sd->ee) return;
if (!ecore_evas_extn_socket_listen(sd->ee, svcname, svcnum, svcsys))
- return EINA_FALSE;
+ return;
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
/* windowing specific calls - shall we do this differently? */
@@ -4027,20 +4696,37 @@ elm_win_xwindow_get(const Evas_Object *obj)
{
if (!obj) return 0;
- if (!evas_object_smart_type_check_ptr(obj, WIN_SMART_NAME))
+ if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME))
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
return _elm_ee_xwin_get(ee);
}
ELM_WIN_CHECK(obj) 0;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, 0);
+ Ecore_X_Window ret = 0;
+ eo_do((Eo *) obj, elm_obj_win_xwindow_get(&ret));
+ return ret;
+}
+
+static void
+_xwindow_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
+{
+ Ecore_X_Window *ret = va_arg(*list, Ecore_X_Window *);
+ Elm_Win_Smart_Data *sd = _pd;
#ifdef HAVE_ELEMENTARY_X
- if (sd->x.xwin) return sd->x.xwin;
- if (sd->parent) return elm_win_xwindow_get(sd->parent);
+ if (sd->x.xwin)
+ {
+ *ret = sd->x.xwin;
+ return;
+ }
+ if (sd->parent)
+ {
+ *ret = elm_win_xwindow_get(sd->parent);
+ return;
+ }
#endif
- return 0;
+ *ret = 0;
}
EAPI Ecore_Wl_Window *
@@ -4048,19 +4734,36 @@ elm_win_wl_window_get(const Evas_Object *obj)
{
if (!obj) return NULL;
- if (!evas_object_smart_type_check_ptr(obj, WIN_SMART_NAME))
+ if (!evas_object_smart_type_check_ptr(obj, MY_CLASS_NAME))
{
Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
return ecore_evas_wayland_window_get(ee);
}
ELM_WIN_CHECK(obj) NULL;
- ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
+ Ecore_Wl_Window *ret = NULL;
+ eo_do((Eo *) obj, elm_obj_win_wl_window_get(&ret));
+ return ret;
+}
+
+static void
+_wl_window_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
+{
+ Ecore_Wl_Window **ret = va_arg(*list, Ecore_Wl_Window **);
#if HAVE_ELEMENTARY_WAYLAND
- if (sd->wl.win) return sd->wl.win;
- if (sd->parent) return elm_win_wl_window_get(sd->parent);
+ Elm_Win_Smart_Data *sd = _pd;
+ if (sd->wl.xwin)
+ {
+ *ret = sd->wl.xwin;
+ return;
+ }
+ if (sd->parent)
+ {
+ *ret = elm_win_wl_window_get(sd->parent);
+ return;
+ }
#endif
- return NULL;
+ *ret = NULL;
}
EAPI Eina_Bool
@@ -4110,3 +4813,216 @@ elm_win_floating_mode_get(const Evas_Object *obj)
return sd->floating;
}
+static void
+_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_win_smart_add),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_win_smart_del),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_RESIZE), _elm_win_smart_resize),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE), _elm_win_smart_move),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW), _elm_win_smart_show),
+ EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE), _elm_win_smart_hide),
+
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_win_smart_on_focus),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_win_smart_event),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_win_smart_focus_next_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_win_smart_focus_next),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_win_smart_focus_direction_manager_is),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION), _elm_win_smart_focus_direction),
+
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), _win_constructor),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), _resize_object_add),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), _resize_object_del),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), _title_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), _title_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), _icon_name_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), _icon_name_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), _role_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), _role_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), _icon_object_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), _icon_object_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), _autodel_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), _autodel_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE), _activate),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER), _lower),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE), _raise),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), _center),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), _borderless_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), _borderless_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), _shaped_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), _shaped_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), _alpha_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), _alpha_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), _override_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), _override_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), _fullscreen_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), _fullscreen_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), _maximized_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), _maximized_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), _iconified_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), _iconified_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), _withdrawn_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), _withdrawn_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), _urgent_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), _urgent_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), _demand_attention_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), _demand_attention_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), _modal_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), _modal_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), _aspect_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), _aspect_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), _size_base_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), _size_base_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), _size_step_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), _size_step_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), _layer_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), _layer_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), _rotation_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), _rotation_with_resize_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), _rotation_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), _sticky_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), _sticky_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), _keyboard_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), _keyboard_mode_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), _keyboard_win_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), _keyboard_win_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), _indicator_mode_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), _indicator_mode_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), _indicator_opacity_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), _indicator_opacity_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), _screen_position_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), _focus_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), _screen_constrain_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), _screen_constrain_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), _screen_size_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), _screen_dpi_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), _conformant_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), _conformant_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), _quickpanel_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), _quickpanel_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), _quickpanel_priority_major_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), _quickpanel_priority_major_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), _quickpanel_priority_minor_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), _quickpanel_priority_minor_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), _quickpanel_zone_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), _quickpanel_zone_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), _prop_focus_skip_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), _illume_command_send),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), _inlined_image_object_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), _focus_highlight_enabled_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), _focus_highlight_enabled_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), _focus_highlight_style_set),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), _focus_highlight_style_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), _socket_listen),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), _xwindow_get),
+ EO_OP_FUNC(ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), _wl_window_get),
+ EO_OP_FUNC_SENTINEL
+ };
+
+ eo_class_funcs_set(klass, func_desc);
+}
+
+static const Eo_Op_Description op_desc[] = {
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR, "Adds a window object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD, "Add subobj as a resize object of window obj."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL, "Delete subobj as a resize object of window obj."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_SET, "Set the title of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_TITLE_GET, "Get the title of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET, "Set the icon name of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET, "Get the icon name of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_SET, "Set the role of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROLE_GET, "Get the role of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET, "Set a window object's icon."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET, "Get the icon object used for the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET, "Set the window's autodel state."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET, "Get the window's autodel state."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ACTIVATE, "Activate a window object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LOWER, "Lower a window object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_RAISE, "Raise a window object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CENTER, "Center a window on its screen."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET, "Set the borderless state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET, "Get the borderless state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_SET, "Set the shaped state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SHAPED_GET, "Get the shaped state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_SET, "Set the alpha channel state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ALPHA_GET, "Get the alpha channel state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET, "Set the override state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET, "Get the override state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET, "Set the fullscreen state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET, "Get the fullscreen state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET, "Set the maximized state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET, "Get the maximized state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET, "Set the iconified state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET, "Get the iconified state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET, "Set the withdrawn state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET, "Get the withdrawn state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_SET, "Set the urgent state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_URGENT_GET, "Get the urgent state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET, "Set the demand_attention state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET, "Get the demand_attention state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_SET, "Set the modal state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_MODAL_GET, "Get the modal state of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_SET, "Set the aspect ratio of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ASPECT_GET, "Get the aspect ratio of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET, "Set the base window size used with stepping calculation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET, "Get the base size of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET, "Set the window stepping used with sizing calculation."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET, "Get the stepping of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_SET, "Set the layer of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_LAYER_GET, "Get the layer of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_SET, "Set the rotation of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET, "Rotates the window and resizes it."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ROTATION_GET, "Get the rotation of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_SET, "Set the sticky state of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_STICKY_GET, "Get the sticky state of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET, "Sets the keyboard mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET, "Gets the keyboard mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET, "Sets whether the window is a keyboard."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET, "Gets whether the window is a keyboard."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET, "Sets the indicator mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET, "Gets the indicator mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET, "Sets the indicator opacity mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET, "Gets the indicator opacity mode of the window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET, "Get the screen position of a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_GET, "Determine whether a window has focus."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET, "Constrain the maximum width and height of a window to the width and height of its screen."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET, "Retrieve the constraints on the maximum width and height of a window relative to the width and height of its screen."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET, "Get screen geometry details for the screen that a window is on."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET, "Get screen dpi for the screen that a window is on."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET, "Set if this window is an illume conformant window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET, "Get if this window is an illume conformant window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET, "Set a window to be an illume quickpanel window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET, "Get if this window is a quickpanel or not."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET, "Set the major priority of a quickpanel window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET, "Get the major priority of a quickpanel window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET, "Set the minor priority of a quickpanel window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET, "Get the minor priority of a quickpanel window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET, "Set which zone this quickpanel should appear in."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET, "Get which zone this quickpanel should appear in."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET, "Set the window to be skipped by keyboard focus."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND, "Send a command to the windowing environment."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET, "Get the inlined image object handle."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET, "Set the enabled status for the focus highlight in a window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET, "Get the enabled value of the focus highlight for this window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET, "Set the style for the focus highlight on this window."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET, "Get the style set for the focus highlight object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN, "Create a socket to provide the service for Plug widget."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET, "Get the Ecore_X_Window of an Evas_Object."),
+ EO_OP_DESCRIPTION(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET, "Get the Ecore_Wl_Window of and Evas_Object."),
+ EO_OP_DESCRIPTION_SENTINEL
+};
+
+static const Eo_Class_Description class_desc = {
+ EO_VERSION,
+ MY_CLASS_NAME,
+ EO_CLASS_TYPE_REGULAR,
+ EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_BASE_ID, op_desc, ELM_OBJ_WIN_SUB_ID_LAST),
+ NULL,
+ sizeof(Elm_Win_Smart_Data),
+ _class_constructor,
+ NULL
+};
+
+EO_DEFINE_CLASS(elm_obj_win_class_get, &class_desc, ELM_OBJ_WIDGET_CLASS, NULL);
diff --git a/src/lib/elm_win.h b/src/lib/elm_win.h
index 2942b80ac..1d36ae2d9 100644
--- a/src/lib/elm_win.h
+++ b/src/lib/elm_win.h
@@ -91,6 +91,1139 @@
*
* @{
*/
+
+#define ELM_OBJ_WIN_CLASS elm_obj_win_class_get()
+
+const Eo_Class *elm_obj_win_class_get(void) EINA_CONST;
+
+extern EAPI Eo_Op ELM_OBJ_WIN_BASE_ID;
+
+enum
+ {
+ ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR,
+ ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD,
+ ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL,
+ ELM_OBJ_WIN_SUB_ID_TITLE_SET,
+ ELM_OBJ_WIN_SUB_ID_TITLE_GET,
+ ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET,
+ ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET,
+ ELM_OBJ_WIN_SUB_ID_ROLE_SET,
+ ELM_OBJ_WIN_SUB_ID_ROLE_GET,
+ ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET,
+ ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET,
+ ELM_OBJ_WIN_SUB_ID_AUTODEL_SET,
+ ELM_OBJ_WIN_SUB_ID_AUTODEL_GET,
+ ELM_OBJ_WIN_SUB_ID_ACTIVATE,
+ ELM_OBJ_WIN_SUB_ID_LOWER,
+ ELM_OBJ_WIN_SUB_ID_RAISE,
+ ELM_OBJ_WIN_SUB_ID_CENTER,
+ ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET,
+ ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET,
+ ELM_OBJ_WIN_SUB_ID_SHAPED_SET,
+ ELM_OBJ_WIN_SUB_ID_SHAPED_GET,
+ ELM_OBJ_WIN_SUB_ID_ALPHA_SET,
+ ELM_OBJ_WIN_SUB_ID_ALPHA_GET,
+ ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET,
+ ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET,
+ ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET,
+ ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET,
+ ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET,
+ ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET,
+ ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET,
+ ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET,
+ ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET,
+ ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET,
+ ELM_OBJ_WIN_SUB_ID_URGENT_SET,
+ ELM_OBJ_WIN_SUB_ID_URGENT_GET,
+ ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET,
+ ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET,
+ ELM_OBJ_WIN_SUB_ID_MODAL_SET,
+ ELM_OBJ_WIN_SUB_ID_MODAL_GET,
+ ELM_OBJ_WIN_SUB_ID_ASPECT_SET,
+ ELM_OBJ_WIN_SUB_ID_ASPECT_GET,
+ ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET,
+ ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET,
+ ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET,
+ ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET,
+ ELM_OBJ_WIN_SUB_ID_LAYER_SET,
+ ELM_OBJ_WIN_SUB_ID_LAYER_GET,
+ ELM_OBJ_WIN_SUB_ID_ROTATION_SET,
+ ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET,
+ ELM_OBJ_WIN_SUB_ID_ROTATION_GET,
+ ELM_OBJ_WIN_SUB_ID_STICKY_SET,
+ ELM_OBJ_WIN_SUB_ID_STICKY_GET,
+ ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET,
+ ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET,
+ ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET,
+ ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET,
+ ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET,
+ ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET,
+ ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET,
+ ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET,
+ ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET,
+ ELM_OBJ_WIN_SUB_ID_FOCUS_GET,
+ ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET,
+ ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET,
+ ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET,
+ ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET,
+ ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET,
+ ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET,
+ ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET,
+ ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET,
+ ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND,
+ ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET,
+ ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET,
+ ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET,
+ ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET,
+ ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET,
+ ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN,
+ ELM_OBJ_WIN_SUB_ID_XWINDOW_GET,
+ ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET,
+ ELM_OBJ_WIN_SUB_ID_LAST
+ };
+
+#define ELM_OBJ_WIN_ID(sub_id) (ELM_OBJ_WIN_BASE_ID + sub_id)
+
+#define elm_obj_win_constructor(name, type) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WIN_CONSTRUCTOR), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Elm_Win_Type, type)
+
+/**
+ * @def elm_obj_win_resize_object_add
+ * @since 1.8
+ *
+ * Add subobj as a resize object of window @p obj.
+ *
+ * @param[in] subobj
+ *
+ * @see elm_win_resize_object_add
+ */
+#define elm_obj_win_resize_object_add(subobj) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_ADD), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_win_resize_object_del
+ * @since 1.8
+ *
+ * Delete subobj as a resize object of window @p obj.
+ *
+ * @param[in] subobj
+ *
+ * @see elm_win_resize_object_del
+ */
+#define elm_obj_win_resize_object_del(subobj) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RESIZE_OBJECT_DEL), EO_TYPECHECK(Evas_Object *, subobj)
+
+/**
+ * @def elm_obj_win_title_set
+ * @since 1.8
+ *
+ * Set the title of the window
+ *
+ * @param[in] title
+ *
+ * @see elm_win_title_set
+ */
+#define elm_obj_win_title_set(title) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_SET), EO_TYPECHECK(const char *, title)
+
+/**
+ * @def elm_obj_win_title_get
+ * @since 1.8
+ *
+ * Get the title of the window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_title_get
+ */
+#define elm_obj_win_title_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_TITLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_win_icon_name_set
+ * @since 1.8
+ *
+ * Set the icon name of the window
+ *
+ * @param[in] icon_name
+ *
+ * @see elm_win_icon_name_set
+ */
+#define elm_obj_win_icon_name_set(icon_name) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_SET), EO_TYPECHECK(const char *, icon_name)
+
+/**
+ * @def elm_obj_win_icon_name_get
+ * @since 1.8
+ *
+ * Get the icon name of the window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_icon_name_get
+ */
+#define elm_obj_win_icon_name_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_NAME_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_win_role_set
+ * @since 1.8
+ *
+ * Set the role of the window
+ *
+ * @param[in] role
+ *
+ * @see elm_win_role_set
+ */
+#define elm_obj_win_role_set(role) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_SET), EO_TYPECHECK(const char *, role)
+
+/**
+ * @def elm_obj_win_role_get
+ * @since 1.8
+ *
+ * Get the role of the window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_role_get
+ */
+#define elm_obj_win_role_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_win_icon_object_set
+ * @since 1.8
+ *
+ * Set a window object's icon
+ *
+ * @param[in] icon
+ *
+ * @see elm_win_icon_object_set
+ */
+#define elm_obj_win_icon_object_set(icon) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_SET), EO_TYPECHECK(Evas_Object *, icon)
+
+/**
+ * @def elm_obj_win_icon_object_get
+ * @since 1.8
+ *
+ * Get the icon object used for the window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_icon_object_get
+ */
+#define elm_obj_win_icon_object_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICON_OBJECT_GET), EO_TYPECHECK(const Evas_Object **, ret)
+
+/**
+ * @def elm_obj_win_autodel_set
+ * @since 1.8
+ *
+ * Set the window's autodel state.
+ *
+ * @param[in] autodel
+ *
+ * @see elm_win_autodel_set
+ */
+#define elm_obj_win_autodel_set(autodel) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_SET), EO_TYPECHECK(Eina_Bool, autodel)
+
+/**
+ * @def elm_obj_win_autodel_get
+ * @since 1.8
+ *
+ * Get the window's autodel state.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_autodel_get
+ */
+#define elm_obj_win_autodel_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_AUTODEL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_activate
+ * @since 1.8
+ *
+ * Activate a window object.
+ *
+ *
+ * @see elm_win_activate
+ */
+#define elm_obj_win_activate() ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ACTIVATE)
+
+/**
+ * @def elm_obj_win_lower
+ * @since 1.8
+ *
+ * Lower a window object.
+ *
+ *
+ * @see elm_win_lower
+ */
+#define elm_obj_win_lower() ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LOWER)
+
+/**
+ * @def elm_obj_win_raise
+ * @since 1.8
+ *
+ * Raise a window object.
+ *
+ *
+ * @see elm_win_raise
+ */
+#define elm_obj_win_raise() ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_RAISE)
+
+/**
+ * @def elm_obj_win_center
+ * @since 1.8
+ *
+ * Center a window on its screen
+ *
+ * @param[in] h
+ * @param[in] v
+ *
+ * @see elm_win_center
+ */
+#define elm_obj_win_center(h, v) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CENTER), EO_TYPECHECK(Eina_Bool, h), EO_TYPECHECK(Eina_Bool, v)
+
+/**
+ * @def elm_obj_win_borderless_set
+ * @since 1.8
+ *
+ * Set the borderless state of a window.
+ *
+ * @param[in] borderless
+ *
+ * @see elm_win_borderless_set
+ */
+#define elm_obj_win_borderless_set(borderless) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_SET), EO_TYPECHECK(Eina_Bool, borderless)
+
+/**
+ * @def elm_obj_win_borderless_get
+ * @since 1.8
+ *
+ * Get the borderless state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_borderless_get
+ */
+#define elm_obj_win_borderless_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_BORDERLESS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_shaped_set
+ * @since 1.8
+ *
+ * Set the shaped state of a window.
+ *
+ * @param[in] shaped
+ *
+ * @see elm_win_shaped_set
+ */
+#define elm_obj_win_shaped_set(shaped) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_SET), EO_TYPECHECK(Eina_Bool, shaped)
+
+/**
+ * @def elm_obj_win_shaped_get
+ * @since 1.8
+ *
+ * Get the shaped state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_shaped_get
+ */
+#define elm_obj_win_shaped_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SHAPED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_alpha_set
+ * @since 1.8
+ *
+ * Set the alpha channel state of a window.
+ *
+ * @param[in] alpha
+ *
+ * @see elm_win_alpha_set
+ */
+#define elm_obj_win_alpha_set(alpha) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_SET), EO_TYPECHECK(Eina_Bool, alpha)
+
+/**
+ * @def elm_obj_win_alpha_get
+ * @since 1.8
+ *
+ * Get the alpha channel state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_alpha_get
+ */
+#define elm_obj_win_alpha_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ALPHA_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_override_set
+ * @since 1.8
+ *
+ * Set the override state of a window.
+ *
+ * @param[in] override
+ *
+ * @see elm_win_override_set
+ */
+#define elm_obj_win_override_set(override) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_SET), EO_TYPECHECK(Eina_Bool, override)
+
+/**
+ * @def elm_obj_win_override_get
+ * @since 1.8
+ *
+ * Get the override state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_override_get
+ */
+#define elm_obj_win_override_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_OVERRIDE_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_fullscreen_set
+ * @since 1.8
+ *
+ * Set the fullscreen state of a window.
+ *
+ * @param[in] fullscreen
+ *
+ * @see elm_win_fullscreen_set
+ */
+#define elm_obj_win_fullscreen_set(fullscreen) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_SET), EO_TYPECHECK(Eina_Bool, fullscreen)
+
+/**
+ * @def elm_obj_win_fullscreen_get
+ * @since 1.8
+ *
+ * Get the fullscreen state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_fullscreen_get
+ */
+#define elm_obj_win_fullscreen_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FULLSCREEN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_maximized_set
+ * @since 1.8
+ *
+ * Set the maximized state of a window.
+ *
+ * @param[in] maximized
+ *
+ * @see elm_win_maximized_set
+ */
+#define elm_obj_win_maximized_set(maximized) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_SET), EO_TYPECHECK(Eina_Bool, maximized)
+
+/**
+ * @def elm_obj_win_maximized_get
+ * @since 1.8
+ *
+ * Get the maximized state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_maximized_get
+ */
+#define elm_obj_win_maximized_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MAXIMIZED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_iconified_set
+ * @since 1.8
+ *
+ * Set the iconified state of a window.
+ *
+ * @param[in] iconified
+ *
+ * @see elm_win_iconified_set
+ */
+#define elm_obj_win_iconified_set(iconified) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_SET), EO_TYPECHECK(Eina_Bool, iconified)
+
+/**
+ * @def elm_obj_win_iconified_get
+ * @since 1.8
+ *
+ * Get the iconified state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_iconified_get
+ */
+#define elm_obj_win_iconified_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ICONIFIED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_withdrawn_set
+ * @since 1.8
+ *
+ * Set the withdrawn state of a window.
+ *
+ * @param[in] withdrawn
+ *
+ * @see elm_win_withdrawn_set
+ */
+#define elm_obj_win_withdrawn_set(withdrawn) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_SET), EO_TYPECHECK(Eina_Bool, withdrawn)
+
+/**
+ * @def elm_obj_win_withdrawn_get
+ * @since 1.8
+ *
+ * Get the withdrawn state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_withdrawn_get
+ */
+#define elm_obj_win_withdrawn_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WITHDRAWN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_urgent_set
+ * @since 1.8
+ *
+ * Set the urgent state of a window.
+ *
+ * @param[in] urgent
+ *
+ * @see elm_win_urgent_set
+ */
+#define elm_obj_win_urgent_set(urgent) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_SET), EO_TYPECHECK(Eina_Bool, urgent)
+
+/**
+ * @def elm_obj_win_urgent_get
+ * @since 1.8
+ *
+ * Get the urgent state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_urgent_get
+ */
+#define elm_obj_win_urgent_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_URGENT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_demand_attention_set
+ * @since 1.8
+ *
+ * Set the demand_attention state of a window.
+ *
+ * @param[in] demand_attention
+ *
+ * @see elm_win_demand_attention_set
+ */
+#define elm_obj_win_demand_attention_set(demand_attention) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_SET), EO_TYPECHECK(Eina_Bool, demand_attention)
+
+/**
+ * @def elm_obj_win_demand_attention_get
+ * @since 1.8
+ *
+ * Get the demand_attention state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_demand_attention_get
+ */
+#define elm_obj_win_demand_attention_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_DEMAND_ATTENTION_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_modal_set
+ * @since 1.8
+ *
+ * Set the modal state of a window.
+ *
+ * @param[in] modal
+ *
+ * @see elm_win_modal_set
+ */
+#define elm_obj_win_modal_set(modal) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_SET), EO_TYPECHECK(Eina_Bool, modal)
+
+/**
+ * @def elm_obj_win_modal_get
+ * @since 1.8
+ *
+ * Get the modal state of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_modal_get
+ */
+#define elm_obj_win_modal_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_MODAL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_aspect_set
+ * @since 1.8
+ *
+ * Set the aspect ratio of a window.
+ *
+ * @param[in] aspect
+ *
+ * @see elm_win_aspect_set
+ */
+#define elm_obj_win_aspect_set(aspect) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_SET), EO_TYPECHECK(double, aspect)
+
+/**
+ * @def elm_obj_win_aspect_get
+ * @since 1.8
+ *
+ * Get the aspect ratio of a window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_aspect_get
+ */
+#define elm_obj_win_aspect_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ASPECT_GET), EO_TYPECHECK(double *, ret)
+
+/**
+ * @def elm_obj_win_size_base_set
+ * @since 1.8
+ *
+ * Set the base window size used with stepping calculation
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_win_size_base_set
+ */
+#define elm_obj_win_size_base_set(w, h) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_win_size_base_get
+ * @since 1.8
+ *
+ * Get the base size of a window.
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_win_size_base_get
+ */
+#define elm_obj_win_size_base_get(w, h) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_BASE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_win_size_step_set
+ * @since 1.8
+ *
+ * Set the window stepping used with sizing calculation
+ *
+ * @param[in] w
+ * @param[in] h
+ *
+ * @see elm_win_size_step_set
+ */
+#define elm_obj_win_size_step_set(w, h) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
+
+/**
+ * @def elm_obj_win_size_step_get
+ * @since 1.8
+ *
+ * Get the stepping of a window.
+ *
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_win_size_step_get
+ */
+#define elm_obj_win_size_step_get(w, h) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SIZE_STEP_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_win_layer_set
+ * @since 1.8
+ *
+ * Set the layer of the window.
+ *
+ * @param[in] layer
+ *
+ * @see elm_win_layer_set
+ */
+#define elm_obj_win_layer_set(layer) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_SET), EO_TYPECHECK(int, layer)
+
+/**
+ * @def elm_obj_win_layer_get
+ * @since 1.8
+ *
+ * Get the layer of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_layer_get
+ */
+#define elm_obj_win_layer_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_LAYER_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_win_rotation_set
+ * @since 1.8
+ *
+ * Set the rotation of the window.
+ *
+ * @param[in] rotation
+ *
+ * @see elm_win_rotation_set
+ */
+#define elm_obj_win_rotation_set(rotation) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_SET), EO_TYPECHECK(int, rotation)
+
+/**
+ * @def elm_obj_win_rotation_with_resize_set
+ * @since 1.8
+ *
+ * Rotates the window and resizes it.
+ *
+ * @param[in] rotation
+ *
+ * @see elm_win_rotation_with_resize_set
+ */
+#define elm_obj_win_rotation_with_resize_set(rotation) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_WITH_RESIZE_SET), EO_TYPECHECK(int, rotation)
+
+/**
+ * @def elm_obj_win_rotation_get
+ * @since 1.8
+ *
+ * Get the rotation of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_rotation_get
+ */
+#define elm_obj_win_rotation_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ROTATION_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_win_sticky_set
+ * @since 1.8
+ *
+ * Set the sticky state of the window.
+ *
+ * @param[in] sticky
+ *
+ * @see elm_win_sticky_set
+ */
+#define elm_obj_win_sticky_set(sticky) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_SET), EO_TYPECHECK(Eina_Bool, sticky)
+
+/**
+ * @def elm_obj_win_sticky_get
+ * @since 1.8
+ *
+ * Get the sticky state of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_sticky_get
+ */
+#define elm_obj_win_sticky_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_STICKY_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_keyboard_mode_set
+ * @since 1.8
+ *
+ * Sets the keyboard mode of the window.
+ *
+ * @param[in] mode
+ *
+ * @see elm_win_keyboard_mode_set
+ */
+#define elm_obj_win_keyboard_mode_set(mode) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_SET), EO_TYPECHECK(Elm_Win_Keyboard_Mode, mode)
+
+/**
+ * @def elm_obj_win_keyboard_mode_get
+ * @since 1.8
+ *
+ * Gets the keyboard mode of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_keyboard_mode_get
+ */
+#define elm_obj_win_keyboard_mode_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_MODE_GET), EO_TYPECHECK(Elm_Win_Keyboard_Mode *, ret)
+
+/**
+ * @def elm_obj_win_keyboard_win_set
+ * @since 1.8
+ *
+ * Sets whether the window is a keyboard.
+ *
+ * @param[in] is_keyboard
+ *
+ * @see elm_win_keyboard_win_set
+ */
+#define elm_obj_win_keyboard_win_set(is_keyboard) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_SET), EO_TYPECHECK(Eina_Bool, is_keyboard)
+
+/**
+ * @def elm_obj_win_keyboard_win_get
+ * @since 1.8
+ *
+ * Gets whether the window is a keyboard.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_keyboard_win_get
+ */
+#define elm_obj_win_keyboard_win_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_KEYBOARD_WIN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_indicator_mode_set
+ * @since 1.8
+ *
+ * Sets the indicator mode of the window.
+ *
+ * @param[in] mode
+ *
+ * @see elm_win_indicator_mode_set
+ */
+#define elm_obj_win_indicator_mode_set(mode) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_SET), EO_TYPECHECK(Elm_Win_Indicator_Mode, mode)
+
+/**
+ * @def elm_obj_win_indicator_mode_get
+ * @since 1.8
+ *
+ * Gets the indicator mode of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_indicator_mode_get
+ */
+#define elm_obj_win_indicator_mode_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_MODE_GET), EO_TYPECHECK(Elm_Win_Indicator_Mode *, ret)
+
+/**
+ * @def elm_obj_win_indicator_opacity_set
+ * @since 1.8
+ *
+ * Sets the indicator opacity mode of the window.
+ *
+ * @param[in] mode
+ *
+ * @see elm_win_indicator_opacity_set
+ */
+#define elm_obj_win_indicator_opacity_set(mode) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_SET), EO_TYPECHECK(Elm_Win_Indicator_Opacity_Mode, mode)
+
+/**
+ * @def elm_obj_win_indicator_opacity_get
+ * @since 1.8
+ *
+ * Gets the indicator opacity mode of the window.
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_indicator_opacity_get
+ */
+#define elm_obj_win_indicator_opacity_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INDICATOR_OPACITY_GET), EO_TYPECHECK(Elm_Win_Indicator_Opacity_Mode *, ret)
+
+/**
+ * @def elm_obj_win_screen_position_get
+ * @since 1.8
+ *
+ * Get the screen position of a window.
+ *
+ * @param[out] x
+ * @param[out] y
+ *
+ * @see elm_win_screen_position_get
+ */
+#define elm_obj_win_screen_position_get(x, y) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_POSITION_GET), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y)
+
+/**
+ * @def elm_obj_win_focus_get
+ * @since 1.8
+ *
+ * Determine whether a window has focus
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_focus_get
+ */
+#define elm_obj_win_focus_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_screen_constrain_set
+ * @since 1.8
+ *
+ * Constrain the maximum width and height of a window to the width and height of its screen
+ *
+ * @param[in] constrain
+ *
+ * @see elm_win_screen_constrain_set
+ */
+#define elm_obj_win_screen_constrain_set(constrain) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_SET), EO_TYPECHECK(Eina_Bool, constrain)
+
+/**
+ * @def elm_obj_win_screen_constrain_get
+ * @since 1.8
+ *
+ * Retrieve the constraints on the maximum width and height of a window relative to the width and height of its screen
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_screen_constrain_get
+ */
+#define elm_obj_win_screen_constrain_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_CONSTRAIN_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_screen_size_get
+ * @since 1.8
+ *
+ * Get screen geometry details for the screen that a window is on
+ *
+ * @param[out] x
+ * @param[out] y
+ * @param[out] w
+ * @param[out] h
+ *
+ * @see elm_win_screen_size_get
+ */
+#define elm_obj_win_screen_size_get(x, y, w, h) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_SIZE_GET), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
+
+/**
+ * @def elm_obj_win_screen_dpi_get
+ * @since 1.8
+ *
+ * Get screen dpi for the screen that a window is on
+ *
+ * @param[out] xdpi
+ * @param[out] ydpi
+ *
+ * @see elm_win_screen_dpi_get
+ */
+#define elm_obj_win_screen_dpi_get(xdpi, ydpi) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SCREEN_DPI_GET), EO_TYPECHECK(int *, xdpi), EO_TYPECHECK(int *, ydpi)
+
+/**
+ * @def elm_obj_win_conformant_set
+ * @since 1.8
+ *
+ * Set if this window is an illume conformant window
+ *
+ * @param[in] conformant
+ *
+ * @see elm_win_conformant_set
+ */
+#define elm_obj_win_conformant_set(conformant) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_SET), EO_TYPECHECK(Eina_Bool, conformant)
+
+/**
+ * @def elm_obj_win_conformant_get
+ * @since 1.8
+ *
+ * Get if this window is an illume conformant window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_conformant_get
+ */
+#define elm_obj_win_conformant_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_CONFORMANT_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_quickpanel_set
+ * @since 1.8
+ *
+ * Set a window to be an illume quickpanel window
+ *
+ * @param[in] quickpanel
+ *
+ * @see elm_win_quickpanel_set
+ */
+#define elm_obj_win_quickpanel_set(quickpanel) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_SET), EO_TYPECHECK(Eina_Bool, quickpanel)
+
+/**
+ * @def elm_obj_win_quickpanel_get
+ * @since 1.8
+ *
+ * Get if this window is a quickpanel or not
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_quickpanel_get
+ */
+#define elm_obj_win_quickpanel_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_quickpanel_priority_major_set
+ * @since 1.8
+ *
+ * Set the major priority of a quickpanel window
+ *
+ * @param[in] priority
+ *
+ * @see elm_win_quickpanel_priority_major_set
+ */
+#define elm_obj_win_quickpanel_priority_major_set(priority) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_SET), EO_TYPECHECK(int, priority)
+
+/**
+ * @def elm_obj_win_quickpanel_priority_major_get
+ * @since 1.8
+ *
+ * Get the major priority of a quickpanel window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_quickpanel_priority_major_get
+ */
+#define elm_obj_win_quickpanel_priority_major_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MAJOR_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_win_quickpanel_priority_minor_set
+ * @since 1.8
+ *
+ * Set the minor priority of a quickpanel window
+ *
+ * @param[in] priority
+ *
+ * @see elm_win_quickpanel_priority_minor_set
+ */
+#define elm_obj_win_quickpanel_priority_minor_set(priority) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_SET), EO_TYPECHECK(int, priority)
+
+/**
+ * @def elm_obj_win_quickpanel_priority_minor_get
+ * @since 1.8
+ *
+ * Get the minor priority of a quickpanel window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_quickpanel_priority_minor_get
+ */
+#define elm_obj_win_quickpanel_priority_minor_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_PRIORITY_MINOR_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_win_quickpanel_zone_set
+ * @since 1.8
+ *
+ * Set which zone this quickpanel should appear in
+ *
+ * @param[in] zone
+ *
+ * @see elm_win_quickpanel_zone_set
+ */
+#define elm_obj_win_quickpanel_zone_set(zone) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_SET), EO_TYPECHECK(int, zone)
+
+/**
+ * @def elm_obj_win_quickpanel_zone_get
+ * @since 1.8
+ *
+ * Get which zone this quickpanel should appear in
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_quickpanel_zone_get
+ */
+#define elm_obj_win_quickpanel_zone_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_QUICKPANEL_ZONE_GET), EO_TYPECHECK(int *, ret)
+
+/**
+ * @def elm_obj_win_prop_focus_skip_set
+ * @since 1.8
+ *
+ * Set the window to be skipped by keyboard focus
+ *
+ * @param[in] skip
+ *
+ * @see elm_win_prop_focus_skip_set
+ */
+#define elm_obj_win_prop_focus_skip_set(skip) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_PROP_FOCUS_SKIP_SET), EO_TYPECHECK(Eina_Bool, skip)
+
+/**
+ * @def elm_obj_win_illume_command_send
+ * @since 1.8
+ *
+ * Send a command to the windowing environment
+ *
+ * @param[in] command
+ * @param[in] params
+ *
+ * @see elm_win_illume_command_send
+ */
+#define elm_obj_win_illume_command_send(command, params) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_ILLUME_COMMAND_SEND), EO_TYPECHECK(Elm_Illume_Command, command), EO_TYPECHECK(void *, params)
+
+/**
+ * @def elm_obj_win_inlined_image_object_get
+ * @since 1.8
+ *
+ * Get the inlined image object handle
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_inlined_image_object_get
+ */
+#define elm_obj_win_inlined_image_object_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_INLINED_IMAGE_OBJECT_GET), EO_TYPECHECK(Evas_Object **, ret)
+
+/**
+ * @def elm_obj_win_focus_highlight_enabled_set
+ * @since 1.8
+ *
+ * Set the enabled status for the focus highlight in a window
+ *
+ * @param[in] enabled
+ *
+ * @see elm_win_focus_highlight_enabled_set
+ */
+#define elm_obj_win_focus_highlight_enabled_set(enabled) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_SET), EO_TYPECHECK(Eina_Bool, enabled)
+
+/**
+ * @def elm_obj_win_focus_highlight_enabled_get
+ * @since 1.8
+ *
+ * Get the enabled value of the focus highlight for this window
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_focus_highlight_enabled_get
+ */
+#define elm_obj_win_focus_highlight_enabled_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_ENABLED_GET), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_focus_highlight_style_set
+ * @since 1.8
+ *
+ * Set the style for the focus highlight on this window
+ *
+ * @param[in] style
+ *
+ * @see elm_win_focus_highlight_style_set
+ */
+#define elm_obj_win_focus_highlight_style_set(style) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_SET), EO_TYPECHECK(const char *, style)
+
+/**
+ * @def elm_obj_win_focus_highlight_style_get
+ * @since 1.8
+ *
+ * Get the style set for the focus highlight object
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_focus_highlight_style_get
+ */
+#define elm_obj_win_focus_highlight_style_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_FOCUS_HIGHLIGHT_STYLE_GET), EO_TYPECHECK(const char **, ret)
+
+/**
+ * @def elm_obj_win_socket_listen
+ * @since 1.8
+ *
+ * Create a socket to provide the service for Plug widget
+ *
+ * @param[in] svcname
+ * @param[in] svcnum
+ * @param[in] svcsys
+ * @param[out] ret
+ *
+ * @see elm_win_socket_listen
+ */
+#define elm_obj_win_socket_listen(svcname, svcnum, svcsys, ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_SOCKET_LISTEN), EO_TYPECHECK(const char *, svcname), EO_TYPECHECK(int, svcnum), EO_TYPECHECK(Eina_Bool, svcsys), EO_TYPECHECK(Eina_Bool *, ret)
+
+/**
+ * @def elm_obj_win_xwindow_get
+ * @since 1.8
+ *
+ * Get the Ecore_X_Window of an Evas_Object
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_xwindow_get
+ */
+#define elm_obj_win_xwindow_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_XWINDOW_GET), EO_TYPECHECK(Ecore_X_Window *, ret)
+
+/**
+ * @def elm_obj_win_wl_window_get
+ * @since 1.8
+ *
+ * Get the Ecore_Wl_Window of and Evas_Object
+ *
+ * @param[out] ret
+ *
+ * @see elm_win_wl_window_get
+ */
+#define elm_obj_win_wl_window_get(ret) ELM_OBJ_WIN_ID(ELM_OBJ_WIN_SUB_ID_WL_WINDOW_GET), EO_TYPECHECK(Ecore_Wl_Window **, ret)
+
/**
* Defines the types of window that can be created
*
diff --git a/src/modules/datetime_input_ctxpopup/Makefile.am b/src/modules/datetime_input_ctxpopup/Makefile.am
index dd9fa928f..c4f157a77 100644
--- a/src/modules/datetime_input_ctxpopup/Makefile.am
+++ b/src/modules/datetime_input_ctxpopup/Makefile.am
@@ -25,6 +25,7 @@ AM_CPPFLAGS = \
@ELEMENTARY_ECORE_CON_CFLAGS@ \
@ELEMENTARY_ECORE_IMF_CFLAGS@ \
@ELEMENTARY_WAYLAND_CFLAGS@ \
+@ELEMENTARY_EMAP_CFLAGS@ \
@EVIL_CFLAGS@ \
@EIO_CFLAGS@ \
@EMOTION_CFLAGS@