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 #ifdef HAVE_ELEMENTARY_ETHUMB
88 static Eina_List *retry = NULL;
89 static int pending_request = 0;
92 EAPI int ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
95 _del_hook(Evas_Object *obj)
97 Widget_Data *wd = elm_widget_data_get(obj);
99 #ifdef HAVE_ELEMENTARY_ETHUMB
100 if (wd->thumb.id >= 0)
102 ethumb_client_generate_cancel(_elm_ethumb_client, wd->thumb.id,
106 if (wd->thumb.exists)
108 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
109 wd->thumb.exists = NULL;
113 retry = eina_list_remove(retry, wd);
114 wd->thumb.retry = EINA_FALSE;
117 eina_stringshare_del(wd->thumb.thumb_path);
118 eina_stringshare_del(wd->thumb.thumb_key);
121 eina_stringshare_del(wd->file);
122 eina_stringshare_del(wd->key);
123 if (wd->eeh) ecore_event_handler_del(wd->eeh);
128 _theme_hook(Evas_Object *obj)
130 Widget_Data *wd = elm_widget_data_get(obj);
131 _elm_theme_object_set(obj, wd->frame, "thumb", "base",
132 elm_widget_style_get(obj));
135 #ifdef HAVE_ELEMENTARY_ETHUMB
137 _mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
139 Widget_Data *wd = data;
140 Evas_Event_Mouse_Down *ev = event_info;
144 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
145 wd->on_hold = EINA_TRUE;
147 wd->on_hold = EINA_FALSE;
148 if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
149 evas_object_smart_callback_call(wd->self, SIG_CLICKED_DOUBLE, NULL);
151 evas_object_smart_callback_call(wd->self, SIG_PRESS, NULL);
155 _mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
157 Widget_Data *wd = data;
158 Evas_Event_Mouse_Up *ev = event_info;
162 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
163 wd->on_hold = EINA_TRUE;
165 wd->on_hold = EINA_FALSE;
167 evas_object_smart_callback_call(wd->self, SIG_CLICKED, NULL);
168 wd->on_hold = EINA_FALSE;
171 /* As we do use stat to check if a thumbnail is available, it's possible
172 that we end up accessing before the file is completly written on disk.
173 By retrying each time a thumbnail is finished we should be fine or not.
176 _retry_thumb(Widget_Data *wd)
181 if ((wd->is_video) && (wd->thumb.format == ETHUMB_THUMB_EET))
183 edje_object_file_set(wd->view, NULL, NULL);
184 if (!edje_object_file_set(wd->view,
185 wd->thumb.thumb_path,
188 if (pending_request == 0)
189 ERR("could not set file=%s key=%s for %s",
190 wd->thumb.thumb_path,
198 evas_object_image_file_set(wd->view, NULL, NULL);
199 evas_object_image_file_set(wd->view,
200 wd->thumb.thumb_path,
201 wd->thumb.thumb_key);
202 r = evas_object_image_load_error_get(wd->view);
203 if (r != EVAS_LOAD_ERROR_NONE)
205 if (pending_request == 0)
206 ERR("%s: %s", wd->thumb.thumb_path, evas_load_error_str(r));
211 edje_object_part_swallow(wd->frame, "elm.swallow.content", wd->view);
212 edje_object_size_min_get(wd->frame, &mw, &mh);
213 edje_object_size_min_restricted_calc(wd->frame, &mw, &mh, mw, mh);
214 evas_object_size_hint_min_set(wd->self, mw, mh);
215 eina_stringshare_replace(&(wd->thumb.file), wd->thumb.thumb_path);
216 eina_stringshare_replace(&(wd->thumb.key), wd->thumb.thumb_key);
217 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
218 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
220 eina_stringshare_del(wd->thumb.thumb_path);
221 wd->thumb.thumb_path = NULL;
223 eina_stringshare_del(wd->thumb.thumb_key);
224 wd->thumb.thumb_key = NULL;
233 _finished_thumb(Widget_Data *wd,
234 const char *thumb_path,
235 const char *thumb_key)
242 evas = evas_object_evas_get(wd->self);
243 if ((wd->view) && (wd->is_video ^ wd->was_video))
245 evas_object_del(wd->view);
248 wd->was_video = wd->is_video;
250 if ((wd->is_video) &&
251 (ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET))
255 wd->view = edje_object_add(evas);
258 ERR("could not create edje object");
261 elm_widget_sub_object_add(wd->self, wd->view);
264 if (!edje_object_file_set(wd->view, thumb_path, "movie/thumb"))
266 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
267 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
268 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
269 wd->thumb.retry = EINA_TRUE;
271 retry = eina_list_append(retry, wd);
279 wd->view = evas_object_image_filled_add(evas);
282 ERR("could not create image object");
285 elm_widget_sub_object_add(wd->self, wd->view);
288 evas_object_image_file_set(wd->view, thumb_path, thumb_key);
289 r = evas_object_image_load_error_get(wd->view);
290 if (r != EVAS_LOAD_ERROR_NONE)
292 WRN("%s: %s", thumb_path, evas_load_error_str(r));
293 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
294 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
295 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
296 wd->thumb.retry = EINA_TRUE;
298 retry = eina_list_append(retry, wd);
303 edje_object_part_swallow(wd->frame, "elm.swallow.content", wd->view);
304 edje_object_size_min_get(wd->frame, &mw, &mh);
305 edje_object_size_min_restricted_calc(wd->frame, &mw, &mh, mw, mh);
306 evas_object_size_hint_min_set(wd->self, mw, mh);
307 eina_stringshare_replace(&(wd->thumb.file), thumb_path);
308 eina_stringshare_replace(&(wd->thumb.key), thumb_key);
309 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
310 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
312 EINA_LIST_FOREACH_SAFE(retry, l, ll, wd)
313 if (_retry_thumb(wd))
314 retry = eina_list_remove_list(retry, l);
316 if (pending_request == 0)
317 EINA_LIST_FREE(retry, wd)
319 eina_stringshare_del(wd->thumb.thumb_path);
320 wd->thumb.thumb_path = NULL;
322 eina_stringshare_del(wd->thumb.thumb_key);
323 wd->thumb.thumb_key = NULL;
325 evas_object_del(wd->view);
328 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
329 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
335 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
336 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
340 _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)
342 Widget_Data *wd = data;
344 EINA_SAFETY_ON_FALSE_RETURN(wd->thumb.id == id);
349 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_STOP, "elm");
353 _finished_thumb(wd, thumb_path, thumb_key);
357 ERR("could not generate thumbnail for %s (key: %s)", file, key ? key : "");
358 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
359 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
363 _thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread,
364 Eina_Bool exists, void *data)
366 Widget_Data *wd = data;
368 if (ethumb_client_thumb_exists_check(thread))
371 wd->thumb.exists = NULL;
375 const char *thumb_path, *thumb_key;
380 ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
382 _finished_thumb(wd, thumb_path, thumb_key);
385 else if ((wd->thumb.id = ethumb_client_generate
386 (_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1)
388 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm");
389 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm");
390 evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
397 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
398 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
404 _thumb_apply(Widget_Data *wd)
406 if (wd->thumb.id > 0)
408 ethumb_client_generate_cancel
409 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
413 if (wd->thumb.exists)
415 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
416 wd->thumb.exists = NULL;
421 retry = eina_list_remove(retry, wd);
422 wd->thumb.retry = EINA_FALSE;
425 if (!wd->file) return;
428 ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key);
429 wd->thumb.exists = ethumb_client_thumb_exists(_elm_ethumb_client,
435 _thumb_apply_cb(void *data, int type __UNUSED__, void *ev __UNUSED__)
438 return ECORE_CALLBACK_RENEW;
442 _thumb_show(Widget_Data *wd)
444 evas_object_show(wd->frame);
446 if (elm_thumb_ethumb_client_connected())
453 wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT,
454 _thumb_apply_cb, wd);
458 _thumb_show_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
464 _thumb_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
466 Widget_Data *wd = data;
468 evas_object_hide(wd->frame);
470 if (wd->thumb.id >= 0)
472 ethumb_client_generate_cancel
473 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
476 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
477 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
480 if (wd->thumb.exists)
482 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
483 wd->thumb.exists = NULL;
488 retry = eina_list_remove(retry, wd);
489 wd->thumb.retry = EINA_FALSE;
494 ecore_event_handler_del(wd->eeh);
502 static int _elm_need_ethumb = 0;
504 static void _on_die_cb(void *, Ethumb_Client *);
507 _connect_cb(void *data __UNUSED__, Ethumb_Client *c, Eina_Bool success)
511 ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
512 _elm_ethumb_connected = EINA_TRUE;
513 ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
516 _elm_ethumb_client = NULL;
520 _on_die_cb(void *data __UNUSED__, Ethumb_Client *c __UNUSED__)
522 ethumb_client_disconnect(_elm_ethumb_client);
523 _elm_ethumb_client = NULL;
524 _elm_ethumb_connected = EINA_FALSE;
525 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
530 _elm_unneed_ethumb(void)
533 if (--_elm_need_ethumb) return;
535 ethumb_client_disconnect(_elm_ethumb_client);
536 _elm_ethumb_client = NULL;
537 ethumb_client_shutdown();
538 ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
543 _elm_thumb_dropcb(void *data __UNUSED__, Evas_Object *o, Elm_Selection_Data *drop)
545 if ((!o) || (!drop) || (!drop->data)) return EINA_FALSE;
546 elm_thumb_file_set(o, drop->data, NULL);
551 * This must be called before any other function that handle with
552 * elm_thumb objects or ethumb_client instances.
557 elm_need_ethumb(void)
560 if (_elm_need_ethumb++) return EINA_TRUE;
561 ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
562 ethumb_client_init();
563 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
571 * Add a new thumb object to the parent.
573 * @param parent The parent object.
574 * @return The new object or NULL if it cannot be created.
576 * @see elm_thumb_file_set()
577 * @see elm_thumb_ethumb_client_get()
582 elm_thumb_add(Evas_Object *parent)
587 Evas_Coord minw, minh;
589 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
591 ELM_SET_WIDTYPE(widtype, "thumb");
592 elm_widget_type_set(obj, "thumb");
593 elm_widget_sub_object_add(parent, obj);
594 elm_widget_data_set(obj, wd);
595 elm_widget_del_hook_set(obj, _del_hook);
596 elm_widget_theme_hook_set(obj, _theme_hook);
597 elm_widget_can_focus_set(obj, EINA_FALSE);
599 wd->frame = edje_object_add(e);
600 _elm_theme_object_set(obj, wd->frame, "thumb", "base", "default");
601 elm_widget_resize_object_set(obj, wd->frame);
603 edje_object_size_min_calc(obj, &minw, &minh);
604 evas_object_size_hint_min_set(obj, minw, minh);
612 wd->on_hold = EINA_FALSE;
613 wd->is_video = EINA_FALSE;
614 wd->was_video = EINA_FALSE;
616 #ifdef HAVE_ELEMENTARY_ETHUMB
617 wd->thumb.thumb_path = NULL;
618 wd->thumb.thumb_key = NULL;
619 wd->thumb.exists = NULL;
620 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
622 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
624 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
626 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
630 // TODO: convert Elementary to subclassing of Evas_Smart_Class
631 // TODO: and save some bytes, making descriptions per-class and not instance!
632 evas_object_smart_callbacks_descriptions_set(obj, _signals);
637 * Reload thumbnail if it was generated before.
639 * This is useful if the ethumb client configuration changed, like its
640 * size, aspect or any other property one set in the handle returned
641 * by elm_thumb_ethumb_client_get().
643 * @param obj The thumb object to reload
645 * @see elm_thumb_file_set()
650 elm_thumb_reload(Evas_Object *obj)
652 ELM_CHECK_WIDTYPE(obj, widtype);
653 Widget_Data *wd = elm_widget_data_get(obj);
655 eina_stringshare_replace(&(wd->thumb.file), NULL);
656 eina_stringshare_replace(&(wd->thumb.key), NULL);
658 #ifdef HAVE_ELEMENTARY_ETHUMB
659 if (evas_object_visible_get(obj))
665 * Set the file that will be used as thumbnail.
667 * The file can be an image or a video (in that case, acceptable extensions are:
668 * avi, mp4, ogv, mov, mpg and wmv). To start the video animation, use the
669 * function elm_thumb_animate().
671 * @param obj The thumb object.
672 * @param file The path to file that will be used as thumb.
673 * @param key The key used in case of an EET file.
675 * @see elm_thumb_file_get()
676 * @see elm_thumb_reload()
677 * @see elm_thumb_animate()
682 elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key)
684 ELM_CHECK_WIDTYPE(obj, widtype);
685 Eina_Bool file_replaced, key_replaced;
686 Widget_Data *wd = elm_widget_data_get(obj);
688 file_replaced = eina_stringshare_replace(&(wd->file), file);
689 key_replaced = eina_stringshare_replace(&(wd->key), key);
694 const char **ext, *ptr;
695 static const char *extensions[] =
697 ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
700 prefix_size = eina_stringshare_strlen(wd->file) - 4;
701 if (prefix_size >= 0)
703 ptr = wd->file + prefix_size;
704 wd->is_video = EINA_FALSE;
705 for (ext = extensions; *ext; ext++)
706 if (!strcasecmp(ptr, *ext))
708 wd->is_video = EINA_TRUE;
714 eina_stringshare_replace(&(wd->thumb.file), NULL);
715 eina_stringshare_replace(&(wd->thumb.key), NULL);
717 #ifdef HAVE_ELEMENTARY_ETHUMB
718 if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj)))
724 * Get the image or video path and key used to generate the thumbnail.
726 * @param obj The thumb object.
727 * @param file Pointer to filename.
728 * @param key Pointer to key.
730 * @see elm_thumb_file_set()
731 * @see elm_thumb_path_get()
732 * @see elm_thumb_animate()
737 elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key)
739 ELM_CHECK_WIDTYPE(obj, widtype);
740 Widget_Data *wd = elm_widget_data_get(obj);
749 * Get the path and key to the image or video generated by ethumb.
751 * One just need to make sure that the thumbnail was generated before getting
752 * its path; otherwise, the path will be NULL. One way to do that is by asking
753 * for the path when/after the "generate,stop" smart callback is called.
755 * @param obj The thumb object.
756 * @param file Pointer to thumb path.
757 * @param key Pointer to thumb key.
759 * @see elm_thumb_file_get()
764 elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key)
766 ELM_CHECK_WIDTYPE(obj, widtype);
767 Widget_Data *wd = elm_widget_data_get(obj);
770 *file = wd->thumb.file;
772 *key = wd->thumb.key;
776 * Set the animation state for the thumb object. If its content is an animated
777 * video, you may start/stop the animation or tell it to play continuously and
780 * @param obj The thumb object.
781 * @param setting The animation setting.
783 * @see elm_thumb_file_set()
788 elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting setting)
790 ELM_CHECK_WIDTYPE(obj, widtype);
791 Widget_Data *wd = elm_widget_data_get(obj);
793 EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST);
795 wd->anim_setting = setting;
796 if (setting == ELM_THUMB_ANIMATION_LOOP)
797 edje_object_signal_emit(wd->view, "animate_loop", "");
798 else if (setting == ELM_THUMB_ANIMATION_START)
799 edje_object_signal_emit(wd->view, "animate", "");
800 else if (setting == ELM_THUMB_ANIMATION_STOP)
801 edje_object_signal_emit(wd->view, "animate_stop", "");
805 * Get the animation state for the thumb object.
807 * @param obj The thumb object.
808 * @return getting The animation setting or @c ELM_THUMB_ANIMATION_LAST,
811 * @see elm_thumb_file_get()
815 EAPI Elm_Thumb_Animation_Setting
816 elm_thumb_animate_get(const Evas_Object *obj)
818 ELM_CHECK_WIDTYPE(obj, widtype) ELM_THUMB_ANIMATION_LAST;
819 Widget_Data *wd = elm_widget_data_get(obj);
821 return wd->anim_setting;
825 * Get the ethumb_client handle so custom configuration can be made.
826 * This must be called before the objects are created to be sure no object is
827 * visible and no generation started.
829 * @return Ethumb_Client instance or NULL.
834 * #include <Elementary.h>
835 * #ifndef ELM_LIB_QUICKLAUNCH
837 * elm_main(int argc, char **argv)
839 * Ethumb_Client *client;
845 * client = elm_thumb_ethumb_client_get();
848 * ERR("could not get ethumb_client");
851 * ethumb_client_size_set(client, 100, 100);
852 * ethumb_client_crop_align_set(client, 0.5, 0.5);
855 * // Create elm_thumb objects here
868 elm_thumb_ethumb_client_get(void)
870 return _elm_ethumb_client;
874 * Get the ethumb_client connection state.
876 * @return EINA_TRUE if the client is connected to the server or
877 * EINA_FALSE otherwise.
880 elm_thumb_ethumb_client_connected(void)
882 return _elm_ethumb_connected;
886 elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
888 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
889 Widget_Data *wd = elm_widget_data_get(obj);
891 if (!wd) return EINA_FALSE;
893 if (wd->edit == edit) return EINA_TRUE;
897 elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
898 _elm_thumb_dropcb, obj);
900 elm_drop_target_del(obj);
906 elm_thumb_editable_get(const Evas_Object *obj)
908 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
909 Widget_Data *wd = elm_widget_data_get(obj);
911 if (!wd) return EINA_FALSE;
915 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/