hermet pushed a commit to branch master.
commit f6ac80e64a1d645bb57d2e80ee7789bbbe298e24
Author: ChunEon Park <[email protected]>
Date: Tue Apr 23 21:00:50 2013 +0900
elementary/fileselector_button, fileselector_entry, spinner - support
language,changed callback.
---
ChangeLog | 7 ++++++-
NEWS | 1 +
src/lib/elc_fileselector_button.c | 12 ++++++++++++
src/lib/elc_fileselector_button.h | 1 +
src/lib/elc_fileselector_entry.c | 12 ++++++++++++
src/lib/elc_fileselector_entry.h | 1 +
src/lib/elm_spinner.c | 12 ++++++++++++
src/lib/elm_spinner.h | 1 +
8 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 3dc98f7..d011f91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1288,4 +1288,9 @@
* 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
diff --git a/NEWS b/NEWS
index 569b5b8..d637403 100644
--- a/NEWS
+++ b/NEWS
@@ -63,6 +63,7 @@ Additions:
* 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:
diff --git a/src/lib/elc_fileselector_button.c
b/src/lib/elc_fileselector_button.c
index 549d75a..51013c5 100644
--- a/src/lib/elc_fileselector_button.c
+++ b/src/lib/elc_fileselector_button.c
@@ -11,12 +11,23 @@ EAPI Eo_Op ELM_OBJ_FILESELECTOR_BUTTON_BASE_ID = EO_NOOP;
#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 *);
@@ -492,6 +503,7 @@ _class_constructor(Eo_Class *klass)
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),
diff --git a/src/lib/elc_fileselector_button.h
b/src/lib/elc_fileselector_button.h
index 7419259..91662d8 100644
--- a/src/lib/elc_fileselector_button.h
+++ b/src/lib/elc_fileselector_button.h
@@ -36,6 +36,7 @@
* - @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:
diff --git a/src/lib/elc_fileselector_entry.c b/src/lib/elc_fileselector_entry.c
index b3a57f2..99d7d81 100644
--- a/src/lib/elc_fileselector_entry.c
+++ b/src/lib/elc_fileselector_entry.c
@@ -25,6 +25,8 @@ static const char SIG_SELECTION_COPY[] = "selection,copy";
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, ""},
@@ -40,6 +42,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] =
{SIG_SELECTION_CUT, ""},
{SIG_UNPRESSED, ""},
{SIG_FILE_CHOSEN, "s"},
+ {SIG_LANG_CHANGED, ""},
{NULL, NULL}
};
@@ -94,6 +97,14 @@ _ACTIVATED_fwd(void *data,
}
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;
@@ -724,6 +735,7 @@ _class_constructor(Eo_Class *klass)
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),
diff --git a/src/lib/elc_fileselector_entry.h b/src/lib/elc_fileselector_entry.h
index 6e55fa7..9230316 100644
--- a/src/lib/elc_fileselector_entry.h
+++ b/src/lib/elc_fileselector_entry.h
@@ -48,6 +48,7 @@
* - @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:
diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index f0a97d5..e6ccf7e 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -13,13 +13,24 @@ EAPI Eo_Op ELM_OBJ_SPINNER_BASE_ID = EO_NOOP;
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";
@@ -1219,6 +1230,7 @@ _class_constructor(Eo_Class *klass)
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),
diff --git a/src/lib/elm_spinner.h b/src/lib/elm_spinner.h
index 5045f13..31849af 100644
--- a/src/lib/elm_spinner.h
+++ b/src/lib/elm_spinner.h
@@ -31,6 +31,7 @@
* 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";
--
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr