-
Notifications
You must be signed in to change notification settings - Fork 28
/
consts.go
2343 lines (2087 loc) · 82.8 KB
/
consts.go
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
//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
// Package consts CEF const
package consts
import (
"github.com/energye/energy/v2/types"
"github.com/energye/golcl/energy/homedir"
"math"
"os"
"path/filepath"
"reflect"
)
var (
CurrentExecuteDir string // 当前执行目录
ExeDir string // 执行文件所在目录
ExePath string // 执行文件所在完整目录
ExeName string // 执行文件名称
HomeDir, _ = homedir.Dir() // 当前系统用户目录
Separator = string(filepath.Separator) // 平台目录分隔符
)
const (
ENERGY_HOME_KEY = "ENERGY_HOME"
MemoryNetwork = "unix"
)
func init() {
// 当前执行目录,在其它目录执行目标执行文件时,返回当前执行目录
CurrentExecuteDir, _ = os.Getwd()
// 执行文件所在真实目录
ExePath = os.Args[0]
ExeDir, ExeName = filepath.Split(ExePath)
}
// Proc Get value and Set value
const (
GetValue uintptr = 0
SetValue uintptr = 1
)
//0:net 1:unix
type IPC_TYPE = types.Int8
const (
IPCT_NET = IPC_TYPE(iota)
IPCT_UNIX
)
type ChannelType = types.Int8
const (
Ct_Server = ChannelType(iota)
Ct_Client
)
// SpecificVersion 特定版本: CEF49,CEF87,CEF106,CEF109
type SpecificVersion = types.Int32
const (
SV_INVALID = SpecificVersion(-1) // 无效
SV_CEF = SpecificVersion(0) // 非特定版本,当前版本或当前最新版本
SV_CEF49 = SpecificVersion(49) // 特定 WindowsXP
SV_CEF87 = SpecificVersion(87) // 特定 Flash
SV_CEF106 = SpecificVersion(106) // 特定 Linux GTK2
SV_CEF109 = SpecificVersion(109) // 特定 Windows 7, 8/8.1 and Windows Server 2012
)
// 功能和消息常量
const (
WM_APP = 0x008000
MINIBROWSER_SHOWDEVTOOLS = WM_APP + 0x00101 //开发工具展示
MINIBROWSER_HIDEDEVTOOLS = WM_APP + 0x00102 //开发工具隐藏
)
// 缩放、放大
type ZOOM = types.Int32
const (
ZOOM_RESET = ZOOM(iota)
ZOOM_INC
ZOOM_DEC
)
// TCefTerminationStatus
//
// 进程结束的状态
// /include/internal/cef_types.h (cef_termination_status_t)
type TCefTerminationStatus = types.Int32
const (
TS_ABNORMAL_TERMINATION = TCefTerminationStatus(iota)
TS_PROCESS_WAS_KILLED
TS_PROCESS_CRASHED
TS_PROCESS_OOM
)
// 前进 & 后退
type BF = types.Int32
const (
BF_GOBACK = BF(iota)
BF_GOFORWARD
)
// 日志等级
type LogSeverity = types.UInt32
const (
LOGSEVERITY_DEFAULT LogSeverity = 0
LOGSEVERITY_VERBOSE LogSeverity = 1
LOGSEVERITY_DEBUG LogSeverity = LOGSEVERITY_VERBOSE
LOGSEVERITY_INFO LogSeverity = 2
LOGSEVERITY_WARNING LogSeverity = 3
LOGSEVERITY_ERROR LogSeverity = 4
LOGSEVERITY_FATAL LogSeverity = 5
LOGSEVERITY_DISABLE LogSeverity = 99
)
type LANGUAGE = types.String
const (
LANGUAGE_zh_CN LANGUAGE = "zh-CN"
LANGUAGE_zh_TW LANGUAGE = "zh-TW"
LANGUAGE_am LANGUAGE = "am"
LANGUAGE_ar LANGUAGE = "ar"
LANGUAGE_bg LANGUAGE = "bg"
LANGUAGE_bn LANGUAGE = "bn"
LANGUAGE_ca LANGUAGE = "ca"
LANGUAGE_cs LANGUAGE = "cs"
LANGUAGE_da LANGUAGE = "da"
LANGUAGE_de LANGUAGE = "de"
LANGUAGE_el LANGUAGE = "el"
LANGUAGE_en_GB LANGUAGE = "en-GB"
LANGUAGE_en_US LANGUAGE = "en-US"
LANGUAGE_es LANGUAGE = "es"
LANGUAGE_es_419 LANGUAGE = "es-419"
LANGUAGE_et LANGUAGE = "et"
LANGUAGE_fa LANGUAGE = "fa"
LANGUAGE_fi LANGUAGE = "fi"
LANGUAGE_fil LANGUAGE = "fil"
LANGUAGE_fr LANGUAGE = "fr"
LANGUAGE_gu LANGUAGE = "gu"
LANGUAGE_he LANGUAGE = "he"
LANGUAGE_hi LANGUAGE = "hi"
LANGUAGE_hr LANGUAGE = "hr"
LANGUAGE_hu LANGUAGE = "hu"
LANGUAGE_id LANGUAGE = "channelId"
LANGUAGE_it LANGUAGE = "it"
LANGUAGE_ja LANGUAGE = "ja"
LANGUAGE_kn LANGUAGE = "kn"
LANGUAGE_ko LANGUAGE = "ko"
LANGUAGE_lt LANGUAGE = "lt"
LANGUAGE_lv LANGUAGE = "lv"
LANGUAGE_ml LANGUAGE = "ml"
LANGUAGE_mr LANGUAGE = "mr"
LANGUAGE_ms LANGUAGE = "ms"
LANGUAGE_nb LANGUAGE = "nb"
LANGUAGE_nl LANGUAGE = "nl"
LANGUAGE_pl LANGUAGE = "pl"
LANGUAGE_pt_BR LANGUAGE = "pt-BR"
LANGUAGE_pt_PT LANGUAGE = "pt-PT"
LANGUAGE_ro LANGUAGE = "ro"
LANGUAGE_ru LANGUAGE = "ru"
LANGUAGE_sk LANGUAGE = "sk"
LANGUAGE_sl LANGUAGE = "sl"
LANGUAGE_sr LANGUAGE = "sr"
LANGUAGE_sv LANGUAGE = "sv"
LANGUAGE_sw LANGUAGE = "sw"
LANGUAGE_ta LANGUAGE = "ta"
LANGUAGE_te LANGUAGE = "te"
LANGUAGE_th LANGUAGE = "th"
LANGUAGE_tr LANGUAGE = "tr"
LANGUAGE_uk LANGUAGE = "uk"
LANGUAGE_vi LANGUAGE = "vi"
)
// TCefCloseBrowserAction
// Chromium关闭的操作类型
// 在 TChromium.Onclose 使用
// -------------------------
// cbaCancel : 停止关闭浏览器
// cbaClose : 继续关闭浏览器
// cbaDelay : 暂时停止关闭浏览器
//
// : 当应用程序需要在关闭浏览器之前执行一些自定义进程时使用。在关闭浏览器之前,通常需要在主线程中销毁TCEFWindowParent。
type TCefCloseBrowserAction = types.Int32
const (
CbaClose = TCefCloseBrowserAction(iota)
CbaDelay
CbaCancel
)
// CefProcessId CEF 进程 Id
type CefProcessId = types.Int32
const (
PID_BROWSER = CefProcessId(iota)
PID_RENDER
)
// Go Kind 扩展常量
const (
SLICE_BYTE reflect.Kind = iota + 30 // []byte
JD // JsonData
NIL // nil
)
// FN_TYPE 函数类型
type FN_TYPE = types.Int8
const (
FN_TYPE_COMMON = FN_TYPE(iota) //普通函数,直接定义的
FN_TYPE_OBJECT //对象函数,所属对象
)
// IS_CO 通用类型或对象类型
type IS_CO = types.Int8
const (
IS_COMMON = IS_CO(iota)
IS_OBJECT
)
// 进程消息类型
type PROCESS_MESSAGE_TYPE = types.Int8
const (
PMT_JS_CODE = PROCESS_MESSAGE_TYPE(iota) //执行JS代码消息
PMT_TEXT //文本传递消息
PMT_BINARY //二进制消息
)
type TDateTime = types.Float64
// /include/internal/cef_types.h (cef_cookie_same_site_t)
type TCefCookieSameSite = types.Int32
const (
Ccss_CEF_COOKIE_SAME_SITE_UNSPECIFIED = TCefCookieSameSite(iota)
Ccss_CEF_COOKIE_SAME_SITE_NO_RESTRICTION
Ccss_CEF_COOKIE_SAME_SITE_LAX_MODE
Ccss_CEF_COOKIE_SAME_SITE_STRICT_MODE
)
// /include/internal/cef_types.h (cef_cookie_priority_t)
type TCefCookiePriority = types.Int32
const (
CEF_COOKIE_PRIORITY_LOW TCefCookiePriority = -1
CEF_COOKIE_PRIORITY_MEDIUM TCefCookiePriority = 0
CEF_COOKIE_PRIORITY_HIGH TCefCookiePriority = 1
)
type TCefProxyType = types.Int32
const (
PtDirect = TCefProxyType(iota) // mode dict => direct
PtAutodetect // mode dict => auto_detect
PtSystem // mode dict => system
PtFixedServers // mode dict => fixed_servers
PtPACScript // mode dict => pac_script
)
type TCefProxyScheme = types.Int32
const (
PsHTTP = TCefProxyScheme(iota)
PsSOCKS4
PsSOCKS5
)
type TCefContextMenuType = types.Int32
const (
CMT_NONE = TCefContextMenuType(iota)
CMT_CHECK
CMT_RADIO
)
// /include/internal/cef_types.h (cef_context_menu_media_type_t)
type TCefContextMenuMediaType = types.Int32
const (
CM_MEDIATYPE_NONE = TCefContextMenuMediaType(iota)
CM_MEDIATYPE_IMAGE
CM_MEDIATYPE_VIDEO
CM_MEDIATYPE_AUDIO
CM_MEDIATYPE_CANVAS
CM_MEDIATYPE_FILE
CM_MEDIATYPE_PLUGIN
)
type MenuId = types.Int32
const (
MENU_ID_BACK MenuId = 100
MENU_ID_FORWARD MenuId = 101
MENU_ID_RELOAD MenuId = 102
MENU_ID_RELOAD_NOCACHE MenuId = 103
MENU_ID_STOPLOAD MenuId = 104
MENU_ID_UNDO MenuId = 110
MENU_ID_REDO MenuId = 111
MENU_ID_CUT MenuId = 112
MENU_ID_COPY MenuId = 113
MENU_ID_PASTE MenuId = 114
MENU_ID_DELETE MenuId = 115
MENU_ID_SELECT_ALL MenuId = 116
MENU_ID_FIND MenuId = 130
MENU_ID_PRINT MenuId = 131
MENU_ID_VIEW_SOURCE MenuId = 132
MENU_ID_SPELLCHECK_SUGGESTION_0 MenuId = 200
MENU_ID_SPELLCHECK_SUGGESTION_1 MenuId = 201
MENU_ID_SPELLCHECK_SUGGESTION_2 MenuId = 202
MENU_ID_SPELLCHECK_SUGGESTION_3 MenuId = 203
MENU_ID_SPELLCHECK_SUGGESTION_4 MenuId = 204
MENU_ID_SPELLCHECK_SUGGESTION_LAST MenuId = 204
MENU_ID_NO_SPELLING_SUGGESTIONS MenuId = 205
MENU_ID_ADD_TO_DICTIONARY MenuId = 206
MENU_ID_CUSTOM_FIRST MenuId = 220
MENU_ID_CUSTOM_LAST MenuId = 250
MENU_ID_USER_FIRST MenuId = 26500
MENU_ID_USER_LAST MenuId = 28500
)
// /include/internal/cef_types.h (cef_menu_color_type_t)
type TCefMenuColorType = types.Int32
const (
CEF_MENU_COLOR_TEXT = TCefMenuColorType(iota)
CEF_MENU_COLOR_TEXT_HOVERED
CEF_MENU_COLOR_TEXT_ACCELERATOR
CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED
CEF_MENU_COLOR_BACKGROUND
CEF_MENU_COLOR_BACKGROUND_HOVERED
CEF_MENU_COLOR_COUNT
)
type ARGB = types.UInt32
// /include/internal/cef_types.h (cef_key_event_type_t)
type TCefKeyEventType = types.Int32
const (
KEYEVENT_RAW_KEYDOWN = TCefKeyEventType(iota)
KEYEVENT_KEYDOWN
KEYEVENT_KEYUP
KEYEVENT_CHAR
)
// /include/internal/cef_types.h (cef_event_flags_t)
type TCefEventFlags = types.UInt32
const (
EVENTFLAG_NONE TCefEventFlags = 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
const (
EVENTFLAG_COMMAND_DOWN TCefEventFlags = 1 << 7
EVENTFLAG_NUM_LOCK_ON = 1 << 8
EVENTFLAG_IS_KEY_PAD = 1 << 9
EVENTFLAG_IS_LEFT = 1 << 10
EVENTFLAG_IS_RIGHT = 1 << 11
EVENTFLAG_ALTGR_DOWN = 1 << 12
EVENTFLAG_IS_REPEAT = 1 << 13
)
type TCefWindowHandleType = types.Int8
// /include/internal/cef_types_win.h (cef_window_handle_t)
// /include/internal/cef_types_mac.h (cef_window_handle_t)
// /include/internal/cef_types_linux.h (cef_window_handle_t)
type TCefWindowHandle = types.UIntptr
const (
Wht_WindowParent = TCefWindowHandleType(iota)
Wht_LinkedWindowParent
)
// /include/internal/cef_types.h (cef_return_value_t)
type TCefReturnValue int32
const (
RV_CANCEL = TCefReturnValue(iota)
RV_CONTINUE
RV_CONTINUE_ASYNC
)
// /include/internal/cef_types.h (cef_referrer_policy_t)
type TCefReferrerPolicy = types.Int32
const (
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE = TCefReferrerPolicy(iota) // same value as REFERRER_POLICY_DEFAULT
REFERRER_POLICY_REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN
REFERRER_POLICY_ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN
REFERRER_POLICY_NEVER_CLEAR_REFERRER
REFERRER_POLICY_ORIGIN
REFERRER_POLICY_CLEAR_REFERRER_ON_TRANSITION_CROSS_ORIGIN
REFERRER_POLICY_ORIGIN_CLEAR_ON_TRANSITION_FROM_SECURE_TO_INSECURE
REFERRER_POLICY_NO_REFERRER // REFERRER_POLICY_LAST_VALUE = REFERRER_POLICY_NO_REFERRER
)
// /include/internal/cef_types.h (cef_urlrequest_flags_t)
type TCefUrlRequestFlags = types.Int
// /include/internal/cef_types.h (cef_errorcode_t)
type TCefErrorCode = types.Int32
// /include/internal/cef_types.h (cef_resource_type_t)
type TCefResourceType = types.Int32
const (
RT_MAIN_FRAME = TCefResourceType(iota) // Top level page.
RT_SUB_FRAME // Frame or iframe.
RT_STYLESHEET // CSS stylesheet.
RT_SCRIPT // External script.
RT_IMAGE // Image (jpg/gif/png/etc).
RT_FONT_RESOURCE // Font.
RT_SUB_RESOURCE // Some other subresource. This is the default type if the actual type is unknown
RT_OBJECT // Object (or embed) tag for a plugin, or a resource that a plugin requested.
RT_MEDIA // Media resource.
RT_WORKER // Main resource of a dedicated worker.
RT_SHARED_WORKER // Main resource of a shared worker.
RT_PREFETCH // Explicitly requested prefetch.
RT_FAVICON // Favicon
RT_XHR // XMLHttpRequest
RT_PING // A request for a "<ping>".
RT_SERVICE_WORKER // Main resource of a service worker.
RT_CSP_REPORT // A report of Content Security Policy violations.
RT_PLUGIN_RESOURCE // A resource that a plugin requested.
RT_EMPTY_FILLER_TYPE_DO_NOT_USE // This type doesn't exist in CEF and it's here just to fill this position.
RT_NAVIGATION_PRELOAD_MAIN_FRAME // A main-frame service worker navigation preload request.This type must have a value of 19
RT_NAVIGATION_PRELOAD_SUB_FRAME // A sub-frame service worker navigation preload request.
)
// /include/internal/cef_types.h (cef_transition_type_t)
type TCefTransitionType = types.Int
// /include/internal/cef_types.h (cef_urlrequest_status_t)
type TCefUrlRequestStatus = types.Int32
const (
UR_UNKNOWN = TCefUrlRequestStatus(iota)
UR_SUCCESS
UR_IO_PENDING
UR_CANCELED
UR_FAILED
)
// / <summary>
// / Represents the state of a setting.
// / </summary>
// / <remarks>
// / <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/internal/cef_types.h">CEF source file: /include/internal/cef_types.h (cef_state_t)</see></para>
// / </remarks>
type TCefState = types.Int32
const (
// <summary>
// Use the default state for the setting.
// </summary>
STATE_DEFAULT = TCefState(iota)
// <summary>
// Enable or allow the setting.
// </summary>
STATE_ENABLED
// <summary>
// Disable or disallow the setting.
// </summary>
STATE_DISABLED
)
// Default values for the Windowsless framerate setting in TChromiumOptions
// The values are frames per second.
const CEF_OSR_FRAMERATE_DEFAULT = 30 // Used when the shared textures are disabled.
const CEF_OSR_SHARED_TEXTURES_FRAMERATE_DEFAULT = 60 // Used when the shared textures are enabled.
const CEF_TIMER_MINIMUM = 0x0000000A
const CEF_TIMER_MAXIMUM = 0x7FFFFFFF
const CEF_TIMER_MAXDELAY = 1000 / CEF_OSR_FRAMERATE_DEFAULT
const CEF_TIMER_DEPLETEWORK_CYCLES = 10
const CEF_TIMER_DEPLETEWORK_DELAY = 50
// /include/internal/cef_types.h (cef_touch_event_type_t)
type TCefTouchEeventType = types.Int32
const (
CEF_TET_RELEASED = TCefTouchEeventType(iota)
CEF_TET_PRESSED
CEF_TET_MOVED
CEF_TET_CANCELLED
)
// /include/internal/cef_types.h (cef_pointer_type_t)
type TCefPointerType = types.Int32
const (
CEF_POINTER_TYPE_TOUCH = TCefPointerType(iota)
CEF_POINTER_TYPE_MOUSE
CEF_POINTER_TYPE_PEN
CEF_POINTER_TYPE_ERASER
CEF_POINTER_TYPE_UNKNOWN
)
// /include/internal/cef_types.h (cef_mouse_button_type_t)
type TCefMouseButtonType = types.Int32
const (
MBT_LEFT = TCefMouseButtonType(iota)
MBT_MIDDLE
MBT_RIGHT
)
// 进程消息错误码
type ProcessMessageError = types.Int32
const (
PME_OK ProcessMessageError = iota + 1 //发送成功
PMErr_NOT_FOUND_FRAME ProcessMessageError = -1 //没找到Frame
PMErr_TARGET_PROCESS ProcessMessageError = -2 //目标进程标识错误
PMErr_NAME_IS_NULL ProcessMessageError = -3 //消息名称为空
PMErr_NO_INVALID_FRAME ProcessMessageError = -4 //无效的Frame
PMErr_REQUIRED_PARAMS_IS_NULL ProcessMessageError = -5 //必要参数为空
PMErr_NAME_CANNOT_USED ProcessMessageError = -6 //不能使用的消息名称
)
// /include/internal/cef_types.h (cef_window_open_disposition_t)
type TCefWindowOpenDisposition = types.Int32
const (
WOD_UNKNOWN = TCefWindowOpenDisposition(iota)
WOD_CURRENT_TAB
WOD_SINGLETON_TAB
WOD_NEW_FOREGROUND_TAB
WOD_NEW_BACKGROUND_TAB
WOD_NEW_POPUP
WOD_NEW_WINDOW
WOD_SAVE_TO_DISK
WOD_OFF_THE_RECORD
WOD_IGNORE_ACTION
WOD_SWITCH_TO_TAB
WOD_NEW_PICTURE_IN_PICTURE
)
// WINDOW_TYPE 窗口类型
type WINDOW_TYPE = types.Int8
const (
WT_MAIN_BROWSER = WINDOW_TYPE(iota) // 主窗口 只允许有一个, 如果自己创建窗口需要设置为 WT_POPUP_SUB_BROWSER 子窗口选项
WT_POPUP_SUB_BROWSER // 子窗口 允许有多个
WT_DEV_TOOLS // 开发者工具窗口
WT_VIEW_SOURCE // 显示源代码窗口
)
// /include/internal/cef_types.h (cef_context_menu_type_flags_t)
type TCefContextMenuTypeFlags = types.UInt32
const (
// No node is selected.
CM_TYPEFLAG_NONE TCefContextMenuTypeFlags = 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
)
// /include/internal/cef_types.h (cef_context_menu_media_state_flags_t)
type TCefContextMenuMediaStateFlags = types.UInt32
const (
CM_MEDIAFLAG_NONE TCefContextMenuMediaStateFlags = 0
CM_MEDIAFLAG_IN_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_CAN_TOGGLE_CONTROLS = 1 << 6
CM_MEDIAFLAG_CONTROLS = 1 << 7
CM_MEDIAFLAG_CAN_PRINT = 1 << 8
CM_MEDIAFLAG_CAN_ROTATE = 1 << 9
CM_MEDIAFLAG_CAN_PICTURE_IN_PICTURE = 1 << 10
CM_MEDIAFLAG_PICTURE_IN_PICTURE = 1 << 11
CM_MEDIAFLAG_CAN_LOOP = 1 << 12
)
// /include/internal/cef_types.h (cef_context_menu_edit_state_flags_t)
type TCefContextMenuEditStateFlags = types.UInt32
const (
CM_EDITFLAG_NONE TCefContextMenuEditStateFlags = 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
CM_EDITFLAG_CAN_EDIT_RICHLY = 1 << 8
)
// /include/internal/cef_types.h (cef_menu_anchor_position_t)
type TCefMenuAnchorPosition = types.Int32
const (
CEF_MENU_ANCHOR_TOPLEFT = TCefMenuAnchorPosition(iota)
CEF_MENU_ANCHOR_TOPRIGHT
CEF_MENU_ANCHOR_BOTTOMCENTER
)
// /include/internal/cef_types.h (cef_docking_mode_t)
type TCefDockingMode = types.Int32
const (
CEF_DOCKING_MODE_TOP_LEFT TCefDockingMode = iota + 1
CEF_DOCKING_MODE_TOP_RIGHT
CEF_DOCKING_MODE_BOTTOM_LEFT
CEF_DOCKING_MODE_BOTTOM_RIGHT
CEF_DOCKING_MODE_CUSTOM
)
// /include/internal/cef_types.h (cef_show_state_t)4
type TCefShowState = types.Int32
const (
CEF_SHOW_STATE_NORMAL = TCefShowState(1)
CEF_SHOW_STATE_MINIMIZED = TCefShowState(2)
CEF_SHOW_STATE_MAXIMIZED = TCefShowState(3)
CEF_SHOW_STATE_FULLSCREEN = TCefShowState(4)
)
// /include/internal/cef_types.h (cef_chrome_toolbar_type_t)
type TCefChromeToolbarType = types.Int32
const (
CEF_CTT_NONE = TCefChromeToolbarType(1)
CEF_CTT_NORMAL = TCefChromeToolbarType(2)
CEF_CTT_LOCATION = TCefChromeToolbarType(3)
)
// /include/internal/cef_types.h (cef_drag_operations_mask_t)
type TCefDragOperations = types.Cardinal
const (
DRAG_OPERATION_NONE TCefDragOperations = 0
DRAG_OPERATION_COPY TCefDragOperations = 1 << 0
DRAG_OPERATION_LINK TCefDragOperations = 1 << 1
DRAG_OPERATION_GENERIC TCefDragOperations = 1 << 2
DRAG_OPERATION_PRIVATE TCefDragOperations = 1 << 3
DRAG_OPERATION_MOVE TCefDragOperations = 1 << 4
DRAG_OPERATION_DELETE TCefDragOperations = 1 << 5
DRAG_OPERATION_EVERY TCefDragOperations = math.MaxUint32
)
// /include/internal/cef_types.h (cef_drag_operations_mask_t)
type TCefDragOperation = TCefDragOperations
type TrayType int8
const (
TRAY_SYS TrayType = iota
TRAY_LCL
)
// CombineRgn Mode flags
type RNGFnCombineMode = int32
const (
RGN_AND RNGFnCombineMode = iota + 1
RGN_OR
RGN_XOR
RGN_DIFF
RGN_COPY
)
type TCefWebRTCHandlingPolicy = types.Int32
const (
HpDefault TCefWebRTCHandlingPolicy = iota
HpDefaultPublicAndPrivateInterfaces
HpDefaultPublicInterfaceOnly
HpDisableNonProxiedUDP
)
// Values used by the battery saver mode state preference
// https://source.chromium.org/chromium/chromium/src/+/main:components/performance_manager/public/user_tuning/prefs.h
type TCefBatterySaverModeState = types.Int32
const (
BsmsDisabled TCefBatterySaverModeState = iota
BsmsEnabledBelowThreshold
BsmsEnabledOnBattery
BsmsEnabled
BsmsDefault // Custom value used to update the preferences only when there's a non-default value
)
// Used in TChromium preferences to allow or block cookies.
type TCefCookiePref = types.Int32
const (
CpDefault TCefCookiePref = iota
CpAllow
CpBlock
)
// https://chromium.googlesource.com/chromium/src/+/refs/tags/77.0.3865.90/chrome/common/net/safe_search_util.h (YouTubeRestrictMode)
// https://www.chromium.org/administrators/policy-list-3#ForceYouTubeRestrict
type YouTubeRestrict = types.Int32
const (
YOUTUBE_RESTRICT_OFF YouTubeRestrict = iota
YOUTUBE_RESTRICT_MODERATE
YOUTUBE_RESTRICT_STRICT
)
type ZoomStep = byte
const (
ZOOM_STEP_25 ZoomStep = 0
ZOOM_STEP_33 ZoomStep = 1
ZOOM_STEP_50 ZoomStep = 2
ZOOM_STEP_67 ZoomStep = 3
ZOOM_STEP_75 ZoomStep = 4
ZOOM_STEP_90 ZoomStep = 5
ZOOM_STEP_100 ZoomStep = 6
ZOOM_STEP_110 ZoomStep = 7
ZOOM_STEP_125 ZoomStep = 8
ZOOM_STEP_150 ZoomStep = 9
ZOOM_STEP_175 ZoomStep = 10
ZOOM_STEP_200 ZoomStep = 11
ZOOM_STEP_250 ZoomStep = 12
ZOOM_STEP_300 ZoomStep = 13
ZOOM_STEP_400 ZoomStep = 14
ZOOM_STEP_500 ZoomStep = 15
ZOOM_STEP_UNK ZoomStep = 16
ZOOM_STEP_MIN ZoomStep = ZOOM_STEP_25
ZOOM_STEP_MAX ZoomStep = ZOOM_STEP_500
ZOOM_STEP_DEF ZoomStep = ZOOM_STEP_100
)
// /include/internal/cef_types.h (cef_v8_accesscontrol_t)
type TCefV8AccessControls = types.Cardinal
const (
V8_ACCESS_CONTROL_DEFAULT TCefV8AccessControls = 0
V8_ACCESS_CONTROL_ALL_CAN_READ TCefV8AccessControls = 1 << 0
V8_ACCESS_CONTROL_ALL_CAN_WRITE TCefV8AccessControls = 1 << 1
V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING TCefV8AccessControls = 1 << 2
)
// /include/internal/cef_types.h (cef_v8_propertyattribute_t)
type TCefV8PropertyAttributes = types.Cardinal
const (
V8_PROPERTY_ATTRIBUTE_NONE TCefV8PropertyAttributes = 0
V8_PROPERTY_ATTRIBUTE_READONLY TCefV8PropertyAttributes = 1 << 0
V8_PROPERTY_ATTRIBUTE_DONTENUM TCefV8PropertyAttributes = 1 << 1
V8_PROPERTY_ATTRIBUTE_DONTDELETE TCefV8PropertyAttributes = 1 << 2
)
// /include/internal/cef_types.h (cef_value_type_t)
type TCefValueType = types.Int32
const (
VTYPE_INVALID TCefValueType = iota
VTYPE_NULL
VTYPE_BOOL
VTYPE_INT
VTYPE_DOUBLE
VTYPE_STRING
VTYPE_BINARY
VTYPE_DICTIONARY // Object
VTYPE_LIST // JSONArray
)
// /include/internal/cef_types.h (cef_postdataelement_type_t)
type TCefPostDataElementType = types.Int32
const (
PDE_TYPE_EMPTY TCefPostDataElementType = iota
PDE_TYPE_BYTES
PDE_TYPE_FILE
)
type TCefAutoplayPolicy = types.Int32
const (
AppDefault TCefAutoplayPolicy = iota
AppDocumentUserActivationRequired
AppNoUserGestureRequired
AppUserGestureRequired
)
// Values used by the --net-log-capture-mode command line switch.
// Sets the granularity of events to capture in the network log.
// https://source.chromium.org/chromium/chromium/src/+/main:content/browser/network_service_instance_impl.cc
// https://source.chromium.org/chromium/chromium/src/+/main:net/log/net_log_capture_mode.h
type TCefNetLogCaptureMode = types.Int32
const (
NlcmDefault TCefNetLogCaptureMode = iota
NlcmIncludeSensitive
NlcmEverything
)
type TCefProcessType types.Int32
const (
PtBrowser TCefProcessType = iota
PtRenderer
PtZygote
PtGPU
PtUtility
PtBroker
PtCrashpad
PtOther
)
type TCefProcessTypeValue types.String
const (
PtvBrowser TCefProcessTypeValue = "browser"
PtvRenderer TCefProcessTypeValue = "renderer"
PtvZygote TCefProcessTypeValue = "zygote"
PtvGPU TCefProcessTypeValue = "GPU"
PtvUtility TCefProcessTypeValue = "utility"
PtvBroker TCefProcessTypeValue = "broker"
PtvCrashpad TCefProcessTypeValue = "crashpad"
PtvOther TCefProcessTypeValue = "other"
)
type TCefApplicationStatus = types.Int32
const (
AsLoading TCefApplicationStatus = iota
AsLoaded
AsInitialized
AsShuttingDown
AsUnloaded
AsErrorMissingFiles
AsErrorDLLVersion
AsErrorLoadingLibrary
AsErrorInitializingLibrary
AsErrorExecutingProcess
)
// net error
type CEF_NET_ERROR = types.Int32
const (
ERR_NONE CEF_NET_ERROR = 0
ERR_IO_PENDING CEF_NET_ERROR = -1
ERR_FAILED CEF_NET_ERROR = -2
ERR_ABORTED CEF_NET_ERROR = -3
ERR_INVALID_ARGUMENT CEF_NET_ERROR = -4
ERR_INVALID_HANDLE CEF_NET_ERROR = -5
ERR_FILE_NOT_FOUND CEF_NET_ERROR = -6
ERR_TIMED_OUT CEF_NET_ERROR = -7
ERR_FILE_TOO_BIG CEF_NET_ERROR = -8
ERR_UNEXPECTED CEF_NET_ERROR = -9
ERR_ACCESS_DENIED CEF_NET_ERROR = -10
ERR_NOT_IMPLEMENTED CEF_NET_ERROR = -11
ERR_INSUFFICIENT_RESOURCES CEF_NET_ERROR = -12
ERR_OUT_OF_MEMORY CEF_NET_ERROR = -13
ERR_UPLOAD_FILE_CHANGED CEF_NET_ERROR = -14
ERR_SOCKET_NOT_CONNECTED CEF_NET_ERROR = -15
ERR_FILE_EXISTS CEF_NET_ERROR = -16
ERR_FILE_PATH_TOO_LONG CEF_NET_ERROR = -17
ERR_FILE_NO_SPACE CEF_NET_ERROR = -18
ERR_FILE_VIRUS_INFECTED CEF_NET_ERROR = -19
ERR_BLOCKED_BY_CLIENT CEF_NET_ERROR = -20
ERR_NETWORK_CHANGED CEF_NET_ERROR = -21
ERR_BLOCKED_BY_ADMINISTRATOR CEF_NET_ERROR = -22
ERR_SOCKET_IS_CONNECTED CEF_NET_ERROR = -23
ERR_BLOCKED_ENROLLMENT_CHECK_PENDING CEF_NET_ERROR = -24
ERR_UPLOAD_STREAM_REWIND_NOT_SUPPORTED CEF_NET_ERROR = -25
ERR_CONTEXT_SHUT_DOWN CEF_NET_ERROR = -26
ERR_BLOCKED_BY_RESPONSE CEF_NET_ERROR = -27
ERR_BLOCKED_BY_XSS_AUDITOR CEF_NET_ERROR = -28
ERR_CLEARTEXT_NOT_PERMITTED CEF_NET_ERROR = -29
ERR_CONNECTION_CLOSED CEF_NET_ERROR = -100
ERR_CONNECTION_RESET CEF_NET_ERROR = -101
ERR_CONNECTION_REFUSED CEF_NET_ERROR = -102
ERR_CONNECTION_ABORTED CEF_NET_ERROR = -103
ERR_CONNECTION_FAILED CEF_NET_ERROR = -104
ERR_NAME_NOT_RESOLVED CEF_NET_ERROR = -105
ERR_INTERNET_DISCONNECTED CEF_NET_ERROR = -106
ERR_SSL_PROTOCOL_ERROR CEF_NET_ERROR = -107
ERR_ADDRESS_INVALID CEF_NET_ERROR = -108
ERR_ADDRESS_UNREACHABLE CEF_NET_ERROR = -109
ERR_SSL_CLIENT_AUTH_CERT_NEEDED CEF_NET_ERROR = -110
ERR_TUNNEL_CONNECTION_FAILED CEF_NET_ERROR = -111
ERR_NO_SSL_VERSIONS_ENABLED CEF_NET_ERROR = -112
ERR_SSL_VERSION_OR_CIPHER_MISMATCH CEF_NET_ERROR = -113
ERR_SSL_RENEGOTIATION_REQUESTED CEF_NET_ERROR = -114
ERR_PROXY_AUTH_UNSUPPORTED CEF_NET_ERROR = -115
ERR_CERT_ERROR_IN_SSL_RENEGOTIATION CEF_NET_ERROR = -116
ERR_BAD_SSL_CLIENT_AUTH_CERT CEF_NET_ERROR = -117
ERR_CONNECTION_TIMED_OUT CEF_NET_ERROR = -118
ERR_HOST_RESOLVER_QUEUE_TOO_LARGE CEF_NET_ERROR = -119
ERR_SOCKS_CONNECTION_FAILED CEF_NET_ERROR = -120
ERR_SOCKS_CONNECTION_HOST_UNREACHABLE CEF_NET_ERROR = -121
ERR_ALPN_NEGOTIATION_FAILED CEF_NET_ERROR = -122
ERR_SSL_NO_RENEGOTIATION CEF_NET_ERROR = -123
ERR_WINSOCK_UNEXPECTED_WRITTEN_BYTES CEF_NET_ERROR = -124
ERR_SSL_DECOMPRESSION_FAILURE_ALERT CEF_NET_ERROR = -125
ERR_SSL_BAD_RECORD_MAC_ALERT CEF_NET_ERROR = -126
ERR_PROXY_AUTH_REQUESTED CEF_NET_ERROR = -127
ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY CEF_NET_ERROR = -129
ERR_PROXY_CONNECTION_FAILED CEF_NET_ERROR = -130
ERR_MANDATORY_PROXY_CONFIGURATION_FAILED CEF_NET_ERROR = -131
ERR_PRECONNECT_MAX_SOCKET_LIMIT CEF_NET_ERROR = -133
ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED CEF_NET_ERROR = -134
ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY CEF_NET_ERROR = -135
ERR_PROXY_CERTIFICATE_INVALID CEF_NET_ERROR = -136
ERR_NAME_RESOLUTION_FAILED CEF_NET_ERROR = -137
ERR_NETWORK_ACCESS_DENIED CEF_NET_ERROR = -138
ERR_TEMPORARILY_THROTTLED CEF_NET_ERROR = -139
ERR_HTTPS_PROXY_TUNNEL_RESPONSE_REDIRECT CEF_NET_ERROR = -140
ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED CEF_NET_ERROR = -141
ERR_MSG_TOO_BIG CEF_NET_ERROR = -142
ERR_SPDY_SESSION_ALREADY_EXISTS CEF_NET_ERROR = -143
ERR_WS_PROTOCOL_ERROR CEF_NET_ERROR = -145
ERR_ADDRESS_IN_USE CEF_NET_ERROR = -147
ERR_SSL_HANDSHAKE_NOT_COMPLETED CEF_NET_ERROR = -148
ERR_SSL_BAD_PEER_PUBLIC_KEY CEF_NET_ERROR = -149
ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN CEF_NET_ERROR = -150
ERR_CLIENT_AUTH_CERT_TYPE_UNSUPPORTED CEF_NET_ERROR = -151
ERR_ORIGIN_BOUND_CERT_GENERATION_TYPE_MISMATCH CEF_NET_ERROR = -152
ERR_SSL_DECRYPT_ERROR_ALERT CEF_NET_ERROR = -153
ERR_WS_THROTTLE_QUEUE_TOO_LARGE CEF_NET_ERROR = -154
ERR_SSL_SERVER_CERT_CHANGED CEF_NET_ERROR = -156
ERR_SSL_UNRECOGNIZED_NAME_ALERT CEF_NET_ERROR = -159
ERR_SOCKET_SET_RECEIVE_BUFFER_SIZE_ERROR CEF_NET_ERROR = -160
ERR_SOCKET_SET_SEND_BUFFER_SIZE_ERROR CEF_NET_ERROR = -161
ERR_SOCKET_RECEIVE_BUFFER_SIZE_UNCHANGEABLE CEF_NET_ERROR = -162
ERR_SOCKET_SEND_BUFFER_SIZE_UNCHANGEABLE CEF_NET_ERROR = -163
ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT CEF_NET_ERROR = -164
ERR_ICANN_NAME_COLLISION CEF_NET_ERROR = -166
ERR_SSL_SERVER_CERT_BAD_FORMAT CEF_NET_ERROR = -167
ERR_CT_STH_PARSING_FAILED CEF_NET_ERROR = -168
ERR_CT_STH_INCOMPLETE CEF_NET_ERROR = -169
ERR_UNABLE_TO_REUSE_CONNECTION_FOR_PROXY_AUTH CEF_NET_ERROR = -170
ERR_CT_CONSISTENCY_PROOF_PARSING_FAILED CEF_NET_ERROR = -171
ERR_SSL_OBSOLETE_CIPHER CEF_NET_ERROR = -172
ERR_WS_UPGRADE CEF_NET_ERROR = -173
ERR_READ_IF_READY_NOT_IMPLEMENTED CEF_NET_ERROR = -174
ERR_SSL_VERSION_INTERFERENCE CEF_NET_ERROR = -175
ERR_NO_BUFFER_SPACE CEF_NET_ERROR = -176
ERR_SSL_CLIENT_AUTH_NO_COMMON_ALGORITHMS CEF_NET_ERROR = -177
ERR_EARLY_DATA_REJECTED CEF_NET_ERROR = -178
ERR_WRONG_VERSION_ON_EARLY_DATA CEF_NET_ERROR = -179
ERR_TLS13_DOWNGRADE_DETECTED CEF_NET_ERROR = -180
ERR_SSL_KEY_USAGE_INCOMPATIBLE CEF_NET_ERROR = -181
ERR_CERT_COMMON_NAME_INVALID CEF_NET_ERROR = -200
ERR_CERT_DATE_INVALID CEF_NET_ERROR = -201
ERR_CERT_AUTHORITY_INVALID CEF_NET_ERROR = -202
ERR_CERT_CONTAINS_ERRORS CEF_NET_ERROR = -203
ERR_CERT_NO_REVOCATION_MECHANISM CEF_NET_ERROR = -204
ERR_CERT_UNABLE_TO_CHECK_REVOCATION CEF_NET_ERROR = -205
ERR_CERT_REVOKED CEF_NET_ERROR = -206
ERR_CERT_INVALID CEF_NET_ERROR = -207
ERR_CERT_WEAK_SIGNATURE_ALGORITHM CEF_NET_ERROR = -208
ERR_CERT_NON_UNIQUE_NAME CEF_NET_ERROR = -210
ERR_CERT_WEAK_KEY CEF_NET_ERROR = -211
ERR_CERT_NAME_CONSTRAINT_VIOLATION CEF_NET_ERROR = -212
ERR_CERT_VALIDITY_TOO_LONG CEF_NET_ERROR = -213
ERR_CERTIFICATE_TRANSPARENCY_REQUIRED CEF_NET_ERROR = -214