aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-31 18:32:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-01 10:09:37 +0900
commitcfe8170624c51761932b48fd6bb57f1c52dcff93 (patch)
treeb3a2954b5ae38ffda91e21a43d572beed1da5735 /src/lib/elementary/efl_ui_win.c
parentwin: Use array for available_profiles (EO) (diff)
downloadefl-cfe8170624c51761932b48fd6bb57f1c52dcff93.tar.gz
win: Fixup doc & code of icon_object
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 9df4c7245a..b06bdaafdc 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3282,6 +3282,8 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
image = sd->icon;
+ else if (efl_isa(sd->icon, EFL_UI_IMAGE_CLASS))
+ image = elm_image_object_get(sd->icon);
if (image)
{
@@ -4535,14 +4537,11 @@ _win_inlined_image_set(Efl_Ui_Win_Data *sd)
}
static void
-_elm_win_on_icon_del(void *data,
- Evas *e EINA_UNUSED,
- Evas_Object *obj,
- void *event_info EINA_UNUSED)
+_elm_win_on_icon_del(void *data, const Efl_Event *ev)
{
ELM_WIN_DATA_GET(data, sd);
- if (sd->icon == obj) sd->icon = NULL;
+ if (sd->icon == ev->object) sd->icon = NULL;
}
EOLIAN static void
@@ -5489,15 +5488,23 @@ _efl_ui_win_role_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
EOLIAN static void
_efl_ui_win_icon_object_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *icon)
{
+ if (icon && (!efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS) &&
+ !efl_isa(sd->icon, EFL_UI_IMAGE_CLASS)))
+ {
+ ERR("Icon object type is not supported!");
+ efl_del(icon);
+ return;
+ }
+
if (sd->icon)
- evas_object_event_callback_del_full(sd->icon, EVAS_CALLBACK_DEL,
- _elm_win_on_icon_del, obj);
- evas_object_del(sd->icon);
+ {
+ efl_event_callback_del(sd->icon, EFL_EVENT_DEL, _elm_win_on_icon_del, obj);
+ efl_del(sd->icon);
+ }
sd->icon = icon;
if (sd->icon)
{
- evas_object_event_callback_add(sd->icon, EVAS_CALLBACK_DEL,
- _elm_win_on_icon_del, obj);
+ efl_event_callback_add(sd->icon, EFL_EVENT_DEL, _elm_win_on_icon_del, obj);
if (sd->frame_obj)
{
edje_object_part_swallow(sd->frame_obj, "elm.swallow.icon", sd->icon);