elementary/naviframe,button,label - support naviframe, button, label orientation...
authorChunEon Park <hermet@hermet.pe.kr>
Fri, 15 Feb 2013 11:22:09 +0000 (11:22 +0000)
committerChunEon Park <hermet@hermet.pe.kr>
Fri, 15 Feb 2013 11:22:09 +0000 (11:22 +0000)
SVN revision: 83947

legacy/elementary/src/lib/elc_naviframe.c
legacy/elementary/src/lib/elm_button.c
legacy/elementary/src/lib/elm_label.c

index e8cef48..c18a6f0 100644 (file)
@@ -277,16 +277,9 @@ _item_title_visible_update(Elm_Naviframe_Item *nit)
 }
 
 static void
-_elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
+_theme_update(Evas_Object *obj, Elm_Naviframe_Smart_Data *sd)
 {
    Elm_Naviframe_Item *it;
-   Elm_Naviframe_Smart_Data *sd = _pd;
-   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
-   if (ret) *ret = EINA_FALSE;
-   Eina_Bool int_ret = EINA_FALSE;
-
-   eo_do_super(obj, elm_wdg_theme(&int_ret));
-   if (!int_ret) return;
 
    EINA_INLIST_FOREACH(sd->stack, it)
      {
@@ -296,10 +289,28 @@ _elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
      }
 
    elm_layout_sizing_eval(obj);
+}
 
+static void
+_elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
+{
+   Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+   Eina_Bool int_ret = EINA_FALSE;
+   eo_do_super(obj, elm_wdg_theme(&int_ret));
+   if (!int_ret) return;
+   _theme_update(obj, _pd);
    if (ret) *ret = EINA_TRUE;
 }
 
+static void
+_elm_naviframe_smart_orientation_set(Eo *obj, void *_pd, va_list *list)
+{
+   int rotation = va_arg(*list, int);
+   eo_do_super(obj, elm_wdg_orientation_set(rotation));
+   //TODO: Deffered Updation. update only top item.
+   _theme_update(obj, _pd);
+}
+
 static char *
 _access_info_cb(void *data, Evas_Object *obj __UNUSED__)
 {
@@ -1974,6 +1985,7 @@ _class_constructor(Eo_Class *klass)
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_naviframe_smart_focus_next),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_naviframe_smart_theme),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_naviframe_smart_access),
+        EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_naviframe_smart_orientation_set),
 
         EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_naviframe_smart_content_set),
         EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_naviframe_smart_content_get),
index b3efd0c..6528f8e 100644 (file)
@@ -314,8 +314,6 @@ _elm_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
      (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, priv);
 
    elm_widget_can_focus_set(obj, EINA_TRUE);
-
-   elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj));
 }
 
 static void
@@ -352,6 +350,8 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
    Evas_Object *parent = eo_parent_get(obj);
    if (!elm_widget_sub_object_add(parent, obj))
      ERR("could not add %p as sub object of %p", obj, parent);
+
+   elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj));
 }
 
 EAPI void
@@ -521,6 +521,16 @@ _elm_button_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA
 }
 
 static void
+_elm_button_smart_orientation_set(Eo *obj __UNUSED__, void *_pd __UNUSED__, va_list *list)
+
+{
+   int rotation = va_arg(*list, int);
+   eo_do_super(obj, elm_wdg_orientation_set(rotation));
+   elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj));
+   _icon_signal_emit(obj);
+}
+
+static void
 _class_constructor(Eo_Class *klass)
 {
    const Eo_Op_Func_Description func_desc[] = {
@@ -534,6 +544,7 @@ _class_constructor(Eo_Class *klass)
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_button_smart_activate),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_button_smart_focus_next_manager_is),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_button_smart_focus_direction_manager_is),
+        EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_button_smart_orientation_set),
 
         EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_button_smart_content_set),
 
index 2b92d87..ec55414 100644 (file)
@@ -151,6 +151,23 @@ _label_slide_change(Evas_Object *obj)
 }
 
 static void
+_elm_label_smart_orientation_set(Eo *obj, void *_pd, va_list *list)
+{
+   int rotation = va_arg(*list, int);
+   Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+   Elm_Label_Smart_Data *sd = _pd;
+
+   eo_do_super(obj, elm_wdg_orientation_set(rotation));
+
+   elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
+   evas_event_freeze(evas_object_evas_get(obj));
+   _label_format_set(wd->resize_obj, sd->format);
+   _label_slide_change(obj);
+   evas_event_thaw(evas_object_evas_get(obj));
+   evas_event_thaw_eval(evas_object_evas_get(obj));
+}
+
+static void
 _elm_label_smart_theme(Eo *obj, void *_pd, va_list *list)
 {
    Eina_Bool *ret = va_arg(*list, Eina_Bool *);
@@ -392,9 +409,6 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
    edje_object_signal_callback_add(wd->resize_obj, "elm,state,slide,end", "",
                                    _on_slide_end, obj);
 
-   elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
-   elm_layout_text_set(obj, NULL, "<br>");
-
    /* access */
    elm_widget_can_focus_set(obj, _elm_config->access_mode);
 
@@ -403,8 +417,6 @@ _elm_label_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
      (_elm_access_object_get(obj), ELM_ACCESS_TYPE, E_("Label"));
    _elm_access_callback_set
      (_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
-
-   elm_layout_sizing_eval(obj);
 }
 
 EAPI Evas_Object *
@@ -427,6 +439,10 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
    Evas_Object *parent = eo_parent_get(obj);
    if (!elm_widget_sub_object_add(parent, obj))
      ERR("could not add %p as sub object of %p", obj, parent);
+
+   elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
+   elm_layout_text_set(obj, NULL, "<br>");
+   elm_layout_sizing_eval(obj);
 }
 
 EAPI void
@@ -732,6 +748,7 @@ _class_constructor(Eo_Class *klass)
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_label_smart_translate),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_label_smart_focus_next_manager_is),
         EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_label_smart_focus_direction_manager_is),
+        EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_label_smart_orientation_set),
 
         EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_label_smart_sizing_eval),
         EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_label_smart_text_set),