MiniGUI API Reference (MiniGUI-Processes)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
customial.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
56 /*
57  * $Id: customial.h 11349 2009-03-02 05:00:43Z weiym $
58  *
59  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
60  * pSOS, ThreadX, NuCleus, OSE, and Win32.
61  */
62 
63 #ifndef GUI_IAL_CUSTOM_H
64  #define GUI_IAL_CUSTOM_H
65 
66 #define IAL_MOUSE_LEFTBUTTON (1 << 0)
67 #define IAL_MOUSE_RIGHTBUTTON (1 << 1)
68 #define IAL_MOUSE_MIDDLEBUTTON (1 << 2)
69 
70 /* deprecated since 4.0.0
71 #define IAL_MOUSE_FOURTHBUTTON (1 << 3)
72 #define IAL_MOUSE_FIFTHBUTTON (1 << 4)
73 #define IAL_MOUSE_SIXTHBUTTON (1 << 5)
74 #define IAL_MOUSE_SEVENTHBUTTON (1 << 6)
75 #define IAL_MOUSE_EIGHTHBUTTON (1 << 7)
76 
77 #define IAL_MOUSE_SIDEBUTTON IAL_MOUSE_FOURTHBUTTON
78 #define IAL_MOUSE_EXTRABUTTON IAL_MOUSE_FIFTHBUTTON
79 #define IAL_MOUSE_FORWARDBUTTON IAL_MOUSE_SIXTHBUTTON
80 #define IAL_MOUSE_BACKBUTTON IAL_MOUSE_SEVENTHBUTTON
81 #define IAL_MOUSE_TASKBUTTON IAL_MOUSE_EIGHTHBUTTON
82 #define IAL_MOUSE_RESETBUTTON IAL_MOUSE_EIGHTHBUTTON
83 */
84 
85 #define IAL_EVENT_MOUSE (1 << 0)
86  #define IAL_MOUSEEVENT IAL_EVENT_MOUSE
87 #define IAL_EVENT_KEY (1 << 1)
88  #define IAL_KEYEVENT IAL_EVENT_KEY
89 
90 #define IAL_EVENT_EXTRA (1 << 2)
91 
92 /* The event identifiers, should keep sync with MSG_EXIN_XXX */
93 #ifndef AXIS_SCROLL_INVALID
94  #define AXIS_SCROLL_INVALID 0
95  #define AXIS_SCROLL_VERTICAL 1
96  #define AXIS_SCROLL_HORIZONTAL 2
97 
98  #define AXIS_SOURCE_INVALID 0
99  #define AXIS_SOURCE_WHEEL 1
100  #define AXIS_SOURCE_FINGER 2
101  #define AXIS_SOURCE_CONTINUOUS 3
102  #define AXIS_SOURCE_WHEEL_TILT 4
103 #endif
104 
105 #define IAL_EVENT_AXIS 0x0070
106 #define IAL_EVENT_BUTTONDOWN 0x0071
107 #define IAL_EVENT_BUTTONUP 0x0072
108 
109 #define IAL_EVENT_TOUCH_DOWN 0x0073
110 #define IAL_EVENT_TOUCH_UP 0x0074
111 #define IAL_EVENT_TOUCH_MOTION 0x0075
112 #define IAL_EVENT_TOUCH_CANCEL 0x0076
113 #define IAL_EVENT_TOUCH_FRAME 0x0077
114 
115 #ifndef SWITCH_INVALID
116  #define SWITCH_INVALID 0
117  #define SWITCH_LID 1
118  #define SWITCH_TABLET_MODE 2
119 
120  #define SWITCH_STATE_INVALID 0
121  #define SWITCH_STATE_ON 1
122  #define SWITCH_STATE_OFF 2
123 #endif
124 
125 #define IAL_EVENT_SWITCH_TOGGLE 0x007A
126 
127 #define IAL_EVENT_GESTURE_SWIPE_BEGIN 0x0080
128 #define IAL_EVENT_GESTURE_SWIPE_UPDATE 0x0081
129 #define IAL_EVENT_GESTURE_SWIPE_END 0x0082
130 #define IAL_EVENT_GESTURE_PINCH_BEGIN 0x0083
131 #define IAL_EVENT_GESTURE_PINCH_UPDATE 0x0084
132 #define IAL_EVENT_GESTURE_PINCH_END 0x0085
133 
134 #ifndef TABLET_TOOL_X
135  #define TABLET_TOOL_PROXIMITY_STATE_INVALID 0
136  #define TABLET_TOOL_PROXIMITY_STATE_OUT 1
137  #define TABLET_TOOL_PROXIMITY_STATE_IN 2
138 
139  #define TABLET_TOOL_TIP_INVALID 0
140  #define TABLET_TOOL_TIP_UP 1
141  #define TABLET_TOOL_TIP_DOWN 2
142 
143  #define TABLET_BUTTON_STATE_INVALID 0
144  #define TABLET_BUTTON_STATE_RELEASED 1
145  #define TABLET_BUTTON_STATE_PRESSED 2
146 
147  #define TABLET_PAD_RING_SOURCE_UNKNOWN 0
148  #define TABLET_PAD_RING_SOURCE_FINGER 1
149 
150  #define TABLET_PAD_STRIP_SOURCE_UNKNOWN 0
151  #define TABLET_PAD_STRIP_SOURCE_FINGER 1
152 
153  #define TABLET_TOOL_CHANGED_X (1 << 0)
154  #define TABLET_TOOL_CHANGED_Y (1 << 1)
155  #define TABLET_TOOL_CHANGED_PRESSURE (1 << 2)
156  #define TABLET_TOOL_CHANGED_DISTANCE (1 << 3)
157  #define TABLET_TOOL_CHANGED_TILT_X (1 << 4)
158  #define TABLET_TOOL_CHANGED_TILT_Y (1 << 5)
159  #define TABLET_TOOL_CHANGED_ROTATION (1 << 6)
160  #define TABLET_TOOL_CHANGED_SLIDER (1 << 7)
161  #define TABLET_TOOL_CHANGED_SIZE_MAJOR (1 << 8)
162  #define TABLET_TOOL_CHANGED_SIZE_MINOR (1 << 9)
163  #define TABLET_TOOL_CHANGED_WHEEL (1 << 10)
164 
165  #define TABLET_TOOL_X 0
166  #define TABLET_TOOL_Y 1
167  #define TABLET_TOOL_PRESSURE 2
168  #define TABLET_TOOL_DISTANCE 3
169  #define TABLET_TOOL_TILT_X 4
170  #define TABLET_TOOL_TILT_Y 5
171  #define TABLET_TOOL_ROTATION 6
172  #define TABLET_TOOL_SLIDER 7
173  #define TABLET_TOOL_SIZE_MAJOR 8
174  #define TABLET_TOOL_SIZE_MINOR 9
175  #define TABLET_TOOL_WHEEL 10
176 
177 #endif
178 
179 #define IAL_EVENT_TABLET_TOOL_AXIS 0x0090
180 #define IAL_EVENT_TABLET_TOOL_PROXIMITY 0x0091
181 #define IAL_EVENT_TABLET_TOOL_TIP 0x0092
182 #define IAL_EVENT_TABLET_TOOL_BUTTON 0x0093
183 
184 #define IAL_EVENT_TABLET_PAD_BUTTON 0x0094
185 #define IAL_EVENT_TABLET_PAD_RING 0x0095
186 #define IAL_EVENT_TABLET_PAD_STRIP 0x0096
187 
188 #define IAL_EVENT_USER_BEGIN 0x009A
189 #define IAL_EVENT_USER_UPDATE 0x009B
190 #define IAL_EVENT_USER_END 0x009C
191 
192 #define NR_PACKED_SUB_EVENTS 16
193 
194 typedef struct _EXTRA_INPUT_EVENT {
195  int event;
196  WPARAM wparam;
197  LPARAM lparam;
198 
199  // for tablet tool messages
200  unsigned int params_mask;
201  WPARAM wparams[NR_PACKED_SUB_EVENTS];
202  LPARAM lparams[NR_PACKED_SUB_EVENTS];
203 } EXTRA_INPUT_EVENT;
204 
205 #define IAL_LEN_MDEV 127
206 
207 typedef struct tagINPUT {
208  char* id;
209 
210  // Initialization and termination
211  BOOL (*init_input) (struct tagINPUT *input, const char* mdev, const char* mtype);
212  void (*term_input) (void);
213 
214  // Mouse operations
215  int (*update_mouse) (void);
216  void (*get_mouse_xy) (int* x, int* y);
217  void (*set_mouse_xy) (int x, int y);
218  int (*get_mouse_button) (void);
219  void (*set_mouse_range) (int minx, int miny, int maxx, int maxy);
220  void (*suspend_mouse) (void);
221  int (*resume_mouse) (void);
222 
223  // Keyboard operations
224  int (*update_keyboard) (void);
225  const char* (*get_keyboard_state) (void);
226  void (*suspend_keyboard) (void);
227  int (*resume_keyboard) (void);
228  void (*set_leds) (unsigned int leds);
229 
230  // Event loop
231  int (*wait_event) (int which, int maxfd, fd_set *in, fd_set *out,
232  fd_set *except, struct timeval *timeout);
233 
234  // New wait event method for getting extra input events; since 4.0.0
235  int (*wait_event_ex) (int maxfd, fd_set *in, fd_set *out,
236  fd_set *except, struct timeval *timeout, EXTRA_INPUT_EVENT* extra);
237 
238  // since 5.0.0, save the mouse device
239  char* mdev;
240 } INPUT;
241 
242 #ifdef __cplusplus
243 extern "C" {
244 #endif /* __cplusplus */
245 
246 #ifdef _MGIAL_CUSTOM
247 extern BOOL InitCustomInput (INPUT* input, const char* mdev, const char* mtype);
248 extern void TermCustomInput (void);
249 #endif
250 
251 #ifdef __cplusplus
252 }
253 #endif /* __cplusplus */
254 
255 #endif /* GUI_IAL_CUSTOM_H */
256 
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
BOOL
int BOOL
A type definition for boolean value.
Definition: common.h:343
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712