[popup]: deprecated rotation API and changed made to support dialog style parent...
authorshilpa singh <shilpa.singh@samsung.com>
Sun, 10 Oct 2010 08:50:25 +0000 (17:50 +0900)
committershilpa singh <shilpa.singh@samsung.com>
Sun, 10 Oct 2010 08:50:25 +0000 (17:50 +0900)
src/lib/Elementary.h.in
src/lib/elm_popup.c

index 839eb18..aace39d 100644 (file)
@@ -2046,13 +2046,12 @@ extern "C" {
    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,  ...);
-   Evas_Object*      elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... );
-   EINA_DEPRECATED Evas_Object*      elm_popup_add_with_buttons(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... );
+   EAPI Evas_Object* elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... );
    EAPI void         elm_popup_timeout_set(Evas_Object *obj, int timeout);
    EAPI void         elm_popup_mode_set(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);
+   EINA_DEPRECATED EAPI void         elm_popup_rotation_set(Evas_Object *obj, int rot_angle);
    EAPI int          elm_popup_run(Evas_Object *obj);
    /* Contextual Popup */
    typedef struct _Ctxpopup_Item Elm_Ctxpopup_Item;
index a6d66d0..28f6c68 100644 (file)
@@ -320,7 +320,7 @@ response_cb( void *data, Evas_Object *obj, void *event_info )
 /**\r
  * Add a new Popup object.\r
  *\r
- * @param parent The parent object\r
+ * @param[in] parent_app The parent object\r
  * @return The new object or NULL if it cannot be created\r
  *\r
  * @ingroup Popup\r
@@ -337,7 +337,7 @@ elm_popup_add(Evas_Object *parent_app)
    int count;\r
    unsigned char *prop_data = NULL;\r
    int ret;\r
-\r
+   Ecore_X_Window_Type type;\r
   if(!parent_app)\r
      {\r
        //FIXME: Keep this window always on top\r
@@ -358,7 +358,7 @@ elm_popup_add(Evas_Object *parent_app)
      }\r
    else\r
      parent = parent_app;\r
-               \r
+       \r
    wd = ELM_NEW(Widget_Data);\r
    e = evas_object_evas_get(parent);\r
    obj = elm_widget_add(e);\r
@@ -387,13 +387,18 @@ elm_popup_add(Evas_Object *parent_app)
 \r
    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show, NULL);\r
    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide, NULL);\r
-   \r
    wd->rot_angle = rotation;\r
    if(!parent_app)\r
      {\r
                wd->parent = parent;\r
                elm_object_style_set(wd->notify, "popup");\r
      }\r
+\r
+   ecore_x_netwm_window_type_get(elm_win_xwindow_get(parent), &type);   \r
+   if(type == ECORE_X_WINDOW_TYPE_DIALOG)\r
+     {\r
+               elm_object_style_set(wd->notify, "popup");\r
+     }\r
    _sizing_eval(obj);\r
 \r
    return obj;\r
@@ -402,12 +407,12 @@ elm_popup_add(Evas_Object *parent_app)
 /**\r
  * Add a new Popup object.\r
  *\r
- * @param parent The parent object\r
- * @param title text to be displayed in title area.\r
- * @param desc_text text to be displayed in description area.\r
- * @param no_of_buttons Number of buttons to be packed in action area.\r
- * @param first_button_text button text\r
- * @param Varargs response ID for first button, then additional buttons followed by response id's ending with NULL\r
+ * @param[in] parent The parent object\r
+ * @param[in] title text to be displayed in title area.\r
+ * @param[in] desc_text text to be displayed in description area.\r
+ * @param[in] no_of_buttons Number of buttons to be packed in action area.\r
+ * @param[in] first_button_text button text\r
+ * @param[in] Varargs response ID for first button, then additional buttons followed by response id's ending with NULL\r
  * @return The new object or NULL if it cannot be created\r
  *\r
  * @ingroup Popup\r
@@ -450,62 +455,12 @@ elm_popup_with_buttons_add(Evas_Object *parent, char *title, char *desc_text,int
    return popup;   \r
 }\r
 \r
-/**\r
- * Add a new Popup object.\r
- *\r
- * @param parent The parent object\r
- * @param title text to be displayed in title area.\r
- * @param desc_text text to be displayed in description area.\r
- * @param no_of_buttons Number of buttons to be packed in action area.\r
- * @param first_button_text button text\r
- * @param Varargs response ID for first button, then additional buttons followed by response id's ending with NULL\r
- * @return The new object or NULL if it cannot be created\r
- *\r
- * @ingroup Popup\r
- */\r
-EAPI Evas_Object *\r
-elm_popup_add_with_buttons(Evas_Object *parent, char *title, char *desc_text,int no_of_buttons, char *first_button_text, ... )\r
-{\r
-   Evas_Object *popup;\r
-   popup = elm_popup_add(parent);\r
-   Widget_Data *wd = elm_widget_data_get(popup);\r
-   char buf[4096];\r
-   \r
-   if (desc_text)\r
-     {\r
-       elm_popup_desc_set(popup, desc_text);\r
-     }\r
-   if (title)\r
-     {\r
-       elm_popup_title_label_set(popup, title);\r
-     }\r
-   if (first_button_text)\r
-     {\r
-       va_list args;  \r
-       va_start(args, first_button_text); \r
-       wd->action_area = elm_layout_add(popup);\r
-       elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);\r
-       snprintf(buf,sizeof(buf), "buttons%d", no_of_buttons);\r
-       elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(popup));\r
-       edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");\r
-       if (wd->title_area)\r
-         {\r
-               edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
-         }\r
-       _elm_popup_buttons_add_valist (popup, first_button_text, args);\r
-       va_end(args);\r
-     }\r
-   edje_object_message_signal_process(wd->layout);\r
-   _sizing_eval(popup);\r
-   \r
-   return popup;   \r
-}\r
-\r
 \r
 /**\r
  * This Set's the description text in content area of Popup widget.\r
  *\r
- * @param text description text.\r
+ * @param[in] obj The Popup object\r
+ * @param[in] text description text.\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -542,7 +497,7 @@ elm_popup_desc_set(Evas_Object *obj, const char *text)
 /**\r
  * This Get's the description text packed in content area of popup object.\r
  *\r
- * @param obj The Popup object\r
+ * @param[in] obj The Popup object\r
  * @return  description text.\r
  *\r
  * @ingroup Popup\r
@@ -560,8 +515,8 @@ elm_popup_desc_get(Evas_Object *obj)
 /**\r
  * This Set's the title text in title area of popup object.\r
  *\r
- * @param obj The popup object\r
- * @param text The title text\r
+ * @param[in] obj The popup object\r
+ * @param[in] text The title text\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -601,7 +556,7 @@ elm_popup_title_label_set(Evas_Object *obj, const char *text)
 /**\r
  * This Get's the title text packed in title area of popup object.\r
  *\r
- * @param obj The Popup object\r
+ * @param[in] obj The Popup object\r
  * @return title text\r
  *\r
  * @ingroup Popup\r
@@ -619,8 +574,8 @@ elm_popup_title_label_get(Evas_Object *obj)
 /**\r
  * This Set's the icon in the title area of Popup object.\r
  *\r
- * @param obj The popup object\r
- * @param icon The title icon\r
+ * @param[in] obj The popup object\r
+ * @param[in] icon The title icon\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -646,7 +601,7 @@ elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)
 /**\r
  * This Get's the icon packed in title area of Popup object.\r
  *\r
- * @param obj The Popup object\r
+ * @param[in] obj The Popup object\r
  * @return title icon\r
  *\r
  * @ingroup Popup\r
@@ -664,8 +619,8 @@ elm_popup_title_icon_get(Evas_Object *obj)
 /**\r
  * This Set's the content widget in content area of Popup object.\r
  *\r
- * @param obj The popup object\r
- * @param content The content widget\r
+ * @param[in] obj The popup object\r
+ * @param[in] content The content widget\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -693,7 +648,7 @@ elm_popup_content_set(Evas_Object *obj, Evas_Object *content)
 /**\r
  * This Get's the content widget packed in content area of Popup object.\r
  *\r
- * @param obj The Popup object\r
+ * @param[in] obj The Popup object\r
  * @return content packed in popup widget\r
  *\r
  * @ingroup Popup\r
@@ -711,10 +666,10 @@ elm_popup_content_get(Evas_Object *obj)
 /**\r
  * Adds the buttons in to the action area of popup object.\r
  *\r
- * @param obj The popup object\r
- * @param no_of_buttons Number of buttons that has to be packed in action area.\r
- * @param first_button_text   Label of first button\r
- * @param Varargs  Response ID(Elm_Popup_Response/ any integer value) for first button, then additional buttons along with their response id ending with NULL.\r
+ * @param[in] obj The popup object\r
+ * @param[in] no_of_buttons Number of buttons that has to be packed in action area.\r
+ * @param[in] first_button_text   Label of first button\r
+ * @param[in] Varargs  Response ID(Elm_Popup_Response/ any integer value) for first button, then additional buttons along with their response id ending with NULL.\r
  * @ingroup Popup\r
  */\r
 EAPI void \r
