summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-11-04 22:17:03 +0900
committerChunEon Park <hermet@hermet.pe.kr>2013-11-04 22:17:03 +0900
commita61bbe7dcf0c6936e3104b35d56a7ed330da4176 (patch)
treee263238f400b2d963e6690e372bbf2dbc59e57cf
parent48a5cb1d1fe69e7e4ce79da11880d8ca4a2ddfa3 (diff)
Revert "popup: Added support for popup move. elm_popup_move."
This reverts commit f67ecb2028dd663aa4b0d9fe78b2a392ac169e7e. Conflicts: ChangeLog NEWS src/bin/test_popup.c Sorry, Pend this to 1.8 after. Let's think about adding this API more carefully.
-rw-r--r--ChangeLog11
-rw-r--r--NEWS3
-rw-r--r--src/bin/test_popup.c42
-rw-r--r--src/lib/elc_popup.c41
-rw-r--r--src/lib/elc_popup_eo.h14
-rw-r--r--src/lib/elc_popup_legacy.h15
6 files changed, 9 insertions, 117 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cede7ac6..6c340ee3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1732,10 +1732,13 @@
1732 1732
1733 * slider: Added elm_slider_step_get(), elm_slider_step_set(). 1733 * slider: Added elm_slider_step_get(), elm_slider_step_set().
1734 1734
17352013-10-03 Abhinandan Aryadipta (aryarockstar)
1736
1737 * Popup - Added elm_popup_move() api.
1738
17392013-10-03 Daniel Juyung Seo (SeoZ) 17352013-10-03 Daniel Juyung Seo (SeoZ)
1740 1736
1741 * Genlist/Gengrid: Added multi select mode. 1737 * Genlist/Gengrid: Added multi select mode.
1738
17392013-10-02 Ryuan Choi (ryuan)
1740
1741 * genlist , gengrid: Add ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL.
1742 It disallow multiple selection when clicked without control pressed although
1743 multiple selection is enabled.
1744
diff --git a/NEWS b/NEWS
index 23d93e304..0e0d6bb30 100644
--- a/NEWS
+++ b/NEWS
@@ -100,8 +100,9 @@ Additions:
100 * Add signals "spinner,drag,start" and "spinner,drag,stop" to the spinner widget. 100 * Add signals "spinner,drag,start" and "spinner,drag,stop" to the spinner widget.
101 * Add support for "clicked" callback on Return/space/KP_Enter key press for image. 101 * Add support for "clicked" callback on Return/space/KP_Enter key press for image.
102 * Add elm_slider_step_get(), elm_slider_step_set() for slider. 102 * Add elm_slider_step_get(), elm_slider_step_set() for slider.
103 * Add support elm_popup_move() for popup.
104 * Add multi select mode for genlist/gengrid. 103 * Add multi select mode for genlist/gengrid.
104 * Add ELM_OBJECT_MULTIPLE_SELECT_MODE_WITH_CONTROL select mode for genlist/gengrid.
105>>>>>>> parent of f67ecb2... popup: Added support for popup move. elm_popup_move.
105 106
106Improvements: 107Improvements:
107 108
diff --git a/src/bin/test_popup.c b/src/bin/test_popup.c
index e98a71c4f..918ad5bfe 100644
--- a/src/bin/test_popup.c
+++ b/src/bin/test_popup.c
@@ -36,19 +36,6 @@ static Evas_Coord_Point _popup_point[POPUP_POINT_MAX] =
36}; 36};
37 37
38static void 38static void
39_popup_move_cb(void *data, Evas_Object *obj EINA_UNUSED,
40 void *event_info EINA_UNUSED)
41{
42 static int k = 0;
43
44 elm_popup_move(data, _popup_point[k].x, _popup_point[k].y);
45
46 k++;
47 if (k >= POPUP_POINT_MAX)
48 k = 0;
49}
50
51static void
52_g_popup_response_cb(void *data, Evas_Object *obj EINA_UNUSED, 39_g_popup_response_cb(void *data, Evas_Object *obj EINA_UNUSED,
53 void *event_info EINA_UNUSED) 40 void *event_info EINA_UNUSED)
54{ 41{
@@ -494,33 +481,6 @@ _popup_transparent_cb(void *data, Evas_Object *obj EINA_UNUSED,
494} 481}
495 482
496static void 483static void
497_popup_transparent_move_cb(void *data, Evas_Object *obj EINA_UNUSED,
498 void *event_info EINA_UNUSED)
499{
500 Evas_Object *popup;
501 Evas_Object *btn, *btn1;
502
503 popup = elm_popup_add(data);
504 elm_object_style_set(popup, "transparent");
505 elm_object_text_set(popup, "This Popup has transparent background");
506
507 // popup buttons
508 btn = elm_button_add(popup);
509 elm_object_text_set(btn, "Move");
510 elm_object_part_content_set(popup, "button1", btn);
511 evas_object_smart_callback_add(btn, "clicked", _popup_move_cb, popup);
512
513 btn1 = elm_button_add(popup);
514 elm_object_text_set(btn1, "Close");
515 elm_object_part_content_set(popup, "button2", btn1);
516 evas_object_smart_callback_add(btn1, "clicked", _popup_close_cb, popup);
517
518 // popup show should be called after adding all the contents and the buttons
519 // of popup to set the focus into popup's contents correctly.
520 evas_object_show(popup);
521}
522
523static void
524_list_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 484_list_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
525{ 485{
526 evas_object_del(data); 486 evas_object_del(data);
@@ -597,8 +557,6 @@ test_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
597 _popup_center_text_3button_add_remove_button_cb, win); 557 _popup_center_text_3button_add_remove_button_cb, win);
598 elm_list_item_append(list, "popup-transparent", NULL, NULL, 558 elm_list_item_append(list, "popup-transparent", NULL, NULL,
599 _popup_transparent_cb, win); 559 _popup_transparent_cb, win);
600 elm_list_item_append(list, "popup-transparent-move", NULL, NULL,
601 _popup_transparent_move_cb, win);
602 elm_list_item_append(list, "popup-center-title + list content + 1 button", 560 elm_list_item_append(list, "popup-center-title + list content + 1 button",
603 NULL, NULL, _popup_center_title_list_content_1button_cb, 561 NULL, NULL, _popup_center_title_list_content_1button_cb,
604 win); 562 win);
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index c5b5c98ee..f873cff00 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -1755,45 +1755,6 @@ _orient_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
1755} 1755}
1756 1756
1757EAPI void 1757EAPI void
1758elm_popup_move(Evas_Object *obj,
1759 Evas_Coord x, Evas_Coord y)
1760{
1761 ELM_POPUP_CHECK(obj);
1762 eo_do(obj, elm_obj_popup_move(x, y));
1763}
1764
1765static void
1766_move(Eo *obj, void *_pd, va_list *list)
1767{
1768 Evas_Coord x = va_arg(*list, Evas_Coord);
1769 Evas_Coord y = va_arg(*list, Evas_Coord);
1770 Evas_Coord tw, th, w, h;
1771 Evas_Object *top;
1772 Elm_Popup_Smart_Data *sd = _pd;
1773
1774 top = elm_widget_top_get(obj);
1775 if (!top)
1776 {
1777 ERR("The top parent is NULL! : popup=%p", obj);
1778 return;
1779 }
1780
1781 evas_object_geometry_get(top, NULL, NULL, &tw, &th);
1782 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
1783
1784 if (x < 0) x = 0;
1785 if (y < 0) y = 0;
1786 if ((x > (tw - w)) && (tw - w > 0))
1787 x = tw - w;
1788 if ((y > (th - h)) && (th - h > 0))
1789 y = th - h;
1790 if ((x > tw) || (y > th) || (w > tw) || (h > th))
1791 elm_notify_align_set(sd->notify, 0.5, 0.5);
1792 else
1793 elm_notify_align_set(sd->notify, ((double)x/(double)tw), ((double)y/(double)th));
1794}
1795
1796EAPI void
1797elm_popup_timeout_set(Evas_Object *obj, 1758elm_popup_timeout_set(Evas_Object *obj,
1798 double timeout) 1759 double timeout)
1799{ 1760{
@@ -1960,7 +1921,6 @@ _class_constructor(Eo_Class *klass)
1960 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), _allow_events_set), 1921 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET), _allow_events_set),
1961 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), _allow_events_get), 1922 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET), _allow_events_get),
1962 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), _item_append), 1923 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), _item_append),
1963 EO_OP_FUNC(ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_MOVE), _move),
1964 EO_OP_FUNC_SENTINEL 1924 EO_OP_FUNC_SENTINEL
1965 }; 1925 };
1966 eo_class_funcs_set(klass, func_desc); 1926 eo_class_funcs_set(klass, func_desc);
@@ -1977,7 +1937,6 @@ static const Eo_Op_Description op_desc[] = {
1977 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET, "Sets whether events should be passed to by a click outside."), 1937 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET, "Sets whether events should be passed to by a click outside."),
1978 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET, "Returns value indicating whether allow event is enabled or not."), 1938 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET, "Returns value indicating whether allow event is enabled or not."),
1979 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND, "Add a new item to a Popup object."), 1939 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND, "Add a new item to a Popup object."),
1980 EO_OP_DESCRIPTION(ELM_OBJ_POPUP_SUB_ID_MOVE, "Move the popup relative to its top parent."),
1981 EO_OP_DESCRIPTION_SENTINEL 1940 EO_OP_DESCRIPTION_SENTINEL
1982}; 1941};
1983static const Eo_Class_Description class_desc = { 1942static const Eo_Class_Description class_desc = {
diff --git a/src/lib/elc_popup_eo.h b/src/lib/elc_popup_eo.h
index 75bf885e9..6d0910937 100644
--- a/src/lib/elc_popup_eo.h
+++ b/src/lib/elc_popup_eo.h
@@ -20,7 +20,6 @@ enum
20 ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET, 20 ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_SET,
21 ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET, 21 ELM_OBJ_POPUP_SUB_ID_ALLOW_EVENTS_GET,
22 ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND, 22 ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND,
23 ELM_OBJ_POPUP_SUB_ID_MOVE,
24 ELM_OBJ_POPUP_SUB_ID_LAST 23 ELM_OBJ_POPUP_SUB_ID_LAST
25}; 24};
26 25
@@ -139,19 +138,6 @@ enum
139 * @see elm_popup_item_append 138 * @see elm_popup_item_append
140 */ 139 */
141#define elm_obj_popup_item_append(label, icon, func, data, ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret) 140#define elm_obj_popup_item_append(label, icon, func, data, ret) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_ITEM_APPEND), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Object *, icon), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
142
143/**
144 * @def elm_obj_popup_move
145 * @since 1.8
146 *
147 * @brief Move the popup relative to its top parent
148 *
149 * @param[in] x
150 * @param[in] y
151 *
152 * @see elm_popup_move
153 */
154#define elm_obj_popup_move(x, y) ELM_OBJ_POPUP_ID(ELM_OBJ_POPUP_SUB_ID_MOVE), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
155/** 141/**
156 * @} 142 * @}
157 */ 143 */
diff --git a/src/lib/elc_popup_legacy.h b/src/lib/elc_popup_legacy.h
index 2530ba05f..0f2d08f52 100644
--- a/src/lib/elc_popup_legacy.h
+++ b/src/lib/elc_popup_legacy.h
@@ -136,18 +136,3 @@ EAPI Eina_Bool elm_popup_allow_events_get(const Evas_Object *obj);
136 * and item(s) can be there in a popup content area. 136 * and item(s) can be there in a popup content area.
137 */ 137 */
138EAPI Elm_Object_Item *elm_popup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1); 138EAPI Elm_Object_Item *elm_popup_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data) EINA_ARG_NONNULL(1);
139
140/**
141 * @since 1.8
142 *
143 * @brief Move the popup relative to its top parent
144 *
145 * @param obj popup object
146 * @param x X position to move the popup object to, in canvas units,
147 * with relative to its top parent object.
148 * @param y Y position to move the popup object to, in canvas units,
149 * with relative to its top parent object.
150 *
151 * @ingroup Popup
152 */
153EAPI void elm_popup_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);