2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2010-04-08 13:36:37 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2014-01-21 05:50:35 -08:00
|
|
|
#include "elm_interface_fileselector.h"
|
2012-08-01 14:04:26 -07:00
|
|
|
#include "elm_widget_fileselector_button.h"
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
#define MY_CLASS ELM_OBJ_FILESELECTOR_BUTTON_CLASS
|
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Fileselector_Button"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_fileselector_button"
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2010-10-11 21:02:47 -07:00
|
|
|
#define DEFAULT_WINDOW_TITLE "Select a file"
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2013-09-02 16:39:02 -07:00
|
|
|
#define ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS(cmd) \
|
|
|
|
cmd(SIG_FILE_CHOSEN, "file,chosen", "s") \
|
|
|
|
|
|
|
|
ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
|
2013-04-23 05:00:50 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
2013-09-02 16:39:02 -07:00
|
|
|
ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS(ELM_PRIV_SMART_CALLBACKS_DESC)
|
2014-01-23 02:30:34 -08:00
|
|
|
{SIG_WIDGET_LANG_CHANGED, ""}, /**<handled by elm_widget */
|
2014-02-07 21:05:06 -08:00
|
|
|
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**<handled by elm_widget */
|
2014-02-05 23:18:57 -08:00
|
|
|
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
|
|
|
|
{SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
|
2012-05-03 15:44:01 -07:00
|
|
|
{NULL, NULL}
|
2010-10-19 07:17:14 -07:00
|
|
|
};
|
2013-10-18 10:20:34 -07:00
|
|
|
#undef ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS
|
2010-09-22 10:45:49 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_elm_widget_theme_apply(Eo *obj, Elc_Fileselector_Button_Data *sd EINA_UNUSED)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool int_ret;
|
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
char buf[4096];
|
|
|
|
const char *style;
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
style = eina_stringshare_add(elm_widget_style_get(obj));
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
snprintf(buf, sizeof(buf), "fileselector_button/%s", style);
|
2011-02-08 04:08:28 -08:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
/* file selector button's style has an extra bit */
|
2012-11-25 22:32:53 -08:00
|
|
|
eina_stringshare_replace(&(wd->style), buf);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2014-03-14 02:13:29 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, elm_obj_widget_theme_apply(&int_ret));
|
2014-03-29 22:34:10 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
eina_stringshare_replace(&(wd->style), style);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
eina_stringshare_del(style);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
return EINA_TRUE;
|
2010-09-22 10:45:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:44:01 -07:00
|
|
|
_selection_done(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
2012-05-03 15:44:01 -07:00
|
|
|
void *event_info)
|
2010-09-22 10:45:43 -07:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
Elc_Fileselector_Button_Data *sd = data;
|
2012-05-03 15:44:01 -07:00
|
|
|
const char *file = event_info;
|
|
|
|
Evas_Object *del;
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (file) eina_stringshare_replace(&sd->fsd.path, file);
|
2012-05-02 10:01:20 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
del = sd->fsw;
|
|
|
|
sd->fs = NULL;
|
|
|
|
sd->fsw = NULL;
|
|
|
|
evas_object_del(del);
|
|
|
|
|
|
|
|
evas_object_smart_callback_call
|
2012-11-25 22:32:53 -08:00
|
|
|
(sd->obj, SIG_FILE_CHOSEN, (void *)file);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2014-03-29 22:34:10 -07:00
|
|
|
_new_window_add(Elc_Fileselector_Button_Data *sd)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win, *bg;
|
|
|
|
|
|
|
|
win = elm_win_add(NULL, "fileselector_button", ELM_WIN_DIALOG_BASIC);
|
2012-05-03 15:44:01 -07:00
|
|
|
elm_win_title_set(win, sd->window_title);
|
2010-04-08 13:36:37 -07:00
|
|
|
elm_win_autodel_set(win, EINA_TRUE);
|
2012-05-03 15:44:01 -07:00
|
|
|
evas_object_smart_callback_add(win, "delete,request", _selection_done, sd);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
|
|
|
bg = elm_bg_add(win);
|
|
|
|
elm_win_resize_object_add(win, bg);
|
|
|
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_show(bg);
|
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
evas_object_resize(win, sd->w, sd->h);
|
2010-04-08 13:36:37 -07:00
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_parent_win_get(Evas_Object *obj)
|
|
|
|
{
|
2013-11-12 11:03:49 -08:00
|
|
|
while ((obj) && (strcmp(evas_object_type_get(obj), "elm_win")))
|
2012-05-03 15:44:01 -07:00
|
|
|
obj = elm_object_parent_widget_get(obj);
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2010-04-08 13:36:37 -07:00
|
|
|
static void
|
2014-03-29 22:34:10 -07:00
|
|
|
_activate(Elc_Fileselector_Button_Data *sd)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2010-10-19 07:17:14 -07:00
|
|
|
Eina_Bool is_inwin = EINA_FALSE;
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fs) return;
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->inwin_mode)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2012-11-25 22:32:53 -08:00
|
|
|
sd->fsw = _parent_win_get(sd->obj);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (!sd->fsw)
|
|
|
|
sd->fsw = _new_window_add(sd);
|
2010-12-07 11:18:14 -08:00
|
|
|
else
|
2010-10-19 07:17:14 -07:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->fsw = elm_win_inwin_add(sd->fsw);
|
2010-10-19 07:17:14 -07:00
|
|
|
is_inwin = EINA_TRUE;
|
|
|
|
}
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
2010-10-19 07:17:14 -07:00
|
|
|
else
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->fsw = _new_window_add(sd);
|
|
|
|
|
|
|
|
sd->fs = elm_fileselector_add(sd->fsw);
|
|
|
|
elm_widget_mirrored_set
|
2012-11-25 22:32:53 -08:00
|
|
|
(sd->fs, elm_widget_mirrored_get(sd->obj));
|
2012-05-03 15:44:01 -07:00
|
|
|
elm_widget_mirrored_automatic_set(sd->fs, EINA_FALSE);
|
|
|
|
elm_fileselector_expandable_set(sd->fs, sd->fsd.expandable);
|
|
|
|
elm_fileselector_folder_only_set(sd->fs, sd->fsd.folder_only);
|
|
|
|
elm_fileselector_is_save_set(sd->fs, sd->fsd.is_save);
|
|
|
|
elm_fileselector_selected_set(sd->fs, sd->fsd.path);
|
|
|
|
evas_object_size_hint_weight_set
|
|
|
|
(sd->fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(sd->fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
|
|
|
evas_object_smart_callback_add(sd->fs, "done", _selection_done, sd);
|
|
|
|
evas_object_show(sd->fs);
|
2010-04-08 13:36:37 -07:00
|
|
|
|
2010-10-19 07:17:14 -07:00
|
|
|
if (is_inwin)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
elm_win_inwin_content_set(sd->fsw, sd->fs);
|
|
|
|
elm_win_inwin_activate(sd->fsw);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
elm_win_resize_object_add(sd->fsw, sd->fs);
|
|
|
|
evas_object_show(sd->fsw);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-05-03 15:44:01 -07:00
|
|
|
_button_clicked(void *data,
|
2014-01-06 06:30:02 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2012-05-02 10:01:20 -07:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
_activate(data);
|
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_evas_smart_add(Eo *obj, Elc_Fileselector_Button_Data *priv)
|
2012-05-03 15:44:01 -07:00
|
|
|
{
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2013-08-26 08:29:45 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
priv->window_title = eina_stringshare_add(DEFAULT_WINDOW_TITLE);
|
|
|
|
if (getenv("HOME")) priv->fsd.path = eina_stringshare_add(getenv("HOME"));
|
|
|
|
else priv->fsd.path = eina_stringshare_add("/");
|
2012-05-02 10:01:20 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
priv->fsd.expandable = _elm_config->fileselector_expand_enable;
|
|
|
|
priv->inwin_mode = _elm_config->inwin_dialogs_enable;
|
|
|
|
priv->w = 400;
|
|
|
|
priv->h = 400;
|
|
|
|
|
|
|
|
elm_widget_mirrored_automatic_set(obj, EINA_FALSE);
|
|
|
|
|
|
|
|
evas_object_smart_callback_add(obj, "clicked", _button_clicked, priv);
|
|
|
|
|
2014-03-14 02:13:29 -07:00
|
|
|
eo_do(obj, elm_obj_widget_theme_apply(NULL));
|
2012-05-03 15:44:01 -07:00
|
|
|
elm_widget_can_focus_set(obj, EINA_TRUE);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_evas_smart_del(Eo *obj, Elc_Fileselector_Button_Data *sd)
|
2011-07-04 03:13:59 -07:00
|
|
|
{
|
2014-01-21 17:12:44 -08:00
|
|
|
eina_stringshare_del(sd->window_title);
|
|
|
|
eina_stringshare_del(sd->fsd.path);
|
|
|
|
evas_object_del(sd->fsw);
|
2012-05-03 15:44:01 -07:00
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
|
2011-07-04 03:13:59 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_elm_button_admits_autorepeat_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd EINA_UNUSED)
|
2012-08-01 14:04:26 -07:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return EINA_FALSE;
|
2012-01-09 00:06:43 -08:00
|
|
|
}
|
|
|
|
|
2010-04-08 13:36:37 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_fileselector_button_add(Evas_Object *parent)
|
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2012-11-25 22:32:53 -08:00
|
|
|
Evas_Object *obj = eo_add(MY_CLASS, parent);
|
|
|
|
eo_unref(obj);
|
|
|
|
return obj;
|
|
|
|
}
|
2012-05-03 15:44:01 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_eo_base_constructor(Eo *obj, Elc_Fileselector_Button_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
|
|
|
sd->obj = obj;
|
|
|
|
|
2013-03-18 09:07:38 -07:00
|
|
|
eo_do_super(obj, MY_CLASS, eo_constructor());
|
2012-11-25 22:32:53 -08:00
|
|
|
eo_do(obj,
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_obj_type_set(MY_CLASS_NAME_LEGACY),
|
2012-11-25 22:32:53 -08:00
|
|
|
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_window_title_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, const char *title)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
eina_stringshare_replace(&sd->window_title, title);
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fsw) elm_win_title_set(sd->fsw, sd->window_title);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static const char *
|
|
|
|
_elc_fileselector_button_window_title_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->window_title;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_window_size_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Evas_Coord width, Evas_Coord height)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->w = width;
|
|
|
|
sd->h = height;
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fsw) evas_object_resize(sd->fsw, sd->w, sd->h);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_window_size_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Evas_Coord *width, Evas_Coord *height)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
if (width) *width = sd->w;
|
|
|
|
if (height) *height = sd->h;
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_fileselector_button_path_set(Evas_Object *obj,
|
2012-05-03 15:44:01 -07:00
|
|
|
const char *path)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do(obj, elm_interface_fileselector_path_set(path));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_path_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, const char *path)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
eina_stringshare_replace(&sd->fsd.path, path);
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fs) elm_fileselector_selected_set(sd->fs, sd->fsd.path);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI const char *
|
2010-05-21 12:26:57 -07:00
|
|
|
elm_fileselector_button_path_get(const Evas_Object *obj)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
2012-11-25 22:32:53 -08:00
|
|
|
const char *ret = NULL;
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_fileselector_path_get(&ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static const char *
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_path_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->fsd.path;
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_fileselector_button_expandable_set(Evas_Object *obj,
|
2012-05-03 15:44:01 -07:00
|
|
|
Eina_Bool value)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do(obj, elm_interface_fileselector_expandable_set(value));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_expandable_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->fsd.expandable = value;
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fs) elm_fileselector_expandable_set(sd->fs, sd->fsd.expandable);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-05-21 12:26:57 -07:00
|
|
|
elm_fileselector_button_expandable_get(const Evas_Object *obj)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_fileselector_expandable_get(&ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
return ret;
|
|
|
|
}
|
2010-10-11 21:02:47 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_expandable_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->fsd.expandable;
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_fileselector_button_folder_only_set(Evas_Object *obj,
|
2012-05-03 15:44:01 -07:00
|
|
|
Eina_Bool value)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do(obj, elm_interface_fileselector_folder_only_set(value));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_folder_only_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->fsd.folder_only = value;
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fs) elm_fileselector_folder_only_set(sd->fs, sd->fsd.folder_only);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-05-21 12:26:57 -07:00
|
|
|
elm_fileselector_button_folder_only_get(const Evas_Object *obj)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_fileselector_folder_only_get(&ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
return ret;
|
|
|
|
}
|
2010-10-11 21:02:47 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_folder_only_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->fsd.folder_only;
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2010-12-07 11:18:14 -08:00
|
|
|
elm_fileselector_button_is_save_set(Evas_Object *obj,
|
2012-05-03 15:44:01 -07:00
|
|
|
Eina_Bool value)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do(obj, elm_interface_fileselector_is_save_set(value));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_is_save_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->fsd.is_save = value;
|
2010-10-19 07:17:14 -07:00
|
|
|
|
2012-05-03 15:44:01 -07:00
|
|
|
if (sd->fs) elm_fileselector_is_save_set(sd->fs, sd->fsd.is_save);
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:42:56 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-05-21 12:26:57 -07:00
|
|
|
elm_fileselector_button_is_save_get(const Evas_Object *obj)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2012-11-25 22:32:53 -08:00
|
|
|
Eina_Bool ret = EINA_FALSE;
|
2014-03-29 21:56:50 -07:00
|
|
|
eo_do((Eo *) obj, elm_interface_fileselector_is_save_get(&ret));
|
2012-11-25 22:32:53 -08:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2010-04-08 13:36:37 -07:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->fsd.is_save;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elc_fileselector_button_inwin_mode_set(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2012-05-03 15:44:01 -07:00
|
|
|
sd->inwin_mode = value;
|
2010-04-08 13:36:37 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_elc_fileselector_button_inwin_mode_get(Eo *obj EINA_UNUSED, Elc_Fileselector_Button_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 22:34:10 -07:00
|
|
|
return sd->inwin_mode;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2010-10-11 21:02:47 -07:00
|
|
|
|
2014-03-29 22:34:10 -07:00
|
|
|
#include "elc_fileselector_button.eo.c"
|