Evas_Object *edje;
Evas_Object *button;
Evas_Object *entry;
+ char *path;
};
static const char *widtype = NULL;
{
Widget_Data *wd = elm_widget_data_get(data);
const char *file = event_info;
- elm_object_text_set(wd->entry, file);
+ char *s;
+
+ s = elm_entry_utf8_to_markup(file);
+ if (!s) return;
+ elm_object_text_set(wd->entry, s);
+ free(s);
evas_object_smart_callback_call(data, SIG_FILE_CHOSEN, event_info);
}
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ if (wd->path) free(wd->path);
free(wd);
}
return elm_object_text_get(wd->button);
}
+static void
+_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (part && strcmp(part, "button icon")) return;
+ elm_object_part_content_set(wd->button, NULL, content);
+}
+
+static Evas_Object *
+_content_get_hook(const Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if (part && strcmp(part, "button icon")) return NULL;
+ return elm_object_part_content_get(wd->button, NULL);
+}
+
+static Evas_Object *
+_content_unset_hook(Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if (part && strcmp(part, "button icon")) return NULL;
+ return elm_object_part_content_unset(wd->button, NULL);
+}
+
EAPI Evas_Object *
elm_fileselector_entry_add(Evas_Object *parent)
{
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_text_set_hook_set(obj, _elm_fileselector_entry_button_label_set);
elm_widget_text_get_hook_set(obj, _elm_fileselector_entry_button_label_get);
+ elm_widget_content_set_hook_set(obj, _content_set_hook);
+ elm_widget_content_get_hook_set(obj, _content_get_hook);
+ elm_widget_content_unset_hook_set(obj, _content_unset_hook);
wd->edje = edje_object_add(e);
_elm_theme_object_set(obj, wd->edje, "fileselector_entry", "base", "default");
}
EAPI void
-elm_fileselector_entry_button_label_set(Evas_Object *obj, const char *label)
-{
- _elm_fileselector_entry_button_label_set(obj, NULL, label);
-}
-
-EAPI const char *
-elm_fileselector_entry_button_label_get(const Evas_Object *obj)
-{
- return _elm_fileselector_entry_button_label_get(obj, NULL);
-}
-
-EAPI void
elm_fileselector_entry_selected_set(Evas_Object *obj, const char *path)
{
ELM_CHECK_WIDTYPE(obj, widtype);
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
+ char *s;
+
if (!wd) return;
elm_fileselector_button_path_set(wd->button, path);
- elm_object_text_set(wd->entry, path);
+ s = elm_entry_utf8_to_markup(path);
+ if (s)
+ {
+ elm_object_text_set(wd->entry, s);
+ free(s);
+ }
}
EAPI const char *
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return NULL;
- return elm_object_text_get(wd->entry);
+ if (wd->path) free(wd->path);
+ wd->path = elm_entry_markup_to_utf8(elm_object_text_get(wd->entry));
+ return wd->path;
}
EAPI void
if (!wd) return EINA_FALSE;
return elm_fileselector_button_inwin_mode_get(wd->button);
}
-
-EAPI void
-elm_fileselector_entry_button_icon_set(Evas_Object *obj, Evas_Object *icon)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- elm_fileselector_button_icon_set(wd->button, icon);
-}
-
-EAPI Evas_Object *
-elm_fileselector_entry_button_icon_get(const Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return elm_fileselector_button_icon_get(wd->button);
-}
-
-EAPI Evas_Object *
-elm_fileselector_entry_button_icon_unset(Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return elm_fileselector_button_icon_unset(wd->button);
-}