forked from enlightenment/efl
Indenting and removing bogus code blocks.
SVN revision: 55364
This commit is contained in:
parent
6461dbad0b
commit
68437b969b
|
@ -4,20 +4,24 @@
|
|||
#endif
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
static void
|
||||
my_fileselector_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
my_fileselector_done(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
/* event_info conatin the full path of the selected file
|
||||
* or NULL if none is selected or cancel is pressed */
|
||||
const char *selected = event_info;
|
||||
const char *selected = event_info;
|
||||
|
||||
if (selected)
|
||||
printf("Selected file: %s\n", selected);
|
||||
else
|
||||
evas_object_del(data); /* delete the test window */
|
||||
if (selected)
|
||||
printf("Selected file: %s\n", selected);
|
||||
else
|
||||
evas_object_del(data); /* delete the test window */
|
||||
}
|
||||
|
||||
static void
|
||||
my_fileselector_selected(void *data __UNUSED__, Evas_Object *obj, void *event_info)
|
||||
my_fileselector_selected(void *data __UNUSED__,
|
||||
Evas_Object *obj,
|
||||
void *event_info)
|
||||
{
|
||||
/* event_info conatin the full path of the selected file */
|
||||
const char *selected = event_info;
|
||||
|
@ -28,54 +32,66 @@ my_fileselector_selected(void *data __UNUSED__, Evas_Object *obj, void *event_in
|
|||
}
|
||||
|
||||
static void
|
||||
_is_save_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_is_save_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
printf("Toggle Is save\n");
|
||||
if (elm_fileselector_is_save_get(fs))
|
||||
elm_fileselector_is_save_set(fs, EINA_FALSE);
|
||||
elm_fileselector_is_save_set(fs, EINA_FALSE);
|
||||
else
|
||||
elm_fileselector_is_save_set(fs, EINA_TRUE);
|
||||
elm_fileselector_is_save_set(fs, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_folder_only_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_folder_only_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
printf("Toggle Folder only\n");
|
||||
if (elm_fileselector_folder_only_get(fs))
|
||||
elm_fileselector_folder_only_set(fs, EINA_FALSE);
|
||||
elm_fileselector_folder_only_set(fs, EINA_FALSE);
|
||||
else
|
||||
elm_fileselector_folder_only_set(fs, EINA_TRUE);
|
||||
elm_fileselector_folder_only_set(fs, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_expandable_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_expandable_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
printf("Toggle Expandable\n");
|
||||
if (elm_fileselector_expandable_get(fs))
|
||||
elm_fileselector_expandable_set(fs, EINA_FALSE);
|
||||
elm_fileselector_expandable_set(fs, EINA_FALSE);
|
||||
else
|
||||
elm_fileselector_expandable_set(fs, EINA_TRUE);
|
||||
elm_fileselector_expandable_set(fs, EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
_sel_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_sel_get_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
printf("Get Selected: %s\n", elm_fileselector_selected_get(fs));
|
||||
}
|
||||
|
||||
static void
|
||||
_path_get_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_path_get_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
printf("Get Path: %s\n", elm_fileselector_path_get(fs));
|
||||
}
|
||||
|
||||
void
|
||||
test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
test_fileselector(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *win, *fs, *bg, *vbox, *hbox, *bt, *sep;
|
||||
|
||||
|
@ -115,7 +131,8 @@ test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
|
|||
/* the 'done' cb is called when the user press ok/cancel */
|
||||
evas_object_smart_callback_add(fs, "done", my_fileselector_done, win);
|
||||
/* the 'selected' cb is called when the user click on a file/dir */
|
||||
evas_object_smart_callback_add(fs, "selected", my_fileselector_selected, win);
|
||||
evas_object_smart_callback_add(fs, "selected", my_fileselector_selected,
|
||||
win);
|
||||
|
||||
/* test buttons */
|
||||
sep = elm_separator_add(win);
|
||||
|
@ -169,4 +186,5 @@ test_fileselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *even
|
|||
evas_object_resize(win, 240, 350);
|
||||
evas_object_show(win);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
static void
|
||||
_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_file_chosen(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Evas_Object *entry = data;
|
||||
const char *file = event_info;
|
||||
|
@ -19,7 +21,9 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_inwin_mode_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_bt = data;
|
||||
Eina_Bool value = elm_fileselector_button_inwin_mode_get(fs_bt);
|
||||
|
@ -28,7 +32,9 @@ _inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
|||
}
|
||||
|
||||
static void
|
||||
_current_sel_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_current_sel_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_bt = data;
|
||||
Eina_Bool value = elm_fileselector_button_is_save_get(fs_bt);
|
||||
|
@ -38,7 +44,9 @@ _current_sel_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
|
|||
}
|
||||
|
||||
static void
|
||||
_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_folder_only_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_bt = data;
|
||||
Eina_Bool value = elm_fileselector_button_folder_only_get(fs_bt);
|
||||
|
@ -47,7 +55,9 @@ _folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
|
|||
}
|
||||
|
||||
static void
|
||||
_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_expandable_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_bt = data;
|
||||
Eina_Bool value = elm_fileselector_button_expandable_get(fs_bt);
|
||||
|
@ -56,7 +66,9 @@ _expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
|||
}
|
||||
|
||||
void
|
||||
test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
test_fileselector_button(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_bt, *en, *lb;
|
||||
|
||||
|
@ -74,11 +86,6 @@ test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, voi
|
|||
evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(vbox);
|
||||
|
||||
vbox = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
evas_object_show(vbox);
|
||||
|
||||
/* file selector button */
|
||||
ic = elm_icon_add(win);
|
||||
elm_icon_standard_set(ic, "file");
|
||||
|
@ -136,4 +143,5 @@ test_fileselector_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, voi
|
|||
evas_object_resize(win, 400, 400);
|
||||
evas_object_show(win);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
|
||||
#ifndef ELM_LIB_QUICKLAUNCH
|
||||
static void
|
||||
_file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_file_chosen(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Evas_Object *entry = data;
|
||||
char *file = event_info;
|
||||
|
@ -14,7 +16,9 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_inwin_mode_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_en = data;
|
||||
Eina_Bool value = elm_fileselector_entry_inwin_mode_get(fs_en);
|
||||
|
@ -23,7 +27,9 @@ _inwin_mode_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
|||
}
|
||||
|
||||
static void
|
||||
_folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_folder_only_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_en = data;
|
||||
Evas_Object *ic = elm_fileselector_entry_button_icon_get(fs_en);
|
||||
|
@ -43,7 +49,9 @@ _folder_only_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __
|
|||
}
|
||||
|
||||
static void
|
||||
_expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_expandable_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_en = data;
|
||||
Eina_Bool value = elm_fileselector_entry_expandable_get(fs_en);
|
||||
|
@ -52,7 +60,9 @@ _expandable_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __U
|
|||
}
|
||||
|
||||
static void
|
||||
_disabled_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_disabled_toggle(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs_en = data;
|
||||
Eina_Bool value = elm_object_disabled_get(fs_en);
|
||||
|
@ -61,7 +71,9 @@ _disabled_toggle(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU
|
|||
}
|
||||
|
||||
void
|
||||
test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
test_fileselector_entry(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_en, *en, *lb;
|
||||
|
||||
|
@ -74,11 +86,6 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(bg);
|
||||
|
||||
vbox = elm_box_add(win);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_show(vbox);
|
||||
|
||||
vbox = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, vbox);
|
||||
|
@ -138,7 +145,6 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
elm_box_pack_end(hbox, bt);
|
||||
evas_object_show(bt);
|
||||
|
||||
|
||||
en = elm_entry_add(win);
|
||||
elm_entry_line_wrap_set(en, EINA_FALSE);
|
||||
elm_entry_editable_set(en, EINA_FALSE);
|
||||
|
@ -149,4 +155,5 @@ test_fileselector_entry(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void
|
|||
evas_object_resize(win, 400, 500);
|
||||
evas_object_show(win);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/**
|
||||
* @defgroup Fileselector Fileselector
|
||||
*
|
||||
* A fileselector is a widget that allows a user to navigate through a tree
|
||||
* of files. It contains buttons for Home(~) and Up(..) as well as cancel/ok
|
||||
* buttons to confirm/cancel a selection. This widget is currently very much
|
||||
* in progress.
|
||||
* A fileselector is a widget that allows a user to navigate through a
|
||||
* tree of files. It contains buttons for Home(~) and Up(..) as well
|
||||
* as cancel/ok buttons to confirm/cancel a selection. This widget is
|
||||
* currently very much in progress.
|
||||
*
|
||||
* TODO
|
||||
* userdefined icon/label cb
|
||||
|
@ -18,7 +18,8 @@
|
|||
* Signals that you can add callbacks for are:
|
||||
*
|
||||
* "selected" - the user clicks on a file
|
||||
* "directory,open" - the list is populated with a new content. event_info is a directory.
|
||||
* "directory,open" - the list is populated with new content.
|
||||
* event_info is a directory.
|
||||
* "done" - the user clicks on the ok or cancel button
|
||||
*/
|
||||
|
||||
|
@ -39,38 +40,41 @@ struct _Widget_Data
|
|||
Evas_Object *ok_button;
|
||||
Evas_Object *cancel_button;
|
||||
|
||||
const char *path;
|
||||
const char *selection;
|
||||
const char *path;
|
||||
const char *selection;
|
||||
Ecore_Idler *sel_idler;
|
||||
|
||||
const char *path_separator;
|
||||
const char *path_separator;
|
||||
|
||||
Eina_Bool only_folder : 1;
|
||||
Eina_Bool expand : 1;
|
||||
Eina_Bool only_folder : 1;
|
||||
Eina_Bool expand : 1;
|
||||
};
|
||||
|
||||
struct sel_data
|
||||
{
|
||||
Evas_Object *fs;
|
||||
const char *path;
|
||||
const char *path;
|
||||
};
|
||||
|
||||
Elm_Genlist_Item_Class itc;
|
||||
|
||||
static const char *widtype = NULL;
|
||||
|
||||
static const char SIG_DIRECTORY_OPEN[]= "directory,open";
|
||||
static const char SIG_DIRECTORY_OPEN[] = "directory,open";
|
||||
static const char SIG_DONE[] = "done";
|
||||
static const char SIG_SELECTED[] = "selected";
|
||||
static const Evas_Smart_Cb_Description _signals[] = {
|
||||
{SIG_DIRECTORY_OPEN, "s"},
|
||||
{SIG_DONE, "s"},
|
||||
{SIG_SELECTED, "s"},
|
||||
{NULL, NULL}
|
||||
{SIG_DIRECTORY_OPEN, "s"},
|
||||
{SIG_DONE, "s"},
|
||||
{SIG_SELECTED, "s"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent);
|
||||
static void _do_anchors(Evas_Object *obj, const char *path);
|
||||
static void _populate(Evas_Object *obj,
|
||||
const char *path,
|
||||
Elm_Genlist_Item *parent);
|
||||
static void _do_anchors(Evas_Object *obj,
|
||||
const char *path);
|
||||
|
||||
/*** ELEMENTARY WIDGET ***/
|
||||
static void
|
||||
|
@ -86,8 +90,8 @@ _del_hook(Evas_Object *obj)
|
|||
if (wd->selection) eina_stringshare_del(wd->selection);
|
||||
if (wd->sel_idler)
|
||||
{
|
||||
sd = ecore_idler_del(wd->sel_idler);
|
||||
free(sd);
|
||||
sd = ecore_idler_del(wd->sel_idler);
|
||||
free(sd);
|
||||
}
|
||||
free(wd);
|
||||
}
|
||||
|
@ -103,15 +107,15 @@ _sizing_eval(Evas_Object *obj)
|
|||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
}
|
||||
|
||||
#define SWALLOW(part_name, object_ptn) \
|
||||
if (object_ptn) \
|
||||
{ \
|
||||
elm_widget_style_set(object_ptn, buf); \
|
||||
if (edje_object_part_swallow(wd->edje, part_name, object_ptn)) \
|
||||
evas_object_show(object_ptn); \
|
||||
else \
|
||||
evas_object_hide(object_ptn); \
|
||||
}
|
||||
#define SWALLOW(part_name, object_ptn) \
|
||||
if (object_ptn) \
|
||||
{ \
|
||||
elm_widget_style_set(object_ptn, buf); \
|
||||
if (edje_object_part_swallow(wd->edje, part_name, object_ptn)) \
|
||||
evas_object_show(object_ptn); \
|
||||
else \
|
||||
evas_object_hide(object_ptn); \
|
||||
}
|
||||
|
||||
static void
|
||||
_theme_hook(Evas_Object *obj)
|
||||
|
@ -125,7 +129,7 @@ _theme_hook(Evas_Object *obj)
|
|||
_elm_theme_object_set(obj, wd->edje, "fileselector", "base", style);
|
||||
|
||||
if (elm_object_disabled_get(obj))
|
||||
edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm");
|
||||
edje_object_signal_emit(wd->edje, "elm,state,disabled", "elm");
|
||||
|
||||
data = edje_object_data_get(wd->edje, "path_separator");
|
||||
if (data)
|
||||
|
@ -153,25 +157,32 @@ _theme_hook(Evas_Object *obj)
|
|||
}
|
||||
|
||||
/*** GENLIST "MODEL" ***/
|
||||
static char*
|
||||
_itc_label_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__)
|
||||
static char *
|
||||
_itc_label_get(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
return strdup(ecore_file_file_get(data)); // NOTE this will be free() by the caller
|
||||
return strdup(ecore_file_file_get(data)); /* NOTE this will be
|
||||
* free() by the
|
||||
* caller */
|
||||
}
|
||||
|
||||
static Evas_Object*
|
||||
_itc_icon_get(void *data, Evas_Object *obj, const char *source)
|
||||
static Evas_Object *
|
||||
_itc_icon_get(void *data,
|
||||
Evas_Object *obj,
|
||||
const char *source)
|
||||
{
|
||||
Evas_Object *ic;
|
||||
|
||||
if (!strcmp(source, "elm.swallow.icon"))
|
||||
{
|
||||
ic = elm_icon_add(obj);
|
||||
if (ecore_file_is_dir((char*)data))
|
||||
if (ecore_file_is_dir((char *)data))
|
||||
elm_icon_standard_set(ic, "folder");
|
||||
else
|
||||
elm_icon_standard_set(ic, "file");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,
|
||||
1, 1);
|
||||
evas_object_show(ic);
|
||||
return ic;
|
||||
}
|
||||
|
@ -179,19 +190,24 @@ _itc_icon_get(void *data, Evas_Object *obj, const char *source)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_itc_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *source __UNUSED__)
|
||||
_itc_state_get(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_itc_del(void *data, Evas_Object *obj __UNUSED__)
|
||||
_itc_del(void *data,
|
||||
Evas_Object *obj __UNUSED__)
|
||||
{
|
||||
eina_stringshare_del(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_expand_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_expand_done(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Genlist_Item *it = event_info;
|
||||
const char *path = elm_genlist_item_data_get(it);
|
||||
|
@ -199,21 +215,27 @@ _expand_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_contract_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_contract_done(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Genlist_Item *it = event_info;
|
||||
elm_genlist_item_subitems_clear(it);
|
||||
}
|
||||
|
||||
static void
|
||||
_expand_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_expand_req(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Genlist_Item *it = event_info;
|
||||
elm_genlist_item_expanded_set(it, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_contract_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_contract_req(void *data __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Genlist_Item *it = event_info;
|
||||
elm_genlist_item_expanded_set(it, 0);
|
||||
|
@ -237,7 +259,8 @@ _sel_do(void *data)
|
|||
if (wd->expand)
|
||||
{
|
||||
_do_anchors(sd->fs, path);
|
||||
if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, "");
|
||||
if (wd->filename_entry)
|
||||
elm_scrolled_entry_entry_set(wd->filename_entry, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -251,19 +274,22 @@ _sel_do(void *data)
|
|||
else
|
||||
{
|
||||
if (wd->filename_entry)
|
||||
elm_scrolled_entry_entry_set(wd->filename_entry, ecore_file_file_get(path));
|
||||
elm_scrolled_entry_entry_set(wd->filename_entry,
|
||||
ecore_file_file_get(path));
|
||||
}
|
||||
|
||||
evas_object_smart_callback_call(sd->fs, SIG_SELECTED, (void *)path);
|
||||
|
||||
end:
|
||||
end:
|
||||
wd->sel_idler = NULL;
|
||||
free(sd);
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static void
|
||||
_sel(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_sel(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
struct sel_data *sd;
|
||||
Widget_Data *wd;
|
||||
|
@ -297,7 +323,9 @@ _sel(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_up(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_up(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
char *parent;
|
||||
|
@ -310,29 +338,37 @@ _up(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
|||
}
|
||||
|
||||
static void
|
||||
_home(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_home(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
_populate(fs, getenv("HOME"), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_ok(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_ok(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
evas_object_smart_callback_call(fs, SIG_DONE,
|
||||
(void *)elm_fileselector_selected_get(fs));
|
||||
(void *)elm_fileselector_selected_get(fs));
|
||||
}
|
||||
|
||||
static void
|
||||
_canc(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_canc(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
evas_object_smart_callback_call(fs, SIG_DONE, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_anchor_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Evas_Object *fs = data;
|
||||
Widget_Data *wd = elm_widget_data_get(fs);
|
||||
|
@ -347,10 +383,11 @@ _anchor_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_do_anchors(Evas_Object *obj, const char *path)
|
||||
_do_anchors(Evas_Object *obj,
|
||||
const char *path)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
char **tok, buf[PATH_MAX*3];
|
||||
char **tok, buf[PATH_MAX * 3];
|
||||
int i, j;
|
||||
if (!wd) return;
|
||||
buf[0] = '\0';
|
||||
|
@ -378,7 +415,9 @@ _do_anchors(Evas_Object *obj, const char *path)
|
|||
}
|
||||
|
||||
static void
|
||||
_populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
||||
_populate(Evas_Object *obj,
|
||||
const char *path,
|
||||
Elm_Genlist_Item *parent)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
DIR *dir;
|
||||
|
@ -401,10 +440,12 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
if (wd->filename_entry) elm_scrolled_entry_entry_set(wd->filename_entry, "");
|
||||
while ((dp = readdir(dir)))
|
||||
{
|
||||
if (dp->d_name[0] == '.') continue; // TODO make this configurable
|
||||
if (dp->d_name[0] == '.') continue; // TODO make this configurable
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s", path, dp->d_name);
|
||||
real = ecore_file_realpath(buf); //TODO this will resolv symlinks...I dont like it
|
||||
real = ecore_file_realpath(buf); /* TODO: this will resolv
|
||||
* symlinks...I dont like
|
||||
* it*/
|
||||
if (ecore_file_is_dir(real))
|
||||
dirs = eina_list_append(dirs, real);
|
||||
else if (!wd->only_folder)
|
||||
|
@ -412,7 +453,8 @@ _populate(Evas_Object *obj, const char *path, Elm_Genlist_Item *parent)
|
|||
}
|
||||
closedir(dir);
|
||||
|
||||
files = eina_list_sort(files, eina_list_count(files), EINA_COMPARE_CB(strcoll));
|
||||
files = eina_list_sort(files, eina_list_count(files),
|
||||
EINA_COMPARE_CB(strcoll));
|
||||
dirs = eina_list_sort(dirs, eina_list_count(dirs), EINA_COMPARE_CB(strcoll));
|
||||
EINA_LIST_FOREACH(dirs, l, real)
|
||||
{
|
||||
|
@ -564,7 +606,8 @@ elm_fileselector_add(Evas_Object *parent)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save)
|
||||
elm_fileselector_is_save_set(Evas_Object *obj,
|
||||
Eina_Bool is_save)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -595,7 +638,6 @@ elm_fileselector_is_save_get(const Evas_Object *obj)
|
|||
return elm_object_disabled_get(wd->filename_entry);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This enables/disables folder-only view in the fileselector.
|
||||
*
|
||||
|
@ -606,7 +648,8 @@ elm_fileselector_is_save_get(const Evas_Object *obj)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only)
|
||||
elm_fileselector_folder_only_set(Evas_Object *obj,
|
||||
Eina_Bool only)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -615,7 +658,6 @@ elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool only)
|
|||
wd->only_folder = !!only;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This gets the state of file display in the fileselector.
|
||||
*
|
||||
|
@ -634,7 +676,6 @@ elm_fileselector_folder_only_get(const Evas_Object *obj)
|
|||
return wd->only_folder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This enables/disables the ok,cancel buttons.
|
||||
*
|
||||
|
@ -645,7 +686,8 @@ elm_fileselector_folder_only_get(const Evas_Object *obj)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool visible)
|
||||
elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj,
|
||||
Eina_Bool visible)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -701,7 +743,6 @@ elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj)
|
|||
return wd->ok_button ? EINA_TRUE : EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This enables tree view in the fileselector. Arrows are created on the
|
||||
* sides of directories, allowing them to expand in place.
|
||||
|
@ -713,7 +754,8 @@ elm_fileselector_buttons_ok_cancel_get(const Evas_Object *obj)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool expand)
|
||||
elm_fileselector_expandable_set(Evas_Object *obj,
|
||||
Eina_Bool expand)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd;
|
||||
|
@ -751,7 +793,8 @@ elm_fileselector_expandable_get(const Evas_Object *obj)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_path_set(Evas_Object *obj, const char *path)
|
||||
elm_fileselector_path_set(Evas_Object *obj,
|
||||
const char *path)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
_populate(obj, path, NULL);
|
||||
|
@ -818,7 +861,8 @@ elm_fileselector_selected_get(const Evas_Object *obj)
|
|||
* @ingroup Fileselector
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
elm_fileselector_selected_set(Evas_Object *obj, const char *path)
|
||||
elm_fileselector_selected_set(Evas_Object *obj,
|
||||
const char *path)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -834,7 +878,8 @@ elm_fileselector_selected_set(Evas_Object *obj, const char *path)
|
|||
_populate(obj, ecore_file_dir_get(path), NULL);
|
||||
if (wd->filename_entry)
|
||||
{
|
||||
elm_scrolled_entry_entry_set(wd->filename_entry, ecore_file_file_get(path));
|
||||
elm_scrolled_entry_entry_set(wd->filename_entry,
|
||||
ecore_file_file_get(path));
|
||||
eina_stringshare_replace(&wd->selection, path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <Elementary.h>
|
||||
#include "elm_priv.h"
|
||||
|
||||
/**
|
||||
/**
|
||||
* @defgroup File_Selector_Button File Selector Button
|
||||
*
|
||||
* A button that, when clicked, creates an Elementary window (or inner
|
||||
|
@ -15,15 +15,16 @@ typedef struct _Widget_Data Widget_Data;
|
|||
struct _Widget_Data
|
||||
{
|
||||
Evas_Object *self, *btn, *fs, *fsw;
|
||||
const char *window_title;
|
||||
Evas_Coord w, h;
|
||||
struct {
|
||||
const char *window_title;
|
||||
Evas_Coord w, h;
|
||||
struct
|
||||
{
|
||||
const char *path;
|
||||
Eina_Bool expandable:1;
|
||||
Eina_Bool folder_only:1;
|
||||
Eina_Bool is_save:1;
|
||||
Eina_Bool expandable : 1;
|
||||
Eina_Bool folder_only : 1;
|
||||
Eina_Bool is_save : 1;
|
||||
} fsd;
|
||||
Eina_Bool inwin_mode:1;
|
||||
Eina_Bool inwin_mode : 1;
|
||||
};
|
||||
|
||||
#define DEFAULT_WINDOW_TITLE "Select a file"
|
||||
|
@ -34,15 +35,21 @@ static void _del_hook(Evas_Object *obj);
|
|||
static void _theme_hook(Evas_Object *obj);
|
||||
static void _disable_hook(Evas_Object *obj);
|
||||
static void _sizing_eval(Evas_Object *obj);
|
||||
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _on_focus_hook(void *data, Evas_Object *obj);
|
||||
static void _selection_done(void *data, Evas_Object *obj, void *event_info);
|
||||
static void _changed_size_hints(void *data,
|
||||
Evas *e,
|
||||
Evas_Object *obj,
|
||||
void *event_info);
|
||||
static void _on_focus_hook(void *data,
|
||||
Evas_Object *obj);
|
||||
static void _selection_done(void *data,
|
||||
Evas_Object *obj,
|
||||
void *event_info);
|
||||
static void _activate(Widget_Data *wd);
|
||||
|
||||
static const char SIG_FILE_CHOSEN[] = "file,chosen";
|
||||
static const Evas_Smart_Cb_Description _signals[] = {
|
||||
{SIG_FILE_CHOSEN, "s"},
|
||||
{NULL, NULL}
|
||||
{SIG_FILE_CHOSEN, "s"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -58,14 +65,15 @@ _del_hook(Evas_Object *obj)
|
|||
if (wd->fsd.path) eina_stringshare_del(wd->fsd.path);
|
||||
if (wd->fs)
|
||||
{
|
||||
win = evas_object_data_del(obj, "win");
|
||||
evas_object_del(win);
|
||||
win = evas_object_data_del(obj, "win");
|
||||
evas_object_del(win);
|
||||
}
|
||||
free(wd);
|
||||
}
|
||||
|
||||
static void
|
||||
_on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
|
||||
_on_focus_hook(void *data __UNUSED__,
|
||||
Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
|
@ -79,7 +87,8 @@ _theme_hook(Evas_Object *obj)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
char buf[4096];
|
||||
if (!wd) return;
|
||||
snprintf(buf, sizeof(buf), "fileselector_button/%s", elm_widget_style_get(obj));
|
||||
snprintf(buf, sizeof(buf), "fileselector_button/%s",
|
||||
elm_widget_style_get(obj));
|
||||
elm_object_style_set(wd->btn, buf);
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
@ -105,7 +114,10 @@ _sizing_eval(Evas_Object *obj)
|
|||
}
|
||||
|
||||
static void
|
||||
_changed_size_hints(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_changed_size_hints(void *data,
|
||||
Evas *e __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (!wd) return;
|
||||
|
@ -122,7 +134,9 @@ _activate_hook(Evas_Object *obj)
|
|||
}
|
||||
|
||||
static void
|
||||
_button_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
_button_clicked(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
_activate(data);
|
||||
}
|
||||
|
@ -163,11 +177,11 @@ _activate(Widget_Data *wd)
|
|||
|
||||
if (wd->inwin_mode)
|
||||
{
|
||||
wd->fsw = _parent_win_get(wd->self);
|
||||
wd->fsw = _parent_win_get(wd->self);
|
||||
|
||||
if (!wd->fsw)
|
||||
if (!wd->fsw)
|
||||
wd->fsw = _new_window_add(wd);
|
||||
else
|
||||
else
|
||||
{
|
||||
wd->fsw = elm_win_inwin_add(wd->fsw);
|
||||
is_inwin = EINA_TRUE;
|
||||
|
@ -182,25 +196,27 @@ _activate(Widget_Data *wd)
|
|||
elm_fileselector_is_save_set(wd->fs, wd->fsd.is_save);
|
||||
elm_fileselector_selected_set(wd->fs, wd->fsd.path);
|
||||
evas_object_size_hint_weight_set(wd->fs, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(wd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_smart_callback_add(wd->fs, "done", _selection_done, wd);
|
||||
evas_object_show(wd->fs);
|
||||
|
||||
if (is_inwin)
|
||||
{
|
||||
elm_win_inwin_content_set(wd->fsw, wd->fs);
|
||||
elm_win_inwin_activate(wd->fsw);
|
||||
elm_win_inwin_content_set(wd->fsw, wd->fs);
|
||||
elm_win_inwin_activate(wd->fsw);
|
||||
}
|
||||
else
|
||||
{
|
||||
elm_win_resize_object_add(wd->fsw, wd->fs);
|
||||
evas_object_show(wd->fsw);
|
||||
elm_win_resize_object_add(wd->fsw, wd->fs);
|
||||
evas_object_show(wd->fsw);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_selection_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
|
||||
_selection_done(void *data,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
const char *file = event_info;
|
||||
Widget_Data *wd = data;
|
||||
|
@ -260,7 +276,7 @@ elm_fileselector_button_add(Evas_Object *parent)
|
|||
wd->btn = elm_button_add(parent);
|
||||
elm_widget_resize_object_set(obj, wd->btn);
|
||||
evas_object_event_callback_add(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
_changed_size_hints, obj);
|
||||
evas_object_smart_callback_add(wd->btn, "clicked", _button_clicked, wd);
|
||||
elm_widget_sub_object_add(obj, wd->btn);
|
||||
|
||||
|
@ -278,7 +294,8 @@ elm_fileselector_button_add(Evas_Object *parent)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_label_set(Evas_Object *obj, const char *label)
|
||||
elm_fileselector_button_label_set(Evas_Object *obj,
|
||||
const char *label)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -286,7 +303,6 @@ elm_fileselector_button_label_set(Evas_Object *obj, const char *label)
|
|||
elm_button_label_set(wd->btn, label);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the label used in the file selector button.
|
||||
*
|
||||
|
@ -316,7 +332,8 @@ elm_fileselector_button_label_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_window_title_set(Evas_Object *obj, const char *title)
|
||||
elm_fileselector_button_window_title_set(Evas_Object *obj,
|
||||
const char *title)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -359,7 +376,9 @@ elm_fileselector_button_window_title_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height)
|
||||
elm_fileselector_button_window_size_set(Evas_Object *obj,
|
||||
Evas_Coord width,
|
||||
Evas_Coord height)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -382,7 +401,9 @@ elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *width, Evas_Coord *height)
|
||||
elm_fileselector_button_window_size_get(const Evas_Object *obj,
|
||||
Evas_Coord *width,
|
||||
Evas_Coord *height)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -404,7 +425,8 @@ elm_fileselector_button_window_size_get(const Evas_Object *obj, Evas_Coord *widt
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_path_set(Evas_Object *obj, const char *path)
|
||||
elm_fileselector_button_path_set(Evas_Object *obj,
|
||||
const char *path)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -414,7 +436,6 @@ elm_fileselector_button_path_set(Evas_Object *obj, const char *path)
|
|||
|
||||
if (wd->fs)
|
||||
elm_fileselector_selected_set(wd->fs, wd->fsd.path);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -445,7 +466,8 @@ elm_fileselector_button_path_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value)
|
||||
elm_fileselector_button_expandable_set(Evas_Object *obj,
|
||||
Eina_Bool value)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -485,7 +507,8 @@ elm_fileselector_button_expandable_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value)
|
||||
elm_fileselector_button_folder_only_set(Evas_Object *obj,
|
||||
Eina_Bool value)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -525,7 +548,8 @@ elm_fileselector_button_folder_only_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value)
|
||||
elm_fileselector_button_is_save_set(Evas_Object *obj,
|
||||
Eina_Bool value)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -566,7 +590,8 @@ elm_fileselector_button_is_save_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value)
|
||||
elm_fileselector_button_inwin_mode_set(Evas_Object *obj,
|
||||
Eina_Bool value)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -606,7 +631,8 @@ elm_fileselector_button_inwin_mode_get(const Evas_Object *obj)
|
|||
* @ingroup File_Selector_Button
|
||||
*/
|
||||
EAPI void
|
||||
elm_fileselector_button_icon_set(Evas_Object *obj, Evas_Object *icon)
|
||||
elm_fileselector_button_icon_set(Evas_Object *obj,
|
||||
Evas_Object *icon)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -653,3 +679,4 @@ elm_fileselector_button_icon_unset(Evas_Object *obj)
|
|||
if (!wd) return NULL;
|
||||
return elm_button_icon_unset(wd->btn);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue