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;
172 _thumb_ready(Widget_Data *wd, const char *thumb_path, const char *thumb_key)
177 evas_object_image_size_get(wd->view, &aw, &ah);
178 evas_object_size_hint_aspect_set(wd->view,
179 EVAS_ASPECT_CONTROL_BOTH,
181 edje_object_part_swallow(wd->frame, "elm.swallow.content", wd->view);
182 edje_object_size_min_get(wd->frame, &mw, &mh);
183 edje_object_size_min_restricted_calc(wd->frame, &mw, &mh, mw, mh);
184 evas_object_size_hint_min_set(wd->self, mw, mh);
185 eina_stringshare_replace(&(wd->thumb.file), thumb_path);
186 eina_stringshare_replace(&(wd->thumb.key), thumb_key);
187 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
188 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
192 _thumb_loaded(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
194 Widget_Data *wd = data;
195 const char *thumb_path;
196 const char *thumb_key;
198 evas_object_image_file_get(wd->view, &thumb_path, &thumb_key);
200 _thumb_ready(wd, thumb_path, thumb_key);
203 /* As we do use stat to check if a thumbnail is available, it's possible
204 that we end up accessing before the file is completly written on disk.
205 By retrying each time a thumbnail is finished we should be fine or not.
208 _retry_thumb(Widget_Data *wd)
212 if ((wd->is_video) && (wd->thumb.format == ETHUMB_THUMB_EET))
214 edje_object_file_set(wd->view, NULL, NULL);
215 if (!edje_object_file_set(wd->view,
216 wd->thumb.thumb_path,
219 if (pending_request == 0)
220 ERR("could not set file=%s key=%s for %s",
221 wd->thumb.thumb_path,
229 evas_object_image_file_set(wd->view, NULL, NULL);
230 evas_object_image_file_set(wd->view,
231 wd->thumb.thumb_path,
232 wd->thumb.thumb_key);
233 r = evas_object_image_load_error_get(wd->view);
234 if (r != EVAS_LOAD_ERROR_NONE)
236 if (pending_request == 0)
237 ERR("%s: %s", wd->thumb.thumb_path, evas_load_error_str(r));
241 evas_object_event_callback_add(wd->view,
242 EVAS_CALLBACK_IMAGE_PRELOADED,
244 evas_object_image_preload(wd->view, EINA_TRUE);
248 _thumb_ready(wd, wd->thumb.thumb_path, wd->thumb.thumb_key);
250 eina_stringshare_del(wd->thumb.thumb_path);
251 wd->thumb.thumb_path = NULL;
253 eina_stringshare_del(wd->thumb.thumb_key);
254 wd->thumb.thumb_key = NULL;
263 _finished_thumb(Widget_Data *wd,
264 const char *thumb_path,
265 const char *thumb_key)
271 evas = evas_object_evas_get(wd->self);
272 if ((wd->view) && (wd->is_video ^ wd->was_video))
274 evas_object_del(wd->view);
277 wd->was_video = wd->is_video;
279 if ((wd->is_video) &&
280 (ethumb_client_format_get(_elm_ethumb_client) == ETHUMB_THUMB_EET))
284 wd->view = edje_object_add(evas);
287 ERR("could not create edje object");
290 elm_widget_sub_object_add(wd->self, wd->view);
293 if (!edje_object_file_set(wd->view, thumb_path, "movie/thumb"))
295 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
296 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
297 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
298 wd->thumb.retry = EINA_TRUE;
300 retry = eina_list_append(retry, wd);
308 wd->view = evas_object_image_filled_add(evas);
311 ERR("could not create image object");
314 evas_object_event_callback_add(wd->view,
315 EVAS_CALLBACK_IMAGE_PRELOADED,
317 elm_widget_sub_object_add(wd->self, wd->view);
318 evas_object_hide(wd->view);
321 evas_object_image_file_set(wd->view, thumb_path, thumb_key);
322 r = evas_object_image_load_error_get(wd->view);
323 if (r != EVAS_LOAD_ERROR_NONE)
325 WRN("%s: %s", thumb_path, evas_load_error_str(r));
326 wd->thumb.thumb_path = eina_stringshare_ref(thumb_path);
327 wd->thumb.thumb_key = eina_stringshare_ref(thumb_key);
328 wd->thumb.format = ethumb_client_format_get(_elm_ethumb_client);
329 wd->thumb.retry = EINA_TRUE;
331 retry = eina_list_append(retry, wd);
335 evas_object_image_preload(wd->view, 0);
339 _thumb_ready(wd, thumb_path, thumb_key);
341 EINA_LIST_FOREACH_SAFE(retry, l, ll, wd)
342 if (_retry_thumb(wd))
343 retry = eina_list_remove_list(retry, l);
345 if (pending_request == 0)
346 EINA_LIST_FREE(retry, wd)
348 eina_stringshare_del(wd->thumb.thumb_path);
349 wd->thumb.thumb_path = NULL;
351 eina_stringshare_del(wd->thumb.thumb_key);
352 wd->thumb.thumb_key = NULL;
354 evas_object_del(wd->view);
357 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
358 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
364 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_LOAD_ERROR, "elm");
365 evas_object_smart_callback_call(wd->self, SIG_LOAD_ERROR, NULL);
369 _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)
371 Widget_Data *wd = data;
373 EINA_SAFETY_ON_FALSE_RETURN(wd->thumb.id == id);
378 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_STOP, "elm");
382 _finished_thumb(wd, thumb_path, thumb_key);
386 ERR("could not generate thumbnail for %s (key: %s)", file, key ? key : "");
387 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
388 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
392 _thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread,
393 Eina_Bool exists, void *data)
395 Widget_Data *wd = data;
397 if (ethumb_client_thumb_exists_check(thread))
400 wd->thumb.exists = NULL;
404 const char *thumb_path, *thumb_key;
409 ethumb_client_thumb_path_get(_elm_ethumb_client, &thumb_path,
411 _finished_thumb(wd, thumb_path, thumb_key);
414 else if ((wd->thumb.id = ethumb_client_generate
415 (_elm_ethumb_client, _finished_thumb_cb, wd, NULL)) != -1)
417 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_PULSE_START, "elm");
418 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_START, "elm");
419 evas_object_smart_callback_call(wd->self, SIG_GENERATE_START, NULL);
426 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_ERROR, "elm");
427 evas_object_smart_callback_call(wd->self, SIG_GENERATE_ERROR, NULL);
433 _thumb_apply(Widget_Data *wd)
435 if (wd->thumb.id > 0)
437 ethumb_client_generate_cancel
438 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
442 if (wd->thumb.exists)
444 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
445 wd->thumb.exists = NULL;
450 retry = eina_list_remove(retry, wd);
451 wd->thumb.retry = EINA_FALSE;
454 if (!wd->file) return;
457 ethumb_client_file_set(_elm_ethumb_client, wd->file, wd->key);
458 wd->thumb.exists = ethumb_client_thumb_exists(_elm_ethumb_client,
464 _thumb_apply_cb(void *data, int type __UNUSED__, void *ev __UNUSED__)
467 return ECORE_CALLBACK_RENEW;
471 _thumb_show(Widget_Data *wd)
473 evas_object_show(wd->frame);
475 if (elm_thumb_ethumb_client_connected())
482 wd->eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT,
483 _thumb_apply_cb, wd);
487 _thumb_show_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
493 _thumb_hide_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
495 Widget_Data *wd = data;
497 evas_object_hide(wd->frame);
499 if (wd->thumb.id >= 0)
501 ethumb_client_generate_cancel
502 (_elm_ethumb_client, wd->thumb.id, NULL, NULL, NULL);
505 edje_object_signal_emit(wd->frame, EDJE_SIGNAL_GENERATE_STOP, "elm");
506 evas_object_smart_callback_call(wd->self, SIG_GENERATE_STOP, NULL);
509 if (wd->thumb.exists)
511 ethumb_client_thumb_exists_cancel(wd->thumb.exists);
512 wd->thumb.exists = NULL;
517 retry = eina_list_remove(retry, wd);
518 wd->thumb.retry = EINA_FALSE;
523 ecore_event_handler_del(wd->eeh);
531 static int _elm_need_ethumb = 0;
533 static void _on_die_cb(void *, Ethumb_Client *);
536 _connect_cb(void *data __UNUSED__, Ethumb_Client *c, Eina_Bool success)
540 ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL, NULL);
541 _elm_ethumb_connected = EINA_TRUE;
542 ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL, NULL);
545 _elm_ethumb_client = NULL;
549 _on_die_cb(void *data __UNUSED__, Ethumb_Client *c __UNUSED__)
551 ethumb_client_disconnect(_elm_ethumb_client);
552 _elm_ethumb_client = NULL;
553 _elm_ethumb_connected = EINA_FALSE;
554 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
559 _elm_unneed_ethumb(void)
562 if (--_elm_need_ethumb) return;
564 ethumb_client_disconnect(_elm_ethumb_client);
565 _elm_ethumb_client = NULL;
566 ethumb_client_shutdown();
567 ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
572 _elm_thumb_dropcb(void *data __UNUSED__, Evas_Object *o, Elm_Selection_Data *drop)
574 if ((!o) || (!drop) || (!drop->data)) return EINA_FALSE;
575 elm_thumb_file_set(o, drop->data, NULL);
580 * This must be called before any other function that handle with
581 * elm_thumb objects or ethumb_client instances.
586 elm_need_ethumb(void)
589 if (_elm_need_ethumb++) return EINA_TRUE;
590 ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
591 ethumb_client_init();
592 _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
600 * Add a new thumb object to the parent.
602 * @param parent The parent object.
603 * @return The new object or NULL if it cannot be created.
605 * @see elm_thumb_file_set()
606 * @see elm_thumb_ethumb_client_get()
611 elm_thumb_add(Evas_Object *parent)
616 Evas_Coord minw, minh;
618 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
620 ELM_SET_WIDTYPE(widtype, "thumb");
621 elm_widget_type_set(obj, "thumb");
622 elm_widget_sub_object_add(parent, obj);
623 elm_widget_data_set(obj, wd);
624 elm_widget_del_hook_set(obj, _del_hook);
625 elm_widget_theme_hook_set(obj, _theme_hook);
626 elm_widget_can_focus_set(obj, EINA_FALSE);
628 wd->frame = edje_object_add(e);
629 _elm_theme_object_set(obj, wd->frame, "thumb", "base", "default");
630 elm_widget_resize_object_set(obj, wd->frame);
632 edje_object_size_min_calc(obj, &minw, &minh);
633 evas_object_size_hint_min_set(obj, minw, minh);
641 wd->on_hold = EINA_FALSE;
642 wd->is_video = EINA_FALSE;
643 wd->was_video = EINA_FALSE;
645 #ifdef HAVE_ELEMENTARY_ETHUMB
646 wd->thumb.thumb_path = NULL;
647 wd->thumb.thumb_key = NULL;
648 wd->thumb.exists = NULL;
649 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
651 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
653 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
655 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
659 // TODO: convert Elementary to subclassing of Evas_Smart_Class
660 // TODO: and save some bytes, making descriptions per-class and not instance!
661 evas_object_smart_callbacks_descriptions_set(obj, _signals);
666 * Reload thumbnail if it was generated before.
668 * This is useful if the ethumb client configuration changed, like its
669 * size, aspect or any other property one set in the handle returned
670 * by elm_thumb_ethumb_client_get().
672 * @param obj The thumb object to reload
674 * @see elm_thumb_file_set()
679 elm_thumb_reload(Evas_Object *obj)
681 ELM_CHECK_WIDTYPE(obj, widtype);
682 Widget_Data *wd = elm_widget_data_get(obj);
684 eina_stringshare_replace(&(wd->thumb.file), NULL);
685 eina_stringshare_replace(&(wd->thumb.key), NULL);
687 #ifdef HAVE_ELEMENTARY_ETHUMB
688 if (evas_object_visible_get(obj))
694 * Set the file that will be used as thumbnail.
696 * The file can be an image or a video (in that case, acceptable extensions are:
697 * avi, mp4, ogv, mov, mpg and wmv). To start the video animation, use the
698 * function elm_thumb_animate().
700 * @param obj The thumb object.
701 * @param file The path to file that will be used as thumb.
702 * @param key The key used in case of an EET file.
704 * @see elm_thumb_file_get()
705 * @see elm_thumb_reload()
706 * @see elm_thumb_animate()
711 elm_thumb_file_set(Evas_Object *obj, const char *file, const char *key)
713 ELM_CHECK_WIDTYPE(obj, widtype);
714 Eina_Bool file_replaced, key_replaced;
715 Widget_Data *wd = elm_widget_data_get(obj);
717 file_replaced = eina_stringshare_replace(&(wd->file), file);
718 key_replaced = eina_stringshare_replace(&(wd->key), key);
723 const char **ext, *ptr;
724 static const char *extensions[] =
726 ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
729 prefix_size = eina_stringshare_strlen(wd->file) - 4;
730 if (prefix_size >= 0)
732 ptr = wd->file + prefix_size;
733 wd->is_video = EINA_FALSE;
734 for (ext = extensions; *ext; ext++)
735 if (!strcasecmp(ptr, *ext))
737 wd->is_video = EINA_TRUE;
743 eina_stringshare_replace(&(wd->thumb.file), NULL);
744 eina_stringshare_replace(&(wd->thumb.key), NULL);
746 #ifdef HAVE_ELEMENTARY_ETHUMB
747 if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj)))
753 * Get the image or video path and key used to generate the thumbnail.
755 * @param obj The thumb object.
756 * @param file Pointer to filename.
757 * @param key Pointer to key.
759 * @see elm_thumb_file_set()
760 * @see elm_thumb_path_get()
761 * @see elm_thumb_animate()
766 elm_thumb_file_get(const Evas_Object *obj, const char **file, const char **key)
768 ELM_CHECK_WIDTYPE(obj, widtype);
769 Widget_Data *wd = elm_widget_data_get(obj);
778 * Get the path and key to the image or video generated by ethumb.
780 * One just need to make sure that the thumbnail was generated before getting
781 * its path; otherwise, the path will be NULL. One way to do that is by asking
782 * for the path when/after the "generate,stop" smart callback is called.
784 * @param obj The thumb object.
785 * @param file Pointer to thumb path.
786 * @param key Pointer to thumb key.
788 * @see elm_thumb_file_get()
793 elm_thumb_path_get(const Evas_Object *obj, const char **file, const char **key)
795 ELM_CHECK_WIDTYPE(obj, widtype);
796 Widget_Data *wd = elm_widget_data_get(obj);
799 *file = wd->thumb.file;
801 *key = wd->thumb.key;
805 * Set the animation state for the thumb object. If its content is an animated
806 * video, you may start/stop the animation or tell it to play continuously and
809 * @param obj The thumb object.
810 * @param setting The animation setting.
812 * @see elm_thumb_file_set()
817 elm_thumb_animate_set(Evas_Object *obj, Elm_Thumb_Animation_Setting setting)
819 ELM_CHECK_WIDTYPE(obj, widtype);
820 Widget_Data *wd = elm_widget_data_get(obj);
822 EINA_SAFETY_ON_TRUE_RETURN(setting >= ELM_THUMB_ANIMATION_LAST);
824 wd->anim_setting = setting;
825 if (setting == ELM_THUMB_ANIMATION_LOOP)
826 edje_object_signal_emit(wd->view, "animate_loop", "");
827 else if (setting == ELM_THUMB_ANIMATION_START)
828 edje_object_signal_emit(wd->view, "animate", "");
829 else if (setting == ELM_THUMB_ANIMATION_STOP)
830 edje_object_signal_emit(wd->view, "animate_stop", "");
834 * Get the animation state for the thumb object.
836 * @param obj The thumb object.
837 * @return getting The animation setting or @c ELM_THUMB_ANIMATION_LAST,
840 * @see elm_thumb_file_get()
844 EAPI Elm_Thumb_Animation_Setting
845 elm_thumb_animate_get(const Evas_Object *obj)
847 ELM_CHECK_WIDTYPE(obj, widtype) ELM_THUMB_ANIMATION_LAST;
848 Widget_Data *wd = elm_widget_data_get(obj);
850 return wd->anim_setting;
854 * Get the ethumb_client handle so custom configuration can be made.
855 * This must be called before the objects are created to be sure no object is
856 * visible and no generation started.
858 * @return Ethumb_Client instance or NULL.
863 * #include <Elementary.h>
864 * #ifndef ELM_LIB_QUICKLAUNCH
866 * elm_main(int argc, char **argv)
868 * Ethumb_Client *client;
874 * client = elm_thumb_ethumb_client_get();
877 * ERR("could not get ethumb_client");
880 * ethumb_client_size_set(client, 100, 100);
881 * ethumb_client_crop_align_set(client, 0.5, 0.5);
884 * // Create elm_thumb objects here
897 elm_thumb_ethumb_client_get(void)
899 return _elm_ethumb_client;
903 * Get the ethumb_client connection state.
905 * @return EINA_TRUE if the client is connected to the server or
906 * EINA_FALSE otherwise.
909 elm_thumb_ethumb_client_connected(void)
911 return _elm_ethumb_connected;
915 elm_thumb_editable_set(Evas_Object *obj, Eina_Bool edit)
917 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
918 Widget_Data *wd = elm_widget_data_get(obj);
920 if (!wd) return EINA_FALSE;
922 if (wd->edit == edit) return EINA_TRUE;
926 elm_drop_target_add(obj, ELM_SEL_FORMAT_IMAGE,
927 _elm_thumb_dropcb, obj);
929 elm_drop_target_del(obj);
935 elm_thumb_editable_get(const Evas_Object *obj)
937 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
938 Widget_Data *wd = elm_widget_data_get(obj);
940 if (!wd) return EINA_FALSE;
944 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/