elm fileselector_button_entry: add the elm_object_text_set/get hooks.
[framework/uifw/elementary.git] / src / lib / elc_fileselector_entry.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4  /**
5  * @defgroup File_Selector_Entry File Selector Entry
6  *
7  * An entry that shows to enter/display path and have an associated
8  * button to allow selecting the file from a dialog.
9  *
10  * The button, when clicked, creates an Elementary window (or inner
11  * window) with an Elementary File Selector within. When a file is
12  * chosen, the (inner) window is closed and the selected file is
13  * exposed as an evas_object_smart_callback_call() of the button.
14  */
15
16 typedef struct _Widget_Data Widget_Data;
17
18 struct _Widget_Data
19 {
20    Evas_Object *edje;
21    Evas_Object *button;
22    Evas_Object *entry;
23 };
24
25 static const char *widtype = NULL;
26
27 static const char SIG_CHANGED[] = "changed";
28 static const char SIG_ACTIVATED[] = "activated";
29 static const char SIG_PRESS[] = "press";
30 static const char SIG_LONGPRESSED[] = "longpressed";
31 static const char SIG_CLICKED[] = "clicked";
32 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
33 static const char SIG_FOCUSED[] = "focused";
34 static const char SIG_UNFOCUSED[] = "unfocused";
35 static const char SIG_SELECTION_PASTE[] = "selection,paste";
36 static const char SIG_SELECTION_COPY[] = "selection,copy";
37 static const char SIG_SELECTION_CUT[] = "selection,cut";
38 static const char SIG_UNPRESSED[] = "unpressed";
39 static const char SIG_FILE_CHOSEN[] = "file,chosen";
40 static const Evas_Smart_Cb_Description _signals[] =
41 {
42   {SIG_CHANGED, ""},
43   {SIG_ACTIVATED, ""},
44   {SIG_PRESS, ""},
45   {SIG_LONGPRESSED, ""},
46   {SIG_CLICKED, ""},
47   {SIG_CLICKED_DOUBLE, ""},
48   {SIG_FOCUSED, ""},
49   {SIG_UNFOCUSED, ""},
50   {SIG_SELECTION_PASTE, ""},
51   {SIG_SELECTION_COPY, ""},
52   {SIG_SELECTION_CUT, ""},
53   {SIG_UNPRESSED, ""},
54   {SIG_FILE_CHOSEN, "s"},
55   {NULL, NULL}
56 };
57
58 #define SIG_FWD(name)                                                    \
59 static void                                                              \
60 _##name##_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info) \
61 {                                                                        \
62    evas_object_smart_callback_call(data, SIG_##name, event_info);        \
63 }
64 SIG_FWD(CHANGED)
65 SIG_FWD(PRESS)
66 SIG_FWD(LONGPRESSED)
67 SIG_FWD(CLICKED)
68 SIG_FWD(CLICKED_DOUBLE)
69 SIG_FWD(FOCUSED)
70 SIG_FWD(UNFOCUSED)
71 SIG_FWD(SELECTION_PASTE)
72 SIG_FWD(SELECTION_COPY)
73 SIG_FWD(SELECTION_CUT)
74 SIG_FWD(UNPRESSED)
75 #undef SIG_FWD
76
77 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
78
79 static void
80 _FILE_CHOSEN_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info)
81 {
82    Widget_Data *wd = elm_widget_data_get(data);
83    const char *file = event_info;
84    elm_entry_entry_set(wd->entry, file);
85    evas_object_smart_callback_call(data, SIG_FILE_CHOSEN, event_info);
86 }
87
88 static void
89 _ACTIVATED_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info)
90 {
91    Widget_Data *wd = elm_widget_data_get(data);
92    const char *file = elm_entry_entry_get(wd->entry);
93    elm_fileselector_button_path_set(wd->button, file);
94    evas_object_smart_callback_call(data, SIG_ACTIVATED, event_info);
95 }
96
97 static void
98 _del_hook(Evas_Object *obj)
99 {
100    Widget_Data *wd = elm_widget_data_get(obj);
101    free(wd);
102 }
103
104 static void
105 _sizing_eval(Evas_Object *obj)
106 {
107    Widget_Data *wd = elm_widget_data_get(obj);
108    Evas_Coord minw = -1, minh = -1;
109    if (!wd) return;
110    edje_object_size_min_calc(wd->edje, &minw, &minh);
111    evas_object_size_hint_min_set(obj, minw, minh);
112    evas_object_size_hint_max_set(obj, -1, -1);
113 }
114
115 static Eina_Bool
116 _elm_fileselector_entry_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
117 {
118    Widget_Data *wd = elm_widget_data_get(obj);
119
120    if (!wd)
121      return EINA_FALSE;
122
123    Evas_Object *chain[2];
124
125    /* Direction */
126    if (dir == ELM_FOCUS_PREVIOUS)
127      {
128         chain[0] = wd->button;
129         chain[1] = wd->entry;
130      }
131    else if (dir == ELM_FOCUS_NEXT)
132      {
133         chain[0] = wd->entry;
134         chain[1] = wd->button;
135      }
136    else
137      return EINA_FALSE;
138
139    unsigned char i = elm_widget_focus_get(chain[1]);
140
141    if (elm_widget_focus_next_get(chain[i], dir, next))
142      return EINA_TRUE;
143
144    i = !i;
145
146    Evas_Object *to_focus;
147    if (elm_widget_focus_next_get(chain[i], dir, &to_focus))
148      {
149         *next = to_focus;
150         return !!i;
151      }
152
153    return EINA_FALSE;
154 }
155
156 static void
157 _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
158 {
159    Widget_Data *wd = elm_widget_data_get(obj);
160    if (!wd) return;
161    elm_widget_mirrored_set(wd->button, rtl);
162    edje_object_mirrored_set(wd->edje, rtl);
163 }
164
165 static void
166 _theme_hook(Evas_Object *obj)
167 {
168    Widget_Data *wd = elm_widget_data_get(obj);
169    const char *style = elm_widget_style_get(obj);
170    char buf[1024];
171
172    if (!wd) return;
173    _elm_widget_mirrored_reload(obj);
174    _mirrored_set(obj, elm_widget_mirrored_get(obj));
175
176    _elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", style);
177    if (elm_object_disabled_get(obj))
178       edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm");
179
180    if (!style) style = "default";
181    snprintf(buf, sizeof(buf), "fileselector_entry/%s", style);
182    elm_widget_style_set(wd->button, buf);
183    elm_widget_style_set(wd->entry, buf);
184
185    edje_object_part_swallow(obj, "elm.swallow.button", wd->button);
186    edje_object_part_swallow(obj, "elm.swallow.entry", wd->entry);
187
188    edje_object_message_signal_process(wd->edje);
189    edje_object_scale_set
190      (wd->edje, elm_widget_scale_get(obj) * _elm_config->scale);
191    _sizing_eval(obj);
192 }
193
194 static void
195 _disable_hook(Evas_Object *obj)
196 {
197    Widget_Data *wd = elm_widget_data_get(obj);
198    Eina_Bool val = elm_widget_disabled_get(obj);
199    if (!wd) return;
200    if (val)
201      edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm");
202    else
203      edje_object_signal_emit(wd->edje, "elm,state,enabled", "elm");
204
205    elm_widget_disabled_set(wd->button, val);
206    elm_widget_disabled_set(wd->entry, val);
207 }
208
209 static void
210 _changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
211 {
212    _sizing_eval(data);
213 }
214
215 static void
216 _elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *item, const char *label)
217 {
218    ELM_CHECK_WIDTYPE(obj, widtype);
219    Widget_Data *wd = elm_widget_data_get(obj);
220    if (item) return;
221    if (!wd) return;
222    elm_object_text_set(wd->button, label);
223 }
224
225 static const char *
226 _elm_fileselector_entry_button_label_get(const Evas_Object *obj, const char *item)
227 {
228    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
229    Widget_Data *wd = elm_widget_data_get(obj);
230    if (item) return NULL;
231    if (!wd) return NULL;
232    return elm_object_text_get(wd->button);
233 }
234
235 /**
236  * Add a new file selector entry into the parent object.
237  *
238  * @param parent The parent object
239  * @return The new object or NULL if it cannot be created
240  *
241  * @ingroup File_Selector_Entry
242  */
243 EAPI Evas_Object *
244 elm_fileselector_entry_add(Evas_Object *parent)
245 {
246    Evas_Object *obj;
247    Evas *e;
248    Widget_Data *wd;
249
250    ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
251
252    ELM_SET_WIDTYPE(widtype, "fileselector_entry");
253    elm_widget_type_set(obj, "fileselector_entry");
254    elm_widget_sub_object_add(parent, obj);
255    elm_widget_data_set(obj, wd);
256    elm_widget_del_hook_set(obj, _del_hook);
257    elm_widget_disable_hook_set(obj, _disable_hook);
258    elm_widget_focus_next_hook_set(obj, _elm_fileselector_entry_focus_next_hook);
259    elm_widget_can_focus_set(obj, EINA_FALSE);
260    elm_widget_theme_hook_set(obj, _theme_hook);
261    elm_widget_text_set_hook_set(obj, _elm_fileselector_entry_button_label_set);
262    elm_widget_text_get_hook_set(obj, _elm_fileselector_entry_button_label_get);
263
264    wd->edje = edje_object_add(e);
265    _elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", "default");
266    elm_widget_resize_object_set(obj, wd->edje);
267
268    wd->button = elm_fileselector_button_add(obj);
269    elm_widget_mirrored_automatic_set(wd->button, EINA_FALSE);
270    ELM_SET_WIDTYPE(widtype, "fileselector_entry");
271    elm_widget_style_set(wd->button, "fileselector_entry/default");
272    edje_object_part_swallow(wd->edje, "elm.swallow.button", wd->button);
273    elm_widget_sub_object_add(obj, wd->button);
274    evas_object_event_callback_add
275       (wd->button, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
276    elm_fileselector_button_expandable_set(wd->button,
277                                           _elm_config->fileselector_expand_enable);
278
279 #define SIG_FWD(name)                                                   \
280    evas_object_smart_callback_add(wd->button, SIG_##name, _##name##_fwd, obj)
281    SIG_FWD(CLICKED);
282    SIG_FWD(UNPRESSED);
283    SIG_FWD(FILE_CHOSEN);
284 #undef SIG_FWD
285
286    wd->entry = elm_entry_add(obj);
287    elm_entry_scrollable_set(wd->entry, EINA_TRUE);
288    elm_widget_mirrored_automatic_set(wd->entry, EINA_FALSE);
289    elm_widget_style_set(wd->entry, "fileselector_entry/default");
290    elm_entry_single_line_set(wd->entry, EINA_TRUE);
291    elm_entry_editable_set(wd->entry, EINA_TRUE);
292    edje_object_part_swallow(wd->edje, "elm.swallow.entry", wd->entry);
293    elm_widget_sub_object_add(obj, wd->entry);
294    evas_object_event_callback_add
295       (wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
296
297 #define SIG_FWD(name)                                                   \
298    evas_object_smart_callback_add(wd->entry, SIG_##name, _##name##_fwd, obj)
299    SIG_FWD(CHANGED);
300    SIG_FWD(ACTIVATED);
301    SIG_FWD(PRESS);
302    SIG_FWD(LONGPRESSED);
303    SIG_FWD(CLICKED);
304    SIG_FWD(CLICKED_DOUBLE);
305    SIG_FWD(FOCUSED);
306    SIG_FWD(UNFOCUSED);
307    SIG_FWD(SELECTION_PASTE);
308    SIG_FWD(SELECTION_COPY);
309    SIG_FWD(SELECTION_CUT);
310 #undef SIG_FWD
311
312    _mirrored_set(obj, elm_widget_mirrored_get(obj));
313    _sizing_eval(obj);
314
315    // TODO: convert Elementary to subclassing of Evas_Smart_Class
316    // TODO: and save some bytes, making descriptions per-class and not instance!
317    evas_object_smart_callbacks_descriptions_set(obj, _signals);
318    return obj;
319 }
320
321 /**
322  * Set the label used in the file selector entry.
323  *
324  * @param obj The entry object
325  * @param label The text label text to be displayed on the entry
326  *
327  * @ingroup File_Selector_Entry
328  * @deprecated use elm_object_text_set() instead.
329  */
330 EAPI void
331 elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label)
332 {
333    _elm_fileselector_entry_button_label_set(obj, NULL, label);
334 }
335
336 EAPI const char *
337 elm_fileselector_entry_button_label_get(const Evas_Object *obj)
338 {
339    return _elm_fileselector_entry_button_label_get(obj, NULL);
340 }
341
342 /**
343  * Set the path to start the entry's file selector with, when clicked.
344  *
345  * @param obj The entry object
346  * @param path Path to a file/directory
347  *
348  * Default path is "HOME" environment variable's value.
349  *
350  * @ingroup File_Selector_Entry
351  */
352 EAPI void
353 elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path)
354 {
355    ELM_CHECK_WIDTYPE(obj, widtype);
356    Widget_Data *wd = elm_widget_data_get(obj);
357    if (!wd) return;
358    elm_fileselector_button_path_set(wd->button, path);
359 }
360
361 /**
362  * Get the <b>last</b> path which the entry's file selector was set to.
363  *
364  * @param obj The entry object
365  * @param path Path to a file/directory
366  *
367  * Default path is "HOME" environment variable's value.
368  *
369  * @ingroup File_Selector_Entry
370  */
371 EAPI const char *
372 elm_fileselector_entry_selected_get(const Evas_Object *obj)
373 {
374    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
375    Widget_Data *wd = elm_widget_data_get(obj);
376    if (!wd) return NULL;
377    return elm_fileselector_button_path_get(wd->button);
378 }
379
380 /**
381  * Set the title of the file selector entry's window.
382  *
383  * @param obj The entry object
384  * @param title The title string
385  *
386  * Note that it will only take any effect if the fileselector entry
387  * not at "inwin mode".
388  *
389  * @ingroup File_Selector_Entry
390  */
391 EAPI void
392 elm_fileselector_entry_window_title_set(Evas_Object *obj, const char *title)
393 {
394    ELM_CHECK_WIDTYPE(obj, widtype);
395    Widget_Data *wd = elm_widget_data_get(obj);
396    if (!wd) return;
397    elm_fileselector_button_window_title_set(wd->button, title);
398 }
399
400 /**
401  * Get the title of the file selector entry's window.
402  *
403  * @param obj The entry object
404  *
405  * @ingroup File_Selector_Entry
406  */
407 EAPI const char *
408 elm_fileselector_entry_window_title_get(const Evas_Object *obj)
409 {
410    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
411    Widget_Data *wd = elm_widget_data_get(obj);
412    if (!wd) return NULL;
413    return elm_fileselector_button_window_title_get(wd->button);
414 }
415
416 /**
417  * Set the size of the file selector entry's window.
418  *
419  * @param obj The entry object
420  * @param width The width
421  * @param height The height
422  *
423  * Note that it will only take any effect if the fileselector entry not at
424  * "inwin mode". Default size for the window (when applicable) is 400x400.
425  *
426  * @ingroup File_Selector_Entry
427  */
428 EAPI void
429 elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height)
430 {
431    ELM_CHECK_WIDTYPE(obj, widtype);
432    Widget_Data *wd = elm_widget_data_get(obj);
433    if (!wd) return;
434    elm_fileselector_button_window_size_set(wd->button, width, height);
435 }
436
437 /**
438  * Get the size of the file selector entry's window.
439  *
440  * @param obj The entry object
441  * @param width Pointer into which to store the width value
442  * @param height Pointer into which to store the height value
443  *
444  * @ingroup File_Selector_Entry
445  */
446 EAPI void
447 elm_fileselector_entry_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height)
448 {
449    ELM_CHECK_WIDTYPE(obj, widtype);
450    Widget_Data *wd = elm_widget_data_get(obj);
451    if (!wd) return;
452    elm_fileselector_button_window_size_get(wd->button, width, height);
453 }
454
455 /**
456  * Set the starting path of the file selector entry's window.
457  *
458  * @param obj The entry object
459  * @param path The path string
460  *
461  * It must be a <b>directory</b> path.
462  *
463  * @ingroup File_Selector_Entry
464  */
465 EAPI void
466 elm_fileselector_entry_path_set(Evas_Object *obj, const char *path)
467 {
468    ELM_CHECK_WIDTYPE(obj, widtype);
469    Widget_Data *wd = elm_widget_data_get(obj);
470    if (!wd) return;
471    elm_fileselector_button_path_set(wd->button, path);
472    elm_entry_entry_set(wd->entry, path);
473 }
474
475 /**
476  * Get the <b>last</b> path of the file selector entry's window.
477  *
478  * @param obj The entry object
479  *
480  * @ingroup File_Selector_Entry
481  */
482 EAPI const char *
483 elm_fileselector_entry_path_get(const Evas_Object *obj)
484 {
485    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
486    Widget_Data *wd = elm_widget_data_get(obj);
487    if (!wd) return NULL;
488    return elm_entry_entry_get(wd->entry);
489 }
490
491 /**
492  * Set whether the entry's file selector is to present itself as an
493  * Elementary Generic List (which will expand its entries for nested
494  * directories) or as canonical list, which will be rendered again
495  * with the contents of each selected directory.
496  *
497  * @param obj The entry object
498  * @param value The expandable flag
499  *
500  * @ingroup File_Selector_Entry
501  */
502 EAPI void
503 elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value)
504 {
505    ELM_CHECK_WIDTYPE(obj, widtype);
506    Widget_Data *wd = elm_widget_data_get(obj);
507    if (!wd) return;
508    elm_fileselector_button_expandable_set(wd->button, value);
509 }
510
511 /**
512  * Get the entry's file selector expandable flag.
513  *
514  * @param obj The entry object
515  * @return value The expandable flag
516  *
517  * @ingroup File_Selector_Entry
518  */
519 EAPI Eina_Bool
520 elm_fileselector_entry_expandable_get(const Evas_Object *obj)
521 {
522    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
523    Widget_Data *wd = elm_widget_data_get(obj);
524    if (!wd) return EINA_FALSE;
525    return elm_fileselector_button_expandable_get(wd->button);
526 }
527
528 /**
529  * Set whether the entry's file selector list is to display folders
530  * only or the directory contents, as well.
531  *
532  * @param obj The entry object
533  * @param value The "folder only" flag
534  *
535  * @ingroup File_Selector_Entry
536  */
537 EAPI void
538 elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value)
539 {
540    ELM_CHECK_WIDTYPE(obj, widtype);
541    Widget_Data *wd = elm_widget_data_get(obj);
542    if (!wd) return;
543    elm_fileselector_button_folder_only_set(wd->button, value);
544 }
545
546 /**
547  * Get the entry's file selector "folder only" flag.
548  *
549  * @param obj The entry object
550  * @return value The "folder only" flag
551  *
552  * @ingroup File_Selector_Entry
553  */
554 EAPI Eina_Bool
555 elm_fileselector_entry_folder_only_get(const Evas_Object *obj)
556 {
557    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
558    Widget_Data *wd = elm_widget_data_get(obj);
559    if (!wd) return EINA_FALSE;
560    return elm_fileselector_button_folder_only_get(wd->button);
561 }
562
563 /**
564  * Set whether the entry's file selector has an editable text entry
565  * which will hold its current selection.
566  *
567  * @param obj The entry object
568  * @param value The "is save" flag
569  *
570  * @ingroup File_Selector_Entry
571  */
572 EAPI void
573 elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value)
574 {
575    ELM_CHECK_WIDTYPE(obj, widtype);
576    Widget_Data *wd = elm_widget_data_get(obj);
577    if (!wd) return;
578    elm_fileselector_button_is_save_set(wd->button, value);
579 }
580
581 /**
582  * Get the entry's file selector "is save" flag.
583  *
584  * @param obj The entry object
585  * @return value The "is save" flag
586  *
587  * @ingroup File_Selector_Entry
588  */
589 EAPI Eina_Bool
590 elm_fileselector_entry_is_save_get(const Evas_Object *obj)
591 {
592    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
593    Widget_Data *wd = elm_widget_data_get(obj);
594    if (!wd) return EINA_FALSE;
595    return elm_fileselector_button_is_save_get(wd->button);
596 }
597
598 /**
599  * Set whether the entry's file selector will raise an Elementary
600  * Inner Window, instead of a dedicated Elementary Window. By default,
601  * it won't.
602  *
603  * @param obj The entry object
604  * @param value The "inwin mode" flag
605  *
606  * @ingroup File_Selector_Entry
607  */
608 EAPI void
609 elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value)
610 {
611    ELM_CHECK_WIDTYPE(obj, widtype);
612    Widget_Data *wd = elm_widget_data_get(obj);
613    if (!wd) return;
614    elm_fileselector_button_inwin_mode_set(wd->button, value);
615 }
616
617 /**
618  * Get the entry's file selector "inwin mode" flag.
619  *
620  * @param obj The entry object
621  * @return value The "inwin mode" flag
622  *
623  * @ingroup File_Selector_Entry
624  */
625 EAPI Eina_Bool
626 elm_fileselector_entry_inwin_mode_get(const Evas_Object *obj)
627 {
628    ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
629    Widget_Data *wd = elm_widget_data_get(obj);
630    if (!wd) return EINA_FALSE;
631    return elm_fileselector_button_inwin_mode_get(wd->button);
632 }
633
634 /**
635  * Set the icon used for the entry button
636  *
637  * Once the icon object is set, a previously set one will be deleted.
638  *
639  * @param obj The entry object
640  * @param icon  The image for the entry
641  *
642  * @ingroup File_Selector_Entry
643  */
644 EAPI void
645 elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon)
646 {
647    ELM_CHECK_WIDTYPE(obj, widtype);
648    Widget_Data *wd = elm_widget_data_get(obj);
649    if (!wd) return;
650    elm_fileselector_button_icon_set(wd->button, icon);
651 }
652
653 /**
654  * Get the icon used for the entry button
655  *
656  * @param obj The entry object
657  * @return The image for the entry
658  *
659  * @ingroup File_Selector_Entry
660  */
661 EAPI Evas_Object *
662 elm_fileselector_entry_button_icon_get(const Evas_Object *obj)
663 {
664    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
665    Widget_Data *wd = elm_widget_data_get(obj);
666    if (!wd) return NULL;
667    return elm_fileselector_button_icon_get(wd->button);
668 }
669
670 /**
671  * Unset the icon used for the entry button
672  *
673  * Unparent and return the icon object which was set for this widget.
674  *
675  * @param obj The entry object
676  * @return The icon object that was being used
677  *
678  * @ingroup File_Selector_Entry
679  */
680 EAPI Evas_Object *
681 elm_fileselector_entry_button_icon_unset(Evas_Object *obj)
682 {
683    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
684    Widget_Data *wd = elm_widget_data_get(obj);
685    if (!wd) return NULL;
686    return elm_fileselector_button_icon_unset(wd->button);
687 }