forked from dliw/fpCEF3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcef3types.pas
1440 lines (1211 loc) · 49.2 KB
/
cef3types.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
(*
* Free Pascal Chromium Embedded 3
*
* 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.
*
* Author: d.l.i.w <dev.dliw@gmail.com>
* Repository: http://github.com/dliw/fpCEF3
*
*
* Based on 'Delphi Chromium Embedded' by: Henri Gourvest <hgourvest@gmail.com>
* Repository : http://code.google.com/p/delphichromiumembedded/
*
* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.
*
*)
Unit cef3types;
{$MODE objfpc}{$H+}
{$I cef.inc}
Interface
Uses
{$IFDEF WINDOWS}Windows,{$ENDIF}
ctypes;
Type
ustring = WideString;
rbstring = AnsiString;
TUrlParts = record
spec: ustring;
scheme: ustring;
username: ustring;
password: ustring;
host: ustring;
port: ustring;
path: ustring;
query: ustring;
end;
PSize = ^TSize;
TSize = csize_t;
{ *** cef_string_types.h *** }
// 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: csize_t;
dtor: procedure(str: PWideChar); cconv;
end;
PCefStringUtf8 = ^TCefStringUtf8;
TCefStringUtf8 = record
str: PAnsiChar;
length: csize_t;
dtor: procedure(str: PAnsiChar); cconv;
end;
PCefStringUtf16 = ^TCefStringUtf16;
TCefStringUtf16 = record
str: PChar16;
length: csize_t;
dtor: procedure(str: PChar16); cconv;
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;
{ *** cef_string.h *** }
(*
{$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_string_list.h *** }
// CEF string maps are a set of key/value string pairs.
TCefStringList = Pointer;
{ *** cef_string_map.h *** }
// CEF string maps are a set of key/value string pairs.
TCefStringMap = Pointer;
{ *** cef_string_multimap.h *** }
// CEF string multimaps are a set of key/value string pairs.
// More than one value can be assigned to a single key.
TCefStringMultimap = Pointer;
{ *** platform specific types *** }
TCefWindowHandle = {$IFDEF WINDOWS}HWND {$ELSE}Pointer {PGtkWidget}{$ENDIF};
TCefCursorHandle = {$IFDEF WINDOWS}HCURSOR{$ELSE}Pointer {PGdkCursor}{$ENDIF};
TCefEventHandle = {$IFDEF WINDOWS}PMSG {$ELSE}Pointer {PGdkEvent}{$ENDIF};
TCefTextInputContext = Pointer;
// Structure representing CefExecuteProcess arguments.
PCefMainArgs = ^TCefMainArgs;
TCefMainArgs = record
{$IFDEF WINDOWS}
instance : HINST;
{$ELSE}
argc : Integer;
argv : PPChar;
{$ENDIF}
end;
// Structure representing window information.
PCefWindowInfo = ^TCefWindowInfo;
TCefWindowInfo = record
{$IFDEF WINDOWS}
// Standard parameters required by CreateWindowEx()
ex_style : DWORD;
window_name : TCefString;
style : DWORD;
x, y, width, height : Integer;
parent_window : TCefWindowHandle;
menu : HMENU;
// If window rendering is disabled no browser window will be created. Set
// |parent_window| to be used for identifying monitor info
// (MonitorFromWindow). If |parent_window| is not provided the main screen
// monitor will be used.
window_rendering_disabled : BOOL;
// Set to true to enable transparent painting.
// If window rendering is disabled and |transparent_painting| is set to true
// WebKit rendering will draw on a transparent background (RGBA=0x00000000).
// When this value is false the background will be white and opaque.
transparent_painting : BOOL;
// Handle for the new browser window.
window : TCefWindowHandle;
{$ENDIF}
{$IFDEF LINUX}
// Pointer for the parent GtkBox widget.
parent_widget : TCefWindowHandle;
// If window rendering is disabled no browser window will be created. Set
// |parent_widget| to the window that will act as the parent for popup menus,
// dialog boxes, etc.
window_rendering_disabled : Boolean;
// Set to true to enable transparent painting.
transparent_painting : Boolean;
// Pointer for the new browser widget.
widget : TCefWindowHandle;
{$ENDIF}
{$IFDEF MACOS}
window_name : TCefString;
x, y, width, height, hidden : Integer;
// NSView pointer for the parent view.
parent_view : TCefWindowHandle;
// If window rendering is disabled no browser window will be created. Set
// |parent_view| to the window that will act as the parent for popup menus,
// dialog boxes, etc.
window_rendering_disabled : Boolean;
// Set to true to enable transparent painting.
transparent_painting : Boolean;
// NSView pointer for the new browser view.
view : TCefWindowHandle;
{$ENDIF}
end;
{ *** cef_time.h *** }
// 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;
{ *** cef_types.h *** }
// 32-bit ARGB color value, not premultiplied. The color components are always
// in a known order. Equivalent to the SkColor type.
TCefColor = UInt32;
{ TODO
// Return the alpha byte from a cef_color_t value.
#define CefColorGetA(color) (((color) >> 24) & 0xFF)
// Return the red byte from a cef_color_t value.
#define CefColorGetR(color) (((color) >> 16) & 0xFF)
// Return the green byte from a cef_color_t value.
#define CefColorGetG(color) (((color) >> 8) & 0xFF)
// Return the blue byte from a cef_color_t value.
#define CefColorGetB(color) (((color) >> 0) & 0xFF)
// Return an cef_color_t value with the specified byte component values.
#define CefColorSetARGB(a, r, g, b) static_cast<cef_color_t>(\
(static_cast<unsigned>(a) << 24) | \
(static_cast<unsigned>(r) << 16) | \
(static_cast<unsigned>(g) << 8) | \
(static_cast<unsigned>(b) << 0))
}
// Log severity levels.
TCefLogSeverity = (
// Default logging (currently INFO logging).
LOGSEVERITY_DEFAULT,
// Verbose logging.
LOGSEVERITY_VERBOSE,
// INFO logging.
LOGSEVERITY_INFO,
// WARNING logging.
LOGSEVERITY_WARNING,
// ERROR logging.
LOGSEVERITY_ERROR,
// ERROR_REPORT logging.
LOGSEVERITY_ERROR_REPORT,
// Disables logging completely.
LOGSEVERITY_DISABLE = 99
);
// Represents the state of a setting.
TCefState = (
// Use the default state for the setting.
STATE_DEFAULT = 0,
// Enable or allow the setting.
STATE_ENABLED,
// Disable or disallow the setting.
STATE_DISABLED
);
// Initialization settings. Specify NULL or 0 to get the recommended default
// values. Many of these and other settings can also configured using command-
// line switches.
PCefSettings = ^TCefSettings;
TCefSettings = record
// Size of this structure.
size: csize_t;
// Set to true (1) to use a single process for the browser and renderer. This
// run mode is not officially supported by Chromium and is less stable than
// the multi-process default. Also configurable using the "single-process"
// command-line switch.
single_process: Boolean;
// The path to a separate executable that will be launched for sub-processes.
// By default the browser process executable is used. See the comments on
// CefExecuteProcess() for details. Also configurable using the
// "browser-subprocess-path" command-line switch.
browser_subprocess_path: TCefString;
// Set to true (1) to have the browser process 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;
// Set to true (1) to disable configuration of browser process features using
// standard CEF and Chromium command-line arguments. Configuration can still
// be specified using CEF data structures or via the
// CefApp::OnBeforeCommandLineProcessing() method.
command_line_args_disabled: Boolean;
// The location where cache data will be stored on disk. If empty an in-memory
// cache will be used for some features and a temporary disk cache for others.
// HTML5 databases such as localStorage will only persist across sessions if a
// cache path is specified.
cache_path: TCefString;
// To persist session cookies (cookies without an expiry date or validity
// interval) by default when using the global cookie manager set this value to
// true. Session cookies are generally intended to be transient and most Web
// browsers do not persist them. A |cache_path| value must also be specified to
// enable this feature. Also configurable using the "persist-session-cookies"
// command-line switch.
persist_session_cookies: Boolean;
// Value that will be returned as the User-Agent HTTP header. If empty the
// default User-Agent string will be used. Also configurable using the
// "user-agent" command-line switch.
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. Also configurable
// using the "product-version" command-line switch.
product_version: TCefString;
// The locale string that will be passed to WebKit. If empty the default
// locale of "en-US" will be used. This value is ignored on Linux where locale
// is determined using environment variable parsing with the precedence order:
// LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang"
// command-line switch.
locale: TCefString;
// 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. Also configurable using the "log-file"
// command-line switch.
log_file: TCefString;
// The log severity. Only messages of this severity level or higher will be
// logged.
log_severity: TCefLogSeverity;
// Enable DCHECK in release mode to ease debugging. Also configurable using the
// "enable-release-dcheck" command-line switch.
release_dcheck_enabled: Boolean;
// Custom flags that will be used when initializing the V8 JavaScript engine.
// The consequences of using custom flags may not be well tested. Also
// configurable using the "js-flags" command-line switch.
javascript_flags: TCefString;
// The fully qualified path for the resources directory. If this value is
// empty the cef.pak and/or devtools_resources.pak files must be located in
// the module directory on Windows/Linux or the app bundle Resources directory
// on Mac OS X. Also configurable using the "resources-dir-path" command-line
// switch.
resources_dir_path: TCefString;
// The fully qualified path for the locales directory. If this value is empty
// the locales directory must be located in the module directory. This value
// is ignored on Mac OS X where pack files are always loaded from the app
// bundle Resources directory. Also configurable using the "locales-dir-path"
// command-line switch.
locales_dir_path: TCefString;
// Set to true (1) to disable loading of pack files for resources and locales.
// A resource bundle handler must be provided for the browser and render
// processes via CefApp::GetResourceBundleHandler() if loading of pack files
// is disabled. Also configurable using the "disable-pack-loading" command-
// line switch.
pack_loading_disabled: Boolean;
// Set to a value between 1024 and 65535 to enable remote debugging on the
// specified port. For example, if 8080 is specified the remote debugging URL
// will be http://localhost:8080. CEF can be remotely debugged from any CEF or
// Chrome browser window. Also configurable using the "remote-debugging-port"
// command-line switch.
remote_debugging_port: Integer;
// The number of stack trace frames to capture for uncaught exceptions.
// Specify a positive value to enable the CefV8ContextHandler::
// OnUncaughtException() callback. Specify 0 (default value) and
// OnUncaughtException() will not be called. Also configurable using the
// "uncaught-exception-stack-size" command-line switch.
uncaught_exception_stack_size: Integer;
// By default CEF V8 references will be invalidated (the IsValid() method will
// return false) after the owning context has been released. This reduces the
// need for external record keeping and avoids crashes due to the use of V8
// references after the associated context has been released.
//
// CEF currently offers two context safety implementations with different
// performance characteristics. The default implementation (value of 0) uses a
// map of hash values and should provide better performance in situations with
// a small number contexts. The alternate implementation (value of 1) uses a
// hidden value attached to each context and should provide better performance
// in situations with a large number of contexts.
//
// If you need better performance in the creation of V8 references and you
// plan to manually track context lifespan you can disable context safety by
// specifying a value of -1.
//
// Also configurable using the "context-safety-implementation" command-line
// switch.
context_safety_implementation: Integer;
// Set to true (1) to ignore errors related to invalid SSL certificates.
// Enabling this setting can lead to potential security vulnerabilities like
// "man in the middle" attacks. Applications that load content from the
// internet should not enable this setting. Also configurable using the
// "ignore-certificate-errors" command-line switch.
ignore_certificate_error: Boolean;
// Used on Mac OS X to specify the background color for hardware accelerated
// content.
background_color: TCefColor;
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. Many of these and other settings can also configured using command-
// line switches.
PCefBrowserSettings = ^TCefBrowserSettings;
TCefBrowserSettings = record
// Size of this structure.
size: csize_t;
// 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;
// Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
// configurable using the "default-encoding" command-line switch.
default_encoding: TCefString;
// Location of the user style sheet that will be used for all pages. This must
// be a data URL of the form "data:text/css;charset=utf-8;base64,csscontent"
// where "csscontent" is the base64 encoded contents of the CSS file. Also
// configurable using the "user-style-sheet-location" command-line switch.
user_style_sheet_location: TCefString;
// Controls the loading of fonts from remote sources. Also configurable using
// the "disable-remote-fonts" command-line switch.
remote_fonts: TCefState;
// Controls whether JavaScript can be executed. Also configurable using the
// "disable-javascript" command-line switch.
javascript: TCefState;
// Controls whether JavaScript can be used for opening windows. Also
// configurable using the "disable-javascript-open-windows" command-line
// switch.
javascript_open_windows: TCefState;
// Controls whether JavaScript can be used to close windows that were not
// opened via JavaScript. JavaScript can still be used to close windows that
// were opened via JavaScript. Also configurable using the
// "disable-javascript-close-windows" command-line switch.
javascript_close_windows: TCefState;
// Controls whether JavaScript can access the clipboard. Also configurable
// using the "disable-javascript-access-clipboard" command-line switch.
javascript_access_clipboard: TCefState;
// Controls whether DOM pasting is supported in the editor via
// execCommand("paste"). The |javascript_access_clipboard| setting must also
// be enabled. Also configurable using the "disable-javascript-dom-paste"
// command-line switch.
javascript_dom_paste: TCefState;
// Controls whether the caret position will be drawn. Also configurable using
// the "enable-caret-browsing" command-line switch.
caret_browsing: TCefState;
// Controls whether the Java plugin will be loaded. Also configurable using
// the "disable-java" command-line switch.
java: TCefState;
// Controls whether any plugins will be loaded. Also configurable using the
// "disable-plugins" command-line switch.
plugins: TCefState;
// Controls whether file URLs will have access to all URLs. Also configurable
// using the "allow-universal-access-from-files" command-line switch.
universal_access_from_file_urls: TCefState;
// Controls whether file URLs will have access to other file URLs. Also
// configurable using the "allow-access-from-files" command-line switch.
file_access_from_file_urls: TCefState;
// Controls whether web security restrictions (same-origin policy) will be
// enforced. Disabling this setting is not recommend as it will allow risky
// security behavior such as cross-site scripting (XSS). Also configurable
// using the "disable-web-security" command-line switch.
web_security: TCefState;
// Controls whether image URLs will be loaded from the network. A cached image
// will still be rendered if requested. Also configurable using the
// "disable-image-loading" command-line switch.
image_loading: TCefState;
// Controls whether standalone images will be shrunk to fit the page. Also
// configurable using the "image-shrink-standalone-to-fit" command-line
// switch.
image_shrink_standalone_to_fit: TCefState;
// Controls whether text areas can be resized. Also configurable using the
// "disable-text-area-resize" command-line switch.
text_area_resize: TCefState;
// Controls whether the tab key can advance focus to links. Also configurable
// using the "disable-tab-to-links" command-line switch.
tab_to_links: TCefState;
// Controls whether style sheets can be used. Also configurable using the
// "disable-author-and-user-styles" command-line switch.
author_and_user_styles: TCefState;
// Controls whether local storage can be used. Also configurable using the
// "disable-local-storage" command-line switch.
local_storage: TCefState;
// Controls whether databases can be used. Also configurable using the
// "disable-databases" command-line switch.
databases: TCefState;
// Controls whether the application cache can be used. Also configurable using
// the "disable-application-cache" command-line switch.
application_cache: TCefState;
// Controls whether WebGL can be used. Note that WebGL requires hardware
// support and may not work on all systems even when enabled. Also
// configurable using the "disable-webgl" command-line switch.
webgl: TCefState;
// Controls whether content that depends on accelerated compositing can be
// used. Note that accelerated compositing requires hardware support and may
// not work on all systems even when enabled. Also configurable using the
// "disable-accelerated-compositing" command-line switch.
accelerated_compositing: TCefState;
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;
// Cookie information.
PCefCookie = ^TCefCookie;
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;
// Process termination status values.
TCefTerminationStatus = (
// Non-zero exit status.
TS_ABNORMAL_TERMINATION,
// SIGKILL or task manager kill.
TS_PROCESS_WAS_KILLED,
// Segmentation fault.
TS_PROCESS_CRASHED
);
// Path key values.
TCefPathKey = (
// Current directory.
PK_DIR_CURRENT,
// Directory containing PK_FILE_EXE.
PK_DIR_EXE,
// Directory containing PK_FILE_MODULE.
PK_DIR_MODULE,
// Temporary directory.
PK_DIR_TEMP,
// Path and filename of the current executable.
PK_FILE_EXE,
// Path and filename of the module containing the CEF code (usually the libcef
// module).
PK_FILE_MODULE
);
// Storage types.
TCefStorageType = (
ST_LOCALSTORAGE = 0,
ST_SESSIONSTORAGE
);
// Supported error code values. See net\base\net_error_list.h for complete
// descriptions of the error codes.
TCefHandlerErrorcode = Integer;
{$NOTE ascending order?}
TCefErrorCode = (
ERR_NONE = 0,
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.
TCefDragOperationsMask = (
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 = High(UInt32)
);
// V8 access control values.
TCefV8AccessControl = (
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
);
TCefV8AccessControls = set of TCefV8AccessControl;
// V8 property attribute values.
TCefV8PropertyAttribute = (
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
);
TCefV8PropertyAttributes = set of TCefV8PropertyAttribute;
// Post data elements may represent either bytes or files.
TCefPostDataElementType = (
PDE_TYPE_EMPTY = 0,
PDE_TYPE_BYTES,
PDE_TYPE_FILE
);
// Resource type for a request.
TCefResourceType = (
// Top level page.
RT_MAIN_FRAME = 0,
// Frame or iframe.
RT_SUB_FRAME,
// CSS stylesheet.
RT_STYLESHEET,
// External script.
RT_SCRIPT,
// Image (jpg/gif/png/etc).
RT_IMAGE,
// Font.
RT_FONT_RESOURCE,
// Some other subresource. This is the default type if the actual type is
// unknown.
RT_SUB_RESOURCE,
// Object (or embed) tag for a plugin, or a resource that a plugin requested.
RT_OBJECT,
// Media resource.
RT_MEDIA,
// Main resource of a dedicated worker.
RT_WORKER,
// Main resource of a shared worker.
RT_SHARED_WORKER,
// Explicitly requested prefetch.
RT_PREFETCH,
// Favicon.
RT_FAVICON,
// XMLHttpRequest.
RT_XHR
);
// Transition type for a request. Made up of one source value and 0 or more
// qualifiers.
TCefTransitionType = (
// Source is a link click or the JavaScript window.open function. This is
// also the default value for requests like sub-resource loads that are not
// navigations.
TT_LINK = 0,
// Source is some other "explicit" navigation action such as creating a new
// browser or using the LoadURL function. This is also the default value
// for navigations where the actual type is unknown.
TT_EXPLICIT = 1,
// Source is a subframe navigation. This is any content that is automatically
// loaded in a non-toplevel frame. For example, if a page consists of several
// frames containing ads, those ad URLs will have this transition type.
// The user may not even realize the content in these pages is a separate
// frame, so may not care about the URL.
TT_AUTO_SUBFRAME = 3,
// Source is a subframe navigation explicitly requested by the user that will
// generate new navigation entries in the back/forward list. These are
// probably more important than frames that were automatically loaded in
// the background because the user probably cares about the fact that this
// link was loaded.
TT_MANUAL_SUBFRAME = 4,
// Source is a form submission by the user. NOTE: In some situations
// submitting a form does not result in this transition type. This can happen
// if the form uses a script to submit the contents.
TT_FORM_SUBMIT = 7,
// Source is a "reload" of the page via the Reload function or by re-visiting
// the same URL. NOTE: This is distinct from the concept of whether a
// particular load uses "reload semantics" (i.e. bypasses cached data).
TT_RELOAD = 8,
// General mask defining the bits used for the source values.
TT_SOURCE_MASK = $FF,
// Qualifiers.
// Any of the core values above can be augmented by one or more qualifiers.
// These qualifiers further define the transition.
// Attempted to visit a URL but was blocked.
TT_BLOCKED_FLAG = $00800000,
// Used the Forward or Back function to navigate among browsing history.
TT_FORWARD_BACK_FLAG = $01000000,
// The beginning of a navigation chain.
TT_CHAIN_START_FLAG = $10000000,
// The last transition in a redirect chain.
TT_CHAIN_END_FLAG = $20000000,
// Redirects caused by JavaScript or a meta refresh tag on the page.
TT_CLIENT_REDIRECT_FLAG = $40000000,
// Redirects sent from the server by HTTP headers.
TT_SERVER_REDIRECT_FLAG = $80000000,
// Used to test whether a transition involves a redirect.
TT_IS_REDIRECT_MASK = $C0000000,
// General mask defining the bits used for the qualifiers.
TT_QUALIFIER_MASK = $FFFFFF00
);
// Flags used to customize the behavior of CefURLRequest.
TCefUrlRequestFlag = (
// Default behavior.
UR_FLAG_NONE = 0,
// If set the cache will be skipped when handling the request.
UR_FLAG_SKIP_CACHE = 1 shl 0,
// If set user name, password, and cookies may be sent with the request.
UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 shl 1,
// If set cookies may be sent with the request and saved from the response.
// UR_FLAG_ALLOW_CACHED_CREDENTIALS must also be set.
UR_FLAG_ALLOW_COOKIES = 1 shl 2,
// If set upload progress events will be generated when a request has a body.
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 shl 3,
// If set load timing info will be collected for the request.
UR_FLAG_REPORT_LOAD_TIMING = 1 shl 4,
// If set the headers sent and received for the request will be recorded.
UR_FLAG_REPORT_RAW_HEADERS = 1 shl 5,
// If set the CefURLRequestClient::OnDownloadData method will not be called.
UR_FLAG_NO_DOWNLOAD_DATA = 1 shl 6,
// If set 5XX redirect errors will be propagated to the observer instead of
// automatically re-tried. This currently only applies for requests
// originated in the browser process.
UR_FLAG_NO_RETRY_ON_5XX = 1 shl 7
);
TCefUrlRequestFlags = set of TCefUrlRequestFlag;
// Flags that represent CefURLRequest status.
TCefUrlRequestStatus = (
// Unknown status.
UR_UNKNOWN = 0,
// Request succeeded.
UR_SUCCESS,
// An IO request is pending, and the caller will be informed when it is
// completed.
UR_IO_PENDING,
// Request was canceled programatically.
UR_CANCELED,
// Request failed for some reason.
UR_FAILED
);
// Structure representing a rectangle.
PCefRect = ^TCefRect;
TCefRect = record
x: Integer;
y: Integer;
width: Integer;
height: Integer;
end;
TCefRectArray = array[0..(High(Integer) div SizeOf(TCefRect))-1] of TCefRect;
PCefRectArray = ^TCefRectArray;
// Existing process IDs.
TCefProcessId = (
// Browser process.
PID_BROWSER,
// Renderer process.
PID_RENDERER
);
// Existing thread IDs.
TCefThreadId = (
// BROWSER PROCESS THREADS -- Only available in the browser process.
// The main thread in the browser. This will be the same as the main
// application thread if CefInitialize() is called with a
// CefSettings.multi_threaded_message_loop value of false.
///
TID_UI,
// Used to interact with the database.
TID_DB,
// Used to interact with the file system.
TID_FILE,
// Used for file system operations that block user interactions.
// Responsiveness of this thread affects users.
TID_FILE_USER_BLOCKING,
// Used to launch and terminate browser processes.
TID_PROCESS_LAUNCHER,
// Used to handle slow HTTP cache operations.
TID_CACHE,
// Used to process IPC and network messages.
TID_IO,
// RENDER PROCESS THREADS -- Only available in the render process.
// The main thread in the renderer. Used for all WebKit and V8 interaction.
TID_RENDERER
);
// Supported value types.
TCefValueType = (
VTYPE_INVALID = 0,
VTYPE_NULL,
VTYPE_BOOL,
VTYPE_INT,
VTYPE_DOUBLE,
VTYPE_STRING,
VTYPE_BINARY,
VTYPE_DICTIONARY,
VTYPE_LIST
);