#define MY_CLASS EFL_UI_POPUP_CLASS
#define MY_CLASS_NAME "Efl.Ui.Popup"
-#define MY_CLASS_NAME_LEGACY "elm_popup"
static void
_bg_clicked_cb(void *data,
- Evas_Object *o EINA_UNUSED,
- const char *emission EINA_UNUSED,
- const char *source EINA_UNUSED)
+ Eo *o EINA_UNUSED,
+ const char *emission EINA_UNUSED,
+ const char *source EINA_UNUSED)
{
- Evas_Object *obj = data;
- efl_event_callback_legacy_call(obj, EFL_UI_POPUP_EVENT_BG_CLICKED, NULL);
+ Eo *obj = data;
+ efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BG_CLICKED, NULL);
}
EOLIAN static void
}
static void
-_calc_align(Evas_Object *obj)
+_calc_align(Eo *obj)
{
Efl_Ui_Popup_Data *pd = efl_data_scope_get(obj, MY_CLASS);
- Evas_Coord x, y, w, h;
- evas_object_geometry_get(pd->win_parent, &x, &y, &w, &h);
+ Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
- x = 0;
- y = 0;
+ efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(0, 0));
+ efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h));
- evas_object_move(pd->event_bg, x, y);
- evas_object_resize(pd->event_bg, w, h);
+ Eina_Rect o_geom = efl_gfx_geometry_get(obj);
Evas_Coord pw, ph;
- evas_object_geometry_get(obj, NULL, NULL, &pw, &ph);
+ pw = p_geom.w;
+ ph = p_geom.h;
+
+ Evas_Coord ow, oh;
+ ow = o_geom.w;
+ oh = o_geom.h;
switch (pd->align)
{
- case EFL_UI_POPUP_ALIGN_CENTER:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw ) / 2), y + ((h - ph) / 2)));
- break;
- case EFL_UI_POPUP_ALIGN_LEFT:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x, y + ((h - ph) / 2)));
- break;
- case EFL_UI_POPUP_ALIGN_RIGHT:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + (w - pw), ((h - ph) / 2)));
- break;
- case EFL_UI_POPUP_ALIGN_TOP:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw) / 2), y));
- break;
- case EFL_UI_POPUP_ALIGN_BOTTOM:
- efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw) / 2), y + (h - ph)));
- break;
- default:
- break;
+ case EFL_UI_POPUP_ALIGN_CENTER:
+ efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow ) / 2, (ph - oh) / 2));
+ break;
+ case EFL_UI_POPUP_ALIGN_LEFT:
+ efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(0, (ph - oh) / 2));
+ break;
+ case EFL_UI_POPUP_ALIGN_RIGHT:
+ efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(pw - ow, (ph - oh) / 2));
+ break;
+ case EFL_UI_POPUP_ALIGN_TOP:
+ efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, 0));
+ break;
+ case EFL_UI_POPUP_ALIGN_BOTTOM:
+ efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, ph - oh));
+ break;
+ default:
+ break;
}
}
}
EOLIAN static void
-_efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED)
+_efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent EINA_UNUSED)
{
- Evas_Coord x, y, w, h;
pd->win_parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
if (!pd->win_parent)
{
return;
}
- evas_object_geometry_get(pd->win_parent, &x, &y, &w, &h);
- evas_object_move(pd->event_bg, x, y);
- evas_object_resize(pd->event_bg, w, h);
+ Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
+
+ efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(p_geom.x, p_geom.y));
+ efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h));
efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
}
EOLIAN static Eina_Bool
-_efl_ui_popup_efl_container_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Evas_Object *content)
+_efl_ui_popup_efl_container_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *content)
{
return efl_content_set(efl_part(obj, "elm.swallow.content"), content);
}
-EOLIAN static Evas_Object*
+EOLIAN static Eo*
_efl_ui_popup_efl_container_content_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
{
return efl_content_get(efl_part(obj, "elm.swallow.content"));
}
-EOLIAN static Evas_Object*
+EOLIAN static Eo*
_efl_ui_popup_efl_container_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
{
return efl_content_unset(efl_part(obj, "elm.swallow.content"));
static Eina_Bool
_timer_cb(void *data)
{
- Evas_Object *popup = data;
- evas_object_del(popup);
+ Eo *popup = data;
+ efl_del(popup);
return ECORE_CALLBACK_CANCEL;
}
EOLIAN static void
_efl_ui_popup_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Data *pd)
{
- ELM_SAFE_FREE(pd->event_bg, evas_object_del);
+ ELM_SAFE_DEL(pd->event_bg);
efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (wd->resize_obj, &minw, &minh, minw, minh);
- evas_object_size_hint_min_set(obj, minw, minh);
-
- Evas_Coord w, h;
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
-
- if ((minw > w) && (minh < h))
- evas_object_resize(obj, minw, h);
- else if ((minw < w) && (minh > h))
- evas_object_resize(obj, w, minh);
- else if ((minw >= w) && (minh >= h))
- evas_object_resize(obj, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
+
+ Eina_Size2D size = efl_gfx_size_get(obj);
+
+ Eina_Size2D new_size;
+ new_size.w = (minw > size.w ? minw : size.w);
+ new_size.h = (minh > size.h ? minh : size.h);
+ efl_gfx_size_set(obj, new_size);
}
EOLIAN static void
_efl_ui_popup_bg_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const char* group)
{
- Evas_Object *prev_obj = edje_object_part_swallow_get(pd->event_bg, "elm.swallow.image");
+ Eo *prev_obj = edje_object_part_swallow_get(pd->event_bg, "elm.swallow.image");
if (prev_obj)
- {
- edje_object_part_unswallow(pd->event_bg, prev_obj);
- evas_object_del(prev_obj);
- }
+ {
+ edje_object_part_unswallow(pd->event_bg, prev_obj);
+ efl_del(prev_obj);
+ }
- Evas_Object *image = elm_image_add(obj);
+ Eo *image = elm_image_add(obj);
Eina_Bool ret = elm_image_file_set(image, file, group);
if (!ret)
- {
- edje_object_signal_emit(pd->event_bg, "elm,state,image,hidden", "elm");
- evas_object_del(image);
- return;
- }
+ {
+ edje_object_signal_emit(pd->event_bg, "elm,state,image,hidden", "elm");
+ efl_del(image);
+ return;
+ }
edje_object_part_swallow(pd->event_bg, "elm.swallow.image", image);
edje_object_signal_emit(pd->event_bg, "elm,state,image,visible", "elm");
}
{
pd->bg_repeat_events = repeat;
- evas_object_repeat_events_set(pd->event_bg, repeat);
+ efl_canvas_object_repeat_events_set(pd->event_bg, repeat);
}
EOLIAN static Eina_Bool
_efl_ui_popup_bg_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
{
- return pd->bg_repeat_events;
-}
-
-EOLIAN static void
-_efl_ui_popup_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
+ return pd->bg_repeat_events;
}
/* Internal EO APIs and hidden overrides */
}
}
implements {
- class.constructor;
Efl.Gfx.position { set; }
Efl.Gfx.visible { set; }
Elm.Widget.widget_parent { set; }
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (wd->resize_obj, &minw, &minh, minw, minh);
- evas_object_size_hint_min_set(obj, minw, minh);
-
- Evas_Coord w, h;
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
}
static Eina_Bool
}
static Eina_Bool
-_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part, Evas_Object *content)
+_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part, Eo *content)
{
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
}
-Evas_Object *
+Eo *
_efl_ui_popup_alert_content_get(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
{
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
}
-static Evas_Object *
+static Eo *
_efl_ui_popup_alert_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
{
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
}
static void
-_positive_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
+_positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- Eo *popup_obj = data;
- efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE);
+ Eo *popup_obj = data;
+ efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE);
}
static void
-_negative_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
+_negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Eo *popup_obj = data;
}
static void
-_user_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
+_user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Eo *popup_obj = data;
{
if (pd->button[type])
{
- evas_object_del(pd->button[type]);
+ efl_del(pd->button[type]);
pd->button[type] = NULL;
}
pd->button[type] = elm_button_add(obj);
switch (type)
{
- case EFL_UI_POPUP_ALERT_BUTTON_POSITIVE:
- evas_object_smart_callback_add(pd->button[type], "clicked",
- _positive_button_clicked_cb,
- obj);
- break;
- case EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE:
- evas_object_smart_callback_add(pd->button[type], "clicked",
- _negative_button_clicked_cb,
- obj);
- break;
- case EFL_UI_POPUP_ALERT_BUTTON_USER:
- evas_object_smart_callback_add(pd->button[type], "clicked",
- _user_button_clicked_cb,
- obj);
- break;
- default:
- break;
+ case EFL_UI_POPUP_ALERT_BUTTON_POSITIVE:
+ evas_object_smart_callback_add(pd->button[type], "clicked",
+ _positive_button_clicked_cb,
+ obj);
+ break;
+ case EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE:
+ evas_object_smart_callback_add(pd->button[type], "clicked",
+ _negative_button_clicked_cb,
+ obj);
+ break;
+ case EFL_UI_POPUP_ALERT_BUTTON_USER:
+ evas_object_smart_callback_add(pd->button[type], "clicked",
+ _user_button_clicked_cb,
+ obj);
+ break;
+ default:
+ break;
}
- Evas_Object * cur_content = efl_content_unset(efl_part(obj, "buttons"));
+ Eo *cur_content = efl_content_unset(efl_part(obj, "buttons"));
if (cur_content)
{
efl_content_unset(efl_part(cur_content, "elm.swallow.button1"));
efl_content_unset(efl_part(cur_content, "elm.swallow.button2"));
efl_content_unset(efl_part(cur_content, "elm.swallow.button3"));
- evas_object_del(cur_content);
+ efl_del(cur_content);
}
if (pd->button[EFL_UI_POPUP_ALERT_BUTTON_POSITIVE]
efl_content_set(efl_part(obj, "buttons"), pd->button_layout[EFL_UI_POPUP_ALERT_BUTTON_1]);
}
- elm_layout_signal_emit(obj, "elm,buttons,show", "elm");
- elm_layout_sizing_eval(obj);
+ elm_layout_signal_emit(obj, "elm,buttons,show", "elm");
+ elm_layout_sizing_eval(obj);
}
EOLIAN static void
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EOLIAN static void
-_efl_ui_popup_alert_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
-}
-
/* Efl.Part begin */
ELM_PART_OVERRIDE(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
}
}
implements {
- class.constructor;
Efl.Part.part;
}
events {
#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll"
static void
-_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Evas_Coord minw, Evas_Coord minh)
+_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D min)
{
- Evas_Coord w, h;
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ Eina_Rect geom = efl_gfx_geometry_get(obj);
pd->is_sizing_eval = EINA_TRUE;
if (pd->is_expandable_w && !pd->is_expandable_h)
{
- if ((pd->max_scroll_w > -1) && (minw > pd->max_scroll_w))
+ if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- evas_object_resize(obj, pd->max_scroll_w, h);
+ efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
}
}
else if (!pd->is_expandable_w && pd->is_expandable_h)
{
- if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
+ if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
{
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- evas_object_resize(obj, w, pd->max_scroll_h);
+ efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
}
- }
+ }
else if (pd->is_expandable_w && pd->is_expandable_h)
- {
- Eina_Bool wdir, hdir;
- wdir = hdir = EINA_FALSE;
-
- if ((pd->max_scroll_w > -1) && (minw > pd->max_scroll_w))
- wdir = 1;
- if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
- hdir = 1;
- if (wdir && !hdir)
- {
- elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
- evas_object_resize(obj, pd->max_scroll_w, h);
- }
- else if (!wdir && hdir)
- {
+ {
+ Eina_Bool wdir, hdir;
+ wdir = hdir = EINA_FALSE;
+
+ if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
+ wdir = 1;
+ if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
+ hdir = 1;
+ if (wdir && !hdir)
+ {
+ elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
+ efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
+ }
+ else if (!wdir && hdir)
+ {
elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
- evas_object_resize(obj, w, pd->max_scroll_h);
- }
- else if(wdir && hdir)
- {
+ efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
+ }
+ else if(wdir && hdir)
+ {
elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- evas_object_resize(obj, pd->max_scroll_w, pd->max_scroll_h);
- }
+ efl_gfx_size_set(obj, pd->max_scroll);
+ }
}
pd->is_sizing_eval = EINA_FALSE;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc
- (wd->resize_obj, &minw, &minh, minw, minh);
- evas_object_size_hint_min_set(obj, minw, minh);
+ (wd->resize_obj, &minw, &minh, minw, minh);
+ efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
- _scroller_sizing_eval(obj, pd, minw, minh);
+ _scroller_sizing_eval(obj, pd, EINA_SIZE2D(minw, minh));
}
static Eina_Bool
-_efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part, Evas_Object *content)
+_efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part, Eo *content)
{
//For efl_content_set()
if (part && !strcmp(part, "elm.swallow.content"))
pd->content = content;
//Content should have expand propeties since the scroller is not layout layer
- evas_object_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ efl_gfx_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ efl_gfx_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL);
efl_content_set(efl_part(pd->scroller, "default"), pd->content);
}
return EINA_TRUE;
}
-Evas_Object *
+Eo *
_efl_ui_popup_alert_scroll_content_get(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
{
//For efl_content_set()
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
}
-static Evas_Object *
+static Eo *
_efl_ui_popup_alert_scroll_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
{
//For efl_content_set()
if (part && !strcmp(part, "elm.swallow.content"))
{
- Evas_Object *content = pd->content;
+ Eo *content = pd->content;
if (!content) return content;
pd->content = NULL;
_efl_ui_popup_alert_scroll_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D size)
{
efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), size);
- pd->max_scroll_w = size.w;
- pd->max_scroll_h = size.h;
+ pd->max_scroll = size;
elm_layout_sizing_eval(obj);
}
efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), pd->scroller);
- pd->max_scroll_w = -1;
- pd->max_scroll_h = -1;
+ pd->max_scroll = EINA_SIZE2D(-1, -1);
}
EOLIAN static void
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EOLIAN static void
-_efl_ui_popup_alert_scroll_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
-}
-
/* Efl.Part begin */
ELM_PART_OVERRIDE(efl_ui_popup_alert_scroll, EFL_UI_POPUP_ALERT_SCROLL, Efl_Ui_Popup_Alert_Scroll_Data)
}
}
implements {
- class.constructor;
Efl.Gfx.Size.Hint.hint_max { set; }
Efl.Part.part;
}
typedef struct _Efl_Ui_Popup_Alert_Scroll_Data Efl_Ui_Popup_Alert_Scroll_Data;
struct _Efl_Ui_Popup_Alert_Scroll_Data
{
- Evas_Object *scroller;
- Evas_Object *content;
- Evas_Coord max_scroll_w;
- Evas_Coord max_scroll_h;
- Eina_Bool is_expandable_w;
- Eina_Bool is_expandable_h;
- Eina_Bool is_sizing_eval;
+ Eo *scroller;
+ Eo *content;
+ Eina_Size2D max_scroll;
+ Eina_Bool is_expandable_w : 1;
+ Eina_Bool is_expandable_h : 1;
+ Eina_Bool is_sizing_eval : 1;
};
#endif
static void
_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Evas_Coord minh)
{
- Evas_Coord w, h;
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ Eina_Rect geom = efl_gfx_geometry_get(obj);
if (pd->is_expandable_h)
{
- if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
- {
- elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
- evas_object_resize(obj, w, pd->max_scroll_h);
- }
+ if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
+ {
+ elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
+ efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll_h));
+ }
}
}
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, minw, minh);
- evas_object_size_hint_min_set(obj, minw, minh);
+ efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
_scroller_sizing_eval(obj, pd, minh);
}
static Eina_Bool
-_efl_ui_popup_alert_text_content_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part, Evas_Object *content)
+_efl_ui_popup_alert_text_content_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part, Eo *content)
{
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
}
-Evas_Object *
+Eo *
_efl_ui_popup_alert_text_content_get(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part)
{
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
}
-static Evas_Object *
+static Eo *
_efl_ui_popup_alert_text_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part)
{
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
{
pd->message = elm_label_add(obj);
elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED);
- evas_object_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ efl_gfx_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
efl_content_set(efl_part(pd->scroller, "default"), pd->message);
}
elm_object_text_set(pd->message, label);
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EOLIAN static void
-_efl_ui_popup_alert_text_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
-}
-
/* Efl.Part begin */
ELM_PART_OVERRIDE(efl_ui_popup_alert_text, EFL_UI_POPUP_ALERT_TEXT, Efl_Ui_Popup_Alert_Text_Data)
}
}
implements {
- class.constructor;
Efl.Gfx.Size.Hint.hint_max { set;}
Efl.Text.text { get; set; }
Efl.Part.part;
typedef struct _Efl_Ui_Popup_Alert_Text_Data Efl_Ui_Popup_Alert_Text_Data;
struct _Efl_Ui_Popup_Alert_Text_Data
{
- Evas_Object *scroller;
- Evas_Object *message;
+ Eo *scroller;
+ Eo *message;
Evas_Coord max_scroll_h;
- Eina_Bool is_expandable_h;
+ Eina_Bool is_expandable_h : 1;
};
#endif
#define MY_CLASS_NAME "Efl.Ui.Popup.Anchor"
static void
-_anchor_calc(Evas_Object *obj)
+_anchor_calc(Eo *obj)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd);
- Evas_Coord_Rectangle anchor_geom = {0, 0, 0, 0};
- Evas_Coord_Size popup_size = {0, 0};
- Evas_Coord_Size parent_size = {0, 0};
Eina_Position2D pos = {0, 0};
- Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
+ Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
if (!parent)
{
ERR("Cannot find window parent");
return;
}
- evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h);
- evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h);
- evas_object_geometry_get(parent, NULL, NULL, &parent_size.w, &parent_size.h);
+ Eina_Rect a_geom = efl_gfx_geometry_get(sd->anchor);
+ Eina_Rect o_geom = efl_gfx_geometry_get(obj);
+ Eina_Rect p_geom = efl_gfx_geometry_get(parent);
sd->used_align = EFL_UI_POPUP_ALIGN_NONE;
switch(cur_align)
{
- case EFL_UI_POPUP_ALIGN_TOP:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = (anchor_geom.y - popup_size.h);
-
- if ((pos.y < 0) ||
- ((pos.y + popup_size.h) > parent_size.h) ||
- (popup_size.w > parent_size.w))
- continue;
- break;
-
- case EFL_UI_POPUP_ALIGN_LEFT:
- pos.x = (anchor_geom.x - popup_size.w);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
-
- if ((pos.x < 0) ||
- ((pos.x + popup_size.w) > parent_size.w) ||
- (popup_size.h > parent_size.h))
- continue;
- break;
-
- case EFL_UI_POPUP_ALIGN_RIGHT:
- pos.x = (anchor_geom.x + anchor_geom.w);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
-
- if ((pos.x < 0) ||
- ((pos.x + popup_size.w) > parent_size.w) ||
- (popup_size.h > parent_size.h))
- continue;
- break;
-
- case EFL_UI_POPUP_ALIGN_BOTTOM:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = (anchor_geom.y + anchor_geom.h);
-
- if ((pos.y < 0) ||
- ((pos.y + popup_size.h) > parent_size.h) ||
- (popup_size.w > parent_size.w))
- continue;
- break;
-
- case EFL_UI_POPUP_ALIGN_CENTER:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
-
- if (popup_size.w > parent_size.w || popup_size.h > parent_size.h)
- continue;
- break;
-
- default:
- continue;
+ case EFL_UI_POPUP_ALIGN_TOP:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = (a_geom.y - o_geom.h);
+
+ if ((pos.y < 0) ||
+ ((pos.y + o_geom.h) > p_geom.h) ||
+ (o_geom.w > p_geom.w))
+ continue;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_LEFT:
+ pos.x = (a_geom.x - o_geom.w);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+
+ if ((pos.x < 0) ||
+ ((pos.x + o_geom.w) > p_geom.w) ||
+ (o_geom.h > p_geom.h))
+ continue;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_RIGHT:
+ pos.x = (a_geom.x + a_geom.w);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+
+ if ((pos.x < 0) ||
+ ((pos.x + o_geom.w) > p_geom.w) ||
+ (o_geom.h > p_geom.h))
+ continue;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_BOTTOM:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = (a_geom.y + a_geom.h);
+
+ if ((pos.y < 0) ||
+ ((pos.y + o_geom.h) > p_geom.h) ||
+ (o_geom.w > p_geom.w))
+ continue;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_CENTER:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+
+ if ((o_geom.w > p_geom.w) || (o_geom.h > p_geom.h))
+ continue;
+ break;
+
+ default:
+ continue;
}
if ((cur_align == EFL_UI_POPUP_ALIGN_TOP) ||
{
if (pos.x < 0)
pos.x = 0;
- if ((pos.x + popup_size.w) > parent_size.w)
- pos.x = parent_size.w - popup_size.w;
+ if ((pos.x + o_geom.w) > p_geom.w)
+ pos.x = p_geom.w - o_geom.w;
- if ((pos.x > (anchor_geom.x + anchor_geom.w)) ||
- ((pos.x + popup_size.w) < anchor_geom.x))
+ if ((pos.x > (a_geom.x + a_geom.w)) ||
+ ((pos.x + o_geom.w) < a_geom.x))
continue;
}
{
if (pos.y < 0)
pos.y = 0;
- if ((pos.y + popup_size.h) > parent_size.h)
- pos.y = parent_size.h - popup_size.h;
+ if ((pos.y + o_geom.h) > p_geom.h)
+ pos.y = p_geom.h - o_geom.h;
- if ((pos.y > (anchor_geom.y + anchor_geom.h)) ||
- ((pos.y + popup_size.h) < anchor_geom.y))
+ if ((pos.y > (a_geom.y + a_geom.h)) ||
+ ((pos.y + o_geom.h) < a_geom.y))
continue;
}
for (int idx = 0; idx < 6; idx++)
{
- Efl_Ui_Popup_Align cur_align;
-
- if (idx == 0)
- cur_align = sd->align;
- else
- cur_align = sd->priority[idx - 1];
-
- if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
- continue;
-
- switch(cur_align)
- {
- case EFL_UI_POPUP_ALIGN_TOP:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = (anchor_geom.y - popup_size.h);
- sd->used_align = cur_align;
- goto end;
- break;
-
- case EFL_UI_POPUP_ALIGN_LEFT:
- pos.x = (anchor_geom.x - popup_size.w);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
- sd->used_align = cur_align;
- goto end;
- break;
-
- case EFL_UI_POPUP_ALIGN_RIGHT:
- pos.x = (anchor_geom.x + anchor_geom.w);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
- sd->used_align = cur_align;
- goto end;
- break;
-
- case EFL_UI_POPUP_ALIGN_BOTTOM:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = (anchor_geom.y + anchor_geom.h);
- sd->used_align = cur_align;
- goto end;
- break;
-
- case EFL_UI_POPUP_ALIGN_CENTER:
- pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2);
- pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2);
- sd->used_align = cur_align;
- goto end;
- break;
-
- default:
- break;
- }
+ Efl_Ui_Popup_Align cur_align;
+
+ if (idx == 0)
+ cur_align = sd->align;
+ else
+ cur_align = sd->priority[idx - 1];
+
+ if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
+ continue;
+
+ switch(cur_align)
+ {
+ case EFL_UI_POPUP_ALIGN_TOP:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = (a_geom.y - o_geom.h);
+ sd->used_align = cur_align;
+ goto end;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_LEFT:
+ pos.x = (a_geom.x - o_geom.w);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+ sd->used_align = cur_align;
+ goto end;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_RIGHT:
+ pos.x = (a_geom.x + a_geom.w);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+ sd->used_align = cur_align;
+ goto end;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_BOTTOM:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = (a_geom.y + a_geom.h);
+ sd->used_align = cur_align;
+ goto end;
+ break;
+
+ case EFL_UI_POPUP_ALIGN_CENTER:
+ pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
+ pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
+ sd->used_align = cur_align;
+ goto end;
+ break;
+
+ default:
+ break;
+ }
}
end:
{
EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd);
- Evas_Object *parent = efl_provider_find(data, EFL_UI_WIN_CLASS);
+ Eo *parent = efl_provider_find(data, EFL_UI_WIN_CLASS);
if (!parent)
{
ERR("Cannot find window parent");
}
static void
-_anchor_detach(Evas_Object *obj)
+_anchor_detach(Eo *obj)
{
EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd);
if (sd->anchor == NULL) return;
- Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
+ Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
if (!parent)
{
ERR("Cannot find window parent");
}
EOLIAN static void
-_efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Evas_Object *anchor)
+_efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eo *anchor)
{
_anchor_detach(obj);
pd->anchor = anchor;
if (anchor == NULL)
- efl_ui_popup_align_set(efl_super(obj, MY_CLASS), pd->align);
+ efl_ui_popup_align_set(efl_super(obj, MY_CLASS), pd->align);
else
{
efl_ui_popup_align_set(efl_super(obj, MY_CLASS), EFL_UI_POPUP_ALIGN_NONE);
_anchor_calc(obj);
- Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
+ Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
if (!parent)
{
ERR("Cannot find window parent");
{
pd->align = type;
if (pd->anchor == NULL)
- efl_ui_popup_align_set(efl_super(obj, MY_CLASS), type);
+ efl_ui_popup_align_set(efl_super(obj, MY_CLASS), type);
else
- _anchor_calc(obj);
+ _anchor_calc(obj);
}
EOLIAN static Efl_Ui_Popup_Align
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
-EOLIAN static void
-_efl_ui_popup_anchor_class_constructor(Efl_Class *klass)
-{
- evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
-}
-
#define EFL_UI_POPUP_ANCHOR_EXTRA_OPS \
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_anchor), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_anchor)
}
}
implements {
- class.constructor;
Efl.Gfx.position { set; }
Efl.Ui.Popup.align { set; get; }
}
typedef struct _Efl_Ui_Popup_Anchor_Data Efl_Ui_Popup_Anchor_Data;
struct _Efl_Ui_Popup_Anchor_Data
{
- Evas_Object *anchor;
+ Eo *anchor;
Efl_Ui_Popup_Align align;
Efl_Ui_Popup_Align priority[5];
Efl_Ui_Popup_Align used_align;
typedef struct _Efl_Ui_Popup_Data Efl_Ui_Popup_Data;
struct _Efl_Ui_Popup_Data
{
- Evas_Object *win_parent;
- Evas_Object *event_bg;
+ Eo *win_parent;
+ Eo *event_bg;
Efl_Ui_Popup_Align align;
- Ecore_Timer *timer;
- double timeout;
- Eina_Bool bg_repeat_events : 1;
+ Ecore_Timer *timer;
+ double timeout;
+ Eina_Bool bg_repeat_events : 1;
};
#endif