Repository navigation
Expand file tree
/
Copy pathtypes.rs
More file actions
2032 lines (1755 loc) · 52.1 KB
/
Copy pathtypes.rs
File metadata and controls
2032 lines (1755 loc) · 52.1 KB
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
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use libc::{c_uint, c_ushort, c_int, c_double, size_t, wchar_t};
#[cfg(target_os="linux")]
use libc::c_ulong;
#[cfg(target_os="macos")]
use libc::c_void;
use net_traits::net_error_list::NetError;
pub use self::cef_rect as cef_rect_t;
use std::collections::BTreeMap;
pub type cef_string_map_t = BTreeMap<String
10BC8
, *mut cef_string_t>;
pub type cef_string_multimap_t = BTreeMap<String, Vec<*mut cef_string_t>>;
pub type cef_string_list_t = Vec<String>;
pub enum cef_text_input_context_t {}
pub enum cef_event_handle_t {}
#[cfg(target_os="linux")]
pub type cef_window_handle_t = c_ulong;
#[cfg(target_os="macos")]
pub type cef_window_handle_t = *mut c_void; //NSView*
//#[cfg(target_os="win")]
//pub enum cef_window_handle_t {} //HWND
#[cfg(target_os="linux")]
pub type cef_cursor_handle_t = c_ulong;
#[cfg(target_os="macos")]
pub type cef_cursor_handle_t = *mut c_void; //NSCursor*
//#[cfg(target_os="win")]
//pub enum cef_cursor_handle_t {} //HCURSOR
pub type cef_string_t = cef_string_utf16; //FIXME: this is #defined...
pub type cef_string_userfree_t = *mut cef_string_t; //FIXME: this is #defined...
pub struct cef_string_utf8 {
pub str: *mut u8,
pub length: size_t,
pub dtor: Option<extern "C" fn(str: *mut u8)>,
}
pub type cef_string_utf8_t = cef_string_utf8;
pub type cef_string_userfree_utf8_t = cef_string_utf8;
pub type cef_string_utf16_t = cef_string_utf16;
pub type cef_string_userfree_utf16_t = *mut cef_string_utf16;
pub struct cef_string_utf16 {
pub str: *mut c_ushort,
pub length: size_t,
pub dtor: Option<extern "C" fn(str: *mut c_ushort)>,
}
pub type cef_string_wide_t = cef_string_wide;
pub type cef_string_userfree_wide_t = cef_string_wide;
pub struct cef_string_wide {
pub str: *mut wchar_t,
pub length: size_t,
pub dtor: Option<extern "C" fn(str: *mut wchar_t)>,
}
pub type cef_main_args_t = cef_main_args;
pub struct cef_main_args {
pub argc: c_int,
pub argv: *const *const u8
}
pub type cef_color_t = c_uint;
pub enum cef_json_parser_error_t {
JSON_NO_ERROR = 0,
JSON_INVALID_ESCAPE,
JSON_SYNTAX_ERROR,
JSON_UNEXPECTED_TOKEN,
JSON_TRAILING_COMMA,
JSON_TOO_MUCH_NESTING,
JSON_UNEXPECTED_DATA_AFTER_ROOT,
JSON_UNSUPPORTED_ENCODING,
JSON_UNQUOTED_DICTIONARY_KEY,
JSON_PARSE_ERROR_COUNT
}
///
// Represents the state of a setting.
///
pub enum cef_state_t {
///
// Use the default state for the setting.
///
STATE_DEFAULT = 0,
///
// Enable or allow the setting.
///
STATE_ENABLED,
///
// Disable or disallow the setting.
///
STATE_DISABLED,
}
//
// Existing thread IDs.
//
pub enum cef_thread_id_t {
// 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,
}
//
// Navigation types.
//
pub enum cef_navigation_type_t {
NAVIGATION_LINK_CLICKED = 0,
NAVIGATION_FORM_SUBMITTED,
NAVIGATION_BACK_FORWARD,
NAVIGATION_RELOAD,
NAVIGATION_FORM_RESUBMITTED,
NAVIGATION_OTHER,
}
//
// Mouse button types.
//
pub enum cef_mouse_button_type_t {
MBT_LEFT = 0,
MBT_MIDDLE,
MBT_RIGHT,
}
//
// Structure representing mouse event information.
//
pub type cef_mouse_event_t = cef_mouse_event;
pub type CefMouseEvent = cef_mouse_event_t;
pub struct cef_mouse_event {
//
// X coordinate relative to the left side of the view.
//
pub x: c_int,
//
// Y coordinate relative to the top side of the view.
//
pub y: c_int,
//
// Bit flags describing any pressed modifier keys. See
// cef_event_flags_t for values.
//
pub modifiers: c_uint,
}
//
// Post data elements may represent either bytes or files.
//
pub enum cef_postdataelement_type_t {
PDE_TYPE_EMPTY = 0,
PDE_TYPE_BYTES,
PDE_TYPE_FILE,
}
//
// Flags used to customize the behavior of CefURLRequest.
//
pub enum cef_urlrequest_flags_t {
//
// Default behavior.
//
UR_FLAG_NONE = 0,
//
// If set the cache will be skipped when handling the request.
//
UR_FLAG_SKIP_CACHE = 1 << 0,
//
// If set user name, password, and cookies may be sent with the request.
//
UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 << 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 << 2,
//
// If set upload progress events will be generated when a request has a body.
//
UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3,
//
// If set load timing info will be collected for the request.
//
UR_FLAG_REPORT_LOAD_TIMING = 1 << 4,
//
// If set the headers sent and received for the request will be recorded.
//
UR_FLAG_REPORT_RAW_HEADERS = 1 << 5,
//
// If set the CefURLRequestClient::OnDownloadData method will not be called.
//
UR_FLAG_NO_DOWNLOAD_DATA = 1 << 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 << 7,
}
//
// Flags that represent CefURLRequest status.
//
pub enum cef_urlrequest_status_t {
//
// 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,
}
pub type cef_errorcode_t = NetError;
//
// Key event types.
//
pub enum cef_key_event_type_t {
KEYEVENT_RAWKEYDOWN = 0,
KEYEVENT_KEYDOWN,
KEYEVENT_KEYUP,
KEYEVENT_CHAR
}
//
// Structure representing keyboard event information.
//
pub type cef_key_event_t = cef_key_event;
pub struct cef_key_event {
//
// The type of keyboard event.
//
pub t: cef_key_event_type_t,
//
// Bit flags describing any pressed modifier keys. See
// cef_event_flags_t for values.
//
pub modifiers: c_uint,
//
// The Windows key code for the key event. This value is used by the DOM
// specification. Sometimes it comes directly from the event (i.e. on
// Windows) and sometimes it's determined using a mapping function. See
// WebCore/platform/chromium/KeyboardCodes.h for the list of values.
//
pub windows_key_code: c_int,
//
// The actual key code generated by the platform.
//
pub native_key_code: c_int,
//
// Indicates whether the event is considered a "system key" event (see
// http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details).
// This value will always be false on non-Windows platforms.
//
pub is_system_key: c_int,
//
// The character generated by the keystroke.
//
pub character: c_ushort, //FIXME: can be wchar_t also?
//
// Same as |character| but unmodified by any concurrently-held modifiers
// (except shift). This is useful for working out shortcut keys.
//
pub unmodified_character: c_ushort, //FIXME: can be wchar_t also?
//
// True if the focus is currently on an editable field on the page. This is
// useful for determining if standard key events should be intercepted.
//
pub focus_on_editable_field: c_int,
}
pub type CefKeyEvent = cef_key_event_t;
//
// Structure representing a point.
//
pub type cef_point_t = cef_point;
pub struct cef_point {
pub x: c_int,
pub y: c_int,
}
//
// Structure representing a rectangle.
//
pub struct cef_rect {
pub x: c_int,
pub y: c_int,
pub width: c_int,
pub height: c_int,
}
impl cef_rect {
pub fn zero() -> cef_rect {
cef_rect {
x: 0,
y: 0,
width: 0,
height: 0,
}
}
}
pub type cef_draggable_region_t = cef_draggable_region;
///
// Structure representing a draggable region.
///
pub struct cef_draggable_region {
///
// Bounds of the region.
///
pub bounds: cef_rect_t,
///
// True (1) this this region is draggable and false (0) otherwise.
///
pub draggable: i32
}
//
// Paint element types.
//
pub enum cef_paint_element_type_t {
PET_VIEW = 0,
PET_POPUP,
}
//
// DOM document types.
//
pub enum cef_dom_document_type_t {
DOM_DOCUMENT_TYPE_UNKNOWN = 0,
DOM_DOCUMENT_TYPE_HTML,
DOM_DOCUMENT_TYPE_XHTML,
DOM_DOCUMENT_TYPE_PLUGIN,
}
//
// Supported file dialog modes.
//
pub enum cef_file_dialog_mode_t {
//
// Requires that the file exists before allowing the user to pick it.
//
FILE_DIALOG_OPEN = 0,
//
// Like Open, but allows picking multiple files to open.
//
FILE_DIALOG_OPEN_MULTIPLE,
//
// Allows picking a nonexistent file, and prompts to overwrite if the file
// already exists.
//
FILE_DIALOG_SAVE,
}
//
// Supported value types.
//
pub enum cef_value_type_t {
VTYPE_INVALID = 0,
VTYPE_NULL,
VTYPE_BOOL,
VTYPE_INT,
VTYPE_DOUBLE,
VTYPE_STRING,
VTYPE_BINARY,
VTYPE_DICTIONARY,
VTYPE_LIST,
}
pub type CefValueType = cef_value_type_t;
//
// Existing process IDs.
//
pub enum cef_process_id_t {
//
// Browser process.
//
PID_BROWSER,
//
// Renderer process.
//
PID_RENDERER,
}
pub type CefProcessId = cef_process_id_t;
//
// Log severity levels.
//
pub enum cef_log_severity_t {
//
// 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,
//
// Completely disable logging.
//
LOGSEVERITY_DISABLE = 99
}
//
// 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.
//
pub type cef_settings_t = cef_settings;
#[repr(C)]
pub struct cef_settings {
//
// Size of this structure.
//
pub size: size_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.
//
pub single_process: c_int,
//
// Set to true (1) to disable the sandbox for sub-processes. See
// cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
// configurable using the "no-sandbox" command-line switch.
//
pub no_sandbox: c_int,
//
// 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.
//
pub browser_subprocess_path: cef_string_t,
//
// 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.
//
pub multi_threaded_message_loop: c_int,
//
// Set to true (1) to enable windowless (off-screen) rendering support. Do not
// enable this value if the application does not use windowless rendering as
// it may reduce rendering performance on some systems.
//
pub windowless_rendering_enabled: c_int,
//
// 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.
//
pub command_line_args_disabled: c_int,
//
// 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.
//
pub cache_path: cef_string_t,
//
// 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.
//
pub persist_session_cookies: c_int,
//
// 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.
//
pub user_agent: cef_string_t,
//
// 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.
//
pub product_version: cef_string_t,
//
// 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.
//
pub locale: cef_string_t,
//
// 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.
//
pub log_file: cef_string_t,
//
// The log severity. Only messages of this severity level or higher will be
// logged. Also configurable using the "log-severity" command-line switch with
// a value of "verbose", "info", "warning", "error", "error-report" or
// "disable".
//
pub log_severity: cef_log_severity_t,
//
// 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.
//
pub javascript_flags: cef_string_t,
//
// 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.
//
pub resources_dir_path: cef_string_t,
//
// 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.
//
pub locales_dir_path: cef_string_t,
//
// 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.
//
pub pack_loading_disabled: c_int,
//
// 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.
//
pub remote_debugging_port: c_int,
//
// 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.
//
pub uncaught_exception_stack_size: c_int,
//
// 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.
//
pub context_safety_implementation: c_int,
//
// 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.
//
pub ignore_certificate_errors: c_int,
//
// Opaque background color used for accelerated content. By default the
// background color will be white. Only the RGB components of the specified
// value will be used. The alpha component must greater than 0 to enable use
// of the background color but will be otherwise ignored.
//
pub background_color: cef_color_t,
//
// Determines how many rendering threads are used.
//
pub rendering_threads: c_int,
}
//
// Structure defining the reference count implementation functions. All
// framework structures must include the cef_base_t structure first.
//
pub type cef_base_t = cef_base;
pub struct cef_base {
//
// Size of the data structure.
//
pub size: size_t,
//
// Increment the reference count.
//
pub add_ref: Option<extern "C" fn(base: *mut cef_base) -> c_int>,
//
// Decrement the reference count. Delete this object when no references
// remain.
//
pub release: Option<extern "C" fn(base: *mut cef_base) -> c_int>,
//
// Returns the current number of references.
//
pub get_refct: Option<extern "C" fn(base: *mut cef_base) -> c_int>,
}
pub type CefBase = *mut cef_base_t;
//
// Class representing window information.
//
pub type cef_window_info_t = cef_window_info;
#[cfg(target_os="linux")]
pub struct cef_window_info {
pub x: c_uint,
pub y: c_uint,
pub width: c_uint,
pub height: c_uint,
//
// Pointer for the parent window.
//
pub parent_window: cef_window_handle_t,
//
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
//
pub windowless_rendering_enabled: c_int,
//
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
//
pub transparent_painting_enabled: c_int,
//
// Pointer for the new browser window. Only used with windowed rendering.
//
pub window: cef_window_handle_t
}
#[cfg(target_os="macos")]
pub struct cef_window_info {
pub window_name: cef_string_t,
pub x: c_uint,
pub y: c_uint,
pub width: c_uint,
pub height: c_uint,
//
// Set to true (1) to create the view initially hidden.
//
pub hidden: c_int,
//
// Pointer for the parent window.
//
pub parent_window: cef_window_handle_t,
//
// Set to true (1) to create the browser using windowless (off-screen)
// rendering. No window will be created for the browser and all rendering will
// occur via the CefRenderHandler interface. The |parent_window| value will be
// used to identify monitor info and to act as the parent window for dialogs,
// context menus, etc. If |parent_window| is not provided then the main screen
// monitor will be used and some functionality that requires a parent window
// may not function correctly. In order to create windowless browsers the
// CefSettings.windowless_rendering_enabled value must be set to true.
//
pub windowless_rendering_enabled: c_int,
//
// Set to true (1) to enable transparent painting in combination with
// windowless rendering. When this value is true a transparent background
// color will be used (RGBA=0x00000000). When this value is false the
// background will be white and opaque.
//
pub transparent_painting_enabled: c_int,
//
// Pointer for the new browser window. Only used with windowed rendering.
//
pub window: cef_window_handle_t
}
pub type CefWindowInfo = cef_window_info_t;
//
// Supported menu item types.
//
pub enum cef_menu_item_type_t {
MENUITEMTYPE_NONE,
MENUITEMTYPE_COMMAND,
MENUITEMTYPE_CHECK,
MENUITEMTYPE_RADIO,
MENUITEMTYPE_SEPARATOR,
MENUITEMTYPE_SUBMENU,
}
//
// Supported context menu type flags.
//
pub enum cef_context_menu_type_flags_t {
//
// No node is selected.
//
CM_TYPEFLAG_NONE = 0,
//
// The top page is selected.
//
CM_TYPEFLAG_PAGE = 1 << 0,
//
// A subframe page is selected.
//
CM_TYPEFLAG_FRAME = 1 << 1,
//
// A link is selected.
//
CM_TYPEFLAG_LINK = 1 << 2,
//
// A media node is selected.
//
CM_TYPEFLAG_MEDIA = 1 << 3,
//
// There is a textual or mixed selection that is selected.
//
CM_TYPEFLAG_SELECTION = 1 << 4,
//
// An editable element is selected.
//
CM_TYPEFLAG_EDITABLE = 1 << 5,
}
//
// Supported context menu media types.
//
pub enum cef_context_menu_media_type_t {
//
// No special node is in context.
//
CM_MEDIATYPE_NONE,
//
// An image node is selected.
//
CM_MEDIATYPE_IMAGE,
//
// A video node is selected.
//
CM_MEDIATYPE_VIDEO,
//
// An audio node is selected.
//
CM_MEDIATYPE_AUDIO,
//
// A file node is selected.
//
CM_MEDIATYPE_FILE,
//
// A plugin node is selected.
//
CM_MEDIATYPE_PLUGIN,
}
//
// Supported context menu media state bit flags.
//
pub enum cef_context_menu_media_state_flags_t {
CM_MEDIAFLAG_NONE = 0,
CM_MEDIAFLAG_ERROR = 1 << 0,
CM_MEDIAFLAG_PAUSED = 1 << 1,
CM_MEDIAFLAG_MUTED = 1 << 2,
CM_MEDIAFLAG_LOOP = 1 << 3,
CM_MEDIAFLAG_CAN_SAVE = 1 << 4,
CM_MEDIAFLAG_HAS_AUDIO = 1 << 5,
CM_MEDIAFLAG_HAS_VIDEO = 1 << 6,
CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7,
CM_MEDIAFLAG_CAN_PRINT = 1 << 8,
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9,
}
//
// Supported context menu edit state bit flags.
//
pub enum cef_context_menu_edit_state_flags_t {
CM_EDITFLAG_NONE = 0,
CM_EDITFLAG_CAN_UNDO = 1 << 0,
CM_EDITFLAG_CAN_REDO = 1 << 1,
CM_EDITFLAG_CAN_CUT = 1 << 2,
CM_EDITFLAG_CAN_COPY = 1 << 3,
CM_EDITFLAG_CAN_PASTE = 1 << 4,
CM_EDITFLAG_CAN_DELETE = 1 << 5,
CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6,
CM_EDITFLAG_CAN_TRANSLATE = 1 << 7,
}
//
// Supported event bit flags.
//
pub enum cef_event_flags_t {
EVENTFLAG_NONE = 0,
EVENTFLAG_CAPS_LOCK_ON = 1 << 0,
EVENTFLAG_SHIFT_DOWN = 1 << 1,
EVENTFLAG_CONTROL_DOWN = 1 << 2,
EVENTFLAG_ALT_DOWN = 1 << 3,
EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4,
EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5,
EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6,
// Mac OS-X command key.
EVENTFLAG_COMMAND_DOWN = 1 << 7,
EVENTFLAG_NUM_LOCK_ON = 1 << 8,
EVENTFLAG_IS_KEY_PAD = 1 << 9,
EVENTFLAG_IS_LEFT = 1 << 10,
EVENTFLAG_IS_RIGHT = 1 << 11,
}
//
// Time information. Values should always be in UTC.
//
#[repr(C)]
pub struct _cef_time_t {
year: c_int, // Four digit year "2007"
month: c_int, // 1-based month (values 1 = January, etc.)
day_of_week: c_int, // 0-based day of week (0 = Sunday, etc.)
day_of_month: c_int, // 1-based day of month (1-31)
hour: c_int, // Hour within the current day (0-23)
minute: c_int, // Minute within the current hour (0-59)
second: c_int, // Second within the current minute (0-59 plus leap
// seconds which may take it up to 60).
millisecond: c_int, // Milliseconds within the current second (0-999)
}
pub type cef_time_t = _cef_time_t;