1 #include <Elementary.h>
5 * @defgroup Thumb Thumb
7 * A thumb object is used for displaying the thumbnail of an image or video.
8 * You must have compiled Elementary with Ethumb_Client support and the DBus
9 * service must be present and auto-activated in order to have thumbnails to
12 * Signals that you can add callbacks for are:
14 * "clicked" - This is called when a user has clicked the thumb without dragging
16 * "clicked,double" - This is called when a user has double-clicked the thumb.
17 * "press" - This is called when a user has pressed down the thumb.
18 * "generate,start" - The thumbnail generation started.
19 * "generate,stop" - The generation process stopped.
20 * "generate,error" - The generation failed.
21 * "load,error" - The thumbnail image loading failed.
24 typedef struct _Widget_Data Widget_Data;
38 #ifdef HAVE_ELEMENTARY_ETHUMB
39 const char *thumb_path;
40 const char *thumb_key;
41 Ethumb_Exists *exists;
43 Ethumb_Thumb_Format format;
48 Ecore_Event_Handler *eeh;
49 Elm_Thumb_Animation_Setting anim_setting;
50 Eina_Bool on_hold : 1;
51 Eina_Bool is_video : 1;
52 Eina_Bool was_video : 1;
56 static const char *widtype = NULL;
58 static const char SIG_CLICKED[] = "clicked";
59 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
60 static const char SIG_GENERATE_ERROR[] = "generate,error";
61 static const char SIG_GENERATE_START[] = "generate,start";
62 static const char SIG_GENERATE_STOP[] = "generate,stop";
63 static const char SIG_LOAD_ERROR[] = "load,error";
64 static const char SIG_PRESS[] = "press";
66 static const Evas_Smart_Cb_Description _signals[] =
69 {SIG_CLICKED_DOUBLE, ""},
70 {SIG_GENERATE_ERROR, ""},
71 {SIG_GENERATE_START, ""},
72 {SIG_GENERATE_STOP, ""},
78 #define EDJE_SIGNAL_GENERATE_START "elm,thumb,generate,start"
79 #define EDJE_SIGNAL_GENERATE_STOP "elm,thumb,generate,stop"
80 #define EDJE_SIGNAL_GENERATE_ERROR "elm,thumb,generate,error"
81 #define EDJE_SIGNAL_LOAD_ERROR "elm,thumb,load,error"
82 #define EDJE_SIGNAL_PULSE_START "elm,state,pulse,start"
83 #define EDJE_SIGNAL_PULSE_STOP "elm,state,pulse,stop"
85 struct _Ethumb_Client *_elm_ethumb_client = NULL;
86 Eina_Bool _elm_ethumb_connected = EINA_FALSE;
87 static Eina_List *retry = NULL;
88 static int pending_request = 0;
90 EAPI int ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
93 _del_hook(Evas_Object *obj)
95 Widget_Data *wd = elm_widget_data_get(obj);
97 #ifdef HAVE_ELEMENTARY_ETHUMB
98 if (wd->thumb.id >= 0)
100 ethumb_client_generate_cancel(_elm_ethumb_client, wd->thumb.id,
104 if (wd->thumb.exists)
106 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
107 wd->thumb.exists = NULL;
111 retry = eina_list_remove(retry, wd);
112 wd->thumb.retry = EINA_FALSE;
115 eina_stringshare_del(wd->thumb.thumb_path);
116 eina_stringshare_del(wd->thumb.thumb_key);
119 eina_stringshare_del(wd->file);
120 eina_stringshare_del(wd->key);
121 if (wd->eeh) ecore_event_handler_del(wd->eeh);
126 _theme_hook(Evas_Object *obj)
128 Widget_Data *wd = elm_widget_data_get(obj);
129 _elm_theme_object_set(obj, wd->frame, "thumb", "base",
130 elm_widget_style_get(obj));
133 #ifdef HAVE_ELEMENTARY_ETHUMB
135 _mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
137 Widget_Data *wd = data;
138 Evas_Event_Mouse_Down *ev = event_info;
142 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
143 wd->on_hold = EINA_TRUE;
145 wd->on_hold = EINA_FALSE;
146 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
147 evas_object_smart_callback_call(wd->self, SIG_CLICKED_DOUBLE, NULL);
149 evas_object_smart_callback_call(wd->self, SIG_PRESS, NULL);
153 _mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
155 Widget_Data *wd = data;
156 Evas_Event_Mouse_Up *ev = event_info;
160 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
161 wd->on_hold = EINA_TRUE;
163 wd->on_hold = EINA_FALSE;
165 evas_object_smart_callback_call(wd->self, SIG_CLICKED, NULL);
166 wd->on_hold = EINA_FALSE;
169 /* As we do use stat to check if a thumbnail is available, it's possible
170 that we end up accessing before the file is completly written on disk.
171 By retrying each time a thumbnail is finished we should be fine or not.
174 _retry_thumb(Widget_Data *wd)
179 if ((wd->is_video) && (wd->thumb.format == ETHUMB_THUMB_EET))
181 edje_object_file_set(wd->view, NULL, NULL);
182 if (!edje_object_file_set(wd->view,
183 wd->thumb.thumb_path,
186 if (pending_request == 0)
187 ERR("could not set file=%s key=%s for %s",
188 wd->thumb.thumb_path,
196 evas_object_image_file_set(wd->view, NULL, NULL);
197 evas_object_image_file_set(wd->view,
198 wd->thumb.thumb_path,
199 wd->thumb.thumb_key);
200 r = evas_object_image_load_error_get(wd->view);
201 if (r != EVAS_LOAD_ERROR_NONE)
203 if (pending_request == 0)
204 ERR("%s: %s", wd->thumb.thumb_path, evas_load_error_str(r));
209 edje_object_part_swallow(wd->frame, "elm.swallow.content", wd->view);
210 edje_object_size_min_get(wd->frame, &mw, &mh);
211 edje_object_size_min_restricted_calc(wd->frame, &mw, &mh, mw, mh);
212 evas_object_size_hint_min_set(wd->self, mw, mh);
213 eina_stringshare_replace(&(wd->thumb.file), wd->thumb.thumb_path);
214 eina_stringshare_replace(&(wd->thumb.key), wd->thumb.thumb_key);
215 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
216 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
218 eina_stringshare_del(wd->thumb.thumb_path);
219 wd->thumb.thumb_path = NULL;
221 eina_stringshare_del(wd->thumb.thumb_key);
222 wd->thumb.thumb_key = NULL;
231 _finished_thumb(Widget_Data *wd,
232 const char *thumb_path,
233 const char *thumb_key)
240 evas = evas_object_evas_get(wd->self);
241 if ((wd->view) && (wd->is_video ^ wd->was_video))
243 evas_object_del(wd->view);
246 wd->was_video = wd->is_video;
248 if ((wd->is_video) &&
249 (ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET))
253 wd->view = edje_object_add(evas);
256 ERR("could not create edje object");
259 elm_widget_sub_object_add(wd->self, wd->view);
262 if (!edje_object_file_set(wd->view, thumb_path, "movie/thumb"))
264 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
265 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
266 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
267 wd->thumb.retry = EINA_TRUE;
269 retry = eina_list_append(retry, wd);
277 wd->view = evas_object_image_filled_add(evas);
280 ERR("could not create image object");
283 elm_widget_sub_object_add(wd->self, wd->view);
286 evas_object_image_file_set(wd->view, thumb_path, thumb_key);
287 r = evas_object_image_load_error_get(wd->view);
288 if (r != EVAS_LOAD_ERROR_NONE)
290 WRN("%s: %s", thumb_path, evas_load_error_str(r));
291 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
292 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
293 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
294 wd->thumb.retry = EINA_TRUE;
296 retry = eina_list_append(retry, wd);
301 edje_object_part_swallow(wd->frame, "elm.swallow.content", wd->view);
302 edje_object_size_min_get(wd->frame, &mw, &mh);
303 edje_object_size_min_restricted_calc(wd->frame, &mw, &mh, mw, mh);
304 evas_object_size_hint_min_set(wd->self, mw, mh);
305 eina_stringshare_replace(&(wd->thumb.file), thumb_path);
306 eina_stringshare_replace(&(wd->thumb.key), thumb_key);
307 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
308 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
310 EINA_LIST_FOREACH_SAFE(retry, l, ll, wd)
311 if (_retry_thumb(wd))
312 retry = eina_list_remove_list(retry, l);
314 if (pending_request == 0)
315 EINA_LIST_FREE(retry, wd)
317 eina_stringshare_del(wd->thumb.thumb_path);
318 wd->thumb.thumb_path = NULL;
320 eina_stringshare_del(wd->thumb.thumb_key);
321 wd->thumb.thumb_key = NULL;
323 evas_object_del(wd->view);
326 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
327 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
333 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
334 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
338 _finished_thumb_cb(void *data, Ethumb_Client *c __UNUSED__, int id, const char *file, const char *key, const char *thumb_path, const char *thumb_key, Eina_Bool success)
340 Widget_Data *wd = data;
342 EINA_SAFETY_ON_FALSE_RETURN(wd->thumb.id == id);
347 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_STOP, "elm");
351 _finished_thumb(wd, thumb_path, thumb_key);
355 ERR("could not generate thumbnail for %s (key: %s)", file, key ? key : "");
356 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
357 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
361 _thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread,
362 Eina_Bool exists, void *data)
364 Widget_Data *wd = data;
366 if (ethumb_client_thumb_exists_check(thread))
369 wd->thumb.exists = NULL;
373 const char *thumb_path, *thumb_key;
378 ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
380 _finished_thumb(wd, thumb_path, thumb_key);
383 else if ((wd->thumb.id = ethumb_client_generate
384 (_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1)
386 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm");
387 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm");
388 evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
395 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
396 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
402 _thumb_apply(Widget_Data *wd)
404 if (wd->thumb.id > 0)
406 ethumb_client_generate_cancel
407 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
411 if (wd->thumb.exists)
413 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
414 wd->thumb.exists = NULL;
419 retry = eina_list_remove(retry, wd);
420 wd->thumb.retry = EINA_FALSE;
423 if (!wd->file) return;
426 ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key);
427 wd->thumb.exists = ethumb_client_thumb_exists(_elm_ethumb_client,
433 _thumb_apply_cb(void *data, int type __UNUSED__, void *ev __UNUSED__)
436 return ECORE_CALLBACK_RENEW;
440 _thumb_show(Widget_Data *wd)
442 evas_object_show(wd->frame);
444 if (elm_thumb_ethumb_client_connected())
451 wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT,
452 _thumb_apply_cb, wd);
456 _thumb_show_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
462 _thumb_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
464 Widget_Data *wd = data;
466 evas_object_hide(wd->frame);
468 if (wd->thumb.id >= 0)
470 ethumb_client_generate_cancel
471 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
474 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
475 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
478 if (wd->thumb.exists)
480 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
481 wd->thumb.exists = NULL;
486 retry = eina_list_remove(retry, wd);
487 wd->thumb.retry = EINA_FALSE;
492 ecore_event_handler_del(wd->eeh);
500 static int _elm_need_ethumb = 0;
502 static void _on_die_cb(void *, Ethumb_Client *);
505 _connect_cb(void *data __UNUSED__, Ethumb_Client *c, Eina_Bool success)
509 ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
510 _elm_ethumb_connected = EINA_TRUE;
511 ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
514 _elm_ethumb_client = NULL;
518 _on_die_cb(void *data __UNUSED__, Ethumb_Client *c __UNUSED__)
520 ethumb_client_disconnect(_elm_ethumb_client);
521 _elm_ethumb_client = NULL;
522 _elm_ethumb_connected = EINA_FALSE;
523 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
528 _elm_unneed_ethumb(void)
531 if (--_elm_need_ethumb) return;
533 ethumb_client_disconnect(_elm_ethumb_client);
534 _elm_ethumb_client = NULL;
535 ethumb_client_shutdown();
536 ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
541 _elm_thumb_dropcb(void *data __UNUSED__, Evas_Object *o, Elm_Selection_Data *drop)
543 if ((!o) || (!drop) || (!drop->data)) return EINA_FALSE;
544 elm_thumb_file_set(o, drop->data, NULL);
549 * This must be called before any other function that handle with
550 * elm_thumb objects or ethumb_client instances.
555 elm_need_ethumb(void)
558 if (_elm_need_ethumb++) return EINA_TRUE;
559 ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
560 ethumb_client_init();
561 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
569 * Add a new thumb object to the parent.
571 * @param parent The parent object.
572 * @return The new object or NULL if it cannot be created.
574 * @see elm_thumb_file_set()
575 * @see elm_thumb_ethumb_client_get()
580 elm_thumb_add(Evas_Object *parent)
585 Evas_Coord minw, minh;
587 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
589 ELM_SET_WIDTYPE(widtype, "thumb");
590 elm_widget_type_set(obj, "thumb");
591 elm_widget_sub_object_add(parent, obj);
592 elm_widget_data_set(obj, wd);
593 elm_widget_del_hook_set(obj, _del_hook);
594 elm_widget_theme_hook_set(obj, _theme_hook);
595 elm_widget_can_focus_set(obj, EINA_FALSE);
597 wd->frame = edje_object_add(e);
598 _elm_theme_object_set(obj, wd->frame, "thumb", "base", "default");
599 elm_widget_resize_object_set(obj, wd->frame);
601 edje_object_size_min_calc(obj, &minw, &minh);
602 evas_object_size_hint_min_set(obj, minw, minh);
610 wd->on_hold = EINA_FALSE;
611 wd->is_video = EINA_FALSE;
612 wd->was_video = EINA_FALSE;
614 #ifdef HAVE_ELEMENTARY_ETHUMB
615 wd->thumb.thumb_path = NULL;
616 wd->thumb.thumb_key = NULL;
617 wd->thumb.exists = NULL;
618 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
620 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
622 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
624 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
628 // TODO: convert Elementary to subclassing of Evas_Smart_Class
629 // TODO: and save some bytes, making descriptions per-class and not instance!
630 evas_object_smart_callbacks_descriptions_set(obj, _signals);
635 * Reload thumbnail if it was generated before.
637 * This is useful if the ethumb client configuration changed, like its
638 * size, aspect or any other property one set in the handle returned
639 * by elm_thumb_ethumb_client_get().
641 * @param obj The thumb object to reload
643 * @see elm_thumb_file_set()
648 elm_thumb_reload(Evas_Object *obj)
650 ELM_CHECK_WIDTYPE(obj, widtype);
651 Widget_Data *wd = elm_widget_data_get(obj);
653 eina_stringshare_replace(&(wd->thumb.file), NULL);
654 eina_stringshare_replace(&(wd->thumb.key), NULL);
656 #ifdef HAVE_ELEMENTARY_ETHUMB
657 if (evas_object_visible_get(obj))
663 * Set the file that will be used as thumbnail.
665 * The file can be an image or a video (in that case, acceptable extensions are:
666 * avi, mp4, ogv, mov, mpg and wmv). To start the video animation, use the
667 * function elm_thumb_animate().
669 * @param obj The thumb object.
670 * @param file The path to file that will be used as thumb.
671 * @param key The key used in case of an EET file.
673 * @see elm_thumb_file_get()
674 * @see elm_thumb_reload()
675 * @see elm_thumb_animate()
680 elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key)
682 ELM_CHECK_WIDTYPE(obj, widtype);
683 Eina_Bool file_replaced, key_replaced;
684 Widget_Data *wd = elm_widget_data_get(obj);
686 file_replaced = eina_stringshare_replace(&(wd->file), file);
687 key_replaced = eina_stringshare_replace(&(wd->key), key);
692 const char **ext, *ptr;
693 static const char *extensions[] =
695 ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
698 prefix_size = eina_stringshare_strlen(wd->file) - 4;
699 if (prefix_size >= 0)
701 ptr = wd->file + prefix_size;
702 wd->is_video = EINA_FALSE;
703 for (ext = extensions; *ext; ext++)
704 if (!strcasecmp(ptr, *ext))
706 wd->is_video = EINA_TRUE;
712 eina_stringshare_replace(&(wd->thumb.file), NULL);
713 eina_stringshare_replace(&(wd->thumb.key), NULL);
715 #ifdef HAVE_ELEMENTARY_ETHUMB
716 if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj)))
722 * Get the image or video path and key used to generate the thumbnail.
724 * @param obj The thumb object.
725 * @param file Pointer to filename.
726 * @param key Pointer to key.
728 * @see elm_thumb_file_set()
729 * @see elm_thumb_path_get()
730 * @see elm_thumb_animate()
735 elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key)
737 ELM_CHECK_WIDTYPE(obj, widtype);
738 Widget_Data *wd = elm_widget_data_get(obj);
747 * Get the path and key to the image or video generated by ethumb.
749 * One just need to make sure that the thumbnail was generated before getting
750 * its path; otherwise, the path will be NULL. One way to do that is by asking
751 * for the path when/after the "generate,stop" smart callback is called.
753 * @param obj The thumb object.
754 * @param file Pointer to thumb path.
755 * @param key Pointer to thumb key.
757 * @see elm_thumb_file_get()
762 elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key)
764 ELM_CHECK_WIDTYPE(obj, widtype);
765 Widget_Data *wd = elm_widget_data_get(obj);
768 *file = wd->thumb.file;
770 *key = wd->thumb.key;
774 * Set the animation state for the thumb object. If its content is an animated
775 * video, you may start/stop the animation or tell it to play continuously and
778 * @param obj The thumb object.
779 * @param setting The animation setting.
781 * @see elm_thumb_file_set()
786 elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting setting)
788 ELM_CHECK_WIDTYPE(obj, widtype);
789 Widget_Data *wd = elm_widget_data_get(obj);
791 EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST);
793 wd->anim_setting = setting;
794 if (setting == ELM_THUMB_ANIMATION_LOOP)
795 edje_object_signal_emit(wd->view, "animate_loop", "");
796 else if (setting == ELM_THUMB_ANIMATION_START)
797 edje_object_signal_emit(wd->view, "animate", "");
798 else if (setting == ELM_THUMB_ANIMATION_STOP)
799 edje_object_signal_emit(wd->view, "animate_stop", "");
803 * Get the animation state for the thumb object.
805 * @param obj The thumb object.
806 * @return getting The animation setting or @c ELM_THUMB_ANIMATION_LAST,
809 * @see elm_thumb_file_get()
813 EAPI Elm_Thumb_Animation_Setting
814 elm_thumb_animate_get(const Evas_Object *obj)
816 ELM_CHECK_WIDTYPE(obj, widtype) ELM_THUMB_ANIMATION_LAST;
817 Widget_Data *wd = elm_widget_data_get(obj);
819 return wd->anim_setting;
823 * Get the ethumb_client handle so custom configuration can be made.
824 * This must be called before the objects are created to be sure no object is
825 * visible and no generation started.
827 * @return Ethumb_Client instance or NULL.
832 * #include <Elementary.h>
833 * #ifndef ELM_LIB_QUICKLAUNCH
835 * elm_main(int argc, char **argv)
837 * Ethumb_Client *client;
843 * client = elm_thumb_ethumb_client_get();
846 * ERR("could not get ethumb_client");
849 * ethumb_client_size_set(client, 100, 100);
850 * ethumb_client_crop_align_set(client, 0.5, 0.5);
853 * // Create elm_thumb objects here
866 elm_thumb_ethumb_client_get(void)
868 return _elm_ethumb_client;
872 * Get the ethumb_client connection state.
874 * @return EINA_TRUE if the client is connected to the server or
875 * EINA_FALSE otherwise.
878 elm_thumb_ethumb_client_connected(void)
880 return _elm_ethumb_connected;
884 elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
886 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
887 Widget_Data *wd = elm_widget_data_get(obj);
889 if (!wd) return EINA_FALSE;
891 if (wd->edit == edit) return EINA_TRUE;
895 elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
896 _elm_thumb_dropcb, obj);
898 elm_drop_target_del(obj);
904 elm_thumb_editable_get(const Evas_Object *obj)
906 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
907 Widget_Data *wd = elm_widget_data_get(obj);
909 if (!wd) return EINA_FALSE;
913 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/