diff options
author | Cedric Bail <cedric.bail@free.fr> | 2019-10-31 13:20:33 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-10-31 13:29:56 -0400 |
commit | 7dc98ab3d01b47f14552ca021d49b49b24fb7057 (patch) | |
tree | 483e5fe2f047c1ab3cbe0c55de4d38793625d44a /src/lib/evas | |
parent | 72be0842ab514b43124f6fd17066039ccf78cec5 (diff) |
evas: move efl_input_device into evas/Efl_Canvas.h
Summary:
The internal and the API we would like is mostly a canvas API. A lot of the code
in evas is working around the fact that efl_input_device is not defined inside Evas.
This patch is the first step to try to clean this up.
Depends on D10487
Reviewers: zmike, raster, bu5hm4n, Hermet
Reviewed By: zmike
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8321
Differential Revision: https://phab.enlightenment.org/D10488
Diffstat (limited to 'src/lib/evas')
24 files changed, 1006 insertions, 53 deletions
diff --git a/src/lib/evas/Efl_Canvas.h b/src/lib/evas/Efl_Canvas.h index cd8bf52693..dcb3836218 100644 --- a/src/lib/evas/Efl_Canvas.h +++ b/src/lib/evas/Efl_Canvas.h | |||
@@ -45,6 +45,19 @@ extern "C" { | |||
45 | #include <canvas/efl_canvas_animation_types.eot.h> | 45 | #include <canvas/efl_canvas_animation_types.eot.h> |
46 | #include <gesture/efl_canvas_gesture_types.eot.h> | 46 | #include <gesture/efl_canvas_gesture_types.eot.h> |
47 | 47 | ||
48 | /* Input events */ | ||
49 | #include "canvas/efl_input_device.eo.h" | ||
50 | #include "canvas/efl_canvas_pointer.eo.h" | ||
51 | #include "canvas/efl_canvas_scene.eo.h" | ||
52 | #include "canvas/efl_input_state.eo.h" | ||
53 | #include "canvas/efl_input_event.eo.h" | ||
54 | #include "canvas/efl_input_pointer.eo.h" | ||
55 | #include "canvas/efl_input_key.eo.h" | ||
56 | #include "canvas/efl_input_hold.eo.h" | ||
57 | #include "canvas/efl_input_interface.eo.h" | ||
58 | #include "canvas/efl_input_focus.eo.h" | ||
59 | #include "canvas/efl_input_clickable.eo.h" | ||
60 | |||
48 | #include <gesture/efl_canvas_gesture.eo.h> | 61 | #include <gesture/efl_canvas_gesture.eo.h> |
49 | #include <gesture/efl_canvas_gesture_touch.eo.h> | 62 | #include <gesture/efl_canvas_gesture_touch.eo.h> |
50 | #include <gesture/efl_canvas_gesture_recognizer.eo.h> | 63 | #include <gesture/efl_canvas_gesture_recognizer.eo.h> |
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 1ae09bf259..f68f544dd3 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h | |||
@@ -3488,13 +3488,29 @@ typedef Eo Efl_Animation_Group_Sequential; | |||
3488 | #define EFL_ANIMATION_REPEAT_INFINITE -1 | 3488 | #define EFL_ANIMATION_REPEAT_INFINITE -1 |
3489 | #define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1 | 3489 | #define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1 |
3490 | 3490 | ||
3491 | #ifndef _EFL_INPUT_DEVICE_EO_H_ | 3491 | // The below type are necessary for legacy API and need to be manually kept in sync with .eo file. |
3492 | #define _EFL_INPUT_DEVICE_EO_H_ | 3492 | #ifndef _EFL_INPUT_DEVICE_EO_CLASS_TYPE |
3493 | #define _EFL_INPUT_DEVICE_EO_CLASS_TYPE | ||
3493 | typedef Eo Efl_Input_Device; | 3494 | typedef Eo Efl_Input_Device; |
3494 | typedef unsigned int Efl_Input_Device_Type; | 3495 | #endif |
3496 | |||
3497 | #ifndef _EFL_INPUT_DEVICE_EO_TYPES | ||
3498 | #define _EFL_INPUT_DEVICE_EO_TYPES | ||
3499 | typedef enum | ||
3500 | { | ||
3501 | EFL_INPUT_DEVICE_TYPE_NONE = 0, | ||
3502 | EFL_INPUT_DEVICE_TYPE_SEAT, | ||
3503 | EFL_INPUT_DEVICE_TYPE_KEYBOARD, | ||
3504 | EFL_INPUT_DEVICE_TYPE_MOUSE, | ||
3505 | EFL_INPUT_DEVICE_TYPE_TOUCH, | ||
3506 | EFL_INPUT_DEVICE_TYPE_PEN, | ||
3507 | EFL_INPUT_DEVICE_TYPE_WAND, | ||
3508 | EFL_INPUT_DEVICE_TYPE_GAMEPAD | ||
3509 | } Efl_Input_Device_Type; | ||
3495 | 3510 | ||
3496 | #endif | 3511 | #endif |
3497 | 3512 | ||
3513 | |||
3498 | #ifndef _EFL_TEXT_CURSOR_EO_H_ | 3514 | #ifndef _EFL_TEXT_CURSOR_EO_H_ |
3499 | #define _EFL_TEXT_CURSOR_EO_H_ | 3515 | #define _EFL_TEXT_CURSOR_EO_H_ |
3500 | 3516 | ||
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 5f46511e84..ddf3b2d2b0 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h | |||
@@ -185,6 +185,20 @@ struct _Efl_Canvas_Object_Animation_Event | |||
185 | * @} | 185 | * @} |
186 | */ | 186 | */ |
187 | 187 | ||
188 | /* Input events */ | ||
189 | #include "interfaces/efl_input_types.eot.h" | ||
190 | #include "canvas/efl_input_device.eo.h" | ||
191 | #include "canvas/efl_canvas_pointer.eo.h" | ||
192 | #include "canvas/efl_canvas_scene.eo.h" | ||
193 | #include "canvas/efl_input_state.eo.h" | ||
194 | #include "canvas/efl_input_event.eo.h" | ||
195 | #include "canvas/efl_input_pointer.eo.h" | ||
196 | #include "canvas/efl_input_key.eo.h" | ||
197 | #include "canvas/efl_input_hold.eo.h" | ||
198 | #include "canvas/efl_input_interface.eo.h" | ||
199 | #include "canvas/efl_input_focus.eo.h" | ||
200 | #include "canvas/efl_input_clickable.eo.h" | ||
201 | |||
188 | #include "canvas/efl_canvas_animation_types.eot.h" | 202 | #include "canvas/efl_canvas_animation_types.eot.h" |
189 | 203 | ||
190 | #include "gesture/efl_canvas_gesture_types.eot.h" | 204 | #include "gesture/efl_canvas_gesture_types.eot.h" |
@@ -457,12 +471,3 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, | |||
457 | #include "canvas/efl_canvas_vg_gradient.eo.h" | 471 | #include "canvas/efl_canvas_vg_gradient.eo.h" |
458 | #include "canvas/efl_canvas_vg_gradient_linear.eo.h" | 472 | #include "canvas/efl_canvas_vg_gradient_linear.eo.h" |
459 | #include "canvas/efl_canvas_vg_gradient_radial.eo.h" | 473 | #include "canvas/efl_canvas_vg_gradient_radial.eo.h" |
460 | |||
461 | #include "canvas/efl_input_state.eo.h" | ||
462 | #include "canvas/efl_input_event.eo.h" | ||
463 | #include "canvas/efl_input_pointer.eo.h" | ||
464 | #include "canvas/efl_input_key.eo.h" | ||
465 | #include "canvas/efl_input_hold.eo.h" | ||
466 | #include "canvas/efl_input_interface.eo.h" | ||
467 | #include "canvas/efl_input_focus.eo.h" | ||
468 | #include "canvas/efl_input_clickable.eo.h" | ||
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h index 15e4ed1e80..baf7cd5b16 100644 --- a/src/lib/evas/Evas_Internal.h +++ b/src/lib/evas/Evas_Internal.h | |||
@@ -32,6 +32,166 @@ | |||
32 | extern "C" { | 32 | extern "C" { |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | |||
36 | #ifndef EFL_INTERNAL_UNSTABLE | ||
37 | # error This file can not be included outside EFL | ||
38 | #endif | ||
39 | |||
40 | #include <Efl.h> | ||
41 | |||
42 | typedef struct _Efl_Input_Pointer_Data Efl_Input_Pointer_Data; | ||
43 | typedef struct _Efl_Input_Key_Data Efl_Input_Key_Data; | ||
44 | typedef struct _Efl_Input_Device_Data Efl_Input_Device_Data; | ||
45 | typedef struct _Efl_Input_Hold_Data Efl_Input_Hold_Data; | ||
46 | typedef struct _Efl_Input_Focus_Data Efl_Input_Focus_Data; | ||
47 | |||
48 | #ifndef _EVAS_TYPES_EOT_H_ | ||
49 | typedef struct _Evas_Modifier Evas_Modifier; | ||
50 | typedef struct _Evas_Lock Evas_Lock; | ||
51 | #endif | ||
52 | |||
53 | struct _Efl_Input_Pointer_Data | ||
54 | { | ||
55 | Eo *eo; | ||
56 | unsigned int timestamp; /* FIXME: store as double? */ | ||
57 | int button; | ||
58 | unsigned int pressed_buttons; | ||
59 | int touch_id; /* finger or tool ID */ | ||
60 | double radius, radius_x, radius_y; | ||
61 | double pressure, distance, azimuth, tilt, twist; | ||
62 | double angle; | ||
63 | /* current, previous positions in window coordinates. | ||
64 | * raw can be either un-smoothed, un-predicted x,y or a tablet's raw input. | ||
65 | * norm is the normalized value in [0..1] for tablet input. | ||
66 | */ | ||
67 | Eina_Vector2 cur, prev, raw, norm; | ||
68 | struct { | ||
69 | int z; | ||
70 | Eina_Bool horizontal; | ||
71 | } wheel; | ||
72 | Efl_Gfx_Entity *source; /* could it be ecore? */ | ||
73 | Efl_Input_Device *device; | ||
74 | Efl_Pointer_Action action; | ||
75 | Efl_Pointer_Flags button_flags; | ||
76 | Efl_Input_Flags event_flags; | ||
77 | void *data; /* evas data - whatever that is */ | ||
78 | Eina_Bool window_pos; /* true if positions are window-relative | ||
79 | (see input vs. feed: this is "input") */ | ||
80 | Evas_Modifier *modifiers; | ||
81 | Evas_Lock *locks; | ||
82 | void *legacy; /* DO NOT TOUCH THIS */ | ||
83 | uint32_t value_flags; | ||
84 | Eina_Bool has_norm : 1; /* not in value_flags */ | ||
85 | Eina_Bool has_raw : 1; /* not in value_flags */ | ||
86 | Eina_Bool evas_done : 1; /* set by evas */ | ||
87 | Eina_Bool fake : 1; | ||
88 | Eina_Bool win_fed : 1; | ||
89 | }; | ||
90 | |||
91 | struct _Efl_Input_Key_Data | ||
92 | { | ||
93 | Eo *eo; | ||
94 | unsigned int timestamp; /* FIXME: store as double? */ | ||
95 | |||
96 | Eina_Bool pressed; /* 1 = pressed/down, 0 = released/up */ | ||
97 | Eina_Stringshare *keyname; | ||
98 | Eina_Stringshare *key; | ||
99 | Eina_Stringshare *string; | ||
100 | Eina_Stringshare *compose; | ||
101 | unsigned int keycode; | ||
102 | |||
103 | void *data; | ||
104 | Evas_Modifier *modifiers; | ||
105 | Evas_Lock *locks; | ||
106 | Efl_Input_Flags event_flags; | ||
107 | Efl_Input_Device *device; | ||
108 | void *legacy; /* DO NOT TOUCH THIS */ | ||
109 | Eina_Bool evas_done : 1; /* set by evas */ | ||
110 | Eina_Bool fake : 1; | ||
111 | Eina_Bool win_fed : 1; | ||
112 | Eina_Bool no_stringshare : 1; | ||
113 | }; | ||
114 | |||
115 | struct _Efl_Input_Device_Data | ||
116 | { | ||
117 | Eo *eo; | ||
118 | Eo *evas; /* Evas */ | ||
119 | Efl_Input_Device *source; /* ref */ | ||
120 | Eina_List *children; /* ref'ed by efl_parent, not by this list */ | ||
121 | unsigned int id; | ||
122 | Efl_Input_Device_Type klass; | ||
123 | unsigned int subclass; // Evas_Device_Subclass (unused) | ||
124 | unsigned int pointer_count; | ||
125 | }; | ||
126 | |||
127 | struct _Efl_Input_Hold_Data | ||
128 | { | ||
129 | Eo *eo; | ||
130 | double timestamp; | ||
131 | Efl_Input_Flags event_flags; | ||
132 | Efl_Input_Device *device; | ||
133 | void *data; | ||
134 | void *legacy; /* DO NOT TOUCH THIS */ | ||
135 | Eina_Bool hold : 1; | ||
136 | Eina_Bool evas_done : 1; /* set by evas */ | ||
137 | }; | ||
138 | |||
139 | struct _Efl_Input_Focus_Data | ||
140 | { | ||
141 | Eo *eo; | ||
142 | Efl_Input_Device *device; //The seat | ||
143 | Eo *object_wref; // wref on the focused object - Efl.Canvas.Object or Efl.Canvas. | ||
144 | double timestamp; | ||
145 | Efl_Input_Flags event_flags; | ||
146 | }; | ||
147 | |||
148 | /* Internal helpers */ | ||
149 | |||
150 | static inline const char * | ||
151 | _efl_input_modifier_to_string(Efl_Input_Modifier mod) | ||
152 | { | ||
153 | switch (mod) | ||
154 | { | ||
155 | default: | ||
156 | case EFL_INPUT_MODIFIER_NONE: return NULL; | ||
157 | case EFL_INPUT_MODIFIER_ALT: return "Alt"; | ||
158 | case EFL_INPUT_MODIFIER_CONTROL: return "Control"; | ||
159 | case EFL_INPUT_MODIFIER_SHIFT: return "Shift"; | ||
160 | case EFL_INPUT_MODIFIER_META: return "Meta"; | ||
161 | case EFL_INPUT_MODIFIER_ALTGR: return "AltGr"; | ||
162 | case EFL_INPUT_MODIFIER_HYPER: return "Hyper"; | ||
163 | case EFL_INPUT_MODIFIER_SUPER: return "Super"; | ||
164 | } | ||
165 | } | ||
166 | |||
167 | static inline const char * | ||
168 | _efl_input_lock_to_string(Efl_Input_Lock lock) | ||
169 | { | ||
170 | switch (lock) | ||
171 | { | ||
172 | default: | ||
173 | case EFL_INPUT_LOCK_NONE: return NULL; | ||
174 | case EFL_INPUT_LOCK_NUM: return "Num"; | ||
175 | case EFL_INPUT_LOCK_CAPS: return "Caps"; | ||
176 | case EFL_INPUT_LOCK_SCROLL: return "Scroll"; | ||
177 | case EFL_INPUT_LOCK_SHIFT: return "Shift"; | ||
178 | } | ||
179 | } | ||
180 | |||
181 | static inline Eina_Bool | ||
182 | _efl_input_value_has(const Efl_Input_Pointer_Data *pd, Efl_Input_Value key) | ||
183 | { | ||
184 | return (pd->value_flags & (1u << (int) key)) != 0; | ||
185 | } | ||
186 | |||
187 | static inline void | ||
188 | _efl_input_value_mark(Efl_Input_Pointer_Data *pd, Efl_Input_Value key) | ||
189 | { | ||
190 | pd->value_flags |= (1u << (int) key); | ||
191 | } | ||
192 | |||
193 | #define _efl_input_value_mask(key) (1u << (int) key) | ||
194 | |||
35 | typedef struct _Efl_Canvas_Output Efl_Canvas_Output; | 195 | typedef struct _Efl_Canvas_Output Efl_Canvas_Output; |
36 | 196 | ||
37 | EAPI Efl_Canvas_Output *efl_canvas_output_add(Evas *canvas); | 197 | EAPI Efl_Canvas_Output *efl_canvas_output_add(Evas *canvas); |
diff --git a/src/lib/evas/canvas/efl_canvas_pointer.eo b/src/lib/evas/canvas/efl_canvas_pointer.eo new file mode 100644 index 0000000000..f0c363a953 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_pointer.eo | |||
@@ -0,0 +1,35 @@ | |||
1 | import efl_input_device; | ||
2 | |||
3 | interface Efl.Canvas.Pointer | ||
4 | { | ||
5 | [[Efl Canvas Pointer interface | ||
6 | |||
7 | @since 1.22 | ||
8 | ]] | ||
9 | methods { | ||
10 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
11 | @property pointer_inside @beta { | ||
12 | [[Whether the mouse pointer is logically inside the canvas. | ||
13 | |||
14 | This value is $false or $true, depending on whether a pointer,in or pointer,out | ||
15 | event has been previously received. | ||
16 | |||
17 | A return value of $true indicates the mouse is logically | ||
18 | inside the canvas, and $false implies it is logically | ||
19 | outside the canvas. | ||
20 | |||
21 | A canvas begins with the mouse being assumed outside ($false). | ||
22 | ]] | ||
23 | get { | ||
24 | } | ||
25 | keys { | ||
26 | seat: Efl.Input.Device @optional; [[The seat to consider, if $null | ||
27 | then the default seat will be used.]] | ||
28 | } | ||
29 | values { | ||
30 | inside: bool; [[$true if the mouse pointer is inside the canvas, | ||
31 | $false otherwise]] | ||
32 | } | ||
33 | } | ||
34 | } | ||
35 | } | ||
diff --git a/src/lib/evas/canvas/efl_canvas_scene.eo b/src/lib/evas/canvas/efl_canvas_scene.eo new file mode 100644 index 0000000000..b31f0ba3b4 --- /dev/null +++ b/src/lib/evas/canvas/efl_canvas_scene.eo | |||
@@ -0,0 +1,244 @@ | |||
1 | import efl_input_device; | ||
2 | import efl_gfx_types; | ||
3 | |||
4 | interface Efl.Canvas.Scene | ||
5 | { | ||
6 | [[Interface containing basic canvas-related methods and events. | ||
7 | |||
8 | @since 1.22 | ||
9 | ]] | ||
10 | methods { | ||
11 | @property image_max_size { | ||
12 | [[The maximum image size the canvas can possibly handle. | ||
13 | |||
14 | This function returns the largest image or surface size that | ||
15 | the canvas can handle in pixels, and if there is one, returns $true. | ||
16 | It returns $false if no extra constraint on maximum image | ||
17 | size exists. | ||
18 | |||
19 | The default limit is 65535x65535. | ||
20 | |||
21 | ]] | ||
22 | get { | ||
23 | return: bool; [[$true on success, $false otherwise]] | ||
24 | } | ||
25 | values { | ||
26 | max: Eina.Size2D; [[The maximum image size (in pixels).]] | ||
27 | } | ||
28 | } | ||
29 | group_objects_calculate { | ||
30 | [[Call user-provided $calculate group functions and unset the | ||
31 | flag signalling that the object needs to get recalculated to | ||
32 | all group objects in the canvas. | ||
33 | ]] | ||
34 | } | ||
35 | @property group_objects_calculating { | ||
36 | [[Get if the canvas is currently calculating group objects.]] | ||
37 | get { | ||
38 | } | ||
39 | values { | ||
40 | calculating: bool; [[$true if currently calculating group objects.]] | ||
41 | } | ||
42 | } | ||
43 | objects_at_xy_get { | ||
44 | [[Retrieve a list of objects at a given position in a canvas. | ||
45 | |||
46 | This function will traverse all the layers of the given canvas, | ||
47 | from top to bottom, querying for objects with areas covering the | ||
48 | given position. The user can exclude from the query objects which are | ||
49 | hidden and/or which are set to pass events. | ||
50 | |||
51 | Warning: This function will only evaluate top-level objects; child | ||
52 | or "sub" objects will be skipped. | ||
53 | ]] | ||
54 | return: iterator<Efl.Gfx.Entity> @move @no_unused; [[ | ||
55 | The list of objects that are over the given position in $e. | ||
56 | ]] | ||
57 | params { | ||
58 | @in pos: Eina.Position2D; [[The pixel position.]] | ||
59 | @in include_pass_events_objects: bool; [[ | ||
60 | Boolean flag to include or not objects which pass events | ||
61 | in this calculation. | ||
62 | ]] | ||
63 | @in include_hidden_objects: bool; [[ | ||
64 | Boolean flag to include or not hidden objects in this | ||
65 | calculation. | ||
66 | ]] | ||
67 | } | ||
68 | } | ||
69 | object_top_at_xy_get @const { | ||
70 | [[Retrieve the object stacked at the top of a given position | ||
71 | in a canvas. | ||
72 | |||
73 | This function will traverse all the layers of the given canvas, | ||
74 | from top to bottom, querying for objects with areas covering the | ||
75 | given position. The user can exclude from the query objects which are | ||
76 | hidden and/or which are set to pass events. | ||
77 | |||
78 | Warning: This function will only evaluate top-level objects; child | ||
79 | or "sub" objects will be skipped. | ||
80 | ]] | ||
81 | return: Efl.Gfx.Entity @no_unused; [[The canvas object that is over all other objects at the given position.]] | ||
82 | params { | ||
83 | @in pos: Eina.Position2D; [[The pixel position.]] | ||
84 | @in include_pass_events_objects: bool; [[ | ||
85 | Boolean flag to include or not objects which pass events | ||
86 | in this calculation. | ||
87 | ]] | ||
88 | @in include_hidden_objects: bool; [[ | ||
89 | Boolean flag to include or not hidden objects in this | ||
90 | calculation. | ||
91 | ]] | ||
92 | } | ||
93 | } | ||
94 | objects_in_rectangle_get { | ||
95 | [[Retrieve a list of objects overlapping a given rectangular region in a canvas. | ||
96 | |||
97 | This function will traverse all the layers of the given canvas, | ||
98 | from top to bottom, querying for objects with areas overlapping | ||
99 | with the given rectangular region. The user can exclude | ||
100 | from the query objects which are hidden and/or which are set to | ||
101 | pass events. | ||
102 | |||
103 | Warning: This function will only evaluate top-level objects; child | ||
104 | or "sub" objects will be skipped. | ||
105 | ]] | ||
106 | return: iterator<Efl.Gfx.Entity> @move @no_unused; [[Iterator to objects]] | ||
107 | params { | ||
108 | @in rect: Eina.Rect; [[The rectangular region.]] | ||
109 | @in include_pass_events_objects: bool; [[ | ||
110 | Boolean flag to include or not objects which pass events | ||
111 | in this calculation. | ||
112 | ]] | ||
113 | @in include_hidden_objects: bool; [[ | ||
114 | Boolean flag to include or not hidden objects in this | ||
115 | calculation. | ||
116 | ]] | ||
117 | } | ||
118 | } | ||
119 | object_top_in_rectangle_get @const { | ||
120 | [[Retrieve the canvas object stacked at the top of a given | ||
121 | rectangular region in a canvas | ||
122 | |||
123 | This function will traverse all the layers of the given canvas, | ||
124 | from top to bottom, querying for objects with areas overlapping | ||
125 | with the given rectangular region. The user can exclude | ||
126 | from the query objects which are hidden and/or which are set to | ||
127 | pass events. | ||
128 | |||
129 | Warning: This function will only evaluate top-level objects; child | ||
130 | or "sub" objects will be skipped. | ||
131 | ]] | ||
132 | return: Efl.Gfx.Entity @no_unused; [[ | ||
133 | The object that is over all other objects at the given | ||
134 | rectangular region. | ||
135 | ]] | ||
136 | params { | ||
137 | @in rect: Eina.Rect; [[The rectangular region.]] | ||
138 | @in include_pass_events_objects: bool; [[ | ||
139 | Boolean flag to include or not objects which pass events | ||
140 | in this calculation. | ||
141 | ]] | ||
142 | @in include_hidden_objects: bool; [[ | ||
143 | Boolean flag to include or not hidden objects in this | ||
144 | calculation. | ||
145 | ]] | ||
146 | } | ||
147 | } | ||
148 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
149 | seats @beta { | ||
150 | [[Iterate over the available input device seats for the canvas. | ||
151 | |||
152 | A "seat" is the term used for a group of input devices, typically including | ||
153 | a pointer and a keyboard. A seat object is the parent of the individual input | ||
154 | devices. | ||
155 | ]] | ||
156 | return: iterator<Efl.Input.Device> @move; | ||
157 | [[An iterator over the attached seats.]] | ||
158 | } | ||
159 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
160 | @property device @beta{ | ||
161 | [[An input device attached to this canvas, found by name. | ||
162 | |||
163 | Note: This function is meant to find seats and not individual | ||
164 | input devices. | ||
165 | |||
166 | See also @.seat to find a seat by id instead of by name. | ||
167 | ]] | ||
168 | get { | ||
169 | [[Get a device by name.]] | ||
170 | } | ||
171 | keys { | ||
172 | name: string; [[The name of the seat to find.]] | ||
173 | } | ||
174 | values { | ||
175 | seat: Efl.Input.Device; [[The device or seat, $null if not found.]] | ||
176 | } | ||
177 | } | ||
178 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
179 | @property seat @beta { | ||
180 | [[Get a seat attached to this canvas using the seat's id property. | ||
181 | |||
182 | Seats are associated with an arbitrary integer id. The id is not a | ||
183 | persistent value and should never be hardcoded, as it may change between | ||
184 | runs of an application depending on the environment. | ||
185 | |||
186 | See also @.device to find a seat by name instead of by id. | ||
187 | ]] | ||
188 | get { | ||
189 | [[Get a seat by id.]] | ||
190 | } | ||
191 | keys { | ||
192 | id: int; [[The id of the seat to find.]] | ||
193 | } | ||
194 | values { | ||
195 | seat: Efl.Input.Device; [[The seat or $null if not found.]] | ||
196 | } | ||
197 | } | ||
198 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
199 | @property seat_default @beta { | ||
200 | [[Get the default seat attached to this canvas. | ||
201 | |||
202 | A canvas may have exactly one default seat. | ||
203 | |||
204 | See also @.device to find a seat by name. | ||
205 | See also @.seat to find a seat by id. | ||
206 | ]] | ||
207 | get { | ||
208 | [[Get the default seat.]] | ||
209 | } | ||
210 | values { | ||
211 | seat: Efl.Input.Device; [[The default seat or $null if one does not exist.]] | ||
212 | } | ||
213 | } | ||
214 | /* FIXME Efl.Input.Device is not stable yet*/ | ||
215 | @property pointer_position @beta { | ||
216 | [[The current known pointer coordinates. | ||
217 | |||
218 | This function returns the current position of the main input | ||
219 | pointer (mouse, pen, etc...). | ||
220 | ]] | ||
221 | get { | ||
222 | return: bool; [[$true if a pointer exists for the given seat, otherwise $false.]] | ||
223 | } | ||
224 | keys { | ||
225 | seat: Efl.Input.Device; [[The seat, or $null to use the default.]] | ||
226 | } | ||
227 | values { | ||
228 | pos: Eina.Position2D; [[The pointer position in pixels.]] | ||
229 | } | ||
230 | } | ||
231 | } | ||
232 | events { | ||
233 | scene,focus,in: void; [[Called when scene got focus]] | ||
234 | scene,focus,out: void; [[Called when scene lost focus]] | ||
235 | object,focus,in: Efl.Input.Focus; [[Called when object got focus]] | ||
236 | object,focus,out: Efl.Input.Focus; [[Called when object lost focus]] | ||
237 | render,pre: void; [[Called when pre render happens]] | ||
238 | /* tag nullable once supported by eolian */ | ||
239 | render,post @beta: Efl.Gfx.Event.Render_Post; [[Called when post render happens]] | ||
240 | device,changed @beta : Efl.Input.Device; [[Called when input device changed]] | ||
241 | device,added @beta: Efl.Input.Device; [[Called when input device was added]] | ||
242 | device,removed @beta : Efl.Input.Device; [[Called when input device was removed]] | ||
243 | } | ||
244 | } | ||
diff --git a/src/lib/evas/canvas/efl_input_device.c b/src/lib/evas/canvas/efl_input_device.c new file mode 100644 index 0000000000..690db7698d --- /dev/null +++ b/src/lib/evas/canvas/efl_input_device.c | |||
@@ -0,0 +1,230 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include "Evas.h" | ||
6 | #define EFL_INTERNAL_UNSTABLE | ||
7 | #include "Evas_Internal.h" | ||
8 | |||
9 | #define MY_CLASS EFL_INPUT_DEVICE_CLASS | ||
10 | |||
11 | /* Efl Input Device = Evas Device */ | ||
12 | |||
13 | typedef struct _Child_Device_Iterator Child_Device_Iterator; | ||
14 | |||
15 | struct _Child_Device_Iterator | ||
16 | { | ||
17 | Eina_Iterator iterator; | ||
18 | Eina_List *list; | ||
19 | Eina_Iterator *real_iterator; | ||
20 | Eo *object; | ||
21 | }; | ||
22 | |||
23 | static Eina_Bool | ||
24 | _is_pointer(Efl_Input_Device_Data *pd) | ||
25 | { | ||
26 | return (pd->klass == EFL_INPUT_DEVICE_TYPE_MOUSE || | ||
27 | pd->klass == EFL_INPUT_DEVICE_TYPE_TOUCH || | ||
28 | pd->klass == EFL_INPUT_DEVICE_TYPE_PEN || | ||
29 | pd->klass == EFL_INPUT_DEVICE_TYPE_WAND); | ||
30 | } | ||
31 | |||
32 | static void | ||
33 | _seat_pointers_update(Efl_Input_Device_Data *seat, Efl_Input_Device_Data *dev) | ||
34 | { | ||
35 | if (seat && _is_pointer(dev)) | ||
36 | seat->pointer_count++; | ||
37 | } | ||
38 | |||
39 | EOLIAN static Efl_Object * | ||
40 | _efl_input_device_efl_object_constructor(Eo *obj, Efl_Input_Device_Data *pd) | ||
41 | { | ||
42 | obj = efl_constructor(efl_super(obj, MY_CLASS)); | ||
43 | pd->eo = obj; | ||
44 | return obj; | ||
45 | } | ||
46 | |||
47 | EOLIAN static void | ||
48 | _efl_input_device_efl_object_destructor(Eo *obj, Efl_Input_Device_Data *pd) | ||
49 | { | ||
50 | pd->children = eina_list_free(pd->children); | ||
51 | if (pd->klass != EFL_INPUT_DEVICE_TYPE_SEAT) | ||
52 | { | ||
53 | Efl_Input_Device_Data *p; | ||
54 | Eo *seat; | ||
55 | |||
56 | seat = efl_input_device_seat_get(obj); | ||
57 | p = efl_data_scope_get(seat, MY_CLASS); | ||
58 | if (p) p->children = eina_list_remove(p->children, obj); | ||
59 | } | ||
60 | efl_unref(pd->source); | ||
61 | |||
62 | return efl_destructor(efl_super(obj, MY_CLASS)); | ||
63 | } | ||
64 | |||
65 | EOLIAN static void | ||
66 | _efl_input_device_efl_object_parent_set(Eo *obj, Efl_Input_Device_Data *pd EINA_UNUSED, Eo *parent) | ||
67 | { | ||
68 | Efl_Input_Device_Data *p; | ||
69 | |||
70 | if (parent) | ||
71 | { | ||
72 | if (efl_isa(parent, MY_CLASS)) | ||
73 | { | ||
74 | p = efl_data_scope_get(parent, MY_CLASS); | ||
75 | EINA_SAFETY_ON_FALSE_RETURN(p->klass == EFL_INPUT_DEVICE_TYPE_SEAT); | ||
76 | if (!eina_list_data_find(p->children, obj)) | ||
77 | { | ||
78 | p->children = eina_list_append(p->children, obj); | ||
79 | _seat_pointers_update(p, pd); | ||
80 | } | ||
81 | } | ||
82 | else if(!efl_isa(parent, EFL_CANVAS_SCENE_INTERFACE)) | ||
83 | { | ||
84 | EINA_SAFETY_ERROR("The parent of a device must be a seat or the canvas"); | ||
85 | return; | ||
86 | } | ||
87 | } | ||
88 | else | ||
89 | { | ||
90 | Eo *old_parent = efl_parent_get(obj); | ||
91 | if (old_parent && efl_isa(old_parent, MY_CLASS)) | ||
92 | { | ||
93 | p = efl_data_scope_get(old_parent, MY_CLASS); | ||
94 | p->children = eina_list_remove(p->children, obj); | ||
95 | if (_is_pointer(pd)) | ||
96 | p->pointer_count--; | ||
97 | } | ||
98 | } | ||
99 | |||
100 | efl_parent_set(efl_super(obj, MY_CLASS), parent); | ||
101 | } | ||
102 | |||
103 | EOLIAN static void | ||
104 | _efl_input_device_device_type_set(Eo *obj, Efl_Input_Device_Data *pd, Efl_Input_Device_Type klass) | ||
105 | { | ||
106 | EINA_SAFETY_ON_TRUE_RETURN(pd->klass); | ||
107 | pd->klass = klass; | ||
108 | if (klass != EFL_INPUT_DEVICE_TYPE_SEAT) | ||
109 | { | ||
110 | Efl_Input_Device_Data *seat = efl_data_scope_get(efl_input_device_seat_get(obj), MY_CLASS); | ||
111 | _seat_pointers_update(seat, pd); | ||
112 | } | ||
113 | } | ||
114 | |||
115 | EOLIAN static Efl_Input_Device_Type | ||
116 | _efl_input_device_device_type_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd) | ||
117 | { | ||
118 | return pd->klass; | ||
119 | } | ||
120 | |||
121 | EOLIAN static void | ||
122 | _efl_input_device_source_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, Efl_Input_Device *src) | ||
123 | { | ||
124 | if (pd->source == src) return; | ||
125 | efl_unref(pd->source); | ||
126 | pd->source = efl_ref(src); | ||
127 | } | ||
128 | |||
129 | EOLIAN static Efl_Input_Device * | ||
130 | _efl_input_device_source_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd) | ||
131 | { | ||
132 | return pd->source; | ||
133 | } | ||
134 | |||
135 | EOLIAN static void | ||
136 | _efl_input_device_seat_id_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, unsigned int id) | ||
137 | { | ||
138 | EINA_SAFETY_ON_TRUE_RETURN(pd->klass != EFL_INPUT_DEVICE_TYPE_SEAT); | ||
139 | pd->id = id; | ||
140 | } | ||
141 | |||
142 | EOLIAN static unsigned int | ||
143 | _efl_input_device_seat_id_get(const Eo *obj, Efl_Input_Device_Data *pd) | ||
144 | { | ||
145 | if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) | ||
146 | return pd->id; | ||
147 | return efl_input_device_seat_id_get(efl_input_device_seat_get(obj)); | ||
148 | } | ||
149 | |||
150 | EOLIAN static Efl_Input_Device * | ||
151 | _efl_input_device_seat_get(const Eo *obj, Efl_Input_Device_Data *pd) | ||
152 | { | ||
153 | EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); | ||
154 | |||
155 | if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) | ||
156 | return pd->eo; | ||
157 | |||
158 | while ((obj = efl_parent_get(obj))) | ||
159 | { | ||
160 | if (!efl_isa(obj, MY_CLASS)) break; | ||
161 | pd = efl_data_scope_get(obj, MY_CLASS); | ||
162 | if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) | ||
163 | return pd->eo; | ||
164 | } | ||
165 | |||
166 | return NULL; | ||
167 | } | ||
168 | |||
169 | static Eina_Bool | ||
170 | _child_device_iterator_next(Child_Device_Iterator *it, void **data) | ||
171 | { | ||
172 | Eo *sub; | ||
173 | |||
174 | if (!eina_iterator_next(it->real_iterator, (void **) &sub)) | ||
175 | return EINA_FALSE; | ||
176 | |||
177 | if (data) *data = sub; | ||
178 | return EINA_TRUE; | ||
179 | } | ||
180 | |||
181 | static Eo * | ||
182 | _child_device_iterator_get_container(Child_Device_Iterator *it) | ||
183 | { | ||
184 | return it->object; | ||
185 | } | ||
186 | |||
187 | static void | ||
188 | _child_device_iterator_free(Child_Device_Iterator *it) | ||
189 | { | ||
190 | eina_iterator_free(it->real_iterator); | ||
191 | free(it); | ||
192 | } | ||
193 | |||
194 | EOLIAN static Eina_Iterator * | ||
195 | _efl_input_device_children_iterate(Eo *obj, Efl_Input_Device_Data *pd) | ||
196 | { | ||
197 | Child_Device_Iterator *it; | ||
198 | |||
199 | it = calloc(1, sizeof(*it)); | ||
200 | if (!it) return NULL; | ||
201 | |||
202 | EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); | ||
203 | |||
204 | it->list = pd->children; | ||
205 | it->real_iterator = eina_list_iterator_new(it->list); | ||
206 | it->iterator.version = EINA_ITERATOR_VERSION; | ||
207 | it->iterator.next = FUNC_ITERATOR_NEXT(_child_device_iterator_next); | ||
208 | it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_child_device_iterator_get_container); | ||
209 | it->iterator.free = FUNC_ITERATOR_FREE(_child_device_iterator_free); | ||
210 | it->object = obj; | ||
211 | |||
212 | return &it->iterator; | ||
213 | } | ||
214 | |||
215 | EOLIAN static int | ||
216 | _efl_input_device_pointer_device_count_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd) | ||
217 | { | ||
218 | if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) | ||
219 | return pd->pointer_count; | ||
220 | return -1; | ||
221 | } | ||
222 | |||
223 | EOLIAN static Eina_Bool | ||
224 | _efl_input_device_is_pointer_type_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd) | ||
225 | { | ||
226 | return _is_pointer(pd); | ||
227 | } | ||
228 | |||
229 | |||
230 | #include "efl_input_device.eo.c" | ||
diff --git a/src/lib/evas/canvas/efl_input_device.eo b/src/lib/evas/canvas/efl_input_device.eo new file mode 100644 index 0000000000..dda39b1877 --- /dev/null +++ b/src/lib/evas/canvas/efl_input_device.eo | |||
@@ -0,0 +1,102 @@ | |||
1 | enum Efl.Input.Device_Type | ||
2 | { | ||
3 | [[General type of input device. | ||
4 | |||
5 | Legacy support since 1.8 as $Evas_Device_Class. | ||
6 | |||
7 | @since 1.23 | ||
8 | ]] | ||
9 | none, [[Not a device.]] | ||
10 | seat, [[The user/seat (the user themselves).]] | ||
11 | keyboard, [[A regular keyboard, numberpad or attached buttons.]] | ||
12 | mouse, [[A mouse, trackball or touchpad relative motion device.]] | ||
13 | touch, [[A touchscreen with fingers or stylus.]] | ||
14 | pen, [[A special pen device.]] | ||
15 | wand, [[A laser pointer, wii-style or "Minority Report" pointing device.]] | ||
16 | gamepad, [[A gamepad controller or joystick.]] | ||
17 | } | ||
18 | |||
19 | /* TODO: Add canvas property. Current problem is we need to return | ||
20 | Efl.Ui.Win and not Evas: | ||
21 | @property canvas { values { canvas: Efl.Canvas; } } | ||
22 | */ | ||
23 | |||
24 | class Efl.Input.Device extends Efl.Object | ||
25 | { | ||
26 | [[Represents a pointing device such as a touch finger, pen or mouse. | ||
27 | |||
28 | @since 1.23 | ||
29 | ]] | ||
30 | methods { | ||
31 | @property device_type { | ||
32 | [[Device type property]] | ||
33 | values { | ||
34 | klass: Efl.Input.Device_Type; [[Input device class]] | ||
35 | } | ||
36 | } | ||
37 | @property source { | ||
38 | [[Device source property]] | ||
39 | values { | ||
40 | src: Efl.Input.Device; [[Input device]] | ||
41 | } | ||
42 | } | ||
43 | @property seat { | ||
44 | [[Get the @Efl.Input.Device that represents a seat. | ||
45 | |||
46 | This method will find the seat the device belongs to. | ||
47 | |||
48 | For this, it walk through device's parents looking for a device | ||
49 | with @Efl.Input.Device_Type.seat. It may be | ||
50 | the device itself. | ||
51 | |||
52 | In case no seat is found, $null is returned. | ||
53 | ]] | ||
54 | get {} | ||
55 | values { | ||
56 | seat: Efl.Input.Device; [[The seat this device belongs to.]] | ||
57 | } | ||
58 | } | ||
59 | @property seat_id { | ||
60 | [[Seat id number | ||
61 | ]] | ||
62 | values { | ||
63 | id: uint; [[The id of the seat]] | ||
64 | } | ||
65 | } | ||
66 | children_iterate { | ||
67 | [[Lists the children attached to this device. | ||
68 | |||
69 | This is only meaningful with seat devices, as they are groups of | ||
70 | real input devices. | ||
71 | ]] | ||
72 | return: iterator<const(Efl.Input.Device)> @move; [[List of device children]] | ||
73 | } | ||
74 | @property pointer_device_count { | ||
75 | [[The number of pointer devices in this seat. | ||
76 | |||
77 | Pointer devices are the ones whose @.device_type is $mouse, $pen, $touch or $wand. | ||
78 | In case this device is not of the type $seat, -1 is returned. | ||
79 | ]] | ||
80 | get { | ||
81 | |||
82 | } | ||
83 | values { | ||
84 | devices : int; [[The number of pointer devices.]] | ||
85 | } | ||
86 | } | ||
87 | @property is_pointer_type { | ||
88 | [[$true if @.device_type is $mouse, $pen, $touch or $wand.]] | ||
89 | get { | ||
90 | |||
91 | } | ||
92 | values { | ||
93 | pointer_type : bool; [[$true if the device has pointing capabilities.]] | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | implements { | ||
98 | Efl.Object.constructor; | ||
99 | Efl.Object.destructor; | ||
100 | Efl.Object.parent { set; } | ||
101 | } | ||
102 | } | ||
diff --git a/src/lib/evas/canvas/efl_input_event.c b/src/lib/evas/canvas/efl_input_event.c index 3274b31a8e..90bddde143 100644 --- a/src/lib/evas/canvas/efl_input_event.c +++ b/src/lib/evas/canvas/efl_input_event.c | |||
@@ -5,12 +5,10 @@ | |||
5 | #define EFL_INPUT_EVENT_PROTECTED | 5 | #define EFL_INPUT_EVENT_PROTECTED |
6 | 6 | ||
7 | #include <Evas.h> | 7 | #include <Evas.h> |
8 | #define EFL_INTERNAL_UNSTABLE | ||
8 | #include <Evas_Internal.h> | 9 | #include <Evas_Internal.h> |
9 | #include "canvas/evas_canvas_eo.h" | 10 | #include "canvas/evas_canvas_eo.h" |
10 | 11 | ||
11 | #define EFL_INTERNAL_UNSTABLE | ||
12 | #include "interfaces/efl_common_internal.h" | ||
13 | |||
14 | #define MY_CLASS EFL_INPUT_EVENT_MIXIN | 12 | #define MY_CLASS EFL_INPUT_EVENT_MIXIN |
15 | 13 | ||
16 | EOLIAN static void | 14 | EOLIAN static void |
diff --git a/src/lib/evas/canvas/efl_input_focus.c b/src/lib/evas/canvas/efl_input_focus.c index d7b18dec53..cb154a0017 100644 --- a/src/lib/evas/canvas/efl_input_focus.c +++ b/src/lib/evas/canvas/efl_input_focus.c | |||
@@ -9,11 +9,6 @@ | |||
9 | 9 | ||
10 | #include <Evas.h> | 10 | #include <Evas.h> |
11 | 11 | ||
12 | #include <Evas_Internal.h> | ||
13 | |||
14 | #define EFL_INTERNAL_UNSTABLE | ||
15 | #include "interfaces/efl_common_internal.h" | ||
16 | |||
17 | #define MY_CLASS EFL_INPUT_FOCUS_CLASS | 12 | #define MY_CLASS EFL_INPUT_FOCUS_CLASS |
18 | 13 | ||
19 | static void | 14 | static void |
diff --git a/src/lib/evas/canvas/efl_input_hold.c b/src/lib/evas/canvas/efl_input_hold.c index c23f043ad1..b5ad65b644 100644 --- a/src/lib/evas/canvas/efl_input_hold.c +++ b/src/lib/evas/canvas/efl_input_hold.c | |||
@@ -7,9 +7,6 @@ | |||
7 | #include "evas_common_private.h" | 7 | #include "evas_common_private.h" |
8 | #include "evas_private.h" | 8 | #include "evas_private.h" |
9 | 9 | ||
10 | #define EFL_INTERNAL_UNSTABLE | ||
11 | #include "interfaces/efl_common_internal.h" | ||
12 | |||
13 | #define MY_CLASS EFL_INPUT_HOLD_CLASS | 10 | #define MY_CLASS EFL_INPUT_HOLD_CLASS |
14 | 11 | ||
15 | EOLIAN static void | 12 | EOLIAN static void |
diff --git a/src/lib/evas/canvas/efl_input_key.c b/src/lib/evas/canvas/efl_input_key.c index 07d5a63776..79c833ccda 100644 --- a/src/lib/evas/canvas/efl_input_key.c +++ b/src/lib/evas/canvas/efl_input_key.c | |||
@@ -7,9 +7,6 @@ | |||
7 | #include "evas_common_private.h" | 7 | #include "evas_common_private.h" |
8 | #include "evas_private.h" | 8 | #include "evas_private.h" |
9 | 9 | ||
10 | #define EFL_INTERNAL_UNSTABLE | ||
11 | #include "interfaces/efl_common_internal.h" | ||
12 | |||
13 | #define MY_CLASS EFL_INPUT_KEY_CLASS | 10 | #define MY_CLASS EFL_INPUT_KEY_CLASS |
14 | 11 | ||
15 | EOAPI Eo* | 12 | EOAPI Eo* |
diff --git a/src/lib/evas/canvas/efl_input_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c index 8b16c5767a..33cb80ce68 100644 --- a/src/lib/evas/canvas/efl_input_pointer.c +++ b/src/lib/evas/canvas/efl_input_pointer.c | |||
@@ -7,9 +7,6 @@ | |||
7 | #include "evas_common_private.h" | 7 | #include "evas_common_private.h" |
8 | #include "evas_private.h" | 8 | #include "evas_private.h" |
9 | 9 | ||
10 | #define EFL_INTERNAL_UNSTABLE | ||
11 | #include "interfaces/efl_common_internal.h" | ||
12 | |||
13 | #define MY_CLASS EFL_INPUT_POINTER_CLASS | 10 | #define MY_CLASS EFL_INPUT_POINTER_CLASS |
14 | 11 | ||
15 | 12 | ||
diff --git a/src/lib/evas/canvas/efl_input_types.eot b/src/lib/evas/canvas/efl_input_types.eot new file mode 100644 index 0000000000..a716686528 --- /dev/null +++ b/src/lib/evas/canvas/efl_input_types.eot | |||
@@ -0,0 +1,178 @@ | |||
1 | enum Efl.Pointer.Action | ||
2 | { | ||
3 | [[Pointer event type. Represents which kind of event this is. | ||
4 | |||
5 | @since 1.19 | ||
6 | ]] | ||
7 | none, [[Not a valid event, or nothing new happened (eg. when querying | ||
8 | current state of touch points).]] | ||
9 | move, [[Mouse or equivalent pointer moved.]] | ||
10 | down, [[Mouse button or equivalent pointer pressed down. | ||
11 | Always followed by up or cancel.]] | ||
12 | up, [[Mouse button or equivalent pointer released. See also cancel.]] | ||
13 | cancel, [[Special event happening after a down if the up counterpart | ||
14 | can not happen (eg. another window forcibly stole the focus).]] | ||
15 | in, [[Mouse or pointer entered the object.]] | ||
16 | out, [[Mouse or pointer exited the object.]] | ||
17 | wheel, [[Mouse wheel scroll, horizontally or vertically.]] | ||
18 | axis, [[Axis event (pen, stick, ...).]] | ||
19 | } | ||
20 | |||
21 | enum Efl.Pointer.Flags | ||
22 | { | ||
23 | [[Pointer flags indicating whether a double or triple click is under way. | ||
24 | |||
25 | @since 1.19 | ||
26 | ]] | ||
27 | none = 0, [[No extra mouse button data]] | ||
28 | double_click = (1 << 0), [[This mouse button press was the 2nd press of a double click]] | ||
29 | triple_click = (1 << 1), [[This mouse button press was the 3rd press of a triple click]] | ||
30 | } | ||
31 | |||
32 | enum Efl.Input.Flags | ||
33 | { | ||
34 | [[Special flags set during an input event propagation. | ||
35 | |||
36 | @since 1.19 | ||
37 | ]] | ||
38 | none = 0, [[No fancy flags set]] | ||
39 | processed = (1 << 0), [[This event is being delivered and has been processed, | ||
40 | so it should be put "on hold" until the flag is unset. | ||
41 | The event should be used for informational purposes | ||
42 | and maybe some indications visually, but not | ||
43 | actually perform anything.]] | ||
44 | scrolling = (1 << 1), [[This event flag indicates the event occurs while | ||
45 | scrolling; for example, DOWN event occurs during | ||
46 | scrolling. The event should be used for informational | ||
47 | purposes and maybe some indications visually, but not | ||
48 | actually perform anything.]] | ||
49 | } | ||
50 | |||
51 | enum @beta Efl.Input.Object_Pointer_Mode { | ||
52 | [[How the mouse pointer should be handled by EFL. | ||
53 | |||
54 | In the mode $autograb, when a mouse button is pressed down over an | ||
55 | object and held down, with the mouse pointer being moved outside of it, | ||
56 | the pointer still behaves as being bound to that object, albeit out | ||
57 | of its drawing region. When the button is released, the event will | ||
58 | be fed to the object, that may check if the final position is over it | ||
59 | or not and do something about it. | ||
60 | |||
61 | In the mode $nograb, the pointer will always be bound to the object | ||
62 | right below it. | ||
63 | |||
64 | @since 1.19 | ||
65 | ]] | ||
66 | auto_grab, [[Default, X11-like.]] | ||
67 | no_grab, [[Pointer always bound to the object right below it.]] | ||
68 | no_grab_no_repeat_updown [[Useful on object with "repeat events" enabled, | ||
69 | where mouse/touch up and down events WON'T be | ||
70 | repeated to objects and these objects wont be | ||
71 | auto-grabbed. | ||
72 | |||
73 | @since 1.2 | ||
74 | ]] | ||
75 | } | ||
76 | |||
77 | enum @beta Efl.Input.Value { | ||
78 | [[Keys for the generic values of all events. | ||
79 | |||
80 | @since 1.19 | ||
81 | ]] | ||
82 | none, [[Not a valid value type.]] | ||
83 | timestamp, [[Timestamp of this event in seconds.]] | ||
84 | button, [[ID of the button that triggered this event (unsigned int). | ||
85 | Prefer the method $button to read this value. Default: 0.]] | ||
86 | buttons_pressed, [[32-bit bit mask (unsigned int). Prefer the | ||
87 | method $buttons_pressed to read this value. Default: 0.]] | ||
88 | touch_id, [[ID of the finger or tool (eg. pen) that triggered this event. | ||
89 | Prefer the property $touch_id to read this value. Default: 0.]] | ||
90 | x, [[Absolute X position where this event occurred, in pixels. | ||
91 | Relative to the window. Default: last known position. | ||
92 | This value may be smoothed out or even extrapolated by EFL.]] | ||
93 | y, [[Absolute Y position where this event occurred, in pixels. | ||
94 | Relative to the window. Default: last known position. | ||
95 | This value may be smoothed out or even extrapolated by EFL.]] | ||
96 | dx, [[Relative X movement, in pixels. Range: unbounded. Default: 0.]] | ||
97 | dy, [[Relative Y movement, in pixels. Range: unbounded. Default: 0.]] | ||
98 | previous_x, [[Previous X position of the pointer, in pixels. | ||
99 | Default: last known position, may be equal to x.]] | ||
100 | previous_y, [[Previous Y position of the pointer, in pixels. | ||
101 | Default: last known position, may be equal to y.]] | ||
102 | raw_x, [[Absolute X position where this event occurred. Default: 0. | ||
103 | This value will be set from the hardware input without any | ||
104 | smoothing or extrapolation. For an axis input event, this is | ||
105 | the raw value set by the driver (undefined range and unit).]] | ||
106 | raw_y, [[Absolute X position where this event occurred. Default: 0. | ||
107 | This value will be set from the hardware input without any | ||
108 | smoothing or extrapolation. For an axis input event, this is | ||
109 | the raw value set by the driver (undefined range and unit).]] | ||
110 | radius, [[Average radius of the pressed area under a finger or tool, | ||
111 | in pixels. Default is 1.]] | ||
112 | radius_x, [[Spread over X of the pressed area under a finger or tool, | ||
113 | in pixels. Default is 1.]] | ||
114 | radius_y, [[Spread over Y of the pressed area under a finger or tool, | ||
115 | in pixels. Default is 1.]] | ||
116 | pressure, [[Pressure applied to the button, touch or pen tip. | ||
117 | Range: [0, 1]. Default is 1.]] | ||
118 | distance, [[Relative distance along physical Z axis. Range: [0, 1]. | ||
119 | Default is 0.]] | ||
120 | azimuth, [[Angle of tool about the Z axis from positive X axis. | ||
121 | Range: [-PI, PI]. Unit: Radians.]] | ||
122 | tilt, [[Angle of tool about plane of sensor from positive Z axis. | ||
123 | Range: [0.0, PI]. Unit: Radians.]] | ||
124 | tilt_x, [[Current tilt along the X axis of the tablet's current logical | ||
125 | orientation, in radians off the tablet's Z axis. | ||
126 | Range: [-PI, PI]. Unit: Radians.]] | ||
127 | tilt_y, [[Current tilt along the Y axis of the tablet's current logical | ||
128 | orientation, in radians off the tablet's Z axis. | ||
129 | Range: [-PI, PI]. Unit: Radians.]] | ||
130 | twist, [[Rotation of tool about its major axis from its "natural" | ||
131 | position. Range: [-PI, PI] Unit: Radians.]] | ||
132 | wheel_delta, [[Delta movement of the wheel in discrete steps (int). | ||
133 | Default: 0.]] | ||
134 | wheel_angle, [[Delta movement of the wheel in radians. Default: 0.]] | ||
135 | wheel_horizontal, [[Direction of the wheel (horizontal = 1 or vertical = 0). | ||
136 | Default: 0. Prefer the property $wheel_horizontal to read.]] | ||
137 | slider, [[Current position of the slider on the tool. Range: [-1, 1]. | ||
138 | Default: 0.]] | ||
139 | } | ||
140 | |||
141 | enum Efl.Input.Modifier { | ||
142 | [[Key modifiers such as Control, Alt, etc... | ||
143 | |||
144 | This enum may be used as a bitmask with OR operations, depending on the | ||
145 | API. | ||
146 | |||
147 | The available keys may vary depending on the physical keyboard layout, or | ||
148 | language and keyboard settings, or depending on the platform. | ||
149 | |||
150 | @since 1.20 | ||
151 | ]] | ||
152 | none = 0, [[No key modifier]] | ||
153 | alt = 1 << 0, [[Alt key modifier]] | ||
154 | control = 1 << 1, [[Control key modifier ("Ctrl" key)]] | ||
155 | shift = 1 << 2, [[Shift key modifier]] | ||
156 | meta = 1 << 3, [[Meta key modifier (often the "Windows" key)]] | ||
157 | altgr = 1 << 4, [[AltGr key modifier (not present on all keyboards)]] | ||
158 | hyper = 1 << 5, [[Hyper key modifier (may be "Windows" key)]] | ||
159 | super = 1 << 6, [[Super key modifier (may be "Windows" key)]] | ||
160 | } | ||
161 | |||
162 | enum Efl.Input.Lock { | ||
163 | [[Key locks such as Num Lock, Scroll Lock and Caps Lock. | ||
164 | |||
165 | This enum may be used as a bitmask with OR operations, depending on the | ||
166 | API. | ||
167 | |||
168 | The available keys may vary depending on the physical keyboard layout, or | ||
169 | language and keyboard settings, or depending on the platform. | ||
170 | |||
171 | @since 1.20 | ||
172 | ]] | ||
173 | none = 0, [[No key modifier]] | ||
174 | num = 1 << 0, [[Num Lock for numeric key pad use]] | ||
175 | caps = 1 << 1, [[Caps Lock for writing in all caps]] | ||
176 | scroll = 1 << 2, [[Scroll Lock]] | ||
177 | shift = 1 << 3, [[Shift Lock]] | ||
178 | } | ||
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 65b78f2bcd..d19ce686da 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c | |||
@@ -2,9 +2,6 @@ | |||
2 | #include "evas_common_private.h" | 2 | #include "evas_common_private.h" |
3 | #include "evas_private.h" | 3 | #include "evas_private.h" |
4 | 4 | ||
5 | #define EFL_INTERNAL_UNSTABLE | ||
6 | #include "interfaces/efl_common_internal.h" | ||
7 | |||
8 | EVAS_MEMPOOL(_mp_pc); | 5 | EVAS_MEMPOOL(_mp_pc); |
9 | 6 | ||
10 | extern Eina_Hash* signals_hash_table; | 7 | extern Eina_Hash* signals_hash_table; |
diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c index 660f657158..5f5e1aaba8 100644 --- a/src/lib/evas/canvas/evas_device.c +++ b/src/lib/evas/canvas/evas_device.c | |||
@@ -1,9 +1,6 @@ | |||
1 | #include "evas_common_private.h" | 1 | #include "evas_common_private.h" |
2 | #include "evas_private.h" | 2 | #include "evas_private.h" |
3 | 3 | ||
4 | #define EFL_INTERNAL_UNSTABLE | ||
5 | #include "interfaces/efl_common_internal.h" | ||
6 | |||
7 | /* WARNING: This API is not used across EFL, hard to test! */ | 4 | /* WARNING: This API is not used across EFL, hard to test! */ |
8 | 5 | ||
9 | #ifdef DEBUG_UNTESTED_ | 6 | #ifdef DEBUG_UNTESTED_ |
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 46a765e32c..bb8c9346fb 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c | |||
@@ -3,9 +3,6 @@ | |||
3 | #include "evas_common_private.h" | 3 | #include "evas_common_private.h" |
4 | #include "evas_private.h" | 4 | #include "evas_private.h" |
5 | 5 | ||
6 | #define EFL_INTERNAL_UNSTABLE | ||
7 | #include "interfaces/efl_common_internal.h" | ||
8 | |||
9 | int _evas_event_counter = 0; | 6 | int _evas_event_counter = 0; |
10 | 7 | ||
11 | static Eina_List * | 8 | static Eina_List * |
diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c index 4675735727..1204800631 100644 --- a/src/lib/evas/canvas/evas_events_legacy.c +++ b/src/lib/evas/canvas/evas_events_legacy.c | |||
@@ -1,9 +1,6 @@ | |||
1 | #include "evas_common_private.h" | 1 | #include "evas_common_private.h" |
2 | #include "evas_private.h" | 2 | #include "evas_private.h" |
3 | 3 | ||
4 | #define EFL_INTERNAL_UNSTABLE | ||
5 | #include "interfaces/efl_common_internal.h" | ||
6 | |||
7 | typedef union { | 4 | typedef union { |
8 | Evas_Event_Mouse_Down down; | 5 | Evas_Event_Mouse_Down down; |
9 | Evas_Event_Mouse_Up up; | 6 | Evas_Event_Mouse_Up up; |
diff --git a/src/lib/evas/canvas/evas_focus.c b/src/lib/evas/canvas/evas_focus.c index d76c1042dc..e11df7887d 100644 --- a/src/lib/evas/canvas/evas_focus.c +++ b/src/lib/evas/canvas/evas_focus.c | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include "evas_common_private.h" | 4 | #include "evas_common_private.h" |
5 | #include "evas_private.h" | 5 | #include "evas_private.h" |
6 | #include "interfaces/efl_common_internal.h" | ||
7 | |||
8 | 6 | ||
9 | static int evas_focus_log_domain = -1; | 7 | static int evas_focus_log_domain = -1; |
10 | 8 | ||
diff --git a/src/lib/evas/canvas/evas_key_grab.c b/src/lib/evas/canvas/evas_key_grab.c index aaf6e6a2d0..5c8969ccb4 100644 --- a/src/lib/evas/canvas/evas_key_grab.c +++ b/src/lib/evas/canvas/evas_key_grab.c | |||
@@ -1,9 +1,6 @@ | |||
1 | #include "evas_common_private.h" | 1 | #include "evas_common_private.h" |
2 | #include "evas_private.h" | 2 | #include "evas_private.h" |
3 | 3 | ||
4 | #define EFL_INTERNAL_UNSTABLE | ||
5 | #include "interfaces/efl_common_internal.h" | ||
6 | |||
7 | /* private calls */ | 4 | /* private calls */ |
8 | 5 | ||
9 | /* FIXME: this is not optimal, but works. i should have a hash of keys per */ | 6 | /* FIXME: this is not optimal, but works. i should have a hash of keys per */ |
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 92c9ed2334..6d4c07c95e 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c | |||
@@ -16,9 +16,6 @@ | |||
16 | 16 | ||
17 | #include <Ecore.h> | 17 | #include <Ecore.h> |
18 | 18 | ||
19 | #define EFL_INTERNAL_UNSTABLE | ||
20 | #include "interfaces/efl_common_internal.h" | ||
21 | |||
22 | #define MY_CLASS EVAS_CANVAS_CLASS | 19 | #define MY_CLASS EVAS_CANVAS_CLASS |
23 | 20 | ||
24 | #ifdef LKDEBUG | 21 | #ifdef LKDEBUG |
@@ -2052,3 +2049,5 @@ _evas_canvas_efl_object_event_callback_array_priority_add(Eo *obj, Evas_Public_D | |||
2052 | 2049 | ||
2053 | #include "evas_stack.x" | 2050 | #include "evas_stack.x" |
2054 | #include "canvas/evas_canvas_eo.c" | 2051 | #include "canvas/evas_canvas_eo.c" |
2052 | #include "efl_canvas_pointer.eo.c" | ||
2053 | #include "efl_canvas_scene.eo.c" | ||
diff --git a/src/lib/evas/canvas/meson.build b/src/lib/evas/canvas/meson.build index 758a8db064..1edaeca69e 100644 --- a/src/lib/evas/canvas/meson.build +++ b/src/lib/evas/canvas/meson.build | |||
@@ -28,6 +28,9 @@ pub_eo_files = [ | |||
28 | 'efl_input_hold.eo', | 28 | 'efl_input_hold.eo', |
29 | 'efl_input_focus.eo', | 29 | 'efl_input_focus.eo', |
30 | 'efl_input_clickable.eo', | 30 | 'efl_input_clickable.eo', |
31 | 'efl_input_device.eo', | ||
32 | 'efl_canvas_pointer.eo', | ||
33 | 'efl_canvas_scene.eo', | ||
31 | 'efl_canvas_animation.eo', | 34 | 'efl_canvas_animation.eo', |
32 | 'efl_canvas_animation_alpha.eo', | 35 | 'efl_canvas_animation_alpha.eo', |
33 | 'efl_canvas_animation_rotate.eo', | 36 | 'efl_canvas_animation_rotate.eo', |
@@ -52,7 +55,7 @@ pub_eo_files = [ | |||
52 | 'efl_canvas_group.eo', | 55 | 'efl_canvas_group.eo', |
53 | 'efl_gfx_mapping.eo', | 56 | 'efl_gfx_mapping.eo', |
54 | 'efl_canvas_event_grabber.eo', | 57 | 'efl_canvas_event_grabber.eo', |
55 | 'efl_canvas_text.eo' | 58 | 'efl_canvas_text.eo', |
56 | ] | 59 | ] |
57 | 60 | ||
58 | evas_canvas_eo_files = pub_eo_files | 61 | evas_canvas_eo_files = pub_eo_files |
@@ -76,7 +79,8 @@ endforeach | |||
76 | 79 | ||
77 | pub_eo_types_files = [ | 80 | pub_eo_types_files = [ |
78 | 'evas_canvas3d_types.eot', | 81 | 'evas_canvas3d_types.eot', |
79 | 'efl_canvas_animation_types.eot' | 82 | 'efl_canvas_animation_types.eot', |
83 | 'efl_input_types.eot', | ||
80 | ] | 84 | ] |
81 | 85 | ||
82 | evas_canvas_eot_files = pub_eo_types_files | 86 | evas_canvas_eot_files = pub_eo_types_files |
@@ -171,6 +175,7 @@ evas_src += files([ | |||
171 | 'efl_input_hold.c', | 175 | 'efl_input_hold.c', |
172 | 'efl_input_focus.c', | 176 | 'efl_input_focus.c', |
173 | 'efl_input_clickable.c', | 177 | 'efl_input_clickable.c', |
178 | 'efl_input_device.c', | ||
174 | 'efl_canvas_animation.c', | 179 | 'efl_canvas_animation.c', |
175 | 'efl_canvas_animation_alpha.c', | 180 | 'efl_canvas_animation_alpha.c', |
176 | 'efl_canvas_animation_rotate.c', | 181 | 'efl_canvas_animation_rotate.c', |
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_private.h b/src/lib/evas/gesture/efl_canvas_gesture_private.h index ceb7ca7d42..a835c3093d 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_private.h +++ b/src/lib/evas/gesture/efl_canvas_gesture_private.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include "evas_common_private.h" | 4 | #include "evas_common_private.h" |
5 | #include "evas_private.h" | 5 | #include "evas_private.h" |
6 | #define EFL_INTERNAL_UNSTABLE | ||
7 | #include "interfaces/efl_common_internal.h" | ||
8 | 6 | ||
9 | #include "efl_gesture_events.eo.h" | 7 | #include "efl_gesture_events.eo.h" |
10 | 8 | ||
diff --git a/src/lib/evas/include/evas_common_private.h b/src/lib/evas/include/evas_common_private.h index 59eb800724..5fecf3f157 100644 --- a/src/lib/evas/include/evas_common_private.h +++ b/src/lib/evas/include/evas_common_private.h | |||
@@ -54,6 +54,7 @@ | |||
54 | 54 | ||
55 | #include "Evas.h" | 55 | #include "Evas.h" |
56 | 56 | ||
57 | #define EFL_INTERNAL_UNSTABLE | ||
57 | #include "Evas_Internal.h" | 58 | #include "Evas_Internal.h" |
58 | 59 | ||
59 | #include "../common/evas_font.h" | 60 | #include "../common/evas_font.h" |