*/\r
\r
typedef struct _Widget_Data Widget_Data;\r
+typedef struct _Action_Area_Data Action_Area_Data;\r
\r
struct _Widget_Data \r
{\r
- Evas_Object *notify;\r
- Evas_Object *layout;\r
- Evas_Object *parent;\r
- Evas_Object *parent_app;\r
- Evas_Object *title_area;\r
- Evas_Object *title_icon;\r
- Evas_Object *content_area;\r
- Evas_Object *desc_label;\r
- Evas_Object *action_area; \r
- Eina_List *button_list;\r
- int rot_angle;\r
- Ecore_Job *del_job;\r
- Eina_Bool delete_me : 1;\r
+ Evas_Object *notify;\r
+ Evas_Object *layout;\r
+ Evas_Object *parent;\r
+ Evas_Object *parent_app;\r
+ Evas_Object *title_area;\r
+ Evas_Object *title_icon;\r
+ Evas_Object *content_area;\r
+ Evas_Object *desc_label;\r
+ Evas_Object *action_area;\r
+ Eina_List *button_list;\r
+ int rot_angle;\r
+ Ecore_Job *del_job;\r
+ Eina_Bool delete_me : 1;\r
};\r
\r
-typedef struct _action_area_Data Action_Area_Data;\r
-struct _action_area_Data \r
+struct _Action_Area_Data \r
{\r
- Evas_Object *obj; \r
- int response_id;\r
+ Evas_Object *obj;\r
+ Evas_Object *btn;\r
+ int response_id;\r
};\r
\r
+static const char *widtype = NULL;\r
static void _del_hook(Evas_Object *obj);\r
static void _theme_hook(Evas_Object *obj);\r
static void _sizing_eval(Evas_Object *obj);\r
-static void _elm_popup_buttons_add_valist(Evas_Object *obj,const char *first_button_text,va_list args);\r
-static Evas_Object* _elm_popup_add_button(Evas_Object *obj,const char *text,int response_id);\r
-static void _action_area_clicked( void *data, Evas_Object *obj, void *event_info );\r
-static void _block_clicked_cb( void *data, Evas_Object *obj, void *event_info );\r
+static void _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, va_list args);\r
+static Evas_Object* _elm_popup_add_button(Evas_Object *obj, const char *text, int response_id);\r
+static void _action_area_clicked(void *data, Evas_Object *obj, void *event_info);\r
+static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info);\r
static void _show(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
static void _hide(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
static void _resize_parent(void *data, Evas *e, Evas_Object *obj, void *event_info);\r
static void\r
_del_parent(void *data, Evas *e, Evas_Object *obj, void *evet_info)\r
{\r
- Evas_Object *pop = data;\r
- Widget_Data *wd = elm_widget_data_get(pop);\r
- if (!wd) return;\r
- if (wd->parent == obj)\r
- {\r
- evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _del_parent, pop);\r
- wd->parent = NULL;\r
- }\r
+ Evas_Object *pop = data;\r
+ Widget_Data *wd = elm_widget_data_get(pop);\r
+ \r
+ if (!wd) return;\r
+ if (wd->parent == obj)\r
+ {\r
+ evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _del_parent, pop);\r
+ wd->parent = NULL;\r
+ }\r
}\r
\r
static void\r
_del_job(void *data)\r
{\r
- Evas_Object *obj = data;\r
- evas_object_del(obj);\r
+ Evas_Object *obj = data;\r
+ evas_object_del(obj);\r
}\r
\r
static void\r
_del_hook(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return; \r
- if (!wd->del_job)\r
- {\r
- if (wd->parent)\r
- {\r
- evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _del_parent, obj);\r
- wd->del_job = ecore_job_add(_del_job, wd->parent);\r
- wd->parent = NULL;\r
- }\r
- }\r
- free(wd); \r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return; \r
+ if (!wd->del_job)\r
+ {\r
+ if (wd->parent)\r
+ {\r
+ evas_object_event_callback_del_full(wd->parent, EVAS_CALLBACK_DEL, _del_parent, obj);\r
+ wd->del_job = ecore_job_add(_del_job, wd->parent);\r
+ wd->parent = NULL;\r
+ }\r
+ }\r
+ free(wd); \r
}\r
\r
static void\r
_del_pre_hook(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_SHOW, _show, NULL);\r
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_HIDE, _hide, NULL);\r
- if(wd->parent_app)\r
- evas_object_event_callback_del_full(wd->parent_app, EVAS_CALLBACK_RESIZE, _resize_parent, obj);\r
- eina_list_free(wd->button_list);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ Action_Area_Data *action_data = NULL;\r
+ Eina_List *list = NULL;\r
+ \r
+ if (!wd) return;\r
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_SHOW, _show, NULL);\r
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_HIDE, _hide, NULL);\r
+ if (wd->parent_app)\r
+ evas_object_event_callback_del_full(wd->parent_app, EVAS_CALLBACK_RESIZE, _resize_parent, obj);\r
+ EINA_LIST_FOREACH(wd->button_list, list, action_data)\r
+ {\r
+ free(action_data);\r
+ action_data = NULL;\r
+ }\r
+ eina_list_free(wd->button_list);\r
}\r
\r
static void\r
_theme_hook(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- char buf[4096];\r
- Eina_List *list=NULL;\r
- Evas_Object *btn_obj;\r
- if (!wd) return;\r
- \r
- elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));\r
- elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);\r
- edje_object_message_signal_process( elm_layout_edje_get(wd->layout));\r
- if(wd->title_area)\r
- {\r
- snprintf(buf, sizeof(buf), "popup_title/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(wd->title_area,buf);\r
- }\r
- if(wd->action_area)\r
- {\r
- EINA_LIST_FOREACH(wd->button_list, list, btn_obj)\r
- {\r
- snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(btn_obj, buf);\r
- }\r
- }\r
- if(wd->content_area)\r
- {\r
- elm_layout_theme_set(wd->content_area,"popup","content",elm_widget_style_get(obj));\r
- if(wd->desc_label)\r
- {\r
- snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(wd->desc_label,buf);\r
- }\r
- } \r
- _sizing_eval(obj);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ char buf[4096];\r
+ Eina_List *list = NULL;\r
+ Action_Area_Data *action_data = NULL;\r
+ \r
+ if (!wd) return;\r
+ elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));\r
+ elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);\r
+ edje_object_message_signal_process(elm_layout_edje_get(wd->layout));\r
+ if (wd->title_area)\r
+ {\r
+ snprintf(buf, sizeof(buf), "popup_title/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(wd->title_area, buf);\r
+ }\r
+ if (wd->action_area)\r
+ {\r
+ EINA_LIST_FOREACH(wd->button_list, list, action_data)\r
+ {\r
+ snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(action_data->btn, buf);\r
+ }\r
+ }\r
+ if (wd->content_area)\r
+ {\r
+ elm_layout_theme_set(wd->content_area, "popup", "content", elm_widget_style_get(obj));\r
+ if (wd->desc_label)\r
+ {\r
+ snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(wd->desc_label, buf);\r
+ }\r
+ } \r
+ _sizing_eval(obj);\r
}\r
\r
static void\r
_sizing_eval(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;\r
-\r
- edje_object_size_min_calc(elm_layout_edje_get(wd->layout), &minw, &minh);\r
- evas_object_size_hint_min_set(obj, minw, minh);\r
- evas_object_size_hint_max_set(obj, maxw, maxh);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;\r
+ \r
+ if (!wd) return;\r
+ edje_object_size_min_calc(elm_layout_edje_get(wd->layout), &minw, &minh);\r
+ evas_object_size_hint_min_set(obj, minw, minh);\r
+ evas_object_size_hint_max_set(obj, maxw, maxh);\r
}\r
\r
static void\r
}\r
\r
static void _block_clicked_cb( void *data, Evas_Object *obj, void *event_info )\r
-{ \r
- evas_object_hide((Evas_Object*)data); \r
- evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_NONE); \r
+{ \r
+ evas_object_hide((Evas_Object*)data); \r
+ evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_NONE); \r
}\r
\r
static void\r
_show(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{ \r
- 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",\r
- elm_widget_style_get(obj));\r
- _sizing_eval(obj);\r
- evas_object_show(obj); \r
-\r
+{ \r
+ Widget_Data *wd = elm_widget_data_get(obj); \r
+ \r
+ if (!wd) return;\r
+ if (wd->parent) evas_object_show(wd->parent); \r
+ elm_layout_theme_set(wd->layout, "popup", "base", elm_widget_style_get(obj));\r
+ _sizing_eval(obj);\r
+ evas_object_show(obj); \r
}\r
+\r
static void\r
_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
{\r
- \r
Widget_Data *wd = elm_widget_data_get(obj);\r
- if(wd->parent)\r
- evas_object_hide(wd->parent); \r
- evas_object_hide(obj); \r
-\r
+ \r
+ if (!wd) return;\r
+ if (wd->parent) evas_object_hide(wd->parent); \r
+ evas_object_hide(obj); \r
}\r
\r
static void\r
_resize_parent(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
{\r
- Widget_Data *wd = elm_widget_data_get(data);\r
- int rot_angle;\r
- if(!wd)\r
- return;\r
- if(wd->parent)\r
- {\r
- rot_angle = elm_win_rotation_get(obj);\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
+ Widget_Data *wd = elm_widget_data_get(data);\r
+ int rot_angle;\r
+ \r
+ if (!wd) return;\r
+ if (wd->parent)\r
+ {\r
+ rot_angle = elm_win_rotation_get(obj);\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
\r
static void _action_area_clicked( void *data, Evas_Object *obj, void *event_info )\r
{\r
- Action_Area_Data *adata = (Action_Area_Data *)data;\r
- if (!adata) return; \r
- evas_object_smart_callback_call(adata->obj, "response", (void *)adata->response_id); \r
- evas_object_hide(adata->obj);\r
+ Action_Area_Data *adata = (Action_Area_Data *)data;\r
+ \r
+ if (!adata) return; \r
+ evas_object_smart_callback_call(adata->obj, "response", (void *)adata->response_id); \r
+ evas_object_hide(adata->obj);\r
}\r
\r
-static Evas_Object* _elm_popup_add_button(Evas_Object *obj,const char *text,int response_id)\r
+static Evas_Object* _elm_popup_add_button(Evas_Object *obj, const char *text, int response_id)\r
{\r
- char buf[4096];\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return NULL;\r
- Evas_Object *btn;\r
- Action_Area_Data *adata = malloc(sizeof(Action_Area_Data)); \r
- btn = elm_button_add(obj);\r
- snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(btn, buf);\r
- elm_button_label_set(btn,text);\r
- wd->button_list = eina_list_append(wd->button_list, btn);\r
- adata->response_id = response_id;\r
- adata->obj = obj;\r
- evas_object_smart_callback_add(btn, "clicked", _action_area_clicked, adata); \r
- return btn;\r
+ char buf[4096];\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ Evas_Object *btn;\r
+ \r
+ if (!wd) return NULL;\r
+ Action_Area_Data *adata = malloc(sizeof(Action_Area_Data)); \r
+ btn = elm_button_add(obj);\r
+ snprintf(buf, sizeof(buf), "popup_button/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(btn, buf);\r
+ elm_button_label_set(btn, text);\r
+ adata->response_id = response_id;\r
+ adata->obj = obj;\r
+ adata->btn = btn;\r
+ wd->button_list = eina_list_append(wd->button_list, adata);\r
+ evas_object_smart_callback_add(btn, "clicked", _action_area_clicked, adata); \r
+ return btn;\r
}\r
\r
-static void _elm_popup_buttons_add_valist(Evas_Object *obj,const char *first_button_text,va_list args)\r
+static void _elm_popup_buttons_add_valist(Evas_Object *obj, const char *first_button_text, va_list args)\r
{\r
- const char *text; \r
- char buf[4096];\r
- int response=0;\r
- int index=0;\r
- if(first_button_text==NULL)\r
- return;\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return;\r
- text = first_button_text; \r
- response = va_arg (args, int);\r
- Evas_Object *btn;\r
- while (text != NULL)\r
- {\r
- btn = _elm_popup_add_button(obj,text,response);\r
- ++index; \r
- snprintf(buf,sizeof(buf),"actionbtn%d",index); \r
- elm_layout_content_set(wd->action_area,buf,btn);\r
- evas_object_event_callback_add(wd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,\r
- _changed_size_hints, obj);\r
- \r
- text = va_arg (args, char*);\r
- if (text == NULL)\r
- break;\r
- response = va_arg (args, int);\r
- } \r
+ const char *text = NULL; \r
+ char buf[4096];\r
+ int response = 0;\r
+ int index = 0;\r
+ Evas_Object *btn;\r
+ \r
+ if (first_button_text == NULL) return;\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ if (!wd) return;\r
+ text = first_button_text; \r
+ response = va_arg(args, int);\r
+ while (text != NULL)\r
+ {\r
+ btn = _elm_popup_add_button(obj, text, response);\r
+ ++index;\r
+ snprintf(buf, sizeof(buf), "actionbtn%d", index); \r
+ elm_layout_content_set(wd->action_area, buf, btn);\r
+ evas_object_event_callback_add(wd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,\r
+ _changed_size_hints, obj);\r
+ text = va_arg(args, char*);\r
+ if (text == NULL) break;\r
+ response = va_arg(args, int);\r
+ } \r
}\r
\r
static void _elm_popup_timeout( void *data, Evas_Object *obj, void *event_info )\r
-{ \r
- evas_object_hide((Evas_Object*)data); \r
- evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_TIMEOUT); \r
+{ \r
+ evas_object_hide((Evas_Object*)data); \r
+ evas_object_smart_callback_call((Evas_Object *)data, "response", (void *)ELM_POPUP_RESPONSE_TIMEOUT); \r
}\r
\r
\r
EAPI Evas_Object *\r
elm_popup_add(Evas_Object *parent_app)\r
{\r
- Evas_Object *obj;\r
- Evas *e;\r
- Widget_Data *wd;\r
- Evas_Object *parent;\r
- Evas_Coord x,y,w,h;\r
- int rotation=-1;\r
- int count;\r
- unsigned char *prop_data = NULL;\r
- int ret;\r
-\r
- //FIXME: Keep this window always on top\r
- parent = elm_win_add(parent_app,"popup",ELM_WIN_DIALOG_BASIC);\r
- elm_win_alpha_set(parent, EINA_TRUE); \r
- elm_win_raise(parent); \r
-\r
- if(parent_app)\r
- {\r
- evas_object_geometry_get(parent_app, &x, &y, &w, &h);\r
- rotation = elm_win_rotation_get(parent_app);\r
- evas_object_resize(parent, w, h);\r
- evas_object_move(parent, x, y);\r
- if(rotation!=-1)\r
- {\r
- elm_win_rotation_set(parent, rotation);\r
- } \r
- }\r
- else\r
- {\r
- ecore_x_window_geometry_get(ecore_x_window_root_get(ecore_x_window_focus_get()),&x, &y, &w, &h); \r
- ret = ecore_x_window_prop_property_get (ecore_x_window_root_get(ecore_x_window_focus_get()), ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE, ECORE_X_ATOM_CARDINAL, 32, &prop_data, &count);\r
- if( ret && prop_data )\r
- memcpy (&rotation, prop_data, sizeof (int));\r
-\r
- if (prop_data) free (prop_data);\r
- evas_object_resize(parent, w, h);\r
- evas_object_move(parent, x, y);\r
- if(rotation!=-1)\r
- {\r
- elm_win_rotation_with_resize_set(parent, rotation);\r
- } \r
- }\r
- wd = ELM_NEW(Widget_Data);\r
- e = evas_object_evas_get(parent);\r
- obj = elm_widget_add(e);\r
- elm_widget_type_set(obj, "popup");\r
- elm_widget_sub_object_add(parent, obj);\r
- elm_widget_data_set(obj, wd);\r
- elm_widget_del_pre_hook_set(obj, _del_pre_hook);\r
- elm_widget_del_hook_set(obj, _del_hook);\r
- elm_widget_theme_hook_set(obj, _theme_hook);\r
- wd->parent = parent;\r
- wd->rot_angle = rotation;\r
-\r
- evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL, _del_parent, obj);\r
- if(parent_app)\r
- evas_object_event_callback_add(parent_app, EVAS_CALLBACK_RESIZE, _resize_parent, obj);\r
- wd->parent_app = parent_app;\r
-\r
- wd->notify= elm_notify_add(parent); \r
- elm_widget_resize_object_set(obj, wd->notify);\r
- elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);\r
- elm_notify_repeat_events_set(wd->notify, EINA_FALSE);\r
- evas_object_size_hint_weight_set(wd->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
- evas_object_size_hint_align_set(wd->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
-\r
- wd->layout = elm_layout_add(parent);\r
- evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
- evas_object_size_hint_align_set(wd->layout , EVAS_HINT_FILL, EVAS_HINT_FILL);\r
- \r
- elm_layout_theme_set(wd->layout, "popup", "base", "default");\r
- elm_notify_content_set(wd->notify, wd->layout);\r
-\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
- _sizing_eval(obj);\r
-\r
- return obj;\r
+ Evas_Object *obj;\r
+ Evas *e;\r
+ Widget_Data *wd;\r
+ Evas_Object *parent;\r
+ Evas_Coord x,y,w,h;\r
+ int rotation = -1;\r
+ int count;\r
+ unsigned char *prop_data = NULL;\r
+ int ret;\r
+\r
+ //FIXME: Keep this window always on top\r
+ parent = elm_win_add(parent_app, "popup", ELM_WIN_DIALOG_BASIC);\r
+ elm_win_alpha_set(parent, EINA_TRUE); \r
+ elm_win_raise(parent); \r
+ if (parent_app)\r
+ {\r
+ evas_object_geometry_get(parent_app, &x, &y, &w, &h);\r
+ rotation = elm_win_rotation_get(parent_app);\r
+ evas_object_resize(parent, w, h);\r
+ evas_object_move(parent, x, y);\r
+ if (rotation != -1)\r
+ {\r
+ elm_win_rotation_set(parent, rotation);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ ecore_x_window_geometry_get(ecore_x_window_root_get(ecore_x_window_focus_get()), &x, &y, &w, &h);\r
+ ret = ecore_x_window_prop_property_get(ecore_x_window_root_get(ecore_x_window_focus_get()), ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE, \r
+ ECORE_X_ATOM_CARDINAL, 32, &prop_data, &count);\r
+ if (ret && prop_data) memcpy(&rotation, prop_data, sizeof(int));\r
+ if (prop_data) free(prop_data);\r
+ evas_object_resize(parent, w, h);\r
+ evas_object_move(parent, x, y);\r
+ if (rotation != -1) \r
+ elm_win_rotation_with_resize_set(parent, rotation);\r
+ \r
+ }\r
+ wd = ELM_NEW(Widget_Data);\r
+ e = evas_object_evas_get(parent);\r
+ obj = elm_widget_add(e);\r
+ ELM_SET_WIDTYPE(widtype, "popup");\r
+ elm_widget_type_set(obj, "popup");\r
+ elm_widget_sub_object_add(parent, obj);\r
+ elm_widget_data_set(obj, wd);\r
+ elm_widget_del_pre_hook_set(obj, _del_pre_hook);\r
+ elm_widget_del_hook_set(obj, _del_hook);\r
+ elm_widget_theme_hook_set(obj, _theme_hook);\r
+ wd->parent = parent;\r
+ wd->rot_angle = rotation;\r
+\r
+ evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL, _del_parent, obj);\r
+ if (parent_app)\r
+ evas_object_event_callback_add(parent_app, EVAS_CALLBACK_RESIZE, _resize_parent, obj);\r
+ wd->parent_app = parent_app;\r
+\r
+ wd->notify = elm_notify_add(parent); \r
+ elm_widget_resize_object_set(obj, wd->notify);\r
+ elm_notify_orient_set(wd->notify, ELM_NOTIFY_ORIENT_CENTER);\r
+ elm_notify_repeat_events_set(wd->notify, EINA_FALSE);\r
+ evas_object_size_hint_weight_set(wd->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ evas_object_size_hint_align_set(wd->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+\r
+ wd->layout = elm_layout_add(parent);\r
+ evas_object_size_hint_weight_set(wd->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ evas_object_size_hint_align_set(wd->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+\r
+ elm_layout_theme_set(wd->layout, "popup", "base", "default");\r
+ elm_notify_content_set(wd->notify, wd->layout);\r
+\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
+ _sizing_eval(obj);\r
+\r
+ return obj;\r
}\r
\r
/**\r
*\r
* @ingroup Popup\r
*/\r
-Evas_Object *\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
- 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
-\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,\r
- first_button_text,\r
- args);\r
- va_end (args); \r
- }\r
- _sizing_eval(popup);\r
- return popup;\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
+ \r
+ _sizing_eval(popup);\r
+ \r
+ return popup; \r
}\r
\r
/**\r
EAPI void \r
elm_popup_desc_set(Evas_Object *obj, const char *text)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- int w; \r
- char buf[4096];\r
- if (!wd) return;\r
-\r
- if(wd->content_area)\r
- {\r
- evas_object_del(wd->content_area);\r
- wd->content_area=NULL;\r
- } \r
- wd->content_area = elm_layout_add(obj);\r
- elm_layout_theme_set(wd->content_area,"popup","content",elm_widget_style_get(obj));\r
- wd->desc_label = elm_label_add(obj);\r
- snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(wd->desc_label,buf);\r
- elm_label_line_wrap_set(wd->desc_label, EINA_TRUE);\r
- elm_label_label_set(wd->desc_label, text);\r
- evas_object_size_hint_weight_set(wd->desc_label, EVAS_HINT_EXPAND, 0.0);\r
- evas_object_size_hint_align_set(wd->desc_label, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
- evas_object_show(wd->desc_label); \r
- elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_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
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj); \r
+ char buf[4096];\r
+ \r
+ if (!wd) return;\r
+ if (wd->content_area)\r
+ {\r
+ evas_object_del(wd->content_area);\r
+ wd->content_area = NULL;\r
+ } \r
+ wd->content_area = elm_layout_add(obj);\r
+ elm_layout_theme_set(wd->content_area, "popup", "content", elm_widget_style_get(obj));\r
+ wd->desc_label = elm_label_add(obj);\r
+ snprintf(buf, sizeof(buf), "popup_description/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(wd->desc_label, buf);\r
+ elm_label_line_wrap_set(wd->desc_label, EINA_TRUE);\r
+ elm_label_label_set(wd->desc_label, text);\r
+ evas_object_size_hint_weight_set(wd->desc_label, EVAS_HINT_EXPAND, 0.0);\r
+ evas_object_size_hint_align_set(wd->desc_label, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+ evas_object_show(wd->desc_label); \r
+ elm_layout_content_set(wd->content_area, "elm.swallow.content", wd->desc_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
/**\r
EAPI const char* \r
elm_popup_desc_get(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return NULL;\r
-\r
- return elm_label_label_get(wd->desc_label);\r
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return NULL;\r
+ return elm_label_label_get(wd->desc_label);\r
}\r
\r
/**\r
EAPI void \r
elm_popup_title_label_set(Evas_Object *obj, const char *text)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- char buf[4096];\r
- if (!wd) return;\r
-\r
- if(wd->title_area)\r
- {\r
- evas_object_del(wd->title_area);\r
- wd->title_area=NULL;\r
- }\r
- \r
- wd->title_area= elm_label_add(obj); \r
- snprintf(buf, sizeof(buf), "popup_title/%s", elm_widget_style_get(obj));\r
- elm_object_style_set(wd->title_area,buf);\r
- elm_label_label_set(wd->title_area, text);\r
- evas_object_size_hint_weight_set(wd->title_area, EVAS_HINT_EXPAND, 0.0);\r
- evas_object_size_hint_align_set(wd->title_area, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
- elm_layout_content_set(wd->layout, "elm.swallow.title", wd->title_area); \r
- edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm");\r
- if(wd->action_area)\r
- {\r
- edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
- }\r
- if(wd->title_icon)\r
- {\r
- edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");\r
- } \r
- _sizing_eval(obj);\r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ char buf[4096];\r
+ \r
+ if (!wd) return;\r
+ if (wd->title_area)\r
+ {\r
+ evas_object_del(wd->title_area);\r
+ wd->title_area = NULL;\r
+ } \r
+ wd->title_area = elm_label_add(obj); \r
+ snprintf(buf, sizeof(buf), "popup_title/%s", elm_widget_style_get(obj));\r
+ elm_object_style_set(wd->title_area, buf);\r
+ elm_label_label_set(wd->title_area, text);\r
+ evas_object_size_hint_weight_set(wd->title_area, EVAS_HINT_EXPAND, 0.0);\r
+ evas_object_size_hint_align_set(wd->title_area, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+ elm_layout_content_set(wd->layout, "elm.swallow.title", wd->title_area); \r
+ edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,visible", "elm");\r
+ if (wd->action_area)\r
+ {\r
+ edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,title,visible", "elm");\r
+ }\r
+ if (wd->title_icon)\r
+ {\r
+ edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm");\r
+ } \r
+ _sizing_eval(obj);\r
}\r
\r
/**\r
EAPI const char* \r
elm_popup_title_label_get(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return NULL;\r
-\r
- return elm_label_label_get(wd->title_area);\r
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return NULL;\r
+ return elm_label_label_get(wd->title_area);\r
}\r
\r
/**\r
EAPI void \r
elm_popup_title_icon_set(Evas_Object *obj, Evas_Object *icon)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return;\r
-\r
- if(wd->title_icon)\r
- {\r
- evas_object_del(wd->title_icon);\r
- wd->title_icon=NULL;\r
- }\r
- \r
- wd->title_icon= icon; \r
- elm_layout_content_set(wd->layout, "elm.swallow.title.icon", wd->title_icon); \r
- edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm"); \r
- _sizing_eval(obj);\r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return;\r
+ if (wd->title_icon)\r
+ {\r
+ evas_object_del(wd->title_icon);\r
+ wd->title_icon = NULL;\r
+ }\r
+ wd->title_icon = icon; \r
+ elm_layout_content_set(wd->layout, "elm.swallow.title.icon", wd->title_icon); \r
+ edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,title,icon,visible", "elm"); \r
+ _sizing_eval(obj);\r
}\r
\r
/**\r
EAPI Evas_Object* \r
elm_popup_title_icon_get(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return NULL;\r
-\r
- return wd->title_icon;\r
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return NULL;\r
+ return wd->title_icon;\r
}\r
\r
/**\r
EAPI void \r
elm_popup_content_set(Evas_Object *obj, Evas_Object *content)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj); \r
- if (!wd) return;\r
-\r
- if(wd->content_area)\r
- {\r
- evas_object_del(wd->content_area);\r
- wd->content_area=NULL;\r
- } \r
- wd->content_area = elm_layout_add(obj);\r
- elm_layout_theme_set(wd->content_area,"popup","content",elm_widget_style_get(obj));\r
- elm_layout_content_set(wd->content_area, "elm.swallow.content", content); \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
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj); \r
+ \r
+ if (!wd) return;\r
+ if (wd->content_area)\r
+ {\r
+ evas_object_del(wd->content_area);\r
+ wd->content_area = NULL;\r
+ } \r
+ wd->content_area = elm_layout_add(obj);\r
+ elm_layout_theme_set(wd->content_area, "popup","content", elm_widget_style_get(obj));\r
+ elm_layout_content_set(wd->content_area, "elm.swallow.content", content); \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
/**\r
EAPI Evas_Object*\r
elm_popup_content_get(Evas_Object *obj)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return NULL;\r
-\r
- return wd->content_area;\r
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return NULL;\r
+ return wd->content_area;\r
}\r
\r
/**\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 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
* @ingroup Popup\r
*/\r
EAPI void \r
elm_popup_buttons_add(Evas_Object *obj,int no_of_buttons, char *first_button_text, ...)\r
\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj); \r
- char buf[4096];\r
- if (!wd) return; \r
- va_list args; \r
-\r
- va_start (args, first_button_text); \r
-\r
- if(wd->action_area)\r
- {\r
- evas_object_del(wd->action_area);\r
- wd->action_area=NULL;\r
- }\r
- wd->action_area= elm_layout_add(obj); \r
- elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area); \r
- evas_object_size_hint_weight_set(wd->action_area, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
- evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
- snprintf(buf,sizeof(buf),"buttons%d",no_of_buttons); \r
- elm_layout_theme_set(wd->action_area,"popup",buf,elm_widget_style_get(obj)); \r
- edje_object_signal_emit(elm_layout_edje_get(wd->layout), "elm,state,button,visible", "elm");\r
-\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
-\r
- _elm_popup_buttons_add_valist (obj,\r
- first_button_text,\r
- args);\r
- \r
- va_end (args);\r
- _sizing_eval(obj);\r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj); \r
+ char buf[4096]; \r
+ va_list args; \r
+ \r
+ if (!wd) return;\r
+ va_start(args, first_button_text); \r
+ if (wd->action_area)\r
+ {\r
+ evas_object_del(wd->action_area);\r
+ wd->action_area = NULL;\r
+ }\r
+ wd->action_area = elm_layout_add(obj);\r
+ elm_layout_content_set(wd->layout, "elm.swallow.buttonArea", wd->action_area);\r
+ evas_object_size_hint_weight_set(wd->action_area, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ evas_object_size_hint_align_set(wd->action_area, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+ snprintf(buf, sizeof(buf), "buttons%d", no_of_buttons); \r
+ elm_layout_theme_set(wd->action_area, "popup", buf, elm_widget_style_get(obj)); \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 (obj, first_button_text, args);\r
+ va_end(args);\r
+ _sizing_eval(obj);\r
}\r
\r
/**\r
*/\r
EAPI void \r
elm_popup_timeout_set(Evas_Object *obj, int timeout)\r
-{ \r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return; \r
- elm_notify_timeout_set(wd->notify, timeout);\r
- evas_object_smart_callback_add(wd->notify, "notify,timeout", _elm_popup_timeout, obj);\r
+{ \r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return; \r
+ elm_notify_timeout_set(wd->notify, timeout);\r
+ evas_object_smart_callback_add(wd->notify, "notify,timeout", _elm_popup_timeout, obj);\r
}\r
\r
/**\r
*/\r
EAPI void elm_popup_set_mode(Evas_Object *obj, Elm_Popup_Mode mode)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return; \r
- evas_object_smart_callback_add(wd->notify, "block,clicked", _block_clicked_cb, obj);\r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return; \r
+ evas_object_smart_callback_add(wd->notify, "block,clicked", _block_clicked_cb, obj);\r
}\r
\r
/**\r
*/ \r
EAPI void elm_popup_response(Evas_Object *obj, int response_id)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return; \r
- evas_object_hide(obj); \r
- evas_object_smart_callback_call((Evas_Object *)obj, "response", (void *)response_id); \r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \r
+ if (!wd) return; \r
+ evas_object_hide(obj); \r
+ evas_object_smart_callback_call((Evas_Object *)obj, "response", (void *)response_id); \r
}\r
\r
/**\r
*\r
* @ingroup Popup\r
*/\r
- EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient)\r
+EAPI void elm_popup_orient_set(Evas_Object *obj, Elm_Popup_Orient orient)\r
{\r
- Widget_Data *wd = elm_widget_data_get(obj);\r
- if (!wd) return; \r
- Elm_Notify_Orient notify_orient=-1;\r
- switch (orient)\r
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ Elm_Notify_Orient notify_orient = -1;\r
+ \r
+ if (!wd) return;\r
+ switch (orient)\r
{\r
- case ELM_POPUP_ORIENT_TOP:\r
- notify_orient = ELM_NOTIFY_ORIENT_TOP;\r
- break;\r
- case ELM_POPUP_ORIENT_CENTER:\r
- notify_orient = ELM_NOTIFY_ORIENT_CENTER;\r
- break;\r
- case ELM_POPUP_ORIENT_BOTTOM:\r
- notify_orient = ELM_NOTIFY_ORIENT_BOTTOM;\r
- break;\r
- case ELM_POPUP_ORIENT_LEFT:\r
- notify_orient = ELM_NOTIFY_ORIENT_LEFT;\r
- break;\r
- case ELM_POPUP_ORIENT_RIGHT:\r
- notify_orient = ELM_NOTIFY_ORIENT_RIGHT;\r
- break;\r
- case ELM_POPUP_ORIENT_TOP_LEFT:\r
- notify_orient = ELM_NOTIFY_ORIENT_TOP_LEFT;\r
- break;\r
- case ELM_POPUP_ORIENT_TOP_RIGHT:\r
- notify_orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;\r
- break;\r
- case ELM_POPUP_ORIENT_BOTTOM_LEFT:\r
- notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;\r
- break;\r
- case ELM_POPUP_ORIENT_BOTTOM_RIGHT:\r
- notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;\r
- break;\r
+ case ELM_POPUP_ORIENT_TOP:\r
+ notify_orient = ELM_NOTIFY_ORIENT_TOP;\r
+ break;\r
+ case ELM_POPUP_ORIENT_CENTER:\r
+ notify_orient = ELM_NOTIFY_ORIENT_CENTER;\r
+ break;\r
+ case ELM_POPUP_ORIENT_BOTTOM:\r
+ notify_orient = ELM_NOTIFY_ORIENT_BOTTOM;\r
+ break;\r
+ case ELM_POPUP_ORIENT_LEFT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_LEFT;\r
+ break;\r
+ case ELM_POPUP_ORIENT_RIGHT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_RIGHT;\r
+ break;\r
+ case ELM_POPUP_ORIENT_TOP_LEFT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_TOP_LEFT;\r
+ break;\r
+ case ELM_POPUP_ORIENT_TOP_RIGHT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_TOP_RIGHT;\r
+ break;\r
+ case ELM_POPUP_ORIENT_BOTTOM_LEFT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT;\r
+ break;\r
+ case ELM_POPUP_ORIENT_BOTTOM_RIGHT:\r
+ notify_orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT;\r
+ break;\r
}\r
- elm_notify_orient_set(wd->notify, notify_orient);\r
+ elm_notify_orient_set(wd->notify, notify_orient);\r
}\r
\r
/**\r
*\r
* @ingroup Popup\r
*/\r
- EAPI void elm_popup_rotation_set(Evas_Object *obj, int rot_angle)\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
+ ELM_CHECK_WIDTYPE(obj, widtype);\r
+ Widget_Data *wd = elm_widget_data_get(obj);\r
+ \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
\r
\r