GL Studio SCECpp Runtime Library
gls_event.h
Go to the documentation of this file.
1 #ifndef _GLS_EVENT_H
2 #define _GLS_EVENT_H
3 
4 /*! \file gls_event.h
5 
6 \brief This header the GlsEvent structure and related classes
7  in the GL Studio DO-178B Runtime Library.
8 
9 \par Copyright Information
10 Copyright (C) 1999-2012 The DiSTI Corporation<br>
11 Orlando, FL USA<br>
12 All rights reserved.<br>
13 
14  This file is copyrighted software and contains proprietary trade secrets of
15 DiSTI, and embodies substantial creative efforts as well as confidential
16 information, ideas, and expressions.
17 
18  Permission to use, and copy this software and its documentation for any
19 purpose is hereby granted per the Distribution Agreement and/or the Licensing
20 Agreement signed with DiSTI. This permission is granted provided that:
21  1. The above copyright notice appears in all copies.
22  2. That both the copyright notice and this permission notice appear in
23  the supporting documentation.
24  3. That the names DiSTI and GL Studio not be used in advertising or
25  publicity pertaining to distribution of the software without specific,
26  written prior permission of DiSTI.
27 
28  Permission to modify the software is granted, but not the right to
29 distribute the source code whether modified, or non-modified. Modifying the
30 software might invalidate the DO-178B certification package.
31 
32  Permission to distribute binaries produced by compiling source code, or
33 modified source code is granted, provided you:
34  1. Provide your name and address as the primary contact for the support
35  of your modified version.
36  2. Retain our contact information in regard to use of the base software.
37 
38  DiSTI does not provide warranty for this software or guarantee that it
39 satisfies any specification or requirement unless otherwise stated in a
40 specific contractual arrangement between the customer and DiSTI.
41 
42 */
43 
44 #include "gls_include.h"
45 #include "gls_types.h"
46 #include "gls_vertex.h"
47 
48 // forward ref
49 class GlsDisplayObject;
50 
51 /** encapsulates an event */
52 struct GlsEvent
53 {
54  /** enumeration of possible event types */
55  enum EventType
56  {
57  EVENT_TYPE_MOUSE_BUTTON_DOWN, /**< mouse button down event */
58  EVENT_TYPE_MOUSE_BUTTON_UP, /**< mouse button up event */
59  EVENT_TYPE_MOUSE_MOVE, /**< mouse move event */
60  EVENT_TYPE_MOUSE_DRAG, /**< mouse drag event */
61  EVENT_TYPE_MOUSE_ENTER, /**< mouse enter event */
62  EVENT_TYPE_MOUSE_LEAVE, /**< mouse leave event */
63  EVENT_TYPE_KEYBOARD_DOWN, /**< keyboard down event */
64  EVENT_TYPE_KEYBOARD_UP, /**< keyboard up event */
65  EVENT_TYPE_USER, /**< User defined event */
66 
67  #if defined( GLS_DEBUG )
68  EVENT_TYPE_INVALID /**< invalid event type ( GLS_DEBUG only )*/
69  #endif // GLS_DEBUG
70  };
71 
72  /** mouse button bit flags */
74  {
75  MOUSE_BUTTON_NONE = 0u, /**< no mouse button is down */
76  MOUSE_BUTTON_LEFT = ( 1u << 0u ), /**< left mouse button is down */
77  MOUSE_BUTTON_MIDDLE = ( 1u << 1u ), /**< middle mouse button is down */
78  MOUSE_BUTTON_RIGHT = ( 1u << 2u ), /**< right mouse button is down */
79  MOUSE_BUTTON_USER_1 = ( 1u << 3u ), /**< user defined mouse button 1 is down */
80  MOUSE_BUTTON_USER_2 = ( 1u << 4u ), /**< user defined mouse button 2 is down */
81  MOUSE_BUTTON_USER_3 = ( 1u << 5u ), /**< user defined mouse button 3 is down */
82  MOUSE_BUTTON_USER_4 = ( 1u << 6u ), /**< user defined mouse button 4 is down */
83  MOUSE_BUTTON_USER_5 = ( 1u << 7u ) /**< user defined mouse button 5 is down */
84  };
85 
86  /** keyboard modifier bit flags */
88  {
89  KEYBOARD_MODIFIER_NONE = 0u, /**< no modifier keys are down */
90  KEYBOARD_MODIFIER_SHIFT = ( 1u << 0u ), /**< shift key is down */
91  KEYBOARD_MODIFIER_CAPS_LOCK = ( 1u << 1u ), /**< caps lock key is down */
92  KEYBOARD_MODIFIER_CTRL = ( 1u << 2u ), /**< ctrl key is down */
93  KEYBOARD_MODIFIER_ALT = ( 1u << 3u ), /**< alt key is down */
94  KEYBOARD_MODIFIER_NUM_LOCK = ( 1u << 4u ), /**< num lock key is down */
95  KEYBOARD_MODIFIER_SCROLL_LOCK = ( 1u << 5u ), /**< scroll lock key is down */
96  KEYBOARD_MODIFIER_META = ( 1u << 6u ), /**< meta key is down */
97  KEYBOARD_MODIFIER_USER_MOD_1 = ( 1u << 7u ), /**< user defined key modifier 1 is down */
98  KEYBOARD_MODIFIER_USER_MOD_2 = ( 1u << 8u ), /**< user defined key modifier 2 is down */
99  KEYBOARD_MODIFIER_USER_MOD_3 = ( 1u << 9u ), /**< user defined key modifier 3 is down */
100  KEYBOARD_MODIFIER_USER_MOD_4 = ( 1u << 10u ), /**< user defined key modifier 4 is down */
101  KEYBOARD_MODIFIER_USER_MOD_5 = ( 1u << 11u ), /**< user defined key modifier 5 is down */
102  KEYBOARD_MODIFIER_USER_MOD_6 = ( 1u << 12u ), /**< user defined key modifier 6 is down */
103  KEYBOARD_MODIFIER_USER_MOD_7 = ( 1u << 13u ), /**< user defined key modifier 7 is down */
104  };
105 
106  /** Keyboard key enumeration */
108  {
109  KEYBOARD_KEY_NULL = 0x00, /**< no key */
110  KEYBOARD_KEY_SHIFT = 0x01, /**< shift key */
111  KEYBOARD_KEY_CTRL = 0x02, /**< ctrl key */
112  KEYBOARD_KEY_ALT = 0x03, /**< alt key */
113  KEYBOARD_KEY_META = 0x04, /**< meta key */
114  KEYBOARD_CAPS_LOCK = 0x05, /**< caps lock key */
115  KEYBOARD_KEY_NUM_LOCK = 0x06, /**< num lock key */
116  KEYBOARD_KEY_SCROLL_LOCK = 0x07, /**< scroll lock key */
117  KEYBOARD_KEY_BACKSPACE = 0x08, /**< backspace key */
118  KEYBOARD_KEY_TAB = 0x09, /**< tab key */
119  KEYBOARD_KEY_ENTER = 0x0A, /**< enter key */
120  KEYBOARD_KEY_PAUSE = 0x0B, /**< pause key */
121  KEYBOARD_KEY_INSERT = 0x0C, /**< insert key */
122  KEYBOARD_KEY_HOME = 0x0D, /**< home key */
123  KEYBOARD_KEY_END = 0x0E, /**< end key */
124  KEYBOARD_KEY_PAGE_UP = 0x0F, /**< page up key */
125  KEYBOARD_KEY_PAGE_DOWN = 0x10, /**< page down key */
126  KEYBOARD_KEY_ARROW_LEFT = 0x11, /**< arrow left key */
127  KEYBOARD_KEY_ARROW_UP = 0x12, /**< arrow up key */
128  KEYBOARD_KEY_ARROW_RIGHT = 0x13, /**< arrow right key */
129  KEYBOARD_KEY_ARROW_DOWN = 0x14, /**< arrow down key */
130  KEYBOARD_KEY_SYS_RQ = 0x15, /**< SysRq key */
131  KEYBOARD_KEY_PRINT_SCREEN = 0x16, /**< Print Screen key */
132  KEYBOARD_KEY_BREAK = 0x17, /**< Break key */
133  KEYBOARD_KEY_ESCAPE = 0x18, /**< escape key */
134  KEYBOARD_KEY_USER_MOD_1 = 0x19, /**< user key modifier 1 */
135  KEYBOARD_KEY_USER_MOD_2 = 0x1A, /**< user key modifier 2 */
136  KEYBOARD_KEY_USER_MOD_3 = 0x1B, /**< user key modifier 3 */
137  KEYBOARD_KEY_USER_MOD_4 = 0x1C, /**< user key modifier 4 */
138  KEYBOARD_KEY_USER_MOD_5 = 0x1D, /**< user key modifier 5 */
139  KEYBOARD_KEY_USER_MOD_6 = 0x1E, /**< user key modifier 6 */
140  KEYBOARD_KEY_USER_MOD_7 = 0x1F, /**< user key modifier 7 */
141  KEYBOARD_KEY_SPACE = 0x20, /**< ASCII code for ' ' */
142  KEYBOARD_KEY_EXCLAMATION_MARK = 0x21, /**< ASCII code for '!' */
143  KEYBOARD_KEY_QUOTATION_MARK = 0x22, /**< ASCII code for '"' */
144  KEYBOARD_KEY_NUMBER_SIGN = 0x23, /**< ASCII code for '#' */
145  KEYBOARD_KEY_DOLLAR_SIGN = 0x24, /**< ASCII code for '$' */
146  KEYBOARD_KEY_PERCENT_SIGN = 0x25, /**< ASCII code for '%' */
147  KEYBOARD_KEY_AMPERSAND = 0x26, /**< ASCII code for '&' */
148  KEYBOARD_KEY_APOSTROPHE = 0x27, /**< ASCII code for '\'' */
149  KEYBOARD_KEY_LEFT_PARENTHESES = 0x28, /**< ASCII code for '(' */
150  KEYBOARD_KEY_RIGHT_PARENTHESES = 0x29, /**< ASCII code for ')' */
151  KEYBOARD_KEY_ASTERISK = 0x2A, /**< ASCII code for '*' */
152  KEYBOARD_KEY_PLUS = 0x2B, /**< ASCII code for '+' */
153  KEYBOARD_KEY_COMMA = 0x2C, /**< ASCII code for ',' */
154  KEYBOARD_KEY_HYPHEN = 0x2D, /**< ASCII code for '-' */
155  KEYBOARD_KEY_PERIOD = 0x2E, /**< ASCII code for '.' */
156  KEYBOARD_KEY_FORWARD_SLASH = 0x2F, /**< ASCII code for '/' */
157  KEYBOARD_KEY_ZERO = 0x30, /**< ASCII code for '0' */
158  KEYBOARD_KEY_ONE = 0x31, /**< ASCII code for '1' */
159  KEYBOARD_KEY_TWO = 0x32, /**< ASCII code for '2' */
160  KEYBOARD_KEY_THREE = 0x33, /**< ASCII code for '3' */
161  KEYBOARD_KEY_FOUR = 0x34, /**< ASCII code for '4' */
162  KEYBOARD_KEY_FIVE = 0x35, /**< ASCII code for '5' */
163  KEYBOARD_KEY_SIX = 0x36, /**< ASCII code for '6' */
164  KEYBOARD_KEY_SEVEN = 0x37, /**< ASCII code for '7' */
165  KEYBOARD_KEY_EIGHT = 0x38, /**< ASCII code for '8' */
166  KEYBOARD_KEY_NINE = 0x39, /**< ASCII code for '9' */
167  KEYBOARD_KEY_COLON = 0x3A, /**< ASCII code for ':' */
168  KEYBOARD_KEY_SEMICOLON = 0x3B, /**< ASCII code for ';' */
169  KEYBOARD_KEY_LESS_THAN_SIGN = 0x3C, /**< ASCII code for '<' */
170  KEYBOARD_KEY_EQUALS_SIGN = 0x3D, /**< ASCII code for '=' */
171  KEYBOARD_KEY_GREATER_THAN_SIGN = 0x3E, /**< ASCII code for '>' */
172  KEYBOARD_KEY_QUESTION_MARK = 0x3F, /**< ASCII code for '?' */
173  KEYBOARD_KEY_AT_SIGN = 0x40, /**< ASCII code for '@' */
174  KEYBOARD_KEY_UPPERCASE_A = 0x41, /**< ASCII code for 'A' */
175  KEYBOARD_KEY_UPPERCASE_B = 0x42, /**< ASCII code for 'B' */
176  KEYBOARD_KEY_UPPERCASE_C = 0x43, /**< ASCII code for 'C' */
177  KEYBOARD_KEY_UPPERCASE_D = 0x44, /**< ASCII code for 'D' */
178  KEYBOARD_KEY_UPPERCASE_E = 0x45, /**< ASCII code for 'E' */
179  KEYBOARD_KEY_UPPERCASE_F = 0x46, /**< ASCII code for 'F' */
180  KEYBOARD_KEY_UPPERCASE_G = 0x47, /**< ASCII code for 'G' */
181  KEYBOARD_KEY_UPPERCASE_H = 0x48, /**< ASCII code for 'H' */
182  KEYBOARD_KEY_UPPERCASE_I = 0x49, /**< ASCII code for 'I' */
183  KEYBOARD_KEY_UPPERCASE_J = 0x4A, /**< ASCII code for 'J' */
184  KEYBOARD_KEY_UPPERCASE_K = 0x4B, /**< ASCII code for 'K' */
185  KEYBOARD_KEY_UPPERCASE_L = 0x4C, /**< ASCII code for 'L' */
186  KEYBOARD_KEY_UPPERCASE_M = 0x4D, /**< ASCII code for 'M' */
187  KEYBOARD_KEY_UPPERCASE_N = 0x4E, /**< ASCII code for 'N' */
188  KEYBOARD_KEY_UPPERCASE_O = 0x4F, /**< ASCII code for 'O' */
189  KEYBOARD_KEY_UPPERCASE_P = 0x50, /**< ASCII code for 'P' */
190  KEYBOARD_KEY_UPPERCASE_Q = 0x51, /**< ASCII code for 'Q' */
191  KEYBOARD_KEY_UPPERCASE_R = 0x52, /**< ASCII code for 'R' */
192  KEYBOARD_KEY_UPPERCASE_S = 0x53, /**< ASCII code for 'S' */
193  KEYBOARD_KEY_UPPERCASE_T = 0x54, /**< ASCII code for 'T' */
194  KEYBOARD_KEY_UPPERCASE_U = 0x55, /**< ASCII code for 'U' */
195  KEYBOARD_KEY_UPPERCASE_V = 0x56, /**< ASCII code for 'V' */
196  KEYBOARD_KEY_UPPERCASE_W = 0x57, /**< ASCII code for 'W' */
197  KEYBOARD_KEY_UPPERCASE_X = 0x58, /**< ASCII code for 'X' */
198  KEYBOARD_KEY_UPPERCASE_Y = 0x59, /**< ASCII code for 'Y' */
199  KEYBOARD_KEY_UPPERCASE_Z = 0x5A, /**< ASCII code for 'Z' */
200  KEYBOARD_KEY_LEFT_SQUARE_BRACKET = 0x5B, /**< ASCII code for '[' */
201  KEYBOARD_KEY_BACKSLASH = 0x5C, /**< ASCII code for '\' */
202  KEYBOARD_KEY_RIGHT_SQUARE_BRACKET = 0x5D, /**< ASCII code for ']' */
203  KEYBOARD_KEY_CARET = 0x5E, /**< ASCII code for '^' */
204  KEYBOARD_KEY_UNDERSCORE = 0x5F, /**< ASCII code for '_' */
205  KEYBOARD_KEY_OPENING_SINGLE_QUOTE = 0x60, /**< ASCII code for '`' */
206  KEYBOARD_KEY_LOWERCASE_A = 0x61, /**< ASCII code for 'a' */
207  KEYBOARD_KEY_LOWERCASE_B = 0x62, /**< ASCII code for 'b' */
208  KEYBOARD_KEY_LOWERCASE_C = 0x63, /**< ASCII code for 'c' */
209  KEYBOARD_KEY_LOWERCASE_D = 0x64, /**< ASCII code for 'd' */
210  KEYBOARD_KEY_LOWERCASE_E = 0x65, /**< ASCII code for 'e' */
211  KEYBOARD_KEY_LOWERCASE_F = 0x66, /**< ASCII code for 'f' */
212  KEYBOARD_KEY_LOWERCASE_G = 0x67, /**< ASCII code for 'g' */
213  KEYBOARD_KEY_LOWERCASE_H = 0x68, /**< ASCII code for 'h' */
214  KEYBOARD_KEY_LOWERCASE_I = 0x69, /**< ASCII code for 'i' */
215  KEYBOARD_KEY_LOWERCASE_J = 0x6A, /**< ASCII code for 'j' */
216  KEYBOARD_KEY_LOWERCASE_K = 0x6B, /**< ASCII code for 'k' */
217  KEYBOARD_KEY_LOWERCASE_L = 0x6C, /**< ASCII code for 'l' */
218  KEYBOARD_KEY_LOWERCASE_M = 0x6D, /**< ASCII code for 'm' */
219  KEYBOARD_KEY_LOWERCASE_N = 0x6E, /**< ASCII code for 'n' */
220  KEYBOARD_KEY_LOWERCASE_O = 0x6F, /**< ASCII code for 'o' */
221  KEYBOARD_KEY_LOWERCASE_P = 0x70, /**< ASCII code for 'p' */
222  KEYBOARD_KEY_LOWERCASE_Q = 0x71, /**< ASCII code for 'q' */
223  KEYBOARD_KEY_LOWERCASE_R = 0x72, /**< ASCII code for 'r' */
224  KEYBOARD_KEY_LOWERCASE_S = 0x73, /**< ASCII code for 's' */
225  KEYBOARD_KEY_LOWERCASE_T = 0x74, /**< ASCII code for 't' */
226  KEYBOARD_KEY_LOWERCASE_U = 0x75, /**< ASCII code for 'u' */
227  KEYBOARD_KEY_LOWERCASE_V = 0x76, /**< ASCII code for 'v' */
228  KEYBOARD_KEY_LOWERCASE_W = 0x77, /**< ASCII code for 'w' */
229  KEYBOARD_KEY_LOWERCASE_X = 0x78, /**< ASCII code for 'x' */
230  KEYBOARD_KEY_LOWERCASE_Y = 0x79, /**< ASCII code for 'y' */
231  KEYBOARD_KEY_LOWERCASE_Z = 0x7A, /**< ASCII code for 'z' */
232  KEYBOARD_KEY_LEFT_CURLY_BRACE = 0x7B, /**< ASCII code for '{' */
233  KEYBOARD_KEY_VERTICAL_LINE = 0x7C, /**< ASCII code for '|' */
234  KEYBOARD_KEY_RIGHT_CURLY_BRACE = 0x7D, /**< ASCII code for '}' */
235  KEYBOARD_KEY_TILDE = 0x7E, /**< ASCII code for '~' */
236  KEYBOARD_KEY_DELETE = 0x7F, /**< ASCII code for DEL */
237  KEYBOARD_KEY_F1 = 0x80, /**< Function Key 1 */
238  KEYBOARD_KEY_F2 = 0x81, /**< Function Key 2 */
239  KEYBOARD_KEY_F3 = 0x82, /**< Function Key 3 */
240  KEYBOARD_KEY_F4 = 0x83, /**< Function Key 4 */
241  KEYBOARD_KEY_F5 = 0x84, /**< Function Key 5 */
242  KEYBOARD_KEY_F6 = 0x85, /**< Function Key 6 */
243  KEYBOARD_KEY_F7 = 0x86, /**< Function Key 7 */
244  KEYBOARD_KEY_F8 = 0x87, /**< Function Key 8 */
245  KEYBOARD_KEY_F9 = 0x88, /**< Function Key 9 */
246  KEYBOARD_KEY_F10 = 0x89, /**< Function Key 10 */
247  KEYBOARD_KEY_F11 = 0x8A, /**< Function Key 11 */
248  KEYBOARD_KEY_F12 = 0x8B, /**< Function Key 12 */
249  KEYBOARD_KEY_USER_DEFINED_1 = 0x8C, /**< User Defined Key 1 */
250  KEYBOARD_KEY_USER_DEFINED_2 = 0x8D, /**< User Defined Key 2 */
251  KEYBOARD_KEY_USER_DEFINED_3 = 0x8E, /**< User Defined Key 3 */
252  KEYBOARD_KEY_USER_DEFINED_4 = 0x8F, /**< User Defined Key 4 */
253  KEYBOARD_KEY_USER_DEFINED_5 = 0x90, /**< User Defined Key 5 */
254  KEYBOARD_KEY_USER_DEFINED_6 = 0x91, /**< User Defined Key 6 */
255  KEYBOARD_KEY_USER_DEFINED_7 = 0x92, /**< User Defined Key 7 */
256  KEYBOARD_KEY_USER_DEFINED_8 = 0x93, /**< User Defined Key 8 */
257  KEYBOARD_KEY_USER_DEFINED_9 = 0x94, /**< User Defined Key 9 */
258  KEYBOARD_KEY_USER_DEFINED_10 = 0x95, /**< User Defined Key 10 */
259  KEYBOARD_KEY_USER_DEFINED_11 = 0x96, /**< User Defined Key 11 */
260  KEYBOARD_KEY_USER_DEFINED_12 = 0x97, /**< User Defined Key 12 */
261  KEYBOARD_KEY_USER_DEFINED_13 = 0x98, /**< User Defined Key 13 */
262  KEYBOARD_KEY_USER_DEFINED_14 = 0x99, /**< User Defined Key 14 */
263  KEYBOARD_KEY_USER_DEFINED_15 = 0x9A, /**< User Defined Key 15 */
264  KEYBOARD_KEY_USER_DEFINED_16 = 0x9B, /**< User Defined Key 16 */
265  KEYBOARD_KEY_USER_DEFINED_17 = 0x9C, /**< User Defined Key 17 */
266  KEYBOARD_KEY_USER_DEFINED_18 = 0x9D, /**< User Defined Key 18 */
267  KEYBOARD_KEY_USER_DEFINED_19 = 0x9E, /**< User Defined Key 19 */
268  KEYBOARD_KEY_USER_DEFINED_20 = 0x9F, /**< User Defined Key 20 */
269  KEYBOARD_KEY_USER_DEFINED_21 = 0xA0, /**< User Defined Key 21 */
270  KEYBOARD_KEY_USER_DEFINED_22 = 0xA1, /**< User Defined Key 22 */
271  KEYBOARD_KEY_USER_DEFINED_23 = 0xA2, /**< User Defined Key 23 */
272  KEYBOARD_KEY_USER_DEFINED_24 = 0xA3, /**< User Defined Key 24 */
273  KEYBOARD_KEY_USER_DEFINED_25 = 0xA4, /**< User Defined Key 25 */
274  KEYBOARD_KEY_USER_DEFINED_26 = 0xA5, /**< User Defined Key 26 */
275  KEYBOARD_KEY_USER_DEFINED_27 = 0xA6, /**< User Defined Key 27 */
276  KEYBOARD_KEY_USER_DEFINED_28 = 0xA7, /**< User Defined Key 28 */
277  KEYBOARD_KEY_USER_DEFINED_29 = 0xA8, /**< User Defined Key 29 */
278  KEYBOARD_KEY_USER_DEFINED_30 = 0xA9, /**< User Defined Key 30 */
279  KEYBOARD_KEY_USER_DEFINED_31 = 0xAA, /**< User Defined Key 31 */
280  KEYBOARD_KEY_USER_DEFINED_32 = 0xAB, /**< User Defined Key 32 */
281  };
282 
283  EventType eventType; /**< type of event */
284  GlsVector2D windowCoord; /**< window coordinate associated with event */
285  GlsUInt32 mouseButton; /**< mouse button state ( MouseButton bit flags ) */
286  GlsUInt32 keyboardModifier; /**< keyboard modifier ( KeyboardModifier bit flags ) */
287  KeyboardKey keyboardKey; /**< keyboard key */
288  GlsUInt32 userData; /**< user defined data */
289  GlsDisplayObject *initiator; /**< object that emitted the event else GLS_NULL */
290 
291  #if defined( GLS_DEBUG )
292  /** Determine if this event is valid ( GLS_DEBUG only )
293  * \return GLS_TRUE if valid else GLS_FALSE
294  * \pre none
295  * \post none
296  */
297  GlsBool IsValid( void ) const;
298  #endif // GLS_DEBUG
299 };
300 
301 /** abstract base class for dispatching events
302  * \invariant none
303  */
305 {
306 public:
307  /** Constructor - construct an instance
308  * \pre none
309  * \post instance created
310  */
311  GlsEventDispatcher( void );
312 
313  /** Dispatch the given event (pure virtual)
314  * \param event event in question
315  * \return GLS_TRUE if event was handled during dispatch else GLS_FALSE
316  * \pre event.IsValid()
317  * \post event is dispatched and handled if return value is GLS_TRUE
318  */
319  virtual GlsBool DispatchEvent( GlsEvent &event ) = 0;
320 
321 protected:
322  /** Destructor - shall never be called
323  * \pre none
324  * \post none
325  */
326  virtual ~GlsEventDispatcher();
327 
328 private:
329  // Disable implicit generated Members
330  GlsEventDispatcher& operator=( const GlsEventDispatcher &rhs );
332 };
333 
334 #if defined( GLS_DEBUG )
335 #pragma BullseyeCoverage save off
336 /** Determine if the given event type is valid ( GLS_DEBUG only )
337  * \param eventType event type in question
338  * \return GLS_TRUE if valid else GLS_FALSE
339  * \pre none
340  * \post none
341  */
342 inline GlsBool GlsEventTypeIsValid( const GlsEvent::EventType eventType )
343 {
344  return( ( GlsEvent::EVENT_TYPE_MOUSE_BUTTON_DOWN == eventType ) ||
345  ( GlsEvent::EVENT_TYPE_MOUSE_BUTTON_UP == eventType ) ||
346  ( GlsEvent::EVENT_TYPE_MOUSE_MOVE == eventType ) ||
347  ( GlsEvent::EVENT_TYPE_MOUSE_DRAG == eventType ) ||
348  ( GlsEvent::EVENT_TYPE_MOUSE_ENTER == eventType ) ||
349  ( GlsEvent::EVENT_TYPE_MOUSE_LEAVE == eventType ) ||
350  ( GlsEvent::EVENT_TYPE_KEYBOARD_DOWN == eventType ) ||
351  ( GlsEvent::EVENT_TYPE_KEYBOARD_UP == eventType ) ||
352  ( GlsEvent::EVENT_TYPE_USER == eventType ) );
353 }
354 #pragma BullseyeCoverage restore
355 #endif // GLS_DEBUG
356 
357 #endif // _GLS_EVENT_H
Definition: gls_event.h:239
Definition: gls_event.h:212
Definition: gls_event.h:234
Definition: gls_event.h:129
Definition: gls_event.h:127
Definition: gls_event.h:279
Definition: gls_event.h:276
Definition: gls_event.h:165
Definition: gls_event.h:163
Definition: gls_event.h:175
Definition: gls_event.h:140
Definition: gls_event.h:269
Definition: gls_event.h:242
Definition: gls_event.h:304
Definition: gls_event.h:119
Definition: gls_event.h:128
Definition: gls_event.h:190
Definition: gls_event.h:61
Definition: gls_event.h:57
Definition: gls_event.h:268
Definition: gls_event.h:237
Definition: gls_event.h:264
Definition: gls_event.h:203
Definition: gls_event.h:263
Definition: gls_event.h:95
Definition: gls_event.h:133
Definition: gls_event.h:150
Definition: gls_event.h:210
Definition: gls_event.h:142
Definition: gls_event.h:261
Definition: gls_event.h:271
Definition: gls_event.h:138
Definition: gls_event.h:122
Definition: gls_event.h:213
Definition: gls_event.h:90
Definition: gls_event.h:188
Definition: gls_event.h:89
Definition: gls_event.h:260
Definition: gls_event.h:191
Definition: gls_event.h:176
Definition: gls_event.h:112
Definition: gls_event.h:135
Definition: gls_event.h:132
Definition: gls_event.h:97
Definition: gls_event.h:193
Definition: gls_event.h:144
Definition: gls_event.h:126
Definition: gls_event.h:101
Definition: gls_event.h:115
Definition: gls_event.h:232
Definition: gls_event.h:159
Definition: gls_event.h:228
Definition: gls_event.h:249
Definition: gls_event.h:254
Definition: gls_event.h:219
Definition: gls_event.h:83
Definition: gls_event.h:118
GlsDisplayObject * initiator
Definition: gls_event.h:289
Definition: gls_event.h:204
Definition: gls_event.h:143
Definition: gls_event.h:125
Definition: gls_event.h:131
EventType
Definition: gls_event.h:55
Definition: gls_event.h:244
Definition: gls_event.h:111
Definition: gls_event.h:113
Definition: gls_event.h:224
Definition: gls_event.h:252
Definition: gls_event.h:148
Definition: gls_event.h:168
Definition: gls_event.h:102
Definition: gls_event.h:208
Definition: gls_event.h:166
Definition: gls_event.h:136
Definition: gls_event.h:280
Definition: gls_event.h:184
Definition: gls_event.h:109
Definition: gls_event.h:155
Definition: gls_event.h:240
GlsUInt32 mouseButton
Definition: gls_event.h:285
Definition: gls_event.h:77
Definition: gls_event.h:197
Definition: gls_event.h:231
Definition: gls_event.h:117
Definition: gls_event.h:63
unsigned int GlsUInt32
Definition: gls_types.h:73
Definition: gls_event.h:147
Definition: gls_event.h:156
Definition: gls_event.h:149
Definition: gls_event.h:278
Definition: gls_event.h:183
This header defines any preprocessor defines needed to configure the GL Studio DO-178B Runtime Librar...
Definition: gls_event.h:256
virtual GlsBool DispatchEvent(GlsEvent &event)=0
Definition: gls_event.h:272
Definition: gls_event.h:80
Definition: gls_event.h:220
Definition: gls_event.h:52
Definition: gls_event.h:209
Definition: gls_event.h:145
Definition: gls_event.h:181
Definition: gls_event.h:277
Definition: gls_event.h:96
Definition: gls_event.h:137
Definition: gls_event.h:158
Definition: gls_event.h:258
Definition: gls_event.h:248
Definition: gls_event.h:225
Definition: gls_event.h:201
Definition: gls_event.h:75
Definition: gls_event.h:247
Definition: gls_event.h:179
Definition: gls_event.h:121
Definition: gls_event.h:246
Definition: gls_event.h:81
Definition: gls_event.h:164
Definition: gls_event.h:267
Definition: gls_event.h:123
Definition: gls_event.h:170
Definition: gls_event.h:259
Definition: gls_event.h:235
Definition: gls_event.h:255
Definition: gls_event.h:78
Definition: gls_event.h:134
Definition: gls_vertex.h:49
Definition: gls_event.h:186
Definition: gls_event.h:99
Definition: gls_event.h:211
Definition: gls_event.h:120
Definition: gls_event.h:157
GlsVector2D windowCoord
Definition: gls_event.h:284
Definition: gls_event.h:241
Definition: gls_event.h:65
Definition: gls_event.h:114
Definition: gls_event.h:160
Definition: gls_event.h:270
Definition: gls_event.h:243
bool GlsBool
Definition: gls_types.h:96
Definition: gls_event.h:253
Definition: gls_event.h:130
Definition: gls_event.h:216
Definition: gls_event.h:92
Definition: gls_event.h:171
Definition: gls_event.h:187
Definition: gls_event.h:93
Definition: gls_event.h:198
Definition: gls_event.h:152
Definition: gls_event.h:100
Definition: gls_event.h:182
KeyboardKey keyboardKey
Definition: gls_event.h:287
Definition: gls_event.h:199
Definition: gls_event.h:233
Definition: gls_event.h:59
Definition: gls_event.h:196
KeyboardModifier
Definition: gls_event.h:87
Definition: gls_event.h:180
Definition: gls_event.h:236
Definition: gls_event.h:178
Definition: gls_event.h:94
Definition: gls_event.h:207
Definition: gls_event.h:223
Definition: gls_event.h:185
Definition: gls_event.h:64
Definition: gls_event.h:154
Definition: gls_event.h:151
Definition: gls_event.h:266
Definition: gls_event.h:189
Definition: gls_event.h:229
Definition: gls_event.h:222
MouseButton
Definition: gls_event.h:73
Definition: gls_event.h:141
Definition: gls_event.h:251
Definition: gls_event.h:167
Definition: gls_event.h:192
Definition: gls_event.h:206
Definition: gls_event.h:58
Definition: gls_event.h:146
Definition: gls_event.h:226
Definition: gls_event.h:245
EventType eventType
Definition: gls_event.h:283
This header defines classes for working with 2D and 3D vectors, vertices and textured vertices in the...
Definition: gls_event.h:273
Definition: gls_event.h:110
Definition: gls_event.h:76
Definition: gls_event.h:218
Definition: gls_event.h:274
This header defines the basic types used by the GL Studio DO-178B Runtime Library.
Definition: gls_event.h:215
Definition: gls_event.h:153
Definition: gls_event.h:98
Definition: gls_event.h:221
Definition: gls_event.h:60
Definition: gls_event.h:79
Definition: gls_event.h:169
Definition: gls_event.h:217
Definition: gls_event.h:238
Definition: gls_event.h:262
virtual ~GlsEventDispatcher()
Definition: gls_event.h:275
Definition: gls_event.h:62
Definition: gls_event.h:214
Definition: gls_event.h:139
Definition: gls_event.h:103
Definition: gls_event.h:257
Definition: gls_event.h:230
Definition: gls_event.h:161
Definition: gls_event.h:227
GlsUInt32 keyboardModifier
Definition: gls_event.h:286
Definition: gls_event.h:124
Definition: gls_event.h:174
Definition: gls_event.h:195
KeyboardKey
Definition: gls_event.h:107
GlsUInt32 userData
Definition: gls_event.h:288
Definition: gls_event.h:162
Definition: gls_event.h:91
Definition: gls_event.h:265
Definition: gls_event.h:173
Definition: gls_event.h:250
Definition: gls_event.h:116
Definition: gls_event.h:82
Definition: gls_display_object.h:64
Definition: gls_event.h:177
Definition: gls_event.h:194
Definition: gls_event.h:172