forked from enlightenment/efl
Elm_icon: move thumb_set API from eo to legacy.
This commit is contained in:
parent
02a37da0ed
commit
44d6506b8a
|
@ -706,33 +706,6 @@ elm_icon_file_get(const Evas_Object *obj,
|
|||
elm_image_file_get(obj, file, group);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_icon_thumb_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const char *group)
|
||||
{
|
||||
evas_object_event_callback_del_full
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj);
|
||||
evas_object_event_callback_del_full
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
|
||||
|
||||
evas_object_event_callback_add
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
|
||||
|
||||
eina_stringshare_replace(&sd->thumb.file.path, file);
|
||||
eina_stringshare_replace(&sd->thumb.file.key, group);
|
||||
|
||||
if (elm_thumb_ethumb_client_connected_get())
|
||||
{
|
||||
_icon_thumb_apply(sd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sd->thumb.eeh)
|
||||
{
|
||||
sd->thumb.eeh = ecore_event_handler_add
|
||||
(ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_icon_animated_available_get(const Evas_Object *obj)
|
||||
{
|
||||
|
@ -951,4 +924,34 @@ _elm_icon_class_constructor(Eo_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group)
|
||||
{
|
||||
ELM_ICON_CHECK(obj);
|
||||
ELM_ICON_DATA_GET(obj, sd)
|
||||
|
||||
evas_object_event_callback_del_full
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj);
|
||||
evas_object_event_callback_del_full
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
|
||||
|
||||
evas_object_event_callback_add
|
||||
(obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
|
||||
|
||||
eina_stringshare_replace(&sd->thumb.file.path, file);
|
||||
eina_stringshare_replace(&sd->thumb.file.key, group);
|
||||
|
||||
if (elm_thumb_ethumb_client_connected_get())
|
||||
{
|
||||
_icon_thumb_apply(sd);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sd->thumb.eeh)
|
||||
{
|
||||
sd->thumb.eeh = ecore_event_handler_add
|
||||
(ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj);
|
||||
}
|
||||
}
|
||||
|
||||
#include "elm_icon.eo.c"
|
||||
|
|
|
@ -79,24 +79,6 @@ class Elm.Icon (Elm.Image)
|
|||
name: const(char)*; [[The icon name]]
|
||||
}
|
||||
}
|
||||
@property thumb {
|
||||
set {
|
||||
[[Set the file that will be used, but use a generated thumbnail.
|
||||
|
||||
This functions like elm_image_file_set() but requires the Ethumb
|
||||
library support to be enabled successfully with $elm_need_ethumb.
|
||||
When set the file indicated has a thumbnail generated and cached
|
||||
on disk for future use or will directly use an existing cached
|
||||
thumbnail if it is valid.
|
||||
]]
|
||||
}
|
||||
values {
|
||||
file: const(char)* @nullable; [[The path to file that will be used
|
||||
as icon image]]
|
||||
group: const(char)* @optional; [[The group that the icon belongs
|
||||
to an edje file]]
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
class.constructor;
|
||||
|
|
|
@ -10,4 +10,19 @@
|
|||
*/
|
||||
EAPI Evas_Object *elm_icon_add(Evas_Object *parent);
|
||||
|
||||
/**
|
||||
* @brief Set the file that will be used, but use a generated thumbnail.
|
||||
*
|
||||
* This functions like elm_image_file_set() but requires the Ethumb library
|
||||
* support to be enabled successfully with @c elm_need_ethumb. When set the
|
||||
* file indicated has a thumbnail generated and cached on disk for future use
|
||||
* or will directly use an existing cached thumbnail if it is valid.
|
||||
*
|
||||
* @param[in] file The path to file that will be used as icon image
|
||||
* @param[in] group The group that the icon belongs to an edje file
|
||||
*
|
||||
* @ingroup Elm_Icon
|
||||
*/
|
||||
EAPI void elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group);
|
||||
|
||||
#include "elm_icon.eo.legacy.h"
|
Loading…
Reference in New Issue