eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_mouse.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4D_MOUSE_H
47 #define __D4D_MOUSE_H
48 
49 /******************************************************************************
50 * Includes
51 ******************************************************************************/
52 
53 /******************************************************************************
54 * D4D Mouse setting constants
55 *
56 */
60 #ifndef D4D_MOUSE_BUFF_LENGTH
61  #define D4D_MOUSE_BUFF_LENGTH 4
62 #endif
63 
65 #ifndef D4D_MOUSE_NORMAL_BMP
66  #define D4D_MOUSE_NORMAL_BMP NULL
67 #endif
68 
70 #ifndef D4D_MOUSE_BUSY_BMP
71  #define D4D_MOUSE_BUSY_BMP NULL
72 #endif
73 
75 #ifndef D4D_MOUSE_UNAVAILABLE_BMP
76  #define D4D_MOUSE_UNAVAILABLE_BMP NULL
77 #endif
78 
80 #ifndef D4D_MOUSE_BMP_KEY_COLOR
81  #define D4D_MOUSE_BMP_KEY_COLOR 0x003F3F3F
82 #endif
83 
86 /******************************************************************************
87 * Internal constants
88 ******************************************************************************/
89 #define D4D_MOUSE_CURSOR_TYPES 3
90 
91 
92 /******************************************************************************
93 * D4D Mouse types
94 *
95 */
99 typedef enum
100 {
112 
113 
115 typedef struct
116 {
120 
122 typedef enum
123 {
130 
132 /******************************************************************************
133 * Internal types
134 ******************************************************************************/
135 typedef struct
136 {
140 }D4D_MOUSE;
141 
142 typedef struct
143 {
148 
150 
151 #define D4D_MOUSE_BTN_LEFT_MASK (0x01)
152 #define D4D_MOUSE_BTN_RIGHT_MASK (0x02)
153 #define D4D_MOUSE_BTN_MIDDLE_MASK (0x04)
154 
155 #define D4D_MOUSE_CURSOR_MASK (0x70)
156 #define D4D_MOUSE_VISIBLE_MASK (0x80)
157 
158 #define D4D_MOUSE_CURSOR_SHIFT (4)
159 
160 /******************************************************************************
161 * D4D Mouse macros
162 *
163 */
167 /**************************************************************************/
177 #define D4D_DECLARE_MOUSE_CURSOR_BMP(name, pNormal, pBusy, pUnavailable, keyColor) \
178  extern D4D_BMP pNormal; \
179  extern D4D_BMP pBusy; \
180  extern D4D_BMP pUnavailable; \
181  const D4D_MOUSECURSOR_BMP name = \
182  { { (D4D_BMP*)&pNormal, (D4D_BMP*)&pBusy, (D4D_BMP*)&pUnavailable }, keyColor};
183 
184 
187 /******************************************************************************
188 * Global variables
189 ******************************************************************************/
190 
191 
192 #ifdef D4D_LLD_MOUSE
193 /******************************************************************************
194 * Global functions
195 ******************************************************************************/
196 void D4D_ClearMouseInputBuffer(void);
197 void D4D_NewMouseEvent(sWord x, sWord y, D4D_MOUSE_EVENT event);
201 void D4D_MouseShow(D4D_BOOL show);
209 /*********************************************************
210 *
211 * internal API
212 *
213 *********************************************************/
214 void D4D_MouseInit(void);
215 void D4D_HandleMouse(void);
216 void D4D_MouseCenterCursor(void);
217 void D4D_MouseChangedScreen(void);
218 #else
219 
220 /******************************************************************************
221 * Global functions
222 ******************************************************************************/
223 #define D4D_ClearMouseInputBuffer()
224 #define D4D_NewMouseEvent(x, y, event)
225 #define D4D_GetMouseHoverObject() NULL
226 #define D4D_GetMouseCoordinates(pObject) d4d_point_zero
227 #define D4D_GetMouseRawCoordinates() d4d_point_zero
228 #define D4D_MouseShow(show)
229 #define D4D_MouseVisible() D4D_FALSE
230 #define D4D_SetMouseCursorType(cursorIx, force)
231 #define D4D_GetMouseCursorType() 0
232 #define D4D_ObjectSetMouseCursor(pObj, cursorType)
233 #define D4D_ObjectGetMouseCursor(pObj) 0
234 #define D4D_ScreenSetMouseCursor(pScr, cursorType)
235 #define D4D_ScreenGetMouseCursor(pScr) 0
236 
237 /*********************************************************
238 *
239 * internal API
240 *
241 *********************************************************/
242 #define D4D_MouseInit()
243 #define D4D_HandleMouse()
244 #define D4D_MouseCenterCursor()
245 #define D4D_MouseChangedScreen()
246 #endif
247 
248 #endif /* __D4D_MOUSE_H */
249 
250 
251 
252 
253 
254 
255 
256 
257 
258 
Type definition of eGUI point structure.
Definition: d4d_types.h:223
#define D4D_GetMouseHoverObject()
Definition: d4d_mouse.h:225
D4D_MOUSECURSOR_BMP structure contains the pointer to cursor bitmaps and key color.
Definition: d4d_mouse.h:115
sWord x
Definition: d4d_mouse.h:137
Left button up event.
Definition: d4d_mouse.h:104
Right button down event.
Definition: d4d_mouse.h:105
Set abosolute position event.
Definition: d4d_mouse.h:102
Wheel down event.
Definition: d4d_mouse.h:110
Wheel up event.
Definition: d4d_mouse.h:109
D4D_MOUSE_EVENT
D4D_MOUSE_EVENT Mouse input events enumeration.
Definition: d4d_mouse.h:99
sWord y
Definition: d4d_mouse.h:138
#define D4D_ObjectSetMouseCursor(pObj, cursorType)
Definition: d4d_mouse.h:232
#define D4D_GetMouseCoordinates(pObject)
Definition: d4d_mouse.h:226
D4D_MOUSE_CURSOR_TYPE
D4D_MOUSE_CURSOR_TYPE enumeration type contains all types of MOUSE cursors.
Definition: d4d_mouse.h:122
#define D4D_NewMouseEvent(x, y, event)
Definition: d4d_mouse.h:224
Right button up event.
Definition: d4d_mouse.h:106
#define D4D_MouseCenterCursor()
Definition: d4d_mouse.h:244
#define D4D_HandleMouse()
Definition: d4d_mouse.h:243
unsigned char Byte
Type definition of Byte (unsigned 8-bit).
Definition: d4d_types.h:151
#define D4D_MouseChangedScreen()
Definition: d4d_mouse.h:245
D4D_COLOR keyColor
key Color for transparent color
Definition: d4d_mouse.h:118
Middle button down event.
Definition: d4d_mouse.h:107
D4D_BMP eGUI main image structure.
Definition: d4d_bmp.h:100
Left button down event.
Definition: d4d_mouse.h:103
#define D4D_MouseShow(show)
Definition: d4d_mouse.h:228
#define D4D_GetMouseRawCoordinates()
Definition: d4d_mouse.h:227
signed short sWord
Type definition of sWord (signed 16-bit).
Definition: d4d_types.h:163
#define D4D_ScreenSetMouseCursor(pScr, cursorType)
Definition: d4d_mouse.h:234
#define D4D_ScreenGetMouseCursor(pScr)
Definition: d4d_mouse.h:235
The object main structure type definition.
Definition: d4d_object.h:167
Drawed busy cursor but the object/screen doesn&#39;t get any click/wheel events.
Definition: d4d_mouse.h:126
Drawed unavailable cursor but the object/screen doesn&#39;t get any click/wheel events.
Definition: d4d_mouse.h:127
D4D_MOUSE_EVENT event
Definition: d4d_mouse.h:139
#define D4D_MouseInit()
Definition: d4d_mouse.h:242
Drawed normal cursor and all events are sending to objects/screens.
Definition: d4d_mouse.h:125
LWord D4D_BOOL
Type definition of eGUI boolean.
Definition: d4d_types.h:204
#define D4D_SetMouseCursorType(cursorIx, force)
Definition: d4d_mouse.h:230
Move event.
Definition: d4d_mouse.h:101
Middle button up event.
Definition: d4d_mouse.h:108
Just system define that specified the count of cursors, must be kept on end of the enumeration field...
Definition: d4d_mouse.h:128
#define D4D_MouseVisible()
Definition: d4d_mouse.h:229
Byte D4D_MOUSE_STATUS
Definition: d4d_mouse.h:149
Drawed normal cursor but the object/screen doesn&#39;t get any click/wheel events.
Definition: d4d_mouse.h:124
The screen structure type. The main screen structure that contains all needed data to run the eGUI sc...
Definition: d4d_screen.h:162
#define D4D_ObjectGetMouseCursor(pObj)
Definition: d4d_mouse.h:233
#define D4D_MOUSE_CURSOR_TYPES
Definition: d4d_mouse.h:89
#define D4D_GetMouseCursorType()
Definition: d4d_mouse.h:231
#define D4D_MOUSE_BUFF_LENGTH
D4D_MOUSE_BUFF_LENGTH constant default declaration.
Definition: d4d_mouse.h:61
#define D4D_ClearMouseInputBuffer()
Definition: d4d_mouse.h:223
LWord D4D_COLOR
Type definition of eGUI color variables.
Definition: d4d_types.h:262