2012-08-30 09:45:28 -07:00
|
|
|
//FIXME this widget should inherit from file selector button
|
2013-04-25 22:13:00 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2014-10-17 08:56:11 -07:00
|
|
|
#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
|
|
|
|
|
2010-10-13 18:18:14 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
2016-10-26 16:53:12 -07:00
|
|
|
#include "elm_fileselector_button.eo.h"
|
|
|
|
#include "elm_fileselector_entry.eo.h"
|
2014-01-21 05:50:35 -08:00
|
|
|
#include "elm_interface_fileselector.h"
|
2012-08-30 09:45:28 -07:00
|
|
|
#include "elm_widget_fileselector_entry.h"
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
#include "elm_fileselector_entry_internal_part.eo.h"
|
|
|
|
#include "elm_part_helper.h"
|
|
|
|
|
2014-06-03 03:35:28 -07:00
|
|
|
#define MY_CLASS ELM_FILESELECTOR_ENTRY_CLASS
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-11-07 03:44:22 -08:00
|
|
|
#define MY_CLASS_NAME "Elm_Fileselector_Entry"
|
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_fileselector_entry"
|
2012-11-25 22:32:53 -08:00
|
|
|
|
2013-09-02 16:39:02 -07:00
|
|
|
#define ELM_PRIV_FILESELECTOR_ENTRY_SIGNALS(cmd) \
|
|
|
|
cmd(SIG_CHANGED, "changed", "") \
|
|
|
|
cmd(SIG_ACTIVATED, "activated", "") \
|
|
|
|
cmd(SIG_PRESS, "press", "") \
|
|
|
|
cmd(SIG_LONGPRESSED, "longpressed", "") \
|
|
|
|
cmd(SIG_CLICKED, "clicked", "") \
|
|
|
|
cmd(SIG_CLICKED_DOUBLE, "clicked,double", "") \
|
|
|
|
cmd(SIG_FOCUSED, "focused", "") \
|
|
|
|
cmd(SIG_UNFOCUSED, "unfocused", "") \
|
|
|
|
cmd(SIG_SELECTION_PASTE, "selection,paste", "") \
|
|
|
|
cmd(SIG_SELECTION_COPY, "selection,copy", "") \
|
|
|
|
cmd(SIG_SELECTION_CUT, "selection,cut", "") \
|
|
|
|
cmd(SIG_UNPRESSED, "unpressed", "") \
|
2016-08-22 17:59:10 -07:00
|
|
|
cmd(SIG_FILE_CHOSEN, "file,chosen", "s") \
|
2013-09-02 16:39:02 -07:00
|
|
|
|
|
|
|
ELM_PRIV_FILESELECTOR_ENTRY_SIGNALS(ELM_PRIV_STATIC_VARIABLE_DECLARE);
|
2013-04-23 05:00:50 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] =
|
|
|
|
{
|
2013-09-02 16:39:02 -07:00
|
|
|
ELM_PRIV_FILESELECTOR_ENTRY_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 */
|
2012-08-30 09:45:28 -07:00
|
|
|
{NULL, NULL}
|
2010-10-13 18:18:14 -07:00
|
|
|
};
|
2013-10-18 10:20:34 -07:00
|
|
|
#undef ELM_PRIV_FILESELECTOR_ENTRY_SIGNALS
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2015-05-17 00:37:49 -07:00
|
|
|
#define SIG_FWD(name, event) \
|
2016-06-20 07:31:31 -07:00
|
|
|
static void \
|
2016-08-30 05:34:10 -07:00
|
|
|
_##name##_fwd(void *data, const Efl_Event *ev EINA_UNUSED) \
|
2012-08-30 09:45:28 -07:00
|
|
|
{ \
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call(data, event, ev->info); \
|
2012-08-30 09:45:28 -07:00
|
|
|
}
|
2015-05-17 00:37:49 -07:00
|
|
|
SIG_FWD(CHANGED, ELM_FILESELECTOR_ENTRY_EVENT_CHANGED)
|
|
|
|
SIG_FWD(PRESS, ELM_FILESELECTOR_ENTRY_EVENT_PRESS)
|
2016-06-10 01:29:40 -07:00
|
|
|
SIG_FWD(LONGPRESSED, EFL_UI_EVENT_LONGPRESSED)
|
|
|
|
SIG_FWD(CLICKED, EFL_UI_EVENT_CLICKED)
|
|
|
|
SIG_FWD(CLICKED_DOUBLE, EFL_UI_EVENT_CLICKED_DOUBLE)
|
2015-07-05 23:21:40 -07:00
|
|
|
SIG_FWD(FOCUSED, ELM_WIDGET_EVENT_FOCUSED)
|
|
|
|
SIG_FWD(UNFOCUSED, ELM_WIDGET_EVENT_UNFOCUSED)
|
2016-06-10 01:58:17 -07:00
|
|
|
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE)
|
|
|
|
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY)
|
|
|
|
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT)
|
2016-06-10 01:29:40 -07:00
|
|
|
SIG_FWD(UNPRESSED, EFL_UI_EVENT_UNPRESSED)
|
2010-10-13 18:18:14 -07:00
|
|
|
#undef SIG_FWD
|
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
static void
|
2016-09-29 09:12:09 -07:00
|
|
|
_file_chosen_path_then(void *data, Efl_Event const* event)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-08-22 17:59:10 -07:00
|
|
|
Eina_Array *args = data;
|
2016-06-06 00:16:57 -07:00
|
|
|
const char *file = NULL;
|
2012-04-20 05:51:10 -07:00
|
|
|
char *s;
|
2016-08-22 17:59:10 -07:00
|
|
|
Eo *fs = eina_array_data_get(args, 0);
|
|
|
|
Efl_Model *model = eina_array_data_get(args, 1);
|
|
|
|
|
|
|
|
eina_array_free(args);
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2016-09-29 09:12:09 -07:00
|
|
|
eina_value_get((Eina_Value*)((Efl_Future_Event_Success*)event->info)->value, &file);
|
2016-06-06 00:16:57 -07:00
|
|
|
|
|
|
|
if (!file) return;
|
2016-08-22 17:59:10 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET(fs, sd);
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2012-04-20 05:51:10 -07:00
|
|
|
s = elm_entry_utf8_to_markup(file);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_object_text_set(sd->entry, s);
|
2012-04-20 05:51:10 -07:00
|
|
|
free(s);
|
2016-08-26 17:06:49 -07:00
|
|
|
|
2016-08-22 17:59:10 -07:00
|
|
|
_model_event_call
|
|
|
|
(fs, ELM_FILESELECTOR_ENTRY_EVENT_FILE_CHOSEN, model, file);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-09-29 09:12:09 -07:00
|
|
|
_file_chosen_path_then_error(void *data, Efl_Event const* event)
|
2016-08-22 17:59:10 -07:00
|
|
|
{
|
2016-09-29 09:12:09 -07:00
|
|
|
Eina_Error err = ((Efl_Future_Event_Failure*)event->info)->error;
|
2016-08-22 17:59:10 -07:00
|
|
|
ERR("Efl.Model property \"path\" error: %s", eina_error_msg_get(err));
|
|
|
|
eina_array_free(data);
|
2016-06-06 00:16:57 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_FILE_CHOSEN_fwd(void *data, const Efl_Event *event)
|
2016-06-06 00:16:57 -07:00
|
|
|
{
|
|
|
|
Efl_Model *model = event->info;
|
2016-09-29 09:12:09 -07:00
|
|
|
Efl_Future *future = NULL;
|
2016-08-22 17:59:10 -07:00
|
|
|
Eina_Array *args = NULL;
|
2016-06-06 00:16:57 -07:00
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
if (!model) return;
|
2016-06-06 00:16:57 -07:00
|
|
|
|
2016-08-22 17:59:10 -07:00
|
|
|
args = eina_array_new(2);
|
|
|
|
eina_array_push(args, data);
|
|
|
|
eina_array_push(args, model);
|
2016-06-06 00:16:57 -07:00
|
|
|
|
2016-09-29 09:12:09 -07:00
|
|
|
future = efl_model_property_get(model, "path");
|
|
|
|
efl_future_then
|
|
|
|
(future, _file_chosen_path_then, _file_chosen_path_then_error, NULL, args);
|
2016-06-06 00:16:57 -07:00
|
|
|
}
|
|
|
|
|
2016-06-20 07:31:31 -07:00
|
|
|
static void
|
2016-08-30 05:34:10 -07:00
|
|
|
_ACTIVATED_fwd(void *data, const Efl_Event *event)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
const char *file;
|
2016-06-06 00:16:57 -07:00
|
|
|
Efl_Model *bmodel, *model;
|
|
|
|
Eina_Value path;
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET(data, sd);
|
2011-10-30 17:13:32 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
file = elm_object_text_get(sd->entry);
|
2016-06-06 00:16:57 -07:00
|
|
|
|
|
|
|
bmodel = elm_interface_fileselector_model_get(sd->button);
|
|
|
|
if (bmodel)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
model = efl_add(efl_class_get(bmodel), NULL);
|
2016-06-06 00:16:57 -07:00
|
|
|
eina_value_setup(&path, EINA_VALUE_TYPE_STRING);
|
|
|
|
eina_value_set(&path, file);
|
2016-09-29 09:12:09 -07:00
|
|
|
efl_model_property_set(model, "path", &path);
|
2016-06-06 00:16:57 -07:00
|
|
|
eina_value_flush(&path);
|
|
|
|
elm_interface_fileselector_model_set(sd->button, model);
|
|
|
|
}
|
|
|
|
|
2016-08-22 15:40:39 -07:00
|
|
|
efl_event_callback_legacy_call
|
2016-04-12 07:23:55 -07:00
|
|
|
(data, ELM_FILESELECTOR_ENTRY_EVENT_ACTIVATED, event->info);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
static void
|
|
|
|
_model_free_eo_cb(void *eo)
|
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_unref(eo);
|
2016-06-06 00:16:57 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_Data *sd EINA_UNUSED)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
|
|
|
Evas_Coord minw = -1, minh = -1;
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2013-10-05 01:12:27 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
edje_object_size_min_calc(wd->resize_obj, &minw, &minh);
|
2010-10-13 18:18:14 -07:00
|
|
|
evas_object_size_hint_min_set(obj, minw, minh);
|
|
|
|
evas_object_size_hint_max_set(obj, -1, -1);
|
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_FALSE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2015-09-15 03:41:51 -07:00
|
|
|
_elm_fileselector_entry_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Elm_Focus_Direction dir, Evas_Object **next, Elm_Object_Item **next_item)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2010-10-15 10:28:49 -07:00
|
|
|
Evas_Object *chain[2];
|
2012-08-30 09:45:28 -07:00
|
|
|
Evas_Object *to_focus;
|
|
|
|
unsigned char i;
|
|
|
|
|
2010-10-15 10:28:49 -07:00
|
|
|
/* Direction */
|
|
|
|
if (dir == ELM_FOCUS_PREVIOUS)
|
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
chain[0] = sd->button;
|
|
|
|
chain[1] = sd->entry;
|
2010-10-15 10:28:49 -07:00
|
|
|
}
|
|
|
|
else if (dir == ELM_FOCUS_NEXT)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
chain[0] = sd->entry;
|
|
|
|
chain[1] = sd->button;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
else
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_FALSE;
|
2010-10-15 10:28:49 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
i = elm_widget_focus_get(chain[1]);
|
2010-10-15 10:28:49 -07:00
|
|
|
|
2015-09-15 03:41:51 -07:00
|
|
|
if (elm_widget_focus_next_get(chain[i], dir, next, next_item)) return EINA_TRUE;
|
2010-10-15 10:28:49 -07:00
|
|
|
|
|
|
|
i = !i;
|
|
|
|
|
2015-09-15 03:41:51 -07:00
|
|
|
if (elm_widget_focus_next_get(chain[i], dir, &to_focus, next_item))
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2010-10-15 10:28:49 -07:00
|
|
|
*next = to_focus;
|
2014-03-29 23:48:21 -07:00
|
|
|
return !!i;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
2010-10-15 10:28:49 -07:00
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_FALSE;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
EOLIAN static Elm_Theme_Apply
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
const char *style;
|
2010-10-14 11:24:24 -07:00
|
|
|
char buf[1024];
|
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, ELM_THEME_APPLY_FAILED);
|
2012-11-25 22:32:53 -08:00
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
Elm_Theme_Apply int_ret = ELM_THEME_APPLY_FAILED;
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS));
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
if (!int_ret) return ELM_THEME_APPLY_FAILED;
|
2012-08-30 09:45:28 -07:00
|
|
|
|
|
|
|
style = elm_widget_style_get(obj);
|
|
|
|
|
2017-06-13 03:41:15 -07:00
|
|
|
efl_ui_mirrored_set(sd->button, efl_ui_mirrored_get(obj));
|
2011-02-10 07:13:05 -08:00
|
|
|
|
2010-10-13 18:18:14 -07:00
|
|
|
if (elm_object_disabled_get(obj))
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_layout_signal_emit(obj, "elm,state,disabled", "elm");
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2010-10-14 11:24:24 -07:00
|
|
|
if (!style) style = "default";
|
|
|
|
snprintf(buf, sizeof(buf), "fileselector_entry/%s", style);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_widget_style_set(sd->button, buf);
|
|
|
|
elm_widget_style_set(sd->entry, buf);
|
2010-10-14 11:24:24 -07:00
|
|
|
|
2012-11-25 22:32:53 -08:00
|
|
|
edje_object_message_signal_process(wd->resize_obj);
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
|
theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum
* related history : 4ca3ef45146e05908a13d1010909abeba9693ad6
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.
@fix
Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4073
2016-06-30 23:09:42 -07:00
|
|
|
return int_ret;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_widget_disable(Eo *obj, Elm_Fileselector_Entry_Data *sd)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
Eina_Bool val;
|
2010-10-13 18:18:14 -07:00
|
|
|
|
2014-04-03 05:58:26 -07:00
|
|
|
Eina_Bool int_ret = EINA_FALSE;
|
2016-08-15 06:44:41 -07:00
|
|
|
int_ret = elm_obj_widget_disable(efl_super(obj, MY_CLASS));
|
2014-03-29 23:48:21 -07:00
|
|
|
if (!int_ret) return EINA_FALSE;
|
2012-08-30 09:45:28 -07:00
|
|
|
|
|
|
|
val = elm_widget_disabled_get(obj);
|
|
|
|
|
|
|
|
elm_widget_disabled_set(sd->button, val);
|
|
|
|
elm_widget_disabled_set(sd->entry, val);
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_TRUE;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2017-07-05 04:06:24 -07:00
|
|
|
static Eina_Bool
|
2017-06-04 07:25:36 -07:00
|
|
|
_elm_fileselector_entry_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, const char *label)
|
2011-07-04 03:14:05 -07:00
|
|
|
{
|
2013-07-22 13:34:19 -07:00
|
|
|
if (part && strcmp(part, "default"))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2017-06-04 07:25:36 -07:00
|
|
|
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
|
|
|
elm_object_text_set(sd->button, label);
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_TRUE;
|
2011-07-04 03:14:05 -07:00
|
|
|
}
|
|
|
|
|
2017-07-05 04:06:24 -07:00
|
|
|
static const char *
|
2017-06-04 07:25:36 -07:00
|
|
|
_elm_fileselector_entry_text_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
|
2011-07-04 03:14:05 -07:00
|
|
|
{
|
2013-07-22 13:34:19 -07:00
|
|
|
if (part && strcmp(part, "default"))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
const char *text = NULL;
|
2017-06-04 07:25:36 -07:00
|
|
|
text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
|
2014-03-29 23:48:21 -07:00
|
|
|
return text;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_object_text_get(sd->button);
|
2011-07-04 03:14:05 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_elm_fileselector_entry_content_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, Evas_Object *content)
|
2012-01-09 00:06:43 -08:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
if (part && strcmp(part, "button icon"))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
|
|
|
elm_layout_content_set(sd->button, NULL, content);
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return EINA_TRUE;
|
2012-01-09 00:06:43 -08:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_elm_fileselector_entry_content_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
|
2012-01-09 00:06:43 -08:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
if (part && strcmp(part, "button icon"))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_layout_content_get(sd->button, NULL);
|
2012-01-09 00:06:43 -08:00
|
|
|
}
|
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_elm_fileselector_entry_content_unset(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
|
2012-01-09 00:06:43 -08:00
|
|
|
{
|
2012-08-30 09:45:28 -07:00
|
|
|
if (part && strcmp(part, "button icon"))
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_layout_content_unset(sd->button, NULL);
|
2012-01-09 00:06:43 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_fileselector_entry_efl_canvas_group_group_add(Eo *obj, Elm_Fileselector_Entry_Data *priv)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
2013-09-24 21:33:39 -07:00
|
|
|
elm_widget_sub_object_parent_add(obj);
|
2013-08-26 08:29:45 -07:00
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
priv->button = elm_fileselector_button_add(obj);
|
2017-06-14 19:12:00 -07:00
|
|
|
efl_ui_mirrored_automatic_set(priv->button, EINA_FALSE);
|
2017-06-13 03:41:15 -07:00
|
|
|
efl_ui_mirrored_set(priv->button, efl_ui_mirrored_get(obj));
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_widget_style_set(priv->button, "fileselector_entry/default");
|
|
|
|
|
2014-01-21 05:50:35 -08:00
|
|
|
elm_fileselector_expandable_set
|
2012-08-30 09:45:28 -07:00
|
|
|
(priv->button, _elm_config->fileselector_expand_enable);
|
|
|
|
|
2015-05-17 00:37:49 -07:00
|
|
|
#define SIG_FWD(name, event) \
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(priv->button, event, _##name##_fwd, obj)
|
2016-06-10 01:29:40 -07:00
|
|
|
SIG_FWD(CLICKED, EFL_UI_EVENT_CLICKED);
|
|
|
|
SIG_FWD(UNPRESSED, EFL_UI_EVENT_UNPRESSED);
|
2016-08-22 17:59:10 -07:00
|
|
|
SIG_FWD(FILE_CHOSEN, ELM_FILESELECTOR_BUTTON_EVENT_FILE_CHOSEN);
|
2010-10-13 18:18:14 -07:00
|
|
|
#undef SIG_FWD
|
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
priv->entry = elm_entry_add(obj);
|
|
|
|
elm_entry_scrollable_set(priv->entry, EINA_TRUE);
|
2017-06-14 19:12:00 -07:00
|
|
|
efl_ui_mirrored_automatic_set(priv->entry, EINA_FALSE);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_widget_style_set(priv->entry, "fileselector_entry/default");
|
|
|
|
elm_entry_single_line_set(priv->entry, EINA_TRUE);
|
|
|
|
elm_entry_editable_set(priv->entry, EINA_TRUE);
|
|
|
|
|
2015-05-17 00:37:49 -07:00
|
|
|
#define SIG_FWD(name, event) \
|
2016-08-10 07:23:04 -07:00
|
|
|
efl_event_callback_add(priv->entry, event, _##name##_fwd, obj)
|
2015-09-02 08:41:04 -07:00
|
|
|
SIG_FWD(CHANGED, ELM_ENTRY_EVENT_CHANGED);
|
|
|
|
SIG_FWD(ACTIVATED, ELM_ENTRY_EVENT_ACTIVATED);
|
|
|
|
SIG_FWD(PRESS, ELM_ENTRY_EVENT_PRESS);
|
2016-06-10 01:29:40 -07:00
|
|
|
SIG_FWD(LONGPRESSED, EFL_UI_EVENT_LONGPRESSED);
|
|
|
|
SIG_FWD(CLICKED, EFL_UI_EVENT_CLICKED);
|
|
|
|
SIG_FWD(CLICKED_DOUBLE, EFL_UI_EVENT_CLICKED_DOUBLE);
|
2015-07-05 23:21:40 -07:00
|
|
|
SIG_FWD(FOCUSED, ELM_WIDGET_EVENT_FOCUSED);
|
|
|
|
SIG_FWD(UNFOCUSED, ELM_WIDGET_EVENT_UNFOCUSED);
|
2016-06-10 01:58:17 -07:00
|
|
|
SIG_FWD(SELECTION_PASTE, EFL_UI_EVENT_SELECTION_PASTE);
|
|
|
|
SIG_FWD(SELECTION_COPY, EFL_UI_EVENT_SELECTION_COPY);
|
|
|
|
SIG_FWD(SELECTION_CUT, EFL_UI_EVENT_SELECTION_CUT);
|
2010-10-13 18:18:14 -07:00
|
|
|
#undef SIG_FWD
|
|
|
|
|
2014-01-15 04:44:21 -08:00
|
|
|
if (!elm_layout_theme_set
|
|
|
|
(obj, "fileselector_entry", "base", elm_widget_style_get(obj)))
|
|
|
|
CRI("Failed to set layout!");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.button", priv->button);
|
|
|
|
elm_layout_content_set(obj, "elm.swallow.entry", priv->entry);
|
|
|
|
}
|
|
|
|
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_layout_sizing_eval(obj);
|
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2016-06-17 01:26:08 -07:00
|
|
|
_elm_fileselector_entry_efl_canvas_group_group_del(Eo *obj, Elm_Fileselector_Entry_Data *sd)
|
2012-08-30 09:45:28 -07:00
|
|
|
{
|
2014-01-21 18:08:47 -08:00
|
|
|
free(sd->path);
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
2012-08-30 09:45:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_fileselector_entry_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2017-07-06 00:47:41 -07:00
|
|
|
return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2015-05-19 05:34:07 -07:00
|
|
|
EOLIAN static Eo *
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_fileselector_entry_efl_object_constructor(Eo *obj, Elm_Fileselector_Entry_Data *sd EINA_UNUSED)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
2016-06-20 21:26:15 -07:00
|
|
|
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
2016-06-16 22:12:02 -07:00
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_GROUPING);
|
2015-05-19 05:34:07 -07:00
|
|
|
|
|
|
|
return obj;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2016-06-06 00:16:57 -07:00
|
|
|
elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2016-09-14 17:02:15 -07:00
|
|
|
elm_fileselector_selected_set(obj, path);
|
|
|
|
}
|
|
|
|
|
|
|
|
Eina_Bool
|
|
|
|
_elm_fileselector_entry_selected_set_internal(Evas_Object *obj, const char *path)
|
|
|
|
{
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
|
|
|
|
elm_fileselector_path_set(sd->button, path);
|
|
|
|
return EINA_TRUE;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-09-29 09:12:09 -07:00
|
|
|
EOLIAN static Efl_Future*
|
2016-06-06 00:16:57 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_selected_model_set(Eo *obj EINA_UNUSED,
|
|
|
|
Elm_Fileselector_Entry_Data *sd,
|
2016-09-29 09:12:09 -07:00
|
|
|
Efl_Model *model)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-09-29 09:12:09 -07:00
|
|
|
Efl_Promise* promise = efl_add(EFL_PROMISE_CLASS, obj);
|
|
|
|
Efl_Future* future = efl_promise_future_get(promise);
|
2016-06-06 00:16:57 -07:00
|
|
|
elm_interface_fileselector_model_set(sd->button, model);
|
2016-09-29 09:12:09 -07:00
|
|
|
efl_promise_value_set(promise, efl_ref(model), _model_free_eo_cb);
|
|
|
|
return future;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI const char *
|
2010-10-13 18:18:14 -07:00
|
|
|
elm_fileselector_entry_selected_get(const Evas_Object *obj)
|
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
2016-09-14 17:02:15 -07:00
|
|
|
return elm_fileselector_selected_get((Eo *) obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
_elm_fileselector_entry_selected_get_internal(const Evas_Object *obj)
|
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
|
2016-09-14 17:02:15 -07:00
|
|
|
return elm_fileselector_path_get(sd->button);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
EOLIAN static Efl_Model *
|
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_selected_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
return elm_interface_fileselector_model_get(sd->button);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI void
|
|
|
|
elm_fileselector_entry_window_title_set(Eo *obj, const char *title)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj);
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_button_window_title_set(sd->button, title);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI const char *
|
|
|
|
elm_fileselector_entry_window_title_get(const Eo *obj)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj) NULL;
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_fileselector_button_window_title_get(sd->button);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI void
|
|
|
|
elm_fileselector_entry_window_size_set(Eo *obj, Evas_Coord width, Evas_Coord height)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj);
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_button_window_size_set(sd->button, width, height);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI void
|
|
|
|
elm_fileselector_entry_window_size_get(const Eo *obj, Evas_Coord *width, Evas_Coord *height)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
if (width) *width = 0;
|
|
|
|
if (height) *height = 0;
|
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj);
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_button_window_size_get(sd->button, width, height);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_entry_path_set(Evas_Object *obj,
|
|
|
|
const char *path)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2016-09-14 17:02:15 -07:00
|
|
|
elm_fileselector_path_set(obj, path);
|
2016-07-22 14:43:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path)
|
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
2016-09-14 17:02:15 -07:00
|
|
|
char *s;
|
|
|
|
|
|
|
|
elm_fileselector_path_set(sd->button, path);
|
|
|
|
|
|
|
|
s = elm_entry_utf8_to_markup(path);
|
2016-06-06 00:16:57 -07:00
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
elm_object_text_set(sd->entry, s);
|
|
|
|
free(s);
|
|
|
|
}
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
static void
|
2016-09-29 09:12:09 -07:00
|
|
|
_fs_entry_model_path_get_then(void *data, Efl_Event const *event)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
Elm_Fileselector_Entry_Data *sd = data;
|
|
|
|
char *path = NULL;
|
2012-04-20 05:51:10 -07:00
|
|
|
char *s;
|
2016-09-29 09:12:09 -07:00
|
|
|
Eina_Value* v = (Eina_Value*)((Efl_Future_Event_Success*)event->info)->value;
|
2012-08-30 09:45:28 -07:00
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
if (!v)
|
|
|
|
return;
|
|
|
|
|
|
|
|
eina_value_get(v, &path);
|
2012-04-20 05:51:10 -07:00
|
|
|
s = elm_entry_utf8_to_markup(path);
|
2013-07-17 18:25:57 -07:00
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
elm_object_text_set(sd->entry, s);
|
|
|
|
free(s);
|
|
|
|
}
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
EOLIAN static void
|
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Efl_Model *model)
|
|
|
|
{
|
2016-09-29 09:12:09 -07:00
|
|
|
Efl_Future *p = NULL;
|
2016-06-06 00:16:57 -07:00
|
|
|
elm_interface_fileselector_model_set(sd->button, model);
|
|
|
|
|
2016-06-16 17:50:37 -07:00
|
|
|
p = efl_model_property_get(model, "path");
|
2016-09-29 09:12:09 -07:00
|
|
|
efl_future_then(p, _fs_entry_model_path_get_then, NULL, NULL, sd);
|
2016-06-06 00:16:57 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI const char *
|
2010-10-13 18:18:14 -07:00
|
|
|
elm_fileselector_entry_path_get(const Evas_Object *obj)
|
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, NULL);
|
2016-09-14 17:02:15 -07:00
|
|
|
return elm_fileselector_path_get(obj);
|
2016-07-22 14:43:12 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
_elm_fileselector_entry_path_get_internal(const Evas_Object *obj)
|
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, NULL);
|
|
|
|
free(sd->path);
|
|
|
|
sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
|
|
|
|
return sd->path;
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-06-06 00:16:57 -07:00
|
|
|
EOLIAN static Efl_Model *
|
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_model_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-06-06 00:16:57 -07:00
|
|
|
Efl_Model *bmodel, *ret;
|
|
|
|
Eina_Value path;
|
|
|
|
bmodel = elm_interface_fileselector_model_get(sd->button);
|
|
|
|
if (!bmodel)
|
|
|
|
{
|
|
|
|
WRN("no base Efl.Model");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
ret = efl_add(efl_class_get(bmodel), NULL);
|
2014-01-21 18:08:47 -08:00
|
|
|
free(sd->path);
|
2012-08-30 09:45:28 -07:00
|
|
|
sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
|
2016-06-06 00:16:57 -07:00
|
|
|
eina_value_setup(&path, EINA_VALUE_TYPE_STRING);
|
|
|
|
eina_value_set(&path, sd->path);
|
2016-09-29 09:12:09 -07:00
|
|
|
efl_model_property_set(ret, "path", &path);
|
2016-06-06 00:16:57 -07:00
|
|
|
eina_value_flush(&path);
|
|
|
|
|
|
|
|
return ret;
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_entry_expandable_set(Evas_Object *obj,
|
|
|
|
Eina_Bool value)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_fileselector_expandable_set(obj, value);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_expandable_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
elm_fileselector_expandable_set(sd->button, value);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-10-13 18:18:14 -07:00
|
|
|
elm_fileselector_entry_expandable_get(const Evas_Object *obj)
|
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2016-05-24 19:56:59 -07:00
|
|
|
return elm_interface_fileselector_expandable_get((Eo *) obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_expandable_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_fileselector_expandable_get(sd->button);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_entry_folder_only_set(Evas_Object *obj,
|
|
|
|
Eina_Bool value)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_fileselector_folder_only_set(obj, value);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_folder_only_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
elm_fileselector_folder_only_set(sd->button, value);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-10-13 18:18:14 -07:00
|
|
|
elm_fileselector_entry_folder_only_get(const Evas_Object *obj)
|
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2016-05-24 19:56:59 -07:00
|
|
|
return elm_interface_fileselector_folder_only_get((Eo *) obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_folder_only_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_fileselector_folder_only_get(sd->button);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI void
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_entry_is_save_set(Evas_Object *obj,
|
|
|
|
Eina_Bool value)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj);
|
2016-03-02 04:10:48 -08:00
|
|
|
elm_interface_fileselector_is_save_set(obj, value);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_is_save_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
elm_fileselector_is_save_set(sd->button, value);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2014-01-21 06:50:31 -08:00
|
|
|
EINA_DEPRECATED EAPI Eina_Bool
|
2010-10-13 18:18:14 -07:00
|
|
|
elm_fileselector_entry_is_save_get(const Evas_Object *obj)
|
|
|
|
{
|
2014-01-21 05:50:35 -08:00
|
|
|
ELM_FILESELECTOR_INTERFACE_CHECK(obj, EINA_FALSE);
|
2016-05-24 19:56:59 -07:00
|
|
|
return elm_interface_fileselector_is_save_get((Eo *) obj);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static Eina_Bool
|
2014-04-22 05:51:46 -07:00
|
|
|
_elm_fileselector_entry_elm_interface_fileselector_is_save_get(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_fileselector_is_save_get(sd->button);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI void
|
|
|
|
elm_fileselector_entry_inwin_mode_set(Eo *obj, Eina_Bool value)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj);
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN(obj, sd);
|
2012-08-30 09:45:28 -07:00
|
|
|
elm_fileselector_button_inwin_mode_set(sd->button, value);
|
2010-10-13 18:18:14 -07:00
|
|
|
}
|
|
|
|
|
2016-05-24 19:56:59 -07:00
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_fileselector_entry_inwin_mode_get(const Eo *obj)
|
2010-10-13 18:18:14 -07:00
|
|
|
{
|
2016-05-24 19:56:59 -07:00
|
|
|
ELM_FILESELECTOR_ENTRY_CHECK(obj) EINA_FALSE;
|
|
|
|
ELM_FILESELECTOR_ENTRY_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
|
2014-03-29 23:48:21 -07:00
|
|
|
return elm_fileselector_button_inwin_mode_get(sd->button);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
|
|
|
|
2014-03-29 23:48:21 -07:00
|
|
|
EOLIAN static void
|
2016-08-10 07:23:04 -07:00
|
|
|
_elm_fileselector_entry_class_constructor(Efl_Class *klass)
|
2012-11-25 22:32:53 -08:00
|
|
|
{
|
2013-11-07 03:44:22 -08:00
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
2012-11-25 22:32:53 -08:00
|
|
|
}
|
2014-03-29 23:48:21 -07:00
|
|
|
|
2016-05-24 04:40:18 -07:00
|
|
|
/* Efl.Part begin */
|
|
|
|
|
2017-08-07 19:48:31 -07:00
|
|
|
ELM_PART_OVERRIDE(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
|
|
|
ELM_PART_OVERRIDE_TEXT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, EFL_UI_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
|
2017-06-29 04:02:59 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_SET(elm_fileselector_entry, "button icon")
|
2016-05-24 04:40:18 -07:00
|
|
|
#include "elm_fileselector_entry_internal_part.eo.c"
|
|
|
|
|
|
|
|
/* Efl.Part end */
|
|
|
|
|
2017-05-18 01:52:17 -07:00
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
|
|
|
#define ELM_FILESELECTOR_ENTRY_EXTRA_OPS \
|
2017-06-29 04:02:59 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_OPS(elm_fileselector_entry), \
|
2017-08-07 00:13:38 -07:00
|
|
|
ELM_LAYOUT_SIZING_EVAL_OPS(elm_fileselector_entry), \
|
2017-05-18 01:52:17 -07:00
|
|
|
EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_fileselector_entry)
|
|
|
|
|
2014-08-11 07:46:11 -07:00
|
|
|
#include "elm_fileselector_entry.eo.c"
|