Project

General

Profile

SO3Engine
SCOLWebNavigator.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) 2011 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#include "SCOLPack/SO3SCOL.h"
26
29
30#if SO3_WEB_NAVIGATOR_BUILD == 1
31
32#if defined(_WIN32)
33extern int(*CallMainThread)(void*, mmachine m);
34#endif
35
36// Useful macro to generate a reflexive function addition
37#ifdef SCOL_DEBUG
38#define WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(CB_NAME, CB_ID) \
39 int SO3WebNavigatorCb##CB_NAME##(mmachine m) \
40 {\
41 MMechostr(MSKDEBUG, "WebNavigatorCb##CB_NAME##\n");\
42 return OBJaddreflex (m, OBJWEBNAVIGATORSCOL, CB_ID);\
43 }
44#else
45#define WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(CB_NAME, CB_ID) \
46 int SO3WebNavigatorCb##CB_NAME##(mmachine m) \
47 {\
48 return OBJaddreflex (m, OBJWEBNAVIGATORSCOL, CB_ID);\
49 }
50#endif
51
52// Object type variable declaration
54
55// Web navigator reflexives identifiers
56#define WEB_NAVIGATOR_LIFESPAN_ON_POPUP_CB 0
57#define WEB_NAVIGATOR_LIFESPAN_RUN_MODAL_CB 1
58#define WEB_NAVIGATOR_LOAD_ON_START_CB 2
59#define WEB_NAVIGATOR_LOAD_ON_END_CB 3
60#define WEB_NAVIGATOR_LOAD_ON_ERROR_CB 4
61#define WEB_NAVIGATOR_DISPLAY_ON_NAV_STATE_CHANGE_CB 5
62#define WEB_NAVIGATOR_DISPLAY_ON_ADDRESS_CHANGE_CB 6
63#define WEB_NAVIGATOR_DISPLAY_ON_TITLE_CHANGE_CB 7
64#define WEB_NAVIGATOR_DISPLAY_ON_TOOLTIP_CB 8
65#define WEB_NAVIGATOR_DISPLAY_ON_STATUS_MESSAGE_CB 9
66#define WEB_NAVIGATOR_DISPLAY_ON_CONSOLE_MESSAGE_CB 10
67#define WEB_NAVIGATOR_FIND_ON_RESULT_CB 11
68#define WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_CB 12
69#define WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_STR_CB 13
70#define WEB_NAVIGATOR_MAX_CB 14
71
88WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnExternalCall, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_CB)
89
90
101 WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnExternalCallStr, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_STR_CB)
102
103
106 class ScolWebNavigatorListener : public SO3::EmbeddedWebNavigator::WebNavigatorListener
107{
108public:
109protected:
110private:
111 mmachine scolMachine;
112
113public:
116 ScolWebNavigatorListener(mmachine scolMachineInstance)
117 {
118 scolMachine = scolMachineInstance;
119 };
120
124 virtual void OnExternalCall(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const SO3::SScriptFunction& functionCalled)
125 {
126#ifdef SCOL_DEBUG
127 MMechostr(MSKDEBUG, "WebNavigator: OnExternalCall\n");
128#endif
129
130 int k = 0;
131 if (!(k = OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_CB)))
132 {
133 // Push function name
134 Mpushstrbloc(scolMachine, (char*)(functionCalled.function.c_str()));
135
136 // Push every arguments
137 for (unsigned int i = 0; i < functionCalled.arguments.size(); i++)
138 {
139 if (k = Mpushstrbloc(scolMachine, (char*)(functionCalled.arguments.at(i).c_str())))
140 return;
141 }
142
143 if (MMpush(scolMachine, NIL))
144 return;
145
146 for (unsigned int i = 0; i < functionCalled.arguments.size(); i++)
147 {
148 if (MMpush(scolMachine, 2 * 2))
149 return;
150
151 if (k = MBdeftab(scolMachine))
152 return;
153 }
154 OBJcallreflex(scolMachine, 2);
155 }
156 };
157
161 virtual void OnExternalCallStr(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const SO3::SScriptFunction& functionCalled)
162 {
163#ifdef SCOL_DEBUG
164 MMechostr(MSKDEBUG, "WebNavigator: OnExternalCallStr\n");
165#endif
166
167 int k = 0;
168 if (!(k = OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_STR_CB)))
169 {
170 // Push function name
171 Mpushstrbloc(scolMachine, (char*)(functionCalled.function.c_str()));
172
173 // Push every arguments
174 for (unsigned int i = 0; i < functionCalled.arguments.size(); i++)
175 {
176 if (k = Mpushstrbloc(scolMachine, (char*)(functionCalled.arguments.at(i).c_str())))
177 return;
178 }
179
180 if (MMpush(scolMachine, NIL))
181 return;
182
183 for (unsigned int i = 0; i < functionCalled.arguments.size(); i++)
184 {
185 if (MMpush(scolMachine, 2 * 2))
186 return;
187
188 if (k = MBdeftab(scolMachine))
189 return;
190 }
191 OBJcallreflex(scolMachine, 2);
192 }
193 };
194
198 virtual void OnNavStateChange(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, bool canGoBack, bool canGoForward)
199 {
200#ifdef SCOL_DEBUG
201 MMechostr(MSKDEBUG, "WebNavigator: OnNavStateChange\n");
202#endif
203
204 // TODO callback params
205 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_NAV_STATE_CHANGE_CB))
206 OBJcallreflex(scolMachine, 0);
207 };
208
212 virtual void OnAddressChange(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& frameName, const std::string& url)
213 {
214#ifdef SCOL_DEBUG
215 MMechostr(MSKDEBUG, "WebNavigator: OnAddressChange\n");
216#endif
217
218 int res = 0;
219 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_ADDRESS_CHANGE_CB))
220 {
221 Mpushstrbloc(scolMachine, (char*)(frameName.c_str()));
222 Mpushstrbloc(scolMachine, (char*)(url.c_str()));
223 res = OBJcallreflex(scolMachine, 2);
224 }
225 };
226
230 virtual void OnTitleChange(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& title)
231 {
232#ifdef SCOL_DEBUG
233 MMechostr(MSKDEBUG, "WebNavigator: OnTitleChange\n");
234#endif
235
236 int res = 0;
237 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_TITLE_CHANGE_CB))
238 {
239 Mpushstrbloc(scolMachine, (char*)(title.c_str()));
240 res = OBJcallreflex(scolMachine, 1);
241 }
242 }
243
247 virtual void OnTooltip(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, std::string& text)
248 {
249#ifdef SCOL_DEBUG
250 MMechostr(MSKDEBUG, "WebNavigator: OnTooltip\n");
251#endif
252
253 int res = 0;
254 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_TOOLTIP_CB))
255 {
256 Mpushstrbloc(scolMachine, (char*)(text.c_str()));
257 res = OBJcallreflex(scolMachine, 1);
258 }
259 };
260
264 virtual void OnStatusMessage(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& value)
265 {
266#ifdef SCOL_DEBUG
267 MMechostr(MSKDEBUG, "WebNavigator: OnStatusMessage\n");
268#endif
269
270 // TODO Param!
271 int res = 0;
272 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_STATUS_MESSAGE_CB))
273 res = OBJcallreflex(scolMachine, 0);
274 };
275
279 virtual void OnConsoleMessage(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& message, const std::string& source, int line)
280 {
281#ifdef SCOL_DEBUG
282 MMechostr(MSKDEBUG, "WebNavigator: OnConsoleMessage\n");
283#endif
284
285 int res = 0;
286 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_CONSOLE_MESSAGE_CB))
287 {
288 Mpushstrbloc(scolMachine, (char*)(message.c_str()));
289 Mpushstrbloc(scolMachine, (char*)(source.c_str()));
290 MMpush(scolMachine, ITOM(line));
291 res = OBJcallreflex(scolMachine, 3);
292 }
293 };
294
298 virtual void OnBeforePopup(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, int popupX, int popupY, int popupWidth, int popupHeight, std::string popupUrl)
299 {
300#ifdef SCOL_DEBUG
301 MMechostr(MSKDEBUG, "WebNavigator: OnBeforePopup\n");
302#endif
303
304 int res = 0;
305 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LIFESPAN_ON_POPUP_CB))
306 {
307 MMpush(scolMachine, ITOM(popupX));
308 MMpush(scolMachine, ITOM(popupY));
309 MMpush(scolMachine, ITOM(popupWidth));
310 MMpush(scolMachine, ITOM(popupHeight));
311 Mpushstrbloc(scolMachine, (char*)(popupUrl.c_str()));
312 res = OBJcallreflex(scolMachine, 5);
313 }
314 };
315
319 virtual void RunModal(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator)
320 {
321#ifdef SCOL_DEBUG
322 MMechostr(MSKDEBUG, "WebNavigator: OnBeforePopup\n");
323#endif
324
325 int res = 0;
326 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LIFESPAN_RUN_MODAL_CB))
327 res = OBJcallreflex(scolMachine, 0);
328 };
329
333 virtual void OnLoadStart(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& frameName)
334 {
335#ifdef SCOL_DEBUG
336 MMechostr(MSKDEBUG, "WebNavigator: OnLoadStart\n");
337#endif
338
339 int res = 0;
340 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_START_CB))
341 {
342 Mpushstrbloc(scolMachine, (char*)(frameName.c_str()));
343 res = OBJcallreflex(scolMachine, 1);
344 }
345 };
346
350 virtual void OnLoadEnd(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& frameName, int httpStatusCode)
351 {
352#ifdef SCOL_DEBUG
353 MMechostr(MSKDEBUG, "WebNavigator: OnLoadEnd\n");
354#endif
355
356 int res = 0;
357 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_END_CB))
358 {
359 Mpushstrbloc(scolMachine, (char*)(frameName.c_str()));
360 MMpush(scolMachine, ITOM(httpStatusCode));
361 res = OBJcallreflex(scolMachine, 2);
362 }
363 };
364
368 virtual void OnLoadError(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, const std::string& frameName, int errorCode, const std::string& failedUrl, std::string& errorText)
369 {
370#ifdef SCOL_DEBUG
371 MMechostr(MSKDEBUG, "WebNavigator: OnLoadError\n");
372#endif
373
374 int res = 0;
375 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_ERROR_CB))
376 {
377 Mpushstrbloc(scolMachine, (char*)(frameName.c_str()));
378 Mpushstrbloc(scolMachine, (char*)(failedUrl.c_str()));
379 MMpush(scolMachine, ITOM(errorCode));
380 Mpushstrbloc(scolMachine, (char*)(errorText.c_str()));
381 res = OBJcallreflex(scolMachine, 4);
382 }
383 };
384
388 virtual void OnFindResult(SO3::EmbeddedWebNavigator::WebNavigator* sourceWebNavigator, int identifier, int count, const CefRect& selectionRect, int activeMatchOrdinal, bool finalUpdate)
389 {
390#ifdef SCOL_DEBUG
391 MMechostr(MSKDEBUG, "WebNavigator: OnFindResult\n");
392#endif
393
394 int res = 0;
395 if (!OBJbeginreflex(scolMachine, OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_FIND_ON_RESULT_CB))
396 {
397 MMpush(scolMachine, ITOM(identifier));
398 MMpush(scolMachine, ITOM(count));
399
400 // Create the 'selectionRect' return tuple
401 int scolselectionRect = MMmalloc(scolMachine, 4, TYPETAB);
402 if (scolselectionRect == NIL)
403 return;
404
405 // Store the selectionRect
406 MMstore(scolMachine, scolselectionRect, 3, ITOM(selectionRect.x));
407 MMstore(scolMachine, scolselectionRect, 2, ITOM(selectionRect.y));
408 MMstore(scolMachine, scolselectionRect, 1, ITOM(selectionRect.width));
409 MMstore(scolMachine, scolselectionRect, 0, ITOM(selectionRect.height));
410 MMpush(scolMachine, PTOM(scolselectionRect));
411 MMpush(scolMachine, ITOM(activeMatchOrdinal));
412 if (finalUpdate)
413 MMpush(scolMachine, ITOM(1));
414 else
415 MMpush(scolMachine, ITOM(0));
416 res = OBJcallreflex(scolMachine, 5);
417 }
418 };
419protected:
420private:
421};
422
426int destroyWebNavigatorObj(mmachine m, SCOL_PTR_TYPE handsys, int webNavigatorIndex)
427{
428#ifdef SCOL_DEBUG
429 MMechostr(MSKDEBUG, "destroyWebNavigatorObj\n");
430#endif
431
432 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
433 if (webNavigator == NULL)
434 {
435 MMset(m, 0, NIL);
436 return 0;
437 }
438
439 // Remove Javascript external call listener
440 ScolWebNavigatorListener* scolWebNavigatorListener = static_cast<ScolWebNavigatorListener*> (webNavigator->GetListener());
441 webNavigator->SetListener(0);
442 delete(scolWebNavigatorListener);
443
444 // Delete web navigator
446 MMsetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex), 0);
447 return 0;
448}
449
465{
466#ifdef SCOL_DEBUG
467 MMechostr(MSKDEBUG, "WebNavigatorCreate\n");
468#endif
469
470 // Get parameters
471 int scolUrl = MMpull(m);
472 int scolHeight = MMpull(m);
473 int scolWidth = MMpull(m);
474 int scolPositionY = MMpull(m);
475 int scolPositionX = MMpull(m);
476 int scolParentWindow = MMpull(m);
477 int scolChannel = MMget(m, 0);
478 if ((scolChannel == NIL) || (scolParentWindow == NIL) || (scolPositionY == NIL) || (scolPositionX == NIL) || (scolWidth == NIL) || (scolHeight == NIL))
479 {
480 MMechostr(MSKDEBUG, "WebNavigatorCreate: Invalid parameters!\n"); //Display Warning in Console
481 MMset(m, 0, NIL);
482 return 0;
483 }
484
485 // Get the parent window handle, and check that it's a valid one.
486 PtrObjVoid OB = (PtrObjVoid)MMstart(m, MTOP(scolParentWindow));
487 PtrObjWindow W = (PtrObjWindow)MMstart(m, OB->Buffer >> 1);
488 ScolWindowHandle parentWindowHandle = (ScolWindowHandle)W->WHandler;
489 if (parentWindowHandle == 0)
490 {
491 MMset(m, 0, NIL);
492 return 0;
493 }
494
495 // Load url
496 std::string url = "";
497 if (scolUrl != NIL)
498 url = MMstartstr(m, MTOP(scolUrl));
499
500 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = SO3::EmbeddedWebNavigator::WebNavigatorManager::GetSingleton().CreateNavigator(parentWindowHandle, MTOI(scolPositionX), MTOI(scolPositionY), MTOI(scolWidth), MTOI(scolHeight), url);
501 if (webNavigator == 0)
502 {
503 MMechostr(MSKDEBUG, "WebNavigatorCreate: Error while creating a new embedded web navigator\n");
504 MMset(m, 0, NIL);
505 return 0;
506 }
507
508 // Javascript external call listener
509 ScolWebNavigatorListener* scolWebNavigatorListener = new ScolWebNavigatorListener(m);
510 webNavigator->SetListener(scolWebNavigatorListener);
511
512 if ((MMpushPointer(m, webNavigator) != 0))
513 {
515 MMset(m, 0, NIL);
516 return MERRMEM;
517 }
518
519 // Create scol object
520 return OBJcreate(m, OBJWEBNAVIGATORSCOL, SCOL_PTR webNavigator, OBJtypebyname("OBJTYPWINDOW"), SCOL_PTR parentWindowHandle);
521}
522/*
523int SO3WebNavigatorCreate(mmachine m)
524{
525 CallMainThread((void*)SO3WebNavigatorCreateSync, m);
526 return 0;
527}*/
528
543{
544#ifdef SCOL_DEBUG
545 MMechostr(MSKDEBUG, "WebNavigatorCreateOffscreen\n");
546#endif
547
548 // Get parameters
549 int scolUrl = MMpull(m);
550 int scolTransparency = MMpull(m);
551 int scolHeight = MMpull(m);
552 int scolWidth = MMpull(m);
553 int scolParentWindow = MMpull(m);
554 int scolChannel = MMget(m, 0);
555 if ((scolChannel == NIL) || (scolWidth == NIL) || (scolHeight == NIL))
556 {
557 MMechostr(MSKDEBUG, "WebNavigatorCreateOffscreen: Invalid parameters!\n"); //Display Warning in Console
558 MMset(m, 0, NIL);
559 return 0;
560 }
561
562 // Get the parent window handle, could be 0
563 ScolWindowHandle parentWindowHandle = 0;
564 if (scolParentWindow != NIL)
565 {
566 PtrObjVoid OB = (PtrObjVoid)MMstart(m, MTOP(scolParentWindow));
567 PtrObjWindow W = (PtrObjWindow)MMstart(m, OB->Buffer >> 1);
568 parentWindowHandle = (ScolWindowHandle)W->WHandler;
569 if (parentWindowHandle == 0)
570 {
571 MMset(m, 0, NIL);
572 return 0;
573 }
574 }
575
576 bool transparency = false;
577 if (MTOI(scolTransparency) == 1)
578 transparency = true;
579
580 // Load url
581 std::string url = "";
582 if (scolUrl != NIL)
583 url = MMstartstr(m, MTOP(scolUrl));
584
585 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = SO3::EmbeddedWebNavigator::WebNavigatorManager::GetSingleton().CreateNavigator(parentWindowHandle, MTOI(scolWidth), MTOI(scolHeight), url, transparency);
586 if (webNavigator == 0)
587 {
588 MMechostr(MSKDEBUG, "WebNavigatorCreateOffscreen: Error while creating a new embedded web navigator\n");
589 MMset(m, 0, NIL);
590 return 0;
591 }
592
593 // Javascript external call listener
594 ScolWebNavigatorListener* scolWebNavigatorListener = new ScolWebNavigatorListener(m);
595 webNavigator->SetListener(scolWebNavigatorListener);
596
597 // stack : channel
598 if ((MMpushPointer(m, webNavigator) != 0))
599 {
601 MMset(m, 0, NIL);
602 return MERRMEM;
603 }
604
605 // Create scol object
606 return OBJcreate(m, OBJWEBNAVIGATORSCOL, SCOL_PTR webNavigator, OBJtypebyname("OBJTYPWINDOW"), SCOL_PTR parentWindowHandle);
607}
608/*
609int SO3WebNavigatorCreateOffscreen(mmachine m)
610{
611 CallMainThread((void*)SO3WebNavigatorCreateOffscreenSync, m);
612 return 0;
613}
614*/
624{
625#ifdef SCOL_DEBUG
626 MMechostr(MSKDEBUG, "WebNavigatorDestroy\n");
627#endif
628
629 int webNavigatorIndex = MMget(m, 0);
630 if (webNavigatorIndex == NIL)
631 {
632 MMechostr(MSKDEBUG, "WebNavigatorDestroy: Invalid parameters!\n");
633 MMset(m, 0, NIL);
634 return 0;
635 }
636
637 OBJdelTM(m, OBJWEBNAVIGATORSCOL, webNavigatorIndex);
638 MMset(m, 0, 0);
639
640#ifdef SCOL_DEBUG
641 MMechostr(MSKDEBUG, "ok\n");
642#endif
643 return 0;
644}
645
657{
658#ifdef SCOL_DEBUG
659 MMechostr(MSKDEBUG, "WebNavigatorLoadURL\n");
660#endif
661
662 int scolFrameName = MMpull(m);
663 int scolUrl = MMpull(m);
664 int webNavigatorIndex = MMget(m, 0);
665 if ((webNavigatorIndex == NIL) || (scolUrl == NIL))
666 {
667 MMechostr(MSKDEBUG, "WebNavigatorLoadURL: Invalid parameters!\n");
668 MMset(m, 0, NIL);
669 return 0;
670 }
671
672 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
673 if (webNavigator == 0)
674 {
675 MMechostr(MSKDEBUG, "WebNavigatorLoadURL: Invalid parameters!\n");
676 MMset(m, 0, NIL);
677 return 0;
678 }
679
680 // Get the url to load
681 std::string url = MMstartstr(m, MTOP(scolUrl));
682
683 // Get the optional frame name
684 std::string frameName = "";
685 if (scolFrameName != NIL)
686 frameName = MMstartstr(m, MTOP(scolFrameName));
687
688 webNavigator->LoadURL(url, frameName);
689 MMset(m, 0, ITOM(1));
690 return 0;
691}
692
704{
705#ifdef SCOL_DEBUG
706 MMechostr(MSKDEBUG, "WebNavigatorLoadFile\n");
707#endif
708
709 int scolFrameName = MMpull(m);
710 int scolFileName = MMpull(m);
711 int webNavigatorIndex = MMget(m, 0);
712 if ((webNavigatorIndex == NIL) || (scolFileName == NIL))
713 {
714 MMechostr(MSKDEBUG, "WebNavigatorLoadFile: Invalid parameters!\n");
715 MMset(m, 0, NIL);
716 return 0;
717 }
718
719 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
720 if (webNavigator == 0)
721 {
722 MMechostr(MSKDEBUG, "WebNavigatorLoadFile: Invalid parameters!\n");
723 MMset(m, 0, NIL);
724 return 0;
725 }
726
727 // Get the name of the file to load
728 std::string fileName = MMstartstr(m, MTOP(scolFileName));
729
730 // Get the optional frame name
731 std::string frameName = "";
732 if (scolFrameName != NIL)
733 frameName = MMstartstr(m, MTOP(scolFrameName));
734
735 webNavigator->LoadFile(fileName, frameName);
736 MMset(m, 0, ITOM(1));
737 return 0;
738}
739
751{
752#ifdef SCOL_DEBUG
753 MMechostr(MSKDEBUG, "WebNavigatorLoadHTML\n");
754#endif
755
756 int scolFrameName = MMpull(m);
757 int scolHtmlText = MMpull(m);
758 int webNavigatorIndex = MMget(m, 0);
759 if ((webNavigatorIndex == NIL) || (scolHtmlText == NIL))
760 {
761 MMechostr(MSKDEBUG, "WebNavigatorLoadHTML: Invalid parameters!\n");
762 MMset(m, 0, NIL);
763 return 0;
764 }
765
766 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
767 if (webNavigator == 0)
768 {
769 MMechostr(MSKDEBUG, "WebNavigatorLoadHTML: Invalid parameters!\n");
770 MMset(m, 0, NIL);
771 return 0;
772 }
773
774 // Get the html content to load
775 std::string htmlText = MMstartstr(m, MTOP(scolHtmlText));
776
777 // Get the optional frame name
778 std::string frameName = "";
779 if (scolFrameName != NIL)
780 frameName = MMstartstr(m, MTOP(scolFrameName));
781
782 webNavigator->LoadHTML(htmlText, frameName);
783 MMset(m, 0, ITOM(1));
784 return 0;
785}
786
797{
798#ifdef SCOL_DEBUG
799 MMechostr(MSKDEBUG, "WebNavigatorActionUndo\n");
800#endif
801
802 int scolFrameName = MMpull(m);
803 int webNavigatorIndex = MMget(m, 0);
804 if (webNavigatorIndex == NIL)
805 {
806 MMechostr(MSKDEBUG, "WebNavigatorActionUndo: Invalid parameters!\n");
807 MMset(m, 0, NIL);
808 return 0;
809 }
810
811 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
812 if (webNavigator == 0)
813 {
814 MMechostr(MSKDEBUG, "WebNavigatorActionUndo: Invalid parameters!\n");
815 MMset(m, 0, NIL);
816 return 0;
817 }
818
819 // Get the optional frame name
820 std::string frameName = "";
821 if (scolFrameName != NIL)
822 frameName = MMstartstr(m, MTOP(scolFrameName));
823
824 webNavigator->Undo(frameName);
825 MMset(m, 0, ITOM(1));
826 return 0;
827}
828
839{
840#ifdef SCOL_DEBUG
841 MMechostr(MSKDEBUG, "WebNavigatorActionRedo\n");
842#endif
843
844 int scolFrameName = MMpull(m);
845 int webNavigatorIndex = MMget(m, 0);
846 if (webNavigatorIndex == NIL)
847 {
848 MMechostr(MSKDEBUG, "WebNavigatorActionRedo: Invalid parameters!\n");
849 MMset(m, 0, NIL);
850 return 0;
851 }
852
853 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
854 if (webNavigator == 0)
855 {
856 MMechostr(MSKDEBUG, "WebNavigatorActionRedo: Invalid parameters!\n");
857 MMset(m, 0, NIL);
858 return 0;
859 }
860
861 // Get the optional frame name
862 std::string frameName = "";
863 if (scolFrameName != NIL)
864 frameName = MMstartstr(m, MTOP(scolFrameName));
865
866 webNavigator->Redo(frameName);
867 MMset(m, 0, ITOM(1));
868 return 0;
869}
870
881{
882#ifdef SCOL_DEBUG
883 MMechostr(MSKDEBUG, "WebNavigatorActionCut\n");
884#endif
885
886 int scolFrameName = MMpull(m);
887 int webNavigatorIndex = MMget(m, 0);
888 if (webNavigatorIndex == NIL)
889 {
890 MMechostr(MSKDEBUG, "WebNavigatorActionCut: Invalid parameters!\n");
891 MMset(m, 0, NIL);
892 return 0;
893 }
894
895 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
896 if (webNavigator == 0)
897 {
898 MMechostr(MSKDEBUG, "WebNavigatorActionCut: Invalid parameters!\n");
899 MMset(m, 0, NIL);
900 return 0;
901 }
902
903 // Get the optional frame name
904 std::string frameName = "";
905 if (scolFrameName != NIL)
906 frameName = MMstartstr(m, MTOP(scolFrameName));
907
908 webNavigator->Cut(frameName);
909 MMset(m, 0, ITOM(1));
910 return 0;
911}
912
923{
924#ifdef SCOL_DEBUG
925 MMechostr(MSKDEBUG, "WebNavigatorActionCopy\n");
926#endif
927
928 int scolFrameName = MMpull(m);
929 int webNavigatorIndex = MMget(m, 0);
930 if (webNavigatorIndex == NIL)
931 {
932 MMechostr(MSKDEBUG, "WebNavigatorActionCopy: Invalid parameters!\n");
933 MMset(m, 0, NIL);
934 return 0;
935 }
936
937 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
938 if (webNavigator == 0)
939 {
940 MMechostr(MSKDEBUG, "WebNavigatorActionCopy: Invalid parameters!\n");
941 MMset(m, 0, NIL);
942 return 0;
943 }
944
945 // Get the optional frame name
946 std::string frameName = "";
947 if (scolFrameName != NIL)
948 frameName = MMstartstr(m, MTOP(scolFrameName));
949
950 webNavigator->Copy(frameName);
951 MMset(m, 0, ITOM(1));
952 return 0;
953}
954
965{
966#ifdef SCOL_DEBUG
967 MMechostr(MSKDEBUG, "WebNavigatorActionPaste\n");
968#endif
969
970 int scolFrameName = MMpull(m);
971 int webNavigatorIndex = MMget(m, 0);
972 if (webNavigatorIndex == NIL)
973 {
974 MMechostr(MSKDEBUG, "WebNavigatorActionPaste: Invalid parameters!\n");
975 MMset(m, 0, NIL);
976 return 0;
977 }
978
979 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
980 if (webNavigator == 0)
981 {
982 MMechostr(MSKDEBUG, "WebNavigatorActionPaste: Invalid parameters!\n");
983 MMset(m, 0, NIL);
984 return 0;
985 }
986
987 // Get the optional frame name
988 std::string frameName = "";
989 if (scolFrameName != NIL)
990 frameName = MMstartstr(m, MTOP(scolFrameName));
991
992 webNavigator->Paste(frameName);
993 MMset(m, 0, ITOM(1));
994 return 0;
995}
996
1007{
1008#ifdef SCOL_DEBUG
1009 MMechostr(MSKDEBUG, "WebNavigatorActionDelete\n");
1010#endif
1011
1012 int scolFrameName = MMpull(m);
1013 int webNavigatorIndex = MMget(m, 0);
1014 if (webNavigatorIndex == NIL)
1015 {
1016 MMechostr(MSKDEBUG, "WebNavigatorActionDelete: Invalid parameters!\n");
1017 MMset(m, 0, NIL);
1018 return 0;
1019 }
1020
1021 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1022 if (webNavigator == 0)
1023 {
1024 MMechostr(MSKDEBUG, "WebNavigatorActionDelete: Invalid parameters!\n");
1025 MMset(m, 0, NIL);
1026 return 0;
1027 }
1028
1029 // Get the optional frame name
1030 std::string frameName = "";
1031 if (scolFrameName != NIL)
1032 frameName = MMstartstr(m, MTOP(scolFrameName));
1033
1034 webNavigator->Delete(frameName);
1035 MMset(m, 0, ITOM(1));
1036 return 0;
1037}
1038
1049{
1050#ifdef SCOL_DEBUG
1051 MMechostr(MSKDEBUG, "WebNavigatorActionSelectAll\n");
1052#endif
1053
1054 int scolFrameName = MMpull(m);
1055 int webNavigatorIndex = MMget(m, 0);
1056 if (webNavigatorIndex == NIL)
1057 {
1058 MMechostr(MSKDEBUG, "WebNavigatorActionSelectAll: Invalid parameters!\n");
1059 MMset(m, 0, NIL);
1060 return 0;
1061 }
1062
1063 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1064 if (webNavigator == 0)
1065 {
1066 MMechostr(MSKDEBUG, "WebNavigatorActionSelectAll: Invalid parameters!\n");
1067 MMset(m, 0, NIL);
1068 return 0;
1069 }
1070
1071 // Get the optional frame name
1072 std::string frameName = "";
1073 if (scolFrameName != NIL)
1074 frameName = MMstartstr(m, MTOP(scolFrameName));
1075
1076 webNavigator->SelectAll(frameName);
1077 MMset(m, 0, ITOM(1));
1078 return 0;
1079}
1080
1091{
1092#ifdef SCOL_DEBUG
1093 MMechostr(MSKDEBUG, "WebNavigatorPrint\n");
1094#endif
1095
1096 int scolFrameName = MMpull(m);
1097 int webNavigatorIndex = MMget(m, 0);
1098 if (webNavigatorIndex == NIL)
1099 {
1100 MMechostr(MSKDEBUG, "WebNavigatorPrint: Invalid parameters!\n");
1101 MMset(m, 0, NIL);
1102 return 0;
1103 }
1104
1105 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1106 if (webNavigator == 0)
1107 {
1108 MMechostr(MSKDEBUG, "WebNavigatorPrint: Invalid parameters!\n");
1109 MMset(m, 0, NIL);
1110 return 0;
1111 }
1112
1113 // Get the optional frame name
1114 std::string frameName = "";
1115 if (scolFrameName != NIL)
1116 frameName = MMstartstr(m, MTOP(scolFrameName));
1117
1118 webNavigator->Print(frameName);
1119 MMset(m, 0, ITOM(1));
1120 return 0;
1121}
1122
1133{
1134#ifdef SCOL_DEBUG
1135 MMechostr(MSKDEBUG, "WebNavigatorViewSource\n");
1136#endif
1137
1138 int scolFrameName = MMpull(m);
1139 int webNavigatorIndex = MMget(m, 0);
1140 if (webNavigatorIndex == NIL)
1141 {
1142 MMechostr(MSKDEBUG, "WebNavigatorViewSource: Invalid parameters!\n");
1143 MMset(m, 0, NIL);
1144 return 0;
1145 }
1146
1147 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1148 if (webNavigator == 0)
1149 {
1150 MMechostr(MSKDEBUG, "WebNavigatorViewSource: Invalid parameters!\n");
1151 MMset(m, 0, NIL);
1152 return 0;
1153 }
1154
1155 // Get the optional frame name
1156 std::string frameName = "";
1157 if (scolFrameName != NIL)
1158 frameName = MMstartstr(m, MTOP(scolFrameName));
1159
1160 webNavigator->ViewSource(frameName);
1161 MMset(m, 0, ITOM(1));
1162 return 0;
1163}
1164
1175{
1176#ifdef SCOL_DEBUG
1177 MMechostr(MSKDEBUG, "WebNavigatorGetSource\n");
1178#endif
1179
1180 int scolFrameName = MMpull(m);
1181 int webNavigatorIndex = MMpull(m);
1182 if (webNavigatorIndex == NIL)
1183 {
1184 MMechostr(MSKDEBUG, "WebNavigatorGetSource: Invalid parameters!\n");
1185 MMpush(m, NIL);
1186 return 0;
1187 }
1188
1189 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1190 if (webNavigator == 0)
1191 {
1192 MMechostr(MSKDEBUG, "WebNavigatorGetSource: Invalid parameters!\n");
1193 MMpush(m, NIL);
1194 return 0;
1195 }
1196
1197 // Get the optional frame name
1198 std::string frameName = "";
1199 if (scolFrameName != NIL)
1200 frameName = MMstartstr(m, MTOP(scolFrameName));
1201
1202 std::string frameSource = webNavigator->GetSource(frameName);
1203 return Mpushstrbloc(m, (char*)(frameSource.c_str()));
1204 return 0;
1205}
1206
1217{
1218#ifdef SCOL_DEBUG
1219 MMechostr(MSKDEBUG, "WebNavigatorGetText\n");
1220#endif
1221
1222 int scolFrameName = MMpull(m);
1223 int webNavigatorIndex = MMpull(m);
1224 if (webNavigatorIndex == NIL)
1225 {
1226 MMechostr(MSKDEBUG, "WebNavigatorGetText: Invalid parameters!\n");
1227 MMpush(m, NIL);
1228 return 0;
1229 }
1230
1231 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1232 if (webNavigator == 0)
1233 {
1234 MMechostr(MSKDEBUG, "WebNavigatorGetText: Invalid parameters!\n");
1235 MMpush(m, NIL);
1236 return 0;
1237 }
1238
1239 // Get the optional frame name
1240 std::string frameName = "";
1241 if (scolFrameName != NIL)
1242 frameName = MMstartstr(m, MTOP(scolFrameName));
1243
1244 std::string frameText = webNavigator->GetText(frameName);
1245 return Mpushstrbloc(m, (char*)(frameText.c_str()));
1246 return 0;
1247}
1248
1265{
1266#ifdef SCOL_DEBUG
1267 MMechostr(MSKDEBUG, "WebNavigatorExecuteJavaScript\n");
1268#endif
1269
1270 int scolFrameName = MMpull(m);
1271 int scolLigneNumber = MMpull(m);
1272 int scolUrl = MMpull(m);
1273 int scolJavascript = MMpull(m);
1274 int webNavigatorIndex = MMget(m, 0);
1275 if ((webNavigatorIndex == NIL) || (scolJavascript == NIL))
1276 {
1277 MMechostr(MSKDEBUG, "WebNavigatorExecuteJavaScript: Invalid parameters!\n");
1278 MMset(m, 0, NIL);
1279 return 0;
1280 }
1281
1282 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1283 if (webNavigator == 0)
1284 {
1285 MMechostr(MSKDEBUG, "WebNavigatorExecuteJavaScript: Invalid parameters!\n");
1286 MMset(m, 0, NIL);
1287 return 0;
1288 }
1289
1290 // Get the javascript code
1291 std::string javascriptCode = MMstartstr(m, MTOP(scolJavascript));
1292
1293 // Get the optional url
1294 std::string url = "";
1295 if (scolUrl != NIL)
1296 url = MMstartstr(m, MTOP(scolUrl));
1297
1298 // Get the optional line number
1299 int ligneNumber = 0;
1300 if (scolLigneNumber != NIL)
1301 ligneNumber = MTOI(scolLigneNumber);
1302
1303 // Get the optional frame name
1304 std::string frameName = "";
1305 if (scolFrameName != NIL)
1306 frameName = MMstartstr(m, MTOP(scolFrameName));
1307
1308 webNavigator->ExecuteJavaScript(javascriptCode, url, ligneNumber, frameName);
1309 MMset(m, 0, ITOM(1));
1310 return 0;
1311}
1312
1323{
1324#ifdef SCOL_DEBUG
1325 MMechostr(MSKDEBUG, "WebNavigatorGetURL\n");
1326#endif
1327
1328 int scolFrameName = MMpull(m);
1329 int webNavigatorIndex = MMpull(m);
1330 if (webNavigatorIndex == NIL)
1331 {
1332 MMechostr(MSKDEBUG, "WebNavigatorGetURL: Invalid parameters!\n");
1333 MMpush(m, NIL);
1334 return 0;
1335 }
1336
1337 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1338 if (webNavigator == 0)
1339 {
1340 MMechostr(MSKDEBUG, "WebNavigatorGetURL: Invalid parameters!\n");
1341 MMpush(m, NIL);
1342 return 0;
1343 }
1344
1345 // Get the optional frame name
1346 std::string frameName = "";
1347 if (scolFrameName != NIL)
1348 frameName = MMstartstr(m, MTOP(scolFrameName));
1349
1350 std::string url = webNavigator->GetURL(frameName);
1351 return Mpushstrbloc(m, (char*)(url.c_str()));
1352 return 0;
1353}
1354
1364{
1365#ifdef SCOL_DEBUG
1366 MMechostr(MSKDEBUG, "WebNavigatorCanGoBack\n");
1367#endif
1368
1369 int webNavigatorIndex = MMget(m, 0);
1370 if (webNavigatorIndex == NIL)
1371 {
1372 MMechostr(MSKDEBUG, "WebNavigatorCanGoBack: Invalid parameters!\n");
1373 MMset(m, 0, NIL);
1374 return 0;
1375 }
1376
1377 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1378 if (webNavigator == 0)
1379 {
1380 MMechostr(MSKDEBUG, "WebNavigatorCanGoBack: Invalid parameters!\n");
1381 MMset(m, 0, NIL);
1382 return 0;
1383 }
1384
1385 if (webNavigator->CanGoBack())
1386 MMset(m, 0, ITOM(1));
1387 else
1388 MMset(m, 0, ITOM(0));
1389 return 0;
1390}
1391
1401{
1402#ifdef SCOL_DEBUG
1403 MMechostr(MSKDEBUG, "WebNavigatorGoBack\n");
1404#endif
1405
1406 int webNavigatorIndex = MMget(m, 0);
1407 if (webNavigatorIndex == NIL)
1408 {
1409 MMechostr(MSKDEBUG, "WebNavigatorGoBack: Invalid parameters!\n");
1410 MMset(m, 0, NIL);
1411 return 0;
1412 }
1413
1414 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1415 if (webNavigator == 0)
1416 {
1417 MMechostr(MSKDEBUG, "WebNavigatorGoBack: Invalid parameters!\n");
1418 MMset(m, 0, NIL);
1419 return 0;
1420 }
1421
1422 webNavigator->GoBack();
1423 MMset(m, 0, ITOM(1));
1424 return 0;
1425}
1426
1436{
1437#ifdef SCOL_DEBUG
1438 MMechostr(MSKDEBUG, "WebNavigatorCanGoForward\n");
1439#endif
1440
1441 int webNavigatorIndex = MMget(m, 0);
1442 if (webNavigatorIndex == NIL)
1443 {
1444 MMechostr(MSKDEBUG, "WebNavigatorCanGoForward: Invalid parameters!\n");
1445 MMset(m, 0, NIL);
1446 return 0;
1447 }
1448
1449 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1450 if (webNavigator == 0)
1451 {
1452 MMechostr(MSKDEBUG, "WebNavigatorCanGoForward: Invalid parameters!\n");
1453 MMset(m, 0, NIL);
1454 return 0;
1455 }
1456
1457 if (webNavigator->CanGoForward())
1458 MMset(m, 0, ITOM(1));
1459 else
1460 MMset(m, 0, ITOM(0));
1461 return 0;
1462}
1463
1473{
1474#ifdef SCOL_DEBUG
1475 MMechostr(MSKDEBUG, "WebNavigatorGoForward\n");
1476#endif
1477
1478 int webNavigatorIndex = MMget(m, 0);
1479 if (webNavigatorIndex == NIL)
1480 {
1481 MMechostr(MSKDEBUG, "WebNavigatorGoForward: Invalid parameters!\n");
1482 MMset(m, 0, NIL);
1483 return 0;
1484 }
1485
1486 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1487 if (webNavigator == 0)
1488 {
1489 MMechostr(MSKDEBUG, "WebNavigatorGoForward: Invalid parameters!\n");
1490 MMset(m, 0, NIL);
1491 return 0;
1492 }
1493
1494 webNavigator->GoForward();
1495 MMset(m, 0, ITOM(1));
1496 return 0;
1497}
1498
1508{
1509#ifdef SCOL_DEBUG
1510 MMechostr(MSKDEBUG, "WebNavigatorReload\n");
1511#endif
1512
1513 int webNavigatorIndex = MMget(m, 0);
1514 if (webNavigatorIndex == NIL)
1515 {
1516 MMechostr(MSKDEBUG, "WebNavigatorReload: Invalid parameters!\n");
1517 MMset(m, 0, NIL);
1518 return 0;
1519 }
1520
1521 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1522 if (webNavigator == 0)
1523 {
1524 MMechostr(MSKDEBUG, "WebNavigatorReload: Invalid parameters!\n");
1525 MMset(m, 0, NIL);
1526 return 0;
1527 }
1528
1529 webNavigator->Reload();
1530 MMset(m, 0, ITOM(1));
1531 return 0;
1532}
1533
1543{
1544#ifdef SCOL_DEBUG
1545 MMechostr(MSKDEBUG, "WebNavigatorReloadIgnoreCache\n");
1546#endif
1547
1548 int webNavigatorIndex = MMget(m, 0);
1549 if (webNavigatorIndex == NIL)
1550 {
1551 MMechostr(MSKDEBUG, "WebNavigatorReloadIgnoreCache: Invalid parameters!\n");
1552 MMset(m, 0, NIL);
1553 return 0;
1554 }
1555
1556 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1557 if (webNavigator == 0)
1558 {
1559 MMechostr(MSKDEBUG, "WebNavigatorReloadIgnoreCache: Invalid parameters!\n");
1560 MMset(m, 0, NIL);
1561 return 0;
1562 }
1563
1564 webNavigator->ReloadIgnoreCache();
1565 MMset(m, 0, ITOM(1));
1566 return 0;
1567}
1568
1578{
1579#ifdef SCOL_DEBUG
1580 MMechostr(MSKDEBUG, "WebNavigatorStopLoad\n");
1581#endif
1582
1583 int webNavigatorIndex = MMget(m, 0);
1584 if (webNavigatorIndex == NIL)
1585 {
1586 MMechostr(MSKDEBUG, "WebNavigatorStopLoad: Invalid parameters!\n");
1587 MMset(m, 0, NIL);
1588 return 0;
1589 }
1590
1591 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1592 if (webNavigator == 0)
1593 {
1594 MMechostr(MSKDEBUG, "WebNavigatorStopLoad: Invalid parameters!\n");
1595 MMset(m, 0, NIL);
1596 return 0;
1597 }
1598
1599 webNavigator->StopLoad();
1600 MMset(m, 0, ITOM(1));
1601 return 0;
1602}
1603
1617int SO3WebNavigatorFind(mmachine m)
1618{
1619#ifdef SCOL_DEBUG
1620 MMechostr(MSKDEBUG, "WebNavigatorFind\n");
1621#endif
1622
1623 int scolFirstSearch = MMpull(m);
1624 int scolCaseSensitive = MMpull(m);
1625 int scolSearchForward = MMpull(m);
1626 int scolSearchedText = MMpull(m);
1627 int scolSearchIdentifier = MMpull(m);
1628 int webNavigatorIndex = MMget(m, 0);
1629 if ((webNavigatorIndex == NIL) || (scolSearchedText == NIL) || (scolSearchIdentifier == NIL))
1630 {
1631 MMechostr(MSKDEBUG, "WebNavigatorFind: Invalid parameters!\n");
1632 MMset(m, 0, NIL);
1633 return 0;
1634 }
1635
1636 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1637 if (webNavigator == 0)
1638 {
1639 MMechostr(MSKDEBUG, "WebNavigatorFind: Invalid parameters!\n");
1640 MMset(m, 0, NIL);
1641 return 0;
1642 }
1643
1644 // Get the search index
1645 int searchIdentifier = MTOI(scolSearchIdentifier);
1646
1647 // Get text to search
1648 std::string searchedText = MMstartstr(m, MTOP(scolSearchedText));
1649
1650 // Search forward?
1651 bool searchForward = true;
1652 if (scolSearchForward != NIL)
1653 if (MTOI(scolSearchForward) == 0)
1654 searchForward = false;
1655
1656 // Case sensitive?
1657 bool caseSensitive = false;
1658 if (scolCaseSensitive != NIL)
1659 if (MTOI(scolCaseSensitive) == 0)
1660 caseSensitive = true;
1661
1662 // First search or follow up?
1663 bool firstSearch = true;
1664 if (scolFirstSearch != NIL)
1665 if (MTOI(scolFirstSearch) == 0)
1666 firstSearch = false;
1667
1668 // Launch search, response will be sent in the dedicated callback
1669 webNavigator->Find(searchIdentifier, searchedText, searchForward, caseSensitive, firstSearch);
1670 MMset(m, 0, ITOM(1));
1671 return 0;
1672}
1673
1684{
1685#ifdef SCOL_DEBUG
1686 MMechostr(MSKDEBUG, "WebNavigatorStopFinding\n");
1687#endif
1688
1689 int scolClearSelection = MMpull(m);
1690 int webNavigatorIndex = MMget(m, 0);
1691 if (webNavigatorIndex == NIL)
1692 {
1693 MMechostr(MSKDEBUG, "WebNavigatorStopFinding: Invalid parameters!\n");
1694 MMset(m, 0, NIL);
1695 return 0;
1696 }
1697
1698 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1699 if (webNavigator == 0)
1700 {
1701 MMechostr(MSKDEBUG, "WebNavigatorStopFinding: Invalid parameters!\n");
1702 MMset(m, 0, NIL);
1703 return 0;
1704 }
1705
1706 bool clearSelection = false;
1707 if (scolClearSelection != NIL)
1708 if (MTOI(scolClearSelection) == 1)
1709 clearSelection = true;
1710
1711 webNavigator->StopFinding(clearSelection);
1712 MMset(m, 0, ITOM(1));
1713 return 0;
1714}
1715
1725{
1726#ifdef SCOL_DEBUG
1727 MMechostr(MSKDEBUG, "WebNavigatorGetZoomLevel\n");
1728#endif
1729
1730 int webNavigatorIndex = MMget(m, 0);
1731 if (webNavigatorIndex == NIL)
1732 {
1733 MMechostr(MSKDEBUG, "WebNavigatorGetZoomLevel: Invalid parameters!\n");
1734 MMset(m, 0, NIL);
1735 return 0;
1736 }
1737
1738 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1739 if (webNavigator == 0)
1740 {
1741 MMechostr(MSKDEBUG, "WebNavigatorGetZoomLevel: Invalid parameters!\n");
1742 MMset(m, 0, NIL);
1743 return 0;
1744 }
1745
1746 float zoomLevel = static_cast<float>(webNavigator->GetZoomLevel());
1747 MMset(m, 0, FTOM(zoomLevel));
1748 return 0;
1749}
1750
1761{
1762#ifdef SCOL_DEBUG
1763 MMechostr(MSKDEBUG, "WebNavigatorSetZoomLevel\n");
1764#endif
1765
1766 int scolZoomLevel = MMpull(m);
1767 int webNavigatorIndex = MMget(m, 0);
1768 if ((webNavigatorIndex == NIL) || (scolZoomLevel == NIL))
1769 {
1770 MMechostr(MSKDEBUG, "WebNavigatorSetZoomLevel: Invalid parameters!\n");
1771 MMset(m, 0, NIL);
1772 return 0;
1773 }
1774
1775 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1776 if (webNavigator == 0)
1777 {
1778 MMechostr(MSKDEBUG, "WebNavigatorSetZoomLevel: Invalid parameters!\n");
1779 MMset(m, 0, NIL);
1780 return 0;
1781 }
1782
1783 float zoomLevel = MTOF(scolZoomLevel);
1784 webNavigator->SetZoomLevel(static_cast<double>(zoomLevel));
1785 MMset(m, 0, ITOM(1));
1786 return 0;
1787}
1788
1798{
1799#ifdef SCOL_DEBUG
1800 MMechostr(MSKDEBUG, "WebNavigatorClearHistory\n");
1801#endif
1802
1803 int webNavigatorIndex = MMget(m, 0);
1804 if (webNavigatorIndex == NIL)
1805 {
1806 MMechostr(MSKDEBUG, "WebNavigatorClearHistory: Invalid parameters!\n");
1807 MMset(m, 0, NIL);
1808 return 0;
1809 }
1810
1811 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1812 if (webNavigator == 0)
1813 {
1814 MMechostr(MSKDEBUG, "WebNavigatorClearHistory: Invalid parameters!\n");
1815 MMset(m, 0, NIL);
1816 return 0;
1817 }
1818
1819 webNavigator->ClearHistory();
1820 MMset(m, 0, ITOM(1));
1821 return 0;
1822}
1823
1833{
1834#ifdef SCOL_DEBUG
1835 MMechostr(MSKDEBUG, "WebNavigatorShowDevTools\n");
1836#endif
1837
1838 int webNavigatorIndex = MMget(m, 0);
1839 if (webNavigatorIndex == NIL)
1840 {
1841 MMechostr(MSKDEBUG, "WebNavigatorShowDevTools: Invalid parameters!\n");
1842 MMset(m, 0, NIL);
1843 return 0;
1844 }
1845
1846 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1847 if (webNavigator == 0)
1848 {
1849 MMechostr(MSKDEBUG, "WebNavigatorShowDevTools: Invalid parameters!\n");
1850 MMset(m, 0, NIL);
1851 return 0;
1852 }
1853
1854 webNavigator->ShowDevTools();
1855 MMset(m, 0, ITOM(1));
1856 return 0;
1857}
1858
1868{
1869#ifdef SCOL_DEBUG
1870 MMechostr(MSKDEBUG, "WebNavigatorCloseDevTools\n");
1871#endif
1872 int webNavigatorIndex = MMget(m, 0);
1873 if (webNavigatorIndex == NIL)
1874 {
1875 MMechostr(MSKDEBUG, "WebNavigatorCloseDevTools: Invalid parameters!\n");
1876 MMset(m, 0, NIL);
1877 return 0;
1878 }
1879
1880 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1881 if (webNavigator == 0)
1882 {
1883 MMechostr(MSKDEBUG, "WebNavigatorCloseDevTools: Invalid parameters!\n");
1884 MMset(m, 0, NIL);
1885 return 0;
1886 }
1887
1888 webNavigator->CloseDevTools();
1889 MMset(m, 0, ITOM(1));
1890 return 0;
1891}
1892
1904{
1905#ifdef SCOL_DEBUG
1906 MMechostr(MSKDEBUG, "WebNavigatorGetSize\n");
1907#endif
1908
1909 int webNavigatorIndex = MMget(m, 0);
1910 if (webNavigatorIndex == NIL)
1911 {
1912 MMechostr(MSKDEBUG, "WebNavigatorGetSize: Invalid parameters!\n");
1913 MMset(m, 0, NIL);
1914 return 0;
1915 }
1916
1917 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1918 if (webNavigator == 0)
1919 {
1920 MMechostr(MSKDEBUG, "WebNavigatorGetSize: Invalid parameters!\n");
1921 MMset(m, 0, NIL);
1922 return 0;
1923 }
1924
1925 // Create the 'size' return tuple
1926 int scolSize = MMmalloc(m, 2, TYPETAB);
1927 if (scolSize == NIL)
1928 return MERRMEM;
1929
1930 // Store the size
1931 std::pair<int, int> size = webNavigator->GetSize();
1932 MMstore(m, scolSize, 1, ITOM(size.first));
1933 MMstore(m, scolSize, 0, ITOM(size.second));
1934 MMset(m, 0, PTOM(scolSize));
1935 return 0;
1936}
1937
1949{
1950#ifdef SCOL_DEBUG
1951 MMechostr(MSKDEBUG, "WebNavigatorSetSize\n");
1952#endif
1953
1954 int scolHeight = MMpull(m);
1955 int scolWidth = MMpull(m);
1956 int webNavigatorIndex = MMget(m, 0);
1957 if ((webNavigatorIndex == NIL) || (scolWidth == NIL) || (scolHeight == NIL))
1958 {
1959 MMechostr(MSKDEBUG, "WebNavigatorSetSize: Invalid parameters!\n");
1960 MMset(m, 0, NIL);
1961 return 0;
1962 }
1963
1964 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
1965 if (webNavigator == 0)
1966 {
1967 MMechostr(MSKDEBUG, "WebNavigatorSetSize: Invalid parameters!\n");
1968 MMset(m, 0, NIL);
1969 return 0;
1970 }
1971
1972 webNavigator->SetSize(std::pair<int, int>(MTOI(scolWidth), MTOI(scolHeight)));
1973 MMset(m, 0, ITOM(1));
1974 return 0;
1975}
1976
1988{
1989#ifdef SCOL_DEBUG
1990 MMechostr(MSKDEBUG, "WebNavigatorGetPosition\n");
1991#endif
1992
1993 int webNavigatorIndex = MMget(m, 0);
1994 if (webNavigatorIndex == NIL)
1995 {
1996 MMechostr(MSKDEBUG, "WebNavigatorGetPosition: Invalid parameters!\n");
1997 MMset(m, 0, NIL);
1998 return 0;
1999 }
2000
2001 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2002 if (webNavigator == 0)
2003 {
2004 MMechostr(MSKDEBUG, "WebNavigatorGetPosition: Invalid parameters!\n");
2005 MMset(m, 0, NIL);
2006 return 0;
2007 }
2008
2009 // Create the 'size' return tuple
2010 int scolPosition = MMmalloc(m, 2, TYPETAB);
2011 if (scolPosition == NIL)
2012 return MERRMEM;
2013
2014 // Store the position
2015 std::pair<int, int> position = webNavigator->GetPosition();
2016 MMstore(m, scolPosition, 1, ITOM(position.first));
2017 MMstore(m, scolPosition, 0, ITOM(position.second));
2018 MMset(m, 0, PTOM(scolPosition));
2019 return 0;
2020}
2021
2033{
2034#ifdef SCOL_DEBUG
2035 MMechostr(MSKDEBUG, "WebNavigatorSetPosition\n");
2036#endif
2037
2038 int scolYPos = MMpull(m);
2039 int scolXPos = MMpull(m);
2040 int webNavigatorIndex = MMget(m, 0);
2041 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL))
2042 {
2043 MMechostr(MSKDEBUG, "WebNavigatorSetPosition: Invalid parameters!\n");
2044 MMset(m, 0, NIL);
2045 return 0;
2046 }
2047
2048 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2049 if (webNavigator == 0)
2050 {
2051 MMechostr(MSKDEBUG, "WebNavigatorSetPosition: Invalid parameters!\n");
2052 MMset(m, 0, NIL);
2053 return 0;
2054 }
2055
2056 webNavigator->SetPosition(std::pair<int, int>(MTOI(scolXPos), MTOI(scolYPos)));
2057 MMset(m, 0, ITOM(1));
2058 return 0;
2059}
2060
2071{
2072#ifdef SCOL_DEBUG
2073 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreen\n");
2074#endif
2075
2076 int scolTargetBitmap = MMpull(m);
2077 int webNavigatorIndex = MMget(m, 0);
2078 if ((webNavigatorIndex == NIL) || (scolTargetBitmap == NIL))
2079 {
2080 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreen: Invalid parameters!\n");
2081 MMset(m, 0, NIL);
2082 return 0;
2083 }
2084
2085 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2086 if (webNavigator == 0)
2087 {
2088 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreen: Invalid parameters!\n");
2089 MMset(m, 0, NIL);
2090 return 0;
2091 }
2092
2093 if (!webNavigator->IsOffscreen())
2094 {
2095 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreen: Not an offscreen rendered web navigator!\n");
2096 MMset(m, 0, NIL);
2097 return 0;
2098 }
2099
2100 // Get the target buffer
2101 PtrObjVoid OB = (PtrObjVoid)MMstart(m, MTOP(scolTargetBitmap));
2102 PtrObjBitmap B = (PtrObjBitmap)MMstart(m, MTOP(OB->Buffer));
2103
2104 // Copy buffer
2105 bool sucess = webNavigator->GetWebNavigatorClient()->BlitOffscreenBitmap(B->bits, B->TailleW, B->TailleH, B->BytesPP, B->BPL);
2106 if (!sucess)
2107 {
2108 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreen: the target bitmap don't have the same size!\n");
2109 MMset(m, 0, NIL);
2110 return 0;
2111 }
2112 else
2113 {
2114 MMset(m, 0, PTOM(scolTargetBitmap));
2115 return 0;
2116 }
2117}
2118
2129{
2130#ifdef SCOL_DEBUG
2131 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha\n");
2132#endif
2133
2134 int scolTargetAlphaBitmap = MMpull(m);
2135 int webNavigatorIndex = MMget(m, 0);
2136 if ((webNavigatorIndex == NIL) || (scolTargetAlphaBitmap == NIL))
2137 {
2138 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: Invalid parameters!\n");
2139 MMset(m, 0, NIL);
2140 return 0;
2141 }
2142
2143 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2144 if (webNavigator == 0)
2145 {
2146 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: Invalid parameters!\n");
2147 MMset(m, 0, NIL);
2148 return 0;
2149 }
2150
2151 if (!webNavigator->IsOffscreen())
2152 {
2153 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: Not an offscreen rendered web navigator!\n");
2154 MMset(m, 0, NIL);
2155 return 0;
2156 }
2157
2158 // Get alphabitmap content
2159 int scolColorLayer = MMfetch(m, MTOP(scolTargetAlphaBitmap), 0);
2160 int scolAlphaLayer = MMfetch(m, MTOP(scolTargetAlphaBitmap), 1);
2161
2162 // Get color layer bitmap
2163 PtrObjVoid scolVoidPointerBmp = (PtrObjVoid)MMstart(m, MTOP(scolColorLayer));
2164 if (scolVoidPointerBmp->Type != OBJ_TYPE_BITMAP << 1)
2165 {
2166 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: Invalid alphabitmap color layer!\n");
2167 MMset(m, 0, NIL);
2168 return 0;
2169 }
2170 PtrObjBitmap targetBitmapColor = (PtrObjBitmap)MMstart(m, MTOP(scolVoidPointerBmp->Buffer));
2171
2172 // Get alpha layer bitmap
2173 PtrObjBitmap targetBitmapAlpha = 0;
2174 if (scolAlphaLayer != NIL)
2175 {
2176 PtrObjVoid scolVoidPointerAlpha = (PtrObjVoid)MMstart(m, MTOP(scolAlphaLayer));
2177
2178 // Get alpha layer bitmap
2179 if (scolVoidPointerAlpha->Type != OBJ_TYPE_BITMAP << 1)
2180 {
2181 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: Invalid alphabitmap alpha layer!\n");
2182 MMset(m, 0, NIL);
2183 return 0;
2184 }
2185 targetBitmapAlpha = (PtrObjBitmap)MMstart(m, MTOP(scolVoidPointerAlpha->Buffer));
2186 }
2187
2188 // Copy buffer
2189 bool success = false;
2190 if (targetBitmapAlpha == 0)
2191 {
2192 success = webNavigator->GetWebNavigatorClient()->BlitOffscreenBitmap(targetBitmapColor->bits, targetBitmapColor->TailleW, targetBitmapColor->TailleH, targetBitmapColor->BytesPP, targetBitmapColor->BPL);
2193 }
2194 else
2195 {
2196 if ((targetBitmapColor->TailleW != targetBitmapAlpha->TailleW) || (targetBitmapColor->TailleH != targetBitmapAlpha->TailleH))
2197 {
2198 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: the target alphabitmap color layer have a different size than the alpha layer!\n");
2199 MMset(m, 0, NIL);
2200 return 0;
2201 }
2202
2203 success = webNavigator->GetWebNavigatorClient()->BlitOffscreenAlphaBitmap(targetBitmapColor->bits, targetBitmapAlpha->bits, targetBitmapColor->TailleW, targetBitmapColor->TailleH, targetBitmapColor->BytesPP, targetBitmapColor->BPL);
2204 }
2205
2206 // Result
2207 if (!success)
2208 {
2209 MMechostr(MSKDEBUG, "WebNavigatorBlitOffscreenAlpha: the target alphabitmap don't have the same size!\n");
2210 MMset(m, 0, NIL);
2211 return 0;
2212 }
2213 else
2214 {
2215 MMset(m, 0, PTOM(scolTargetAlphaBitmap));
2216 return 0;
2217 }
2218}
2219
2232{
2233#ifdef SCOL_DEBUG
2234 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyDown\n");
2235#endif
2236
2237 int scolKeyData = MMpull(m);
2238 int scolScanCode = MMpull(m);
2239 int webNavigatorIndex = MMget(m, 0);
2240 if ((webNavigatorIndex == NIL) || (scolScanCode == NIL))
2241 {
2242 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyDown: Invalid parameters!\n");
2243 MMset(m, 0, NIL);
2244 return 0;
2245 }
2246
2247 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2248 if (webNavigator == 0)
2249 {
2250 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyDown: Invalid parameters!\n");
2251 MMset(m, 0, NIL);
2252 return 0;
2253 }
2254
2255 webNavigator->InjectKey(MTOI(scolScanCode), MTOI(scolKeyData), true);
2256 webNavigator->InjectChar(MTOI(scolScanCode), MTOI(scolKeyData));
2257 MMset(m, 0, ITOM(1));
2258 return 0;
2259}
2260
2272{
2273#ifdef SCOL_DEBUG
2274 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyUp\n");
2275#endif
2276
2277 int scolScanCode = MMpull(m);
2278 int webNavigatorIndex = MMget(m, 0);
2279 if ((webNavigatorIndex == NIL) || (scolScanCode == NIL))
2280 {
2281 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyUp: Invalid parameters!\n");
2282 MMset(m, 0, NIL);
2283 return 0;
2284 }
2285
2286 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2287 if (webNavigator == 0)
2288 {
2289 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyUp: Invalid parameters!\n");
2290 MMset(m, 0, NIL);
2291 return 0;
2292 }
2293
2294 webNavigator->InjectKey(MTOI(scolScanCode), 0, false);
2295 MMset(m, 0, ITOM(1));
2296 return 0;
2297}
2298
2311{
2312#ifdef SCOL_DEBUG
2313 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyMessage\n");
2314#endif
2315
2316 int scolWparam = MMpull(m);
2317 int scolLparam = MMpull(m);
2318 int scolMsg = MMpull(m);
2319 int webNavigatorIndex = MMget(m, 0);
2320 if ((webNavigatorIndex == NIL) || (scolMsg == NIL))
2321 {
2322 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyMessage: Invalid parameters!\n");
2323 MMset(m, 0, NIL);
2324 return 0;
2325 }
2326
2327 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2328 if (webNavigator == 0)
2329 {
2330 MMechostr(MSKDEBUG, "WebNavigatorInjectKeyMessage: Invalid parameters!\n");
2331 MMset(m, 0, NIL);
2332 return 0;
2333 }
2334
2335 webNavigator->InjectKeyMsg(MTOI(scolMsg), MTOI(scolLparam), MTOI(scolWparam));
2336 MMset(m, 0, ITOM(1));
2337 return 0;
2338}
2339
2352{
2353#ifdef SCOL_DEBUG
2354 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseClick\n");
2355#endif
2356
2357 int scolButton = MMpull(m);
2358 int scolYPos = MMpull(m);
2359 int scolXPos = MMpull(m);
2360 int webNavigatorIndex = MMget(m, 0);
2361 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL) || (scolButton == NIL))
2362 {
2363 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseClick: Invalid parameters!\n");
2364 MMset(m, 0, NIL);
2365 return 0;
2366 }
2367
2368 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2369 if (webNavigator == 0)
2370 {
2371 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseClick: Invalid parameters!\n");
2372 MMset(m, 0, NIL);
2373 return 0;
2374 }
2375
2376 webNavigator->InjectMouseClick(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolButton), false, 1);
2377 MMset(m, 0, ITOM(1));
2378 return 0;
2379}
2380
2381
2394{
2395#ifdef SCOL_DEBUG
2396 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseUnClick\n");
2397#endif
2398
2399 int scolButton = MMpull(m);
2400 int scolYPos = MMpull(m);
2401 int scolXPos = MMpull(m);
2402 int webNavigatorIndex = MMget(m, 0);
2403 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL) || (scolButton == NIL))
2404 {
2405 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseUnClick: Invalid parameters!\n");
2406 MMset(m, 0, NIL);
2407 return 0;
2408 }
2409
2410 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2411 if (webNavigator == 0)
2412 {
2413 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseUnClick: Invalid parameters!\n");
2414 MMset(m, 0, NIL);
2415 return 0;
2416 }
2417
2418 webNavigator->InjectMouseClick(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolButton), true, 1);
2419 MMset(m, 0, ITOM(1));
2420 return 0;
2421}
2422
2434{
2435#ifdef SCOL_DEBUG
2436 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseMove\n");
2437#endif
2438
2439 int scolYPos = MMpull(m);
2440 int scolXPos = MMpull(m);
2441 int webNavigatorIndex = MMget(m, 0);
2442 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL))
2443 {
2444 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseMove: Invalid parameters!\n");
2445 MMset(m, 0, NIL);
2446 return 0;
2447 }
2448
2449 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2450 if (webNavigator == 0)
2451 {
2452 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseMove: Invalid parameters!\n");
2453 MMset(m, 0, NIL);
2454 return 0;
2455 }
2456
2457 webNavigator->InjectMouseMove(MTOI(scolXPos), MTOI(scolYPos), false);
2458 MMset(m, 0, ITOM(1));
2459 return 0;
2460}
2461
2474{
2475#ifdef SCOL_DEBUG
2476 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseWheel\n");
2477#endif
2478
2479 int scolDelta = MMpull(m);
2480 int scolYPos = MMpull(m);
2481 int scolXPos = MMpull(m);
2482 int webNavigatorIndex = MMget(m, 0);
2483 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL) || (scolDelta == NIL))
2484 {
2485 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseWheel: Invalid parameters!\n");
2486 MMset(m, 0, NIL);
2487 return 0;
2488 }
2489
2490 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2491 if (webNavigator == 0)
2492 {
2493 MMechostr(MSKDEBUG, "WebNavigatorInjectMouseWheel: Invalid parameters!\n");
2494 MMset(m, 0, NIL);
2495 return 0;
2496 }
2497
2498 webNavigator->InjectMouseWheel(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolDelta));
2499 MMset(m, 0, ITOM(1));
2500 return 0;
2501}
2502
2513{
2514#ifdef SCOL_DEBUG
2515 MMechostr(MSKDEBUG, "WebNavigatorInjectFocus\n");
2516#endif
2517
2518 int scolFocus = MMpull(m);
2519 int webNavigatorIndex = MMget(m, 0);
2520 if ((webNavigatorIndex == NIL) || (scolFocus == NIL))
2521 {
2522 MMechostr(MSKDEBUG, "WebNavigatorInjectFocus: Invalid parameters!\n");
2523 MMset(m, 0, NIL);
2524 return 0;
2525 }
2526
2527 SO3::EmbeddedWebNavigator::WebNavigator* webNavigator = MMgetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex));
2528 if (webNavigator == 0)
2529 {
2530 MMechostr(MSKDEBUG, "WebNavigatorInjectFocus: Invalid parameters!\n");
2531 MMset(m, 0, NIL);
2532 return 0;
2533 }
2534
2535 if (MTOI(scolFocus) == 1)
2536 webNavigator->InjectFocus(true);
2537 else
2538 webNavigator->InjectFocus(false);
2539 MMset(m, 0, ITOM(1));
2540 return 0;
2541}
2542
2558{
2559#ifdef SCOL_DEBUG
2560 MMechostr(MSKDEBUG, "SO3WebNavigatorSetCookie\n");
2561#endif
2562
2563 int scolCookieHttpOnly = MMpull(m);
2564 int scolCookieSecure = MMpull(m);
2565 int scolCookiePath = MMpull(m);
2566 int scolCookieDomain = MMpull(m);
2567 int scolCookieValue = MMpull(m);
2568 int scolCookieName = MMpull(m);
2569 int scolCookieUrl = MMget(m, 0);
2570 if ((scolCookieUrl == NIL) || (scolCookieValue == NIL))
2571 {
2572 MMechostr(MSKDEBUG, "SO3WebNavigatorSetCookie: Invalid parameters!\n");
2573 MMset(m, 0, NIL);
2574 return 0;
2575 }
2576
2577 // Setting up parameters
2578 std::string cookieUrl(MMstartstr(m, MTOP(scolCookieUrl)));
2579 std::string cookieName = "";
2580 if (scolCookieName != NIL)
2581 cookieName = MMstartstr(m, MTOP(scolCookieName));
2582
2583 std::string cookieValue(MMstartstr(m, MTOP(scolCookieValue)));
2584 std::string cookieDomain = "";
2585 if (scolCookieDomain != NIL)
2586 cookieDomain = MMstartstr(m, MTOP(scolCookieDomain));
2587
2588 std::string cookiePath = "";
2589 if (scolCookiePath != NIL)
2590 cookiePath = MMstartstr(m, MTOP(scolCookiePath));
2591
2592 bool secure = false;
2593 if ((scolCookieSecure != NIL) && (MTOI(scolCookieSecure) == 1))
2594 secure = true;
2595
2596 bool httpOnly = false;
2597 if ((scolCookieHttpOnly != NIL) && (MTOI(scolCookieHttpOnly) == 1))
2598 httpOnly = true;
2599
2600 // Call
2601 if (SO3::EmbeddedWebNavigator::WebNavigatorManager::GetSingleton().SetCookie(cookieUrl, cookieName, cookieValue, cookieDomain, cookiePath, secure, httpOnly))
2602 MMset(m, 0, ITOM(1));
2603 else
2604 MMset(m, 0, ITOM(0));
2605 return 0;
2606}
2607
2618{
2619#ifdef SCOL_DEBUG
2620 MMechostr(MSKDEBUG, "SO3WebNavigatorDeleteCookies\n");
2621#endif
2622
2623 int scolCookieName = MMpull(m);
2624 int scolCookieUrl = MMget(m, 0);
2625
2626 // Setting up parameters
2627 std::string cookieUrl = "";
2628 if (scolCookieUrl != NIL)
2629 cookieUrl = MMstartstr(m, MTOP(scolCookieUrl));
2630 std::string cookieName = "";
2631 if (scolCookieName != NIL)
2632 cookieName = MMstartstr(m, MTOP(scolCookieName));
2633
2634 // Call
2635 if (SO3::EmbeddedWebNavigator::WebNavigatorManager::GetSingleton().DeleteCookies(cookieUrl, cookieName))
2636 MMset(m, 0, ITOM(1));
2637 else
2638 MMset(m, 0, ITOM(0));
2639 return 0;
2640}
2641
2652WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnNavStateChange, WEB_NAVIGATOR_DISPLAY_ON_NAV_STATE_CHANGE_CB)
2653
2654
2666WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnAddressChange, WEB_NAVIGATOR_DISPLAY_ON_ADDRESS_CHANGE_CB)
2667
2668
2679WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnTitleChange, WEB_NAVIGATOR_DISPLAY_ON_TITLE_CHANGE_CB)
2680
2695WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnTooltip, WEB_NAVIGATOR_DISPLAY_ON_TOOLTIP_CB)
2696
2709WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnStatusMessage, WEB_NAVIGATOR_DISPLAY_ON_STATUS_MESSAGE_CB)
2710
2725WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnConsoleMessage, WEB_NAVIGATOR_DISPLAY_ON_CONSOLE_MESSAGE_CB)
2726
2745WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnFindResult, WEB_NAVIGATOR_FIND_ON_RESULT_CB)
2746
2762WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnPopup, WEB_NAVIGATOR_LIFESPAN_ON_POPUP_CB)
2763
2775WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(RunModal, WEB_NAVIGATOR_LIFESPAN_RUN_MODAL_CB)
2776
2791WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnLoadStart, WEB_NAVIGATOR_LOAD_ON_START_CB)
2792
2809WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnLoadEnd, WEB_NAVIGATOR_LOAD_ON_END_CB)
2810
2879WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnLoadError, WEB_NAVIGATOR_LOAD_ON_ERROR_CB)
2880
2881
2882NativeDefinition natSO3WebNavigator[] = {
2883 { "ObjWebNavigator", TYPTYPE, NULL, NULL },
2884 { "SO3WebNavigatorCreate", 7, "fun [Chn ObjWin I I I I S] ObjWebNavigator", SO3WebNavigatorCreate },
2885 { "SO3WebNavigatorCreateOffscreen", 6, "fun [Chn ObjWin I I I S] ObjWebNavigator", SO3WebNavigatorCreateOffscreen },
2886 { "SO3WebNavigatorDestroy", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorDestroy },
2887 { "SO3WebNavigatorLoadURL", 3, "fun [ObjWebNavigator S S] I", SO3WebNavigatorLoadURL },
2888 { "SO3WebNavigatorLoadFile", 3, "fun [ObjWebNavigator P S] I", SO3WebNavigatorLoadFile },
2889 { "SO3WebNavigatorLoadHTML", 3, "fun [ObjWebNavigator S S] I", SO3WebNavigatorLoadHTML },
2890 { "SO3WebNavigatorActionUndo", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionUndo },
2891 { "SO3WebNavigatorActionRedo", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionRedo },
2892 { "SO3WebNavigatorActionCut", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionCut },
2893 { "SO3WebNavigatorActionCopy", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionCopy },
2894 { "SO3WebNavigatorActionPaste", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionPaste },
2895 { "SO3WebNavigatorActionDelete", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionDelete },
2896 { "SO3WebNavigatorActionSelectAll", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorActionSelectAll },
2897 { "SO3WebNavigatorPrint", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorPrint },
2898 { "SO3WebNavigatorViewSource", 2, "fun [ObjWebNavigator S] I", SO3WebNavigatorViewSource },
2899 { "SO3WebNavigatorGetSource", 2, "fun [ObjWebNavigator S] S", SO3WebNavigatorGetSource },
2900 { "SO3WebNavigatorGetText", 2, "fun [ObjWebNavigator S] S", SO3WebNavigatorGetText },
2901 { "SO3WebNavigatorGetURL", 2, "fun [ObjWebNavigator S] S", SO3WebNavigatorGetURL },
2902 { "SO3WebNavigatorExecuteJavaScript", 5, "fun [ObjWebNavigator S S I S] I", SO3WebNavigatorExecuteJavaScript },
2903 { "SO3WebNavigatorCanGoBack", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorCanGoBack },
2904 { "SO3WebNavigatorGoBack", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorGoBack },
2905 { "SO3WebNavigatorCanGoForward", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorCanGoForward },
2906 { "SO3WebNavigatorGoForward", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorGoForward },
2907 { "SO3WebNavigatorReload", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorReload },
2908 { "SO3WebNavigatorReloadIgnoreCache", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorReloadIgnoreCache },
2909 { "SO3WebNavigatorStopLoad", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorStopLoad },
2910 { "SO3WebNavigatorFind", 6, "fun [ObjWebNavigator I S I I I] I", SO3WebNavigatorFind },
2911 { "SO3WebNavigatorStopFinding", 2, "fun [ObjWebNavigator I] I", SO3WebNavigatorStopFinding },
2912 { "SO3WebNavigatorGetZoomLevel", 1, "fun [ObjWebNavigator] F", SO3WebNavigatorGetZoomLevel },
2913 { "SO3WebNavigatorSetZoomLevel", 2, "fun [ObjWebNavigator F] I", SO3WebNavigatorSetZoomLevel },
2914 { "SO3WebNavigatorClearHistory", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorClearHistory },
2915 { "SO3WebNavigatorShowDevTools", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorShowDevTools },
2916 { "SO3WebNavigatorCloseDevTools", 1, "fun [ObjWebNavigator] I", SO3WebNavigatorCloseDevTools },
2917 { "SO3WebNavigatorGetSize", 1, "fun [ObjWebNavigator] [I I]", SO3WebNavigatorGetSize },
2918 { "SO3WebNavigatorSetSize", 3, "fun [ObjWebNavigator I I] I", SO3WebNavigatorSetSize },
2919 { "SO3WebNavigatorGetPosition", 1, "fun [ObjWebNavigator] [I I]", SO3WebNavigatorGetPosition },
2920 { "SO3WebNavigatorSetPosition", 3, "fun [ObjWebNavigator I I] I", SO3WebNavigatorSetPosition },
2921 { "SO3WebNavigatorBlitOffscreen", 2, "fun [ObjWebNavigator ObjBitmap] ObjBitmap", SO3WebNavigatorBlitOffscreen },
2922 { "SO3WebNavigatorBlitOffscreenAlpha", 2, "fun [ObjWebNavigator AlphaBitmap] AlphaBitmap", SO3WebNavigatorBlitOffscreenAlpha },
2923 { "SO3WebNavigatorInjectKeyDown", 3, "fun [ObjWebNavigator I I] I", SO3WebNavigatorInjectKeyDown },
2924 { "SO3WebNavigatorInjectKeyUp", 2, "fun [ObjWebNavigator I] I", SO3WebNavigatorInjectKeyUp },
2925 { "SO3WebNavigatorInjectKeyMessage", 4, "fun [ObjWebNavigator I I I] I", SO3WebNavigatorInjectKeyMessage },
2926 { "SO3WebNavigatorInjectMouseClick", 4, "fun [ObjWebNavigator I I I] I", SO3WebNavigatorInjectMouseClick },
2927 { "SO3WebNavigatorInjectMouseUnClick", 4, "fun [ObjWebNavigator I I I] I", SO3WebNavigatorInjectMouseUnClick },
2928 { "SO3WebNavigatorInjectMouseMove", 3, "fun [ObjWebNavigator I I] I", SO3WebNavigatorInjectMouseMove },
2929 { "SO3WebNavigatorInjectMouseWheel", 4, "fun [ObjWebNavigator I I I] I", SO3WebNavigatorInjectMouseWheel },
2930 { "SO3WebNavigatorInjectFocus", 2, "fun [ObjWebNavigator I] I", SO3WebNavigatorInjectFocus },
2931 { "SO3WebNavigatorSetCookie", 7, "fun [S S S S S I I] I", SO3WebNavigatorSetCookie },
2932 { "SO3WebNavigatorDeleteCookies", 2, "fun [S S] I", SO3WebNavigatorDeleteCookies },
2933 { "SO3WebNavigatorCbOnAddressChange", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnAddressChange },
2934 { "SO3WebNavigatorCbOnTitleChange", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnTitleChange },
2935 { "SO3WebNavigatorCbOnTooltip", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnTooltip },
2936 { "SO3WebNavigatorCbOnConsoleMessage", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S S I] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnConsoleMessage },
2937 { "SO3WebNavigatorCbOnFindResult", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 I I [I I I I] I I] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnFindResult },
2938 { "SO3WebNavigatorCbOnPopup", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 I I I I S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnPopup },
2939 { "SO3WebNavigatorCbRunModal", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0] u1 u0] ObjWebNavigator", SO3WebNavigatorCbRunModal },
2940 { "SO3WebNavigatorCbOnLoadStart", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnLoadStart },
2941 { "SO3WebNavigatorCbOnLoadEnd", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S I] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnLoadEnd },
2942 { "SO3WebNavigatorCbOnLoadError", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S S I S] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnLoadError },
2943 { "SO3WebNavigatorCbOnExternalCall", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S [S r1]] u1 u0] ObjWebNavigator", SO3WebNavigatorCbOnExternalCall },
2944 { "SO3WebNavigatorCbOnExternalCallStr", 3, "fun [ObjWebNavigator fun [ObjWebNavigator u0 S [S r1]] S u0] ObjWebNavigator", SO3WebNavigatorCbOnExternalCallStr }
2945};
2946
2947
2948// Everything inside _cond and _endcond is ignored by doxygen
2950
2955int SCOLloadWebNavigator(mmachine m)
2956{
2957 // Scol type declaration
2958 OBJWEBNAVIGATORSCOL = OBJregister(WEB_NAVIGATOR_MAX_CB, 1, destroyWebNavigatorObj, "OBJWEBNAVIGATORSCOL");
2959
2960 // Load OBJWEBNAVIGATORSCOL scol functions
2961 return PKhardpak2(m, "SO3WebNavigator.pkg", sizeof(natSO3WebNavigator) / sizeof(natSO3WebNavigator[0]), natSO3WebNavigator);
2962}
2963
2969{
2970 return 0;
2971}
2972
2974
2975#endif
int destroyWebNavigatorObj(mmachine m, SCOL_PTR_TYPE handsys, int webNavigatorIndex)
int OBJWEBNAVIGATORSCOL
int(* CallMainThread)(void *, mmachine m)
main include
Definition SO3SCOL.cpp:84
WEB_NAVIGATOR_DISPLAY_ON_ADDRESS_CHANGE_CB WEB_NAVIGATOR_DISPLAY_ON_TOOLTIP_CB WEB_NAVIGATOR_DISPLAY_ON_CONSOLE_MESSAGE_CB WEB_NAVIGATOR_LIFESPAN_ON_POPUP_CB WEB_NAVIGATOR_LOAD_ON_START_CB WEB_NAVIGATOR_LOAD_ON_ERROR_CB NativeDefinition natSO3WebNavigator[]
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
int SCOLfreeWebNavigator()
int SCOLloadWebNavigator(mmachine m)
void Cut(const std::string &frameName="")
void InjectMouseClick(int x, int y, int buttonType, bool mouseUp, int clickCount)
void LoadFile(const std::string &file, const std::string &frameName="")
std::string GetText(const std::string &frameName="")
void Delete(const std::string &frameName="")
void Redo(const std::string &frameName="")
void Undo(const std::string &frameName="")
std::string GetSource(const std::string &frameName="")
void SetSize(std::pair< int, int > newSize)
void ViewSource(const std::string &frameName="")
std::string GetURL(const std::string &frameName="")
void SelectAll(const std::string &frameName="")
void LoadURL(const std::string &url, const std::string &frameName="")
void SetPosition(std::pair< int, int > newPosition)
void InjectKeyMsg(int msg, LPARAM lparam, WPARAM wparam)
void InjectMouseMove(int x, int y, bool mouseLeave)
void Find(int identifier, const CefString &searchText, bool forward, bool matchCase, bool findNext)
void Print(const std::string &frameName="")
CefRefPtr< WebNavigatorClient > & GetWebNavigatorClient()
void Paste(const std::string &frameName="")
void SetListener(WebNavigatorListener *newListener)
void LoadHTML(const std::string &html, const std::string &frameName="")
void ExecuteJavaScript(const std::string &jsCode, const std::string &scriptUrl, int startLine, const std::string &frameName="")
void Copy(const std::string &frameName="")
void InjectKey(int scanCode, int keydata, bool down)
virtual void OnLoadEnd(WebNavigator *sourceWebNavigator, const std::string &frameName, int httpStatusCode)
virtual void OnConsoleMessage(WebNavigator *sourceWebNavigator, const std::string &message, const std::string &source, int line)
virtual void RunModal(WebNavigator *sourceWebNavigator)
virtual void OnExternalCall(WebNavigator *sourceWebNavigator, const SScriptFunction &functionCalled)
virtual void OnLoadError(WebNavigator *sourceWebNavigator, const std::string &frameName, int errorCode, const std::string &failedUrl, std::string &errorText)
virtual void OnAddressChange(WebNavigator *sourceWebNavigator, const std::string &frameName, const std::string &url)
virtual void OnExternalCallStr(WebNavigator *sourceWebNavigator, const SScriptFunction &functionCalled)
virtual void OnLoadStart(WebNavigator *sourceWebNavigator, const std::string &frameName)
virtual void OnStatusMessage(WebNavigator *sourceWebNavigator, const std::string &value)
virtual void OnTooltip(WebNavigator *sourceWebNavigator, std::string &text)
virtual void OnBeforePopup(WebNavigator *sourceWebNavigator, int popupX, int popupY, int popupWidth, int popupHeight, std::string popupUrl)
virtual void OnTitleChange(WebNavigator *sourceWebNavigator, const std::string &title)
virtual void OnNavStateChange(WebNavigator *sourceWebNavigator, bool canGoBack, bool canGoForward)
virtual void OnFindResult(WebNavigator *sourceWebNavigator, int identifier, int count, const CefRect &selectionRect, int activeMatchOrdinal, bool finalUpdate)
WebNavigator * CreateNavigator(const ScolWindowHandle &parentWindowHandle, int xPosition, int yPosition, int width, int height, std::string url)
std::vector< std::string > arguments
int SO3WebNavigatorSetZoomLevel(mmachine m)
WebNavigatorSetZoomLevel : Change the zoom level.
int SO3WebNavigatorLoadURL(mmachine m)
WebNavigatorLoadURL : Load the given url.
int SO3WebNavigatorSetPosition(mmachine m)
WebNavigatorSetPosition : Set the position of a web navigator object in his parent window.
int SO3WebNavigatorActionCopy(mmachine m)
WebNavigatorActionCopy : Execute copy on a frame.
int SO3WebNavigatorViewSource(mmachine m)
WebNavigatorViewSource : Save a frame's HTML source to a temporary file and open it in the default te...
int SO3WebNavigatorInjectKeyDown(mmachine m)
WebNavigatorInjectKeyDown : Send "key down" event to the web navigator.
int SO3WebNavigatorInjectMouseWheel(mmachine m)
WebNavigatorInjectMouseWheel : Send "mouse wheel" event to the web navigator.
int SO3WebNavigatorActionRedo(mmachine m)
WebNavigatorActionRedo : Execute redo on a frame.
int SO3WebNavigatorInjectKeyMessage(mmachine m)
WebNavigatorInjectKeyMessage : Send "key message" event to the web navigator.
int SO3WebNavigatorGetPosition(mmachine m)
WebNavigatorGetPosition : Retrieve the position of a web navigator object.
int SO3WebNavigatorLoadFile(mmachine m)
WebNavigatorLoadFile : Load the given file.
int SO3WebNavigatorStopFinding(mmachine m)
WebNavigatorStopFinding : Cancel all searches that are currently going on.
int SO3WebNavigatorInjectMouseMove(mmachine m)
WebNavigatorInjectMouseMove : Send "mouse move" event to the web navigator.
int SO3WebNavigatorSetCookie(mmachine m)
SO3WebNavigatorSetCookie : Create a domain cookie.
int SO3WebNavigatorBlitOffscreen(mmachine m)
WebNavigatorBlitOffscreen : Copy the content of an offscreen web navigator to the destination bitmap.
int SO3WebNavigatorFind(mmachine m)
WebNavigatorFind : Search for text in the current page.
int SO3WebNavigatorGetSource(mmachine m)
WebNavigatorGetSource : Returns a frame's HTML source as a string.
int SO3WebNavigatorGetURL(mmachine m)
WebNavigatorGetURL : Returns the URL currently loaded in a frame.
int SO3WebNavigatorSetSize(mmachine m)
WebNavigatorSetSize : Set the size of a web navigator object.
int SO3WebNavigatorActionSelectAll(mmachine m)
WebNavigatorActionSelectAll : Execute select all on a frame.
int SO3WebNavigatorGetSize(mmachine m)
WebNavigatorGetSize : Retrieve the size of a web navigator object.
int SO3WebNavigatorCreate(mmachine m)
WebNavigatorCreate : This function create a new Embedded Web Navigator Object.
int SO3WebNavigatorGetZoomLevel(mmachine m)
WebNavigatorGetZoomLevel : Get the zoom level.
int SO3WebNavigatorShowDevTools(mmachine m)
WebNavigatorShowDevTools : Open developer tools window.
int SO3WebNavigatorGetText(mmachine m)
WebNavigatorGetText : Returns a frame's display text as a string.
int SO3WebNavigatorReload(mmachine m)
WebNavigatorReload : Reload the current page.
int SO3WebNavigatorCanGoForward(mmachine m)
WebNavigatorCanGoForward : Does the browser can navigate forward?
int SO3WebNavigatorGoForward(mmachine m)
WebNavigatorGoForward : Navigate forward.
int SO3WebNavigatorPrint(mmachine m)
WebNavigatorPrint : Execute printing on a frame. The user will be prompted with the print dialog appr...
int SO3WebNavigatorCreateOffscreen(mmachine m)
WebNavigatorCreateOffscreen : This function create a new Embedded Web Navigator Object which render i...
int SO3WebNavigatorInjectFocus(mmachine m)
WebNavigatorSetFocus : Send "focus" event to the web navigator.
int SO3WebNavigatorActionDelete(mmachine m)
WebNavigatorActionDelete : Execute delete on a frame.
int SO3WebNavigatorGoBack(mmachine m)
WebNavigatorGoBack : Navigate backward.
int SO3WebNavigatorExecuteJavaScript(mmachine m)
WebNavigatorExecuteJavaScript : Execute a string of JavaScript code in this frame....
int SO3WebNavigatorClearHistory(mmachine m)
WebNavigatorClearHistory : Clear the back/forward browsing history.
int SO3WebNavigatorActionPaste(mmachine m)
WebNavigatorActionPaste : Execute paste on a frame.
int SO3WebNavigatorReloadIgnoreCache(mmachine m)
WebNavigatorReloadIgnoreCache : Reload the current page ignoring any cached data.
WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnExternalCall, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_CB) WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(OnExternalCallStr
WebNavigatorCbOnExternalCall : Called when a javascript external called is performed.
int SO3WebNavigatorDestroy(mmachine m)
WebNavigatorDestroy : This function destroy a Embedded Web Navigator Object.
int SO3WebNavigatorBlitOffscreenAlpha(mmachine m)
WebNavigatorBlitOffscreenAlpha : Copy the content of an offscreen web navigator to the destination al...
int SO3WebNavigatorInjectMouseUnClick(mmachine m)
WebNavigatorInjectMouseClick : Send "mouse unclick" event to the web navigator.
int SO3WebNavigatorDeleteCookies(mmachine m)
SO3WebNavigatorDeleteCookies : Delete one or more cookie(s)
int SO3WebNavigatorStopLoad(mmachine m)
WebNavigatorStopLoad : Stop loading the page.
int SO3WebNavigatorCanGoBack(mmachine m)
WebNavigatorCanGoBack : Does the browser can navigate backward?
int SO3WebNavigatorLoadHTML(mmachine m)
WebNavigatorLoadHTML : Load the given html text.
int SO3WebNavigatorInjectMouseClick(mmachine m)
WebNavigatorInjectMouseClick : Send "mouse click" event to the web navigator.
int SO3WebNavigatorInjectKeyUp(mmachine m)
WebNavigatorInjectKeyUp : Send "key up" event to the web navigator.
int SO3WebNavigatorActionUndo(mmachine m)
WebNavigatorActionUndo : Execute undo on a frame.
int SO3WebNavigatorCloseDevTools(mmachine m)
WebNavigatorCloseDevTools : Close the developer tools window if one exists for this browser instance.
int SO3WebNavigatorActionCut(mmachine m)
WebNavigatorActionCut : Execute cut on a frame.