summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-24 11:32:38 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-26 11:42:02 +0100
commit1c27529363faa90450685140b7fa552fb24ab546 (patch)
tree7f75ecd4c2fb58bb6b9eb7cb8dfc0e934a901c57 /src/lib/elementary
parent67d9b49c1bc9dd5d505aa9c31da9fb26fb4da444 (diff)
elm_fileselector_button: support the whole interface
this adds full support of the full elm_fileselector interface to elm_fileselector_button. ref T5719 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7753
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/elc_fileselector_button.c50
-rw-r--r--src/lib/elementary/elm_fileselector_button.eo4
-rw-r--r--src/lib/elementary/elm_widget_fileselector_button.h1
3 files changed, 54 insertions, 1 deletions
diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c
index 86632611bc..16d76cbf51 100644
--- a/src/lib/elementary/elc_fileselector_button.c
+++ b/src/lib/elementary/elc_fileselector_button.c
@@ -98,7 +98,7 @@ _selection_done(void *data, const Efl_Event *event EINA_UNUSED)
98 _model_event_call 98 _model_event_call
99 (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, NULL, NULL); 99 (sd->obj, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN, NULL, NULL);
100 } 100 }
101 101 eina_stringshare_replace(&sd->fsd.current_name, elm_interface_fileselector_current_name_get(sd->fs));
102 del = sd->fsw; 102 del = sd->fsw;
103 sd->fs = NULL; 103 sd->fs = NULL;
104 sd->fsw = NULL; 104 sd->fsw = NULL;
@@ -629,6 +629,54 @@ _elm_fileselector_button_elm_interface_fileselector_hidden_visible_set(Eo *obj E
629 if (sd->fs) elm_fileselector_hidden_visible_set(sd->fs, visible); 629 if (sd->fs) elm_fileselector_hidden_visible_set(sd->fs, visible);
630} 630}
631 631
632EOLIAN static void
633_elm_fileselector_button_elm_interface_fileselector_current_name_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd, const char *name)
634{
635 eina_stringshare_replace(&sd->fsd.current_name, name);
636 if (sd->fs) elm_fileselector_current_name_set(sd->fs, sd->fsd.current_name);
637}
638
639EOLIAN static const char*
640_elm_fileselector_button_elm_interface_fileselector_current_name_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
641{
642 if (sd->fs)
643 return elm_fileselector_current_name_get(sd->fs);
644
645 return sd->fsd.current_name;
646}
647
648#define FS_USAGE_API(ret)\
649 if (!pd->fs) \
650 { \
651 ERR("This function is only supported when there is a fileselector"); \
652 return ret; \
653 } \
654
655EOLIAN static Eina_Bool
656_elm_fileselector_button_elm_interface_fileselector_custom_filter_append(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd, Elm_Fileselector_Filter_Func func, void *data, const char *filter_name)
657{
658 FS_USAGE_API(EINA_FALSE)
659
660 return elm_interface_fileselector_custom_filter_append(pd->fs, func, data, filter_name);
661}
662
663EOLIAN static Eina_Bool
664_elm_fileselector_button_elm_interface_fileselector_mime_types_filter_append(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd, const char *mime_types, const char *filter_name)
665{
666 FS_USAGE_API(EINA_FALSE)
667
668 return elm_interface_fileselector_mime_types_filter_append(pd->fs, mime_types, filter_name);
669}
670
671EOLIAN static void
672_elm_fileselector_button_elm_interface_fileselector_filters_clear(Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *pd)
673{
674 FS_USAGE_API()
675
676 elm_interface_fileselector_filters_clear(pd->fs);
677}
678
679
632EOLIAN static Eina_Bool 680EOLIAN static Eina_Bool
633_elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd) 681_elm_fileselector_button_elm_interface_fileselector_hidden_visible_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Button_Data *sd)
634{ 682{
diff --git a/src/lib/elementary/elm_fileselector_button.eo b/src/lib/elementary/elm_fileselector_button.eo
index 545409f229..be3de44d08 100644
--- a/src/lib/elementary/elm_fileselector_button.eo
+++ b/src/lib/elementary/elm_fileselector_button.eo
@@ -18,6 +18,10 @@ class Elm.Fileselector_Button extends Efl.Ui.Button implements Elm.Interface.Fil
18 Elm.Interface.Fileselector.multi_select { get; set; } 18 Elm.Interface.Fileselector.multi_select { get; set; }
19 Elm.Interface.Fileselector.folder_only { get; set; } 19 Elm.Interface.Fileselector.folder_only { get; set; }
20 Elm.Interface.Fileselector.mode { get; set; } 20 Elm.Interface.Fileselector.mode { get; set; }
21 Elm.Interface.Fileselector.current_name { get; set; }
22 Elm.Interface.Fileselector.custom_filter_append;
23 Elm.Interface.Fileselector.mime_types_filter_append;
24 Elm.Interface.Fileselector.filters_clear;
21 } 25 }
22 events { 26 events {
23 /* FIXME: Can be Efl.Model, string and NULL */ 27 /* FIXME: Can be Efl.Model, string and NULL */
diff --git a/src/lib/elementary/elm_widget_fileselector_button.h b/src/lib/elementary/elm_widget_fileselector_button.h
index e055ae10de..86c8b53810 100644
--- a/src/lib/elementary/elm_widget_fileselector_button.h
+++ b/src/lib/elementary/elm_widget_fileselector_button.h
@@ -41,6 +41,7 @@ struct _Elm_Fileselector_Button_Data
41 const char *path; 41 const char *path;
42 Efl_Model *selection; 42 Efl_Model *selection;
43 const char *selection_path; 43 const char *selection_path;
44 const char *current_name;
44 Evas_Coord_Size thumbnail_size; 45 Evas_Coord_Size thumbnail_size;
45 Elm_Fileselector_Mode mode; 46 Elm_Fileselector_Mode mode;
46 Elm_Fileselector_Sort sort_type; 47 Elm_Fileselector_Sort sort_type;