@@ -754,8 +709,8 @@ elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_tex
  * This Set's the time before the popup window is hidden, \r
  * and ELM_POPUP_RESPONSE_TIMEOUT is sent along with response signal.\r
  *\r
- * @param obj The popup object\r
- * @param timeout The timeout value in seconds.\r
+ * @param[in] obj The popup object\r
+ * @param[in] timeout The timeout value in seconds.\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -775,8 +730,8 @@ elm_popup_timeout_set(Evas_Object *obj, int timeout)
  * will not close when clicked outside. if ELM_POPUP_TYPE_ALERT is set, popup will close\r
  * when clicked outside, and ELM_POPUP_RESPONSE_NONE is sent along with response signal.\r
  *\r
- * @param obj The popup object\r
- * @param mode  Elm_Popup_Mode\r
+ * @param[in] obj The popup object\r
+ * @param[in] mode  Elm_Popup_Mode\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -796,8 +751,8 @@ elm_popup_mode_set(Evas_Object *obj, Elm_Popup_Mode mode)
 /**\r
  * This Hides the popup by emitting response signal.\r
  *\r
- * @param obj The popup object\r
- * @param response_id  response ID of the signal to be emitted along with response signal\r
+ * @param[in] obj The popup object\r
+ * @param[in] response_id  response ID of the signal to be emitted along with response signal\r
  *\r
  * @ingroup Popup\r
  */ \r
@@ -814,8 +769,8 @@ elm_popup_response(Evas_Object *obj, int  response_id)
 \r
 /**\r
  * This API controls the direction from which popup will appear and location of popup.\r
- * @param obj The popup object\r
- * @param orient  the orientation of the popup\r
+ * @param[in] obj The popup object\r
+ * @param[in] orient  the orientation of the popup\r
  *\r
  * @ingroup Popup\r
  */\r
@@ -913,7 +868,7 @@ elm_popup_rotation_set(Evas_Object *obj, int rot_angle)
  * when popup returns with signal ELM_POPUP_RESPONSE_NONE, then exit the application using elm_exit\r
  * by calling any post exit application code.\r
  * \r
- * @param obj The popup object\r
+ * @param[in] obj The popup object\r
  * @ingroup Popup\r
  */\r
 EAPI int \r