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>
Additions:
+ * Porting to Eo
* Add ELM_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN.
* Add elementary_codegen
* Add window floating mode api's
#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";
{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))
{
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"))
{
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
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;
//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);
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
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);
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);
}
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);
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);
}
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)
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;
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)
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;
}
//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
}
}
-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" */
}
}
- 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);
}
}
//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));
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;
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
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
(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);
}
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);
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;
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;
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;
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 *
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);
if (sd->visible) elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
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;
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];
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);
* 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).
*
* @{
*/
+#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 */
#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];
{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)
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);
}
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 = "/";
#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" ***/
}
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);
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)
{
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
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);
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
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;
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)
{
sd->ok_button = bt;
- _elm_fileselector_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
}
else
{
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
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;
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);
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
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;
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)
{
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);
{
if (!ecore_file_exists(path))
{
- ret = EINA_FALSE;
+ if (ret) *ret = EINA_FALSE;
goto clean_up;
}
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);
* 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
* @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
* @{
#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"
{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
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 *
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);
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);
}
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"));
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);
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
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);
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
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;
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;
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);
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
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;
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
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;
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
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;
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
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;
}
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);
+
* @{
*/
+#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
#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";
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__,
}
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)
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
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);
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));
}
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
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);
}
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
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);
}
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
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);
}
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);
}
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);
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
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);
}
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
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);
}
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
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);
}
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
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);
}
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);
* @{
*/
+#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
#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";
{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)
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);
elm_hoversel_hover_end(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
}
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);
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)
{
}
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
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
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
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;
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;
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)
{
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 *
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);
sd->items = eina_list_append(sd->items, item);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
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);
+
* @{
*/
+#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
*
#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
{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)
{
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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);
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 =
_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)
{
evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
}
- return EINA_TRUE;
+end:
+ if (ret) *ret = EINA_TRUE;
}
static void
//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);
_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
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);
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);
}
}
-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 *
}
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));
_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
}
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)
{
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);
}
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
}
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;
}
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;
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;
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 *
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);
}
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);
}
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);
}
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);
}
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
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)
{
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);
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);
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);
}
}
}
+
+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);
* @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
* @{
#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";
{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__,
}
-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)
{
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ *ret = EINA_TRUE;
}
static void
}
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)
}
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
return it;
}
-
static void
_on_obj_size_hints_changed(void *data __UNUSED__, Evas *e __UNUSED__,
Evas_Object *obj, void *event_info __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;
}
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;
}
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;
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)
{
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 *
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));
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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)
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),
elm_layout_sizing_eval(obj);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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;
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;
else
elm_widget_item_del(it);
- return content;
+ *ret = content;
}
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)
{
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;
}
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));
}
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));
}
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;
}
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
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;
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);
* 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
* @{
#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";
{ 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)))
}
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)))
}
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if (!strcmp(ev->keyname, "space"))
{
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) \
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);
}
/* 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);
_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));
#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);
#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);
{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
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;
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)
{
}
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);
_list_del(sd);
}
- ELM_WIDGET_CLASS(_elm_popup_parent_sc)->base.del(obj);
+ eo_do_super(obj, evas_obj_smart_del());
}
static void
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));
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
}
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)
{
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 =
}
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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;
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
{
_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);
(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);
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);
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)));
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;
//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"));
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;
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)
{
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);
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 *
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
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);
//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;
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)
{
//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
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;
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;
_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 *
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"))
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 *
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"))
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)
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);
}
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
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;
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
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);
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
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);
}
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);
}
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 *
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
_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);
+
+
+
* @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.
*
#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;
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);
+
#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[] =
{
{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)
}
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);
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);
}
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);
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
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");
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;
}
}
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);
}
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;
}
}
-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;
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
}
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;
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
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;
}
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
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;
}
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, ¢er);
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);
* 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,
#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[] =
{
{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;
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;
/* 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;
}
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);
}
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
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)
{
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
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);
{
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
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;
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;
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
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);
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);
}
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;
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);
+
* @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.
#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";
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 */
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
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);
_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,
}
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
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
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
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
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
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
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
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
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
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
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
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);
+
+#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
#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";
"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);
}
/* 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")))
{
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
}
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
}
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)
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
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;
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);
* @{
*/
+#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.
*
#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";
{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)
{
}
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
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
}
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
}
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
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)
{
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
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;
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
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;
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);
+
+
* @{
*/
+#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
*
#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";
{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,
}
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);
}
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;
}
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;
}
return;
}
- elm_layout_signal_emit(ELM_WIDGET_DATA(sd)->obj, emission, "elm");
+ elm_layout_signal_emit(sd->obj, emission, "elm");
}
static void
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 *
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*/
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)))
&& (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);
}
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;
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++)
}
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);
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);
}
}
- 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
}
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++)
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
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;
}
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
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;
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;
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);
}
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)
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
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);
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
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)
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);
}
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)
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
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))
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;
}
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);
* @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
* @{
#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[] =
{
{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)
{
/* 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
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static char *
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)
{
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)
{
}
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);
}
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
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)
{
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
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)
{
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);
+
* @{
*/
+#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
*
#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";
{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)
{
_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;
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++)
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
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) *
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;
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
}
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;
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
}
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;
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 */
}
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
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;
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;
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)
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
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)
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
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);
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
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);
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
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;
}
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);
+
* @{
*/
+#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
#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
{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)
{
}
}
-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;
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
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
}
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);
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);
}
}
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));
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
}
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);
/* 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")) ||
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)))
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)))
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)))
* first color type*/
sd->sel_color_type = HUE;
}
- else return EINA_FALSE;
+ else return;
}
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
{
/*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);
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);
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
}
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
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,
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;
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;
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);
}
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
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)
{
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;
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)
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;
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);
* @{
*/
+#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;
#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)
# 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
{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"
}
}
-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
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]))
#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);
}
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);
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);
}
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);
(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);
* @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
* @{
#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;
-}
#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
# 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
{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()
{
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.
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 *
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;
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++)
{
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++)
{
}
}
- 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
}
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));
}
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++)
{
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
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)
{
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
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;
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;
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;
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;
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
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;
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
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;
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);
*
*/
+#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
* @{
#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"
{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);
}
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);
evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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)
{
_update_items(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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;
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);
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);
elm_layout_sizing_eval(obj);
- return content;
+ if (ret) *ret = content;
}
static void
}
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");
}
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;
}
/* 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
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);
}
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;
{
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);
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
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;
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
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;
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);
* @{
*/
+#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.
#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))
#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";
{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)
{
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;
}
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;
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);
* (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);
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));
}
}
- 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;
}
}
if (dit) _item_icon_set(dit, icon);
- _sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ _sizing_eval(WIDGET(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));
}
static Elm_Diskselector_Item *
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)
{
_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)
{
}
}
- 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))
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")) ||
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);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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);
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)
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
}
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));
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;
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);
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;
}
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)
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;
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
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;
}
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
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
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;
}
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;
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 *
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);
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
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
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;
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);
+
* @{
*/
+#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.
#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.
{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
}
/* 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))
{
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));
{
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));
evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
}
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);
{
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;
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);
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;
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);
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 */
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
}
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);
}
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 */
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 */
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)
else
edje_object_part_text_set(sd->entry_edje, item, entry);
- return EINA_TRUE;
+ return;
}
evas_event_freeze(evas_object_evas_get(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:
{
ERR("text=NULL for edje %p, part 'elm.text'", sd->entry_edje);
- return NULL;
+ return;
}
if (sd->append_text_len > 0)
if (!tmpbuf)
{
ERR("Failed to allocate memory for entry's text %p", obj);
- return NULL;
+ return;
}
memcpy(tmpbuf, text, tlen);
eina_stringshare_replace(&sd->text, text);
}
- return sd->text;
+ *ret = sd->text;
}
static char *
{
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);
}
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;
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);
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
}
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)
{
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);
}
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
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;
+}
+
+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;
- return edje_object_part_text_style_user_peek(sd->entry_edje, "elm.text");
+ *ret = edje_object_part_text_style_user_peek(sd->entry_edje, "elm.text");
}
EAPI void
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);
}
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;
+}
- return sd->single_line;
+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;
+
+ *ret = sd->single_line;
}
EAPI void
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;
_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;
+}
+
+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;
- return sd->password;
+ *ret = sd->password;
}
EAPI void
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 = "";
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
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;
+}
+
+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;
- return (Evas_Object *)edje_object_part_object_get
+ *ret = (Evas_Object *)edje_object_part_object_get
(sd->entry_edje, "elm.text");
}
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;
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
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;
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;
+}
+
+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;
- return sd->line_wrap;
+ *ret = sd->line_wrap;
}
EAPI void
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)
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)
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)
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;
+}
- return edje_object_part_text_cursor_next
+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;
+
+ *ret = edje_object_part_text_cursor_next
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
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;
+}
+
+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;
- return edje_object_part_text_cursor_prev
+ *ret = edje_object_part_text_cursor_prev
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
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);
}
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);
}
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);
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);
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);
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);
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");
}
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");
}
elm_entry_cursor_is_format_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) EINA_FALSE;
- ELM_ENTRY_DATA_GET(obj, sd);
-
- return edje_object_part_text_cursor_is_format_get
- (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
+ Eina_Bool ret = EINA_FALSE;
+ eo_do((Eo *) obj, elm_obj_entry_cursor_is_format_get(&ret));
+ return ret;
}
-EAPI Eina_Bool
+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);
+}
+
+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);
}
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;
+}
- return edje_object_part_text_cursor_content_get
+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;
+
+ *ret = edje_object_part_text_cursor_content_get
(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN);
}
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);
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);
}
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);
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);
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);
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)
{
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;
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;
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;
+}
+
+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;
- return !sd->context_menu;
+ *ret = !sd->context_menu;
}
EAPI void
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));
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));
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)
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);
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);
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)
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)
{
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
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;
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)
{
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;
}
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
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;
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;
+}
+
+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;
- return sd->cnp_mode;
+ *ret = sd->cnp_mode;
}
EAPI void
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;
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);
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
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;
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;
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
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
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
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;
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;
+}
+
+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;
- return sd->input_panel_layout;
+ *ret = sd->input_panel_layout;
}
EAPI void
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
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
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
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;
+}
+
+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;
- return sd->prediction_allow;
+ *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");
}
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
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");
}
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");
}
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
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;
+}
+
+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;
- return sd->input_panel_lang;
+ *ret = sd->input_panel_lang;
}
EAPI void
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);
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);
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;
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;
+}
+
+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;
- return sd->input_panel_return_key_type;
+ *ret = sd->input_panel_return_key_type;
}
EAPI void
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;
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
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);
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 */
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
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
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);
}
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;
+}
- return sd->anchor_hover.hover_style;
+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;
+
+ *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);
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 */
*/
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)
+
/**
* @}
*/
#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";
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)
{
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
_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)
{
(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;
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);
}
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;
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;
sl = sd->slices[nn];
if (!sl)
{
- sl = _slice_new(sd, front);
+ sl = _slice_new(obj, front);
sd->slices[nn] = sl;
}
_slice_xyz(sd, sl,
sl = sd->slices2[nn];
if (!sl)
{
- sl = _slice_new(sd, back);
+ sl = _slice_new(obj, back);
sd->slices2[nn] = sl;
}
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)
{
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)
{
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)
{
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);
}
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:
{
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:
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;
}
_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;
{
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:
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
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);
}
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
// 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);
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
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;
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
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;
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)
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
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)
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)
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);
+
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
*
*
* @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
#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) */
* 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)
{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;
}
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);
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);
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
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);
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
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);
}
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
{
_update_view(obj);
elm_layout_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
{
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);
{
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);
_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;
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static Eina_Bool
}
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));
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;
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;
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;
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)
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 *
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)
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
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;
}
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);
* @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
* @{
#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";
{SIG_CLICKED, ""},
{NULL, NULL}
};
+
static const Elm_Layout_Part_Alias_Description _content_aliases[] =
{
{"default", "elm.swallow.content"},
{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;
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
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);
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;
/* 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);
}
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
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;
}
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
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;
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;
}
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);
* @{
*/
+#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
*
#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
#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";
{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)
{
}
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;
{
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");
}
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");
}
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);
}
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;
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;
}
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)
}
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)
}
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)
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;
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)))
|| (_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")) &&
|| (_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;
|| (_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")) &&
|| (_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;
|| (_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")) &&
|| (_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;
|| (_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")) &&
|| (_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;
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)))
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)))
}
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")) ||
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)
{
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
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);
}
}
-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
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)
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
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;
/* 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);
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);
}
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
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;
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;
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;
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;
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;
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;
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);
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 *
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);
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 *
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));
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 *
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));
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 *
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)
{
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
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;
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);
}
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;
}
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
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);
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;
}
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
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
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
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
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
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
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
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
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
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
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
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;
}
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 *
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)
{
}
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
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)
{
}
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
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)
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 *
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;
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
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;
}
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
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);
+
* @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
* @{
#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
#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";
{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 *);
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;
}
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;
}
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)
{
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);
{
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;
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;
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)
{
}
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
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;
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;
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;
}
}
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;
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;
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
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;
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);
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)
_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
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)
}
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
}
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;
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));
(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)
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;
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)))
|| (_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;
|| (_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;
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)))
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)))
}
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")) ||
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'
* 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
* 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)
{
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))
{
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
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));
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
//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
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);
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));
}
}
}
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)
{
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;
_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;
_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)
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;
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
_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;
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");
}
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);
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;
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));
}
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;
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);
}
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
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)
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
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;
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 *
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)
{
it->item->before = EINA_FALSE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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)
{
it->item->before = EINA_TRUE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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)
{
it->item->before = EINA_FALSE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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)
{
it->item->before = EINA_TRUE;
_item_queue(sd, it, NULL);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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;
_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);
}
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;
}
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)
{
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
if (done) break;
}
}
- return list;
}
EAPI Elm_Object_Item *
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;
else *posret = 0;
}
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
+ return;
}
lasty = ity + it->item->h;
}
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);
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);
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)
{
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);
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
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
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;
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
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
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;
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;
}
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
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;
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
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;
}
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
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
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;
}
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);
}
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);
}
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;
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;
}
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
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;
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
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;
}
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
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;
}
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 *
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);
+
* - @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
* @{
#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
((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); \
}
#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
*
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;
}
}
-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 =
}
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);
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
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);
}
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
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;
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
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;
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)
sd->target = target;
_callbacks_register(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
EAPI void
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));
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);
*
*/
+#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.
#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";
{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)
{
(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;
_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)
{
// 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;
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;
}
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)
}
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)
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
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;
// 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
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:
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;
}
}
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
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;
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;
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;
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;
}
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;
}
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);
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);
+
*
*/
+#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
#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 */
}
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 */
}
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
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
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
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
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
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
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);
* @{
*/
+
+#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
*
#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))
{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__,
}
}
-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);
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;
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);
}
_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)
{
}
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
}
}
-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"))
{
}
}
- 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.");
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
}
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;
}
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;
_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");
}
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
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)
{
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);
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);
+
* @{
*/
+#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
*
#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;
{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
}
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;
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;
}
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);
}
/* 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);
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);
}
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
}
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;
}
#endif
- _elm_icon_parent_sc->sizing_eval(obj);
+ eo_do_super(obj, elm_obj_image_sizing_eval());
sd->in_eval--;
}
}
}
-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);
}
#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
Eina_Bool *fdo)
{
char *tmp;
- Eina_Bool ret;
+ Eina_Bool ret = EINA_FALSE;
ELM_ICON_DATA_GET(obj, sd);
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;
}
#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;
}
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);
_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 */
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
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;
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 */
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)
{
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 */
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
{
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
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
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);
}
#else
(void)obj;
+ (void)_pd;
(void)file;
(void)group;
#endif
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
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;
}
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
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);
* @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
* @{
#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";
{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__,
}
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;
}
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;
}
/* 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;
}
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;
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;
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;
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;
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;
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;
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;
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;
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
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);
}
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);
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);
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;
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);
}
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);
}
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;
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);
{
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);
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);
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);
}
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;
}
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;
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)
{
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
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
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;
}
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
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
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
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
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
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;
}
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
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
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
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
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
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
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;
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
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;
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);
* @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
* @{
#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";
{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)
{
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])
{
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])
{
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);
}
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);
}
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++)
{
}
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)
{
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)
}
_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");
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)
{
}
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;
}
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;
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
}
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)
{
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");
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
}
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
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;
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
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;
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
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 *
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 *
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 *
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 *
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 *
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)
}
_index_box_clear(obj, sd->bx[sd->level], sd->level);
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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)
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);
}
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;
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 *
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);
* @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
* @{
#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); \
{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)
{
}
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;
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;
}
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;
}
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;
}
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)
{
}
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)
}
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;
}
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
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); \
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
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;
{
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,
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;
(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
{
(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");
}
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))
(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");
}
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;
}
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;
}
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;
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;
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)
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);
{
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;
}
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)
}
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)
{
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;
}
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)
}
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)
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
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;
}
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;
(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;
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)
}
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;
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.
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;
* 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;
/* 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;
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;
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
{
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
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))
{
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));
}
}
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)
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))
{
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;
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;
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;
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);
_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;
}
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);
_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;
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;
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;
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
{
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)) ||
_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;
{
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)))
{
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)))
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)
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;
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:
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);
}
}
- 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;
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) ||
_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;
}
(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;
}
}
- _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;
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;
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;
}
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;
}
{
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;
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
}
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;
}
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");
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;
}
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;
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;
}
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)
{
}
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)
}
}
-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)
}
}
-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;
}
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;
}
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;
}
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;
}
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)
}
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;
}
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;
}
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)
}
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)
}
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))
}
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))
{
}
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));
_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)
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);
+
* 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;
/**
* 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
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
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__; \
}
#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[] =
{
};
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);
{
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);
}
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);
}
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);
+
* @{
*/
+#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
*
#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[] =
{
{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
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)
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);
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;
}
}
-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);
{
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));
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 *
}
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;
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);
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
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;
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);
}
}
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
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);
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;
(&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);
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
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;
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)));
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);
* @{
*/
+#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
*
#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[] = {
* 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;
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
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);
}
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
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
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
{
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);
}
}
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)
{
_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
_visuals_refresh(obj, sd);
- return ret;
+ if (ret) *ret = int_ret;
}
static void *
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;
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)
{
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)))
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
}
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;
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)
{
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;
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;
}
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)
{
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;
}
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);
_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)
{
{
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;
}
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);
_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)
{
{
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 */
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);
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);
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
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);
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);
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 *
((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))
{
}
}
-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;
{
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;
/* 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);
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 *
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))
{
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;
{
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;
/* 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
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;
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);
/* 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)
{
}
}
-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)
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
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
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 *
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
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 *
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 *
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
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 *
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
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
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
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
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 *
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
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
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 *
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
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 *
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
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);
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 *
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
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;
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
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 *
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
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
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;
-}
*
*/
+#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
*
#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";
{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)
{
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;
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")) ||
|| (_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;
|| (_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;
|| (_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;
|| (_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;
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))
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))
}
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
}
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;
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;
}
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)
sd->scr_minh = EINA_FALSE;
}
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ elm_layout_sizing_eval(wd->obj);
}
static inline void
}
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)
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);
}
}
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);
}
/* 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))
{
elm_widget_scroll_hold_pop(obj);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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));
_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;
}
end:
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
evas_object_raise(VIEW(it));
it->highlighted = EINA_TRUE;
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
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);
}
evas_object_smart_callback_call(WIDGET(it), SIG_UNSELECTED, it);
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
sd->swipe = EINA_FALSE;
sd->movements = 0;
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
_elm_list_item_free(item);
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
return EINA_TRUE;
}
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
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)
{
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);
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);
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");
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);
}
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;
}
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
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;
{
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
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;
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
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
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
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
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;
elm_widget_item_free(it);
}
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
_items_fix(obj);
elm_layout_sizing_eval(obj);
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 *
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);
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 *
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);
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 *
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 *
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 *
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);
elm_box_pack_before(sd->box, VIEW(it), VIEW(before));
}
- return (Elm_Object_Item *)it;
+ *ret = (Elm_Object_Item *)it;
}
EAPI void
else
_item_unselect(item);
- _elm_list_unwalk(sd);
+ _elm_list_unwalk(obj, sd);
evas_object_unref(obj);
}
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
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 *
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);
+
* @{
*/
+#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
#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
{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,
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);
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;
}
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);
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);
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;
}
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);
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);
_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
{
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");
}
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;
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");
}
}
_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;
}
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);
{
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
_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;
}
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
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
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
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;
}
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;
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;
}
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
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)
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
(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));
}
}
_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;
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
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;
}
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);
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);
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);
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);
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;
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);
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);
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)
_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");
}
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)
_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");
}
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)
_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);
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");
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;
}
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");
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;
}
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);
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
}
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;
}
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;
}
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;
}
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)))
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));
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);
}
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;
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);
}
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
}
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;
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)zoom;
#endif
}
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
}
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;
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)mode;
#endif
}
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
}
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
}
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
}
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
}
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
}
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;
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
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;
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
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
if (lat) *lat = tlat;
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
#endif
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;
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
}
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
}
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;
evas_object_smart_changed(sd->pan_obj);
#else
(void)obj;
+ (void)_pd;
(void)degree;
(void)cx;
(void)cy;
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;
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
sd->wheel_disabled = !!disabled;
#else
(void)obj;
+ (void)_pd;
(void)disabled;
#endif
}
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
}
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
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);
_coord_to_region_convert(sd, x, y, sd->size.w, lon, lat);
#else
(void)obj;
+ (void)_pd;
(void)x;
(void)y;
(void)lon;
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);
_coord_to_canvas(sd, *x, *y, x, y);
#else
(void)obj;
+ (void)_pd;
(void)lon;
(void)lat;
(void)x;
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);
eina_hash_set(sd->ua, "User-Agent", sd->user_agent);
#else
(void)obj;
+ (void)_pd;
(void)user_agent;
#endif
}
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
}
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);
#else
(void)obj;
(void)type;
+ (void)_pd;
(void)source_name;
#endif
}
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
}
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
}
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;
{
ERR("Route URL is NULL");
if (type_name) free(type_name);
- return NULL;
+ return;
}
if (type_name) free(type_name);
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;
(void)tlat;
(void)route_cb;
(void)data;
- return NULL;
#endif
}
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);
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
}
#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);
#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
#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;
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;
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;
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
}
#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)
{
#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
#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
#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
#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;
#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
#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);
#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
#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;
#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
#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
#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)
{
_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);
#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)
{
#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)
{
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);
#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)
{
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);
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)
{
#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;
#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)
{
#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;
#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;
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;
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
}
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;
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;
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;
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);
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);
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;
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
}
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;
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;
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;
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;
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
}
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;
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;
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
}
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;
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;
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
}
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;
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
}
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
* @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
* @{
#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)
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
_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)
{
_sizing_eval(obj);
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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)
_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))
{
}
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;
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;
_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
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;
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
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;
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
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;
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);
* @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
* @{
#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[] = {
{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)
{
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)
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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;
}
}
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);
}
}
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);
}
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);
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
_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)
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);
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
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;
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);
}
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);
_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
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);
}
_sizing_eval(obj);
- return (Elm_Object_Item *)subitem;
+ *ret = (Elm_Object_Item *)subitem;
}
EAPI const char *
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
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);
+
* @{
*/
+#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
*
#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";
{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)
{
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));
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
_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)
{
sd->content = NULL;
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
}
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);
}
}
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);
}
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);
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;
_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;
}
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);
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
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)
{
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)
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;
orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;
else
orient = ELM_NOTIFY_ORIENT_TOP;
- return orient;
+ *ret = orient;
}
EAPI void
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);
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
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;
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
*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);
#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
*
#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,
}
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);
}
_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)
{
{
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
}
}
-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
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
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)
{
}
}
- 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;
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);
}
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
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;
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
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;
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);
* @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 */
#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.
* 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";
{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);
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;
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)
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
}
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);
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
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
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
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
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);
}
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)
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);
* @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
* @{
#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";
{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)
{
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;
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;
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
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)
{
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
}
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);
(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
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;
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;
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);
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);
+
* @{
*/
+#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
*
#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):
* 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";
{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);
}
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;
{
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))
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
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));
}
}
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);
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);
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);
}
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;
}
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;
}
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)
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++)
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);
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);
}
}
}
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);
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;
_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);
}
}
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;
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;
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
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;
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)))
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")))
{
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) &&
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;
}
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;
}
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;
_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;
}
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;
_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;
}
_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)
}
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;
}
}
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));
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;
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);
}
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;
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);
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;
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;
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)
}
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)
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
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;
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)
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;
_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
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;
_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
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;
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
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
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
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;
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);
+
* @{
*/
+#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.
*/
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
*
#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";
{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__)
{
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
}
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;
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
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);
*
*/
+#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
* @{
#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";
{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"},
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);
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);
}
/* 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");
* 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 *
}
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;
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
}
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
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;
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;
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
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;
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
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);
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;
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
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;
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);
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);
+
* @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
#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[] =
{
{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)
{
/* 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
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);
}
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));
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
}
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
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)
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);
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
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;
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
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)
{
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);
* @{
*/
+#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
*
#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)
_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
#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);
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());
}
/**
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
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;
}
_sizing_eval(obj);
-}
-
+#else
+ (void)obj;
+ (void)_pd;
+ (void)_emap;
#endif
+}
EAPI void
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;
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);
* @{
*/
+#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
*
#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";
{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;
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")) ||
{
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)
{
elm_widget_focus_steal(new_focus);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
else
{
elm_widget_focus_steal(new_focus);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
}
}
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")) ||
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;
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)
{
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)
{
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))
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;
_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;
{
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
{
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
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)
{
sd->content = NULL;
}
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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;
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
}
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);
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 */
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
{
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
{
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
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
{
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
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
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
{
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
{
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
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
{
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
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
{
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
{
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
{
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
{
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
{
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
{
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
{
ELM_SCROLLABLE_CHECK(obj);
- s_iface->gravity_set(obj, x, y);
+ eo_do(obj, elm_scrollable_interface_gravity_set(x, y));
}
EAPI void
{
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);
* @{
*/
+#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.
*
#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[] = {
{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);
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;
else pos += sd->item_width;
}
- elm_layout_sizing_eval(ELM_WIDGET_DATA(sd)->obj);
+ elm_layout_sizing_eval(sd->obj);
}
static void
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");
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;
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");
}
}
-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);
_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,
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)))
{
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
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
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;
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");
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)
}
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));
}
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)
{
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;
}
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 *
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 *
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);
_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;
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 *
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 *
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
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
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);
*
*/
+#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
* @{
#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;
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
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);
* @{
*/
+#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
*
#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[] =
{
{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)
{
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;
(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
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
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
}
}
-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);
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;
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;
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;
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))
_slider_update(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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",
}
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) *
_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);
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);
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);
}
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);
}
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;
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);
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
}
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);
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
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;
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
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");
}
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
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);
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
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
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;
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;
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;
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
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;
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);
}
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
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;
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;
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)
{
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);
* @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
* @{
#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";
{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)))
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")) ||
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")) ||
}
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);
}
}
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;
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
}
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);
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 *
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;
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 *
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;
if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)item);
- return (Elm_Object_Item *)item;
+ *ret = (Elm_Object_Item *)item;
}
EAPI void
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);
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);
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
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);
}
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
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;
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
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;
}
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);
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;
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 *
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;
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
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;
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);
* @{
*/
+
+#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. */
#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";
{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)
{
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));
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
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;
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;
}
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
}
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") ||
_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)) ||
_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") ||
!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 *
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);
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;
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;
(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);
}
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);
}
}
- 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
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);
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
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;
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;
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;
}
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
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;
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
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;
}
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
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)
{
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;
}
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
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;
}
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
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;
}
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
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;
}
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);
* @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
* @{
#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 */
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 */
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
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);
_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));
(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
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
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
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
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
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
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;
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);
+
* @{
*/
+#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
*
#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";
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,
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
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);
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
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
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);
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())
{
#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);
}
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)
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)
}
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;
}
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)
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);
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);
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;
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;
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);
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 *
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);
+
* @{
*/
+#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
#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)
{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)
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
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);
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);
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
_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
}
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);
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)
{
_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
_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;
_sizing_eval(obj);
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
}
static void
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
}
}
- sd->s_iface->hold_set(obj, EINA_FALSE);
+ eo_do(obj, elm_scrollable_interface_hold_set(EINA_FALSE));
}
static void
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
_item_del(item);
if (item != sd->more_item)
- _elm_toolbar_smart_theme(obj);
+ eo_do(obj, elm_wdg_theme(NULL));
return EINA_TRUE;
}
}
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));
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;
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);
}
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;
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);
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)
{
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);
}
}
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
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;
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 *
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));
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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));
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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
_sizing_eval(obj);
sd->item_count++;
- return (Elm_Object_Item *)it;
+ if (ret) *ret = (Elm_Object_Item *)it;
}
EAPI Elm_Object_Item *
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
_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 *
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
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
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)
{
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);
}
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
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;
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;
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
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)
{
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
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;
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
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;
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
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;
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
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;
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
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
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);
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
*
#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_widget_layout.h"
#include "elm_widget_video.h"
#ifdef HAVE_EMOTION
/* 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)))
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if ((!strcmp(ev->keyname, "Right")) ||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
- return EINA_TRUE;
+ if (ret) *ret = EINA_TRUE;
+ return;
}
if (!strcmp(ev->keyname, "space"))
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;
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)
{
#else
(void) obj;
+ (void) _pd;
#endif
}
}
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);
(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);
(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
}
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;
sd->stop = EINA_FALSE;
emotion_object_play_set(sd->emotion, EINA_TRUE);
#else
- (void)obj;
+ (void) _pd;
#endif
}
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;
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
}
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;
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
}
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
}
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
}
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);
*/
/**
+ * 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
#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
#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>
" 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;
{ 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)
#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);
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
}
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)
{
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);
}
}
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;
}
_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;
}
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);
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;
}
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)
{
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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;
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
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;
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;
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;
}
}
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
}
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
}
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;
sd->zoom.current = 0.0;
elm_web_zoom_set(obj, tz);
#else
+ (void)obj;
+ (void)_pd;
(void)mode;
#endif
}
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
}
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;
}
ewk_frame_scroll_set(frame, rx, ry);
#else
+ (void)obj;
+ (void)_pd;
(void)x;
(void)y;
#endif
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;
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
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
}
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
}
// 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
* - @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
* @{
#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;
{ 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)
{
}
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
{
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
{
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
{
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
{
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
{
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
{
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
{
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
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
{
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
{
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
{
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
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
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
{
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
{
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
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
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
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
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
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
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
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
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
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
#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;
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
_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
}
}
-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;
-}
-
-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;
+ if (ret) *ret = EINA_TRUE;
}
-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__)
+static void
+_elm_widget_on_focus_region(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
- WRN("The %s widget does not implement the \"event\" 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_next_func_unimplemented(const Evas_Object *obj,
- Elm_Focus_Direction dir __UNUSED__,
- Evas_Object **next __UNUSED__)
-{
- WRN("The %s widget does not implement the \"focus_next\" function.",
- elm_widget_type_get(obj));
- return 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
}
}
-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);
}
{
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);
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;
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;
}
}
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)
}
if (abort_on_warn == 1) abort();
- return EINA_FALSE;
+ return;
}
if (_elm_widget_is(sobj))
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[] =
};
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
}
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)
{
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);
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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
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
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;
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;
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))
{
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;
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
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;
}
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;
}
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));
}
/**
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;
}
/**
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;
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;
}
/**
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;
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;
}
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
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;
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,
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;
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;
}
/**
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;
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;
}
/**
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)
{
}
}
}
- 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 */
}
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
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;
}
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;
}
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;
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
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;
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;
}
/**
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)
{
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;
}
/**
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)
{
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,
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;
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;
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);
(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
*
* @ingroup Widget
*/
+
EAPI Eina_Bool
elm_widget_focus_direction_get(const Evas_Object *obj,
const Evas_Object *base,
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) ||
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;
}
/**
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;
elm_widget_focus_direction_get(cur, base, degree, direction, weight);
}
if (current_best != *direction)
- return EINA_TRUE;
- else
- return EINA_FALSE;
+ *ret = EINA_TRUE;
}
/**
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);
}
/**
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)
else if (dir == ELM_FOCUS_NEXT)
list_next = eina_list_next;
else
- return EINA_FALSE;
+ return;
const Eina_List *l = items;
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;
if (tmp)
{
*next = tmp;
- return EINA_FALSE;
+ return;
}
}
*next = to_focus;
- return EINA_FALSE;
+ return;
}
EAPI void
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"))
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);
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);
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)
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;
{
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;
{
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;
{
if (elm_widget_focus_get(child))
{
- elm_widget_focused_object_clear(child);
+ eo_do(child, elm_wdg_focused_object_clear());
break;
}
}
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)
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
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));
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);
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;
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;
+}
+
+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 *);
- return sd->api->on_focus_region(obj, x, y, w, h);
+ 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;
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;
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;
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;
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)
+EAPI int
+elm_widget_scroll_freeze_get(const Evas_Object *obj)
+{
+ 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)
{
- API_ENTRY return 0;
- return sd->scroll_freeze;
+ 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)
{
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);
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);
}
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
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)
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
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)
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);
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);
}
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);
}
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);
}
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);
}
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);
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);
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
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
{
API_ENTRY return NULL;
- return evas_object_type_get(obj);
+ return eo_class_name_get(eo_class_get(obj));
}
EAPI Eina_Bool
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);
}
/**
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);
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
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
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;
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;
}
/**
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);
(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);
+
* @{
*/
-/**
- * @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
*/
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;
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); \
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()
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
+
#ifndef ELM_WIDGET_ACTIONSLIDER_H
#define ELM_WIDGET_ACTIONSLIDER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_BG_H
#define ELM_WIDGET_BG_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_BOX_H
#define ELM_WIDGET_BOX_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_BUBBLE_H
#define ELM_WIDGET_BUBBLE_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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.
typedef struct _Elm_Bubble_Smart_Data Elm_Bubble_Smart_Data;
struct _Elm_Bubble_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Elm_Bubble_Pos pos;
};
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_BUTTON_H
#define ELM_WIDGET_BUTTON_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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 */
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_CALENDAR_H
#define ELM_WIDGET_CALENDAR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
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;
* @}
*/
-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
#ifndef ELM_WIDGET_CHECK_H
#define ELM_WIDGET_CHECK_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
};
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_CLOCK_H
#define ELM_WIDGET_CLOCK_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
*/
/**
- * @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;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_COLORSELECTOR_H
#define ELM_WIDGET_COLORSELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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;
/**
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;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_CONFORMANT_H
#define ELM_WIDGET_CONFORMANT_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
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
* - 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
* 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;
/**
struct _Elm_Ctxpopup_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *parent;
Evas_Object *list;
Evas_Object *box;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_DATETIME_H
#define ELM_WIDGET_DATETIME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_DAYSELECTOR_H
#define ELM_WIDGET_DAYSELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_DISKSELECTOR_H
#define ELM_WIDGET_DISKSELECTOR_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
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;
* @}
*/
-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); \
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) \
#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
* 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;
/**
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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_FILESELECTOR_H
#define ELM_WIDGET_FILESELECTOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#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>
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_FLIP_H
#define ELM_WIDGET_FLIP_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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;
/**
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
* @}
*/
-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); \
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
*/
/**
- * @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
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); \
}
#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) \
#ifndef ELM_WIDGET_FRAME_H
#define ELM_WIDGET_FRAME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
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
#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
*/
/**
- * @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
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;
};
* @}
*/
-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); \
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) \
#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
#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
*/
/**
- * @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;
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
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;
};
* @}
*/
-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); \
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) \
#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
#ifndef ELM_WIDGET_GLVIEW_H
#define ELM_WIDGET_GLVIEW_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_GRID_H
#define ELM_WIDGET_GRID_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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
#ifndef ELM_WIDGET_HOVER_H
#define ELM_WIDGET_HOVER_H
+#include "Elementary.h"
#include "elm_widget_layout.h"
/**
*/
/**
- * @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;
struct _Elm_Hover_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *offset, *size;
Evas_Object *parent, *target;
* @}
*/
-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); \
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
#ifndef ELM_WIDGET_HOVERSEL_H
#define ELM_WIDGET_HOVERSEL_H
-#include "elm_widget_button.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
*/
/**
- * @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;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_ICON_H
#define ELM_WIDGET_ICON_H
-#include "elm_widget_image.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_IMAGE_H
#define ELM_WIDGET_IMAGE_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
* 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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_INDEX_H
#define ELM_WIDGET_INDEX_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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
/**
* @}
*/
-
-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); \
}
#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) \
#ifndef ELM_WIDGET_INWIN_H
#define ELM_WIDGET_INWIN_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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); \
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
#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;
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); \
}
#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
*/
/**
- * @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
};
/**
- * 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;
* @}
*/
-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
* 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
/**
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;
* @}
*/
-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); \
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) \
#ifndef ELM_WIDGET_MAP_H
#define ELM_WIDGET_MAP_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
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;
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;
};
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_MAPBUF_H
#define ELM_WIDGET_MAPBUF_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_MENU_H
#define ELM_WIDGET_MENU_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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;
* @}
*/
-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); \
}
#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) \
*/
/**
- * @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.
*/
Elm_Multibuttonentry_Smart_Data;
struct _Elm_Multibuttonentry_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
Evas_Object *box;
Evas_Object *entry;
Evas_Object *label;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_NAVIFRAME_H
#define ELM_WIDGET_NAVIFRAME_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_NOTIFY_H
#define ELM_WIDGET_NOTIFY_H
-#include "elm_widget_container.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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.
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;
* @}
*/
-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); \
}
#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
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_PANES_H
#define ELM_WIDGET_PANES_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_PHOTO_H
#define ELM_WIDGET_PHOTO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_PHOTOCAM_H
#define ELM_WIDGET_PHOTOCAM_H
-#include "elm_interface_scrollable.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
struct _Elm_Photocam_Grid_Item
{
+ Evas_Object *obj;
Elm_Photocam_Smart_Data *sd;
Evas_Object *img;
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;
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;
};
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_PLAYER_H
#define ELM_WIDGET_PLAYER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_PLUG_H
#define ELM_WIDGET_PLUG_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
* 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); \
}
#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
* 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;
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;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_PROGRESSBAR_H
#define ELM_WIDGET_PROGRESSBAR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_RADIO_H
#define ELM_WIDGET_RADIO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
struct _Elm_Radio_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
int value;
Eina_Bool state;
* @}
*/
-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); \
}
#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
*/
/**
- * @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;
struct _Elm_Route_Smart_Data
{
- Elm_Widget_Smart_Data base;
-
#ifdef ELM_EMAP
EMap_Route *emap;
#endif
* @}
*/
-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); \
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
#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
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_SEGMENT_CONTROL_H
#define ELM_WIDGET_SEGMENT_CONTROL_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
* 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.
*/
struct _Elm_Segment_Control_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
+ Evas_Object *obj;
Eina_List *items;
Elm_Segment_Item *selected_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); \
}
#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) \
#ifndef ELM_WIDGET_SEPARATOR_H
#define ELM_WIDGET_SEPARATOR_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
};
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_SLIDER_H
#define ELM_WIDGET_SLIDER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_SLIDESHOW_H
#define ELM_WIDGET_SLIDESHOW_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
struct _Elm_Slideshow_Smart_Data
{
- Elm_Layout_Smart_Data base;
-
// list of Elm_Slideshow_Item*
Eina_List *items;
Eina_List *items_built;
* @}
*/
-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); \
}
#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) \
#ifndef ELM_WIDGET_SPINNER_H
#define ELM_WIDGET_SPINNER_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
#ifdef HAVE_EIO
# include <Eio.h>
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
#ifndef ELM_WIDGET_TABLE_H
#define ELM_WIDGET_TABLE_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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
#ifndef ELM_WIDGET_THUMB_H
#define ELM_WIDGET_THUMB_H
+#include "Elementary.h"
+
/**
* @addtogroup Widget
* @{
*/
/**
- * @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 */
* @}
*/
-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); \
}
#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
* 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;
/**
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;
* @}
*/
-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); \
}
#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) \
#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
#ifndef ELM_WIDGET_VIDEO_H
#define ELM_WIDGET_VIDEO_H
-#include "elm_widget_layout.h"
+#include "Elementary.h"
/**
* @addtogroup Widget
*/
/**
- * @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;
* @}
*/
-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); \
}
#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
*/
/**
- * @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
{
* @}
*/
-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); \
}
#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
#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;
{ \
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); \
}
#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 : ""))
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*/
Eina_List *resize_objs; /* a window may have
* *multiple* resize
* objects */
+ Evas_Object *obj; /* The object itself */
#ifdef HAVE_ELEMENTARY_X
struct
{
{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;
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
/* { */
/* } */
- 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);
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);
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)
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))
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);
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--;
}
}
-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")) ||
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
}
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);
}
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);
}
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 */
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))
}
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)
{
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))
{
}
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)
{
EINA_SAFETY_ON_NULL_RETURN(sd);
- obj = ELM_WIDGET_DATA(sd)->obj;
+ obj = sd->obj;
int autodel = sd->autodel;
sd->autodel_clear = &autodel;
{
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();
{
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();
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)
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);
}
}
}
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;
if (!(sd = data)) return;
- win = ELM_WIDGET_DATA(sd)->obj;
+ win = sd->obj;
int autodel = sd->autodel;
sd->autodel_clear = &autodel;
_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
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);
{
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
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
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
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
}
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__)
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;
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) \
{
// 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 *
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);
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);
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);
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
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);
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);
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
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
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
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;
}
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);
}
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);
}
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);
}
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;
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
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
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
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
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)
{
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
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
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
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))
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;
}
}
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
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
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);
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
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);
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
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);
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
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);
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
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);
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
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);
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);
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;
}
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);
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;
}
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
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
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;
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;
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
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);
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
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
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
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);
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
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
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;
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
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;
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
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;
}
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
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);
}
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);
}
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);
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
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)
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
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);
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
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);
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
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);
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
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);
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);
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
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)
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
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;
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
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? */
{
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 *
{
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
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);
*
* @{
*/
+
+#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
*
@ELEMENTARY_ECORE_CON_CFLAGS@ \
@ELEMENTARY_ECORE_IMF_CFLAGS@ \
@ELEMENTARY_WAYLAND_CFLAGS@ \
+@ELEMENTARY_EMAP_CFLAGS@ \
@EVIL_CFLAGS@ \
@EIO_CFLAGS@ \
@EMOTION_CFLAGS@