summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-18 17:09:31 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:01 +0900
commit049a5ddb44de2d55bc565ac2d3943f0ed5352071 (patch)
treef6279782cd800016bc554a31017a4e00ba0ca76f
parentab7f281c3461313d907ef8cac238cb380cd3da6d (diff)
evas events: Remove now unused code
-rw-r--r--src/lib/evas/canvas/evas_events.c138
-rw-r--r--src/lib/evas/canvas/evas_events_legacy.c280
-rw-r--r--src/lib/evas/include/evas_private.h3
3 files changed, 0 insertions, 421 deletions
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 60c1750345..50e17c2b84 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -28,33 +28,6 @@ static void
28_canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y, 28_canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, int y,
29 unsigned int timestamp, const void *data); 29 unsigned int timestamp, const void *data);
30 30
31/* FIXME: remove this */
32static void
33_evas_event_havemap_adjust(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *x, Evas_Coord *y, Eina_Bool mouse_grabbed)
34{
35 double tx = *x, ty = *y;
36
37 if (obj->smart.parent)
38 {
39 Evas_Object_Protected_Data *smart_parent_obj = efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
40 _evas_event_havemap_adjust(obj->smart.parent, smart_parent_obj, x, y, mouse_grabbed);
41 }
42
43 if ((!obj->map->cur.usemap) || (!obj->map->cur.map) ||
44 (obj->map->cur.map->count != 4))
45 return;
46
47 //FIXME: Unless map_coords_get() supports grab mode and extrapolate coords
48 //outside map, this should check the return value for outside case.
49 if (evas_map_coords_get(obj->map->cur.map, tx, ty, &tx, &ty, mouse_grabbed))
50 {
51 tx += obj->cur->geometry.x;
52 ty += obj->cur->geometry.y;
53 *x = tx;
54 *y = ty;
55 }
56}
57
58static void 31static void
59_evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Vector2 *point, Eina_Bool mouse_grabbed) 32_evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Vector2 *point, Eina_Bool mouse_grabbed)
60{ 33{
@@ -77,94 +50,6 @@ _evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec
77 } 50 }
78} 51}
79 52
80static inline Efl_Event *
81_efl_event_create(Efl_Event *evt, Evas_Callback_Type type, void *ev,
82 Efl_Event *parentev, Efl_Event_Flags **pflags)
83{
84 if (!ev) return NULL;
85
86 /* This function converts an existing evas info struct to the efl pointer
87 * event. All pointers must be valid.
88 *
89 * See also evas_callbacks.c: _pointer_event_get()
90 *
91 * FIXME: evas event logic should not use legacy structs anymore... this
92 * should be temporary code. Should be.
93 */
94
95#define EV_CASE(TYPE, Type, OBJTYP, objtyp) \
96 case EVAS_CALLBACK_ ## TYPE: \
97 if (!evt) evt = efl_event_instance_get(EFL_EVENT_ ## OBJTYP ## _CLASS, parentev, NULL); \
98 efl_event_ ## objtyp ## _legacy_info_set(evt, ev, type); \
99 if (pflags) *pflags = &(((Evas_Event_ ## Type *) ev)->event_flags); \
100 break;
101
102 switch (type)
103 {
104 EV_CASE(MOUSE_MOVE, Mouse_Move, POINTER, pointer);
105 EV_CASE(MOUSE_OUT, Mouse_Out, POINTER, pointer);
106 EV_CASE(MOUSE_IN, Mouse_In, POINTER, pointer);
107 EV_CASE(MOUSE_DOWN, Mouse_Down, POINTER, pointer);
108 EV_CASE(MOUSE_UP, Mouse_Up, POINTER, pointer);
109 EV_CASE(MULTI_MOVE, Multi_Move, POINTER, pointer);
110 EV_CASE(MULTI_DOWN, Multi_Down, POINTER, pointer);
111 EV_CASE(MULTI_UP, Multi_Up, POINTER, pointer);
112 EV_CASE(MOUSE_WHEEL, Mouse_Wheel, POINTER, pointer);
113 EV_CASE(KEY_DOWN, Key_Down, KEY, key);
114 EV_CASE(KEY_UP, Key_Up, KEY, key);
115 EV_CASE(HOLD, Hold, HOLD, hold);
116
117 default:
118 DBG("Support for event type %d not implemented yet.", type);
119 break;
120 }
121
122#undef EV_CASE
123
124 return evt;
125}
126
127static inline const Efl_Event_Description *
128_efl_event_desc_get(Evas_Callback_Type type)
129{
130 switch (type)
131 {
132 case EVAS_CALLBACK_MOUSE_IN:
133 return EFL_EVENT_POINTER_IN;
134 case EVAS_CALLBACK_MOUSE_OUT:
135 return EFL_EVENT_POINTER_OUT;
136 case EVAS_CALLBACK_MOUSE_DOWN:
137 case EVAS_CALLBACK_MULTI_DOWN:
138 return EFL_EVENT_POINTER_DOWN;
139 case EVAS_CALLBACK_MOUSE_UP:
140 case EVAS_CALLBACK_MULTI_UP:
141 return EFL_EVENT_POINTER_UP;
142 case EVAS_CALLBACK_MOUSE_MOVE:
143 case EVAS_CALLBACK_MULTI_MOVE:
144 return EFL_EVENT_POINTER_MOVE;
145 case EVAS_CALLBACK_MOUSE_WHEEL:
146 return EFL_EVENT_POINTER_WHEEL;
147 case EVAS_CALLBACK_KEY_DOWN:
148 return EFL_EVENT_KEY_DOWN;
149 case EVAS_CALLBACK_KEY_UP:
150 return EFL_EVENT_KEY_UP;
151 case EVAS_CALLBACK_HOLD:
152 return EFL_EVENT_HOLD;
153 default:
154 return NULL;
155 }
156}
157
158#define EV_CALL(_eo_obj, _obj, _typ, _info, _id, _eoev, _parent_ev) do { \
159 Efl_Event_Flags *_info_pflags = NULL; \
160 _eoev = _efl_event_create(_eoev, _typ, _info, _parent_ev, &_info_pflags); \
161 evas_object_event_callback_call(_eo_obj, _obj, _typ, _info, _id, \
162 _efl_event_desc_get(_typ), _eoev); \
163 if (_info_pflags) *_info_pflags = efl_event_flags_get(_eoev); \
164 } while (0)
165#define EV_RESET(a) do { if (a) efl_event_reset(a); } while (0)
166#define EV_DEL(a) do { if (a) { efl_unref(a); } a = NULL; } while (0)
167
168#if 0 53#if 0
169# define DDD_DO 1 54# define DDD_DO 1
170# define DDD(...) do { for (i = 0; i < spaces; i++) printf(" "); printf(__VA_ARGS__); } while (0) 55# define DDD(...) do { for (i = 0; i < spaces; i++) printf(" "); printf(__VA_ARGS__); } while (0)
@@ -460,29 +345,6 @@ _evas_event_object_list_raw_in_get(Evas *eo_e, Eina_List *in,
460 return in; 345 return in;
461} 346}
462 347
463/* FIXME: remove this */
464static void
465_transform_to_src_space(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *src, Evas_Coord *x, Evas_Coord *y)
466{
467 Evas_Coord obj_w = obj->cur->geometry.w, obj_h = obj->cur->geometry.h;
468 Evas_Coord src_w = src->cur->geometry.w, src_h = src->cur->geometry.h;
469 Evas_Coord tmp_x = *x;
470 Evas_Coord tmp_y = *y;
471
472 tmp_x -= obj->cur->geometry.x;
473 tmp_y -= obj->cur->geometry.y;
474
475 if (obj_w != src_w)
476 tmp_x = (Evas_Coord) ((float)tmp_x * ((float)src_w / (float)obj_w));
477 if (obj_h != src_h)
478 tmp_y = (Evas_Coord) ((float)tmp_y * ((float)src_h / (float)obj_h));
479
480 tmp_x += src->cur->geometry.x;
481 tmp_y += src->cur->geometry.y;
482 *x = tmp_x;
483 *y = tmp_y;
484}
485
486static void 348static void
487_transform_to_src_space_f(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *src, Eina_Vector2 *point) 349_transform_to_src_space_f(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *src, Eina_Vector2 *point)
488{ 350{
diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c
index 2dcdb6896e..dfe3d824d3 100644
--- a/src/lib/evas/canvas/evas_events_legacy.c
+++ b/src/lib/evas/canvas/evas_events_legacy.c
@@ -32,211 +32,6 @@ _event_alloc(void *old)
32 return old; 32 return old;
33} 33}
34 34
35Eina_Bool
36efl_event_pointer_legacy_info_set(Efl_Event_Pointer *evt, const void *event_info, Evas_Callback_Type type)
37{
38 Efl_Event_Pointer_Data *ev = efl_data_scope_get(evt, EFL_EVENT_POINTER_CLASS);
39 if (!ev || !event_info) return EINA_FALSE;
40
41 /* FIXME/TODO:
42 * Some events definitely don't have all the info they could have. Need
43 * to get it from ecore!
44 */
45
46#if defined(DEBUG)
47# define CHKACT(a) do { if (evdata->action != EFL_POINTER_ACTION_ ## a) abort(); } while (0)
48#else
49# define CHKACT(a) do {} while(0)
50#endif
51
52 switch (type)
53 {
54 case EVAS_CALLBACK_MOUSE_IN:
55 CHKACT(IN);
56 {
57 const Evas_Event_Mouse_In *e = event_info;
58 ev->action = EFL_POINTER_ACTION_IN;
59 ev->cur.x = e->canvas.x;
60 ev->cur.y = e->canvas.y;
61 ev->data = e->data;
62 ev->timestamp = e->timestamp;
63 ev->event_flags = e->event_flags;
64 ev->device = e->dev;
65 ev->source = e->event_src;
66 ev->modifiers = e->modifiers;
67 ev->locks = e->locks;
68 break;
69 }
70
71 case EVAS_CALLBACK_MOUSE_OUT:
72 CHKACT(OUT);
73 {
74 const Evas_Event_Mouse_Out *e = event_info;
75 ev->action = EFL_POINTER_ACTION_OUT;
76 ev->cur.x = e->canvas.x;
77 ev->cur.y = e->canvas.y;
78 ev->data = e->data;
79 ev->timestamp = e->timestamp;
80 ev->event_flags = e->event_flags;
81 ev->device = e->dev;
82 ev->source = e->event_src;
83 ev->modifiers = e->modifiers;
84 ev->locks = e->locks;
85 break;
86 }
87
88 case EVAS_CALLBACK_MOUSE_DOWN:
89 CHKACT(DOWN);
90 {
91 const Evas_Event_Mouse_Down *e = event_info;
92 ev->action = EFL_POINTER_ACTION_DOWN;
93 ev->button = e->button;
94 ev->cur.x = e->canvas.x;
95 ev->cur.y = e->canvas.y;
96 ev->data = e->data;
97 ev->button_flags = e->flags;
98 ev->timestamp = e->timestamp;
99 ev->event_flags = e->event_flags;
100 ev->device = e->dev;
101 ev->source = e->event_src;
102 ev->modifiers = e->modifiers;
103 ev->locks = e->locks;
104 break;
105 }
106
107 case EVAS_CALLBACK_MOUSE_UP:
108 CHKACT(UP);
109 {
110 const Evas_Event_Mouse_Up *e = event_info;
111 ev->action = EFL_POINTER_ACTION_UP;
112 ev->button = e->button;
113 ev->cur.x = e->canvas.x;
114 ev->cur.y = e->canvas.y;
115 ev->data = e->data;
116 ev->button_flags = e->flags;
117 ev->timestamp = e->timestamp;
118 ev->event_flags = e->event_flags;
119 ev->device = e->dev;
120 ev->source = e->event_src;
121 ev->modifiers = e->modifiers;
122 ev->locks = e->locks;
123 break;
124 }
125
126 case EVAS_CALLBACK_MOUSE_MOVE:
127 CHKACT(MOVE);
128 {
129 const Evas_Event_Mouse_Move *e = event_info;
130 ev->action = EFL_POINTER_ACTION_MOVE;
131 ev->pressed_buttons = e->buttons;
132 ev->cur.x = e->cur.canvas.x;
133 ev->cur.y = e->cur.canvas.y;
134 ev->prev.x = e->prev.canvas.x;
135 ev->prev.y = e->prev.canvas.y;
136 ev->data = e->data;
137 ev->timestamp = e->timestamp;
138 ev->event_flags = e->event_flags;
139 ev->device = e->dev;
140 ev->source = e->event_src;
141 ev->modifiers = e->modifiers;
142 ev->locks = e->locks;
143 break;
144 }
145
146 case EVAS_CALLBACK_MOUSE_WHEEL:
147 CHKACT(WHEEL);
148 {
149 const Evas_Event_Mouse_Wheel *e = event_info;
150 ev->action = EFL_POINTER_ACTION_WHEEL;
151 ev->wheel.dir = (e->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL);
152 ev->wheel.z = e->z;
153 ev->cur.x = e->canvas.x;
154 ev->cur.y = e->canvas.y;
155 ev->data = e->data;
156 ev->timestamp = e->timestamp;
157 ev->event_flags = e->event_flags;
158 ev->device = e->dev;
159 ev->modifiers = e->modifiers;
160 ev->locks = e->locks;
161 break;
162 }
163
164 case EVAS_CALLBACK_MULTI_DOWN:
165 CHKACT(DOWN);
166 {
167 const Evas_Event_Multi_Down *e = event_info;
168 ev->action = EFL_POINTER_ACTION_DOWN;
169 ev->finger = e->device;
170 ev->radius = e->radius;
171 ev->radius_x = e->radius_x;
172 ev->radius_y = e->radius_y;
173 ev->pressure = e->pressure;
174 ev->angle = e->angle;
175 ev->cur.x = e->canvas.xsub;
176 ev->cur.y = e->canvas.ysub;
177 ev->data = e->data;
178 ev->button_flags = e->flags;
179 ev->timestamp = e->timestamp;
180 ev->event_flags = e->event_flags;
181 ev->device = e->dev;
182 ev->modifiers = e->modifiers;
183 ev->locks = e->locks;
184 break;
185 }
186
187 case EVAS_CALLBACK_MULTI_UP:
188 CHKACT(UP);
189 {
190 const Evas_Event_Multi_Up *e = event_info;
191 ev->action = EFL_POINTER_ACTION_UP;
192 ev->finger = e->device;
193 ev->radius = e->radius;
194 ev->radius_x = e->radius_x;
195 ev->radius_y = e->radius_y;
196 ev->pressure = e->pressure;
197 ev->angle = e->angle;
198 ev->cur.x = e->canvas.xsub;
199 ev->cur.y = e->canvas.ysub;
200 ev->data = e->data;
201 ev->button_flags = e->flags;
202 ev->timestamp = e->timestamp;
203 ev->event_flags = e->event_flags;
204 ev->device = e->dev;
205 ev->modifiers = e->modifiers;
206 ev->locks = e->locks;
207 break;
208 }
209
210 case EVAS_CALLBACK_MULTI_MOVE:
211 CHKACT(MOVE);
212 {
213 const Evas_Event_Multi_Move *e = event_info;
214 ev->action = EFL_POINTER_ACTION_MOVE;
215 ev->finger = e->device;
216 ev->radius = e->radius;
217 ev->radius_x = e->radius_x;
218 ev->radius_y = e->radius_y;
219 ev->pressure = e->pressure;
220 ev->angle = e->angle;
221 ev->cur.x = e->cur.canvas.xsub;
222 ev->cur.y = e->cur.canvas.ysub;
223 ev->data = e->data;
224 ev->timestamp = e->timestamp;
225 ev->event_flags = e->event_flags;
226 ev->device = e->dev;
227 ev->modifiers = e->modifiers;
228 ev->locks = e->locks;
229 break;
230 }
231
232 default:
233 ERR("invalid event type %d", type);
234 return EINA_FALSE;
235 }
236
237 return EINA_TRUE;
238}
239
240void * 35void *
241efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags) 36efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags)
242{ 37{
@@ -456,58 +251,6 @@ efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type,
456 } 251 }
457} 252}
458 253
459Eina_Bool
460efl_event_key_legacy_info_set(Efl_Event_Key *evt, const void *event_info, Evas_Callback_Type type)
461{
462 Efl_Event_Key_Data *ev = efl_data_scope_get(evt, EFL_EVENT_KEY_CLASS);
463 if (!ev || !event_info) return EINA_FALSE;
464
465 switch (type)
466 {
467 case EVAS_CALLBACK_KEY_DOWN:
468 {
469 const Evas_Event_Key_Down *e = event_info;
470 ev->timestamp = e->timestamp;
471 ev->pressed = EINA_TRUE;
472 eina_stringshare_replace(&ev->keyname, e->keyname);
473 eina_stringshare_replace(&ev->key, e->key);
474 eina_stringshare_replace(&ev->string, e->string);
475 eina_stringshare_replace(&ev->compose, e->compose);
476 ev->keycode = e->keycode;
477 ev->data = e->data;
478 ev->modifiers = e->modifiers;
479 ev->locks = e->locks;
480 ev->event_flags = e->event_flags;
481 ev->device = e->dev;
482 break;
483 }
484
485 case EVAS_CALLBACK_KEY_UP:
486 {
487 const Evas_Event_Key_Up *e = event_info;
488 ev->timestamp = e->timestamp;
489 ev->pressed = EINA_FALSE;
490 eina_stringshare_replace(&ev->keyname, e->keyname);
491 eina_stringshare_replace(&ev->key, e->key);
492 eina_stringshare_replace(&ev->string, e->string);
493 eina_stringshare_replace(&ev->compose, e->compose);
494 ev->keycode = e->keycode;
495 ev->data = e->data;
496 ev->modifiers = e->modifiers;
497 ev->locks = e->locks;
498 ev->event_flags = e->event_flags;
499 ev->device = e->dev;
500 break;
501 }
502
503 default:
504 ERR("invalid event type %d", type);
505 return EINA_FALSE;
506 }
507
508 return EINA_TRUE;
509}
510
511void * 254void *
512efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags) 255efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags)
513{ 256{
@@ -554,29 +297,6 @@ efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags)
554 } 297 }
555} 298}
556 299
557Eina_Bool
558efl_event_hold_legacy_info_set(Efl_Event_Hold *evt, const void *event_info, Evas_Callback_Type type)
559{
560 Efl_Event_Hold_Data *ev = efl_data_scope_get(evt, EFL_EVENT_HOLD_CLASS);
561 const Evas_Event_Hold *e = event_info;
562
563 if (!ev || !event_info) return EINA_FALSE;
564
565 if (type != EVAS_CALLBACK_HOLD)
566 {
567 ERR("invalid event type %d", type);
568 return EINA_FALSE;
569 }
570
571 ev->timestamp = e->timestamp;
572 ev->device = e->dev;
573 ev->hold = !!e->hold;
574 ev->event_flags = e->event_flags;
575 ev->data = e->data;
576
577 return EINA_TRUE;
578}
579
580void * 300void *
581efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags) 301efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags)
582{ 302{
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 503313c215..973b28f9dc 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1954,9 +1954,6 @@ void _evas_device_cleanup(Evas *e);
1954Evas_Device *_evas_device_top_get(const Evas *e); 1954Evas_Device *_evas_device_top_get(const Evas *e);
1955 1955
1956/* legacy/eo events */ 1956/* legacy/eo events */
1957Eina_Bool efl_event_pointer_legacy_info_set(Efl_Event_Pointer *evt, const void *event_info, Evas_Callback_Type type);
1958Eina_Bool efl_event_key_legacy_info_set(Efl_Event_Key *evt, const void *event_info, Evas_Callback_Type type);
1959Eina_Bool efl_event_hold_legacy_info_set(Efl_Event_Hold *evt, const void *event_info, Evas_Callback_Type type);
1960void *efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags); 1957void *efl_event_pointer_legacy_info_fill(Efl_Event_Key *evt, Evas_Callback_Type type, Evas_Event_Flags **pflags);
1961void *efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags); 1958void *efl_event_key_legacy_info_fill(Efl_Event_Key *evt, Evas_Event_Flags **pflags);
1962void *efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags); 1959void *efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags);