jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=27c0c90423bd399d463435a193ad6634da8941ab

commit 27c0c90423bd399d463435a193ad6634da8941ab
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Tue Oct 24 22:30:49 2017 +0900

    efl_ui_popup_alert: Define Clicked_Event structure
---
 src/bin/elementary/test_popup.c          | 15 ++++++++-------
 src/lib/elementary/efl_ui_popup_alert.c  | 18 +++++++++++++++---
 src/lib/elementary/efl_ui_popup_alert.eo |  7 ++++++-
 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
 static void
 efl_ui_popup_alert_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev)
 {
-    Efl_Ui_Popup_Alert_Button type = (Efl_Ui_Popup_Alert_Button)ev->info;
-    if (type == EFL_UI_POPUP_ALERT_BUTTON_POSITIVE)
-      printf("Positive Button is clicked\n");
-    else if(type == EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE)
-      printf("Negative Button is clicked\n");
-    else if(type == EFL_UI_POPUP_ALERT_BUTTON_USER)
-      printf("User Button is clicked\n");
+   Efl_Ui_Popup_Alert_Clicked_Event *event = ev->info;
+
+   if (event->button_type == EFL_UI_POPUP_ALERT_BUTTON_POSITIVE)
+     printf("Positive Button is clicked\n");
+   else if(event->button_type == EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE)
+     printf("Negative Button is clicked\n");
+   else if(event->button_type == EFL_UI_POPUP_ALERT_BUTTON_USER)
+     printf("User Button is clicked\n");
 }
 
 void
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,
                             void *event_info EINA_UNUSED)
 {
    Eo *popup_obj = data;
-   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void 
*)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE);
+
+   Efl_Ui_Popup_Alert_Clicked_Event event;
+   event.button_type = EFL_UI_POPUP_ALERT_BUTTON_POSITIVE;
+
+   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, 
&event);
 }
 
 static void
@@ -96,7 +100,11 @@ _negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
                             void *event_info EINA_UNUSED)
 {
    Eo *popup_obj = data;
-   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void 
*)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE);
+
+   Efl_Ui_Popup_Alert_Clicked_Event event;
+   event.button_type = EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE;
+
+   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, 
&event);
 }
 
 static void
@@ -104,7 +112,11 @@ _user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
                         void *event_info EINA_UNUSED)
 {
    Eo *popup_obj = data;
-   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void 
*)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_USER);
+
+   Efl_Ui_Popup_Alert_Clicked_Event event;
+   event.button_type = EFL_UI_POPUP_ALERT_BUTTON_USER;
+
+   efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, 
&event);
 }
 
 EOLIAN 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 {
    user [[Button having user-defined meaning. e.g. "Cancel"]]
 }
 
+struct Efl.Ui.Popup.Alert.Clicked_Event {
+   [[Information of clicked event]]
+   button_type: Efl.Ui.Popup.Alert.Button; [[Clicked button type]]
+}
+
 class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
 {
    methods {
@@ -26,6 +31,6 @@ class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
       Efl.Part.part;
    }
    events {
-      clicked;
+      clicked: Efl.Ui.Popup.Alert.Clicked_Event;
    }
 }

-- 


Reply via email to