* Support language change for widget items (Ctxpopup, Hoversel,
Naviframe, Diskselector, List, Menu, Segment_Control, Toolbar, Popup,
- MultibuttonEntry)
+ MultibuttonEntry)
+
+2013-04-23 ChunEon Park
+
+ * Support language,changed callback (Fileselector_Button,
+ Fileselector Entry, Spinner
* Add the feature for key events.
* Add elm_access_action(), elm_access_action_cb_set()
* Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set().
+ * Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner.
Improvements:
#define DEFAULT_WINDOW_TITLE "Select a file"
static const char SIG_FILE_CHOSEN[] = "file,chosen";
+static const char SIG_LANG_CHANGED[] = "language,changed";
+
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_FILE_CHOSEN, "s"},
+ {SIG_LANG_CHANGED, ""},
{NULL, NULL}
};
static void
+_elm_fileselector_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
+ if (ret) *ret = EINA_TRUE;
+}
+
+static void
_elm_fileselector_button_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_fileselector_button_smart_del),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_button_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_fileselector_smart_translate),
EO_OP_FUNC(ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), _elm_fileselector_button_smart_admits_autorepeat_get),
* - @c "file,chosen" - the user has selected a path, whose string
* pointer comes as the @c event_info data (a stringshared
* string)
+ * - @c "language,changed" - the program's language changed
*
* Default text parts of the fileselector_button widget that you can use for
* are:
static const char SIG_SELECTION_CUT[] = "selection,cut";
static const char SIG_UNPRESSED[] = "unpressed";
static const char SIG_FILE_CHOSEN[] = "file,chosen";
+static const char SIG_LANG_CHANGED[] = "language,changed";
+
static const Evas_Smart_Cb_Description _smart_callbacks[] =
{
{SIG_CHANGED, ""},
{SIG_SELECTION_CUT, ""},
{SIG_UNPRESSED, ""},
{SIG_FILE_CHOSEN, "s"},
+ {SIG_LANG_CHANGED, ""},
{NULL, NULL}
};
}
static void
+_elm_fileselector_entry_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
+ if (ret) *ret = EINA_TRUE;
+}
+
+static void
_elm_fileselector_entry_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
Evas_Coord minw = -1, minh = -1;
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_fileselector_entry_smart_disable),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_fileselector_entry_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_fileselector_entry_smart_translate),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_fileselector_entry_smart_focus_next_manager_is),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_fileselector_entry_smart_focus_next),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_fileselector_entry_smart_focus_direction_manager_is),
* - @c "file,chosen" - The user has selected a path via the file
* selector entry's internal file selector, whose string pointer
* comes as the @c event_info data (a stringshared string)
+ * - @c "language,changed" - the program's language changed
*
* Default text parts of the fileselector_button widget that you can use for
* are:
static const char SIG_CHANGED[] = "changed";
static const char SIG_DELAY_CHANGED[] = "delay,changed";
+static const char SIG_LANG_CHANGED[] = "language,changed";
+
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_CHANGED, ""},
{SIG_DELAY_CHANGED, ""},
+ {SIG_LANG_CHANGED, ""},
{NULL, NULL}
};
static void
+_elm_spinner_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
+{
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL);
+ if (ret) *ret = EINA_TRUE;
+}
+
+static void
_entry_show(Elm_Spinner_Smart_Data *sd)
{
char buf[32], fmt[32] = "%0.f";
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_DEL), _elm_spinner_smart_del),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_spinner_smart_theme),
+ EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_spinner_smart_translate),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_spinner_smart_on_focus),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_EVENT), _elm_spinner_smart_event),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_spinner_smart_focus_next_manager_is),
* the user. This will be called only when the user stops dragging
* for a very short period or when they release their finger/mouse,
* so it avoids possibly expensive reactions to the value change.
+ * - @c "language,changed" - the program's language changed
*
* Available styles for it:
* - @c "default";