Interface for input APIs.
More...
#include <UI_interface.h>
|
| enum | ACTION { RELEASE = 0,
PRESS = 1,
REPEAT = 2
} |
| | Key and mose action type. More...
|
| |
| enum | MODIFIER {
MOD_SHIFT = 0x0001,
MOD_CONTROL = 0x0002,
MOD_ALT = 0x0004,
MOD_SUPER = 0x0008,
MOD_CAPS_LOCK = 0x0010,
MOD_NUM_LOCK = 0x0020
} |
| | Modifier bits. More...
|
| |
| enum | MOUSE_BUTTON { LEFT = 1,
RIGHT = 2,
MIDDLE = 3
} |
| | Mouse button type. More...
|
| |
| enum | CURSOR_TYPE {
ARROW_CURSOR = 0,
HAND_CURSOR = 1,
IBEAM_CURSOR = 2,
CROSSHAIR_CURSOR = 3,
HRESIZE_CURSOR = 4,
VRESIZE_CURSOR = 5
} |
| | Cursor icon type. More...
|
| |
|
| virtual void | resize (int width, int height) |
| | Function that catches window resizing events. More...
|
| |
| virtual void | draw (graphics_engine &g) const |
| | Function that catches draw event. More...
|
| |
| virtual bool | keyboard (int key, int action, int mods) |
| | Function that catches key down event. More...
|
| |
| virtual void | cursor (double x, double y, double z) |
| | Function that catches passive cursor event. More...
|
| |
| virtual void | mouse (double x, double y, double z, int button, int action, int mods) |
| | Function that catches mouse event. More...
|
| |
| virtual void | scroll (double xoffset, double yoffset) |
| | Function that catches scroll event. More...
|
| |
| virtual void | drag (double x, double y, double z, double u, double v, double w) |
| | Function that catches drag event. More...
|
| |
Interface for input APIs.
◆ ACTION
Key and mose action type.
| Enumerator |
|---|
| RELEASE | Release event.
|
| PRESS | Press event.
|
| REPEAT | Repeat event.
|
◆ CURSOR_TYPE
Cursor icon type.
| Enumerator |
|---|
| ARROW_CURSOR | Regular arrow cursor.
|
| HAND_CURSOR | Hand cursor.
|
| IBEAM_CURSOR | Text input I beam cursor.
|
| CROSSHAIR_CURSOR | Cross hair cursor.
|
| HRESIZE_CURSOR | Horizontal resizing cursor.
|
| VRESIZE_CURSOR | Vertical resizing cursor.
|
◆ MODIFIER
Modifier bits.
| Enumerator |
|---|
| MOD_SHIFT | Shift modifier bit.
|
| MOD_CONTROL | Control modifier bit.
|
| MOD_ALT | ALT modifier bit.
|
| MOD_SUPER | SUPER modifier bit.
|
| MOD_CAPS_LOCK | Capslock modifier bit.
|
| MOD_NUM_LOCK | NUM lock modifier bit.
|
◆ MOUSE_BUTTON
Mouse button type.
| Enumerator |
|---|
| LEFT | Left button.
|
| RIGHT | Right button.
|
| MIDDLE | Middle button.
|
◆ cursor()
| virtual void UI_interface::cursor |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches passive cursor event.
- Parameters
-
| [in] | x | Cursor position on x pixel coordinate. |
| [in] | y | Cursor position on y pixel coordinate. |
| [in] | z | Cursor position on y pixel coordinate. |
◆ drag()
| virtual void UI_interface::drag |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
double |
u, |
|
|
double |
v, |
|
|
double |
w |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches drag event.
- Parameters
-
| [in] | x | Cursor position on x pixel coordinate. |
| [in] | y | Cursor position on y pixel coordinate. |
| [in] | u | Drag vector on x pixel coordinate. |
| [in] | v | Drag vector on y pixel coordinate. |
| [in] | w | Drag vector on z pixel coordinate. |
◆ draw()
Function that catches draw event.
- Parameters
-
◆ get_current_cursor()
| virtual CURSOR_TYPE UI_interface::get_current_cursor |
( |
| ) |
const |
|
inlinevirtual |
Get current cursor icon.
- Returns
- Current icon.
Reimplemented in drawable.
◆ handle_event()
Handle an UI input event.
- Parameters
-
Reimplemented in drawable.
◆ has_graphical_interface()
| static bool UI_interface::has_graphical_interface |
( |
| ) |
|
|
inlinestatic |
Get if a graphical interface is available.
- Parameters
-
| [in] | value | Boolean value to set force single thread. |
◆ keyboard()
| virtual bool UI_interface::keyboard |
( |
int |
key, |
|
|
int |
action, |
|
|
int |
mods |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches key down event.
- Parameters
-
| [in] | key | Capitalized key. |
| [in] | action | Action code. |
| [in] | mods | Modifier bits. |
◆ mouse()
| virtual void UI_interface::mouse |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
int |
button, |
|
|
int |
action, |
|
|
int |
mods |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches mouse event.
- Parameters
-
| [in] | button | Mouse button number. |
| [in] | action | Mouse action (Mouse down = 1 Mouse release = 0) |
| [in] | mods | Modifier bit. |
◆ relay_event()
| virtual bool UI_interface::relay_event |
( |
const event_structure & |
event | ) |
const |
|
inlinevirtual |
Get if the event shoule be relayed to other instances after handle_event of this instance is called.
- Parameters
-
| [in] | event | Corresponding event. |
- Returns
t/rue if the event should be relayed to others.
◆ resize()
| virtual void UI_interface::resize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches window resizing events.
- Parameters
-
| [in] | width | Width of the window. |
| [in] | height | Height of the window. |
◆ scroll()
| virtual void UI_interface::scroll |
( |
double |
xoffset, |
|
|
double |
yoffset |
|
) |
| |
|
inlineprotectedvirtual |
Function that catches scroll event.
- Parameters
-
| [in] | xoffset | X coordinate offset. |
| [in] | yoffset | Y coordinate offset. |
The documentation for this class was generated from the following file: