 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_UI_INTERFACE_H
26 #define SHKZ_UI_INTERFACE_H
33 static bool *g_shkz_has_graphical_interface {
nullptr};
173 switch( event.
type ) {
187 drag(event.
x,event.
y,event.
z,event.
u,event.
v,event.
w);
247 if( ! g_shkz_has_graphical_interface ) {
248 g_shkz_has_graphical_interface =
static_cast<bool *
>(::dlsym(RTLD_DEFAULT,
"g_shkz_has_graphical_interface"));
249 assert(g_shkz_has_graphical_interface);
251 return *g_shkz_has_graphical_interface;
264 virtual void resize(
int width,
int height ) {}
282 virtual bool keyboard(
int key,
int action,
int mods ) {
return false; }
293 virtual void cursor(
double x,
double y,
double z ) {};
304 virtual void mouse(
double x,
double y,
double z,
int button,
int action,
int mods ) {};
313 virtual void scroll(
double xoffset,
double yoffset ) {};
328 virtual void drag(
double x,
double y,
double z,
double u,
double v,
double w ) {};
@ MOD_SHIFT
Shift modifier bit.
Definition: UI_interface.h:60
@ RESIZE
Resize event.
Definition: UI_interface.h:118
EVENT_TYPE
Event type.
Definition: UI_interface.h:100
virtual bool relay_event(const event_structure &event) const
Get if the event shoule be relayed to other instances after handle_event of this instance is called.
Definition: UI_interface.h:207
@ REPEAT
Repeat event.
Definition: UI_interface.h:52
virtual void resize(int width, int height)
Function that catches window resizing events.
Definition: UI_interface.h:264
MODIFIER
Modifier bits.
Definition: UI_interface.h:57
@ MOD_ALT
ALT modifier bit.
Definition: UI_interface.h:66
ACTION
Key and mose action type.
Definition: UI_interface.h:43
double x
X coordinate value.
Definition: UI_interface.h:146
@ MOD_CAPS_LOCK
Capslock modifier bit.
Definition: UI_interface.h:72
@ KEYBOARD
Keyboard event.
Definition: UI_interface.h:103
int width
Width.
Definition: UI_interface.h:140
@ DRAG
Drag event.
Definition: UI_interface.h:115
static bool has_graphical_interface()
Get if a graphical interface is available.
Definition: UI_interface.h:246
@ MIDDLE
Middle button.
Definition: UI_interface.h:89
double y
Y coordinate value.
Definition: UI_interface.h:149
double z
Z coordinate value.
Definition: UI_interface.h:152
virtual bool handle_event(const event_structure &event)
Definition: UI_interface.h:172
double w
Z coordinate displacement value.
Definition: UI_interface.h:161
int mods
Modifier information.
Definition: UI_interface.h:137
int height
Height.
Definition: UI_interface.h:143
@ IBEAM_CURSOR
Text input I beam cursor.
Definition: UI_interface.h:220
@ RELEASE
Release event.
Definition: UI_interface.h:46
int key
Key type.
Definition: UI_interface.h:131
CURSOR_TYPE
Cursor icon type.
Definition: UI_interface.h:211
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
virtual bool keyboard(int key, int action, int mods)
Function that catches key down event.
Definition: UI_interface.h:282
@ DRAW
Draw event.
Definition: UI_interface.h:121
@ VRESIZE_CURSOR
Vertical resizing cursor.
Definition: UI_interface.h:229
@ SCROLL
Scroll event.
Definition: UI_interface.h:112
int button
Button type.
Definition: UI_interface.h:128
@ MOD_SUPER
SUPER modifier bit.
Definition: UI_interface.h:69
@ MOD_CONTROL
Control modifier bit.
Definition: UI_interface.h:63
virtual void mouse(double x, double y, double z, int button, int action, int mods)
Function that catches mouse event.
Definition: UI_interface.h:304
@ HAND_CURSOR
Hand cursor.
Definition: UI_interface.h:217
Event information structure.
Definition: UI_interface.h:96
@ MOUSE
Mouse event.
Definition: UI_interface.h:109
int action
Action type.
Definition: UI_interface.h:134
@ MOD_NUM_LOCK
NUM lock modifier bit.
Definition: UI_interface.h:75
EVENT_TYPE type
Event type.
Definition: UI_interface.h:125
Interface for input APIs.
Definition: UI_interface.h:38
virtual void drag(double x, double y, double z, double u, double v, double w)
Function that catches drag event.
Definition: UI_interface.h:328
double v
Y coordinate displacement value.
Definition: UI_interface.h:158
@ PRESS
Press event.
Definition: UI_interface.h:49
@ RIGHT
Right button.
Definition: UI_interface.h:86
@ CROSSHAIR_CURSOR
Cross hair cursor.
Definition: UI_interface.h:223
double u
X coordinate displacement value.
Definition: UI_interface.h:155
@ CURSOR
Cursor event.
Definition: UI_interface.h:106
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
@ LEFT
Left button.
Definition: UI_interface.h:83
virtual void cursor(double x, double y, double z)
Function that catches passive cursor event.
Definition: UI_interface.h:293
@ HRESIZE_CURSOR
Horizontal resizing cursor.
Definition: UI_interface.h:226
virtual void scroll(double xoffset, double yoffset)
Function that catches scroll event.
Definition: UI_interface.h:313
@ ARROW_CURSOR
Regular arrow cursor.
Definition: UI_interface.h:214
Interface for handling drawing operations.
Definition: graphics_engine.h:38
graphics_engine * g
Pointer to the graphics engine.
Definition: UI_interface.h:164
virtual void draw(graphics_engine &g) const
Function that catches draw event.
Definition: UI_interface.h:271
MOUSE_BUTTON
Mouse button type.
Definition: UI_interface.h:80
virtual CURSOR_TYPE get_current_cursor() const
Get current cursor icon.
Definition: UI_interface.h:237