summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi-Youn Park <jy0703.park@samsung.com>2016-04-11 21:44:31 +0830
committerJi-Youn Park <jy0703.park@samsung.com>2016-04-11 21:44:31 +0830
commit44d6506b8a9bc492536f1207fbdc187e879acd88 (patch)
tree435cae7c900d171a48c74757d60b51f141cd5d6b
parent02a37da0ed835c74e6b3cc6146280eb82e6a18f2 (diff)
Elm_icon: move thumb_set API from eo to legacy.
-rw-r--r--src/lib/elementary/elm_icon.c57
-rw-r--r--src/lib/elementary/elm_icon.eo18
-rw-r--r--src/lib/elementary/elm_icon_legacy.h15
3 files changed, 45 insertions, 45 deletions
diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c
index 466ab9d6e6..d1595b6c0b 100644
--- a/src/lib/elementary/elm_icon.c
+++ b/src/lib/elementary/elm_icon.c
@@ -706,33 +706,6 @@ elm_icon_file_get(const Evas_Object *obj,
706 elm_image_file_get(obj, file, group); 706 elm_image_file_get(obj, file, group);
707} 707}
708 708
709EOLIAN static void
710_elm_icon_thumb_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const char *group)
711{
712 evas_object_event_callback_del_full
713 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj);
714 evas_object_event_callback_del_full
715 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
716
717 evas_object_event_callback_add
718 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
719
720 eina_stringshare_replace(&sd->thumb.file.path, file);
721 eina_stringshare_replace(&sd->thumb.file.key, group);
722
723 if (elm_thumb_ethumb_client_connected_get())
724 {
725 _icon_thumb_apply(sd);
726 return;
727 }
728
729 if (!sd->thumb.eeh)
730 {
731 sd->thumb.eeh = ecore_event_handler_add
732 (ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj);
733 }
734}
735
736EAPI Eina_Bool 709EAPI Eina_Bool
737elm_icon_animated_available_get(const Evas_Object *obj) 710elm_icon_animated_available_get(const Evas_Object *obj)
738{ 711{
@@ -951,4 +924,34 @@ _elm_icon_class_constructor(Eo_Class *klass)
951 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 924 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
952} 925}
953 926
927EAPI void
928elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group)
929{
930 ELM_ICON_CHECK(obj);
931 ELM_ICON_DATA_GET(obj, sd)
932
933 evas_object_event_callback_del_full
934 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_standard_resize_cb, obj);
935 evas_object_event_callback_del_full
936 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
937
938 evas_object_event_callback_add
939 (obj, EVAS_CALLBACK_RESIZE, _elm_icon_thumb_resize_cb, obj);
940
941 eina_stringshare_replace(&sd->thumb.file.path, file);
942 eina_stringshare_replace(&sd->thumb.file.key, group);
943
944 if (elm_thumb_ethumb_client_connected_get())
945 {
946 _icon_thumb_apply(sd);
947 return;
948 }
949
950 if (!sd->thumb.eeh)
951 {
952 sd->thumb.eeh = ecore_event_handler_add
953 (ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, obj);
954 }
955}
956
954#include "elm_icon.eo.c" 957#include "elm_icon.eo.c"
diff --git a/src/lib/elementary/elm_icon.eo b/src/lib/elementary/elm_icon.eo
index 421d0d0c75..146c5b32d1 100644
--- a/src/lib/elementary/elm_icon.eo
+++ b/src/lib/elementary/elm_icon.eo
@@ -79,24 +79,6 @@ class Elm.Icon (Elm.Image)
79 name: const(char)*; [[The icon name]] 79 name: const(char)*; [[The icon name]]
80 } 80 }
81 } 81 }
82 @property thumb {
83 set {
84 [[Set the file that will be used, but use a generated thumbnail.
85
86 This functions like elm_image_file_set() but requires the Ethumb
87 library support to be enabled successfully with $elm_need_ethumb.
88 When set the file indicated has a thumbnail generated and cached
89 on disk for future use or will directly use an existing cached
90 thumbnail if it is valid.
91 ]]
92 }
93 values {
94 file: const(char)* @nullable; [[The path to file that will be used
95 as icon image]]
96 group: const(char)* @optional; [[The group that the icon belongs
97 to an edje file]]
98 }
99 }
100 } 82 }
101 implements { 83 implements {
102 class.constructor; 84 class.constructor;
diff --git a/src/lib/elementary/elm_icon_legacy.h b/src/lib/elementary/elm_icon_legacy.h
index a034a684ac..5535329987 100644
--- a/src/lib/elementary/elm_icon_legacy.h
+++ b/src/lib/elementary/elm_icon_legacy.h
@@ -10,4 +10,19 @@
10 */ 10 */
11EAPI Evas_Object *elm_icon_add(Evas_Object *parent); 11EAPI Evas_Object *elm_icon_add(Evas_Object *parent);
12 12
13/**
14 * @brief Set the file that will be used, but use a generated thumbnail.
15 *
16 * This functions like elm_image_file_set() but requires the Ethumb library
17 * support to be enabled successfully with @c elm_need_ethumb. When set the
18 * file indicated has a thumbnail generated and cached on disk for future use
19 * or will directly use an existing cached thumbnail if it is valid.
20 *
21 * @param[in] file The path to file that will be used as icon image
22 * @param[in] group The group that the icon belongs to an edje file
23 *
24 * @ingroup Elm_Icon
25 */
26EAPI void elm_icon_thumb_set(Evas_Object *obj, const char *file, const char *group);
27
13#include "elm_icon.eo.legacy.h" \ No newline at end of file 28#include "elm_icon.eo.legacy.h" \ No newline at end of file