30#if SO3_WEB_NAVIGATOR_BUILD == 1
38#define WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(CB_NAME, CB_ID) \
39 int SO3WebNavigatorCb##CB_NAME##(mmachine m) \
41 MMechostr(MSKDEBUG, "WebNavigatorCb##CB_NAME##\n");\
42 return OBJaddreflex (m, OBJWEBNAVIGATORSCOL, CB_ID);\
45#define WEB_NAVIGATOR_GENERATE_SCOL_ADD_CB_FUNCTION(CB_NAME, CB_ID) \
46 int SO3WebNavigatorCb##CB_NAME##(mmachine m) \
48 return OBJaddreflex (m, OBJWEBNAVIGATORSCOL, CB_ID);\
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
111 mmachine scolMachine;
116 ScolWebNavigatorListener(mmachine scolMachineInstance)
118 scolMachine = scolMachineInstance;
127 MMechostr(MSKDEBUG,
"WebNavigator: OnExternalCall\n");
131 if (!(k = OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_CB)))
134 Mpushstrbloc(scolMachine, (
char*)(functionCalled.
function.c_str()));
137 for (
unsigned int i = 0; i < functionCalled.
arguments.size(); i++)
139 if (k = Mpushstrbloc(scolMachine, (
char*)(functionCalled.
arguments.at(i).c_str())))
143 if (MMpush(scolMachine, NIL))
146 for (
unsigned int i = 0; i < functionCalled.
arguments.size(); i++)
148 if (MMpush(scolMachine, 2 * 2))
151 if (k = MBdeftab(scolMachine))
154 OBJcallreflex(scolMachine, 2);
164 MMechostr(MSKDEBUG,
"WebNavigator: OnExternalCallStr\n");
168 if (!(k = OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_JS_ON_EXTERNAL_CALL_STR_CB)))
171 Mpushstrbloc(scolMachine, (
char*)(functionCalled.
function.c_str()));
174 for (
unsigned int i = 0; i < functionCalled.
arguments.size(); i++)
176 if (k = Mpushstrbloc(scolMachine, (
char*)(functionCalled.
arguments.at(i).c_str())))
180 if (MMpush(scolMachine, NIL))
183 for (
unsigned int i = 0; i < functionCalled.
arguments.size(); i++)
185 if (MMpush(scolMachine, 2 * 2))
188 if (k = MBdeftab(scolMachine))
191 OBJcallreflex(scolMachine, 2);
201 MMechostr(MSKDEBUG,
"WebNavigator: OnNavStateChange\n");
205 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_NAV_STATE_CHANGE_CB))
206 OBJcallreflex(scolMachine, 0);
215 MMechostr(MSKDEBUG,
"WebNavigator: OnAddressChange\n");
219 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_ADDRESS_CHANGE_CB))
221 Mpushstrbloc(scolMachine, (
char*)(frameName.c_str()));
222 Mpushstrbloc(scolMachine, (
char*)(url.c_str()));
223 res = OBJcallreflex(scolMachine, 2);
233 MMechostr(MSKDEBUG,
"WebNavigator: OnTitleChange\n");
237 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_TITLE_CHANGE_CB))
239 Mpushstrbloc(scolMachine, (
char*)(title.c_str()));
240 res = OBJcallreflex(scolMachine, 1);
250 MMechostr(MSKDEBUG,
"WebNavigator: OnTooltip\n");
254 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_TOOLTIP_CB))
256 Mpushstrbloc(scolMachine, (
char*)(text.c_str()));
257 res = OBJcallreflex(scolMachine, 1);
267 MMechostr(MSKDEBUG,
"WebNavigator: OnStatusMessage\n");
272 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_STATUS_MESSAGE_CB))
273 res = OBJcallreflex(scolMachine, 0);
282 MMechostr(MSKDEBUG,
"WebNavigator: OnConsoleMessage\n");
286 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_DISPLAY_ON_CONSOLE_MESSAGE_CB))
288 Mpushstrbloc(scolMachine, (
char*)(message.c_str()));
289 Mpushstrbloc(scolMachine, (
char*)(source.c_str()));
290 MMpush(scolMachine, ITOM(line));
291 res = OBJcallreflex(scolMachine, 3);
301 MMechostr(MSKDEBUG,
"WebNavigator: OnBeforePopup\n");
305 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LIFESPAN_ON_POPUP_CB))
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);
322 MMechostr(MSKDEBUG,
"WebNavigator: OnBeforePopup\n");
326 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LIFESPAN_RUN_MODAL_CB))
327 res = OBJcallreflex(scolMachine, 0);
336 MMechostr(MSKDEBUG,
"WebNavigator: OnLoadStart\n");
340 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_START_CB))
342 Mpushstrbloc(scolMachine, (
char*)(frameName.c_str()));
343 res = OBJcallreflex(scolMachine, 1);
353 MMechostr(MSKDEBUG,
"WebNavigator: OnLoadEnd\n");
357 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_END_CB))
359 Mpushstrbloc(scolMachine, (
char*)(frameName.c_str()));
360 MMpush(scolMachine, ITOM(httpStatusCode));
361 res = OBJcallreflex(scolMachine, 2);
371 MMechostr(MSKDEBUG,
"WebNavigator: OnLoadError\n");
375 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_LOAD_ON_ERROR_CB))
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);
391 MMechostr(MSKDEBUG,
"WebNavigator: OnFindResult\n");
395 if (!OBJbeginreflex(scolMachine,
OBJWEBNAVIGATORSCOL, SCOL_PTR sourceWebNavigator, WEB_NAVIGATOR_FIND_ON_RESULT_CB))
397 MMpush(scolMachine, ITOM(identifier));
398 MMpush(scolMachine, ITOM(count));
401 int scolselectionRect = MMmalloc(scolMachine, 4, TYPETAB);
402 if (scolselectionRect == NIL)
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));
413 MMpush(scolMachine, ITOM(1));
415 MMpush(scolMachine, ITOM(0));
416 res = OBJcallreflex(scolMachine, 5);
429 MMechostr(MSKDEBUG,
"destroyWebNavigatorObj\n");
433 if (webNavigator == NULL)
440 ScolWebNavigatorListener* scolWebNavigatorListener =
static_cast<ScolWebNavigatorListener*
> (webNavigator->
GetListener());
442 delete(scolWebNavigatorListener);
446 MMsetPointer<SO3::EmbeddedWebNavigator::WebNavigator*>(m, MTOP(webNavigatorIndex), 0);
467 MMechostr(MSKDEBUG,
"WebNavigatorCreate\n");
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))
480 MMechostr(MSKDEBUG,
"WebNavigatorCreate: Invalid parameters!\n");
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)
496 std::string url =
"";
498 url = MMstartstr(m, MTOP(scolUrl));
501 if (webNavigator == 0)
503 MMechostr(MSKDEBUG,
"WebNavigatorCreate: Error while creating a new embedded web navigator\n");
509 ScolWebNavigatorListener* scolWebNavigatorListener =
new ScolWebNavigatorListener(m);
510 webNavigator->
SetListener(scolWebNavigatorListener);
512 if ((MMpushPointer(m, webNavigator) != 0))
520 return OBJcreate(m,
OBJWEBNAVIGATORSCOL, SCOL_PTR webNavigator, OBJtypebyname(
"OBJTYPWINDOW"), SCOL_PTR parentWindowHandle);
545 MMechostr(MSKDEBUG,
"WebNavigatorCreateOffscreen\n");
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))
557 MMechostr(MSKDEBUG,
"WebNavigatorCreateOffscreen: Invalid parameters!\n");
563 ScolWindowHandle parentWindowHandle = 0;
564 if (scolParentWindow != NIL)
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)
576 bool transparency =
false;
577 if (MTOI(scolTransparency) == 1)
581 std::string url =
"";
583 url = MMstartstr(m, MTOP(scolUrl));
586 if (webNavigator == 0)
588 MMechostr(MSKDEBUG,
"WebNavigatorCreateOffscreen: Error while creating a new embedded web navigator\n");
594 ScolWebNavigatorListener* scolWebNavigatorListener =
new ScolWebNavigatorListener(m);
595 webNavigator->
SetListener(scolWebNavigatorListener);
598 if ((MMpushPointer(m, webNavigator) != 0))
606 return OBJcreate(m,
OBJWEBNAVIGATORSCOL, SCOL_PTR webNavigator, OBJtypebyname(
"OBJTYPWINDOW"), SCOL_PTR parentWindowHandle);
626 MMechostr(MSKDEBUG,
"WebNavigatorDestroy\n");
629 int webNavigatorIndex = MMget(m, 0);
630 if (webNavigatorIndex == NIL)
632 MMechostr(MSKDEBUG,
"WebNavigatorDestroy: Invalid parameters!\n");
659 MMechostr(MSKDEBUG,
"WebNavigatorLoadURL\n");
662 int scolFrameName = MMpull(m);
663 int scolUrl = MMpull(m);
664 int webNavigatorIndex = MMget(m, 0);
665 if ((webNavigatorIndex == NIL) || (scolUrl == NIL))
667 MMechostr(MSKDEBUG,
"WebNavigatorLoadURL: Invalid parameters!\n");
673 if (webNavigator == 0)
675 MMechostr(MSKDEBUG,
"WebNavigatorLoadURL: Invalid parameters!\n");
681 std::string url = MMstartstr(m, MTOP(scolUrl));
684 std::string frameName =
"";
685 if (scolFrameName != NIL)
686 frameName = MMstartstr(m, MTOP(scolFrameName));
688 webNavigator->
LoadURL(url, frameName);
689 MMset(m, 0, ITOM(1));
706 MMechostr(MSKDEBUG,
"WebNavigatorLoadFile\n");
709 int scolFrameName = MMpull(m);
710 int scolFileName = MMpull(m);
711 int webNavigatorIndex = MMget(m, 0);
712 if ((webNavigatorIndex == NIL) || (scolFileName == NIL))
714 MMechostr(MSKDEBUG,
"WebNavigatorLoadFile: Invalid parameters!\n");
720 if (webNavigator == 0)
722 MMechostr(MSKDEBUG,
"WebNavigatorLoadFile: Invalid parameters!\n");
728 std::string fileName = MMstartstr(m, MTOP(scolFileName));
731 std::string frameName =
"";
732 if (scolFrameName != NIL)
733 frameName = MMstartstr(m, MTOP(scolFrameName));
735 webNavigator->
LoadFile(fileName, frameName);
736 MMset(m, 0, ITOM(1));
753 MMechostr(MSKDEBUG,
"WebNavigatorLoadHTML\n");
756 int scolFrameName = MMpull(m);
757 int scolHtmlText = MMpull(m);
758 int webNavigatorIndex = MMget(m, 0);
759 if ((webNavigatorIndex == NIL) || (scolHtmlText == NIL))
761 MMechostr(MSKDEBUG,
"WebNavigatorLoadHTML: Invalid parameters!\n");
767 if (webNavigator == 0)
769 MMechostr(MSKDEBUG,
"WebNavigatorLoadHTML: Invalid parameters!\n");
775 std::string htmlText = MMstartstr(m, MTOP(scolHtmlText));
778 std::string frameName =
"";
779 if (scolFrameName != NIL)
780 frameName = MMstartstr(m, MTOP(scolFrameName));
782 webNavigator->
LoadHTML(htmlText, frameName);
783 MMset(m, 0, ITOM(1));
799 MMechostr(MSKDEBUG,
"WebNavigatorActionUndo\n");
802 int scolFrameName = MMpull(m);
803 int webNavigatorIndex = MMget(m, 0);
804 if (webNavigatorIndex == NIL)
806 MMechostr(MSKDEBUG,
"WebNavigatorActionUndo: Invalid parameters!\n");
812 if (webNavigator == 0)
814 MMechostr(MSKDEBUG,
"WebNavigatorActionUndo: Invalid parameters!\n");
820 std::string frameName =
"";
821 if (scolFrameName != NIL)
822 frameName = MMstartstr(m, MTOP(scolFrameName));
824 webNavigator->
Undo(frameName);
825 MMset(m, 0, ITOM(1));
841 MMechostr(MSKDEBUG,
"WebNavigatorActionRedo\n");
844 int scolFrameName = MMpull(m);
845 int webNavigatorIndex = MMget(m, 0);
846 if (webNavigatorIndex == NIL)
848 MMechostr(MSKDEBUG,
"WebNavigatorActionRedo: Invalid parameters!\n");
854 if (webNavigator == 0)
856 MMechostr(MSKDEBUG,
"WebNavigatorActionRedo: Invalid parameters!\n");
862 std::string frameName =
"";
863 if (scolFrameName != NIL)
864 frameName = MMstartstr(m, MTOP(scolFrameName));
866 webNavigator->
Redo(frameName);
867 MMset(m, 0, ITOM(1));
883 MMechostr(MSKDEBUG,
"WebNavigatorActionCut\n");
886 int scolFrameName = MMpull(m);
887 int webNavigatorIndex = MMget(m, 0);
888 if (webNavigatorIndex == NIL)
890 MMechostr(MSKDEBUG,
"WebNavigatorActionCut: Invalid parameters!\n");
896 if (webNavigator == 0)
898 MMechostr(MSKDEBUG,
"WebNavigatorActionCut: Invalid parameters!\n");
904 std::string frameName =
"";
905 if (scolFrameName != NIL)
906 frameName = MMstartstr(m, MTOP(scolFrameName));
908 webNavigator->
Cut(frameName);
909 MMset(m, 0, ITOM(1));
925 MMechostr(MSKDEBUG,
"WebNavigatorActionCopy\n");
928 int scolFrameName = MMpull(m);
929 int webNavigatorIndex = MMget(m, 0);
930 if (webNavigatorIndex == NIL)
932 MMechostr(MSKDEBUG,
"WebNavigatorActionCopy: Invalid parameters!\n");
938 if (webNavigator == 0)
940 MMechostr(MSKDEBUG,
"WebNavigatorActionCopy: Invalid parameters!\n");
946 std::string frameName =
"";
947 if (scolFrameName != NIL)
948 frameName = MMstartstr(m, MTOP(scolFrameName));
950 webNavigator->
Copy(frameName);
951 MMset(m, 0, ITOM(1));
967 MMechostr(MSKDEBUG,
"WebNavigatorActionPaste\n");
970 int scolFrameName = MMpull(m);
971 int webNavigatorIndex = MMget(m, 0);
972 if (webNavigatorIndex == NIL)
974 MMechostr(MSKDEBUG,
"WebNavigatorActionPaste: Invalid parameters!\n");
980 if (webNavigator == 0)
982 MMechostr(MSKDEBUG,
"WebNavigatorActionPaste: Invalid parameters!\n");
988 std::string frameName =
"";
989 if (scolFrameName != NIL)
990 frameName = MMstartstr(m, MTOP(scolFrameName));
992 webNavigator->
Paste(frameName);
993 MMset(m, 0, ITOM(1));
1009 MMechostr(MSKDEBUG,
"WebNavigatorActionDelete\n");
1012 int scolFrameName = MMpull(m);
1013 int webNavigatorIndex = MMget(m, 0);
1014 if (webNavigatorIndex == NIL)
1016 MMechostr(MSKDEBUG,
"WebNavigatorActionDelete: Invalid parameters!\n");
1022 if (webNavigator == 0)
1024 MMechostr(MSKDEBUG,
"WebNavigatorActionDelete: Invalid parameters!\n");
1030 std::string frameName =
"";
1031 if (scolFrameName != NIL)
1032 frameName = MMstartstr(m, MTOP(scolFrameName));
1034 webNavigator->
Delete(frameName);
1035 MMset(m, 0, ITOM(1));
1051 MMechostr(MSKDEBUG,
"WebNavigatorActionSelectAll\n");
1054 int scolFrameName = MMpull(m);
1055 int webNavigatorIndex = MMget(m, 0);
1056 if (webNavigatorIndex == NIL)
1058 MMechostr(MSKDEBUG,
"WebNavigatorActionSelectAll: Invalid parameters!\n");
1064 if (webNavigator == 0)
1066 MMechostr(MSKDEBUG,
"WebNavigatorActionSelectAll: Invalid parameters!\n");
1072 std::string frameName =
"";
1073 if (scolFrameName != NIL)
1074 frameName = MMstartstr(m, MTOP(scolFrameName));
1077 MMset(m, 0, ITOM(1));
1093 MMechostr(MSKDEBUG,
"WebNavigatorPrint\n");
1096 int scolFrameName = MMpull(m);
1097 int webNavigatorIndex = MMget(m, 0);
1098 if (webNavigatorIndex == NIL)
1100 MMechostr(MSKDEBUG,
"WebNavigatorPrint: Invalid parameters!\n");
1106 if (webNavigator == 0)
1108 MMechostr(MSKDEBUG,
"WebNavigatorPrint: Invalid parameters!\n");
1114 std::string frameName =
"";
1115 if (scolFrameName != NIL)
1116 frameName = MMstartstr(m, MTOP(scolFrameName));
1118 webNavigator->
Print(frameName);
1119 MMset(m, 0, ITOM(1));
1135 MMechostr(MSKDEBUG,
"WebNavigatorViewSource\n");
1138 int scolFrameName = MMpull(m);
1139 int webNavigatorIndex = MMget(m, 0);
1140 if (webNavigatorIndex == NIL)
1142 MMechostr(MSKDEBUG,
"WebNavigatorViewSource: Invalid parameters!\n");
1148 if (webNavigator == 0)
1150 MMechostr(MSKDEBUG,
"WebNavigatorViewSource: Invalid parameters!\n");
1156 std::string frameName =
"";
1157 if (scolFrameName != NIL)
1158 frameName = MMstartstr(m, MTOP(scolFrameName));
1161 MMset(m, 0, ITOM(1));
1177 MMechostr(MSKDEBUG,
"WebNavigatorGetSource\n");
1180 int scolFrameName = MMpull(m);
1181 int webNavigatorIndex = MMpull(m);
1182 if (webNavigatorIndex == NIL)
1184 MMechostr(MSKDEBUG,
"WebNavigatorGetSource: Invalid parameters!\n");
1190 if (webNavigator == 0)
1192 MMechostr(MSKDEBUG,
"WebNavigatorGetSource: Invalid parameters!\n");
1198 std::string frameName =
"";
1199 if (scolFrameName != NIL)
1200 frameName = MMstartstr(m, MTOP(scolFrameName));
1202 std::string frameSource = webNavigator->
GetSource(frameName);
1203 return Mpushstrbloc(m, (
char*)(frameSource.c_str()));
1219 MMechostr(MSKDEBUG,
"WebNavigatorGetText\n");
1222 int scolFrameName = MMpull(m);
1223 int webNavigatorIndex = MMpull(m);
1224 if (webNavigatorIndex == NIL)
1226 MMechostr(MSKDEBUG,
"WebNavigatorGetText: Invalid parameters!\n");
1232 if (webNavigator == 0)
1234 MMechostr(MSKDEBUG,
"WebNavigatorGetText: Invalid parameters!\n");
1240 std::string frameName =
"";
1241 if (scolFrameName != NIL)
1242 frameName = MMstartstr(m, MTOP(scolFrameName));
1244 std::string frameText = webNavigator->
GetText(frameName);
1245 return Mpushstrbloc(m, (
char*)(frameText.c_str()));
1267 MMechostr(MSKDEBUG,
"WebNavigatorExecuteJavaScript\n");
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))
1277 MMechostr(MSKDEBUG,
"WebNavigatorExecuteJavaScript: Invalid parameters!\n");
1283 if (webNavigator == 0)
1285 MMechostr(MSKDEBUG,
"WebNavigatorExecuteJavaScript: Invalid parameters!\n");
1291 std::string javascriptCode = MMstartstr(m, MTOP(scolJavascript));
1294 std::string url =
"";
1296 url = MMstartstr(m, MTOP(scolUrl));
1299 int ligneNumber = 0;
1300 if (scolLigneNumber != NIL)
1301 ligneNumber = MTOI(scolLigneNumber);
1304 std::string frameName =
"";
1305 if (scolFrameName != NIL)
1306 frameName = MMstartstr(m, MTOP(scolFrameName));
1309 MMset(m, 0, ITOM(1));
1325 MMechostr(MSKDEBUG,
"WebNavigatorGetURL\n");
1328 int scolFrameName = MMpull(m);
1329 int webNavigatorIndex = MMpull(m);
1330 if (webNavigatorIndex == NIL)
1332 MMechostr(MSKDEBUG,
"WebNavigatorGetURL: Invalid parameters!\n");
1338 if (webNavigator == 0)
1340 MMechostr(MSKDEBUG,
"WebNavigatorGetURL: Invalid parameters!\n");
1346 std::string frameName =
"";
1347 if (scolFrameName != NIL)
1348 frameName = MMstartstr(m, MTOP(scolFrameName));
1350 std::string url = webNavigator->
GetURL(frameName);
1351 return Mpushstrbloc(m, (
char*)(url.c_str()));
1366 MMechostr(MSKDEBUG,
"WebNavigatorCanGoBack\n");
1369 int webNavigatorIndex = MMget(m, 0);
1370 if (webNavigatorIndex == NIL)
1372 MMechostr(MSKDEBUG,
"WebNavigatorCanGoBack: Invalid parameters!\n");
1378 if (webNavigator == 0)
1380 MMechostr(MSKDEBUG,
"WebNavigatorCanGoBack: Invalid parameters!\n");
1386 MMset(m, 0, ITOM(1));
1388 MMset(m, 0, ITOM(0));
1403 MMechostr(MSKDEBUG,
"WebNavigatorGoBack\n");
1406 int webNavigatorIndex = MMget(m, 0);
1407 if (webNavigatorIndex == NIL)
1409 MMechostr(MSKDEBUG,
"WebNavigatorGoBack: Invalid parameters!\n");
1415 if (webNavigator == 0)
1417 MMechostr(MSKDEBUG,
"WebNavigatorGoBack: Invalid parameters!\n");
1423 MMset(m, 0, ITOM(1));
1438 MMechostr(MSKDEBUG,
"WebNavigatorCanGoForward\n");
1441 int webNavigatorIndex = MMget(m, 0);
1442 if (webNavigatorIndex == NIL)
1444 MMechostr(MSKDEBUG,
"WebNavigatorCanGoForward: Invalid parameters!\n");
1450 if (webNavigator == 0)
1452 MMechostr(MSKDEBUG,
"WebNavigatorCanGoForward: Invalid parameters!\n");
1458 MMset(m, 0, ITOM(1));
1460 MMset(m, 0, ITOM(0));
1475 MMechostr(MSKDEBUG,
"WebNavigatorGoForward\n");
1478 int webNavigatorIndex = MMget(m, 0);
1479 if (webNavigatorIndex == NIL)
1481 MMechostr(MSKDEBUG,
"WebNavigatorGoForward: Invalid parameters!\n");
1487 if (webNavigator == 0)
1489 MMechostr(MSKDEBUG,
"WebNavigatorGoForward: Invalid parameters!\n");
1495 MMset(m, 0, ITOM(1));
1510 MMechostr(MSKDEBUG,
"WebNavigatorReload\n");
1513 int webNavigatorIndex = MMget(m, 0);
1514 if (webNavigatorIndex == NIL)
1516 MMechostr(MSKDEBUG,
"WebNavigatorReload: Invalid parameters!\n");
1522 if (webNavigator == 0)
1524 MMechostr(MSKDEBUG,
"WebNavigatorReload: Invalid parameters!\n");
1530 MMset(m, 0, ITOM(1));
1545 MMechostr(MSKDEBUG,
"WebNavigatorReloadIgnoreCache\n");
1548 int webNavigatorIndex = MMget(m, 0);
1549 if (webNavigatorIndex == NIL)
1551 MMechostr(MSKDEBUG,
"WebNavigatorReloadIgnoreCache: Invalid parameters!\n");
1557 if (webNavigator == 0)
1559 MMechostr(MSKDEBUG,
"WebNavigatorReloadIgnoreCache: Invalid parameters!\n");
1565 MMset(m, 0, ITOM(1));
1580 MMechostr(MSKDEBUG,
"WebNavigatorStopLoad\n");
1583 int webNavigatorIndex = MMget(m, 0);
1584 if (webNavigatorIndex == NIL)
1586 MMechostr(MSKDEBUG,
"WebNavigatorStopLoad: Invalid parameters!\n");
1592 if (webNavigator == 0)
1594 MMechostr(MSKDEBUG,
"WebNavigatorStopLoad: Invalid parameters!\n");
1600 MMset(m, 0, ITOM(1));
1620 MMechostr(MSKDEBUG,
"WebNavigatorFind\n");
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))
1631 MMechostr(MSKDEBUG,
"WebNavigatorFind: Invalid parameters!\n");
1637 if (webNavigator == 0)
1639 MMechostr(MSKDEBUG,
"WebNavigatorFind: Invalid parameters!\n");
1645 int searchIdentifier = MTOI(scolSearchIdentifier);
1648 std::string searchedText = MMstartstr(m, MTOP(scolSearchedText));
1651 bool searchForward =
true;
1652 if (scolSearchForward != NIL)
1653 if (MTOI(scolSearchForward) == 0)
1654 searchForward =
false;
1657 bool caseSensitive =
false;
1658 if (scolCaseSensitive != NIL)
1659 if (MTOI(scolCaseSensitive) == 0)
1660 caseSensitive =
true;
1663 bool firstSearch =
true;
1664 if (scolFirstSearch != NIL)
1665 if (MTOI(scolFirstSearch) == 0)
1666 firstSearch =
false;
1669 webNavigator->
Find(searchIdentifier, searchedText, searchForward, caseSensitive, firstSearch);
1670 MMset(m, 0, ITOM(1));
1686 MMechostr(MSKDEBUG,
"WebNavigatorStopFinding\n");
1689 int scolClearSelection = MMpull(m);
1690 int webNavigatorIndex = MMget(m, 0);
1691 if (webNavigatorIndex == NIL)
1693 MMechostr(MSKDEBUG,
"WebNavigatorStopFinding: Invalid parameters!\n");
1699 if (webNavigator == 0)
1701 MMechostr(MSKDEBUG,
"WebNavigatorStopFinding: Invalid parameters!\n");
1706 bool clearSelection =
false;
1707 if (scolClearSelection != NIL)
1708 if (MTOI(scolClearSelection) == 1)
1709 clearSelection =
true;
1712 MMset(m, 0, ITOM(1));
1727 MMechostr(MSKDEBUG,
"WebNavigatorGetZoomLevel\n");
1730 int webNavigatorIndex = MMget(m, 0);
1731 if (webNavigatorIndex == NIL)
1733 MMechostr(MSKDEBUG,
"WebNavigatorGetZoomLevel: Invalid parameters!\n");
1739 if (webNavigator == 0)
1741 MMechostr(MSKDEBUG,
"WebNavigatorGetZoomLevel: Invalid parameters!\n");
1746 float zoomLevel =
static_cast<float>(webNavigator->
GetZoomLevel());
1747 MMset(m, 0, FTOM(zoomLevel));
1763 MMechostr(MSKDEBUG,
"WebNavigatorSetZoomLevel\n");
1766 int scolZoomLevel = MMpull(m);
1767 int webNavigatorIndex = MMget(m, 0);
1768 if ((webNavigatorIndex == NIL) || (scolZoomLevel == NIL))
1770 MMechostr(MSKDEBUG,
"WebNavigatorSetZoomLevel: Invalid parameters!\n");
1776 if (webNavigator == 0)
1778 MMechostr(MSKDEBUG,
"WebNavigatorSetZoomLevel: Invalid parameters!\n");
1783 float zoomLevel = MTOF(scolZoomLevel);
1784 webNavigator->
SetZoomLevel(
static_cast<double>(zoomLevel));
1785 MMset(m, 0, ITOM(1));
1800 MMechostr(MSKDEBUG,
"WebNavigatorClearHistory\n");
1803 int webNavigatorIndex = MMget(m, 0);
1804 if (webNavigatorIndex == NIL)
1806 MMechostr(MSKDEBUG,
"WebNavigatorClearHistory: Invalid parameters!\n");
1812 if (webNavigator == 0)
1814 MMechostr(MSKDEBUG,
"WebNavigatorClearHistory: Invalid parameters!\n");
1820 MMset(m, 0, ITOM(1));
1835 MMechostr(MSKDEBUG,
"WebNavigatorShowDevTools\n");
1838 int webNavigatorIndex = MMget(m, 0);
1839 if (webNavigatorIndex == NIL)
1841 MMechostr(MSKDEBUG,
"WebNavigatorShowDevTools: Invalid parameters!\n");
1847 if (webNavigator == 0)
1849 MMechostr(MSKDEBUG,
"WebNavigatorShowDevTools: Invalid parameters!\n");
1855 MMset(m, 0, ITOM(1));
1870 MMechostr(MSKDEBUG,
"WebNavigatorCloseDevTools\n");
1872 int webNavigatorIndex = MMget(m, 0);
1873 if (webNavigatorIndex == NIL)
1875 MMechostr(MSKDEBUG,
"WebNavigatorCloseDevTools: Invalid parameters!\n");
1881 if (webNavigator == 0)
1883 MMechostr(MSKDEBUG,
"WebNavigatorCloseDevTools: Invalid parameters!\n");
1889 MMset(m, 0, ITOM(1));
1906 MMechostr(MSKDEBUG,
"WebNavigatorGetSize\n");
1909 int webNavigatorIndex = MMget(m, 0);
1910 if (webNavigatorIndex == NIL)
1912 MMechostr(MSKDEBUG,
"WebNavigatorGetSize: Invalid parameters!\n");
1918 if (webNavigator == 0)
1920 MMechostr(MSKDEBUG,
"WebNavigatorGetSize: Invalid parameters!\n");
1926 int scolSize = MMmalloc(m, 2, TYPETAB);
1927 if (scolSize == NIL)
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));
1951 MMechostr(MSKDEBUG,
"WebNavigatorSetSize\n");
1954 int scolHeight = MMpull(m);
1955 int scolWidth = MMpull(m);
1956 int webNavigatorIndex = MMget(m, 0);
1957 if ((webNavigatorIndex == NIL) || (scolWidth == NIL) || (scolHeight == NIL))
1959 MMechostr(MSKDEBUG,
"WebNavigatorSetSize: Invalid parameters!\n");
1965 if (webNavigator == 0)
1967 MMechostr(MSKDEBUG,
"WebNavigatorSetSize: Invalid parameters!\n");
1972 webNavigator->
SetSize(std::pair<int, int>(MTOI(scolWidth), MTOI(scolHeight)));
1973 MMset(m, 0, ITOM(1));
1990 MMechostr(MSKDEBUG,
"WebNavigatorGetPosition\n");
1993 int webNavigatorIndex = MMget(m, 0);
1994 if (webNavigatorIndex == NIL)
1996 MMechostr(MSKDEBUG,
"WebNavigatorGetPosition: Invalid parameters!\n");
2002 if (webNavigator == 0)
2004 MMechostr(MSKDEBUG,
"WebNavigatorGetPosition: Invalid parameters!\n");
2010 int scolPosition = MMmalloc(m, 2, TYPETAB);
2011 if (scolPosition == NIL)
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));
2035 MMechostr(MSKDEBUG,
"WebNavigatorSetPosition\n");
2038 int scolYPos = MMpull(m);
2039 int scolXPos = MMpull(m);
2040 int webNavigatorIndex = MMget(m, 0);
2041 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL))
2043 MMechostr(MSKDEBUG,
"WebNavigatorSetPosition: Invalid parameters!\n");
2049 if (webNavigator == 0)
2051 MMechostr(MSKDEBUG,
"WebNavigatorSetPosition: Invalid parameters!\n");
2056 webNavigator->
SetPosition(std::pair<int, int>(MTOI(scolXPos), MTOI(scolYPos)));
2057 MMset(m, 0, ITOM(1));
2073 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreen\n");
2076 int scolTargetBitmap = MMpull(m);
2077 int webNavigatorIndex = MMget(m, 0);
2078 if ((webNavigatorIndex == NIL) || (scolTargetBitmap == NIL))
2080 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreen: Invalid parameters!\n");
2086 if (webNavigator == 0)
2088 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreen: Invalid parameters!\n");
2095 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreen: Not an offscreen rendered web navigator!\n");
2101 PtrObjVoid OB = (PtrObjVoid)MMstart(m, MTOP(scolTargetBitmap));
2102 PtrObjBitmap B = (PtrObjBitmap)MMstart(m, MTOP(OB->Buffer));
2105 bool sucess = webNavigator->
GetWebNavigatorClient()->BlitOffscreenBitmap(B->bits, B->TailleW, B->TailleH, B->BytesPP, B->BPL);
2108 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreen: the target bitmap don't have the same size!\n");
2114 MMset(m, 0, PTOM(scolTargetBitmap));
2131 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha\n");
2134 int scolTargetAlphaBitmap = MMpull(m);
2135 int webNavigatorIndex = MMget(m, 0);
2136 if ((webNavigatorIndex == NIL) || (scolTargetAlphaBitmap == NIL))
2138 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: Invalid parameters!\n");
2144 if (webNavigator == 0)
2146 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: Invalid parameters!\n");
2153 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: Not an offscreen rendered web navigator!\n");
2159 int scolColorLayer = MMfetch(m, MTOP(scolTargetAlphaBitmap), 0);
2160 int scolAlphaLayer = MMfetch(m, MTOP(scolTargetAlphaBitmap), 1);
2163 PtrObjVoid scolVoidPointerBmp = (PtrObjVoid)MMstart(m, MTOP(scolColorLayer));
2164 if (scolVoidPointerBmp->Type != OBJ_TYPE_BITMAP << 1)
2166 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: Invalid alphabitmap color layer!\n");
2170 PtrObjBitmap targetBitmapColor = (PtrObjBitmap)MMstart(m, MTOP(scolVoidPointerBmp->Buffer));
2173 PtrObjBitmap targetBitmapAlpha = 0;
2174 if (scolAlphaLayer != NIL)
2176 PtrObjVoid scolVoidPointerAlpha = (PtrObjVoid)MMstart(m, MTOP(scolAlphaLayer));
2179 if (scolVoidPointerAlpha->Type != OBJ_TYPE_BITMAP << 1)
2181 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: Invalid alphabitmap alpha layer!\n");
2185 targetBitmapAlpha = (PtrObjBitmap)MMstart(m, MTOP(scolVoidPointerAlpha->Buffer));
2189 bool success =
false;
2190 if (targetBitmapAlpha == 0)
2192 success = webNavigator->
GetWebNavigatorClient()->BlitOffscreenBitmap(targetBitmapColor->bits, targetBitmapColor->TailleW, targetBitmapColor->TailleH, targetBitmapColor->BytesPP, targetBitmapColor->BPL);
2196 if ((targetBitmapColor->TailleW != targetBitmapAlpha->TailleW) || (targetBitmapColor->TailleH != targetBitmapAlpha->TailleH))
2198 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: the target alphabitmap color layer have a different size than the alpha layer!\n");
2203 success = webNavigator->
GetWebNavigatorClient()->BlitOffscreenAlphaBitmap(targetBitmapColor->bits, targetBitmapAlpha->bits, targetBitmapColor->TailleW, targetBitmapColor->TailleH, targetBitmapColor->BytesPP, targetBitmapColor->BPL);
2209 MMechostr(MSKDEBUG,
"WebNavigatorBlitOffscreenAlpha: the target alphabitmap don't have the same size!\n");
2215 MMset(m, 0, PTOM(scolTargetAlphaBitmap));
2234 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyDown\n");
2237 int scolKeyData = MMpull(m);
2238 int scolScanCode = MMpull(m);
2239 int webNavigatorIndex = MMget(m, 0);
2240 if ((webNavigatorIndex == NIL) || (scolScanCode == NIL))
2242 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyDown: Invalid parameters!\n");
2248 if (webNavigator == 0)
2250 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyDown: Invalid parameters!\n");
2255 webNavigator->
InjectKey(MTOI(scolScanCode), MTOI(scolKeyData),
true);
2256 webNavigator->
InjectChar(MTOI(scolScanCode), MTOI(scolKeyData));
2257 MMset(m, 0, ITOM(1));
2274 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyUp\n");
2277 int scolScanCode = MMpull(m);
2278 int webNavigatorIndex = MMget(m, 0);
2279 if ((webNavigatorIndex == NIL) || (scolScanCode == NIL))
2281 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyUp: Invalid parameters!\n");
2287 if (webNavigator == 0)
2289 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyUp: Invalid parameters!\n");
2294 webNavigator->
InjectKey(MTOI(scolScanCode), 0,
false);
2295 MMset(m, 0, ITOM(1));
2313 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyMessage\n");
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))
2322 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyMessage: Invalid parameters!\n");
2328 if (webNavigator == 0)
2330 MMechostr(MSKDEBUG,
"WebNavigatorInjectKeyMessage: Invalid parameters!\n");
2335 webNavigator->
InjectKeyMsg(MTOI(scolMsg), MTOI(scolLparam), MTOI(scolWparam));
2336 MMset(m, 0, ITOM(1));
2354 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseClick\n");
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))
2363 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseClick: Invalid parameters!\n");
2369 if (webNavigator == 0)
2371 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseClick: Invalid parameters!\n");
2376 webNavigator->
InjectMouseClick(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolButton),
false, 1);
2377 MMset(m, 0, ITOM(1));
2396 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseUnClick\n");
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))
2405 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseUnClick: Invalid parameters!\n");
2411 if (webNavigator == 0)
2413 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseUnClick: Invalid parameters!\n");
2418 webNavigator->
InjectMouseClick(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolButton),
true, 1);
2419 MMset(m, 0, ITOM(1));
2436 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseMove\n");
2439 int scolYPos = MMpull(m);
2440 int scolXPos = MMpull(m);
2441 int webNavigatorIndex = MMget(m, 0);
2442 if ((webNavigatorIndex == NIL) || (scolXPos == NIL) || (scolYPos == NIL))
2444 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseMove: Invalid parameters!\n");
2450 if (webNavigator == 0)
2452 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseMove: Invalid parameters!\n");
2458 MMset(m, 0, ITOM(1));
2476 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseWheel\n");
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))
2485 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseWheel: Invalid parameters!\n");
2491 if (webNavigator == 0)
2493 MMechostr(MSKDEBUG,
"WebNavigatorInjectMouseWheel: Invalid parameters!\n");
2498 webNavigator->
InjectMouseWheel(MTOI(scolXPos), MTOI(scolYPos), MTOI(scolDelta));
2499 MMset(m, 0, ITOM(1));
2515 MMechostr(MSKDEBUG,
"WebNavigatorInjectFocus\n");
2518 int scolFocus = MMpull(m);
2519 int webNavigatorIndex = MMget(m, 0);
2520 if ((webNavigatorIndex == NIL) || (scolFocus == NIL))
2522 MMechostr(MSKDEBUG,
"WebNavigatorInjectFocus: Invalid parameters!\n");
2528 if (webNavigator == 0)
2530 MMechostr(MSKDEBUG,
"WebNavigatorInjectFocus: Invalid parameters!\n");
2535 if (MTOI(scolFocus) == 1)
2539 MMset(m, 0, ITOM(1));
2560 MMechostr(MSKDEBUG,
"SO3WebNavigatorSetCookie\n");
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))
2572 MMechostr(MSKDEBUG,
"SO3WebNavigatorSetCookie: Invalid parameters!\n");
2578 std::string cookieUrl(MMstartstr(m, MTOP(scolCookieUrl)));
2579 std::string cookieName =
"";
2580 if (scolCookieName != NIL)
2581 cookieName = MMstartstr(m, MTOP(scolCookieName));
2583 std::string cookieValue(MMstartstr(m, MTOP(scolCookieValue)));
2584 std::string cookieDomain =
"";
2585 if (scolCookieDomain != NIL)
2586 cookieDomain = MMstartstr(m, MTOP(scolCookieDomain));
2588 std::string cookiePath =
"";
2589 if (scolCookiePath != NIL)
2590 cookiePath = MMstartstr(m, MTOP(scolCookiePath));
2592 bool secure =
false;
2593 if ((scolCookieSecure != NIL) && (MTOI(scolCookieSecure) == 1))
2596 bool httpOnly =
false;
2597 if ((scolCookieHttpOnly != NIL) && (MTOI(scolCookieHttpOnly) == 1))
2602 MMset(m, 0, ITOM(1));
2604 MMset(m, 0, ITOM(0));
2620 MMechostr(MSKDEBUG,
"SO3WebNavigatorDeleteCookies\n");
2623 int scolCookieName = MMpull(m);
2624 int scolCookieUrl = MMget(m, 0);
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));
2636 MMset(m, 0, ITOM(1));
2638 MMset(m, 0, ITOM(0));
2883 {
"ObjWebNavigator", TYPTYPE, NULL, NULL },
2884 {
"SO3WebNavigatorCreate", 7,
"fun [Chn ObjWin I I I I S] ObjWebNavigator",
SO3WebNavigatorCreate },
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 }
int destroyWebNavigatorObj(mmachine m, SCOL_PTR_TYPE handsys, int webNavigatorIndex)
int(* CallMainThread)(void *, mmachine m)
main include
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 StopFinding(bool clearSelection)
void SetZoomLevel(double zoomLevel)
void LoadFile(const std::string &file, const std::string &frameName="")
WebNavigatorListener * GetListener()
std::string GetText(const std::string &frameName="")
void InjectMouseWheel(int x, int y, int delta)
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 InjectFocus(bool setFocus)
void SetSize(std::pair< int, int > newSize)
void ViewSource(const std::string &frameName="")
std::string GetURL(const std::string &frameName="")
std::pair< int, int > GetPosition()
void SelectAll(const std::string &frameName="")
std::pair< int, int > GetSize()
void LoadURL(const std::string &url, const std::string &frameName="")
void InjectChar(int scanCode, int keydata)
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)
static WebNavigatorManager & GetSingleton()
void DestroyNavigator(WebNavigator *webNavigator)
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.