You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: engine/src/browser.lcb
+97-16Lines changed: 97 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -43,14 +43,16 @@ metadata version is "1.0.0"
43
43
-- foreign types
44
44
public type MCBrowserFactoryRef is Pointer
45
45
public type MCBrowserRef is Pointer
46
+
public type MCBrowserNavigationRequestRef is Pointer
46
47
47
48
public type MCBrowserListRef is Pointer
48
49
public type MCBrowserDictionaryRef is Pointer
49
50
50
51
public type MCBrowserProperty is CInt
51
52
public type MCBrowserValueType is CInt
52
-
public type MCBrowserRequestType is CInt
53
-
public type MCBrowserRequestState is CInt
53
+
public type MCBrowserNavigationEventType is CInt
54
+
public type MCBrowserNavigationState is CInt
55
+
public type MCBrowserNavigationType is CInt
54
56
55
57
--
56
58
@@ -74,17 +76,31 @@ public foreign handler MCBrowserGetNativeLayer(in pBrowser as MCBrowserRef) retu
74
76
75
77
public foreign handler MCBrowserGetBoolProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, out rValue as CBool) returns CBool binds to "<builtin>"
76
78
public foreign handler MCBrowserSetBoolProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, in pValue as CBool) returns CBool binds to "<builtin>"
77
-
78
79
public foreign handler MCBrowserGetStringProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, out rValue as ZStringUTF8) returns CBool binds to "<builtin>"
79
80
public foreign handler MCBrowserSetStringProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, in pValue as ZStringUTF8) returns CBool binds to "<builtin>"
81
+
public foreign handler MCBrowserGetIntegerProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, out rValue as Int32) returns CBool binds to "<builtin>"
82
+
public foreign handler MCBrowserSetIntegerProperty(in pBrowser as MCBrowserRef, in pProperty as MCBrowserProperty, in pValue as Int32) returns CBool binds to "<builtin>"
80
83
81
84
public foreign handler MCBrowserGoBack(in pBrowser as MCBrowserRef) returns CBool binds to "<builtin>"
82
85
public foreign handler MCBrowserGoForward(in pBrowser as MCBrowserRef) returns CBool binds to "<builtin>"
83
86
public foreign handler MCBrowserGoToURL(in pBrowser as MCBrowserRef, in pURL as ZStringUTF8) returns CBool binds to "<builtin>"
87
+
public foreign handler MCBrowserLoadHTMLText(in pBrowser as MCBrowserRef, in pHTMLText as ZStringUTF8, in pBaseURL as ZStringUTF8) returns CBool binds to "<builtin>"
88
+
public foreign handler MCBrowserStopLoading(in pBrowser as MCBrowserRef) returns CBool binds to "<builtin>"
89
+
public foreign handler MCBrowserReload(in pBrowser as MCBrowserRef) returns CBool binds to "<builtin>"
84
90
public foreign handler MCBrowserEvaluateJavaScript(in pBrowser as MCBrowserRef, in pScript as ZStringUTF8, out rResult as ZStringUTF8) returns CBool binds to "<builtin>"
85
91
86
92
----------
87
93
94
+
public foreign handler MCBrowserNavigationRequestRetain(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef) returns MCBrowserNavigationRequestRef binds to "<builtin>"
95
+
public foreign handler MCBrowserNavigationRequestRelease(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef) returns nothing binds to "<builtin>"
96
+
public foreign handler MCBrowserNavigationRequestGetURL(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef, out rURL as ZStringUTF8) returns CBool binds to "<builtin>"
97
+
public foreign handler MCBrowserNavigationRequestGetNavigationType(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef, out rType as MCBrowserNavigationType) returns CBool binds to "<builtin>"
98
+
public foreign handler MCBrowserNavigationRequestIsFrame(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef, out rIsFrame as CBool) returns CBool binds to "<builtin>"
99
+
public foreign handler MCBrowserNavigationRequestContinue(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef) returns CBool binds to "<builtin>"
100
+
public foreign handler MCBrowserNavigationRequestCancel(in pBrowserNavigationRequestRef as MCBrowserNavigationRequestRef) returns CBool binds to "<builtin>"
101
+
102
+
----------
103
+
88
104
public foreign handler MCBrowserListGetSize(in pList as MCBrowserListRef, out rSize as UInt32) returns CBool binds to "<builtin>"
89
105
public foreign handler MCBrowserListGetType(in pList as MCBrowserListRef, in pIndex as UInt32, out rType as MCBrowserValueType) returns CBool binds to "<builtin>"
90
106
public foreign handler MCBrowserListGetBoolean(in pList as MCBrowserListRef, in pIndex as UInt32, out rValue as CBool) returns CBool binds to "<builtin>"
@@ -108,11 +124,13 @@ public foreign handler MCBrowserDictionaryGetUTF8String(in pDictionary as MCBrow
108
124
public foreign handler MCBrowserDictionaryGetList(in pDictionary as MCBrowserDictionaryRef, in pKey as ZStringUTF8, out rValue as MCBrowserListRef) returns CBool binds to "<builtin>"
109
125
public foreign handler MCBrowserDictionaryGetDictionary(in pDictionary as MCBrowserDictionaryRef, in pKey as ZStringUTF8, out rValue as MCBrowserDictionaryRef) returns CBool binds to "<builtin>"
110
126
111
-
public foreign handler type MCBrowserRequestCallback(in pContext as optional Pointer, in pBrowser as MCBrowserRef, in pType as MCBrowserRequestType, in pState as MCBrowserRequestState, in pFrame as CBool, in pUrl as ZStringUTF8, in pError as optional ZStringUTF8) returns nothing
127
+
public foreign handler type MCBrowserNavigationRequestCallback(in pContext as optional Pointer, in pBrowser as MCBrowserRef, in pRequest as MCBrowserNavigationRequestRef) returns CBool
128
+
public foreign handler type MCBrowserNavigationCallback(in pContext as optional Pointer, in pBrowser as MCBrowserRef, in pType as MCBrowserNavigationEventType, in pState as MCBrowserNavigationState, in pFrame as CBool, in pUrl as ZStringUTF8, in pError as optional ZStringUTF8) returns nothing
112
129
public foreign handler type MCBrowserJavaScriptCallback(in pContext as optional Pointer, in pBrowser as MCBrowserRef, in pHandler as ZStringUTF8, in pParams as MCBrowserListRef) returns nothing
113
130
public foreign handler type MCBrowserProgressCallback(in pContext as optional Pointer, in pBrowser as MCBrowserRef, in pUrl as ZStringUTF8, in pProgress as UInt32) returns nothing
114
131
115
-
public foreign handler MCBrowserSetRequestHandler(in pBrowser as MCBrowserRef, in pCallback as optional MCBrowserRequestCallback, in pContext as optional Pointer) returns CBool binds to "<builtin>"
132
+
public foreign handler MCBrowserSetNavigationRequestHandler(in pBrowser as MCBrowserRef, in pCallback as optional MCBrowserNavigationRequestCallback, in pContext as optional Pointer) returns CBool binds to "<builtin>"
133
+
public foreign handler MCBrowserSetNavigationHandler(in pBrowser as MCBrowserRef, in pCallback as optional MCBrowserNavigationCallback, in pContext as optional Pointer) returns CBool binds to "<builtin>"
116
134
public foreign handler MCBrowserSetJavaScriptHandler(in pBrowser as MCBrowserRef, in pCallback as optional MCBrowserJavaScriptCallback, in pContext as optional Pointer) returns CBool binds to "<builtin>"
117
135
public foreign handler MCBrowserSetProgressHandler(in pBrowser as MCBrowserRef, in pCallback as optional MCBrowserProgressCallback, in pContext as optional Pointer) returns CBool binds to "<builtin>"
118
136
@@ -138,34 +156,93 @@ public constant kMCBrowserPropertyUrl is 6
138
156
public constant kMCBrowserPropertyHtmlText is 7
139
157
public constant kMCBrowserPropertyUserAgent is 8
140
158
public constant kMCBrowserPropertyJavaScriptHandlers is 9
159
+
public constant kMCBrowserPropertyiOSDelayRequests is 10
160
+
public constant kMCBrowserPropertyiOSAllowsInlineMediaPlayback is 11
161
+
public constant kMCBrowserPropertyiOSMediaPlaybackRequiresUserAction is 12
162
+
public constant kMCBrowserPropertyiOSAutoFit is 13
163
+
public constant kMCBrowserPropertyCanGoForward is 14
164
+
public constant kMCBrowserPropertyCanGoBack is 15
165
+
public constant kMCBrowserPropertyDataDetectorTypes is 16
166
+
public constant kMCBrowserPropertyScrollEnabled is 17
167
+
public constant kMCBrowserPropertyScrollCanBounce is 18
168
+
169
+
public constant kMCBrowserPropertyMap is [ \
170
+
"verticalScrollbarEnabled", \
171
+
"horizontalScrollbarEnabled", \
172
+
"allowNewWindows", \
173
+
"enableContextMenu", \
174
+
"allowUserInteraction", \
175
+
"isSecure", \
176
+
"url", \
177
+
"htmlText", \
178
+
"userAgent", \
179
+
"javaScriptHandlers", \
180
+
"delayRequests", \
181
+
"allowsInlineMediaPlayback", \
182
+
"mediaPlaybackRequiresUserAction", \
183
+
"autoFit", \
184
+
"canGoForward", \
185
+
"canGoBack", \
186
+
"dataDetectorTypes", \
187
+
"scrollEnabled", \
188
+
"scrollCanBounce" \
189
+
]
141
190
142
-
public constant kMCBrowserPropertyMap is ["verticalScrollbarEnabled", "horizontalScrollbarEnabled", "allowNewWindows", "enableContextMenu", "allowUserInteraction", "isSecure", "url", "htmlText", "userAgent", "javaScriptHandlers"]
191
+
--
192
+
193
+
public constant kMCBrowserNavigationTypeFollowLink is 0
194
+
public constant kMCBrowserNavigationTypeSubmitForm is 1
195
+
public constant kMCBrowserNavigationTypeBackForward is 2
196
+
public constant kMCBrowserNavigationTypeReload is 3
197
+
public constant kMCBrowserNavigationTypeResubmitForm is 4
198
+
public constant kMCBrowserNavigationTypeOther is 5
199
+
200
+
public constant kMCBrowserNavigationTypeMap is ["followLink", "submitForm", "backForward", "reload", "resubmitForm", "other"]
143
201
144
202
--
145
203
146
-
public constant kMCBrowserRequestTypeNavigate is 0
147
-
public constant kMCBrowserRequestTypeDocumentLoad is 1
204
+
public constant kMCBrowserNavigationEventTypeNavigate is 0
205
+
public constant kMCBrowserNavigationEventTypeDocumentLoad is 1
148
206
149
-
public constant kMCBrowserRequestTypeMap is ["navigate", "documentLoad"]
207
+
public constant kMCBrowserNavigationEventTypeMap is ["navigate", "documentLoad"]
150
208
151
209
--
152
210
153
-
public constant kMCBrowserRequestStateBegin is 0
154
-
public constant kMCBrowserRequestStateComplete is 1
155
-
public constant kMCBrowserRequestStateFailed is 2
156
-
public constant kMCBrowserRequestStateUnhandled is 3
211
+
public constant kMCBrowserNavigationStateBegin is 0
212
+
public constant kMCBrowserNavigationStateComplete is 1
213
+
public constant kMCBrowserNavigationStateFailed is 2
214
+
public constant kMCBrowserNavigationStateUnhandled is 3
157
215
158
-
public constant kMCBrowserRequestStateMap is ["begin", "complete", "failed", "unhandled"]
216
+
public constant kMCBrowserNavigationStateMap is ["begin", "complete", "failed", "unhandled"]
159
217
160
218
--
161
219
162
220
-- constant kStringProps is ["url", "htmlText", "userAgent", "javaScriptHandlers"]
163
221
-- TODO - replace literal values with constants when possible
164
222
constant kStringProps is [6, 7, 8, 9]
165
223
166
-
-- constant kBoolProps is ["verticalScrollbarEnabled", "horizontalScrollbarEnabled", "allowNewWindows", "enableContextMenu", "allowUserInteraction", "isSecure"]
224
+
-- constant kBoolProps is [ \
225
+
-- "verticalScrollbarEnabled", \
226
+
-- "horizontalScrollbarEnabled", \
227
+
-- "allowNewWindows", \
228
+
-- "enableContextMenu", \
229
+
-- "allowUserInteraction", \
230
+
-- "isSecure", \
231
+
-- "delayRequests", \
232
+
-- "allowsInlineMediaPlayback", \
233
+
-- "mediaPlaybackRequiresUserAction", \
234
+
-- "autoFit", \
235
+
-- "canGoForward", \
236
+
-- "canGoBack", \
237
+
-- "scrollEnabled", \
238
+
-- "scrollCanBounce", \
239
+
--]
240
+
-- TODO - replace literal values with constants when possible
0 commit comments