1 namespace gui::drivers;
3 #ifdef BUILDING_ECERE_COM
8 public import static "ecere"
18 // source file line number printf (sflnprintf)
19 #define sflnprintf(format,...) printf("%s:% 5d: " format, __FILE__, __LINE__, ##__VA_ARGS__)
21 #define property _property
24 //#include <GLES2/gl2.h>
26 #include <emscripten/emscripten.h>
32 class EmscriptenInterface : Interface
34 class_property(name) = "Emscripten";
37 // --- User Interface System ---
41 sflnprintf("class(EmscriptenInterface) ::Initialize [STUB!]\n");
42 guiApp.desktop.ExternalPosition(0,0, 640, 480);
48 sflnprintf("class(EmscriptenInterface) ::Terminate [STUB!]\n");
51 bool ::ProcessInput(bool processAll)
53 sflnprintf("class(EmscriptenInterface) ::ProcessInput [STUB!]\n");
59 sflnprintf("class(EmscriptenInterface) ::Wait [STUB!]\n");
62 void ::Lock(Window window)
64 sflnprintf("class(EmscriptenInterface) ::Lock [STUB!]\n");
67 void ::Unlock(Window window)
69 sflnprintf("class(EmscriptenInterface) ::Unlock [STUB!]\n");
72 void ::SetTimerResolution(uint hertz)
74 sflnprintf("class(EmscriptenInterface) ::SetTimerResolution [STUB!] Implement high resolution timer here\n");
77 const char ** ::GraphicsDrivers(int * numDrivers)
79 //sflnprintf("class(EmscriptenInterface) ::GraphicsDrivers [STUB!]\n");
80 static const char *graphicsDrivers[] = { "OpenGL" };
81 *numDrivers = sizeof(graphicsDrivers) / sizeof(char *);
82 return (const char **)graphicsDrivers;
86 void ::EnsureFullScreen(bool * fullScreen)
88 sflnprintf("class(EmscriptenInterface) ::EnsureFullScreen [STUB!]\n");
92 void ::GetCurrentMode(bool * fullScreen, Resolution * resolution, PixelFormat * colorDepth, int * refreshRate)
94 sflnprintf("class(EmscriptenInterface) ::GetCurrentMode [STUB!]\n");
97 bool ::ScreenMode(bool fullScreen, Resolution resolution, PixelFormat colorDepth, int refreshRate, bool * textMode)
99 sflnprintf("class(EmscriptenInterface) ::ScreenMode [STUB!]\n");
104 // --- Window Creation ---
106 void * ::CreateRootWindow(Window window)
108 sflnprintf("class(EmscriptenInterface) ::CreateRootWindow [STUB!]\n");
112 void ::DestroyRootWindow(Window window)
114 sflnprintf("class(EmscriptenInterface) ::DestroyRootWindow [STUB!]\n");
118 // --- Window manipulation ---
120 void ::SetRootWindowCaption(Window window, const char * name)
122 sflnprintf("class(EmscriptenInterface) ::SetRootWindowCaption [STUB!]\n");
125 void ::PositionRootWindow(Window window, int x, int y, int w, int h, bool move, bool resize)
127 sflnprintf("class(EmscriptenInterface) ::Stub [STUB!]\n");
130 void ::OffsetWindow(Window window, int * x, int * y)
132 sflnprintf("class(EmscriptenInterface) ::OffsetWindow [STUB!]\n");
135 void ::UpdateRootWindow(Window window)
137 sflnprintf("class(EmscriptenInterface) ::UpdateRootWindow [STUB!]\n");
140 void ::SetRootWindowState(Window window, WindowState state, bool visible)
142 sflnprintf("class(EmscriptenInterface) ::SetRootWindowState [STUB!]\n");
145 void ::ActivateRootWindow(Window window)
147 sflnprintf("class(EmscriptenInterface) ::ActivateRootWindow [STUB!]\n");
150 void ::OrderRootWindow(Window window, bool topMost)
152 sflnprintf("class(EmscriptenInterface) ::OrderRootWindow [STUB!]\n");
155 void ::SetRootWindowColor(Window window)
157 sflnprintf("class(EmscriptenInterface) ::SetRootWindowColor [STUB!]\n");
160 void ::FlashRootWindow(Window window)
162 sflnprintf("class(EmscriptenInterface) ::FlashRootWindow [STUB!]\n");
166 // --- Mouse-based window movement ---
168 void ::StartMoving(Window window, int x, int y, bool fromKeyBoard)
170 sflnprintf("class(EmscriptenInterface) ::StartMoving [STUB!]\n");
173 void ::StopMoving(Window window)
175 sflnprintf("class(EmscriptenInterface) ::StopMoving [STUB!]\n");
179 // --- Mouse manipulation ---
181 void ::GetMousePosition(int *x, int *y)
183 sflnprintf("class(EmscriptenInterface) ::GetMousePosition [STUB!]\n");
186 void ::SetMousePosition(int x, int y)
188 sflnprintf("class(EmscriptenInterface) ::SetMousePosition [STUB!]\n");
191 void ::SetMouseRange(Window window, Box box)
193 sflnprintf("class(EmscriptenInterface) ::SetMouseRange [STUB!]\n");
196 void ::SetMouseCapture(Window window)
198 sflnprintf("class(EmscriptenInterface) ::SetMouseCapture [STUB!]\n");
202 // --- Mouse cursor ---
204 void ::SetMouseCursor(Window window, SystemCursor cursor)
206 sflnprintf("class(EmscriptenInterface) ::SetMouseCursor [STUB!]\n");
210 // --- Caret manipulation ---
212 void ::SetCaret(int caretX, int caretY, int size)
214 sflnprintf("class(EmscriptenInterface) ::SetCaret [STUB!]\n");
218 // --- Clipboard manipulation ---
220 void ::ClearClipboard()
222 sflnprintf("class(EmscriptenInterface) ::ClearClipboard [STUB!]\n");
225 bool ::AllocateClipboard(ClipBoard clipBoard, uint size)
227 sflnprintf("class(EmscriptenInterface) ::AllocateClipboard [STUB!]\n");
231 bool ::SaveClipboard(ClipBoard clipBoard)
233 sflnprintf("class(EmscriptenInterface) ::SaveClipboard [STUB!]\n");
237 bool ::LoadClipboard(ClipBoard clipBoard)
239 sflnprintf("class(EmscriptenInterface) ::LoadClipboard [STUB!]\n");
243 void ::UnloadClipboard(ClipBoard clipBoard)
245 sflnprintf("class(EmscriptenInterface) ::UnloadClipboard [STUB!]\n");
249 // --- State based input ---
251 bool ::AcquireInput(Window window, bool state)
253 sflnprintf("class(EmscriptenInterface) ::AcquireInput [STUB!]\n");
257 bool ::GetMouseState(MouseButtons * buttons, int * x, int * y)
259 sflnprintf("class(EmscriptenInterface) ::GetMouseState [STUB!]\n");
263 bool ::GetJoystickState(int device, Joystick joystick)
265 sflnprintf("class(EmscriptenInterface) ::GetJoystickState [STUB!]\n");
269 bool ::GetKeyState(Key key)
271 sflnprintf("class(EmscriptenInterface) ::GetKeyState [STUB!]\n");
275 bool ::SetIcon(Window window, BitmapResource icon)
277 sflnprintf("class(EmscriptenInterface) ::SetIcon [STUB!]\n");
281 void ::GetScreenArea(Window window, Box box)
283 sflnprintf("class(EmscriptenInterface) ::GetScreenArea [STUB!]\n");