docs/html/glEvents_8h_source.html
| | Jetson Inference
DNN Vision Library |
glEvents.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23 #ifndef __GL_USER_EVENT_H__
24 #define __GL_USER_EVENT_H__
25
26
32 #define KEY_PRESSED 1
33
39 #define KEY_RELEASED 0
40
45 #define KEY_OFFSET 0xff00
46
52 #define MOUSE_PRESSED 1
53
59 #define MOUSE_RELEASED 0
60
66 #define MOUSE_LEFT 1
67
73 #define MOUSE_MIDDLE 2
74
80 #define MOUSE_RIGHT 3
81
87 #define MOUSE_WHEEL_UP 4
88
94 #define MOUSE_WHEEL_DOWN 5
95
96
112 enum glEventType
113 {
124MOUSE_MOVE = 0,
125
137
153
165
171
185
198
208
218
228
244
260
268
274 };
275
276
291 typedef bool (*glEventHandler)(uint16_t event, int a, int b, void* user);
292
293
301 void glRegisterEvents( glEventHandler callback, void* user=NULL, uint32_t display=0 );
302
303
310 void glUnregisterEvents( glEventHandler callback, void* user=NULL );
311
312
313 #endif
314
@ WIDGET_SELECTED
Message indicating that a widget has been selected (e.g.
Definition: glEvents.h:227
@ MOUSE_ABSOLUTE
Message when the mouse has moved (absolute coordinates)
Definition: glEvents.h:136
@ KEY_STATE
Message when a key state has changed (raw, without modifiers applied)
Definition: glEvents.h:184
@ KEY_MODIFIED
Message when a key has been pressed or released (with modifiers applied)
Definition: glEvents.h:197
@ WINDOW_RESIZED
Message indicating that the window has been resized.
Definition: glEvents.h:267
void glUnregisterEvents(glEventHandler callback, void *user=NULL)
Unregister an event message handler from being called with events.
@ WIDGET_RESIZED
Message from a widget indicating that it's been resized.
Definition: glEvents.h:259
@ MOUSE_BUTTON
Message when a mouse button has been pressed/released.
Definition: glEvents.h:152
@ MOUSE_WHEEL
Message when the mouse wheel has been scrolled a = -1 for scrolled up, or +1 for scrolled down.
Definition: glEvents.h:170
@ WIDGET_MOVED
Message from a widget indicating that it's been moved by the user.
Definition: glEvents.h:243
bool(* glEventHandler)(uint16_t event, int a, int b, void *user)
Event message handler callback for recieving UI messages from a window.
Definition: glEvents.h:291
void glRegisterEvents(glEventHandler callback, void *user=NULL, uint32_t display=0)
Register an event message handler that will be called with events.
@ WINDOW_CLOSED
Message indicating that the window is closing.
Definition: glEvents.h:273
glEventType
User interface event message types.
Definition: glEvents.h:112
@ MOUSE_DRAG
Message when the left mouse button has been dragged.
Definition: glEvents.h:164
@ KEY_CHAR
Message when a keyboard ASCII character (0-255) was entered.
Definition: glEvents.h:207
@ MOUSE_MOVE
Message when the mouse has moved (relative coordinates)
Definition: glEvents.h:124
@ WIDGET_CREATED
Message indicating that a widget has been created (e.g.
Definition: glEvents.h:217