-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCEF_LCL_WorkScheduler.inc
176 lines (160 loc) · 4.75 KB
/
CEF_LCL_WorkScheduler.inc
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
//----------------------------------------
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Lazarus.modifiedLGPL
//----------------------------------------
procedure CEFWorkScheduler_StopScheduler(); extdecl;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
GlobalCEFWorkScheduler.StopScheduler;
handleExceptionEnd
end;
procedure CEFWorkScheduler_Create(const AOwner: TComponent; out Result: TCEFWorkScheduler); extdecl;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler = nil then
GlobalCEFWorkScheduler := TCEFWorkScheduler.Create(AOwner);
Result := GlobalCEFWorkScheduler;
handleExceptionEnd
end;
procedure CEFWorkScheduler_CreateDelayed(out Result: TCEFWorkScheduler); extdecl;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler = nil then
GlobalCEFWorkScheduler := TCEFWorkScheduler.CreateDelayed;
Result := GlobalCEFWorkScheduler;
handleExceptionEnd
end;
procedure CEFWorkScheduler_CreateThread(); extdecl;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
GlobalCEFWorkScheduler.CreateThread;
handleExceptionEnd
end;
procedure CEFWorkScheduler_Destroy(); extdecl;
begin
handleExceptionBegin
DestroyGlobalCEFWorkScheduler;
handleExceptionEnd
end;
function CEFWorkScheduler_GetPriority(): TThreadPriority; extdecl;// default tpNormal;
begin
Result := tpNormal;
handleExceptionBegin
{$IFDEF MSWINDOWS}
{$WARN SYMBOL_PLATFORM OFF}
if GlobalCEFWorkScheduler <> nil then
begin
Result := GlobalCEFWorkScheduler.Priority;
end;
{$WARN SYMBOL_PLATFORM ON}
{$ENDIF}
handleExceptionEnd
end;
procedure CEFWorkScheduler_SetPriority(AValue: Integer); extdecl;// default tpNormal;
begin
handleExceptionBegin
{$IFDEF MSWINDOWS}
{$WARN SYMBOL_PLATFORM OFF}
if GlobalCEFWorkScheduler <> nil then
begin
GlobalCEFWorkScheduler.Priority := TThreadPriority(AValue);
end;
{$WARN SYMBOL_PLATFORM ON}
{$ENDIF}
handleExceptionEnd
end;
function CEFWorkScheduler_GetDefaultInterval(): integer; extdecl; // default CEF_TIMER_MAXDELAY;
begin
Result := CEF_TIMER_MAXDELAY;
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
Result := GlobalCEFWorkScheduler.DefaultInterval;
end;
handleExceptionEnd
end;
function CEFWorkScheduler_GetDepleteWorkCycles(): cardinal; extdecl; // default CEF_TIMER_DEPLETEWORK_CYCLES;
begin
Result := CEF_TIMER_DEPLETEWORK_CYCLES;
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
Result := GlobalCEFWorkScheduler.DepleteWorkCycles;
end;
handleExceptionEnd
end;
function CEFWorkScheduler_GetDepleteWorkDelay(): cardinal; extdecl; // default CEF_TIMER_DEPLETEWORK_DELAY;
begin
Result := CEF_TIMER_DEPLETEWORK_DELAY;
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
Result := GlobalCEFWorkScheduler.DepleteWorkDelay;
end;
handleExceptionEnd
end;
function CEFWorkScheduler_GetUseQueueThread(): LongBool; extdecl; // default False;
begin
Result := False;
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
Result := GlobalCEFWorkScheduler.UseQueueThread;
end;
handleExceptionEnd
end;
procedure CEFWorkScheduler_SetDefaultInterval(AValue: integer); extdecl; // default CEF_TIMER_MAXDELAY;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
GlobalCEFWorkScheduler.DefaultInterval := AValue;
end;
handleExceptionEnd
end;
procedure CEFWorkScheduler_SetDepleteWorkCycles(AValue: cardinal); extdecl; // default CEF_TIMER_DEPLETEWORK_CYCLES;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
GlobalCEFWorkScheduler.DepleteWorkCycles := AValue;
end;
handleExceptionEnd
end;
procedure CEFWorkScheduler_SetDepleteWorkDelay(AValue: cardinal); extdecl; // default CEF_TIMER_DEPLETEWORK_DELAY;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
GlobalCEFWorkScheduler.DepleteWorkDelay := AValue;
end;
handleExceptionEnd
end;
procedure CEFWorkScheduler_SetUseQueueThread(AValue: LongBool); extdecl; // default False;
begin
handleExceptionBegin
if GlobalCEFWorkScheduler <> nil then
begin
GlobalCEFWorkScheduler.UseQueueThread := AValue;
end;
handleExceptionEnd
end;
exports
CEFWorkScheduler_StopScheduler,
CEFWorkScheduler_Create,
CEFWorkScheduler_CreateDelayed,
CEFWorkScheduler_CreateThread,
CEFWorkScheduler_Destroy,
CEFWorkScheduler_GetPriority,
CEFWorkScheduler_SetPriority,
CEFWorkScheduler_GetDefaultInterval,
CEFWorkScheduler_GetDepleteWorkCycles,
CEFWorkScheduler_GetDepleteWorkDelay,
CEFWorkScheduler_GetUseQueueThread,
CEFWorkScheduler_SetDefaultInterval,
CEFWorkScheduler_SetDepleteWorkCycles,
CEFWorkScheduler_SetDepleteWorkDelay,
CEFWorkScheduler_SetUseQueueThread;