summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-26 10:15:24 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-26 16:30:32 +0200
commitf5a4fd89d9935fd77afab7bad446477d101e35da (patch)
treedfa06fa31bf4ef89162974aadc94366bc1e28c46 /src/lib/elementary
parenta95870286e45cc2c86736566b7d066feba8e56f8 (diff)
efl_ui/item_clickable: fix event info for press events
this is just a button and not the full clickable struct Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10198
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_collection.c18
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c39
-rw-r--r--src/lib/elementary/efl_ui_item_clickable.eo12
3 files changed, 50 insertions, 19 deletions
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index a281997..6c3c5fe 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -632,13 +632,25 @@ _redirect_cb(void *data, const Efl_Event *ev)
632 \ 632 \
633 efl_event_callback_call(obj, Item_Desc, &item_clicked); \ 633 efl_event_callback_call(obj, Item_Desc, &item_clicked); \
634 } 634 }
635#define REDIRECT_EVT_PRESS(Desc, Item_Desc) \
636 if (Desc == ev->desc) \
637 { \
638 Efl_Ui_Item_Clickable_Pressed item_pressed; \
639 int *button = ev->info; \
640 \
641 item_pressed.button = *button; \
642 item_pressed.item = ev->object; \
643 \
644 efl_event_callback_call(obj, Item_Desc, &item_pressed); \
645 }
635 646
636 REDIRECT_EVT(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED); 647 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED);
637 REDIRECT_EVT(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED); 648 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED);
638 REDIRECT_EVT(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED); 649 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED);
639 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY); 650 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY);
640 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED); 651 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED);
641#undef REDIRECT_EVT 652#undef REDIRECT_EVT
653#undef REDIRECT_EVT_PRESS
642} 654}
643 655
644EFL_CALLBACKS_ARRAY_DEFINE(active_item, 656EFL_CALLBACKS_ARRAY_DEFINE(active_item,
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 400e80e..8640bda 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -183,23 +183,36 @@ _redirect_item_cb(void *data, const Efl_Event *ev)
183{ 183{
184 Eo *obj = data; 184 Eo *obj = data;
185 185
186#define REDIRECT_EVT(Desc, Item_Desc) \ 186#define REDIRECT_EVT(Desc, Item_Desc) \
187 if (Desc == ev->desc) \ 187 if (Desc == ev->desc) \
188 { \ 188 { \
189 Efl_Ui_Item_Clickable_Clicked item_clicked; \ 189 Efl_Ui_Item_Clickable_Clicked item_clicked; \
190 Efl_Input_Clickable_Clicked *clicked = ev->info; \ 190 Efl_Input_Clickable_Clicked *clicked = ev->info; \
191 \ 191 \
192 item_clicked.clicked = *clicked; \ 192 item_clicked.clicked = *clicked; \
193 item_clicked.item = ev->object; \ 193 item_clicked.item = ev->object; \
194 \ 194 \
195 efl_event_callback_call(obj, Item_Desc, &item_clicked); \ 195 efl_event_callback_call(obj, Item_Desc, &item_clicked); \
196 } 196 }
197 REDIRECT_EVT(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED); 197#define REDIRECT_EVT_PRESS(Desc, Item_Desc) \
198 REDIRECT_EVT(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED); 198 if (Desc == ev->desc) \
199 REDIRECT_EVT(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED); 199 { \
200 Efl_Ui_Item_Clickable_Pressed item_pressed; \
201 int *button = ev->info; \
202 \
203 item_pressed.button = *button; \
204 item_pressed.item = ev->object; \
205 \
206 efl_event_callback_call(obj, Item_Desc, &item_pressed); \
207 }
208
209 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED);
210 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED);
211 REDIRECT_EVT_PRESS(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED);
200 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY); 212 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY);
201 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED); 213 REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED);
202#undef REDIRECT_EVT 214#undef REDIRECT_EVT
215#undef REDIRECT_EVT_PRESS
203} 216}
204 217
205EFL_CALLBACKS_ARRAY_DEFINE(active_item_cbs, 218EFL_CALLBACKS_ARRAY_DEFINE(active_item_cbs,
diff --git a/src/lib/elementary/efl_ui_item_clickable.eo b/src/lib/elementary/efl_ui_item_clickable.eo
index a8bc7ea..fbe680a 100644
--- a/src/lib/elementary/efl_ui_item_clickable.eo
+++ b/src/lib/elementary/efl_ui_item_clickable.eo
@@ -6,14 +6,20 @@ struct Efl.Ui.Item_Clickable_Clicked {
6 item: Efl.Ui.Item; [[The clicked item.]] 6 item: Efl.Ui.Item; [[The clicked item.]]
7} 7}
8 8
9struct Efl.Ui.Item_Clickable_Pressed {
10 [[A struct that expresses a press or unpress in item of container widget.]]
11 button: int; [[The button which was pressed or unpressed.]]
12 item: Efl.Ui.Item; [[The corresponding item.]]
13}
14
9interface Efl.Ui.Item_Clickable 15interface Efl.Ui.Item_Clickable
10{ 16{
11 [[Shared sets of events between @Efl.Ui.Collection and @Efl.Ui.Collection_View.]] 17 [[Shared sets of events between @Efl.Ui.Collection and @Efl.Ui.Collection_View.]]
12 event_prefix: efl_ui; 18 event_prefix: efl_ui;
13 events { 19 events {
14 item,pressed : Efl.Ui.Item_Clickable_Clicked; [[A $pressed event occurred over an item.]] 20 item,pressed : Efl.Ui.Item_Clickable_Pressed; [[A $pressed event occurred over an item.]]
15 item,unpressed : Efl.Ui.Item_Clickable_Clicked; [[An $unpressed event occurred over an item.]] 21 item,unpressed : Efl.Ui.Item_Clickable_Pressed; [[An $unpressed event occurred over an item.]]
16 item,longpressed : Efl.Ui.Item_Clickable_Clicked; [[A $longpressed event occurred over an item.]] 22 item,longpressed : Efl.Ui.Item_Clickable_Pressed; [[A $longpressed event occurred over an item.]]
17 item,clicked : Efl.Ui.Item_Clickable_Clicked; [[A $clicked event occurred over an item.]] 23 item,clicked : Efl.Ui.Item_Clickable_Clicked; [[A $clicked event occurred over an item.]]
18 item,clicked,any : Efl.Ui.Item_Clickable_Clicked; [[A $[clicked,any] event occurred over an item.]] 24 item,clicked,any : Efl.Ui.Item_Clickable_Clicked; [[A $[clicked,any] event occurred over an item.]]
19 } 25 }