Project

General

Profile

SO3Engine
SCOLWidget.cpp
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25
33#include "SCOLPack/SO3SCOL.h"
34
35// Renderer includes
40#include "SO3Renderer/SO3Root.h"
41
42// Scene Graph includes
44
67
68#define XK_BackSpace 0xFF08 /* back space, back char */
69#define XK_Tab 0xFF09
70#define XK_Linefeed 0xFF0A /* Linefeed, LF */
71#define XK_Clear 0xFF0B
72#define XK_Return 0xFF0D /* Return, enter */
73#define XK_Pause 0xFF13 /* Pause, hold */
74#define XK_Scroll_Lock 0xFF14
75#define XK_Sys_Req 0xFF15
76#define XK_Escape 0xFF1B
77#define XK_Delete 0xFFFF /* Delete, rubout */
78
79#define XK_Multi_key 0xFF20 /* Multi-key character compose */
80
81/* Cursor control & motion */
82
83#define XK_Home 0xFF50
84#define XK_Left 0xFF51 /* Move left, left arrow */
85#define XK_Up 0xFF52 /* Move up, up arrow */
86#define XK_Right 0xFF53 /* Move right, right arrow */
87#define XK_Down 0xFF54 /* Move down, down arrow */
88#define XK_Prior 0xFF55 /* Prior, previous */
89#define XK_Page_Up 0xFF55
90#define XK_Next 0xFF56 /* Next */
91#define XK_Page_Down 0xFF56
92#define XK_End 0xFF57 /* EOL */
93#define XK_Begin 0xFF58 /* BOL */
94
95
96/* Misc Functions */
97
98#define XK_Select 0xFF60 /* Select, mark */
99#define XK_Print 0xFF61
100#define XK_Execute 0xFF62 /* Execute, run, do */
101#define XK_Insert 0xFF63 /* Insert, insert here */
102#define XK_Undo 0xFF65 /* Undo, oops */
103#define XK_Redo 0xFF66 /* redo, again */
104#define XK_Menu 0xFF67
105#define XK_Find 0xFF68 /* Find, search */
106#define XK_Cancel 0xFF69 /* Cancel, stop, abort, exit */
107#define XK_Help 0xFF6A /* Help */
108#define XK_Break 0xFF6B
109#define XK_Mode_switch 0xFF7E /* Character set switch */
110#define XK_script_switch 0xFF7E /* Alias for mode_switch */
111#define XK_Num_Lock 0xFF7F
112
113/* Keypad Functions, keypad numbers cleverly chosen to map to ascii */
114
115#define XK_KP_Space 0xFF80 /* space */
116#define XK_KP_Tab 0xFF89
117#define XK_KP_Enter 0xFF8D /* enter */
118#define XK_KP_F1 0xFF91 /* PF1, KP_A, ... */
119#define XK_KP_F2 0xFF92
120#define XK_KP_F3 0xFF93
121#define XK_KP_F4 0xFF94
122#define XK_KP_Home 0xFF95
123#define XK_KP_Left 0xFF96
124#define XK_KP_Up 0xFF97
125#define XK_KP_Right 0xFF98
126#define XK_KP_Down 0xFF99
127#define XK_KP_Prior 0xFF9A
128#define XK_KP_Page_Up 0xFF9A
129#define XK_KP_Next 0xFF9B
130#define XK_KP_Page_Down 0xFF9B
131#define XK_KP_End 0xFF9C
132#define XK_KP_Begin 0xFF9D
133#define XK_KP_Insert 0xFF9E
134#define XK_KP_Delete 0xFF9F
135#define XK_KP_Equal 0xFFBD /* equals */
136#define XK_KP_Multiply 0xFFAA
137#define XK_KP_Add 0xFFAB
138#define XK_KP_Separator 0xFFAC /* separator, often comma */
139#define XK_KP_Subtract 0xFFAD
140#define XK_KP_Decimal 0xFFAE
141#define XK_KP_Divide 0xFFAF
142
143#define XK_KP_0 0xFFB0
144#define XK_KP_1 0xFFB1
145#define XK_KP_2 0xFFB2
146#define XK_KP_3 0xFFB3
147#define XK_KP_4 0xFFB4
148#define XK_KP_5 0xFFB5
149#define XK_KP_6 0xFFB6
150#define XK_KP_7 0xFFB7
151#define XK_KP_8 0xFFB8
152#define XK_KP_9 0xFFB9
153
154#define XK_F1 0xFFBE
155#define XK_F2 0xFFBF
156#define XK_F3 0xFFC0
157#define XK_F4 0xFFC1
158#define XK_F5 0xFFC2
159#define XK_F6 0xFFC3
160#define XK_F7 0xFFC4
161#define XK_F8 0xFFC5
162#define XK_F9 0xFFC6
163#define XK_F10 0xFFC7
164#define XK_F11 0xFFC8
165#define XK_L1 0xFFC8
166#define XK_F12 0xFFC9
167#define XK_L2 0xFFC9
168#define XK_F13 0xFFCA
169#define XK_L3 0xFFCA
170#define XK_F14 0xFFCB
171#define XK_L4 0xFFCB
172#define XK_F15 0xFFCC
173#define XK_L5 0xFFCC
174#define XK_F16 0xFFCD
175#define XK_L6 0xFFCD
176#define XK_F17 0xFFCE
177#define XK_L7 0xFFCE
178#define XK_F18 0xFFCF
179#define XK_L8 0xFFCF
180#define XK_F19 0xFFD0
181#define XK_L9 0xFFD0
182#define XK_F20 0xFFD1
183#define XK_L10 0xFFD1
184#define XK_F21 0xFFD2
185#define XK_R1 0xFFD2
186#define XK_F22 0xFFD3
187#define XK_R2 0xFFD3
188#define XK_F23 0xFFD4
189#define XK_R3 0xFFD4
190#define XK_F24 0xFFD5
191#define XK_R4 0xFFD5
192#define XK_F25 0xFFD6
193#define XK_R5 0xFFD6
194#define XK_F26 0xFFD7
195#define XK_R6 0xFFD7
196#define XK_F27 0xFFD8
197#define XK_R7 0xFFD8
198#define XK_F28 0xFFD9
199#define XK_R8 0xFFD9
200#define XK_F29 0xFFDA
201#define XK_R9 0xFFDA
202#define XK_F30 0xFFDB
203#define XK_R10 0xFFDB
204#define XK_F31 0xFFDC
205#define XK_R11 0xFFDC
206#define XK_F32 0xFFDD
207#define XK_R12 0xFFDD
208#define XK_F33 0xFFDE
209#define XK_R13 0xFFDE
210#define XK_F34 0xFFDF
211#define XK_R14 0xFFDF
212#define XK_F35 0xFFE0
213#define XK_R15 0xFFE0
214
215
216#define XK_Shift_L 0xFFE1 /* Left shift */
217#define XK_Shift_R 0xFFE2 /* Right shift */
218#define XK_Control_L 0xFFE3 /* Left control */
219#define XK_Control_R 0xFFE4 /* Right control */
220#define XK_Caps_Lock 0xFFE5 /* Caps lock */
221#define XK_Shift_Lock 0xFFE6 /* Shift lock */
222
223#define XK_Meta_L 0xFFE7 /* Left meta */
224#define XK_Meta_R 0xFFE8 /* Right meta */
225#define XK_Alt_L 0xFFE9 /* Left alt */
226#define XK_Alt_R 0xFFEA /* Right alt */
227#define XK_Super_L 0xFFEB /* Left super */
228#define XK_Super_R 0xFFEC /* Right super */
229#define XK_Hyper_L 0xFFED /* Left hyper */
230#define XK_Hyper_R 0xFFEE /* Right hyper */
231
233{
234 0, 0, 0, 0, 0, 0, 0, 0, /*0.*/
235 0, 0, 0, 0, 0, 0, 0, 0,
236 0, 0, 0, XK_Pause, XK_Caps_Lock, 0, 0, 0,
237 0, 0, 0, XK_Escape, 0, 0, 0, 0,
238 0, XK_Prior, XK_Next, XK_End, XK_Home, XK_Left, XK_Up, XK_Right,
239 XK_Down, 0, 0, 0, XK_Sys_Req, XK_Insert, XK_Delete, 0,
240 0, 0, 0, 0, 0, 0, 0, 0,
241 0, 0, 0, 0, 0, 0, 0, 0,
242 0, 0, 0, 0, 0, 0, 0, 0, /*4.*/
243 0, 0, 0, 0, 0, 0, 0, 0,
244 0, 0, 0, 0, 0, 0, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0,
248 XK_F1, XK_F2, XK_F3, XK_F4, XK_F5, XK_F6, XK_F7, XK_F8,
249 XK_F9, XK_F10, XK_F11, XK_F12, XK_F13, XK_F14, XK_F15, XK_F16,
250 0, 0, 0, 0, 0, 0, 0, 0, /*8.*/
251 0, 0, 0, 0, 0, 0, 0, 0,
252 XK_Num_Lock, XK_Scroll_Lock, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0
254};
255
257{
258 if ((c < 0) || (c >= 160)) return 0;
259 return ScolZooTabCodes[c];
260}
261
265class ScolMessageParameterKeyboard
266{
267public:
268 UINT msg;
269 ScolWindowHandle hwnd;
270 UINT wParam;
271 LONG lParam;
272protected:
273private:
274
275public:
276 ScolMessageParameterKeyboard(const UINT paramMsg, const ScolWindowHandle paramHwnd, const UINT paramWParam, const LONG paramLParam)
277 {
278 msg = (UINT)paramMsg;
279 hwnd = (ScolWindowHandle)paramHwnd;
280 wParam = (UINT)paramWParam;
281 lParam = (LONG)paramLParam;
282 };
283protected:
284private:
288 ScolMessageParameterKeyboard()
289 {
290 };
291};
292
296class ScolWidgetEventsListener : public SWidgetListener
297{
298public:
299protected:
300private:
301
302public:
305 ScolWidgetEventsListener()
306 {
307 };
308
311 virtual void OnEnter(SWidget* targetWidget)
312 {
313 OBJpostEvent(WIDGET_ENTER_EVENT, SCOL_PTR targetWidget, 0);
314 };
315
318 virtual void OnExit(SWidget* targetWidget)
319 {
320 OBJpostEvent(WIDGET_EXIT_EVENT, SCOL_PTR targetWidget, 0);
321 };
322
325 virtual void OnInside(SWidget* targetWidget)
326 {
327 // Not used anymore
328 };
329
332 virtual void OnMouseMove(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
333 {
334 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
335 OBJpostEvent(WIDGET_MOUSEMOVE_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
336
337 mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
338 OBJpostEvent(WIDGET_INPUTUPDATE_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
339 };
340
343 virtual void OnMouseDown(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
344 {
345 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
346 OBJpostEvent(WIDGET_MOUSEDOWN_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
347
348 mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
349 OBJpostEvent(WIDGET_INPUTDOWN_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
350 };
351
354 virtual void OnMouseUp(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const MouseButtonId& mouseButton, const int& id)
355 {
356 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
357 OBJpostEvent(WIDGET_MOUSEUP_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
358
359 mouseParams = new MMOUSE(mousePosX, mousePosY, mouseButton, id);
360 OBJpostEvent(WIDGET_INPUTUP_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
361 };
362
365 virtual void OnMouseWheel(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const int& relativeScroll, const int& id)
366 {
367 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, 0, id, relativeScroll);
368 OBJpostEvent(WIDGET_MOUSEWHEEL_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
369
370 mouseParams = new MMOUSE(mousePosX, mousePosY, 0, id, relativeScroll);
371 OBJpostEvent(WIDGET_INPUTWHEEL_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
372 };
373
376 virtual void OnTouchAdd(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const int& touchid)
377 {
378 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, 0, touchid);
379 OBJpostEvent(WIDGET_TOUCHADD_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
380 };
381
384 virtual void OnTouchRemove(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const int& touchid)
385 {
386 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, 0, touchid);
387 OBJpostEvent(WIDGET_TOUCHREMOVE_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
388 };
389
392 virtual void OnTouchUpdate(SWidget* targetWidget, const int& mousePosX, const int& mousePosY, const int& vx, const int& vy, const int& touchid)
393 {
394 MMOUSE* mouseParams = new MMOUSE(mousePosX, mousePosY, 0, touchid, 0, 0, 0, vx, vy);
395 OBJpostEvent(WIDGET_TOUCHUPDATE_EVENT, SCOL_PTR targetWidget, SCOL_PTR mouseParams);
396 };
397
400 virtual void OnKey(SWidget* targetWidget, const UINT& msg, const ScolWindowHandle& hwnd, const UINT& wParam, const LONG& lParam)
401 {
402 ScolMessageParameterKeyboard* messageParameterFull = new ScolMessageParameterKeyboard(msg, hwnd, wParam, lParam);
403 OBJpostEvent(WIDGET_KEY_EVENT, SCOL_PTR targetWidget, SCOL_PTR messageParameterFull);
404
405 ScolMessageParameterKeyboard* messageParameter = new ScolMessageParameterKeyboard(msg, hwnd, wParam, (lParam >> 16) & 0x1ff);
406 if ((msg == WM_KEYDOWN) || (msg == WM_IME_KEYDOWN) || (msg == WM_SYSKEYDOWN) || (msg == WM_CHAR))
407 {
408 if (msg != WM_CHAR)
409 {
410 int c = ZooConvertvirtcode((int)wParam);
411 if (c == 0)
412 return;
413 messageParameter->wParam = c;
414 }
415 else if ((int)wParam == XK_Escape)
416 return;
417
418 OBJpostEvent(WIDGET_KEY_DOWN_EVENT, SCOL_PTR targetWidget, SCOL_PTR messageParameter);
419 }
420 else if ((msg == WM_KEYUP) || (msg == WM_IME_KEYUP) || (msg == WM_SYSKEYUP))
421 OBJpostEvent(WIDGET_KEY_UP_EVENT, SCOL_PTR targetWidget, SCOL_PTR messageParameter);
422 };
423
426 virtual void OnScriptCall(SWidget* targetWidget, const SScriptFunction& functionCalled)
427 {
428 // Copy to avoid multithread memory access errors
429 SScriptFunction* scriptFunction = new SScriptFunction(functionCalled);
430 OBJpostEvent(WIDGET_SCRIPT_EVENT, SCOL_PTR targetWidget, SCOL_PTR scriptFunction);
431 };
432
435 virtual void OnFocus(SWidget* targetWidget, const bool& focused)
436 {
437 OBJpostEvent(WIDGET_FOCUS_EVENT, SCOL_PTR targetWidget, SCOL_PTR (focused ? 1 : 0));
438 };
439
442 virtual void OnLoadStart(SWidget* targetWidget)
443 {
444 OBJpostEvent(WIDGET_ON_LOAD_START_EVENT, SCOL_PTR targetWidget, SCOL_PTR targetWidget);
445 };
446
449 virtual void OnLoadEnd(SWidget* targetWidget)
450 {
451 OBJpostEvent(WIDGET_ON_LOAD_END_EVENT, SCOL_PTR targetWidget, 0);
452 };
453
456 virtual void OnLoadError(SWidget* targetWidget, const int& errorCode, const std::string& failedUrl)
457 {
458 OBJpostEvent(WIDGET_ON_LOAD_ERROR_EVENT, SCOL_PTR targetWidget, SCOL_PTR failedUrl.c_str());
459 };
460protected:
461private:
462};
463
475int getWidgetCallbackOnScriptCallback(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
476{
477#ifdef SO3_DEBUG
478 MMechostr(MSKDEBUG, "getWidgetCallbackOnScriptCallback\n");
479#endif
480
481 int k;
482 int res = 0;
483
484 // Retrieve script function and arguments
485 SO3::SScriptFunction* functionCalled = (SScriptFunction*)param;
486
487 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_SCRIPT_EVENT)))
488 {
489 // Push function name
490 Mpushstrbloc(m, (char*)(functionCalled->function.c_str()));
491
492 // Push every arguments
493 for (unsigned int i = 0; i < functionCalled->arguments.size(); i++)
494 {
495 if (k = Mpushstrbloc(m, (char*)(functionCalled->arguments.at(i).c_str())))
496 return k;
497 }
498
499 if (MMpush(m, NIL))
500 return MERRMEM;
501
502 for (unsigned int i = 0; i < functionCalled->arguments.size(); i++)
503 {
504 if (MMpush(m, 2 * 2))
505 return MERRMEM;
506
507 if (k = MBdeftab(m))
508 return k;
509 }
510 res = OBJcallreflex(m, 2);
511 }
512
513 delete(functionCalled);
514 return res;
515}
516
517
529int getWidgetCallbackOnEnterEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
530{
531#ifdef SO3_DEBUG
532 MMechostr(MSKDEBUG, "getWidgetCallbackOnEnterEvent\n");
533#endif
534
535 int k;
536 int res = 0;
537
538 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_ENTER_EVENT)))
539 res = OBJcallreflex(m, 0);
540
541 return res;
542}
543
544
556int getWidgetCallbackOnExitEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
557{
558#ifdef SO3_DEBUG
559 MMechostr(MSKDEBUG, "getWidgetCallbackOnExitEvent\n");
560#endif
561
562 int k;
563 int res = 0;
564
565 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_EXIT_EVENT)))
566 res = OBJcallreflex(m, 0);
567
568 return res;
569}
570
571
583int getWidgetCallbackMouseMoveEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
584{
585#ifdef SO3_DEBUG
586 MMechostr(MSKDEBUG, "getWidgetCallbackMouseMoveEvent\n");
587#endif
588
589 int k;
590 int res = 0;
591 MMOUSE* result = (MMOUSE*)param;
592
593 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_MOUSE_MOVE_EVENT)))
594 {
595 MMpush(m, ITOM(result->x));
596 MMpush(m, ITOM(result->y));
597 MMpush(m, ITOM(result->btn));
598
599 res = OBJcallreflex(m, 3);
600 }
601
602 delete(result);
603 return res;
604}
605
606
618int getWidgetCallbackMouseDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
619{
620#ifdef SO3_DEBUG
621 MMechostr(MSKDEBUG, "getWidgetCallbackMouseDownEvent\n");
622#endif
623
624 int k;
625 int res = 0;
626 MMOUSE* result = (MMOUSE*)param;
627
628 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_MOUSE_DOWN_EVENT)))
629 {
630 MMpush(m, ITOM(result->x));
631 MMpush(m, ITOM(result->y));
632 MMpush(m, ITOM(result->btn));
633
634 res = OBJcallreflex(m, 3);
635 }
636
637 delete(result);
638 return res;
639}
640
641
653int getWidgetCallbackMouseUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
654{
655#ifdef SO3_DEBUG
656 MMechostr(MSKDEBUG, "getWidgetCallbackMouseUpEvent\n");
657#endif
658
659 int k;
660 int res = 0;
661 MMOUSE* result = (MMOUSE*)param;
662
663 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_MOUSE_UP_EVENT)))
664 {
665 MMpush(m, ITOM(result->x));
666 MMpush(m, ITOM(result->y));
667 MMpush(m, ITOM(result->btn));
668
669 res = OBJcallreflex(m, 3);
670 }
671
672 delete(result);
673 return res;
674}
675
676
688int getWidgetCallbackMouseWheelEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
689{
690#ifdef SO3_DEBUG
691 MMechostr(MSKDEBUG, "getWidgetCallbackMouseWheelEvent\n");
692#endif
693
694 int k;
695 int res = 0;
696 MMOUSE* result = (MMOUSE*)param;
697
698 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_MOUSEWHEEL_EVENT)))
699 {
700 MMpush(m, ITOM(result->x));
701 MMpush(m, ITOM(result->y));
702 MMpush(m, ITOM(result->scroll));
703
704 res = OBJcallreflex(m, 3);
705 }
706
707 delete(result);
708 return res;
709}
710
711
723int getWidgetCallbackTouchAddEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
724{
725#ifdef SO3_DEBUG
726 MMechostr(MSKDEBUG, "getWidgetCallbackTouchAddEvent\n");
727#endif
728
729 int k;
730 int res = 0;
731 MMOUSE* result = (MMOUSE*)param;
732
733 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_TOUCH_ADD_EVENT)))
734 {
735 MMpush(m, ITOM(result->index));
736 MMpush(m, ITOM(result->x));
737 MMpush(m, ITOM(result->y));
738
739 res = OBJcallreflex(m, 3);
740 }
741
742 delete(result);
743 return res;
744}
745
746
758int getWidgetCallbackTouchRemoveEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
759{
760#ifdef SO3_DEBUG
761 MMechostr(MSKDEBUG, "getWidgetCallbackTouchRemoveEvent\n");
762#endif
763
764 int k;
765 int res = 0;
766 MMOUSE* result = (MMOUSE*)param;
767
768 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_TOUCH_REMOVE_EVENT)))
769 {
770 MMpush(m, ITOM(result->index));
771 MMpush(m, ITOM(result->x));
772 MMpush(m, ITOM(result->y));
773
774 res = OBJcallreflex(m, 3);
775 }
776
777 delete(result);
778 return res;
779}
780
781
793int getWidgetCallbackTouchUpdateEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
794{
795#ifdef SO3_DEBUG
796 MMechostr(MSKDEBUG, "getWidgetCallbackTouchUpdateEvent\n");
797#endif
798
799 int k;
800 int res = 0;
801 MMOUSE* result = (MMOUSE*)param;
802
803 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_TOUCH_UPDATE_EVENT)))
804 {
805 MMpush(m, ITOM(result->index));
806 MMpush(m, ITOM(result->x));
807 MMpush(m, ITOM(result->y));
808 MMpush(m, ITOM(result->vx));
809 MMpush(m, ITOM(result->vy));
810
811 res = OBJcallreflex(m, 5);
812 }
813
814 delete(result);
815 return res;
816}
817
818
830int getWidgetCallbackInputDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
831{
832#ifdef SO3_DEBUG
833 MMechostr(MSKDEBUG, "getWidgetCallbackInputDownEvent\n");
834#endif
835
836 int k;
837 int res = 0;
838 MMOUSE* result = (MMOUSE*)param;
839
840 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_INPUT_DOWN_EVENT)))
841 {
842 MMpush(m, ITOM(result->index));
843 MMpush(m, ITOM(result->x));
844 MMpush(m, ITOM(result->y));
845 MMpush(m, ITOM(result->btn));
846
847 res = OBJcallreflex(m, 4);
848 }
849
850 delete(result);
851 return res;
852}
853
854
866int getWidgetCallbackInputUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
867{
868#ifdef SO3_DEBUG
869 MMechostr(MSKDEBUG, "getWidgetCallbackInputUpEvent\n");
870#endif
871
872 int k;
873 int res = 0;
874 MMOUSE* result = (MMOUSE*)param;
875
876 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_INPUT_UP_EVENT)))
877 {
878 MMpush(m, ITOM(result->index));
879 MMpush(m, ITOM(result->x));
880 MMpush(m, ITOM(result->y));
881 MMpush(m, ITOM(result->btn));
882
883 res = OBJcallreflex(m, 4);
884 }
885
886 delete(result);
887 return res;
888}
889
890
902int getWidgetCallbackInputUpdateEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
903{
904#ifdef SO3_DEBUG
905 MMechostr(MSKDEBUG, "getWidgetCallbackInputUpdateEvent\n");
906#endif
907
908 int k;
909 int res = 0;
910 MMOUSE* result = (MMOUSE*)param;
911
912 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_INPUT_UPDATE_EVENT)))
913 {
914 MMpush(m, ITOM(result->index));
915 MMpush(m, ITOM(result->x));
916 MMpush(m, ITOM(result->y));
917 MMpush(m, ITOM(result->btn));
918
919 res = OBJcallreflex(m, 4);
920 }
921
922 delete(result);
923 return res;
924}
925
926
938int getWidgetCallbackInputWheelEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
939{
940#ifdef SO3_DEBUG
941 MMechostr(MSKDEBUG, "getWidgetCallbackInputWheelEvent\n");
942#endif
943
944 int k;
945 int res = 0;
946 MMOUSE* result = (MMOUSE*)param;
947
948 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_INPUT_WHEEL_EVENT)))
949 {
950 MMpush(m, ITOM(result->index));
951 MMpush(m, ITOM(result->x));
952 MMpush(m, ITOM(result->y));
953 MMpush(m, ITOM(result->scroll));
954
955 res = OBJcallreflex(m, 4);
956 }
957
958 delete(result);
959 return res;
960}
961
962
974int getWidgetCallbackKeyDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
975{
976#ifdef SO3_DEBUG
977 MMechostr(MSKDEBUG, "getWidgetCallbackKeyDownEvent\n");
978#endif
979
980 int k;
981 int res = 0;
982 ScolMessageParameterKeyboard* result = (ScolMessageParameterKeyboard*)param;
983
984 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_KEY_DOWN_EVENT)))
985 {
986 MMpush(m, ITOM(result->lParam));
987 MMpush(m, ITOM(result->wParam));
988 res = OBJcallreflex(m, 2);
989 }
990
991 delete(result);
992 return res;
993}
994
995
1007int getWidgetCallbackKeyUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1008{
1009#ifdef SO3_DEBUG
1010 MMechostr(MSKDEBUG, "getWidgetCallbackKeyUpEvent\n");
1011#endif
1012
1013 int k;
1014 int res = 0;
1015 ScolMessageParameterKeyboard* result = (ScolMessageParameterKeyboard*)param;
1016
1017 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_KEY_UP_EVENT)))
1018 {
1019 MMpush(m, ITOM(result->lParam));
1020 res = OBJcallreflex(m, 1);
1021 }
1022
1023 delete(result);
1024 return res;
1025}
1026
1027
1039int getWidgetCallbackKeyEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1040{
1041#ifdef SO3_DEBUG
1042 MMechostr(MSKDEBUG, "getWidgetCallbackKeyEvent\n");
1043#endif
1044
1045 int k;
1046 int res = 0;
1047 ScolMessageParameterKeyboard* result = (ScolMessageParameterKeyboard*)param;
1048
1049 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_KEY_EVENT)))
1050 {
1051 MMpush(m, ITOM(result->msg));
1052 MMpush(m, ITOM(result->lParam));
1053 MMpush(m, ITOM(result->wParam));
1054 res = OBJcallreflex(m, 3);
1055 }
1056
1057 delete(result);
1058 return res;
1059}
1060
1061
1073int getWidgetCallbackFocusEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1074{
1075#ifdef SO3_DEBUG
1076 MMechostr(MSKDEBUG, "getWidgetCallbackFocusEvent\n");
1077#endif
1078
1079 int k;
1080 int res = 0;
1081 int result = (int)param;
1082
1083 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_FOCUS_EVENT)))
1084 {
1085 MMpush(m, ITOM(result));
1086 res = OBJcallreflex(m, 1);
1087 }
1088 return res;
1089}
1090
1102int getWidgetCallbackOnLoadStartEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1103{
1104#ifdef SO3_DEBUG
1105 MMechostr(MSKDEBUG, "getWidgetCallbackOnLoadStartEvent\n");
1106#endif
1107
1108 int k;
1109 int res = 0;
1110
1111 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_ON_LOAD_START_EVENT)))
1112 {
1113 res = OBJcallreflex(m, 0);
1114 }
1115 return res;
1116}
1117
1129int getWidgetCallbackOnLoadEndEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1130{
1131#ifdef SO3_DEBUG
1132 MMechostr(MSKDEBUG, "getWidgetCallbackOnLoadEndEvent\n");
1133#endif
1134
1135 int res = 0;
1136#if SO3_WEB_NAVIGATOR_BUILD == 1
1137 int k;
1138
1139 SWidget* sWidget = (SWidget*)id;
1140 SWebNavigatorWidget* targetWidget = static_cast<SWebNavigatorWidget*>(sWidget);
1141 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_ON_LOAD_END_EVENT)))
1142 {
1143 // force the update only if the scol object is valid
1144 if (targetWidget && targetWidget->GetUpdateOnFocusOnly() && !targetWidget->HasFocus())
1145 targetWidget->Update(true);
1146
1147 res = OBJcallreflex(m, 0);
1148 }
1149#endif
1150 return res;
1151}
1152
1164int getWidgetCallbackOnLoadErrorEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
1165{
1166#ifdef SO3_DEBUG
1167 MMechostr(MSKDEBUG, "getWidgetCallbackOnLoadErrorEvent\n");
1168#endif
1169
1170 int res = 0;
1171#if SO3_WEB_NAVIGATOR_BUILD == 1
1172 int k;
1173
1174 SWidget* sWidget = (SWidget*)id;
1175 SWebNavigatorWidget* targetWidget = static_cast<SWebNavigatorWidget*>(sWidget);
1176
1177 if (!(k = OBJbeginreflex(m, SO3WIDGET, id, SO3_WIDGET_ON_LOAD_ERROR_EVENT)))
1178 {
1179 // force the update only if the scol object is valid
1180 if (targetWidget && targetWidget->GetUpdateOnFocusOnly() && !targetWidget->HasFocus())
1181 targetWidget->Update(true);
1182
1183 Mpushstrbloc(m, (char*)param);
1184 res = OBJcallreflex(m, 1);
1185 }
1186#endif
1187 return res;
1188}
1189
1199int SO3WidgetLoadFile(mmachine m)
1200{
1201#ifdef SO3_DEBUG
1202 MMechostr(MSKDEBUG, "SO3WidgetLoadFile\n");
1203#endif
1204
1205 int ff = MMpull(m);
1206 int fc = MMget(m, 0);
1207 if ((fc == NIL) || (ff == NIL))
1208 {
1209 MMset(m, 0, NIL);
1210 return 0;
1211 }
1212
1213 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1214 if (widget == 0)
1215 {
1216 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1217 MMset(m, 0, NIL);
1218 return 0;
1219 }
1220
1221 char* file = MMstartstr(m, MTOP(ff));
1222 if (file == 0)
1223 {
1224 MMechostr(MSKDEBUG, "file is NULL \n");
1225 MMset(m, 0, NIL);
1226 return 0;
1227 }
1228
1229 if (!strcmp("", file))
1230 {
1231 MMechostr(MSKDEBUG, "file is NULL \n");
1232 MMset(m, 0, NIL);
1233 return 0;
1234 }
1235
1236 try
1237 {
1238 widget->LoadFile(std::string(file));
1239 }
1240 catch (const Ogre::Exception& e)
1241 {
1242 MMechostr(MSKDEBUG, "An error occurs while trying to load a file named \"%s\" on a widget: %s\n", file, e.what());
1243 MMset(m, 0, NIL);
1244 return 0;
1245 }
1246 MMset(m, 0, ITOM(1));
1247 return 0;
1248}
1249
1250
1260int SO3WidgetLoadUrl(mmachine m)
1261{
1262#ifdef SO3_DEBUG
1263 MMechostr(MSKDEBUG, "SO3WidgetLoadUrl\n");
1264#endif
1265
1266 int u = MMpull(m);
1267 int fc = MMget(m, 0);
1268 if ((fc == NIL) || (u == NIL))
1269 {
1270 MMset(m, 0, NIL);
1271 return 0;
1272 }
1273
1274 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1275 if (widget == 0)
1276 {
1277 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1278 MMset(m, 0, NIL);
1279 return 0;
1280 }
1281
1282 const char* url = MMstartstr(m, MTOP(u));
1283 if (url == 0)
1284 {
1285 MMechostr(MSKDEBUG, "url is NULL \n");
1286 MMset(m, 0, NIL);
1287 return 0;
1288 }
1289
1290 if (!strcmp("", url))
1291 {
1292 MMechostr(MSKDEBUG, "url is NULL \n");
1293 MMset(m, 0, NIL);
1294 return 0;
1295 }
1296
1297 try
1298 {
1299 widget->LoadURL(std::string(url));
1300 }
1301 catch (const Ogre::Exception& e)
1302 {
1303 MMechostr(MSKDEBUG, "An error occurs while trying to load an URL to \"%s\"on a widget: %s\n", url, e.what());
1304 MMset(m, 0, NIL);
1305 return 0;
1306 }
1307 MMset(m, 0, ITOM(1));
1308 return 0;
1309}
1310
1311
1320int SO3WidgetDestroy(mmachine m)
1321{
1322#ifdef SO3_DEBUG
1323 MMechostr(MSKDEBUG, "SO3WidgetDestroy\n");
1324#endif
1325
1326 int fc = MMget(m, 0);
1327 if (fc == NIL)
1328 {
1329 MMset(m, 0, NIL);
1330 return 0;
1331 }
1332
1333 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1334 if (widget == 0)
1335 {
1336 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1337 MMset(m, 0, NIL);
1338 return 0;
1339 }
1340
1341 OBJdelTM(m, SO3WIDGET, fc);
1342
1343#ifdef SO3_DEBUG
1344 MMechostr(MSKDEBUG, "SO3WidgetDestroy : OK !\n");
1345#endif
1346
1347 MMset(m, 0, ITOM(1));
1348 return 0;
1349}
1350
1351
1361int SO3WidgetSetZOrder(mmachine m)
1362{
1363#ifdef SO3_DEBUG
1364 MMechostr(MSKDEBUG, "SO3WidgetSetZOrder\n");
1365#endif
1366
1367 int z = MMpull(m);
1368 int fc = MMget(m, 0);
1369 if ((fc == NIL) || (z == NIL))
1370 {
1371 MMset(m, 0, NIL);
1372 return 0;
1373 }
1374
1375 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1376 if (widget == NULL)
1377 {
1378 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1379 MMset(m, 0, NIL);
1380 return 0;
1381 }
1382
1383 int val = MTOI(z);
1384 widget->SetZOrder((unsigned short)val);
1385
1386 MMset(m, 0, ITOM(1));
1387 return 0;
1388}
1389
1390
1401{
1402#ifdef SO3_DEBUG
1403 MMechostr(MSKDEBUG, "SO3WidgetSetForeground\n");
1404#endif
1405
1406 int b = MMpull(m);
1407 int fc = MMget(m, 0);
1408 if ((fc == NIL) || (b == NIL))
1409 {
1410 MMset(m, 0, NIL);
1411 return 0;
1412 }
1413
1414 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1415 if (widget == NULL)
1416 {
1417 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1418 MMset(m, 0, NIL);
1419 return 0;
1420 }
1421
1422 bool enable = false;
1423 if (MTOI(b) == 1)
1424 enable = true;
1425
1426 widget->SetForeground(enable);
1427 MMset(m, 0, ITOM(1));
1428 return 0;
1429}
1430
1431
1441{
1442#ifdef SO3_DEBUG
1443 MMechostr(MSKDEBUG, "SO3WidgetGetForeground\n");
1444#endif
1445
1446 int fc = MMget(m, 0);
1447 if (fc == NIL)
1448 {
1449 MMset(m, 0, NIL);
1450 return 0;
1451 }
1452
1453 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1454 if (widget == NULL)
1455 {
1456 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1457 MMset(m, 0, NIL);
1458 return 0;
1459 }
1460
1461 int val = 0;
1462 if (widget->GetForeground())
1463 val = 1;
1464
1465 MMset(m, 0, ITOM(val));
1466 return 0;
1467}
1468
1469
1480{
1481#ifdef SO3_DEBUG
1482 MMechostr(MSKDEBUG, "SO3WidgetSetTopOnFocus\n");
1483#endif
1484
1485 int b = MMpull(m);
1486 int fc = MMget(m, 0);
1487 if ((fc == NIL) || (b == NIL))
1488 {
1489 MMset(m, 0, NIL);
1490 return 0;
1491 }
1492
1493 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1494 if (widget == NULL)
1495 {
1496 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1497 MMset(m, 0, NIL);
1498 return 0;
1499 }
1500
1501 bool enable = false;
1502 if (MTOI(b) == 1)
1503 enable = true;
1504
1505 widget->SetTopOnFocus(enable);
1506
1507 MMset(m, 0, ITOM(1));
1508 return 0;
1509}
1510
1511
1521{
1522#ifdef SO3_DEBUG
1523 MMechostr(MSKDEBUG, "SO3WidgetGetTopOnFocus\n");
1524#endif
1525
1526 int fc = MMget(m, 0);
1527 if (fc == NIL)
1528 {
1529 MMset(m, 0, NIL);
1530 return 0;
1531 }
1532
1533 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1534 if (widget == NULL)
1535 {
1536 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1537 MMset(m, 0, NIL);
1538 return 0;
1539 }
1540
1541 int val = 0;
1542 if (widget->GetTopOnFocus())
1543 val = 1;
1544
1545 MMset(m, 0, ITOM(val));
1546 return 0;
1547}
1548
1549
1561{
1562#ifdef SO3_DEBUG
1563 MMechostr(MSKDEBUG, "SO3WidgetSetIgnoreTransparentPixels\n");
1564#endif
1565
1566 int t = MMpull(m);
1567 int b = MMpull(m);
1568 int fc = MMget(m, 0);
1569 if ((fc == NIL) || (b == NIL) || (t == NIL))
1570 {
1571 MMset(m, 0, NIL);
1572 return 0;
1573 }
1574
1575 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1576 if (widget == NULL)
1577 {
1578 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1579 MMset(m, 0, NIL);
1580 return 0;
1581 }
1582
1583 bool ignore = false;
1584 if (MTOI(b) == 1)
1585 ignore = true;
1586
1587 widget->SetIgnoreTransparentPixels(ignore, MTOF(t));
1588 MMset(m, 0, ITOM(1));
1589 return 0;
1590}
1591
1592
1602{
1603#ifdef SO3_DEBUG
1604 MMechostr(MSKDEBUG, "SO3WidgetGetIgnoreTransparentPixels\n");
1605#endif
1606
1607 int fc = MMget(m, 0);
1608 if (fc == NIL)
1609 {
1610 MMset(m, 0, NIL);
1611 return 0;
1612 }
1613
1614 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1615 if (widget == NULL)
1616 {
1617 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1618 MMset(m, 0, NIL);
1619 return 0;
1620 }
1621
1622 float valT = widget->GetIgnoreTransparentPixelsTreshold();
1623 int valI = 0;
1624 if (widget->GetIgnoreTransparentPixels())
1625 valI = 1;
1626
1627
1628 int tuple = MMmalloc(m, 2, TYPETAB);
1629 if (tuple == NIL)
1630 {
1631 MMset(m, 0, NIL);
1632 return MERRMEM;
1633 }
1634
1635 MMstore(m, tuple, 0, ITOM((int)(valI)));
1636 MMstore(m, tuple, 1, FTOM((float)(valT)));
1637 MMset(m, 0, PTOM(tuple));
1638 return 0;
1639}
1640
1641
1650int SO3WidgetSetFocus(mmachine m)
1651{
1652#ifdef SO3_DEBUG
1653 MMechostr(MSKDEBUG, "SO3WidgetSetFocus\n");
1654#endif
1655
1656 int fc = MMget(m, 0);
1657 if (fc == NIL)
1658 {
1659 MMset(m, 0, NIL);
1660 return 0;
1661 }
1662
1663 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1664 if (widget == NULL)
1665 {
1666 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1667 MMset(m, 0, NIL);
1668 return 0;
1669 }
1670
1671 widget->TakeFocus();
1672 MMset(m, 0, ITOM(1));
1673 return 0;
1674}
1675
1684int SO3WidgetUnFocus(mmachine m)
1685{
1686#ifdef SO3_DEBUG
1687 MMechostr(MSKDEBUG, "SO3WidgetSetFocus\n");
1688#endif
1689
1690 int fc = MMget(m, 0);
1691 if (fc == NIL)
1692 {
1693 MMset(m, 0, NIL);
1694 return 0;
1695 }
1696
1697 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1698 if (widget == NULL)
1699 {
1700 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1701 MMset(m, 0, NIL);
1702 return 0;
1703 }
1704
1705 widget->ReleaseFocus();
1706 MMset(m, 0, ITOM(1));
1707 return 0;
1708}
1709
1718int SO3WidgetGetZOrder(mmachine m)
1719{
1720#ifdef SO3_DEBUG
1721 MMechostr(MSKDEBUG, "SO3WidgetGetZOrder\n");
1722#endif
1723
1724 int fc = MMget(m, 0);
1725 if (fc == NIL)
1726 {
1727 MMset(m, 0, NIL);
1728 return 0;
1729 }
1730
1731 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1732 if (widget == NULL)
1733 {
1734 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1735 MMset(m, 0, NIL);
1736 return 0;
1737 }
1738
1739 MMset(m, 0, ITOM(static_cast<int> (widget->GetZOrder())));
1740 return 0;
1741}
1742
1743
1755{
1756#ifdef SO3_DEBUG
1757 MMechostr(MSKDEBUG, "SO3WidgetSetPosition\n");
1758#endif
1759
1760 int y = MTOI(MMpull(m));
1761 int x = MTOI(MMpull(m));
1762 int fc = MMget(m, 0);
1763 if ((fc == NIL))
1764 {
1765 MMset(m, 0, NIL);
1766 return 0;
1767 }
1768
1769 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1770 if (widget == NULL)
1771 {
1772 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1773 MMset(m, 0, NIL);
1774 return 0;
1775 }
1776
1777 widget->SetPosition(SPoint<int>(x, y));
1778 MMset(m, 0, ITOM(1));
1779 return 0;
1780}
1781
1782
1792{
1793#ifdef SO3_DEBUG
1794 MMechostr(MSKDEBUG, "SO3WidgetGetPosition\n");
1795#endif
1796
1797 int fc = MMget(m, 0);
1798 if (fc == NIL)
1799 {
1800 MMset(m, 0, NIL);
1801 return 0;
1802 }
1803
1804 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1805 if (widget == NULL)
1806 {
1807 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1808 MMset(m, 0, NIL);
1809 return 0;
1810 }
1811
1812 int tuple = MMmalloc(m, 2, TYPETAB);
1813 if (tuple == NIL)
1814 {
1815 MMset(m, 0, NIL);
1816 return MERRMEM;
1817 }
1818
1819 SPoint<int> currentPosition = widget->GetPosition();
1820 MMstore(m, tuple, 0, ITOM(currentPosition.x));
1821 MMstore(m, tuple, 1, ITOM(currentPosition.y));
1822 MMset(m, 0, PTOM(tuple));
1823 return 0;
1824}
1825
1836{
1837#ifdef SO3_DEBUG
1838 MMechostr(MSKDEBUG, "SO3WidgetSetTextureRatio\n");
1839#endif
1840
1841 int scolScale = MMpull(m);
1842 int scolWidget = MMget(m, 0);
1843 if ((scolWidget == NIL) || (scolScale == NIL))
1844 {
1845 MMset(m, 0, NIL);
1846 return 0;
1847 }
1848
1849 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(scolWidget));
1850 if (widget == NULL)
1851 {
1852 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1853 MMset(m, 0, NIL);
1854 return 0;
1855 }
1856
1857 float scale = MTOF(scolScale);
1858 if ((scale <= 0.0f) || (scale > 1.0f))
1859 {
1860 MMechostr(MSKDEBUG, "Invalid texture ratio provided!\n");
1861 MMset(m, 0, NIL);
1862 return 0;
1863 }
1864
1865 widget->SetTextureRatio(scale);
1866 MMset(m, 0, ITOM(1));
1867 return 0;
1868}
1869
1879{
1880#ifdef SO3_DEBUG
1881 MMechostr(MSKDEBUG, "SO3WidgetGetTextureRatio\n");
1882#endif
1883
1884 int scolWidget = MMget(m, 0);
1885 if (scolWidget == NIL)
1886 {
1887 MMset(m, 0, NIL);
1888 return 0;
1889 }
1890
1891 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(scolWidget));
1892 if (widget == 0)
1893 {
1894 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1895 MMset(m, 0, NIL);
1896 return 0;
1897 }
1898
1899 MMset(m, 0, FTOM(widget->GetTextureRatio()));
1900 return 0;
1901}
1902
1911int SO3WidgetGetSize(mmachine m)
1912{
1913#ifdef SO3_DEBUG
1914 MMechostr(MSKDEBUG, "SO3WidgetGetSize\n");
1915#endif
1916
1917 int fc = MMget(m, 0);
1918 if (fc == NIL)
1919 {
1920 MMset(m, 0, NIL);
1921 return 0;
1922 }
1923
1924 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1925 if (widget == 0)
1926 {
1927 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1928 MMset(m, 0, NIL);
1929 return 0;
1930 }
1931
1932 int tuple = MMmalloc(m, 2, TYPETAB);
1933 if (tuple == NIL)
1934 {
1935 MMset(m, 0, NIL);
1936 return MERRMEM;
1937 }
1938
1939 MMstore(m, tuple, 0, ITOM((int)(widget->GetWidth())));
1940 MMstore(m, tuple, 1, ITOM((int)(widget->GetHeight())));
1941 MMset(m, 0, PTOM(tuple));
1942 return 0;
1943}
1944
1945
1956int SO3WidgetSetSize(mmachine m)
1957{
1958#ifdef SO3_DEBUG
1959 MMechostr(MSKDEBUG, "SO3WidgetSetSize\n");
1960#endif
1961
1962 int h = MTOI(MMpull(m));
1963 int w = MTOI(MMpull(m));
1964 int fc = MMget(m, 0);
1965 if (fc == NIL)
1966 {
1967 MMset(m, 0, NIL);
1968 return 0;
1969 }
1970
1971 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
1972 if (widget == 0)
1973 {
1974 MMechostr(MSKDEBUG, "widget instance is NULL \n");
1975 MMset(m, 0, NIL);
1976 return 0;
1977 }
1978
1979 try
1980 {
1981 widget->SetSize(abs(w), abs(h));
1982 }
1983 catch (Ogre::Exception &e)
1984 {
1985 MMechostr(MSKDEBUG, "An exception has occurred: %s\n", e.what());
1986 MMset(m, 0, NIL);
1987 return 0;
1988 }
1989
1990 MMset(m, 0, ITOM(1));
1991 return 0;
1992}
1993
1994
2003int SO3WidgetGetName(mmachine m)
2004{
2005#ifdef SO3_DEBUG
2006 MMechostr(MSKDEBUG, "SO3WidgetGetName\n");
2007#endif
2008
2009 int fc = MMget(m, 0);
2010 if (fc == NIL)
2011 {
2012 MMset(m, 0, NIL);
2013 return 0;
2014 }
2015
2016 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2017 if (widget == 0)
2018 {
2019 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2020 MMset(m, 0, NIL);
2021 return 0;
2022 }
2023
2024 MMpull(m);
2025 return Mpushstrbloc(m, (char*)(widget->GetName().c_str()));
2026}
2027
2028
2037int SO3WidgetGetType(mmachine m)
2038{
2039#ifdef SO3_DEBUG
2040 MMechostr(MSKDEBUG, "SO3WidgetGetType\n");
2041#endif
2042
2043 int fc = MMget(m, 0);
2044 if (fc == NIL)
2045 {
2046 MMset(m, 0, NIL);
2047 return 0;
2048 }
2049
2050 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2051 if (widget == 0)
2052 {
2053 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2054 MMset(m, 0, NIL);
2055 return 0;
2056 }
2057
2058 MMpull(m);
2059 return Mpushstrbloc(m, (char*)(widget->GetType().c_str()));
2060}
2061
2062
2071int SO3WidgetGetMode(mmachine m)
2072{
2073#ifdef SO3_DEBUG
2074 MMechostr(MSKDEBUG, "SO3WidgetGetMode\n");
2075#endif
2076
2077 int fc = MMget(m, 0);
2078 if (fc == NIL)
2079 {
2080 MMset(m, 0, NIL);
2081 return 0;
2082 }
2083
2084 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2085 if (widget == 0)
2086 {
2087 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2088 MMset(m, 0, NIL);
2089 return 0;
2090 }
2091
2092 int mode = 3;
2093 if (widget->GetIsOverlayed())
2094 mode = 1;
2095 else if (widget->GetIs2DRect())
2096 mode = 2;
2097
2098 MMset(m, 0, ITOM(mode));
2099 return 0;
2100}
2101
2102
2112int SO3WidgetSetStereo(mmachine m)
2113{
2114#ifdef SO3_DEBUG
2115 MMechostr(MSKDEBUG, "SO3WidgetSetStereo\n");
2116#endif
2117
2118 int st = MMpull(m);
2119 int fc = MMget(m, 0);
2120 if (fc == NIL)
2121 {
2122 MMset(m, 0, NIL);
2123 return 0;
2124 }
2125
2126 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2127 if (widget == 0)
2128 {
2129 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2130 MMset(m, 0, NIL);
2131 return 0;
2132 }
2133
2134 SWidget::StereoMode state = (st == NIL) ? SWidget::StereoMode::MONO : (SWidget::StereoMode)MTOI(st);
2135 widget->SetStereo(state);
2136
2137 return 0;
2138}
2139
2140
2149int SO3WidgetGetStereo(mmachine m)
2150{
2151#ifdef SO3_DEBUG
2152 MMechostr(MSKDEBUG, "SO3WidgetGetStereo\n");
2153#endif
2154
2155 int fc = MMget(m, 0);
2156 if (fc == NIL)
2157 {
2158 MMset(m, 0, NIL);
2159 return 0;
2160 }
2161
2162 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2163 if (widget == 0)
2164 {
2165 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2166 MMset(m, 0, NIL);
2167 return 0;
2168 }
2169
2170 int state = widget->GetIsStereo() ? 1 : 0;
2171
2172 MMset(m, 0, ITOM(state));
2173 return 0;
2174}
2175
2176
2187{
2188#ifdef SO3_DEBUG
2189 MMechostr(MSKDEBUG, "SO3WidgetSetStereoEye\n");
2190#endif
2191
2192 int ey = MMpull(m);
2193 int fc = MMget(m, 0);
2194 if (fc == NIL)
2195 {
2196 MMset(m, 0, NIL);
2197 return 0;
2198 }
2199
2200 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2201 if (widget == 0)
2202 {
2203 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2204 MMset(m, 0, NIL);
2205 return 0;
2206 }
2207
2208 bool left = (MTOI(ey) > 0) ? false : true;
2209 widget->SetStereoEye(left);
2210
2211 return 0;
2212}
2213
2214
2225{
2226#ifdef SO3_DEBUG
2227 MMechostr(MSKDEBUG, "SO3WidgetSetVisibility\n");
2228#endif
2229 // TODO Improvments: manage fade in/out enable or not, and fade duration.
2230 int b = MTOI(MMpull(m));
2231 int fc = MMget(m, 0);
2232 if (fc == NIL)
2233 {
2234 MMset(m, 0, NIL);
2235 return 0;
2236 }
2237
2238 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2239 if (widget == NULL)
2240 {
2241 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2242 MMset(m, 0, NIL);
2243 return 0;
2244 }
2245
2246 if (b == 0)
2247 widget->Hide();
2248 else
2249 widget->Show();
2250
2251 MMset(m, 0, ITOM(1));
2252 return 0;
2253}
2254
2255
2265{
2266#ifdef SO3_DEBUG
2267 MMechostr(MSKDEBUG, "SO3WidgetGetVisibility\n");
2268#endif
2269 int fc = MMget(m, 0);
2270 if (fc == NIL)
2271 {
2272 MMset(m, 0, NIL);
2273 return 0;
2274 }
2275
2276 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2277 if (widget == NULL)
2278 {
2279 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2280 MMset(m, 0, NIL);
2281 return 0;
2282 }
2283
2284 int val = 0;
2285 if (widget->GetVisible())
2286 val = 1;
2287
2288 MMset(m, 0, ITOM(val));
2289 return 0;
2290}
2291
2292
2303{
2304#ifdef SO3_DEBUG
2305 MMechostr(MSKDEBUG, "SO3WidgetSetKeyboardEnable\n");
2306#endif
2307 int enab = MTOI(MMpull(m));
2308 int fc = MMget(m, 0);
2309 if (fc == NIL)
2310 {
2311 MMset(m, 0, NIL);
2312 return 0;
2313 }
2314
2315 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2316 if (widget == NULL)
2317 {
2318 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2319 MMset(m, 0, NIL);
2320 return 0;
2321 }
2322
2323 bool enable = false;
2324 if (enab == 1)
2325 enable = true;
2326
2327 widget->SetKeyboardEnable(enable);
2328 MMset(m, 0, ITOM(1));
2329 return 0;
2330}
2331
2332
2342{
2343#ifdef SO3_DEBUG
2344 MMechostr(MSKDEBUG, "SO3WidgetGetKeyboardEnable\n");
2345#endif
2346 int fc = MMget(m, 0);
2347 if (fc == NIL)
2348 {
2349 MMset(m, 0, NIL);
2350 return 0;
2351 }
2352
2353 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2354 if (widget == NULL)
2355 {
2356 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2357 MMset(m, 0, NIL);
2358 return 0;
2359 }
2360
2361 int val = 0;
2362 if (widget->GetKeyboardEnable())
2363 val = 1;
2364
2365 MMset(m, 0, ITOM(val));
2366 return 0;
2367}
2368
2369
2380{
2381#ifdef SO3_DEBUG
2382 MMechostr(MSKDEBUG, "SO3WidgetSetMouseEnable\n");
2383#endif
2384 int enab = MTOI(MMpull(m));
2385 int fc = MMget(m, 0);
2386 if (fc == NIL)
2387 {
2388 MMset(m, 0, NIL);
2389 return 0;
2390 }
2391
2392 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2393 if (widget == NULL)
2394 {
2395 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2396 MMset(m, 0, NIL);
2397 return 0;
2398 }
2399
2400 bool enable = false;
2401 if (enab == 1)
2402 enable = true;
2403
2404 widget->SetMouseEnable(enable);
2405 MMset(m, 0, ITOM(1));
2406 return 0;
2407}
2408
2409
2419{
2420#ifdef SO3_DEBUG
2421 MMechostr(MSKDEBUG, "SO3WidgetGetMouseEnable\n");
2422#endif
2423 int fc = MMget(m, 0);
2424 if (fc == NIL)
2425 {
2426 MMset(m, 0, NIL);
2427 return 0;
2428 }
2429
2430 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2431 if (widget == NULL)
2432 {
2433 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2434 MMset(m, 0, NIL);
2435 return 0;
2436 }
2437
2438 int val = 0;
2439 if (widget->GetMouseEnable())
2440 val = 1;
2441
2442 MMset(m, 0, ITOM(val));
2443 return 0;
2444}
2445
2446
2456{
2457#ifdef SO3_DEBUG
2458 MMechostr(MSKDEBUG, "SO3WidgetIsMouseOver\n");
2459#endif
2460
2461 int fc = MMget(m, 0);
2462 if (fc == NIL)
2463 {
2464 MMset(m, 0, NIL);
2465 return 0;
2466 }
2467
2468 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2469 if (widget == NULL)
2470 {
2471 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2472 MMset(m, 0, NIL);
2473 return 0;
2474 }
2475
2476 int val = 0;
2477 if (widget->GetMouseOver())
2478 val = 1;
2479
2480 MMset(m, 0, ITOM(val));
2481 return 0;
2482}
2483
2484
2495{
2496#ifdef SO3_DEBUG
2497 MMechostr(MSKDEBUG, "SO3WidgetSetTransparency\n");
2498#endif
2499
2500 int b = MMpull(m);
2501 int fc = MMget(m, 0);
2502 if ((fc == NIL) || (b == NIL))
2503 {
2504 MMset(m, 0, NIL);
2505 return 0;
2506 }
2507
2508 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2509 if (widget == NULL)
2510 {
2511 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2512 MMset(m, 0, NIL);
2513 return 0;
2514 }
2515
2516 bool val = false;
2517 if (MTOI(b) == 1)
2518 val = true;
2519
2520 widget->SetTransparency(val);
2521 MMset(m, 0, ITOM(1));
2522 return 0;
2523}
2524
2525
2535{
2536#ifdef SO3_DEBUG
2537 MMechostr(MSKDEBUG, "SO3WidgetGetTransparency\n");
2538#endif
2539
2540 int fc = MMget(m, 0);
2541 if (fc == NIL)
2542 {
2543 MMset(m, 0, NIL);
2544 return 0;
2545 }
2546
2547 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2548 if (widget == NULL)
2549 {
2550 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2551 MMset(m, 0, NIL);
2552 return 0;
2553 }
2554
2555 int val = 0;
2556 if (widget->GetTransparency())
2557 val = 1;
2558
2559 MMset(m, 0, ITOM(val));
2560 return 0;
2561}
2562
2563
2573int SO3WidgetSetOpacity(mmachine m)
2574{
2575#ifdef SO3_DEBUG
2576 MMechostr(MSKDEBUG, "SO3WidgetSetOpacity\n");
2577#endif
2578
2579 int opacity = MMpull(m);
2580 int fc = MMget(m, 0);
2581 if ((fc == NIL) || (opacity == NIL))
2582 {
2583 MMset(m, 0, NIL);
2584 return 0;
2585 }
2586
2587 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2588 if (widget == NULL)
2589 {
2590 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2591 MMset(m, 0, NIL);
2592 return 0;
2593 }
2594
2595 widget->SetOpacity(MTOF(opacity));
2596 MMset(m, 0, ITOM(1));
2597 return 0;
2598}
2599
2600
2609int SO3WidgetGetOpacity(mmachine m)
2610{
2611#ifdef SO3_DEBUG
2612 MMechostr(MSKDEBUG, "SO3WidgetGetOpacity\n");
2613#endif
2614
2615 int fc = MMget(m, 0);
2616 if (fc == NIL)
2617 {
2618 MMset(m, 0, NIL);
2619 return 0;
2620 }
2621
2622 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2623 if (widget == NULL)
2624 {
2625 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2626 MMset(m, 0, NIL);
2627 return 0;
2628 }
2629
2630 MMset(m, 0, FTOM(widget->GetOpacity()));
2631 return 0;
2632}
2633
2634
2643int SO3WidgetHasFocus(mmachine m)
2644{
2645#ifdef SO3_DEBUG
2646 MMechostr(MSKDEBUG, "SO3WidgetHasFocus\n");
2647#endif
2648
2649 int fc = MMget(m, 0);
2650 if (fc == NIL)
2651 {
2652 MMset(m, 0, NIL);
2653 return 0;
2654 }
2655
2656 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2657 if (widget == NULL)
2658 {
2659 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2660 MMset(m, 0, NIL);
2661 return 0;
2662 }
2663
2664 int val = 0;
2665 if (widget->HasFocus())
2666 val = 1;
2667
2668 MMset(m, 0, ITOM(val));
2669 return 0;
2670}
2671
2672
2685{
2686#ifdef SO3_DEBUG
2687 MMechostr(MSKDEBUG, "SO3WidgetCallFunction\n");
2688#endif
2689
2690 int list = MTOP(MMpull(m));
2691 int f = MMpull(m);
2692 int fc = MMget(m, 0);
2693 if ((fc == NIL) || (f == NIL))
2694 {
2695 MMset(m, 0, NIL);
2696 return 0;
2697 }
2698
2699 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(fc));
2700 if (widget == NULL)
2701 {
2702 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2703 MMset(m, 0, NIL);
2704 return 0;
2705 }
2706
2707 // Get function name
2708 std::string asFunc(MMstartstr(m, MTOP(f)));
2709
2710 // Get funtion's parameters
2711 std::vector<std::string> argVec;
2712 int curPointer;
2713 while (list != NIL)
2714 {
2715 curPointer = MTOP(MMfetch(m, list, 0));
2716 if (curPointer != NIL)
2717 {
2718 std::string argumentStr(MMstartstr(m, curPointer));
2719 argVec.push_back(argumentStr);
2720 list = MTOP(MMfetch(m, list, 1));
2721 }
2722 }
2723
2724 // Call function with parameters.
2725 try
2726 {
2727 widget->RunScriptFunction(asFunc, argVec);
2728 }
2729 catch (Ogre::Exception &e)
2730 {
2731 MMechostr(MSKRUNTIME, "An exception has occurred: %s\n", e.what());
2732 MMset(m, 0, NIL);
2733 return 0;
2734 }
2735
2736 MMset(m, 0, ITOM(1));
2737 return 0;
2738}
2739
2749{
2750#ifdef SO3_DEBUG
2751 MMechostr(MSKDEBUG, "SO3WidgetGetUpdateOnFocusOnly\n");
2752#endif
2753
2754 int scolWidget = MMget(m, 0);
2755 if (scolWidget == NIL)
2756 {
2757 MMset(m, 0, NIL);
2758 return 0;
2759 }
2760
2761 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(scolWidget));
2762 if (widget == NULL)
2763 {
2764 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2765 MMset(m, 0, NIL);
2766 return 0;
2767 }
2768
2769 if (widget->GetUpdateOnFocusOnly())
2770 MMset(m, 0, ITOM(1));
2771 else
2772 MMset(m, 0, ITOM(0));
2773 return 0;
2774}
2775
2786{
2787#ifdef SO3_DEBUG
2788 MMechostr(MSKDEBUG, "SO3WidgetSetUpdateOnFocusOnly\n");
2789#endif
2790
2791 int scolActivateOnFocusOnly = MMpull(m);
2792 int scolWidget = MMget(m, 0);
2793 if ((scolWidget == NIL) || (scolActivateOnFocusOnly == NIL))
2794 {
2795 MMset(m, 0, NIL);
2796 return 0;
2797 }
2798
2799 SWidget* widget = MMgetPointer<SWidget*>(m, MTOP(scolWidget));
2800 if (widget == NULL)
2801 {
2802 MMechostr(MSKDEBUG, "widget instance is NULL \n");
2803 MMset(m, 0, NIL);
2804 return 0;
2805 }
2806
2807 bool activateOnFocusOnly = false;
2808 if (MTOI(scolActivateOnFocusOnly) == 1)
2809 activateOnFocusOnly = true;
2810
2811 widget->SetUpdateOnFocusOnly(activateOnFocusOnly);
2812 return 0;
2813}
2814
2826{
2827#ifdef SO3_DEBUG
2828 MMechostr(MSKDEBUG, "SO3WidgetEnterEventCb\n");
2829#endif
2830
2831 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_ENTER_EVENT);
2832}
2833
2834
2846{
2847#ifdef SO3_DEBUG
2848 MMechostr(MSKDEBUG, "SO3WidgetExitEventCb\n");
2849#endif
2850
2851 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_EXIT_EVENT);
2852}
2853
2854
2870{
2871#ifdef SO3_DEBUG
2872 MMechostr(MSKDEBUG, "SO3WidgetMouseMoveEventCb\n");
2873#endif
2874
2875 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_MOUSE_MOVE_EVENT);
2876}
2877
2878
2894{
2895#ifdef SO3_DEBUG
2896 MMechostr(MSKDEBUG, "SO3WidgetMouseDownEventCb\n");
2897#endif
2898
2899 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_MOUSE_DOWN_EVENT);
2900}
2901
2902
2918{
2919#ifdef SO3_DEBUG
2920 MMechostr(MSKDEBUG, "SO3WidgetMouseUpEventCb\n");
2921#endif
2922
2923 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_MOUSE_UP_EVENT);
2924}
2925
2926
2942{
2943#ifdef SO3_DEBUG
2944 MMechostr(MSKDEBUG, "SO3WidgetMouseWheelEventCb\n");
2945#endif
2946
2947 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_MOUSEWHEEL_EVENT);
2948}
2949
2950
2966{
2967#ifdef SO3_DEBUG
2968 MMechostr(MSKDEBUG, "SO3WidgetTouchAddEventCb\n");
2969#endif
2970
2971 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_TOUCH_ADD_EVENT);
2972}
2973
2974
2990{
2991#ifdef SO3_DEBUG
2992 MMechostr(MSKDEBUG, "SO3WidgetTouchRemoveEventCb\n");
2993#endif
2994
2995 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_TOUCH_REMOVE_EVENT);
2996}
2997
2998
3016{
3017#ifdef SO3_DEBUG
3018 MMechostr(MSKDEBUG, "SO3WidgetTouchUpdateEventCb\n");
3019#endif
3020
3021 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_TOUCH_UPDATE_EVENT);
3022}
3023
3024
3041{
3042#ifdef SO3_DEBUG
3043 MMechostr(MSKDEBUG, "SO3WidgetInputDownEventCb\n");
3044#endif
3045
3046 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_INPUT_DOWN_EVENT);
3047}
3048
3049
3066{
3067#ifdef SO3_DEBUG
3068 MMechostr(MSKDEBUG, "SO3WidgetInputUpEventCb\n");
3069#endif
3070
3071 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_INPUT_UP_EVENT);
3072}
3073
3074
3091{
3092#ifdef SO3_DEBUG
3093 MMechostr(MSKDEBUG, "SO3WidgetInputUpdateEventCb\n");
3094#endif
3095
3096 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_INPUT_UPDATE_EVENT);
3097}
3098
3099
3116{
3117#ifdef SO3_DEBUG
3118 MMechostr(MSKDEBUG, "SO3WidgetInputWheelEventCb\n");
3119#endif
3120
3121 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_INPUT_WHEEL_EVENT);
3122}
3123
3124
3139{
3140#ifdef SO3_DEBUG
3141 MMechostr(MSKDEBUG, "SO3WidgetKeyDownEventCb\n");
3142#endif
3143
3144 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_KEY_DOWN_EVENT);
3145}
3146
3147
3162{
3163#ifdef SO3_DEBUG
3164 MMechostr(MSKDEBUG, "SO3WidgetKeyUpEventCb\n");
3165#endif
3166
3167 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_KEY_UP_EVENT);
3168}
3169
3170
3185int SO3WidgetKeyEventCb(mmachine m)
3186{
3187#ifdef SO3_DEBUG
3188 MMechostr(MSKDEBUG, "SO3WidgetKeyEventCb\n");
3189#endif
3190
3191 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_KEY_EVENT);
3192}
3193
3207{
3208#ifdef SO3_DEBUG
3209 MMechostr(MSKDEBUG, "SO3WidgetFocusEventCb\n");
3210#endif
3211
3212 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_FOCUS_EVENT);
3213}
3214
3230{
3231#ifdef SO3_DEBUG
3232 MMechostr(MSKDEBUG, "SO3WidgetOnScriptEventCb\n");
3233#endif
3234
3235 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_SCRIPT_EVENT);
3236}
3237
3250{
3251#ifdef SO3_DEBUG
3252 MMechostr(MSKDEBUG, "SO3WidgetOnLoadStartEventCb\n");
3253#endif
3254
3255 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_ON_LOAD_START_EVENT);
3256}
3257
3270{
3271#ifdef SO3_DEBUG
3272 MMechostr(MSKDEBUG, "SO3WidgetOnLoadEndEventCb\n");
3273#endif
3274
3275 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_ON_LOAD_END_EVENT);
3276}
3277
3290{
3291#ifdef SO3_DEBUG
3292 MMechostr(MSKDEBUG, "SO3WidgetOnLoadErrorEventCb\n");
3293#endif
3294
3295 return OBJaddreflex(m, SO3WIDGET, SO3_WIDGET_ON_LOAD_ERROR_EVENT);
3296}
3297
3298
3299NativeDefinition natSO3Widget[] = {
3300 { "SO3WidgetGetType", 1, "fun [SO3_WIDGET] S", SO3WidgetGetType },
3301 { "SO3WidgetGetMode", 1, "fun [SO3_WIDGET] I", SO3WidgetGetMode },
3302 { "SO3WidgetSetStereo", 2, "fun [SO3_WIDGET I] SO3_WIDGET", SO3WidgetSetStereo },
3303 { "SO3WidgetGetStereo", 1, "fun [SO3_WIDGET] I", SO3WidgetGetStereo },
3304 { "SO3WidgetSetStereoEye", 2, "fun [SO3_WIDGET I] SO3_WIDGET", SO3WidgetSetStereoEye },
3305 { "SO3WidgetLoadFile", 2, "fun [SO3_WIDGET P] I", SO3WidgetLoadFile },
3306 { "SO3WidgetLoadUrl", 2, "fun [SO3_WIDGET S] I", SO3WidgetLoadUrl },
3307 { "SO3WidgetDestroy", 1, "fun [SO3_WIDGET] I", SO3WidgetDestroy },
3308 { "SO3WidgetSetSize", 3, "fun [SO3_WIDGET I I] I", SO3WidgetSetSize },
3309 { "SO3WidgetGetSize", 1, "fun [SO3_WIDGET] [I I]", SO3WidgetGetSize },
3310 { "SO3WidgetSetPosition", 3, "fun [SO3_WIDGET I I] I", SO3WidgetSetPosition },
3311 { "SO3WidgetGetPosition", 1, "fun [SO3_WIDGET] [I I]", SO3WidgetGetPosition },
3312 { "SO3WidgetSetTextureRatio", 2, "fun [SO3_WIDGET F] I", SO3WidgetSetTextureRatio },
3313 { "SO3WidgetGetTextureRatio", 1, "fun [SO3_WIDGET] F", SO3WidgetGetTextureRatio },
3314 { "SO3WidgetGetName", 1, "fun [SO3_WIDGET] S", SO3WidgetGetName },
3315 { "SO3WidgetGetVisibility", 1, "fun [SO3_WIDGET] I", SO3WidgetGetVisibility },
3316 { "SO3WidgetSetVisibility", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetVisibility },
3317 { "SO3WidgetGetTransparency", 1, "fun [SO3_WIDGET] I", SO3WidgetGetTransparency },
3318 { "SO3WidgetSetTransparency", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetTransparency },
3319 { "SO3WidgetGetOpacity", 1, "fun [SO3_WIDGET] F", SO3WidgetGetOpacity },
3320 { "SO3WidgetSetOpacity", 2, "fun [SO3_WIDGET F] I", SO3WidgetSetOpacity },
3321 { "SO3WidgetGetIgnoreTransparentPixels", 1, "fun [SO3_WIDGET] [I I]", SO3WidgetGetIgnoreTransparentPixels },
3322 { "SO3WidgetSetIgnoreTransparentPixels", 3, "fun [SO3_WIDGET I I] I", SO3WidgetSetIgnoreTransparentPixels },
3323 { "SO3WidgetGetZOrder", 1, "fun [SO3_WIDGET] I", SO3WidgetGetZOrder },
3324 { "SO3WidgetSetZOrder", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetZOrder },
3325 { "SO3WidgetGetForeground", 1, "fun [SO3_WIDGET] I", SO3WidgetGetForeground },
3326 { "SO3WidgetSetForeground", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetForeground },
3327 { "SO3WidgetHasFocus", 1, "fun [SO3_WIDGET] I", SO3WidgetHasFocus },
3328 { "SO3WidgetSetFocus", 1, "fun [SO3_WIDGET] I", SO3WidgetSetFocus },
3329 { "SO3WidgetUnFocus", 1, "fun [SO3_WIDGET] I", SO3WidgetUnFocus },
3330 { "SO3WidgetGetTopOnFocus", 1, "fun [SO3_WIDGET] I", SO3WidgetGetTopOnFocus },
3331 { "SO3WidgetSetTopOnFocus", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetTopOnFocus },
3332 { "SO3WidgetGetKeyboardEnable", 1, "fun [SO3_WIDGET] I", SO3WidgetGetKeyboardEnable },
3333 { "SO3WidgetSetKeyboardEnable", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetKeyboardEnable },
3334 { "SO3WidgetGetMouseEnable", 1, "fun [SO3_WIDGET] I", SO3WidgetGetMouseEnable },
3335 { "SO3WidgetSetMouseEnable", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetMouseEnable },
3336 { "SO3WidgetIsMouseOver", 1, "fun [SO3_WIDGET] I", SO3WidgetIsMouseOver },
3337 { "SO3WidgetCallFunction", 3, "fun [SO3_WIDGET S [S r1]] I", SO3WidgetCallFunction },
3338 { "SO3WidgetGetUpdateOnFocusOnly", 1, "fun [SO3_WIDGET] I", SO3WidgetGetUpdateOnFocusOnly },
3339 { "SO3WidgetSetUpdateOnFocusOnly", 2, "fun [SO3_WIDGET I] I", SO3WidgetSetUpdateOnFocusOnly },
3340 { "SO3WidgetEnterEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0] u1 u0] SO3_WIDGET", SO3WidgetEnterEventCb },
3341 { "SO3WidgetExitEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0] u1 u0] SO3_WIDGET", SO3WidgetExitEventCb },
3342 { "SO3WidgetMouseMoveEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetMouseMoveEventCb },
3343 { "SO3WidgetMouseDownEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetMouseDownEventCb },
3344 { "SO3WidgetMouseUpEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetMouseUpEventCb },
3345 { "SO3WidgetMouseWheelEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetMouseWheelEventCb },
3346 { "SO3WidgetTouchAddEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetTouchAddEventCb },
3347 { "SO3WidgetTouchRemoveEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetTouchRemoveEventCb },
3348 { "SO3WidgetTouchUpdateEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I I I] u1 u0] SO3_WIDGET", SO3WidgetTouchUpdateEventCb },
3349 { "SO3WidgetInputDownEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I I] u1 u0] SO3_WIDGET", SO3WidgetInputDownEventCb },
3350 { "SO3WidgetInputUpEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I I] u1 u0] SO3_WIDGET", SO3WidgetInputUpEventCb },
3351 { "SO3WidgetInputUpdateEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I I] u1 u0] SO3_WIDGET", SO3WidgetInputUpdateEventCb },
3352 { "SO3WidgetInputWheelEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I I] u1 u0] SO3_WIDGET", SO3WidgetInputWheelEventCb },
3353 { "SO3WidgetKeyDownEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I] u1 u0] SO3_WIDGET", SO3WidgetKeyDownEventCb },
3354 { "SO3WidgetKeyUpEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I] u1 u0] SO3_WIDGET", SO3WidgetKeyUpEventCb },
3355 { "SO3WidgetKeyEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I I I] u1 u0] SO3_WIDGET", SO3WidgetKeyEventCb },
3356 { "SO3WidgetFocusEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 I] u1 u0] SO3_WIDGET", SO3WidgetFocusEventCb },
3357 { "SO3WidgetOnScriptEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 S [S r1]] u1 u0] SO3_WIDGET", SO3WidgetOnScriptEventCb },
3358 { "SO3WidgetOnLoadStartEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0] u1 u0] SO3_WIDGET", SO3WidgetOnLoadStartEventCb },
3359 { "SO3WidgetOnLoadEndEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0] u1 u0] SO3_WIDGET", SO3WidgetOnLoadEndEventCb },
3360 { "SO3WidgetOnLoadErrorEventCb", 3, "fun [SO3_WIDGET fun [SO3_WIDGET u0 S] u1 u0] SO3_WIDGET", SO3WidgetOnLoadErrorEventCb }
3361};
3362
3363
3367ScolWidgetEventsListener* scolWidgetEventsListener = 0;
3368
3369
3375int SCOLloadWidget(mmachine m, cbmachine w)
3376{
3377 //ANDROID TODO manage window destruction
3378 scolWidgetEventsListener = new ScolWidgetEventsListener();
3379 assert(scolWidgetEventsListener != 0);
3380 SWidgetManager::getSingleton().AddWidgetListener(scolWidgetEventsListener);
3381
3382 WIDGET_SCRIPT_EVENT = OBJgetUserEvent();
3384
3385 WIDGET_ENTER_EVENT = OBJgetUserEvent();
3387
3388 WIDGET_EXIT_EVENT = OBJgetUserEvent();
3390
3391 WIDGET_MOUSEDOWN_EVENT = OBJgetUserEvent();
3393
3394 WIDGET_MOUSEUP_EVENT = OBJgetUserEvent();
3396
3397 WIDGET_MOUSEMOVE_EVENT = OBJgetUserEvent();
3399
3400 WIDGET_MOUSEWHEEL_EVENT = OBJgetUserEvent();
3402
3403 WIDGET_TOUCHADD_EVENT = OBJgetUserEvent();
3405
3406 WIDGET_TOUCHREMOVE_EVENT = OBJgetUserEvent();
3408
3409 WIDGET_TOUCHUPDATE_EVENT = OBJgetUserEvent();
3411
3412 WIDGET_INPUTDOWN_EVENT = OBJgetUserEvent();
3414
3415 WIDGET_INPUTUP_EVENT = OBJgetUserEvent();
3417
3418 WIDGET_INPUTUPDATE_EVENT = OBJgetUserEvent();
3420
3421 WIDGET_INPUTWHEEL_EVENT = OBJgetUserEvent();
3423
3424 WIDGET_KEY_DOWN_EVENT = OBJgetUserEvent();
3426
3427 WIDGET_KEY_UP_EVENT = OBJgetUserEvent();
3429
3430 WIDGET_KEY_EVENT = OBJgetUserEvent();
3432
3433 WIDGET_FOCUS_EVENT = OBJgetUserEvent();
3435
3436 WIDGET_ON_LOAD_START_EVENT = OBJgetUserEvent();
3438
3439 WIDGET_ON_LOAD_END_EVENT = OBJgetUserEvent();
3441
3442 WIDGET_ON_LOAD_ERROR_EVENT = OBJgetUserEvent();
3444
3445 return PKhardpak2(m, "SO3Widget.pkg", sizeof(natSO3Widget) / sizeof(natSO3Widget[0]), natSO3Widget);
3446}
3447
3448
3454{
3455 SWidgetManager::getSingleton().RemoveWidgetListener(scolWidgetEventsListener);
3456
3457 try
3458 {
3459 SO3_SAFE_DELETE(scolWidgetEventsListener);
3460 }
3461 catch(Ogre::Exception &)
3462 {
3463
3464 }
3465 return 0;
3466}
ScolWidgetEventsListener * scolWidgetEventsListener
int WIDGET_ON_LOAD_END_EVENT
int WIDGET_INPUTUP_EVENT
int WIDGET_TOUCHREMOVE_EVENT
int getWidgetCallbackInputUpdateEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when an input update event occurs o...
int getWidgetCallbackInputDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when an inpur down event occurs on ...
int WIDGET_MOUSEWHEEL_EVENT
int getWidgetCallbackFocusEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a focus event occurs on a widg...
int WIDGET_EXIT_EVENT
int getWidgetCallbackKeyEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a key event occurs on a widget...
NativeDefinition natSO3Widget[]
int WIDGET_INPUTUPDATE_EVENT
int WIDGET_KEY_DOWN_EVENT
int getWidgetCallbackMouseDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a mouse down event occurs on a...
int WIDGET_KEY_UP_EVENT
int WIDGET_TOUCHUPDATE_EVENT
int getWidgetCallbackOnScriptCallback(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of script function callback.
int getWidgetCallbackOnLoadEndEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a load end event occurs on a w...
int ScolZooTabCodes[160]
int getWidgetCallbackMouseWheelEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a mouse wheel event occurs on ...
int WIDGET_ON_LOAD_START_EVENT
int getWidgetCallbackTouchRemoveEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a touch point removed event oc...
int WIDGET_SCRIPT_EVENT
int WIDGET_ENTER_EVENT
main include
int SCOLfreeWidget()
free the SO3Engine Viewport function
int WIDGET_MOUSEDOWN_EVENT
int getWidgetCallbackKeyDownEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a key down event occurs on a w...
int WIDGET_ON_LOAD_ERROR_EVENT
int WIDGET_FOCUS_EVENT
int WIDGET_TOUCHADD_EVENT
int WIDGET_MOUSEMOVE_EVENT
int getWidgetCallbackInputUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when an input up event occurs on a ...
int ZooConvertvirtcode(int c)
int getWidgetCallbackTouchAddEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a touch point added event occu...
int getWidgetCallbackOnExitEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when mouse gets outside a widget (s...
int WIDGET_INPUTDOWN_EVENT
int WIDGET_MOUSEUP_EVENT
int getWidgetCallbackMouseMoveEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a mouse move event occurs on a...
int WIDGET_INPUTWHEEL_EVENT
int getWidgetCallbackOnEnterEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when mouse enters inside a widget (...
int getWidgetCallbackInputWheelEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when an input wheel event occurs on...
int WIDGET_KEY_EVENT
int getWidgetCallbackOnLoadStartEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a load start event occurs on a...
int getWidgetCallbackTouchUpdateEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a touch update event occurs on...
int getWidgetCallbackKeyUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a key up event occurs on a wid...
int SCOLloadWidget(mmachine m, cbmachine w)
Load the SO3Engine Widgets function.
int getWidgetCallbackOnLoadErrorEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a load error event occurs on a...
int getWidgetCallbackMouseUpEvent(mmachine m, SCOL_PTR_TYPE id, SCOL_PTR_TYPE param)
C function that prepares the VM for the execution of the callback when a mouse up event occurs on a w...
long LONG
Definition SO3Android.h:59
unsigned int UINT
Definition SO3Android.h:58
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
Definition SO3SCOL.cpp:5150
SCOL_EXPORT void SCOL_PTR_TYPE param
Definition SO3SCOL.cpp:5089
int SO3WIDGET
Definition SO3SCOL.cpp:101
std::vector< std::string > arguments
int SO3WidgetSetUpdateOnFocusOnly(mmachine m)
SO3WidgetSetUpdateOnFocusOnly : Set if the widget will be updated only when he have focus.
int SO3WidgetGetUpdateOnFocusOnly(mmachine m)
SO3WidgetGetUpdateOnFocusOnly : Return if the widget is updated only when he have focus.
int SO3WidgetCallFunction(mmachine m)
SO3WidgetCallFunction : Call script function of a widgets. Script type may depend of widget type,...
int SO3WidgetOnScriptEventCb(mmachine m)
SO3WidgetOnScriptEventCb : Define the callback scol had to call when there is a script event on a wid...
int SO3WidgetInputDownEventCb(mmachine m)
SO3WidgetInputDownEventCb : Define the scol callback to call when an input down button occure on a wi...
int SO3WidgetSetTextureRatio(mmachine m)
SO3WidgetSetTextureRatio : defines the texture ratio of a widget, ie how the texture size will be sca...
int SO3WidgetHasFocus(mmachine m)
SO3WidgetHasFocus : Retrieves if a widget has the focus.
int SO3WidgetKeyUpEventCb(mmachine m)
SO3WidgetKeyUpEventCb : Define the scol callback to call when a key is "up" on a widget.
int SO3WidgetGetMouseEnable(mmachine m)
SO3WidgetGetMouseEnable : Retrieves if a widget take mouse events or not.
int SO3WidgetSetForeground(mmachine m)
SO3WidgetSetForeground : defines foreground state of a widget.
int SO3WidgetInputUpdateEventCb(mmachine m)
SO3WidgetInputUpdateEventCb : Define the scol callback to call when an input is updated over a widget...
int SO3WidgetTouchRemoveEventCb(mmachine m)
SO3WidgetTouchRemoveEventCb : Define the scol callback to call when a touch point is removed on a wid...
int SO3WidgetKeyEventCb(mmachine m)
SO3WidgetKeyEventCb : Define the scol callback to call when a key event is thow on a widget.
int SO3WidgetTouchUpdateEventCb(mmachine m)
SO3WidgetTouchUpdateEventCb : Define the scol callback to call when a touch point is updated over a w...
int SO3WidgetSetKeyboardEnable(mmachine m)
SO3WidgetSetKeyboardEnable : enable or disable keyboard input on a widget.
int SO3WidgetGetKeyboardEnable(mmachine m)
SO3WidgetGetKeyboardEnable : Retrieves if a widget take keyboard events or not.
int SO3WidgetSetTopOnFocus(mmachine m)
SO3WidgetSetTopOnFocus : defines top On focus state a widget.
int SO3WidgetTouchAddEventCb(mmachine m)
SO3WidgetTouchAddEventCb : Define the scol callback to call when a touch point is added on a widget.
int SO3WidgetOnLoadEndEventCb(mmachine m)
SO3WidgetOnLoadEndEventCb : Define the scol callback to call when a widget has finished to load conte...
int SO3WidgetMouseMoveEventCb(mmachine m)
SO3WidgetMouseMoveEventCb : Define the scol callback to call when a mouse button is "downed" on a wid...
int SO3WidgetInputUpEventCb(mmachine m)
SO3WidgetInputUpEventCb : Define the scol callback to call when an input up button occure on a widget...
int SO3WidgetLoadUrl(mmachine m)
SO3WidgetLoadUrl : Load an Url in a widget.
int SO3WidgetGetType(mmachine m)
SO3WidgetGetType : Return the type of a widget.
int SO3WidgetGetName(mmachine m)
SO3WidgetGetName : Return the name of a widget.
int SO3WidgetGetForeground(mmachine m)
SO3WidgetGetForeground : Get the foreground state of a widget.
int SO3WidgetExitEventCb(mmachine m)
SO3WidgetExitEventCb : Define the scol callback to call when the mouse exit a widget.
int SO3WidgetSetIgnoreTransparentPixels(mmachine m)
SO3WidgetSetIgnoreTransparentPixels : defines ignore transparent pixels state on a widget.
int SO3WidgetSetStereo(mmachine m)
SO3WidgetSetStereo : Set the widget stereo mode.
int SO3WidgetFocusEventCb(mmachine m)
SO3WidgetFocusEventCb : Define the scol callback to call when a widget take or loose focus.
int SO3WidgetGetTextureRatio(mmachine m)
SO3WidgetGetTextureRatio : Return the texture ratio of a widget, ie how the texture size will be scal...
int SO3WidgetSetZOrder(mmachine m)
SO3WidgetSetZOrder : defines Z order of a widget.
int SO3WidgetSetOpacity(mmachine m)
SO3WidgetSetOpacity : defines opacity coefficient of a widget.
int SO3WidgetGetTransparency(mmachine m)
SO3WidgetGetTransparency : Get transparency state of a widget.
int SO3WidgetSetPosition(mmachine m)
SO3WidgetSetPosition : defines position of a widget, in a viewport.
int SO3WidgetUnFocus(mmachine m)
SO3WidgetUnFocus : Force a widget to release focus.
int SO3WidgetMouseDownEventCb(mmachine m)
SO3WidgetMouseDownEventCb : Define the scol callback to call when a mouse button is "downed" on a wid...
int SO3WidgetSetFocus(mmachine m)
SO3WidgetSetFocus : Force a widget to take focus.
int SO3WidgetSetStereoEye(mmachine m)
SO3WidgetSetStereoEye : Set the current visible eye of a stereo widget.
int SO3WidgetGetSize(mmachine m)
SO3WidgetGetSize : Return the size of a widget.
int SO3WidgetSetVisibility(mmachine m)
SO3WidgetSetVisibility : show or hide a widget.
int SO3WidgetIsMouseOver(mmachine m)
SO3WidgetIsMouseOver : Retrieves if the mouse is over a widget.
int SO3WidgetGetVisibility(mmachine m)
SO3WidgetGetVisibility : Retrieves if a widget is visible or not.
int SO3WidgetMouseWheelEventCb(mmachine m)
SO3WidgetMouseWheelEventCb : Define the scol callback to call when the mouse wheel is moved (scrollin...
int SO3WidgetInputWheelEventCb(mmachine m)
SO3WidgetInputWheelEventCb : Define the scol callback to call when an input wheel is updated over a w...
int SO3WidgetOnLoadStartEventCb(mmachine m)
SO3WidgetOnLoadStartEventCb : Define the scol callback to call when a widget start to load content.
int SO3WidgetSetTransparency(mmachine m)
SO3WidgetSetTransparency : Set transparency state of a widget (enable or not)
int SO3WidgetSetMouseEnable(mmachine m)
SO3WidgetSetMouseEnable : enable or disable mouse input on a widget.
int SO3WidgetGetOpacity(mmachine m)
SO3WidgetGetOpacity : Get the opacity coefficient of a widget.
int SO3WidgetGetStereo(mmachine m)
SO3WidgetGetStereo : Return the stereo mode of a widget.
int SO3WidgetGetIgnoreTransparentPixels(mmachine m)
SO3WidgetGetIgnoreTransparentPixels : Get the ignore transparent pixels state on a widget.
int SO3WidgetGetTopOnFocus(mmachine m)
SO3WidgetGetTopOnFocus : Get the top On focus state of a widget.
int SO3WidgetGetMode(mmachine m)
SO3WidgetGetMode : Return the mode of a widget.
int SO3WidgetEnterEventCb(mmachine m)
SO3WidgetEnterEventCb : Define the scol callback to call when the mouse enter a widget.
int SO3WidgetLoadFile(mmachine m)
SO3WidgetLoadFile : Load a File/movie on a widget.
int SO3WidgetOnLoadErrorEventCb(mmachine m)
SO3WidgetOnLoadErrorEventCb : Define the scol callback to call when a widget throw an error while loa...
int SO3WidgetGetPosition(mmachine m)
SO3WidgetGetPosition : Return the position of a widget, in the current viewport.
int SO3WidgetGetZOrder(mmachine m)
SO3WidgetGetZOrder : Get the Z order of a widget.
int SO3WidgetSetSize(mmachine m)
SO3WidgetSetSize : defines size of a widget.
int SO3WidgetMouseUpEventCb(mmachine m)
SO3WidgetMouseUpEventCb : Define the scol callback to call when a mouse button is "released" over a w...
int SO3WidgetKeyDownEventCb(mmachine m)
SO3WidgetKeyDownEventCb : Define the scol callback to call when a key is "downed" on a widget.
int SO3WidgetDestroy(mmachine m)
SO3WidgetDestroy : Destroy a widget.