-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.c3i
180 lines (103 loc) · 7.24 KB
/
window.c3i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
module glfw::window;
import glfw::monitor;
import glfw::input;
import glfw::keyboard;
import glfw::mouse;
distinct Window = void*;
def PositionCallback = fn void(Window window, CInt x, CInt y);
def SizeCallback = fn void(Window window, CInt width, CInt height);
def CloseCallback = fn void(Window window);
def RefreshCallback = fn void(Window window);
def FocusCallback = fn void(Window window, CBool focused);
def IconifyCallback = fn void(Window window, CBool iconified);
def MaximizedCallback = fn void(Window window, CBool maximized);
def FramebufferSizeCallback = fn void(Window window, CInt width, CInt height);
def ContentScaleCallback = fn void(Window window, float x, float y);
def MouseButtonCallback = fn void(Window window, Button button, Action action, Modifiers modifiers);
def CursorPositionCallback = fn void(Window window, double x, double y);
def CursorEnterCallback = fn void(Window window, CBool entered);
def ScrollCallback = fn void(Window window, double x, double y);
def KeyCallback = fn void(Window window, Key key, Scancode scancode, Action action, Modifiers modifiers);
def CharacterCallback = fn void(Window window, CodePoint codepoint);
def CharacterModifiersCallback = fn void(Window window, CodePoint codepoint, Modifiers modifiers);
def DropCallback = fn void(Window window, CInt pathCount, ZString* paths);
fn Window createWindow(CInt width, CInt height, ZString title,
monitor::Monitor monitor = null, Window share = null) @extern("glfwCreateWindow");
fn void Window.destroy(Window window) @extern("glfwDestroyWindow");
fn CInt Window.shouldClose(Window window) @extern("glfwWindowShouldClose");
fn void Window.setShouldClose(Window window, CBool close) @extern("glfwSetWindowShouldClose");
fn ZString Window.getTitle(Window window) @extern("glfwGetWindowTitle");
fn void Window.setTitle(Window window, ZString title) @extern("glfwSetWindowTitle");
fn void Window.setIcon(Window window, CInt count, Image* images) @extern("glfwSetWindowIcon");
fn void Window.getPosition(Window window, CInt* x, CInt* y) @extern("glfwGetWindowPos");
fn void Window.setPosition(Window window, CInt x, CInt y) @extern("glfwSetWindowPos");
fn void Window.getSize(Window window, CInt* width, CInt* height) @extern("glfwGetWindowSize");
fn void Window.setSizeLimits(Window window,
CInt minWidth, CInt minHeight, CInt maxWidth, CInt maxHeight) @extern("glfwSetWindowSizeLimits");
fn void Window.setAspectRatio(Window window,
CInt numerator, CInt denominator) @extern("glfwSetWindowAspectRatio");
fn void Window.setSize(Window window, CInt width, CInt height) @extern("glfwSetWindowSize");
fn void Window.getFramebufferSize(Window window, CInt* width, CInt* height) @extern("glfwGetFramebufferSize");
fn void Window.getFrameSize(Window window,
CInt* left, CInt* top, CInt* right, CInt* bottom) @extern("glfwGetFrameSize");
fn void Window.getContentScale(Window window, float* x, float* y) @extern("glfwGetWindowContentScale");
fn float Window.getOpacity(Window window) @extern("glfwGetWindowOpacity");
fn void Window.setOpacity(Window window, float opacity) @extern("glfwSetWindowOpacity");
fn float Window.iconify(Window window) @extern("glfwIconifyWindow");
fn float Window.restore(Window window) @extern("glfwRestoreWindow");
fn float Window.maximize(Window window) @extern("glfwMaximizeWindow");
fn float Window.show(Window window) @extern("glfwShowWindow");
fn float Window.hide(Window window) @extern("glfwHideWindow");
fn float Window.focus(Window window) @extern("glfwFocusWindow");
fn float Window.requestAttention(Window window) @extern("glfwRequestWindowAttention");
fn Monitor Window.getMonitor(Window window) @extern("glfwGetWindowMonitor");
fn void Window.setMonitor(Window window, Monitor monitor,
CInt x, CInt y, CInt width, CInt height, CInt refreshRate) @extern("glfwSetWindowMonitor");
fn CBool Window.getAttribute(Window window, WindowAttribute attribute) @extern("glfwGetWindowAttrib");
fn void Window.setAttribute(Window window,
WindowAttribute attribute, CBool value) @extern("glfwSetWindowAttrib");
fn UserPointer Window.setUserPointer(Window window, UserPointer pointer) @extern("glfwSetWindowUserPointer");
fn UserPointer Window.getUserPointer(Window window) @extern("glfwGetWindowUserPointer");
fn PositionCallback Window.setPositionCallback(Window window,
PositionCallback callback) @extern("glfwSetWindowPosCallback");
fn SizeCallback Window.setSizeCallback(Window window,
SizeCallback callback) @extern("glfwSetWindowSizeCallback");
fn CloseCallback Window.setCloseCallback(Window window,
CloseCallback callback) @extern("glfwSetWindowCloseCallback");
fn RefreshCallback Window.setRefreshCallback(Window window,
RefreshCallback callback) @extern("glfwSetWindowRefreshCallback");
fn FocusCallback Window.setFocusCallback(Window window,
FocusCallback callback) @extern("glfwSetWindowFocusCallback");
fn IconifyCallback Window.setIconifyCallback(Window window,
IconifyCallback callback) @extern("glfwSetWindowIconifyCallback");
fn MaximizedCallback Window.setMaximizeCallback(Window window,
MaximizedCallback callback) @extern("glfwSetWindowMaximizeCallback");
fn FramebufferSizeCallback Window.setFramebufferSizeCallback(Window window,
FramebufferSizeCallback callback) @extern("glfwSetFramebufferSizeCallback");
fn ContentScaleCallback Window.setContentScaleCallback(Window window,
ContentScaleCallback callback) @extern("glfwSetWindowContentScaleCallback");
fn CInt Window.getInputMode(Window window, InputMode mode) @extern("glfwGetInputMode");
fn CBool Window.setInputMode(Window window, InputMode mode, CInt value) @extern("glfwSetInputMode");
fn Action Window.getKey(Window window, Key key) @extern("glfwGetKey");
fn Action Window.getMouseButton(Window window, Button button) @extern("glfwGetMouseButton");
fn void Window.getCursorPosition(Window window, double* x, double* y) @extern("glfwGetCursorPos");
fn void Window.setCursorPosition(Window window, double x, double y) @extern("glfwSetCursorPos");
fn void Window.setCursor(Window window, Cursor cursor) @extern("glfwSetCursor");
fn KeyCallback Window.setKeyCallback(Window window,
KeyCallback callback) @extern("glfwSetKeyCallback");
fn CharacterCallback Window.setChararacterCallback(Window window,
CharacterCallback callback) @extern("glfwSetCharCallback");
fn CharacterModifiersCallback Window.setChararacterModifiersCallback(Window window,
CharacterModifiersCallback callback) @extern("glfwSetCharModsCallback");
fn MouseButtonCallback Window.setMouseButtonCallback(Window window,
MouseButtonCallback callback) @extern("glfwSetMouseButtonCallback");
fn CursorPositionCallback Window.setCursorPositionCallback(Window window,
CursorPositionCallback callback) @extern("glfwSetCursorPosCallback");
fn CursorEnterCallback Window.setCursorEnterCallback(Window window,
CursorEnterCallback callback) @extern("glfwSetCursorEnterCallback");
fn ScrollCallback Window.setScrollCallback(Window window,
ScrollCallback callback) @extern("glfwSetScrollCallback");
fn DropCallback Window.setDropCallback(Window window,
DropCallback callback) @extern("glfwSetDropCallback");
fn void Window.setClipboardString(Window window, ZString string) @extern("glfwSetClipboardString");
fn ZString Window.getClipboardString(Window window) @extern("glfwGetClipboardString");