summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-10-24 22:30:49 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 17:15:42 +0900
commit27c0c90423bd399d463435a193ad6634da8941ab (patch)
tree020beabd2bdfdf6cf89aaaf99f10efa0abf01eff
parenta44e8cec395cb482e0f1668f16291198b0e0cd59 (diff)
efl_ui_popup_alert: Define Clicked_Event structure
-rw-r--r--src/bin/elementary/test_popup.c15
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.c18
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.eo7
3 files changed, 29 insertions, 11 deletions
diff --git a/src/bin/elementary/test_popup.c b/src/bin/elementary/test_popup.c
index 4975a0f6f1..c5c8904da7 100644
--- a/src/bin/elementary/test_popup.c
+++ b/src/bin/elementary/test_popup.c
@@ -1113,13 +1113,14 @@ test_efl_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev
1113static void 1113static void
1114efl_ui_popup_alert_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev) 1114efl_ui_popup_alert_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev)
1115{ 1115{
1116 Efl_Ui_Popup_Alert_Button type = (Efl_Ui_Popup_Alert_Button)ev->info; 1116 Efl_Ui_Popup_Alert_Clicked_Event *event = ev->info;
1117 if (type == EFL_UI_POPUP_ALERT_BUTTON_POSITIVE) 1117
1118 printf("Positive Button is clicked\n"); 1118 if (event->button_type == EFL_UI_POPUP_ALERT_BUTTON_POSITIVE)
1119 else if(type == EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE) 1119 printf("Positive Button is clicked\n");
1120 printf("Negative Button is clicked\n"); 1120 else if(event->button_type == EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE)
1121 else if(type == EFL_UI_POPUP_ALERT_BUTTON_USER) 1121 printf("Negative Button is clicked\n");
1122 printf("User Button is clicked\n"); 1122 else if(event->button_type == EFL_UI_POPUP_ALERT_BUTTON_USER)
1123 printf("User Button is clicked\n");
1123} 1124}
1124 1125
1125void 1126void
diff --git a/src/lib/elementary/efl_ui_popup_alert.c b/src/lib/elementary/efl_ui_popup_alert.c
index bfb2c3d4e2..13e708f50b 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -88,7 +88,11 @@ _positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
88 void *event_info EINA_UNUSED) 88 void *event_info EINA_UNUSED)
89{ 89{
90 Eo *popup_obj = data; 90 Eo *popup_obj = data;
91 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE); 91
92 Efl_Ui_Popup_Alert_Clicked_Event event;
93 event.button_type = EFL_UI_POPUP_ALERT_BUTTON_POSITIVE;
94
95 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, &event);
92} 96}
93 97
94static void 98static void
@@ -96,7 +100,11 @@ _negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
96 void *event_info EINA_UNUSED) 100 void *event_info EINA_UNUSED)
97{ 101{
98 Eo *popup_obj = data; 102 Eo *popup_obj = data;
99 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE); 103
104 Efl_Ui_Popup_Alert_Clicked_Event event;
105 event.button_type = EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE;
106
107 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, &event);
100} 108}
101 109
102static void 110static void
@@ -104,7 +112,11 @@ _user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
104 void *event_info EINA_UNUSED) 112 void *event_info EINA_UNUSED)
105{ 113{
106 Eo *popup_obj = data; 114 Eo *popup_obj = data;
107 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_USER); 115
116 Efl_Ui_Popup_Alert_Clicked_Event event;
117 event.button_type = EFL_UI_POPUP_ALERT_BUTTON_USER;
118
119 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, &event);
108} 120}
109 121
110EOLIAN static void 122EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_popup_alert.eo b/src/lib/elementary/efl_ui_popup_alert.eo
index 42c55a47f5..7d9fb1fbc1 100644
--- a/src/lib/elementary/efl_ui_popup_alert.eo
+++ b/src/lib/elementary/efl_ui_popup_alert.eo
@@ -5,6 +5,11 @@ enum Efl.Ui.Popup.Alert.Button {
5 user [[Button having user-defined meaning. e.g. "Cancel"]] 5 user [[Button having user-defined meaning. e.g. "Cancel"]]
6} 6}
7 7
8struct Efl.Ui.Popup.Alert.Clicked_Event {
9 [[Information of clicked event]]
10 button_type: Efl.Ui.Popup.Alert.Button; [[Clicked button type]]
11}
12
8class Efl.Ui.Popup.Alert(Efl.Ui.Popup) 13class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
9{ 14{
10 methods { 15 methods {
@@ -26,6 +31,6 @@ class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
26 Efl.Part.part; 31 Efl.Part.part;
27 } 32 }
28 events { 33 events {
29 clicked; 34 clicked: Efl.Ui.Popup.Alert.Clicked_Event;
30 } 35 }
31} 36}