[popup]: addedr rotation API
authorshilpa <shilpa.singh@samsung.com>
Mon, 7 Jun 2010 09:37:24 +0000 (18:37 +0900)
committershilpa <shilpa.singh@samsung.com>
Mon, 7 Jun 2010 09:37:24 +0000 (18:37 +0900)
src/lib/Elementary.h.in
src/lib/elm_popup.c

index d255f02..1b33cf8 100755 (executable)
@@ -1726,9 +1726,9 @@ extern "C" {
        EAPI Evas_Object *elm_popup_add(Evas_Object *parent);
        EAPI void elm_popup_desc_set(Evas_Object *obj, const char *text);
        EAPI const char* elm_popup_desc_get(Evas_Object *obj);
-   EAPI void elm_popup_title_label_set(Evas_Object *obj, const char *text);
-   EAPI const char* elm_popup_title_label_get(Evas_Object *obj);
-   EAPI void elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon);
+       EAPI void elm_popup_title_label_set(Evas_Object *obj, const char *text);
+       EAPI const char* elm_popup_title_label_get(Evas_Object *obj);
+       EAPI void elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon);
        EAPI void elm_popup_content_set(Evas_Object *obj, Evas_Object *content);
        EAPI Evas_Object* elm_popup_content_get(Evas_Object *obj);
        EAPI void elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_text,  ...);
@@ -1737,6 +1737,7 @@ extern "C" {
        EAPI void elm_popup_set_mode(Evas_Object *obj, Elm_Popup_Mode mode);
        EAPI void elm_popup_response(Evas_Object *obj, int  response_id);
        EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient);
+       EAPI void elm_popup_rotation_set(Evas_Object *obj, int rot_angle);
    /* Contextual Popup */
    typedef struct _Ctxpopup_Item Elm_Ctxpopup_Item;
 
index 2e046df..8dfe940 100755 (executable)
@@ -130,7 +130,8 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info)
        Widget_Data *wd = elm_widget_data_get(obj);   \r
         if(wd->parent)\r
          evas_object_show(wd->parent);         \r
-       elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));\r
+    elm_layout_theme_set(wd->layout, "popup", "base",\r
+                        elm_widget_style_get(obj));\r
        _sizing_eval(obj);\r
        evas_object_show(obj);          \r
 \r
@@ -378,6 +379,7 @@ elm_popup_desc_set(Evas_Object *obj, const char *text)
 {\r
        Widget_Data *wd = elm_widget_data_get(obj);\r
        Evas_Object *label;\r
+       int w;                  \r
        if (!wd) return;\r
 \r
        if(wd->content_area)\r
@@ -385,24 +387,20 @@ elm_popup_desc_set(Evas_Object *obj, const char *text)
                        evas_object_del(wd->content_area);\r
                        wd->content_area=NULL;\r
                }\r
-       else\r
-               {\r
-                       int w;                  \r
-                       label = elm_label_add(obj);\r
-                       elm_object_style_set(label, "popup/description");               \r
-                       wd->content_area = elm_scroller_add(obj);\r
-                       elm_label_line_wrap_set(label, EINA_TRUE);\r
-                       edje_object_part_geometry_get((Evas_Object *)elm_layout_edje_get(wd->layout), "elm.swallow.content", NULL, NULL, &w, NULL);\r
-                       elm_label_wrap_width_set(label, w);\r
-                       elm_scroller_content_set(wd->content_area,label);\r
-                       elm_scroller_policy_set(wd->content_area, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);\r
-                       elm_scroller_bounce_set(wd->content_area, EINA_FALSE, EINA_FALSE);              \r
-                       elm_label_label_set(label, text);\r
-                       evas_object_show(label);                        \r
-                       elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);                    \r
-                       evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,\r
-                                      _changed_size_hints, obj);\r
-               }               \r
+               label = elm_label_add(obj);\r
+               elm_object_style_set(label, "popup/description");               \r
+               wd->content_area = elm_scroller_add(obj);\r
+               elm_label_line_wrap_set(label, EINA_TRUE);\r
+               edje_object_part_geometry_get((Evas_Object *)elm_layout_edje_get(wd->layout), "elm.swallow.content", NULL, NULL, &w, NULL);\r
+               elm_label_wrap_width_set(label, w);\r
+               elm_scroller_content_set(wd->content_area,label);\r
+               elm_scroller_policy_set(wd->content_area, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);\r
+               elm_scroller_bounce_set(wd->content_area, EINA_FALSE, EINA_FALSE);              \r
+               elm_label_label_set(label, text);\r
+               evas_object_show(label);                        \r
+               elm_layout_content_set(wd->layout, "elm.swallow.content", wd->content_area);                    \r
+               evas_object_event_callback_add(wd->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,\r
+                              _changed_size_hints, obj);\r
        _sizing_eval(obj);\r
 }\r
 \r
@@ -705,3 +703,23 @@ EAPI void elm_popup_response(Evas_Object *obj, int  response_id)
        elm_notify_orient_set(wd->notify, notify_orient);\r
 }\r
 \r
+/**\r
+ * Applications which do not pass any window to popup need to take care of rotation, only when popup is already shown.\r
+ * @param obj The popup object\r
+ * @param rot_angle  the angle to which popup has to be rotated.\r
+ *\r
+ * @ingroup Popup\r
+ */\r
+ EAPI void elm_popup_rotation_set(Evas_Object *obj, int rot_angle)\r
+{\r
+       Widget_Data *wd = elm_widget_data_get(obj);\r
+       if (!wd)        return; \r
+       if(wd->parent)\r
+       {\r
+               if(wd->rot_angle!=rot_angle)\r
+               {\r
+                       elm_win_rotation_with_resize_set(wd->parent,  rot_angle);\r
+                       wd->rot_angle = rot_angle;\r
+               }\r
+       }\r
+}\r