elementary/fileselector_button, fileselector_entry, spinner - support language,change...
authorChunEon Park <hermet@hermet.pe.kr>
Tue, 23 Apr 2013 12:00:50 +0000 (21:00 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Tue, 23 Apr 2013 12:00:50 +0000 (21:00 +0900)
legacy/elementary/ChangeLog
legacy/elementary/NEWS
legacy/elementary/src/lib/elc_fileselector_button.c
legacy/elementary/src/lib/elc_fileselector_button.h
legacy/elementary/src/lib/elc_fileselector_entry.c
legacy/elementary/src/lib/elc_fileselector_entry.h
legacy/elementary/src/lib/elm_spinner.c
legacy/elementary/src/lib/elm_spinner.h

index 3dc98f7..d011f91 100644 (file)
 
         * 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
index 569b5b8..d637403 100644 (file)
@@ -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:
 
index 549d75a..51013c5 100644 (file)
@@ -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),
 
index 7419259..91662d8 100644 (file)
@@ -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:
index b3a57f2..99d7d81 100644 (file)
@@ -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),
index 6e55fa7..9230316 100644 (file)
@@ -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:
index f0a97d5..e6ccf7e 100644 (file)
@@ -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),
index 5045f13..31849af 100644 (file)
@@ -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";