summaryrefslogtreecommitdiff
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
parent74290355dab1efc80ced19e932e41fa29f7ae70b (diff)
downloadefl-cfe8170624c51761932b48fd6bb57f1c52dcff93.tar.gz
win: Fixup doc & code of icon_object
Ref T5322
-rw-r--r--src/lib/elementary/efl_ui_win.c27
-rw-r--r--src/lib/elementary/efl_ui_win.eo19
2 files changed, 23 insertions, 23 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);
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index f53b611248..c2950d3603 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -364,20 +364,12 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
used, and the image pixels will be used as-is when this
function is called. If the image object has been updated,
then call this function again to source the image pixels
- and put them on the window's icon. Note that only Evas
- image objects are allowed.
+ and put them on the window's icon. Note that only objects of
+ type @Efl.Canvas.Image or @Efl.Ui.Image are allowed.
]]
- /* FIXME-doc
- Example of usage:
- @code
- icon = evas_object_image_add(evas_object_evas_get(elm_window));
- evas_object_image_file_set(icon, "/path/to/the/icon", NULL);
- elm_win_icon_object_set(elm_window, icon);
- evas_object_show(icon);
- @endcode
- */
values {
- icon: Efl.Canvas.Object @nullable; [[The Evas image object to use for an icon.]]
+ icon: own(Efl.Canvas.Object) @nullable;
+ [[The image object to use for an icon.]]
}
}
get {
@@ -387,7 +379,8 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
the object to use for the window icon.
]]
values {
- icon: const(Efl.Canvas.Object) @nullable; [[The Evas image object to use for an icon.]]
+ icon: const(Efl.Canvas.Object) @nullable;
+ [[The Evas image object to use for an icon.]]
}
}
}