forked from dim-s/soulengine
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ceflib.pas_
10556 lines (9002 loc) · 363 KB
/
ceflib.pas_
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
(*
* Delphi Chromium Embedded
*
* Usage allowed under the restrictions of the Lesser GNU General Public License
* or alternatively the restrictions of the Mozilla Public License 1.1
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.
*
* Unit owner : Henri Gourvest <[email protected]>
* Web site : http://www.progdigy.com
* Repository : http://code.google.com/p/delphichromiumembedded/
* Group : http://groups.google.com/group/delphichromiumembedded
*)
{$IFDEF FPC}
{$MODE DELPHI}{$H+}
{$ENDIF}
unit ceflib;
{$ALIGN ON}
{$MINENUMSIZE 4}
{$I cef.inc}
interface
uses
{$IFDEF DELPHI14_UP}
Rtti, TypInfo, Variants, Generics.Collections,
{$ENDIF}
{$IFDEF CEF_MULTI_THREADED_MESSAGE_LOOP}
Messages,
{$ENDIF}
SysUtils, Classes, SyncObjs
{$IFDEF MSWINDOWS}
, Windows
{$ENDIF}
{$IFNDEF FPC}
{$ENDIF}
;
procedure CeflibFinalization;
var
ChromiumLibHandle: THandle = 0;
type
{$IFDEF UNICODE}
ustring = type string;
rbstring = type RawByteString;
{$ELSE}
{$IFDEF FPC}
{$if declared(unicodestring)}
ustring = type unicodestring;
{$else}
ustring = type WideString;
{$ifend}
{$ELSE}
ustring = type WideString;
{$ENDIF}
rbstring = type AnsiString;
{$ENDIF}
{$if not defined(uint64)}
uint64 = int64;
{$ifend}
TCefWindowHandle = {$IFDEF MACOS}Pointer{$ELSE}HWND{$ENDIF};
TCefCursorHandle = {$IFDEF MACOS}Pointer{$ELSE}HCURSOR{$ENDIF};
// CEF provides functions for converting between UTF-8, -16 and -32 strings.
// CEF string types are safe for reading from multiple threads but not for
// modification. It is the user's responsibility to provide synchronization if
// modifying CEF strings from multiple threads.
// CEF character type definitions. wchat_t is 2 bytes on Windows and 4 bytes on
// most other platforms.
Char16 = WideChar;
PChar16 = PWideChar;
// CEF string type definitions. Whomever allocates |str| is responsible for
// providing an appropriate |dtor| implementation that will free the string in
// the same memory space. When reusing an existing string structure make sure
// to call |dtor| for the old value before assigning new |str| and |dtor|
// values. Static strings will have a NULL |dtor| value. Using the below
// functions if you want this managed for you.
PCefStringWide = ^TCefStringWide;
TCefStringWide = record
str: PWideChar;
length: Cardinal;
dtor: procedure(str: PWideChar); stdcall;
end;
PCefStringUtf8 = ^TCefStringUtf8;
TCefStringUtf8 = record
str: PAnsiChar;
length: Cardinal;
dtor: procedure(str: PAnsiChar); stdcall;
end;
PCefStringUtf16 = ^TCefStringUtf16;
TCefStringUtf16 = record
str: PChar16;
length: Cardinal;
dtor: procedure(str: PChar16); stdcall;
end;
// It is sometimes necessary for the system to allocate string structures with
// the expectation that the user will free them. The userfree types act as a
// hint that the user is responsible for freeing the structure.
PCefStringUserFreeWide = ^TCefStringUserFreeWide;
TCefStringUserFreeWide = type TCefStringWide;
PCefStringUserFreeUtf8 = ^TCefStringUserFreeUtf8;
TCefStringUserFreeUtf8 = type TCefStringUtf8;
PCefStringUserFreeUtf16 = ^TCefStringUserFreeUtf16;
TCefStringUserFreeUtf16 = type TCefStringUtf16;
{$IFDEF CEF_STRING_TYPE_UTF8}
TCefChar = AnsiChar;
PCefChar = PAnsiChar;
TCefStringUserFree = TCefStringUserFreeUtf8;
PCefStringUserFree = PCefStringUserFreeUtf8;
TCefString = TCefStringUtf8;
PCefString = PCefStringUtf8;
{$ENDIF}
{$IFDEF CEF_STRING_TYPE_UTF16}
TCefChar = Char16;
PCefChar = PChar16;
TCefStringUserFree = TCefStringUserFreeUtf16;
PCefStringUserFree = PCefStringUserFreeUtf16;
TCefString = TCefStringUtf16;
PCefString = PCefStringUtf16;
{$ENDIF}
{$IFDEF CEF_STRING_TYPE_WIDE}
TCefChar = WideChar;
PCefChar = PWideChar;
TCefStringUserFree = TCefStringUserFreeWide;
PCefStringUserFree = PCefStringUserFreeWide;
TCefString = TCefStringWide;
PCefString = PCefStringWide;
{$ENDIF}
// CEF strings are NUL-terminated wide character strings prefixed with a size
// value, similar to the Microsoft BSTR type. Use the below API functions for
// allocating, managing and freeing CEF strings.
// CEF string maps are a set of key/value string pairs.
TCefStringMap = Pointer;
// CEF string multimaps are a set of key/value string pairs.
// More than one value can be assigned to a single key.
TCefStringMultimap = Pointer;
// CEF string maps are a set of key/value string pairs.
TCefStringList = Pointer;
// Supported graphics implementations.
TCefGraphicsImplementation = (
{$IFDEF MSWINDOWS}
ANGLE_IN_PROCESS,
ANGLE_IN_PROCESS_COMMAND_BUFFER,
{$ENDIF}
DESKTOP_IN_PROCESS,
DESKTOP_IN_PROCESS_COMMAND_BUFFER
);
// Class representing window information.
PCefWindowInfo = ^TCefWindowInfo;
{$IFDEF MACOS}
TCefWindowInfo = record
m_windowName: TCefString;
m_x: Integer;
m_y: Integer;
m_nWidth: Integer;
m_nHeight: Integer;
m_bHidden: Integer;
// NSView pointer for the parent view.
m_ParentView: TCefWindowHandle;
// NSView pointer for the new browser view.
m_View: TCefWindowHandle;
end;
{$ENDIF}
{$IFDEF MSWINDOWS}
TCefWindowInfo = record
// Standard parameters required by CreateWindowEx()
ExStyle: DWORD;
windowName: TCefString;
Style: DWORD;
x: Integer;
y: Integer;
Width: Integer;
Height: Integer;
WndParent: HWND;
Menu: HMENU;
// If window rendering is disabled no browser window will be created. Set
// |m_hWndParent| to the window that will act as the parent for popup menus,
// dialog boxes, etc.
m_bWindowRenderingDisabled: BOOL;
// Set to true to enable transparent painting.
m_bTransparentPainting: BOOL;
// Handle for the new browser window.
Wnd: HWND ;
end;
{$ENDIF}
// Class representing print context information.
TCefPrintInfo = record
{$IFDEF MSWINDOWS}
DC: HDC;
Rect: TRect;
{$ENDIF}
Scale: double;
end;
// Log severity levels.
TCefLogSeverity = (
LOGSEVERITY_VERBOSE = -1,
LOGSEVERITY_INFO,
LOGSEVERITY_WARNING,
LOGSEVERITY_ERROR,
LOGSEVERITY_ERROR_REPORT,
// Disables logging completely.
LOGSEVERITY_DISABLE = 99
);
// Initialization settings. Specify NULL or 0 to get the recommended default
// values.
PCefSettings = ^TCefSettings;
TCefSettings = record
// Size of this structure.
size: Cardinal;
// Set to true (1) to have the message loop run in a separate thread. If
// false (0) than the CefDoMessageLoopWork() function must be called from
// your application message loop.
multi_threaded_message_loop: Boolean;
// The location where cache data will be stored on disk. If empty an
// in-memory cache will be used. HTML5 databases such as localStorage will
// only persist across sessions if a cache path is specified.
cache_path: TCefString;
// Value that will be returned as the User-Agent HTTP header. If empty the
// default User-Agent string will be used.
user_agent: TCefString;
// Value that will be inserted as the product portion of the default
// User-Agent string. If empty the Chromium product version will be used. If
// |userAgent| is specified this value will be ignored.
product_version: TCefString;
// The locale string that will be passed to WebKit. If empty the default
// locale of "en-US" will be used.
locale: TCefString;
// List of fully qualified paths to plugins (including plugin name) that will
// be loaded in addition to any plugins found in the default search paths.
extra_plugin_paths: TCefStringList;
// The directory and file name to use for the debug log. If empty, the
// default name of "debug.log" will be used and the file will be written
// to the application directory.
log_file: TCefString;
// The log severity. Only messages of this severity level or higher will be
// logged.
log_severity: TCefLogSeverity;
// The graphics implementation that CEF will use for rendering GPU accelerated
// content like WebGL, accelerated layers and 3D CSS.
graphics_implementation: TCefGraphicsImplementation;
// Quota limit for localStorage data across all origins. Default size is 5MB.
local_storage_quota: Cardinal;
// Quota limit for sessionStorage data per namespace. Default size is 5MB.
session_storage_quota: Cardinal;
// Custom flags that will be used when initializing the V8 JavaScript engine.
// The consequences of using custom flags may not be well tested.
javascript_flags: TCefString;
{$IFDEF MSWINDOWS}
// Set to true (1) to use the system proxy resolver on Windows when
// "Automatically detect settings" is checked. This setting is disabled
// by default for performance reasons.
auto_detect_proxy_settings_enabled: Boolean;
{$ENDIF}
end;
// Browser initialization settings. Specify NULL or 0 to get the recommended
// default values. The consequences of using custom values may not be well
// tested.
PCefBrowserSettings = ^TCefBrowserSettings;
TCefBrowserSettings = record
// Size of this structure.
size: Cardinal;
// Disable drag & drop of URLs from other windows.
drag_drop_disabled: Boolean;
// Disable default navigation resulting from drag & drop of URLs.
load_drops_disabled: Boolean;
// The below values map to WebPreferences settings.
// Font settings.
standard_font_family: TCefString;
fixed_font_family: TCefString;
serif_font_family: TCefString;
sans_serif_font_family: TCefString;
cursive_font_family: TCefString;
fantasy_font_family: TCefString;
default_font_size: Integer;
default_fixed_font_size: Integer;
minimum_font_size: Integer;
minimum_logical_font_size: Integer;
// Set to true (1) to disable loading of fonts from remote sources.
remote_fonts_disabled: Boolean;
// Default encoding for Web content. If empty "ISO-8859-1" will be used.
default_encoding: TCefString;
// Set to true (1) to attempt automatic detection of content encoding.
encoding_detector_enabled: Boolean;
// Set to true (1) to disable JavaScript.
javascript_disabled: Boolean;
// Set to true (1) to disallow JavaScript from opening windows.
javascript_open_windows_disallowed: Boolean;
// Set to true (1) to disallow JavaScript from closing windows.
javascript_close_windows_disallowed: Boolean;
// Set to true (1) to disallow JavaScript from accessing the clipboard.
javascript_access_clipboard_disallowed: Boolean;
// Set to true (1) to disable DOM pasting in the editor. DOM pasting also
// depends on |javascript_cannot_access_clipboard| being false (0).
dom_paste_disabled: Boolean;
// Set to true (1) to enable drawing of the caret position.
caret_browsing_enabled: Boolean;
// Set to true (1) to disable Java.
java_disabled: Boolean;
// Set to true (1) to disable plugins.
plugins_disabled: Boolean;
// Set to true (1) to allow access to all URLs from file URLs.
universal_access_from_file_urls_allowed: Boolean;
// Set to true (1) to allow access to file URLs from other file URLs.
file_access_from_file_urls_allowed: Boolean;
// Set to true (1) to allow risky security behavior such as cross-site
// scripting (XSS). Use with extreme care.
web_security_disabled: Boolean;
// Set to true (1) to enable console warnings about XSS attempts.
xss_auditor_enabled: Boolean;
// Set to true (1) to suppress the network load of image URLs. A cached
// image will still be rendered if requested.
image_load_disabled: Boolean;
// Set to true (1) to shrink standalone images to fit the page.
shrink_standalone_images_to_fit: Boolean;
// Set to true (1) to disable browser backwards compatibility features.
site_specific_quirks_disabled: Boolean;
// Set to true (1) to disable resize of text areas.
text_area_resize_disabled: Boolean;
// Set to true (1) to disable use of the page cache.
page_cache_disabled: Boolean;
// Set to true (1) to not have the tab key advance focus to links.
tab_to_links_disabled: Boolean;
// Set to true (1) to disable hyperlink pings (<a ping> and window.sendPing).
hyperlink_auditing_disabled: Boolean;
// Set to true (1) to enable the user style sheet for all pages.
// |user_style_sheet_location| must be set to the style sheet URL.
user_style_sheet_enabled: Boolean;
user_style_sheet_location: TCefString;
// Set to true (1) to disable style sheets.
author_and_user_styles_disabled: Boolean;
// Set to true (1) to disable local storage.
local_storage_disabled: Boolean;
// Set to true (1) to disable databases.
databases_disabled: Boolean;
// Set to true (1) to disable application cache.
application_cache_disabled: Boolean;
// Set to true (1) to disable WebGL.
webgl_disabled: Boolean;
// Set to true (1) to enable accelerated compositing. This is turned off by
// default because the current in-process GPU implementation does not
// support it correctly.
accelerated_compositing_enabled: Boolean;
// Set to true (1) to enable threaded compositing. This is currently only
// supported by the command buffer graphics implementation.
threaded_compositing_enabled: Boolean;
// Set to true (1) to disable accelerated layers. This affects features like
// 3D CSS transforms.
accelerated_layers_disabled: Boolean;
// Set to true (1) to disable accelerated 2d canvas.
accelerated_2d_canvas_disabled: Boolean;
// Set to true (1) to disable developer tools (WebKit inspector).
developer_tools_disabled: Boolean;
end;
// URL component parts.
PCefUrlParts = ^TCefUrlParts;
TCefUrlParts = record
// The complete URL specification.
spec: TCefString;
// Scheme component not including the colon (e.g., "http").
scheme: TCefString;
// User name component.
username: TCefString;
// Password component.
password: TCefString;
// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
// surrounded by square brackets (e.g., "[2001:db8::1]").
host: TCefString;
// Port number component.
port: TCefString;
// Path component including the first slash following the host.
path: TCefString;
// Query string component (i.e., everything following the '?').
query: TCefString;
end;
// Time information. Values should always be in UTC.
PCefTime = ^TCefTime;
TCefTime = record
year: Integer; // Four digit year "2007"
month: Integer; // 1-based month (values 1 = January, etc.)
day_of_week: Integer; // 0-based day of week (0 = Sunday, etc.)
day_of_month: Integer; // 1-based day of month (1-31)
hour: Integer; // Hour within the current day (0-23)
minute: Integer; // Minute within the current hour (0-59)
second: Integer; // Second within the current minute (0-59 plus leap
// seconds which may take it up to 60).
millisecond: Integer; // Milliseconds within the current second (0-999)
end;
// Cookie information.
TCefCookie = record
// The cookie name.
name: TCefString;
// The cookie value.
value: TCefString;
// If |domain| is empty a host cookie will be created instead of a domain
// cookie. Domain cookies are stored with a leading "." and are visible to
// sub-domains whereas host cookies are not.
domain: TCefString;
// If |path| is non-empty only URLs at or below the path will get the cookie
// value.
path: TCefString;
// If |secure| is true the cookie will only be sent for HTTPS requests.
secure: Boolean;
// If |httponly| is true the cookie will only be sent for HTTP requests.
httponly: Boolean;
// The cookie creation date. This is automatically populated by the system on
// cookie creation.
creation: TCefTime;
// The cookie last access date. This is automatically populated by the system
// on access.
last_access: TCefTime;
// The cookie expiration date is only valid if |has_expires| is true.
has_expires: Boolean;
expires: TCefTime;
end;
// Storage types.
TCefStorageType = (
ST_LOCALSTORAGE = 0,
ST_SESSIONSTORAGE
);
// Mouse button types.
TCefMouseButtonType = (
MBT_LEFT = 0,
MBT_MIDDLE,
MBT_RIGHT
);
// Key types.
TCefKeyType = (
KT_KEYUP = 0,
KT_KEYDOWN,
KT_CHAR
);
// Various browser navigation types supported by chrome.
TCefHandlerNavtype = (
NAVTYPE_LINKCLICKED = 0,
NAVTYPE_FORMSUBMITTED,
NAVTYPE_BACKFORWARD,
NAVTYPE_RELOAD,
NAVTYPE_FORMRESUBMITTED,
NAVTYPE_OTHER,
NAVTYPE_LINKDROPPED
);
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
TCefHandlerErrorcode = Integer;
const
ERR_FAILED = -2;
ERR_ABORTED = -3;
ERR_INVALID_ARGUMENT = -4;
ERR_INVALID_HANDLE = -5;
ERR_FILE_NOT_FOUND = -6;
ERR_TIMED_OUT = -7;
ERR_FILE_TOO_BIG = -8;
ERR_UNEXPECTED = -9;
ERR_ACCESS_DENIED = -10;
ERR_NOT_IMPLEMENTED = -11;
ERR_CONNECTION_CLOSED = -100;
ERR_CONNECTION_RESET = -101;
ERR_CONNECTION_REFUSED = -102;
ERR_CONNECTION_ABORTED = -103;
ERR_CONNECTION_FAILED = -104;
ERR_NAME_NOT_RESOLVED = -105;
ERR_INTERNET_DISCONNECTED = -106;
ERR_SSL_PROTOCOL_ERROR = -107;
ERR_ADDRESS_INVALID = -108;
ERR_ADDRESS_UNREACHABLE = -109;
ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110;
ERR_TUNNEL_CONNECTION_FAILED = -111;
ERR_NO_SSL_VERSIONS_ENABLED = -112;
ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113;
ERR_SSL_RENEGOTIATION_REQUESTED = -114;
ERR_CERT_COMMON_NAME_INVALID = -200;
ERR_CERT_DATE_INVALID = -201;
ERR_CERT_AUTHORITY_INVALID = -202;
ERR_CERT_CONTAINS_ERRORS = -203;
ERR_CERT_NO_REVOCATION_MECHANISM = -204;
ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205;
ERR_CERT_REVOKED = -206;
ERR_CERT_INVALID = -207;
ERR_CERT_END = -208;
ERR_INVALID_URL = -300;
ERR_DISALLOWED_URL_SCHEME = -301;
ERR_UNKNOWN_URL_SCHEME = -302;
ERR_TOO_MANY_REDIRECTS = -310;
ERR_UNSAFE_REDIRECT = -311;
ERR_UNSAFE_PORT = -312;
ERR_INVALID_RESPONSE = -320;
ERR_INVALID_CHUNKED_ENCODING = -321;
ERR_METHOD_NOT_SUPPORTED = -322;
ERR_UNEXPECTED_PROXY_AUTH = -323;
ERR_EMPTY_RESPONSE = -324;
ERR_RESPONSE_HEADERS_TOO_BIG = -325;
ERR_CACHE_MISS = -400;
ERR_INSECURE_RESPONSE = -501;
type
// "Verb" of a drag-and-drop operation as negotiated between the source and
// destination. These constants match their equivalents in WebCore's
// DragActions.h and should not be renumbered.
TCefDragOperations = Integer;
const
DRAG_OPERATION_NONE = 0;
DRAG_OPERATION_COPY = 1;
DRAG_OPERATION_LINK = 2;
DRAG_OPERATION_GENERIC = 4;
DRAG_OPERATION_PRIVATE = 8;
DRAG_OPERATION_MOVE = 16;
DRAG_OPERATION_DELETE = 32;
DRAG_OPERATION_EVERY = $FFFFFFFF;
type
// V8 access control values.
TCefV8AccessControls = Integer;
const
V8_ACCESS_CONTROL_DEFAULT = 0;
V8_ACCESS_CONTROL_ALL_CAN_READ = 1;
V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 shl 1;
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 shl 2;
type
// V8 property attribute values.
TCefV8PropertyAttributes = Integer;
const
V8_PROPERTY_ATTRIBUTE_NONE = 0; // Writeable, Enumerable, Configurable
V8_PROPERTY_ATTRIBUTE_READONLY = 1 shl 0; // Not writeable
V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 shl 1; // Not enumerable
V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 shl 2; // Not configurable
type
// Structure representing menu information.
TCefHandlerMenuInfo = record
// Values from the cef_handler_menutypebits_t enumeration.
typeFlags: Integer;
// If window rendering is enabled |x| and |y| will be in screen coordinates.
// Otherwise, |x| and |y| will be in view coordinates.
x: Integer;
y: Integer;
linkUrl: TCefString;
imageUrl: TCefString;
pageUrl: TCefString;
frameUrl: TCefString;
selectionText: TCefString;
misspelledWord: TCefString;
// Values from the cef_handler_menucapabilitybits_t enumeration
editFlags: Integer;
securityInfo: TCefString;
end;
// The TCefHandlerMenuInfo typeFlags value will be a combination of the
// following values.
TCefHandlerMenuTypeBits = Integer;
const
// No node is selected
MENUTYPE_NONE = $0;
// The top page is selected
MENUTYPE_PAGE = $1;
// A subframe page is selected
MENUTYPE_FRAME = $2;
// A link is selected
MENUTYPE_LINK = $4;
// An image is selected
MENUTYPE_IMAGE = $8;
// There is a textual or mixed selection that is selected
MENUTYPE_SELECTION = $10;
// An editable element is selected
MENUTYPE_EDITABLE = $20;
// A misspelled word is selected
MENUTYPE_MISSPELLED_WORD = $40;
// A video node is selected
MENUTYPE_VIDEO = $80;
// A video node is selected
MENUTYPE_AUDIO = $100;
type
// The TCefHandlerMenuInfo editFlags value will be a combination of the
// following values.
TCefHandlerMenuCapabilityBits = Integer;
const
// Values from WebContextMenuData::EditFlags in WebContextMenuData.h
MENU_CAN_DO_NONE = $0;
MENU_CAN_UNDO = $1;
MENU_CAN_REDO = $2;
MENU_CAN_CUT = $4;
MENU_CAN_COPY = $8;
MENU_CAN_PASTE = $10;
MENU_CAN_DELETE = $20;
MENU_CAN_SELECT_ALL = $40;
MENU_CAN_TRANSLATE = $80;
// Values unique to CEF
MENU_CAN_GO_FORWARD = $10000000;
MENU_CAN_GO_BACK = $20000000;
type
// Supported menu ID values.
TCefHandlerMenuId = (
MENU_ID_NAV_BACK = 10,
MENU_ID_NAV_FORWARD = 11,
MENU_ID_NAV_RELOAD = 12,
MENU_ID_NAV_RELOAD_NOCACHE = 13,
MENU_ID_NAV_STOP = 14,
MENU_ID_UNDO = 20,
MENU_ID_REDO = 21,
MENU_ID_CUT = 22,
MENU_ID_COPY = 23,
MENU_ID_PASTE = 24,
MENU_ID_DELETE = 25,
MENU_ID_SELECTALL = 26,
MENU_ID_PRINT = 30,
MENU_ID_VIEWSOURCE = 31
);
TCefPaintElementType = (
PET_VIEW = 0,
PET_POPUP
);
// Post data elements may represent either bytes or files.
TCefPostDataElementType = (
PDE_TYPE_EMPTY = 0,
PDE_TYPE_BYTES,
PDE_TYPE_FILE
);
type
TCefWebUrlRequestFlags = Integer;
const
WUR_FLAG_NONE = 0;
WUR_FLAG_SKIP_CACHE = $1;
WUR_FLAG_ALLOW_CACHED_CREDENTIALS = $2;
WUR_FLAG_ALLOW_COOKIES = $4;
WUR_FLAG_REPORT_UPLOAD_PROGRESS = $8;
WUR_FLAG_REPORT_LOAD_TIMING = $10;
WUR_FLAG_REPORT_RAW_HEADERS = $20;
type
TCefWebUrlRequestState = (
WUR_STATE_UNSENT = 0,
WUR_STATE_STARTED = 1,
WUR_STATE_HEADERS_RECEIVED = 2,
WUR_STATE_LOADING = 3,
WUR_STATE_DONE = 4,
WUR_STATE_ERROR = 5,
WUR_STATE_ABORT = 6
);
// Focus sources.
TCefHandlerFocusSource = (
// The source is explicit navigation via the API (LoadURL(), etc).
FOCUS_SOURCE_NAVIGATION = 0,
// The source is a system-generated focus event.
FOCUS_SOURCE_SYSTEM,
// The source is a child widget of the browser window requesting focus.
FOCUS_SOURCE_WIDGET
);
// Key event types.
TCefHandlerKeyEventType = (
KEYEVENT_RAWKEYDOWN = 0,
KEYEVENT_KEYDOWN,
KEYEVENT_KEYUP,
KEYEVENT_CHAR
);
// Key event modifiers.
TCefHandlerKeyEventModifiers = Integer;
const
KEY_SHIFT = 1 shl 0;
KEY_CTRL = 1 shl 1;
KEY_ALT = 1 shl 2;
KEY_META = 1 shl 3;
type
// Structure representing a rectangle.
PCefRect = ^TCefRect;
TCefRect = record
x: Integer;
y: Integer;
width: Integer;
height: Integer;
end;
// Existing thread IDs.
TCefThreadId = (
TID_UI = 0,
TID_IO = 1,
TID_FILE = 2
);
// Paper type for printing.
TCefPaperType = (
PT_LETTER = 0,
PT_LEGAL,
PT_EXECUTIVE,
PT_A3,
PT_A4,
PT_CUSTOM
);
// Paper metric information for printing.
TCefPaperMetrics = record
paper_type: TCefPaperType;
//Length and width needed if paper_type is custom_size
//Units are in inches.
length: Double;
width: Double;
end;
// Paper print margins.
TCefPrintMargins = record
//Margin size in inches for left/right/top/bottom (this is content margins).
left: Double;
right: Double;
top: Double;
bottom: Double;
//Margin size (top/bottom) in inches for header/footer.
header: Double;
footer: Double;
end;
// Page orientation for printing
TCefPageOrientation = (
PORTRAIT = 0,
LANDSCAPE
);
// Printing options.
PCefPrintOptions = ^TCefPrintOptions;
TCefPrintOptions = record
page_orientation: TCefPageOrientation;
paper_metrics: TCefPaperMetrics;
paper_margins: TCefPrintMargins;
end;
// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
// UTF16 (LE and BE) by default. All other types must be translated to UTF8
// before being passed to the parser. If a BOM is detected and the correct
// decoder is available then that decoder will be used automatically.
TCefXmlEncodingType = (
XML_ENCODING_NONE = 0,
XML_ENCODING_UTF8,
XML_ENCODING_UTF16LE,
XML_ENCODING_UTF16BE,
XML_ENCODING_ASCII
);
// XML node types.
TCefXmlNodeType = (
XML_NODE_UNSUPPORTED = 0,
XML_NODE_PROCESSING_INSTRUCTION,
XML_NODE_DOCUMENT_TYPE,
XML_NODE_ELEMENT_START,
XML_NODE_ELEMENT_END,
XML_NODE_ATTRIBUTE,
XML_NODE_TEXT,
XML_NODE_CDATA,
XML_NODE_ENTITY_REFERENCE,
XML_NODE_WHITESPACE,
XML_NODE_COMMENT
);
// Status message types.
TCefHandlerStatusType = (
STATUSTYPE_TEXT = 0,
STATUSTYPE_MOUSEOVER_URL,
STATUSTYPE_KEYBOARD_FOCUS_URL
);
// Popup window features.
PCefPopupFeatures = ^TCefPopupFeatures;
TCefPopupFeatures = record
x: Integer;
xSet: Boolean;
y: Integer;
ySet: Boolean;
width: Integer;
widthSet: Boolean;
height: Integer;
heightSet: Boolean;
menuBarVisible: Boolean;
statusBarVisible: Boolean;
toolBarVisible: Boolean;
locationBarVisible: Boolean;
scrollbarsVisible: Boolean;
resizable: Boolean;
fullscreen: Boolean;
dialog: Boolean;
additionalFeatures: TCefStringList;
end;
// DOM document types.
TCefDomDocumentType = (
DOM_DOCUMENT_TYPE_UNKNOWN = 0,
DOM_DOCUMENT_TYPE_HTML,
DOM_DOCUMENT_TYPE_XHTML,
DOM_DOCUMENT_TYPE_PLUGIN
);
// DOM event category flags.
TCefDomEventCategory = Integer;
const
DOM_EVENT_CATEGORY_UNKNOWN = $0;
DOM_EVENT_CATEGORY_UI = $1;
DOM_EVENT_CATEGORY_MOUSE = $2;
DOM_EVENT_CATEGORY_MUTATION = $4;
DOM_EVENT_CATEGORY_KEYBOARD = $8;
DOM_EVENT_CATEGORY_TEXT = $10;
DOM_EVENT_CATEGORY_COMPOSITION = $20;
DOM_EVENT_CATEGORY_DRAG = $40;
DOM_EVENT_CATEGORY_CLIPBOARD = $80;
DOM_EVENT_CATEGORY_MESSAGE = $100;
DOM_EVENT_CATEGORY_WHEEL = $200;
DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = $400;
DOM_EVENT_CATEGORY_OVERFLOW = $800;
DOM_EVENT_CATEGORY_PAGE_TRANSITION = $1000;
DOM_EVENT_CATEGORY_POPSTATE = $2000;
DOM_EVENT_CATEGORY_PROGRESS = $4000;
DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = $8000;
DOM_EVENT_CATEGORY_WEBKIT_ANIMATION = $10000;
DOM_EVENT_CATEGORY_WEBKIT_TRANSITION = $20000;
DOM_EVENT_CATEGORY_BEFORE_LOAD = $40000;
type
// DOM event processing phases.
TCefDomEventPhase = (
DOM_EVENT_PHASE_UNKNOWN = 0,
DOM_EVENT_PHASE_CAPTURING,
DOM_EVENT_PHASE_AT_TARGET,
DOM_EVENT_PHASE_BUBBLING
);
// DOM node types.
TCefDomNodeType = (
DOM_NODE_TYPE_UNSUPPORTED = 0,
DOM_NODE_TYPE_ELEMENT,
DOM_NODE_TYPE_ATTRIBUTE,
DOM_NODE_TYPE_TEXT,
DOM_NODE_TYPE_CDATA_SECTION,
DOM_NODE_TYPE_ENTITY_REFERENCE,
DOM_NODE_TYPE_ENTITY,
DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS,
DOM_NODE_TYPE_COMMENT,
DOM_NODE_TYPE_DOCUMENT,
DOM_NODE_TYPE_DOCUMENT_TYPE,
DOM_NODE_TYPE_DOCUMENT_FRAGMENT,
DOM_NODE_TYPE_NOTATION,
DOM_NODE_TYPE_XPATH_NAMESPACE
);
(*******************************************************************************
capi
*******************************************************************************)
type
PCefv8Handler = ^TCefv8Handler;
PCefV8Accessor = ^TCefV8Accessor;
PCefv8Value = ^TCefv8Value;
PCefV8ValueArray = array[0..(High(Integer) div SizeOf(Integer)) - 1] of PCefV8Value;
PPCefV8Value = ^PCefV8ValueArray;
PCefSchemeHandlerFactory = ^TCefSchemeHandlerFactory;
PCefSchemeHandlerCallback = ^TCefSchemeHandlerCallback;
// PCefHandler = ^TCefHandler;
PCefFrame = ^TCefFrame;
PCefRequest = ^TCefRequest;
PCefStreamReader = ^TCefStreamReader;
PCefHandlerMenuInfo = ^TCefHandlerMenuInfo;
PCefPrintInfo = ^TCefPrintInfo;
PCefPostData = ^TCefPostData;
PCefPostDataElement = ^TCefPostDataElement;
PCefReadHandler = ^TCefReadHandler;
PCefWriteHandler = ^TCefWriteHandler;
PCefStreamWriter = ^TCefStreamWriter;
PCefSchemeHandler = ^TCefSchemeHandler;
PCefBase = ^TCefBase;
PCefBrowser = ^TCefBrowser;
PCefTask = ^TCefTask;
PCefDownloadHandler = ^TCefDownloadHandler;
PCefXmlReader = ^TCefXmlReader;
PCefZipReader = ^TCefZipReader;
PCefDomVisitor = ^TCefDomVisitor;
PCefDomDocument = ^TCefDomDocument;
PCefDomNode = ^TCefDomNode;
PCefDomEventListener = ^TCefDomEventListener;