libghostty-vt
0.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
mouse/event.h
Go to the documentation of this file.
1
6
7
#ifndef GHOSTTY_VT_MOUSE_EVENT_H
8
#define GHOSTTY_VT_MOUSE_EVENT_H
9
10
#include <stdbool.h>
11
#include <
ghostty/vt/allocator.h
>
12
#include <
ghostty/vt/key/event.h
>
13
#include <
ghostty/vt/types.h
>
14
23
typedef
struct
GhosttyMouseEventImpl *
GhosttyMouseEvent
;
24
30
typedef
enum
GHOSTTY_ENUM_TYPED
{
32
GHOSTTY_MOUSE_ACTION_PRESS
= 0,
33
35
GHOSTTY_MOUSE_ACTION_RELEASE
= 1,
36
38
GHOSTTY_MOUSE_ACTION_MOTION
= 2,
39
GHOSTTY_MOUSE_ACTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
40
}
GhosttyMouseAction
;
41
47
typedef
enum
GHOSTTY_ENUM_TYPED
{
48
GHOSTTY_MOUSE_BUTTON_UNKNOWN = 0,
49
GHOSTTY_MOUSE_BUTTON_LEFT = 1,
50
GHOSTTY_MOUSE_BUTTON_RIGHT = 2,
51
GHOSTTY_MOUSE_BUTTON_MIDDLE = 3,
52
GHOSTTY_MOUSE_BUTTON_FOUR = 4,
53
GHOSTTY_MOUSE_BUTTON_FIVE = 5,
54
GHOSTTY_MOUSE_BUTTON_SIX = 6,
55
GHOSTTY_MOUSE_BUTTON_SEVEN = 7,
56
GHOSTTY_MOUSE_BUTTON_EIGHT = 8,
57
GHOSTTY_MOUSE_BUTTON_NINE = 9,
58
GHOSTTY_MOUSE_BUTTON_TEN = 10,
59
GHOSTTY_MOUSE_BUTTON_ELEVEN = 11,
60
GHOSTTY_MOUSE_BUTTON_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
61
}
GhosttyMouseButton
;
62
68
typedef
struct
{
69
float
x;
70
float
y;
71
}
GhosttyMousePosition
;
72
82
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_new
(
const
GhosttyAllocator
*allocator,
83
GhosttyMouseEvent
*event);
84
92
GHOSTTY_API
void
ghostty_mouse_event_free
(
GhosttyMouseEvent
event);
93
105
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_set_action
(
GhosttyMouseEvent
event,
106
GhosttyMouseAction
action);
107
116
GHOSTTY_API
GhosttyMouseAction
ghostty_mouse_event_get_action
(
GhosttyMouseEvent
event);
117
133
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_set_button
(
GhosttyMouseEvent
event,
134
GhosttyMouseButton
button);
135
147
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_clear_button
(
GhosttyMouseEvent
event);
148
180
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_get_button
(
GhosttyMouseEvent
event,
181
GhosttyMouseButton
*out_button);
182
193
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_set_mods
(
GhosttyMouseEvent
event,
194
GhosttyMods
mods);
195
204
GHOSTTY_API
GhosttyMods
ghostty_mouse_event_get_mods
(
GhosttyMouseEvent
event);
205
216
GHOSTTY_API
GhosttyResult
ghostty_mouse_event_set_position
(
GhosttyMouseEvent
event,
217
GhosttyMousePosition
position);
218
227
GHOSTTY_API
GhosttyMousePosition
ghostty_mouse_event_get_position
(
GhosttyMouseEvent
event);
228
229
#endif
/* GHOSTTY_VT_MOUSE_EVENT_H */
allocator.h
GhosttyResult
GhosttyResult
Definition
types.h:143
GHOSTTY_ENUM_TYPED
#define GHOSTTY_ENUM_TYPED
Definition
types.h:124
GhosttyMods
uint16_t GhosttyMods
Definition
key/event.h:57
ghostty_mouse_event_set_action
GHOSTTY_API GhosttyResult ghostty_mouse_event_set_action(GhosttyMouseEvent event, GhosttyMouseAction action)
ghostty_mouse_event_set_mods
GHOSTTY_API GhosttyResult ghostty_mouse_event_set_mods(GhosttyMouseEvent event, GhosttyMods mods)
ghostty_mouse_event_free
GHOSTTY_API void ghostty_mouse_event_free(GhosttyMouseEvent event)
ghostty_mouse_event_set_position
GHOSTTY_API GhosttyResult ghostty_mouse_event_set_position(GhosttyMouseEvent event, GhosttyMousePosition position)
GhosttyMouseButton
GhosttyMouseButton
Definition
mouse/event.h:47
ghostty_mouse_event_set_button
GHOSTTY_API GhosttyResult ghostty_mouse_event_set_button(GhosttyMouseEvent event, GhosttyMouseButton button)
GhosttyMouseEvent
struct GhosttyMouseEventImpl * GhosttyMouseEvent
Definition
mouse/event.h:23
ghostty_mouse_event_get_mods
GHOSTTY_API GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event)
ghostty_mouse_event_new
GHOSTTY_API GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator, GhosttyMouseEvent *event)
ghostty_mouse_event_get_button
GHOSTTY_API GhosttyResult ghostty_mouse_event_get_button(GhosttyMouseEvent event, GhosttyMouseButton *out_button)
ghostty_mouse_event_get_action
GHOSTTY_API GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event)
GhosttyMouseAction
GhosttyMouseAction
Definition
mouse/event.h:30
ghostty_mouse_event_get_position
GHOSTTY_API GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event)
ghostty_mouse_event_clear_button
GHOSTTY_API GhosttyResult ghostty_mouse_event_clear_button(GhosttyMouseEvent event)
GHOSTTY_MOUSE_ACTION_PRESS
@ GHOSTTY_MOUSE_ACTION_PRESS
Definition
mouse/event.h:32
GHOSTTY_MOUSE_ACTION_RELEASE
@ GHOSTTY_MOUSE_ACTION_RELEASE
Definition
mouse/event.h:35
GHOSTTY_MOUSE_ACTION_MOTION
@ GHOSTTY_MOUSE_ACTION_MOTION
Definition
mouse/event.h:38
event.h
GhosttyAllocator
Definition
allocator.h:164
GhosttyMousePosition
Definition
mouse/event.h:68
types.h
include
ghostty
vt
mouse
event.h
Generated by
1.17.0