summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_common_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/efl/interfaces/efl_common_internal.h')
-rw-r--r--src/lib/efl/interfaces/efl_common_internal.h169
1 files changed, 0 insertions, 169 deletions
diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h
deleted file mode 100644
index f465c08..0000000
--- a/src/lib/efl/interfaces/efl_common_internal.h
+++ /dev/null
@@ -1,169 +0,0 @@
1/* This header file is intended for EFL internal use, and is not part of
2 * EFL stable API.
3 * Place here structs and enums that need to be shared between core EFL
4 * components, such as Ecore, Evas, etc...
5 */
6
7#ifndef EFL_COMMON_INTERNAL_H
8#define EFL_COMMON_INTERNAL_H
9
10#ifndef EFL_INTERNAL_UNSTABLE
11# error This file can not be included outside EFL
12#endif
13
14#include <Efl.h>
15
16typedef struct _Efl_Input_Pointer_Data Efl_Input_Pointer_Data;
17typedef struct _Efl_Input_Key_Data Efl_Input_Key_Data;
18typedef struct _Efl_Input_Device_Data Efl_Input_Device_Data;
19typedef struct _Efl_Input_Hold_Data Efl_Input_Hold_Data;
20typedef struct _Efl_Input_Focus_Data Efl_Input_Focus_Data;
21
22#ifndef _EVAS_TYPES_EOT_H_
23typedef struct _Evas_Modifier Evas_Modifier;
24typedef struct _Evas_Lock Evas_Lock;
25#endif
26
27struct _Efl_Input_Pointer_Data
28{
29 Eo *eo;
30 unsigned int timestamp; /* FIXME: store as double? */
31 int button;
32 unsigned int pressed_buttons;
33 int touch_id; /* finger or tool ID */
34 double radius, radius_x, radius_y;
35 double pressure, distance, azimuth, tilt, twist;
36 double angle;
37 /* current, previous positions in window coordinates.
38 * raw can be either un-smoothed, un-predicted x,y or a tablet's raw input.
39 * norm is the normalized value in [0..1] for tablet input.
40 */
41 Eina_Vector2 cur, prev, raw, norm;
42 struct {
43 int z;
44 Eina_Bool horizontal;
45 } wheel;
46 Efl_Gfx_Entity *source; /* could it be ecore? */
47 Efl_Input_Device *device;
48 Efl_Pointer_Action action;
49 Efl_Pointer_Flags button_flags;
50 Efl_Input_Flags event_flags;
51 void *data; /* evas data - whatever that is */
52 Eina_Bool window_pos; /* true if positions are window-relative
53 (see input vs. feed: this is "input") */
54 Evas_Modifier *modifiers;
55 Evas_Lock *locks;
56 void *legacy; /* DO NOT TOUCH THIS */
57 uint32_t value_flags;
58 Eina_Bool has_norm : 1; /* not in value_flags */
59 Eina_Bool has_raw : 1; /* not in value_flags */
60 Eina_Bool evas_done : 1; /* set by evas */
61 Eina_Bool fake : 1;
62 Eina_Bool win_fed : 1;
63};
64
65struct _Efl_Input_Key_Data
66{
67 Eo *eo;
68 unsigned int timestamp; /* FIXME: store as double? */
69
70 Eina_Bool pressed; /* 1 = pressed/down, 0 = released/up */
71 Eina_Stringshare *keyname;
72 Eina_Stringshare *key;
73 Eina_Stringshare *string;
74 Eina_Stringshare *compose;
75 unsigned int keycode;
76
77 void *data;
78 Evas_Modifier *modifiers;
79 Evas_Lock *locks;
80 Efl_Input_Flags event_flags;
81 Efl_Input_Device *device;
82 void *legacy; /* DO NOT TOUCH THIS */
83 Eina_Bool evas_done : 1; /* set by evas */
84 Eina_Bool fake : 1;
85 Eina_Bool win_fed : 1;
86 Eina_Bool no_stringshare : 1;
87};
88
89struct _Efl_Input_Device_Data
90{
91 Eo *eo;
92 Eo *evas; /* Evas */
93 Efl_Input_Device *source; /* ref */
94 Eina_List *children; /* ref'ed by efl_parent, not by this list */
95 unsigned int id;
96 Efl_Input_Device_Type klass;
97 unsigned int subclass; // Evas_Device_Subclass (unused)
98 unsigned int pointer_count;
99};
100
101struct _Efl_Input_Hold_Data
102{
103 Eo *eo;
104 double timestamp;
105 Efl_Input_Flags event_flags;
106 Efl_Input_Device *device;
107 void *data;
108 void *legacy; /* DO NOT TOUCH THIS */
109 Eina_Bool hold : 1;
110 Eina_Bool evas_done : 1; /* set by evas */
111};
112
113struct _Efl_Input_Focus_Data
114{
115 Eo *eo;
116 Efl_Input_Device *device; //The seat
117 Eo *object_wref; // wref on the focused object - Efl.Canvas.Object or Efl.Canvas.
118 double timestamp;
119 Efl_Input_Flags event_flags;
120};
121
122/* Internal helpers */
123
124static inline const char *
125_efl_input_modifier_to_string(Efl_Input_Modifier mod)
126{
127 switch (mod)
128 {
129 default:
130 case EFL_INPUT_MODIFIER_NONE: return NULL;
131 case EFL_INPUT_MODIFIER_ALT: return "Alt";
132 case EFL_INPUT_MODIFIER_CONTROL: return "Control";
133 case EFL_INPUT_MODIFIER_SHIFT: return "Shift";
134 case EFL_INPUT_MODIFIER_META: return "Meta";
135 case EFL_INPUT_MODIFIER_ALTGR: return "AltGr";
136 case EFL_INPUT_MODIFIER_HYPER: return "Hyper";
137 case EFL_INPUT_MODIFIER_SUPER: return "Super";
138 }
139}
140
141static inline const char *
142_efl_input_lock_to_string(Efl_Input_Lock lock)
143{
144 switch (lock)
145 {
146 default:
147 case EFL_INPUT_LOCK_NONE: return NULL;
148 case EFL_INPUT_LOCK_NUM: return "Num";
149 case EFL_INPUT_LOCK_CAPS: return "Caps";
150 case EFL_INPUT_LOCK_SCROLL: return "Scroll";
151 case EFL_INPUT_LOCK_SHIFT: return "Shift";
152 }
153}
154
155static inline Eina_Bool
156_efl_input_value_has(const Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
157{
158 return (pd->value_flags & (1u << (int) key)) != 0;
159}
160
161static inline void
162_efl_input_value_mark(Efl_Input_Pointer_Data *pd, Efl_Input_Value key)
163{
164 pd->value_flags |= (1u << (int) key);
165}
166
167#define _efl_input_value_mask(key) (1u << (int) key)
168
169#endif