forked from cool2528/baiduCDP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wke.h
1238 lines (1079 loc) · 56.7 KB
/
wke.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
*
* http://miniblink.net
* https://github.com/weolar/miniblink49
* https://weolar.github.io/miniblink/doc-main.html api文档地址
* licence Apache-2.0
*
*/
#ifndef WKE_DEFINE_H
#define WKE_DEFINE_H
#include <windows.h>
//////////////////////////////////////////////////////////////////////////
#define WKE_CALL_TYPE __cdecl
typedef struct {
int x;
int y;
int w;
int h;
} wkeRect;
typedef struct {
int x;
int y;
} wkePoint;
typedef enum {
WKE_LBUTTON = 0x01,
WKE_RBUTTON = 0x02,
WKE_SHIFT = 0x04,
WKE_CONTROL = 0x08,
WKE_MBUTTON = 0x10,
} wkeMouseFlags;
typedef enum {
WKE_EXTENDED = 0x0100,
WKE_REPEAT = 0x4000,
} wkeKeyFlags;
typedef enum {
WKE_MSG_MOUSEMOVE = 0x0200,
WKE_MSG_LBUTTONDOWN = 0x0201,
WKE_MSG_LBUTTONUP = 0x0202,
WKE_MSG_LBUTTONDBLCLK = 0x0203,
WKE_MSG_RBUTTONDOWN = 0x0204,
WKE_MSG_RBUTTONUP = 0x0205,
WKE_MSG_RBUTTONDBLCLK = 0x0206,
WKE_MSG_MBUTTONDOWN = 0x0207,
WKE_MSG_MBUTTONUP = 0x0208,
WKE_MSG_MBUTTONDBLCLK = 0x0209,
WKE_MSG_MOUSEWHEEL = 0x020A,
} wkeMouseMsg;
#if !defined(__cplusplus)
#ifndef HAVE_WCHAR_T
typedef unsigned short wchar_t;
#endif
#define bool _Bool
#define false 0
#define true 1
#endif
#if defined(__cplusplus)
#define WKE_EXTERN_C extern "C"
#else
#define WKE_EXTERN_C
#endif
typedef char utf8;
#if !defined(__cplusplus)
typedef void* jsExecState;
#else
struct JsExecStateInfo;
typedef JsExecStateInfo* jsExecState;
#endif
typedef __int64 jsValue;
#if defined(__cplusplus)
namespace wke { class CWebView; };
typedef wke::CWebView* wkeWebView;
namespace wke { class CString; };
typedef wke::CString* wkeString;
#else
struct _tagWkeWebView;
typedef struct _tagWkeWebView* wkeWebView;
struct _tagWkeString;
typedef struct _tagWkeString* wkeString;
#endif
#if defined(__cplusplus)
namespace wke { class WkeMediaPlayer; };
typedef wke::WkeMediaPlayer* wkeMediaPlayer;
namespace wke { class WkeMediaPlayerClient; };
typedef wke::WkeMediaPlayerClient* wkeMediaPlayerClient;
#else
typedef struct _tagWkeMediaPlayer* wkeMediaPlayer;
typedef struct _tagWkeMediaPlayerClient* wkeMediaPlayerClient;
#endif
typedef enum {
WKE_PROXY_NONE,
WKE_PROXY_HTTP,
WKE_PROXY_SOCKS4,
WKE_PROXY_SOCKS4A,
WKE_PROXY_SOCKS5,
WKE_PROXY_SOCKS5HOSTNAME
} wkeProxyType;
typedef struct {
wkeProxyType type;
char hostname[100];
unsigned short port;
char username[50];
char password[50];
} wkeProxy;
enum wkeSettingMask {
WKE_SETTING_PROXY = 1,
WKE_SETTING_PAINTCALLBACK_IN_OTHER_THREAD = 1 << 2,
};
typedef struct _wkeSettings {
wkeProxy proxy;
unsigned int mask;
} wkeSettings;
typedef struct {
int size;
unsigned int bgColor;
} wkeViewSettings;
typedef void* wkeWebFrameHandle;
typedef void* (WKE_CALL_TYPE *FILE_OPEN_) (const char* path);
typedef void(WKE_CALL_TYPE *FILE_CLOSE_) (void* handle);
typedef size_t(WKE_CALL_TYPE *FILE_SIZE) (void* handle);
typedef int(WKE_CALL_TYPE *FILE_READ) (void* handle, void* buffer, size_t size);
typedef int(WKE_CALL_TYPE *FILE_SEEK) (void* handle, int offset, int origin);
typedef FILE_OPEN_ WKE_FILE_OPEN;
typedef FILE_CLOSE_ WKE_FILE_CLOSE;
typedef FILE_SIZE WKE_FILE_SIZE;
typedef FILE_READ WKE_FILE_READ;
typedef FILE_SEEK WKE_FILE_SEEK;
typedef bool(WKE_CALL_TYPE *WKE_EXISTS_FILE)(const char * path);
struct _wkeClientHandler; // declare warning fix
typedef void(WKE_CALL_TYPE *ON_TITLE_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString title);
typedef void(WKE_CALL_TYPE *ON_URL_CHANGED) (const struct _wkeClientHandler* clientHandler, const wkeString url);
typedef struct _wkeClientHandler {
ON_TITLE_CHANGED onTitleChanged;
ON_URL_CHANGED onURLChanged;
} wkeClientHandler;
typedef bool(WKE_CALL_TYPE * wkeCookieVisitor)(
void* params,
const char* name,
const char* value,
const char* domain,
const char* path, // If |path| is non-empty only URLs at or below the path will get the cookie value.
int secure, // If |secure| is true the cookie will only be sent for HTTPS requests.
int httpOnly, // If |httponly| is true the cookie will only be sent for HTTP requests.
int* expires // The cookie expiration date is only valid if |has_expires| is true.
);
typedef enum {
wkeCookieCommandClearAllCookies,
wkeCookieCommandClearSessionCookies,
wkeCookieCommandFlushCookiesToFile,
wkeCookieCommandReloadCookiesFromFile,
} wkeCookieCommand;
typedef enum {
WKE_NAVIGATION_TYPE_LINKCLICK,
WKE_NAVIGATION_TYPE_FORMSUBMITTE,
WKE_NAVIGATION_TYPE_BACKFORWARD,
WKE_NAVIGATION_TYPE_RELOAD,
WKE_NAVIGATION_TYPE_FORMRESUBMITT,
WKE_NAVIGATION_TYPE_OTHER
} wkeNavigationType;
typedef enum {
WkeCursorInfoPointer,
WkeCursorInfoCross,
WkeCursorInfoHand,
WkeCursorInfoIBeam,
WkeCursorInfoWait,
WkeCursorInfoHelp,
WkeCursorInfoEastResize,
WkeCursorInfoNorthResize,
WkeCursorInfoNorthEastResize,
WkeCursorInfoNorthWestResize,
WkeCursorInfoSouthResize,
WkeCursorInfoSouthEastResize,
WkeCursorInfoSouthWestResize,
WkeCursorInfoWestResize,
WkeCursorInfoNorthSouthResize,
WkeCursorInfoEastWestResize,
WkeCursorInfoNorthEastSouthWestResize,
WkeCursorInfoNorthWestSouthEastResize,
WkeCursorInfoColumnResize,
WkeCursorInfoRowResize,
WkeCursorInfoMiddlePanning,
WkeCursorInfoEastPanning,
WkeCursorInfoNorthPanning,
WkeCursorInfoNorthEastPanning,
WkeCursorInfoNorthWestPanning,
WkeCursorInfoSouthPanning,
WkeCursorInfoSouthEastPanning,
WkeCursorInfoSouthWestPanning,
WkeCursorInfoWestPanning,
WkeCursorInfoMove,
WkeCursorInfoVerticalText,
WkeCursorInfoCell,
WkeCursorInfoContextMenu,
WkeCursorInfoAlias,
WkeCursorInfoProgress,
WkeCursorInfoNoDrop,
WkeCursorInfoCopy,
WkeCursorInfoNone,
WkeCursorInfoNotAllowed,
WkeCursorInfoZoomIn,
WkeCursorInfoZoomOut,
WkeCursorInfoGrab,
WkeCursorInfoGrabbing,
WkeCursorInfoCustom
} WkeCursorInfoType;
typedef struct {
int x;
int y;
int width;
int height;
bool menuBarVisible;
bool statusBarVisible;
bool toolBarVisible;
bool locationBarVisible;
bool scrollbarsVisible;
bool resizable;
bool fullscreen;
} wkeWindowFeatures;
typedef struct {
int size;
void* data;
size_t length;
} wkeMemBuf;
typedef struct {
struct Item {
enum wkeStorageType {
// String data with an associated MIME type. Depending on the MIME type, there may be
// optional metadata attributes as well.
StorageTypeString,
// Stores the name of one file being dragged into the renderer.
StorageTypeFilename,
// An image being dragged out of the renderer. Contains a buffer holding the image data
// as well as the suggested name for saving the image to.
StorageTypeBinaryData,
// Stores the filesystem URL of one file being dragged into the renderer.
StorageTypeFileSystemFile,
} storageType;
// Only valid when storageType == StorageTypeString.
wkeMemBuf* stringType;
wkeMemBuf* stringData;
// Only valid when storageType == StorageTypeFilename.
wkeMemBuf* filenameData;
wkeMemBuf* displayNameData;
// Only valid when storageType == StorageTypeBinaryData.
wkeMemBuf* binaryData;
// Title associated with a link when stringType == "text/uri-list".
// Filename when storageType == StorageTypeBinaryData.
wkeMemBuf* title;
// Only valid when storageType == StorageTypeFileSystemFile.
wkeMemBuf* fileSystemURL;
__int64 fileSystemFileSize;
// Only valid when stringType == "text/html".
wkeMemBuf* baseURL;
};
struct Item* m_itemList;
int m_itemListLength;
int m_modifierKeyState; // State of Shift/Ctrl/Alt/Meta keys.
wkeMemBuf* m_filesystemId;
} wkeWebDragData;
typedef enum {
wkeWebDragOperationNone = 0,
wkeWebDragOperationCopy = 1,
wkeWebDragOperationLink = 2,
wkeWebDragOperationGeneric = 4,
wkeWebDragOperationPrivate = 8,
wkeWebDragOperationMove = 16,
wkeWebDragOperationDelete = 32,
wkeWebDragOperationEvery = 0xffffffff
} wkeWebDragOperation;
typedef wkeWebDragOperation wkeWebDragOperationsMask;
typedef enum {
WKE_RESOURCE_TYPE_MAIN_FRAME = 0, // top level page
WKE_RESOURCE_TYPE_SUB_FRAME = 1, // frame or iframe
WKE_RESOURCE_TYPE_STYLESHEET = 2, // a CSS stylesheet
WKE_RESOURCE_TYPE_SCRIPT = 3, // an external script
WKE_RESOURCE_TYPE_IMAGE = 4, // an image (jpg/gif/png/etc)
WKE_RESOURCE_TYPE_FONT_RESOURCE = 5, // a font
WKE_RESOURCE_TYPE_SUB_RESOURCE = 6, // an "other" subresource.
WKE_RESOURCE_TYPE_OBJECT = 7, // an object (or embed) tag for a plugin,
// or a resource that a plugin requested.
WKE_RESOURCE_TYPE_MEDIA = 8, // a media resource.
WKE_RESOURCE_TYPE_WORKER = 9, // the main resource of a dedicated
// worker.
WKE_RESOURCE_TYPE_SHARED_WORKER = 10, // the main resource of a shared worker.
WKE_RESOURCE_TYPE_PREFETCH = 11, // an explicitly requested prefetch
WKE_RESOURCE_TYPE_FAVICON = 12, // a favicon
WKE_RESOURCE_TYPE_XHR = 13, // a XMLHttpRequest
WKE_RESOURCE_TYPE_PING = 14, // a ping request for <a ping>
WKE_RESOURCE_TYPE_SERVICE_WORKER = 15, // the main resource of a service worker.
WKE_RESOURCE_TYPE_LAST_TYPE
} wkeResourceType;
typedef struct {
wkeString url;
wkeString newUrl;
wkeResourceType resourceType;
int httpResponseCode;
wkeString method;
wkeString referrer;
void* headers;
} wkeWillSendRequestInfo;
typedef enum {
wkeHttBodyElementTypeData,
wkeHttBodyElementTypeFile,
} wkeHttBodyElementType;
typedef struct {
int size;
wkeHttBodyElementType type;
wkeMemBuf* data;
wkeString filePath;
__int64 fileStart;
__int64 fileLength; // -1 means to the end of the file.
} wkePostBodyElement;
typedef struct {
int size;
wkePostBodyElement** element;
size_t elementSize;
bool isDirty;
} wkePostBodyElements;
typedef struct {
int size;
wkeWebFrameHandle frame;
wkeWillSendRequestInfo* willSendRequestInfo;
const char* url;
wkePostBodyElements* postBody;
} wkeTempCallbackInfo;
typedef enum _wkeRequestType {
kWkeRequestTypeInvalidation,
kWkeRequestTypeGet,
kWkeRequestTypePost,
kWkeRequestTypePut,
} wkeRequestType;
typedef void(WKE_CALL_TYPE*wkeTitleChangedCallback)(wkeWebView webView, void* param, const wkeString title);
typedef void(WKE_CALL_TYPE*wkeURLChangedCallback)(wkeWebView webView, void* param, const wkeString url);
typedef void(WKE_CALL_TYPE*wkeURLChangedCallback2)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, const wkeString url);
typedef void(WKE_CALL_TYPE*wkePaintUpdatedCallback)(wkeWebView webView, void* param, const HDC hdc, int x, int y, int cx, int cy);
typedef void(WKE_CALL_TYPE*wkePaintBitUpdatedCallback)(wkeWebView webView, void* param, const void* buffer, const wkeRect* r, int width, int height);
typedef void(WKE_CALL_TYPE*wkeAlertBoxCallback)(wkeWebView webView, void* param, const wkeString msg);
typedef bool(WKE_CALL_TYPE*wkeConfirmBoxCallback)(wkeWebView webView, void* param, const wkeString msg);
typedef bool(WKE_CALL_TYPE*wkePromptBoxCallback)(wkeWebView webView, void* param, const wkeString msg, const wkeString defaultResult, wkeString result);
typedef bool(WKE_CALL_TYPE*wkeNavigationCallback)(wkeWebView webView, void* param, wkeNavigationType navigationType, const wkeString url);
typedef wkeWebView(WKE_CALL_TYPE*wkeCreateViewCallback)(wkeWebView webView, void* param, wkeNavigationType navigationType, const wkeString url, const wkeWindowFeatures* windowFeatures);
typedef void(WKE_CALL_TYPE*wkeDocumentReadyCallback)(wkeWebView webView, void* param);
typedef void(WKE_CALL_TYPE*wkeDocumentReady2Callback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId);
typedef void(WKE_CALL_TYPE*wkeOnShowDevtoolsCallback)(wkeWebView webView, void* param);
typedef void(WKE_CALL_TYPE*wkeNodeOnCreateProcessCallback)(wkeWebView webView, void* param, const WCHAR* applicationPath, const WCHAR* arguments, STARTUPINFOW* startup);
typedef void(WKE_CALL_TYPE*wkeOnPluginFindCallback)(wkeWebView webView, void* param, const utf8* mime, void* initializeFunc, void* getEntryPointsFunc, void* shutdownFunc);
typedef struct {
int size;
int width;
int height;
double duration;
} wkeMediaLoadInfo;
typedef void(WKE_CALL_TYPE*wkeWillMediaLoadCallback)(wkeWebView webView, void* param, const char* url, wkeMediaLoadInfo* info);
typedef void(WKE_CALL_TYPE*wkeStartDraggingCallback)(
wkeWebView webView,
void* param,
wkeWebFrameHandle frame,
const wkeWebDragData* data,
wkeWebDragOperationsMask mask,
const void* image,
const wkePoint* dragImageOffset
);
typedef void(WKE_CALL_TYPE*wkeUiThreadRunCallback)(HWND hWnd, void* param);
typedef int(WKE_CALL_TYPE*wkeUiThreadPostTaskCallback)(HWND hWnd, wkeUiThreadRunCallback callback, void* param);
typedef enum {
WKE_DID_START_LOADING,
WKE_DID_STOP_LOADING,
WKE_DID_NAVIGATE,
WKE_DID_NAVIGATE_IN_PAGE,
WKE_DID_GET_RESPONSE_DETAILS,
WKE_DID_GET_REDIRECT_REQUEST,
WKE_DID_POST_REQUEST,
} wkeOtherLoadType;
typedef void(WKE_CALL_TYPE*wkeOnOtherLoadCallback)(wkeWebView webView, void* param, wkeOtherLoadType type, wkeTempCallbackInfo* info);
typedef enum {
WKE_LOADING_SUCCEEDED,
WKE_LOADING_FAILED,
WKE_LOADING_CANCELED
} wkeLoadingResult;
typedef void(WKE_CALL_TYPE*wkeLoadingFinishCallback)(wkeWebView webView, void* param, const wkeString url, wkeLoadingResult result, const wkeString failedReason);
typedef bool(WKE_CALL_TYPE*wkeDownloadCallback)(wkeWebView webView, void* param, const char* url);
typedef enum {
wkeLevelDebug = 4,
wkeLevelLog = 1,
wkeLevelInfo = 5,
wkeLevelWarning = 2,
wkeLevelError = 3,
wkeLevelRevokedError = 6,
wkeLevelLast = wkeLevelInfo
} wkeConsoleLevel;
typedef void(WKE_CALL_TYPE*wkeConsoleCallback)(wkeWebView webView, void* param, wkeConsoleLevel level, const wkeString message, const wkeString sourceName, unsigned sourceLine, const wkeString stackTrace);
typedef void(WKE_CALL_TYPE*wkeOnCallUiThread)(wkeWebView webView, void* paramOnInThread);
typedef void(WKE_CALL_TYPE*wkeCallUiThread)(wkeWebView webView, wkeOnCallUiThread func, void* param);
typedef wkeMediaPlayer(WKE_CALL_TYPE* wkeMediaPlayerFactory)(wkeWebView webView, wkeMediaPlayerClient client, void* npBrowserFuncs, void* npPluginFuncs);
typedef bool(WKE_CALL_TYPE* wkeOnIsMediaPlayerSupportsMIMEType)(const utf8* mime);
//wkeNet--------------------------------------------------------------------------------------
typedef void* wkeNetJob;
typedef struct wkeWebUrlRequest* wkeWebUrlRequestPtr;
typedef struct wkeWebUrlResponse* wkeWebUrlResponsePtr;
typedef void(WKE_CALL_TYPE* wkeOnUrlRequestWillRedirectCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr oldRequest, wkeWebUrlRequestPtr request, wkeWebUrlResponsePtr redirectResponse);
typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidReceiveResponseCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, wkeWebUrlResponsePtr response);
typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidReceiveDataCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, const char* data, int dataLength);
typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidFailCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, const utf8* error);
typedef void(WKE_CALL_TYPE* wkeOnUrlRequestDidFinishLoadingCallback)(wkeWebView webView, void* param, wkeWebUrlRequestPtr request, double finishTime);
typedef struct _wkeUrlRequestCallbacks {
wkeOnUrlRequestWillRedirectCallback willRedirectCallback;
wkeOnUrlRequestDidReceiveResponseCallback didReceiveResponseCallback;
wkeOnUrlRequestDidReceiveDataCallback didReceiveDataCallback;
wkeOnUrlRequestDidFailCallback didFailCallback;
wkeOnUrlRequestDidFinishLoadingCallback didFinishLoadingCallback;
} wkeUrlRequestCallbacks;
typedef bool(WKE_CALL_TYPE*wkeLoadUrlBeginCallback)(wkeWebView webView, void* param, const char* url, wkeNetJob job);
typedef void(WKE_CALL_TYPE*wkeLoadUrlEndCallback)(wkeWebView webView, void* param, const char* url, wkeNetJob job, void* buf, int len);
typedef void(WKE_CALL_TYPE*wkeDidCreateScriptContextCallback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, void* context, int extensionGroup, int worldId);
typedef void(WKE_CALL_TYPE*wkeWillReleaseScriptContextCallback)(wkeWebView webView, void* param, wkeWebFrameHandle frameId, void* context, int worldId);
typedef bool(WKE_CALL_TYPE*wkeNetResponseCallback)(wkeWebView webView, void* param, const char* url, wkeNetJob job);
typedef void(WKE_CALL_TYPE*wkeOnNetGetFaviconCallback)(wkeWebView webView, void* param, const utf8* url, wkeMemBuf* buf);
typedef void* v8ContextPtr;
typedef void* v8Isolate;
//wke window-----------------------------------------------------------------------------------
typedef enum {
WKE_WINDOW_TYPE_POPUP,
WKE_WINDOW_TYPE_TRANSPARENT,
WKE_WINDOW_TYPE_CONTROL
} wkeWindowType;
typedef bool(WKE_CALL_TYPE*wkeWindowClosingCallback)(wkeWebView webWindow, void* param);
typedef void(WKE_CALL_TYPE*wkeWindowDestroyCallback)(wkeWebView webWindow, void* param);
typedef struct {
RECT bounds;
bool draggable;
} wkeDraggableRegion;
typedef void(WKE_CALL_TYPE*wkeDraggableRegionsChangedCallback)(wkeWebView webView, void* param, const wkeDraggableRegion* rects, int rectCount);
//JavaScript Bind-----------------------------------------------------------------------------------
#define JS_CALL __fastcall
typedef jsValue(JS_CALL* jsNativeFunction) (jsExecState es);
typedef jsValue(WKE_CALL_TYPE* wkeJsNativeFunction) (jsExecState es, void* param);
typedef enum {
JSTYPE_NUMBER,
JSTYPE_STRING,
JSTYPE_BOOLEAN,
JSTYPE_OBJECT,
JSTYPE_FUNCTION,
JSTYPE_UNDEFINED,
JSTYPE_ARRAY,
JSTYPE_NULL,
} jsType;
// cexer JS对象、函数绑定支持
typedef jsValue(WKE_CALL_TYPE*jsGetPropertyCallback)(jsExecState es, jsValue object, const char* propertyName);
typedef bool(WKE_CALL_TYPE*jsSetPropertyCallback)(jsExecState es, jsValue object, const char* propertyName, jsValue value);
typedef jsValue(WKE_CALL_TYPE*jsCallAsFunctionCallback)(jsExecState es, jsValue object, jsValue* args, int argCount);
struct tagjsData; // declare warning fix
typedef void(WKE_CALL_TYPE*jsFinalizeCallback)(struct tagjsData* data);
typedef struct tagjsData {
char typeName[100];
jsGetPropertyCallback propertyGet;
jsSetPropertyCallback propertySet;
jsFinalizeCallback finalize;
jsCallAsFunctionCallback callAsFunction;
} jsData;
typedef struct _jsExceptionInfo {
const utf8* message; // Returns the exception message.
const utf8* sourceLine; // Returns the line of source code that the exception occurred within.
const utf8* scriptResourceName; // Returns the resource name for the script from where the function causing the error originates.
int lineNumber; // Returns the 1-based number of the line where the error occurred or 0 if the line number is unknown.
int startPosition; // Returns the index within the script of the first character where the error occurred.
int endPosition; // Returns the index within the script of the last character where the error occurred.
int startColumn; // Returns the index within the line of the first character where the error occurred.
int endColumn; // Returns the index within the line of the last character where the error occurred.
const utf8* callstackString;
} jsExceptionInfo;
typedef struct _jsKeys {
unsigned int length;
const char** keys;
#if defined(__cplusplus)
~_jsKeys();
#endif
} jsKeys;
#if defined(__cplusplus)
namespace wke {
class IWebView {
public:
virtual void destroy() = 0;
virtual const char* name() const = 0;
virtual void setName(const char* name) = 0;
virtual bool isTransparent() const = 0;
virtual void setTransparent(bool transparent) = 0;
virtual void loadURL(const utf8* url) = 0;
virtual void loadURL(const wchar_t* url) = 0;
virtual void loadHTML(const utf8* html) = 0;
virtual void loadHTML(const wchar_t* html) = 0;
virtual void loadFile(const utf8* filename) = 0;
virtual void loadFile(const wchar_t* filename) = 0;
virtual const utf8* url() const = 0;
virtual bool isLoading() const = 0; /*document load sucessed*/
virtual bool isLoadingFailed() const = 0; /*document load failed*/
virtual bool isLoadingSucceeded() const = 0; /*document load complete*/
virtual bool isDocumentReady() const = 0; /*document ready*/
virtual void stopLoading() = 0;
virtual void reload() = 0;
virtual const utf8* title() = 0;
virtual const wchar_t* titleW() = 0;
virtual void resize(int w, int h) = 0;
virtual int width() const = 0; /*viewport width*/
virtual int height() const = 0; /*viewport height*/
virtual int contentsWidth() const = 0; /*contents width*/
virtual int contentsHeight() const = 0; /*contents height*/
virtual void setDirty(bool dirty) = 0;
virtual bool isDirty() const = 0;
virtual void addDirtyArea(int x, int y, int w, int h) = 0;
virtual void layoutIfNeeded() = 0;
virtual void paint(void* bits, int pitch) = 0;
virtual bool canGoBack() const = 0;
virtual bool goBack() = 0;
virtual bool canGoForward() const = 0;
virtual bool goForward() = 0;
virtual void editorSelectAll() = 0;
virtual void editorUnSelect() = 0;
virtual void editorCopy() = 0;
virtual void editorCut() = 0;
virtual void editorPaste() = 0;
virtual void editorDelete() = 0;
virtual void editorUndo() = 0;
virtual void editorRedo() = 0;
virtual void setCookieEnabled(bool enable) = 0;
virtual bool isCookieEnabled() const = 0;
virtual void setMediaVolume(float volume) = 0;
virtual float mediaVolume() const = 0;
virtual bool fireMouseEvent(unsigned int message, int x, int y, unsigned int flags) = 0;
virtual bool fireContextMenuEvent(int x, int y, unsigned int flags) = 0;
virtual bool fireMouseWheelEvent(int x, int y, int delta, unsigned int flags) = 0;
virtual bool fireKeyUpEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
virtual bool fireKeyDownEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
virtual bool fireKeyPressEvent(unsigned int virtualKeyCode, unsigned int flags, bool systemKey) = 0;
virtual void setFocus() = 0;
virtual void killFocus() = 0;
virtual wkeRect getCaret() = 0;
virtual jsValue runJS(const utf8* script) = 0;
virtual jsValue runJS(const wchar_t* script) = 0;
virtual jsExecState globalExec() = 0;
virtual void sleep() = 0; //moveOffscreen
virtual void wake() = 0; //moveOnscreen
virtual bool isAwake() const = 0;
virtual void setZoomFactor(float factor) = 0;
virtual float zoomFactor() const = 0;
virtual void setEditable(bool editable) = 0;
virtual void setClientHandler(const wkeClientHandler* handler) = 0;
virtual const wkeClientHandler* getClientHandler() const = 0;
};
}
#endif
//////////////////////////////////////////////////////////////////////////
#define WKE_DEFINE_ITERATOR0(returnVal, name, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR1(returnVal, name, p1, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR2(returnVal, name, p1, p2, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR3(returnVal, name, p1, p2, p3, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
#define WKE_DEFINE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \
typedef returnVal(WKE_CALL_TYPE* FN_##name)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11); \
__declspec(selectany) FN_##name name = ((FN_##name)0);
// ---
#define WKE_DECLARE_ITERATOR0(returnVal, name, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name();
#define WKE_DECLARE_ITERATOR1(returnVal, name, p1, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1);
#define WKE_DECLARE_ITERATOR2(returnVal, name, p1, p2, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2);
#define WKE_DECLARE_ITERATOR3(returnVal, name, p1, p2, p3, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3);
#define WKE_DECLARE_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4);
#define WKE_DECLARE_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5);
#define WKE_DECLARE_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6);
#define WKE_DECLARE_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \
WKE_EXTERN_C __declspec(dllexport) returnVal WKE_CALL_TYPE name(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
// ---
#define WKE_GET_PTR_ITERATOR(name) \
name = (FN_##name)GetProcAddress(hMod, #name); \
if (!name) \
MessageBoxA(((HWND)0), "wke api not found", #name, 0);
#define WKE_GET_PTR_ITERATOR0(returnVal, name, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR1(returnVal, name, p1, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR2(returnVal, name, p1, p2, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR3(returnVal, name, p1, p2, p3, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR4(returnVal, name, p1, p2, p3, p4, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR5(returnVal, name, p1, p2, p3, p4, p5, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR6(returnVal, name, p1, p2, p3, p4, p5, p6, description) \
WKE_GET_PTR_ITERATOR(name);
#define WKE_GET_PTR_ITERATOR11(returnVal, name, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, description) \
WKE_GET_PTR_ITERATOR(name);
// 以下是wke的导出函数。格式按照【返回类型】【函数名】【参数】来排列
#define WKE_FOR_EACH_DEFINE_FUNCTION(ITERATOR0, ITERATOR1, ITERATOR2, ITERATOR3, ITERATOR4, ITERATOR5, ITERATOR6, ITERATOR11) \
ITERATOR0(void, wkeShutdown, "") \
\
ITERATOR0(unsigned int, wkeVersion, "") \
ITERATOR0(const utf8*, wkeVersionString, "") \
ITERATOR2(void, wkeGC, wkeWebView webView, long intervalSec, "") \
ITERATOR2(void, wkeSetResourceGc, wkeWebView webView, long intervalSec, "") \
\
ITERATOR5(void, wkeSetFileSystem, WKE_FILE_OPEN pfnOpen, WKE_FILE_CLOSE pfnClose, WKE_FILE_SIZE pfnSize, WKE_FILE_READ pfnRead, WKE_FILE_SEEK pfnSeek, "") \
\
ITERATOR1(const char*, wkeWebViewName, wkeWebView webView, "") \
ITERATOR2(void, wkeSetWebViewName, wkeWebView webView, const char* name, "") \
\
ITERATOR1(bool, wkeIsLoaded, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsLoadFailed, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsLoadComplete, wkeWebView webView, "") \
\
ITERATOR1(const utf8*, wkeGetSource, wkeWebView webView, "") \
ITERATOR1(const utf8*, wkeTitle, wkeWebView webView, "") \
ITERATOR1(const wchar_t*, wkeTitleW, wkeWebView webView, "") \
ITERATOR1(int, wkeWidth, wkeWebView webView, "") \
ITERATOR1(int, wkeHeight, wkeWebView webView, "") \
ITERATOR1(int, wkeContentsWidth, wkeWebView webView, "") \
ITERATOR1(int, wkeContentsHeight, wkeWebView webView, "") \
\
ITERATOR1(void, wkeSelectAll, wkeWebView webView, "") \
ITERATOR1(void, wkeCopy, wkeWebView webView, "") \
ITERATOR1(void, wkeCut, wkeWebView webView, "") \
ITERATOR1(void, wkePaste, wkeWebView webView, "") \
ITERATOR1(void, wkeDelete, wkeWebView webView, "") \
\
ITERATOR1(bool, wkeCookieEnabled, wkeWebView webView, "") \
ITERATOR1(float, wkeMediaVolume, wkeWebView webView, "") \
\
ITERATOR5(bool, wkeMouseEvent, wkeWebView webView, unsigned int message, int x, int y, unsigned int flags, "") \
ITERATOR4(bool, wkeContextMenuEvent, wkeWebView webView, int x, int y, unsigned int flags, "") \
ITERATOR5(bool, wkeMouseWheel, wkeWebView webView, int x, int y, int delta, unsigned int flags, "") \
ITERATOR4(bool, wkeKeyUp, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \
ITERATOR4(bool, wkeKeyDown, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \
ITERATOR4(bool, wkeKeyPress, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \
\
ITERATOR1(void, wkeFocus, wkeWebView webView, "") \
ITERATOR1(void, wkeUnfocus, wkeWebView webView, "") \
\
ITERATOR1(wkeRect, wkeGetCaret, wkeWebView webView, "") \
\
ITERATOR1(void, wkeAwaken, wkeWebView webView, "") \
\
ITERATOR1(float, wkeZoomFactor, wkeWebView webView, "") \
\
ITERATOR2(void, wkeSetClientHandler, wkeWebView webView, const wkeClientHandler* handler, "") \
ITERATOR1(const wkeClientHandler*, wkeGetClientHandler, wkeWebView webView, "") \
\
ITERATOR1(const utf8*, wkeToString, const wkeString string, "") \
ITERATOR1(const wchar_t*, wkeToStringW, const wkeString string, "") \
\
ITERATOR2(const utf8*, jsToString, jsExecState es, jsValue v, "") \
ITERATOR2(const wchar_t*, jsToStringW, jsExecState es, jsValue v, "") \
\
ITERATOR1(void, wkeConfigure, const wkeSettings* settings, "") \
ITERATOR0(bool, wkeIsInitialize, "") \
\
ITERATOR2(void, wkeSetViewSettings, wkeWebView webView, const wkeViewSettings* settings, "") \
ITERATOR3(void, wkeSetDebugConfig, wkeWebView webView, const char* debugString, const char* param, "") \
\
ITERATOR0(void, wkeFinalize, "") \
ITERATOR0(void, wkeUpdate, "") \
ITERATOR0(unsigned int, wkeGetVersion, "") \
ITERATOR0(const utf8*, wkeGetVersionString, "") \
\
ITERATOR0(wkeWebView, wkeCreateWebView, "") \
ITERATOR1(void, wkeDestroyWebView, wkeWebView webView, "") \
\
ITERATOR2(void, wkeSetMemoryCacheEnable, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetMouseEnabled, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetTouchEnabled, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetNavigationToNewWindowEnable, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetCspCheckEnable, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetNpapiPluginsEnabled, wkeWebView webView, bool b, "") \
ITERATOR2(void, wkeSetHeadlessEnabled, wkeWebView webView, bool b, "可以关闭渲染") \
ITERATOR2(void, wkeSetDragEnable, wkeWebView webView, bool b, "可关闭拖拽文件加载网页") \
ITERATOR2(void, wkeSetDragDropEnable, wkeWebView webView, bool b, "可关闭拖拽到其他进程") \
ITERATOR2(void, wkeSetLanguage, wkeWebView webView, const char* language, "可关闭拖拽到其他进程") \
\
ITERATOR2(void, wkeSetViewNetInterface, wkeWebView webView, const char* netInterface, "") \
\
ITERATOR1(void, wkeSetProxy, const wkeProxy* proxy, "") \
ITERATOR2(void, wkeSetViewProxy, wkeWebView webView, wkeProxy *proxy, "") \
\
ITERATOR1(const char*, wkeGetName, wkeWebView webView, "") \
ITERATOR2(void, wkeSetName, wkeWebView webView, const char* name, "") \
\
ITERATOR2(void, wkeSetHandle, wkeWebView webView, HWND wnd, "") \
ITERATOR3(void, wkeSetHandleOffset, wkeWebView webView, int x, int y, "") \
\
ITERATOR1(bool, wkeIsTransparent, wkeWebView webView, "") \
ITERATOR2(void, wkeSetTransparent, wkeWebView webView, bool transparent, "") \
\
ITERATOR2(void, wkeSetUserAgent, wkeWebView webView, const utf8* userAgent, "") \
ITERATOR1(const char*, wkeGetUserAgent, wkeWebView webView, "") \
ITERATOR2(void, wkeSetUserAgentW, wkeWebView webView, const wchar_t* userAgent, "") \
\
ITERATOR4(void, wkeShowDevtools, wkeWebView webView, const wchar_t* path, wkeOnShowDevtoolsCallback callback, void* param, "") \
\
ITERATOR2(void, wkeLoadW, wkeWebView webView, const wchar_t* url, "") \
ITERATOR2(void, wkeLoadURL, wkeWebView webView, const utf8* url, "") \
ITERATOR2(void, wkeLoadURLW, wkeWebView webView, const wchar_t* url, "") \
ITERATOR4(void, wkePostURL, wkeWebView wkeView, const utf8* url, const char* postData, int postLen, "") \
ITERATOR4(void, wkePostURLW, wkeWebView wkeView, const wchar_t* url, const char* postData, int postLen, "") \
\
ITERATOR2(void, wkeLoadHTML, wkeWebView webView, const utf8* html, "") \
ITERATOR3(void, wkeLoadHtmlWithBaseUrl, wkeWebView webView, const utf8* html, const utf8* baseUrl, "") \
ITERATOR2(void, wkeLoadHTMLW, wkeWebView webView, const wchar_t* html, "") \
\
ITERATOR2(void, wkeLoadFile, wkeWebView webView, const utf8* filename, "") \
ITERATOR2(void, wkeLoadFileW, wkeWebView webView, const wchar_t* filename, "") \
\
ITERATOR1(const utf8*, wkeGetURL, wkeWebView webView, "") \
ITERATOR2(const utf8*, wkeGetFrameUrl, wkeWebView webView, wkeWebFrameHandle frameId, "") \
\
ITERATOR1(bool, wkeIsLoading, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsLoadingSucceeded, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsLoadingFailed, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsLoadingCompleted, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsDocumentReady, wkeWebView webView, "") \
ITERATOR1(void, wkeStopLoading, wkeWebView webView, "") \
ITERATOR1(void, wkeReload, wkeWebView webView, "") \
ITERATOR2(void, wkeGoToOffset, wkeWebView webView, int offset, "") \
ITERATOR2(void, wkeGoToIndex, wkeWebView webView, int index, "") \
\
ITERATOR1(int, wkeGetWebviewId, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsWebviewAlive, int id, "") \
\
ITERATOR3(const utf8*, wkeGetDocumentCompleteURL, wkeWebView webView, wkeWebFrameHandle frameId, const utf8* partialURL, "") \
\
ITERATOR3(wkeMemBuf*, wkeCreateMemBuf, wkeWebView webView, void* buf, size_t length, "") \
ITERATOR1(void, wkeFreeMemBuf, wkeMemBuf* buf, "") \
\
ITERATOR1(const utf8*, wkeGetTitle, wkeWebView webView, "") \
ITERATOR1(const wchar_t*, wkeGetTitleW, wkeWebView webView, "") \
\
ITERATOR3(void, wkeResize, wkeWebView webView, int w, int h, "") \
ITERATOR1(int, wkeGetWidth, wkeWebView webView, "") \
ITERATOR1(int, wkeGetHeight, wkeWebView webView, "") \
ITERATOR1(int, wkeGetContentWidth, wkeWebView webView, "") \
ITERATOR1(int, wkeGetContentHeight, wkeWebView webView, "") \
\
ITERATOR2(void, wkeSetDirty, wkeWebView webView, bool dirty, "") \
ITERATOR1(bool, wkeIsDirty, wkeWebView webView, "") \
ITERATOR5(void, wkeAddDirtyArea, wkeWebView webView, int x, int y, int w, int h, "") \
ITERATOR1(void, wkeLayoutIfNeeded, wkeWebView webView, "") \
ITERATOR11(void, wkePaint2, wkeWebView webView, void* bits, int bufWid, int bufHei, int xDst, int yDst, int w, int h, int xSrc, int ySrc, bool bCopyAlpha, "") \
ITERATOR3(void, wkePaint, wkeWebView webView, void* bits, int pitch, "") \
ITERATOR1(void, wkeRepaintIfNeeded, wkeWebView webView, "") \
ITERATOR1(HDC, wkeGetViewDC, wkeWebView webView, "") \
ITERATOR1(HWND, wkeGetHostHWND, wkeWebView webView, "") \
\
ITERATOR1(bool, wkeCanGoBack, wkeWebView webView, "") \
ITERATOR1(bool, wkeGoBack, wkeWebView webView, "") \
ITERATOR1(bool, wkeCanGoForward, wkeWebView webView, "") \
ITERATOR1(bool, wkeGoForward, wkeWebView webView, "") \
\
ITERATOR1(void, wkeEditorSelectAll, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorUnSelect, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorCopy, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorCut, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorPaste, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorDelete, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorUndo, wkeWebView webView, "") \
ITERATOR1(void, wkeEditorRedo, wkeWebView webView, "") \
\
ITERATOR1(const wchar_t*, wkeGetCookieW, wkeWebView webView, "") \
ITERATOR1(const utf8*, wkeGetCookie, wkeWebView webView, "") \
ITERATOR3(void, wkeSetCookie, wkeWebView webView, const utf8* url, const utf8* cookie, "cookie格式必须是:Set-cookie: PRODUCTINFO=webxpress; domain=.fidelity.com; path=/; secure") \
ITERATOR3(void, wkeVisitAllCookie, wkeWebView webView, void* params, wkeCookieVisitor visitor, "") \
ITERATOR2(void, wkePerformCookieCommand, wkeWebView webView, wkeCookieCommand command, "") \
ITERATOR2(void, wkeSetCookieEnabled, wkeWebView webView, bool enable, "") \
ITERATOR1(bool, wkeIsCookieEnabled, wkeWebView webView, "") \
ITERATOR2(void, wkeSetCookieJarPath, wkeWebView webView, const WCHAR* path, "") \
ITERATOR2(void, wkeSetCookieJarFullPath, wkeWebView webView, const WCHAR* path, "") \
ITERATOR2(void, wkeSetLocalStorageFullPath, wkeWebView webView, const WCHAR* path, "") \
ITERATOR2(void, wkeAddPluginDirectory, wkeWebView webView, const WCHAR* path, "") \
\
ITERATOR2(void, wkeSetMediaVolume, wkeWebView webView, float volume, "") \
ITERATOR1(float, wkeGetMediaVolume, wkeWebView webView, "") \
\
ITERATOR5(bool, wkeFireMouseEvent, wkeWebView webView, unsigned int message, int x, int y, unsigned int flags, "") \
ITERATOR4(bool, wkeFireContextMenuEvent, wkeWebView webView, int x, int y, unsigned int flags, "") \
ITERATOR5(bool, wkeFireMouseWheelEvent, wkeWebView webView, int x, int y, int delta, unsigned int flags, "") \
ITERATOR4(bool, wkeFireKeyUpEvent, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \
ITERATOR4(bool, wkeFireKeyDownEvent, wkeWebView webView, unsigned int virtualKeyCode, unsigned int flags, bool systemKey, "") \
ITERATOR4(bool, wkeFireKeyPressEvent, wkeWebView webView, unsigned int charCode, unsigned int flags, bool systemKey, "") \
ITERATOR6(bool, wkeFireWindowsMessage, wkeWebView webView, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* result, "") \
\
ITERATOR1(void, wkeSetFocus, wkeWebView webView, "") \
ITERATOR1(void, wkeKillFocus, wkeWebView webView, "") \
\
ITERATOR1(wkeRect, wkeGetCaretRect, wkeWebView webView, "") \
\
ITERATOR2(jsValue, wkeRunJS, wkeWebView webView, const utf8* script, "") \
ITERATOR2(jsValue, wkeRunJSW, wkeWebView webView, const wchar_t* script, "") \
\
ITERATOR1(jsExecState, wkeGlobalExec, wkeWebView webView, "") \
ITERATOR2(jsExecState, wkeGetGlobalExecByFrame, wkeWebView webView, wkeWebFrameHandle frameId, "") \
\
ITERATOR1(void, wkeSleep, wkeWebView webView, "") \
ITERATOR1(void, wkeWake, wkeWebView webView, "") \
ITERATOR1(bool, wkeIsAwake, wkeWebView webView, "") \
\
ITERATOR2(void, wkeSetZoomFactor, wkeWebView webView, float factor, "") \
ITERATOR1(float, wkeGetZoomFactor, wkeWebView webView, "") \
\
ITERATOR2(void, wkeSetEditable, wkeWebView webView, bool editable, "") \
\
ITERATOR1(const utf8*, wkeGetString, const wkeString string, "") \
ITERATOR1(const wchar_t*, wkeGetStringW, const wkeString string, "") \
\
ITERATOR3(void, wkeSetString, wkeString string, const utf8* str, size_t len, "") \
ITERATOR3(void, wkeSetStringW, wkeString string, const wchar_t* str, size_t len, "") \
\
ITERATOR2(wkeString, wkeCreateString, const utf8* str, size_t len, "") \
ITERATOR2(wkeString, wkeCreateStringW, const wchar_t* str, size_t len, "") \
ITERATOR1(void, wkeDeleteString, wkeString str, "") \
\
ITERATOR0(wkeWebView, wkeGetWebViewForCurrentContext, "") \
ITERATOR3(void, wkeSetUserKeyValue, wkeWebView webView, const char* key, void* value, "") \
ITERATOR2(void*, wkeGetUserKeyValue, wkeWebView webView, const char* key, "") \
\
ITERATOR1(int, wkeGetCursorInfoType, wkeWebView webView, "") \
ITERATOR5(void, wkeSetDragFiles, wkeWebView webView, const POINT* clintPos, const POINT* screenPos, wkeString files[], int filesCount, "") \
\
ITERATOR5(void, wkeSetDeviceParameter, wkeWebView webView, const char* device, const char* paramStr, int paramInt, float paramFloat, "") \
ITERATOR1(wkeTempCallbackInfo*, wkeGetTempCallbackInfo, wkeWebView webView, "") \
\
ITERATOR3(void, wkeOnMouseOverUrlChanged, wkeWebView webView, wkeTitleChangedCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnTitleChanged, wkeWebView webView, wkeTitleChangedCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnURLChanged, wkeWebView webView, wkeURLChangedCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnURLChanged2, wkeWebView webView, wkeURLChangedCallback2 callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnPaintUpdated, wkeWebView webView, wkePaintUpdatedCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnPaintBitUpdated, wkeWebView webView, wkePaintBitUpdatedCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnAlertBox, wkeWebView webView, wkeAlertBoxCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnConfirmBox, wkeWebView webView, wkeConfirmBoxCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnPromptBox, wkeWebView webView, wkePromptBoxCallback callback, void* callbackParam, "") \
ITERATOR3(void, wkeOnNavigation, wkeWebView webView, wkeNavigationCallback callback, void* param, "") \