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)
{
}
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
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);
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 {
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.]]
}
}
}