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>
27 #include <emscripten/html5.h>
35 static inline const char *emscripten_event_type_to_string(int eventType)
37 const char *events[] = { "(invalid)", "(none)", "keypress", "keydown", "keyup", "click", "mousedown", "mouseup", "dblclick", "mousemove", "wheel", "resize",
38 "scroll", "blur", "focus", "focusin", "focusout", "deviceorientation", "devicemotion", "orientationchange", "fullscreenchange", "pointerlockchange",
39 "visibilitychange", "touchstart", "touchend", "touchmove", "touchcancel", "gamepadconnected", "gamepaddisconnected", "beforeunload",
40 "batterychargingchange", "batterylevelchange", "webglcontextlost", "webglcontextrestored", "mouseenter", "mouseleave", "mouseover", "mouseout", "(invalid)" };
42 if (eventType < 0) eventType = 0;
43 if (eventType >= sizeof(events)/sizeof(events[0])) eventType = sizeof(events)/sizeof(events[0])-1;
44 return events[eventType];
47 const char *emscripten_result_to_string(EMSCRIPTEN_RESULT result)
49 if (result == EMSCRIPTEN_RESULT_SUCCESS) return "EMSCRIPTEN_RESULT_SUCCESS";
50 if (result == EMSCRIPTEN_RESULT_DEFERRED) return "EMSCRIPTEN_RESULT_DEFERRED";
51 if (result == EMSCRIPTEN_RESULT_NOT_SUPPORTED) return "EMSCRIPTEN_RESULT_NOT_SUPPORTED";
52 if (result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED) return "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED";
53 if (result == EMSCRIPTEN_RESULT_INVALID_TARGET) return "EMSCRIPTEN_RESULT_INVALID_TARGET";
54 if (result == EMSCRIPTEN_RESULT_UNKNOWN_TARGET) return "EMSCRIPTEN_RESULT_UNKNOWN_TARGET";
55 if (result == EMSCRIPTEN_RESULT_INVALID_PARAM) return "EMSCRIPTEN_RESULT_INVALID_PARAM";
56 if (result == EMSCRIPTEN_RESULT_FAILED) return "EMSCRIPTEN_RESULT_FAILED";
57 if (result == EMSCRIPTEN_RESULT_NO_DATA) return "EMSCRIPTEN_RESULT_NO_DATA";
58 return "Unknown EMSCRIPTEN_RESULT!";
64 public enum KeyCode : Key
85 leftParanthesis = 0x0A,
87 rightParanthesis = 0x0A,
147 // Function keys 1-10
179 keyPadPageDown = 0x51,
184 // KeyPadLess = 0x56,
221 // Remote Control Buttons
227 previousTrack = 0x206,
244 static KeyCode keys[256] =
249 0, // DOM_VK_CANCEL 0x03 ( 3) Cancel key.
252 0, // DOM_VK_HELP 0x06 ( 6) Help key.
254 backSpace, // DOM_VK_BACK_SPACE 0x08 ( 8) Backspace key.
255 tab, // DOM_VK_TAB 0x09 ( 9) Tab key.
258 0, // DOM_VK_CLEAR 0x0C ( 12) "5" key on Numpad when NumLock is unlocked. Or on Mac, clear key which is positioned at NumLock key.
259 enter, // DOM_VK_RETURN 0x0D ( 13) Return/enter key on the main keyboard.
260 0, // DOM_VK_ENTER 0x0E ( 14) Reserved, but not used. Obsolete since Gecko 30 (Dropped, see bug 969247.)
262 shift, // DOM_VK_SHIFT 0x10 ( 16) Shift key.
263 control, // DOM_VK_CONTROL 0x11 ( 17) Control key.
264 alt, // DOM_VK_ALT 0x12 ( 18) Alt (Option on Mac) key.
265 pauseBreak, // DOM_VK_PAUSE 0x13 ( 19) Pause key.
266 0, // DOM_VK_CAPS_LOCK 0x14 ( 20) Caps lock.
267 0, // DOM_VK_KANA 0x15 ( 21) Linux support for this keycode was added in Gecko 4.0. //0, // DOM_VK_HANGUL 0x15 (21) Linux support for this keycode was added in Gecko 4.0.
268 0, // DOM_VK_EISU 0x16 ( 22) "英数" key on Japanese Mac keyboard.
269 0, // DOM_VK_JUNJA 0x17 ( 23) Linux support for this keycode was added in Gecko 4.0.
270 0, // DOM_VK_FINAL 0x18 ( 24) Linux support for this keycode was added in Gecko 4.0.
271 0, // DOM_VK_HANJA 0x19 ( 25) Linux support for this keycode was added in Gecko 4.0. //0, // DOM_VK_KANJI 0x19 (25) Linux support for this keycode was added in Gecko 4.0.
273 escape, // DOM_VK_ESCAPE 0x1B ( 27) Escape key.
274 0, // DOM_VK_CONVERT 0x1C ( 28) Linux support for this keycode was added in Gecko 4.0.
275 0, // DOM_VK_NONCONVERT 0x1D ( 29) Linux support for this keycode was added in Gecko 4.0.
276 0, // DOM_VK_ACCEPT 0x1E ( 30) Linux support for this keycode was added in Gecko 4.0.
277 0, // DOM_VK_MODECHANGE 0x1F ( 31) Linux support for this keycode was added in Gecko 4.0.
278 0, // DOM_VK_SPACE 0x20 ( 32) Space bar.
279 pageUp, // DOM_VK_PAGE_UP 0x21 ( 33) Page Up key.
280 pageDown, // DOM_VK_PAGE_DOWN 0x22 ( 34) Page Down key.
281 end, // DOM_VK_END 0x23 ( 35) End key.
282 home, // DOM_VK_HOME 0x24 ( 36) Home key.
283 left, // DOM_VK_LEFT 0x25 ( 37) Left arrow.
284 up, // DOM_VK_UP 0x26 ( 38) Up arrow.
285 right, // DOM_VK_RIGHT 0x27 ( 39) Right arrow.
286 down, // DOM_VK_DOWN 0x28 ( 40) Down arrow.
287 0, // DOM_VK_SELECT 0x29 ( 41) Linux support for this keycode was added in Gecko 4.0.
288 0, // DOM_VK_PRINT 0x2A ( 42) Linux support for this keycode was added in Gecko 4.0.
289 0, // DOM_VK_EXECUTE 0x2B ( 43) Linux support for this keycode was added in Gecko 4.0.
290 printScreen, // DOM_VK_PRINTSCREEN 0x2C ( 44) Print Screen key.
291 insert, // DOM_VK_INSERT 0x2D ( 45) Ins(ert) key.
292 del, // DOM_VK_DELETE 0x2E ( 46) Del(ete) key.
294 k0, // DOM_VK_0 0x30 ( 48) "0" key in standard key location.
295 k1, // DOM_VK_1 0x31 ( 49) "1" key in standard key location.
296 k2, // DOM_VK_2 0x32 ( 50) "2" key in standard key location.
297 k3, // DOM_VK_3 0x33 ( 51) "3" key in standard key location.
298 k4, // DOM_VK_4 0x34 ( 52) "4" key in standard key location.
299 k5, // DOM_VK_5 0x35 ( 53) "5" key in standard key location.
300 k6, // DOM_VK_6 0x36 ( 54) "6" key in standard key location.
301 k7, // DOM_VK_7 0x37 ( 55) "7" key in standard key location.
302 k8, // DOM_VK_8 0x38 ( 56) "8" key in standard key location.
303 k9, // DOM_VK_9 0x39 ( 57) "9" key in standard key location.
304 colon, // DOM_VK_COLON 0x3A ( 58) Colon (":") key.
305 semicolon, // DOM_VK_SEMICOLON 0x3B ( 59) Semicolon (";") key.
306 smallerThan, // DOM_VK_LESS_THAN 0x3C ( 60) Less-than ("<") key.
307 equal, // DOM_VK_EQUALS 0x3D ( 61) Equals ("=") key.
308 greaterThan, // DOM_VK_GREATER_THAN 0x3E ( 62) Greater-than (">") key.
309 questionMark, // DOM_VK_QUESTION_MARK 0x3F ( 63) Question mark ("?") key.
310 0, // DOM_VK_AT 0x40 ( 64) Atmark ("@") key.
311 a, // DOM_VK_A 0x41 ( 65) "A" key.
312 b, // DOM_VK_B 0x42 ( 66) "B" key.
313 c, // DOM_VK_C 0x43 ( 67) "C" key.
314 d, // DOM_VK_D 0x44 ( 68) "D" key.
315 e, // DOM_VK_E 0x45 ( 69) "E" key.
316 f, // DOM_VK_F 0x46 ( 70) "F" key.
317 g, // DOM_VK_G 0x47 ( 71) "G" key.
318 h, // DOM_VK_H 0x48 ( 72) "H" key.
319 i, // DOM_VK_I 0x49 ( 73) "I" key.
320 j, // DOM_VK_J 0x4A ( 74) "J" key.
321 k, // DOM_VK_K 0x4B ( 75) "K" key.
322 l, // DOM_VK_L 0x4C ( 76) "L" key.
323 m, // DOM_VK_M 0x4D ( 77) "M" key.
324 n, // DOM_VK_N 0x4E ( 78) "N" key.
325 o, // DOM_VK_O 0x4F ( 79) "O" key.
326 p, // DOM_VK_P 0x50 ( 80) "P" key.
327 q, // DOM_VK_Q 0x51 ( 81) "Q" key.
328 r, // DOM_VK_R 0x52 ( 82) "R" key.
329 s, // DOM_VK_S 0x53 ( 83) "S" key.
330 t, // DOM_VK_T 0x54 ( 84) "T" key.
331 u, // DOM_VK_U 0x55 ( 85) "U" key.
332 v, // DOM_VK_V 0x56 ( 86) "V" key.
333 w, // DOM_VK_W 0x57 ( 87) "W" key.
334 x, // DOM_VK_X 0x58 ( 88) "X" key.
335 y, // DOM_VK_Y 0x59 ( 89) "Y" key.
336 z, // DOM_VK_Z 0x5A ( 90) "Z" key.
337 0, // DOM_VK_WIN 0x5B ( 91) Windows logo key on Windows. Or Super or Hyper key on Linux.
339 0, // DOM_VK_CONTEXT_MENU 0x5D ( 93) Opening context menu key.
341 0, // DOM_VK_SLEEP 0x5F ( 95) Linux support for this keycode was added in Gecko 4.0.
342 keyPad0, // DOM_VK_NUMPAD0 0x60 ( 96) "0" on the numeric keypad.
343 keyPad1, // DOM_VK_NUMPAD1 0x61 ( 97) "1" on the numeric keypad.
344 keyPad2, // DOM_VK_NUMPAD2 0x62 ( 98) "2" on the numeric keypad.
345 keyPad3, // DOM_VK_NUMPAD3 0x63 ( 99) "3" on the numeric keypad.
346 keyPad4, // DOM_VK_NUMPAD4 0x64 (100) "4" on the numeric keypad.
347 keyPad5, // DOM_VK_NUMPAD5 0x65 (101) "5" on the numeric keypad.
348 keyPad6, // DOM_VK_NUMPAD6 0x66 (102) "6" on the numeric keypad.
349 keyPad7, // DOM_VK_NUMPAD7 0x67 (103) "7" on the numeric keypad.
350 keyPad8, // DOM_VK_NUMPAD8 0x68 (104) "8" on the numeric keypad.
351 keyPad9, // DOM_VK_NUMPAD9 0x69 (105) "9" on the numeric keypad.
352 keyPadStar, // DOM_VK_MULTIPLY 0x6A (106) "*" on the numeric keypad.
353 keyPadPlus, // DOM_VK_ADD 0x6B (107) "+" on the numeric keypad.
354 0, // DOM_VK_SEPARATOR 0x6C (108)
355 keyPadMinus, // DOM_VK_SUBTRACT 0x6D (109) "-" on the numeric keypad.
356 0, // DOM_VK_DECIMAL 0x6E (110) Decimal point on the numeric keypad.
357 keyPadSlash, // DOM_VK_DIVIDE 0x6F (111) "/" on the numeric keypad.
358 f1, // DOM_VK_F1 0x70 (112) F1 key.
359 f2, // DOM_VK_F2 0x71 (113) F2 key.
360 f3, // DOM_VK_F3 0x72 (114) F3 key.
361 f4, // DOM_VK_F4 0x73 (115) F4 key.
362 f5, // DOM_VK_F5 0x74 (116) F5 key.
363 f6, // DOM_VK_F6 0x75 (117) F6 key.
364 f7, // DOM_VK_F7 0x76 (118) F7 key.
365 f8, // DOM_VK_F8 0x77 (119) F8 key.
366 f9, // DOM_VK_F9 0x78 (120) F9 key.
367 f10, // DOM_VK_F10 0x79 (121) F10 key.
368 f11, // DOM_VK_F11 0x7A (122) F11 key.
369 f12, // DOM_VK_F12 0x7B (123) F12 key.
370 0, // DOM_VK_F13 0x7C (124) F13 key.
371 0, // DOM_VK_F14 0x7D (125) F14 key.
372 0, // DOM_VK_F15 0x7E (126) F15 key.
373 0, // DOM_VK_F16 0x7F (127) F16 key.
374 0, // DOM_VK_F17 0x80 (128) F17 key.
375 0, // DOM_VK_F18 0x81 (129) F18 key.
376 0, // DOM_VK_F19 0x82 (130) F19 key.
377 0, // DOM_VK_F20 0x83 (131) F20 key.
378 0, // DOM_VK_F21 0x84 (132) F21 key.
379 0, // DOM_VK_F22 0x85 (133) F22 key.
380 0, // DOM_VK_F23 0x86 (134) F23 key.
381 0, // DOM_VK_F24 0x87 (135) F24 key.
390 numLock, // DOM_VK_NUM_LOCK 0x90 (144) Num Lock key.
391 scrollLock, // DOM_VK_SCROLL_LOCK 0x91 (145) Scroll Lock key.
392 0, // DOM_VK_WIN_OEM_FJ_JISHO 0x92 (146) An OEM specific key on Windows. This was used for "Dictionary" key on Fujitsu OASYS.
393 0, // DOM_VK_WIN_OEM_FJ_MASSHOU 0x93 (147) An OEM specific key on Windows. This was used for "Unregister word" key on Fujitsu OASYS.
394 0, // DOM_VK_WIN_OEM_FJ_TOUROKU 0x94 (148) An OEM specific key on Windows. This was used for "Register word" key on Fujitsu OASYS.
395 0, // DOM_VK_WIN_OEM_FJ_LOYA 0x95 (149) An OEM specific key on Windows. This was used for "Left OYAYUBI" key on Fujitsu OASYS.
396 0, // DOM_VK_WIN_OEM_FJ_ROYA 0x96 (150) An OEM specific key on Windows. This was used for "Right OYAYUBI" key on Fujitsu OASYS.
406 circumflex, // DOM_VK_CIRCUMFLEX 0xA0 (160) Circumflex ("^") key.
407 bang, // DOM_VK_EXCLAMATION 0xA1 (161) Exclamation ("!") key.
408 doubleQuote, // DOM_VK_DOUBLE_QUOTE 0xA3 (162) Double quote (""") key.
409 pound, // DOM_VK_HASH 0xA3 (163) Hash ("#") key.
410 dollar, // DOM_VK_DOLLAR 0xA4 (164) Dollar sign ("$") key.
411 percent, // DOM_VK_PERCENT 0xA5 (165) Percent ("%") key.
412 ampersand, // DOM_VK_AMPERSAND 0xA6 (166) Ampersand ("&") key.
413 underscore, // DOM_VK_UNDERSCORE 0xA7 (167) Underscore ("_") key.
414 leftParanthesis, // DOM_VK_OPEN_PAREN 0xA8 (168) Open parenthesis ("(") key.
415 rightParanthesis, // DOM_VK_CLOSE_PAREN 0xA9 (169) Close parenthesis (")") key.
416 star, // DOM_VK_ASTERISK 0xAA (170) Asterisk ("*") key.
417 plus, // DOM_VK_PLUS 0xAB (171) Plus ("+") key.
418 pipe, // DOM_VK_PIPE 0xAC (172) Pipe ("|") key.
419 minus, // DOM_VK_HYPHEN_MINUS 0xAD (173) Hyphen-US/docs/Minus ("-") key.
420 0, // DOM_VK_OPEN_CURLY_BRACKET 0xAE (174) Open curly bracket ("{") key.
421 0, // DOM_VK_CLOSE_CURLY_BRACKET 0xAF (175) Close curly bracket ("}") key.
422 tilde, // DOM_VK_TILDE 0xB0 (176) Tilde ("~") key.
427 mute, // DOM_VK_VOLUME_MUTE 0xB5 (181) Audio mute key.
428 volumeDown, // DOM_VK_VOLUME_DOWN 0xB6 (182) Audio volume down key
429 volumeUp, // DOM_VK_VOLUME_UP 0xB7 (183) Audio volume up key
434 comma, // DOM_VK_COMMA 0xBC (188) Comma (",") key.
436 period, // DOM_VK_PERIOD 0xBE (190) Period (".") key.
437 slash, // DOM_VK_SLASH 0xBF (191) Slash ("/") key.
438 backQuote, // DOM_VK_BACK_QUOTE 0xC0 (192) Back tick ("`") key.
465 leftBracket, // DOM_VK_OPEN_BRACKET 0xDB (219) Open square bracket ("[") key.
466 backSlash, // DOM_VK_BACK_SLASH 0xDC (220) Back slash ("\") key.
467 rightBracket, // DOM_VK_CLOSE_BRACKET 0xDD (221) Close square bracket ("]") key.
468 quote, // DOM_VK_QUOTE 0xDE (222) Quote (''') key.
470 0, // DOM_VK_META 0xE0 (224) Meta key on Linux, Command key on Mac.
471 0, // DOM_VK_ALTGR 0xE1 (225) AltGr key (Level 3 Shift key or Level 5 Shift key) on Linux.
473 0, // DOM_VK_WIN_ICO_HELP 0xE3 (227) An OEM specific key on Windows. This is (was?) used for Olivetti ICO keyboard.
474 0, // DOM_VK_WIN_ICO_00 0xE4 (228) An OEM specific key on Windows. This is (was?) used for Olivetti ICO keyboard.
476 0, // DOM_VK_WIN_ICO_CLEAR 0xE6 (230) An OEM specific key on Windows. This is (was?) used for Olivetti ICO keyboard.
479 0, // DOM_VK_WIN_OEM_RESET 0xE9 (233) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
480 0, // DOM_VK_WIN_OEM_JUMP 0xEA (234) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
481 0, // DOM_VK_WIN_OEM_PA1 0xEB (235) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
482 0, // DOM_VK_WIN_OEM_PA2 0xEC (236) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
483 0, // DOM_VK_WIN_OEM_PA3 0xED (237) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
484 0, // DOM_VK_WIN_OEM_WSCTRL 0xEE (238) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
485 0, // DOM_VK_WIN_OEM_CUSEL 0xEF (239) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
486 0, // DOM_VK_WIN_OEM_ATTN 0xF0 (240) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
487 0, // DOM_VK_WIN_OEM_FINISH 0xF1 (241) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
488 0, // DOM_VK_WIN_OEM_COPY 0xF2 (242) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
489 0, // DOM_VK_WIN_OEM_AUTO 0xF3 (243) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
490 0, // DOM_VK_WIN_OEM_ENLW 0xF4 (244) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
491 0, // DOM_VK_WIN_OEM_BACKTAB 0xF5 (245) An OEM specific key on Windows. This was used for Nokia/Ericsson's device.
492 0, // DOM_VK_ATTN 0xF6 (246) Attn (Attention) key of IBM midrange computers, e.g., AS/400.
493 0, // DOM_VK_CRSEL 0xF7 (247) CrSel (Cursor Selection) key of IBM 3270 keyboard layout.
494 0, // DOM_VK_EXSEL 0xF8 (248) ExSel (Extend Selection) key of IBM 3270 keyboard layout.
495 0, // DOM_VK_EREOF 0xF9 (249) Erase EOF key of IBM 3270 keyboard layout.
496 0, // DOM_VK_PLAY 0xFA (250) Play key of IBM 3270 keyboard layout.
497 0, // DOM_VK_ZOOM 0xFB (251) Zoom key.
499 0, // DOM_VK_PA1 0xFD (253) PA1 key of IBM 3270 keyboard layout.
500 0, // DOM_VK_WIN_OEM_CLEAR 0xFE (254) Clear key, but we're not sure the meaning difference from DOM_VK_CLEAR.
504 private EM_BOOL em_key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *userData)
507 Key key = keys[e->keyCode ? e->keyCode : e->which];
508 unichar character = e->charCode ? e->charCode : e->which;
509 PrintLn(key, " | ", character);
511 printf("%s, key: \"%s\", code: \"%s\", location: %lu,%s%s%s%s repeat: %d, locale: \"%s\", char: \"%s\", charCode: %lu, keyCode: %lu, which: %lu\n",
512 emscripten_event_type_to_string(eventType), e->key, e->code, e->location,
513 e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "",
514 e->repeat, e->locale, e->charValue, e->charCode, e->keyCode, e->which);
518 case EMSCRIPTEN_EVENT_KEYPRESS: method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit; break;
519 case EMSCRIPTEN_EVENT_KEYDOWN: method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown; break;
520 case EMSCRIPTEN_EVENT_KEYUP: method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp; break;
525 /*result = */guiApp.desktop.KeyMessage(method, key, character);
529 private EM_BOOL em_mouse_callback(int eventType, const EmscriptenMouseEvent *e, void *userData)
533 bool consequential = false;
534 bool activate = false;
536 canvasX = e->canvasX;
537 canvasY = e->canvasY;
539 printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, movement: (%ld,%ld), canvas: (%ld,%ld)\n",
540 emscripten_event_type_to_string(eventType), e->screenX, e->screenY, e->clientX, e->clientY,
541 e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "",
542 e->button, e->buttons, e->movementX, e->movementY, e->canvasX, e->canvasY);
544 if(e->shiftKey) mods.shift = true;
545 if(e->ctrlKey) mods.ctrl = true;
546 if(e->altKey) mods.alt = true;
547 //if(e->metaKey) mods.meta = true;
552 //case EMSCRIPTEN_EVENT_CLICK: method = 0; break;
553 case EMSCRIPTEN_EVENT_MOUSEDOWN:
556 case 0: mods.left = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown; break;
557 case 1: mods.middle = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown; break;
558 case 2: mods.right = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown; break;
562 case EMSCRIPTEN_EVENT_MOUSEUP:
565 case 0: mods.left = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp; break;
566 case 1: mods.middle = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonUp; break;
567 case 2: mods.right = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonUp; break;
571 case EMSCRIPTEN_EVENT_DBLCLICK:
574 case 0: mods.left = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick; break;
575 case 1: mods.middle = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleDoubleClick; break;
576 case 2: mods.right = true; method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightDoubleClick; break;
580 case EMSCRIPTEN_EVENT_MOUSEMOVE: method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMouseMove; break;
581 //case EMSCRIPTEN_EVENT_MOUSEENTER: method = 0; break;
582 //case EMSCRIPTEN_EVENT_MOUSELEAVE: method = 0; break;
583 case EMSCRIPTEN_EVENT_MOUSEOVER: method = __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMouseMove; break;
584 //case EMSCRIPTEN_EVENT_MOUSEOUT: method = 0; break;
589 // e->screenX, e->screenY, e->clientX, e->clientY, e->movementX, e->movementY
590 guiApp.desktop.MouseMessage(method, e->canvasX, e->canvasY, &mods, consequential, true);
594 private EM_BOOL em_wheel_callback(int eventType, const EmscriptenWheelEvent *e, void *userData)
596 printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, canvas: (%ld,%ld), delta:(%g,%g,%g), deltaMode:%lu\n",
597 emscripten_event_type_to_string(eventType), e->mouse.screenX, e->mouse.screenY, e->mouse.clientX, e->mouse.clientY,
598 e->mouse.ctrlKey ? " CTRL" : "", e->mouse.shiftKey ? " SHIFT" : "", e->mouse.altKey ? " ALT" : "", e->mouse.metaKey ? " META" : "",
599 e->mouse.button, e->mouse.buttons, e->mouse.canvasX, e->mouse.canvasY,
600 (float)e->deltaX, (float)e->deltaY, (float)e->deltaZ, e->deltaMode);
604 private EM_BOOL em_uievent_callback(int eventType, const EmscriptenUiEvent *e, void *userData)
606 printf("%s, detail: %ld, document.body.client size: (%d,%d), window.inner size: (%d,%d), scrollPos: (%d, %d)\n",
607 emscripten_event_type_to_string(eventType), e->detail, e->documentBodyClientWidth, e->documentBodyClientHeight,
608 e->windowInnerWidth, e->windowInnerHeight, e->scrollTop, e->scrollLeft);
612 private EM_BOOL em_focusevent_callback(int eventType, const EmscriptenFocusEvent *e, void *userData)
614 printf("%s, nodeName: \"%s\", id: \"%s\"\n", emscripten_event_type_to_string(eventType), e->nodeName, e->id[0] == '\0' ? "(empty string)" : e->id);
618 private EM_BOOL em_deviceorientation_callback(int eventType, const EmscriptenDeviceOrientationEvent *e, void *userData)
620 printf("%s, (%g, %g, %g)\n", emscripten_event_type_to_string(eventType), e->alpha, e->beta, e->gamma);
624 private EM_BOOL em_devicemotion_callback(int eventType, const EmscriptenDeviceMotionEvent *e, void *userData)
626 printf("%s, accel: (%g, %g, %g), accelInclGravity: (%g, %g, %g), rotationRate: (%g, %g, %g)\n",
627 emscripten_event_type_to_string(eventType),
628 e->accelerationX, e->accelerationY, e->accelerationZ,
629 e->accelerationIncludingGravityX, e->accelerationIncludingGravityY, e->accelerationIncludingGravityZ,
630 e->rotationRateAlpha, e->rotationRateBeta, e->rotationRateGamma);
634 private EM_BOOL em_orientationchange_callback(int eventType, const EmscriptenOrientationChangeEvent *e, void *userData)
636 printf("%s, orientationAngle: %d, orientationIndex: %d\n", emscripten_event_type_to_string(eventType), e->orientationAngle, e->orientationIndex);
640 private EM_BOOL em_fullscreenchange_callback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData)
642 printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\". New size: %dx%d pixels. Screen size: %dx%d pixels.\n",
643 emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id, e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight);
647 private EM_BOOL em_pointerlockchange_callback(int eventType, const EmscriptenPointerlockChangeEvent *e, void *userData)
649 printf("%s, isActive: %d, pointerlock element nodeName: \"%s\", id: \"%s\"\n",
650 emscripten_event_type_to_string(eventType), e->isActive, e->nodeName, e->id);
654 private EM_BOOL em_visibilitychange_callback(int eventType, const EmscriptenVisibilityChangeEvent *e, void *userData)
656 printf("%s, hidden: %d, visibilityState: %d\n", emscripten_event_type_to_string(eventType), e->hidden, e->visibilityState);
661 private EM_BOOL em_touch_callback(int eventType, const EmscriptenTouchEvent *e, void *userData)
663 printf("%s, numTouches: %d %s%s%s%s\n",
664 emscripten_event_type_to_string(eventType), e->numTouches,
665 e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "");
666 for(int i = 0; i < e->numTouches; ++i)
668 const EmscriptenTouchPoint *t = &e->touches[i];
669 printf(" %ld: screen: (%ld,%ld), client: (%ld,%ld), page: (%ld,%ld), isChanged: %d, onTarget: %d, canvas: (%ld, %ld)\n",
670 t->identifier, t->screenX, t->screenY, t->clientX, t->clientY, t->pageX, t->pageY, t->isChanged, t->onTarget, t->canvasX, t->canvasY);
676 private EM_BOOL em_gamepad_callback(int eventType, const EmscriptenGamepadEvent *e, void *userData)
678 printf("%s: timeStamp: %g, connected: %d, index: %ld, numAxes: %d, numButtons: %d, id: \"%s\", mapping: \"%s\"\n",
679 eventType != 0 ? emscripten_event_type_to_string(eventType) : "Gamepad state", e->timestamp, e->connected, e->index,
680 e->numAxes, e->numButtons, e->id, e->mapping);
684 for(int i = 0; i < e->numAxes; ++i)
685 printf("Axis %d: %g\n", i, e->axis[i]);
686 for(int i = 0; i < e->numButtons; ++i)
687 printf("Button %d: Digital: %d, Analog: %g\n", i, e->digitalButton[i], e->analogButton[i]);
692 const char *beforeunload_callback(int eventType, const void *reserved, void *userData)
695 return ""; // For test harness, don't show a confirmation dialog to not block and keep the test runner automated.
697 return "Do you really want to leave the page?";
701 private EM_BOOL em_battery_callback(int eventType, const EmscriptenBatteryEvent *e, void *userData)
704 formatTime(t1, (int)e->chargingTime);
706 formatTime(t2, (int)e->dischargingTime);
707 printf("%s: chargingTime: %s, dischargingTime: %s, level: %g%%, charging: %d\n",
708 emscripten_event_type_to_string(eventType), t1, t2, e->level*100, e->charging);
712 private EM_BOOL em_webglcontext_callback(int eventType, const void *reserved, void *userData)
714 printf("%s.\n", emscripten_event_type_to_string(eventType));
720 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit;
721 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyUp;
722 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown;
723 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyHit;
724 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMouseMove;
725 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftDoubleClick;
726 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonDown;
727 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp;
728 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleDoubleClick;
729 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonDown;
730 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnMiddleButtonUp;
731 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightDoubleClick;
732 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonDown;
733 extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnRightButtonUp;
736 class EmscriptenInterface : Interface
738 class_property(name) = "Emscripten";
741 // --- User Interface System ---
745 sflnprintf("class(EmscriptenInterface) ::Initialize [STUB!]\n");
746 guiApp.desktop.ExternalPosition(0,0, 800, 240);
748 #ifdef __EMSCRIPTEN__
751 EMSCRIPTEN_RESULT ret;
753 ret = emscripten_set_keypress_callback(0, 0, 1, em_key_callback);
754 //TEST_RESULT(emscripten_set_keypress_callback);
755 ret = emscripten_set_keydown_callback(0, 0, 1, em_key_callback);
756 //TEST_RESULT(emscripten_set_keydown_callback);
757 ret = emscripten_set_keyup_callback(0, 0, 1, em_key_callback);
758 //TEST_RESULT(emscripten_set_keyup_callback);
760 //ret = emscripten_set_click_callback(0, 0, 1, em_mouse_callback);
761 //TEST_RESULT(emscripten_set_click_callback);
762 ret = emscripten_set_mousedown_callback(0, 0, 1, em_mouse_callback);
763 //TEST_RESULT(emscripten_set_mousedown_callback);
764 ret = emscripten_set_mouseup_callback(0, 0, 1, em_mouse_callback);
765 //TEST_RESULT(emscripten_set_mouseup_callback);
766 ret = emscripten_set_dblclick_callback(0, 0, 1, em_mouse_callback);
767 //TEST_RESULT(emscripten_set_dblclick_callback);
768 ret = emscripten_set_mousemove_callback(0, 0, 1, em_mouse_callback);
769 //TEST_RESULT(emscripten_set_mousemove_callback);
770 ret = emscripten_set_mouseenter_callback(0, 0, 1, em_mouse_callback);
771 //TEST_RESULT(emscripten_set_mouseenter_callback);
772 ret = emscripten_set_mouseleave_callback(0, 0, 1, em_mouse_callback);
773 //TEST_RESULT(emscripten_set_mouseleave_callback);
774 ret = emscripten_set_mouseover_callback(0, 0, 1, em_mouse_callback);
775 //TEST_RESULT(emscripten_set_mouseover_callback);
776 ret = emscripten_set_mouseout_callback(0, 0, 1, em_mouse_callback);
777 //TEST_RESULT(emscripten_set_mouseout_callback);
779 ret = emscripten_set_wheel_callback(0, 0, 1, em_wheel_callback);
780 //TEST_RESULT(emscripten_set_wheel_callback);
782 ret = emscripten_set_resize_callback(0, 0, 1, em_uievent_callback);
783 //TEST_RESULT(emscripten_set_resize_callback);
784 ret = emscripten_set_scroll_callback(0, 0, 1, em_uievent_callback);
785 //TEST_RESULT(emscripten_set_scroll_callback);
787 ret = emscripten_set_blur_callback(0, 0, 1, em_focusevent_callback);
788 //TEST_RESULT(emscripten_set_blur_callback);
789 ret = emscripten_set_focus_callback(0, 0, 1, em_focusevent_callback);
790 //TEST_RESULT(emscripten_set_focus_callback);
791 ret = emscripten_set_focusin_callback(0, 0, 1, em_focusevent_callback);
792 //TEST_RESULT(emscripten_set_focusin_callback);
793 ret = emscripten_set_focusout_callback(0, 0, 1, em_focusevent_callback);
794 //TEST_RESULT(emscripten_set_focusout_callback);
796 ret = emscripten_set_deviceorientation_callback(0, 1, em_deviceorientation_callback);
797 //TEST_RESULT(emscripten_set_deviceorientation_callback);
798 ret = emscripten_set_devicemotion_callback(0, 1, em_devicemotion_callback);
799 //TEST_RESULT(emscripten_set_devicemotion_callback);
801 ret = emscripten_set_orientationchange_callback(0, 1, em_orientationchange_callback);
802 //TEST_RESULT(emscripten_set_orientationchange_callback);
805 // Test the polling of orientation.
806 EmscriptenOrientationChangeEvent oce;
807 ret = emscripten_get_orientation_status(&oce);
808 //TEST_RESULT(emscripten_get_orientation_status);
809 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
810 printf("The current orientation is:\n");
811 orientationchange_callback(EMSCRIPTEN_EVENT_ORIENTATIONCHANGE, &oce, 0);
814 int newOrientation = (oce.orientationIndex == EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY
815 || oce.orientationIndex == EMSCRIPTEN_ORIENTATION_PORTRAIT_SECONDARY) ? EMSCRIPTEN_ORIENTATION_LANDSCAPE_PRIMARY : EMSCRIPTEN_ORIENTATION_PORTRAIT_PRIMARY;
816 // Test locking of orientation.
817 ret = emscripten_lock_orientation(newOrientation);
818 //TEST_RESULT(emscripten_lock_orientation);
819 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
820 printf("Locked orientation to state %d.\n", newOrientation);
823 ret = emscripten_get_orientation_status(&oce);
824 //TEST_RESULT(emscripten_get_orientation_status);
825 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
826 printf("The current orientation is after locking:\n");
827 orientationchange_callback(18, &oce, 0);
830 ret = emscripten_unlock_orientation();
831 //TEST_RESULT(emscripten_unlock_orientation);
832 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
833 printf("Unlocked orientation.\n");
836 EmscriptenFullscreenChangeEvent fsce;
837 ret = emscripten_get_fullscreen_status(&fsce);
838 //TEST_RESULT(emscripten_get_fullscreen_status);
839 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
840 printf("The current fullscreen status is:\n");
841 fullscreenchange_callback(EMSCRIPTEN_EVENT_FULLSCREENCHANGE, &fsce, 0);
844 ret = emscripten_set_fullscreenchange_callback(0, 0, 1, em_fullscreenchange_callback);
845 //TEST_RESULT(emscripten_set_fullscreenchange_callback);
847 // These won't do anything, since fullscreen must be requested in an event handler,
848 // but call these anyways to confirm that they don't crash in an exception in the test suite.
849 ret = emscripten_request_fullscreen(0, 1);
850 //TEST_RESULT(emscripten_request_fullscreen);
851 ret = emscripten_exit_fullscreen();
852 //TEST_RESULT(emscripten_exit_fullscreen);
854 EmscriptenPointerlockChangeEvent plce;
855 ret = emscripten_get_pointerlock_status(&plce);
856 //TEST_RESULT(emscripten_get_pointerlock_status);
857 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
858 printf("The current pointerlock status is:\n");
859 pointerlockchange_callback(EMSCRIPTEN_EVENT_POINTERLOCKCHANGE, &plce, 0);
862 ret = emscripten_set_pointerlockchange_callback(0, 0, 1, em_pointerlockchange_callback);
863 //TEST_RESULT(emscripten_set_pointerlockchange_callback);
865 // These won't do anything, since pointer lock must be requested in an event handler,
866 // but call these anyways to confirm that they don't crash in an exception in the test suite.
867 ret = emscripten_request_pointerlock(0, 1);
868 //TEST_RESULT(emscripten_request_pointerlock);
869 ret = emscripten_exit_pointerlock();
870 //TEST_RESULT(emscripten_exit_pointerlock);
872 int vibratePattern[] = {
877 ret = emscripten_vibrate_pattern(vibratePattern, sizeof(vibratePattern)/sizeof(vibratePattern[0]));
878 //TEST_RESULT(emscripten_vibrate_pattern);
880 EmscriptenVisibilityChangeEvent vce;
881 ret = emscripten_get_visibility_status(&vce);
882 //TEST_RESULT(emscripten_get_visibility_status);
883 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
884 printf("Current visibility status:\n");
885 visibilitychange_callback(EMSCRIPTEN_EVENT_VISIBILITYCHANGE, &vce, 0);
888 ret = emscripten_set_visibilitychange_callback(0, 1, visibilitychange_callback);
889 //TEST_RESULT(emscripten_set_visibilitychange_callback);
891 ret = emscripten_set_touchstart_callback(0, 0, 1, em_touch_callback);
892 //TEST_RESULT(emscripten_set_touchstart_callback);
893 ret = emscripten_set_touchend_callback(0, 0, 1, em_touch_callback);
894 //TEST_RESULT(emscripten_set_touchend_callback);
895 ret = emscripten_set_touchmove_callback(0, 0, 1, em_touch_callback);
896 //TEST_RESULT(emscripten_set_touchmove_callback);
897 ret = emscripten_set_touchcancel_callback(0, 0, 1, em_touch_callback);
898 //TEST_RESULT(emscripten_set_touchcancel_callback);
900 ret = emscripten_set_gamepadconnected_callback(0, 1, gamepad_callback);
901 //TEST_RESULT(emscripten_set_gamepadconnected_callback);
902 ret = emscripten_set_gamepaddisconnected_callback(0, 1, gamepad_callback);
903 //TEST_RESULT(emscripten_set_gamepaddisconnected_callback);
905 emscripten_set_main_loop(mainloop, 10, 0);
907 ret = emscripten_set_beforeunload_callback(0, beforeunload_callback);
908 //TEST_RESULT(emscripten_set_beforeunload_callback);
910 ret = emscripten_set_batterychargingchange_callback(0, battery_callback);
911 //TEST_RESULT(emscripten_set_batterychargingchange_callback);
912 ret = emscripten_set_batterylevelchange_callback(0, battery_callback);
913 //TEST_RESULT(emscripten_set_batterylevelchange_callback);
915 EmscriptenBatteryEvent bs;
916 ret = emscripten_get_battery_status(&bs);
917 //TEST_RESULT(emscripten_get_battery_status);
918 if (ret == EMSCRIPTEN_RESULT_SUCCESS) {
919 printf("Current battery status:\n");
920 battery_callback(EMSCRIPTEN_EVENT_BATTERYLEVELCHANGE, &bs, 0);
923 ret = emscripten_set_webglcontextlost_callback(0, 0, 1, em_webglcontext_callback);
924 //TEST_RESULT(emscripten_set_webglcontextlost_callback);
925 ret = emscripten_set_webglcontextrestored_callback(0, 0, 1, em_webglcontext_callback);
926 //TEST_RESULT(emscripten_set_webglcontextrestored_callback);
936 sflnprintf("class(EmscriptenInterface) ::Terminate [STUB!]\n");
939 bool ::ProcessInput(bool processAll)
941 //sflnprintf("class(EmscriptenInterface) ::ProcessInput [STUB!]\n");
947 sflnprintf("class(EmscriptenInterface) ::Wait [STUB!]\n");
950 void ::Lock(Window window)
952 sflnprintf("class(EmscriptenInterface) ::Lock [STUB!]\n");
955 void ::Unlock(Window window)
957 sflnprintf("class(EmscriptenInterface) ::Unlock [STUB!]\n");
960 void ::SetTimerResolution(uint hertz)
962 sflnprintf("class(EmscriptenInterface) ::SetTimerResolution [STUB!] Implement high resolution timer here\n");
965 const char ** ::GraphicsDrivers(int * numDrivers)
967 //sflnprintf("class(EmscriptenInterface) ::GraphicsDrivers [STUB!]\n");
968 static const char *graphicsDrivers[] = { "OpenGL" };
969 *numDrivers = sizeof(graphicsDrivers) / sizeof(char *);
970 return (const char **)graphicsDrivers;
974 void ::EnsureFullScreen(bool * fullScreen)
976 sflnprintf("class(EmscriptenInterface) ::EnsureFullScreen [STUB!]\n");
980 void ::GetCurrentMode(bool * fullScreen, Resolution * resolution, PixelFormat * colorDepth, int * refreshRate)
982 sflnprintf("class(EmscriptenInterface) ::GetCurrentMode [STUB!]\n");
985 bool ::ScreenMode(bool fullScreen, Resolution resolution, PixelFormat colorDepth, int refreshRate, bool * textMode)
987 sflnprintf("class(EmscriptenInterface) ::ScreenMode [STUB!]\n");
992 // --- Window Creation ---
994 void * ::CreateRootWindow(Window window)
996 sflnprintf("class(EmscriptenInterface) ::CreateRootWindow [STUB!]\n");
1000 void ::DestroyRootWindow(Window window)
1002 sflnprintf("class(EmscriptenInterface) ::DestroyRootWindow [STUB!]\n");
1006 // --- Window manipulation ---
1008 void ::SetRootWindowCaption(Window window, const char * name)
1010 sflnprintf("class(EmscriptenInterface) ::SetRootWindowCaption [STUB!]\n");
1013 void ::PositionRootWindow(Window window, int x, int y, int w, int h, bool move, bool resize)
1015 sflnprintf("class(EmscriptenInterface) ::Stub [STUB!]\n");
1018 void ::OffsetWindow(Window window, int * x, int * y)
1020 //sflnprintf("class(EmscriptenInterface) ::OffsetWindow [STUB!]\n");
1023 void ::UpdateRootWindow(Window window)
1025 sflnprintf("class(EmscriptenInterface) ::UpdateRootWindow [STUB!]\n");
1028 void ::SetRootWindowState(Window window, WindowState state, bool visible)
1030 sflnprintf("class(EmscriptenInterface) ::SetRootWindowState [STUB!]\n");
1033 void ::ActivateRootWindow(Window window)
1035 sflnprintf("class(EmscriptenInterface) ::ActivateRootWindow [STUB!]\n");
1038 void ::OrderRootWindow(Window window, bool topMost)
1040 sflnprintf("class(EmscriptenInterface) ::OrderRootWindow [STUB!]\n");
1043 void ::SetRootWindowColor(Window window)
1045 sflnprintf("class(EmscriptenInterface) ::SetRootWindowColor [STUB!]\n");
1048 void ::FlashRootWindow(Window window)
1050 sflnprintf("class(EmscriptenInterface) ::FlashRootWindow [STUB!]\n");
1054 // --- Mouse-based window movement ---
1056 void ::StartMoving(Window window, int x, int y, bool fromKeyBoard)
1058 sflnprintf("class(EmscriptenInterface) ::StartMoving [STUB!]\n");
1061 void ::StopMoving(Window window)
1063 sflnprintf("class(EmscriptenInterface) ::StopMoving [STUB!]\n");
1067 // --- Mouse manipulation ---
1069 void ::GetMousePosition(int *x, int *y)
1075 void ::SetMousePosition(int x, int y)
1077 sflnprintf("class(EmscriptenInterface) ::SetMousePosition [STUB!]\n");
1080 void ::SetMouseRange(Window window, Box box)
1082 sflnprintf("class(EmscriptenInterface) ::SetMouseRange [STUB!]\n");
1085 void ::SetMouseCapture(Window window)
1087 sflnprintf("class(EmscriptenInterface) ::SetMouseCapture [STUB!]\n");
1091 // --- Mouse cursor ---
1093 void ::SetMouseCursor(Window window, SystemCursor cursor)
1095 sflnprintf("class(EmscriptenInterface) ::SetMouseCursor [STUB!]\n");
1099 // --- Caret manipulation ---
1101 void ::SetCaret(int caretX, int caretY, int size)
1103 sflnprintf("class(EmscriptenInterface) ::SetCaret [STUB!]\n");
1107 // --- Clipboard manipulation ---
1109 void ::ClearClipboard()
1111 sflnprintf("class(EmscriptenInterface) ::ClearClipboard [STUB!]\n");
1114 bool ::AllocateClipboard(ClipBoard clipBoard, uint size)
1116 sflnprintf("class(EmscriptenInterface) ::AllocateClipboard [STUB!]\n");
1120 bool ::SaveClipboard(ClipBoard clipBoard)
1122 sflnprintf("class(EmscriptenInterface) ::SaveClipboard [STUB!]\n");
1126 bool ::LoadClipboard(ClipBoard clipBoard)
1128 sflnprintf("class(EmscriptenInterface) ::LoadClipboard [STUB!]\n");
1132 void ::UnloadClipboard(ClipBoard clipBoard)
1134 sflnprintf("class(EmscriptenInterface) ::UnloadClipboard [STUB!]\n");
1138 // --- State based input ---
1140 bool ::AcquireInput(Window window, bool state)
1142 sflnprintf("class(EmscriptenInterface) ::AcquireInput [STUB!]\n");
1146 bool ::GetMouseState(MouseButtons * buttons, int * x, int * y)
1148 sflnprintf("class(EmscriptenInterface) ::GetMouseState [STUB!]\n");
1152 bool ::GetJoystickState(int device, Joystick joystick)
1154 sflnprintf("class(EmscriptenInterface) ::GetJoystickState [STUB!]\n");
1158 bool ::GetKeyState(Key key)
1160 sflnprintf("class(EmscriptenInterface) ::GetKeyState [STUB!]\n");
1164 bool ::SetIcon(Window window, BitmapResource icon)
1166 sflnprintf("class(EmscriptenInterface) ::SetIcon [STUB!]\n");
1170 void ::GetScreenArea(Window window, Box box)
1172 sflnprintf("class(EmscriptenInterface) ::GetScreenArea [STUB!]\n");