-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathApus.Engine.UIScene.pas
651 lines (579 loc) · 20.9 KB
/
Apus.Engine.UIScene.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
// Common useful UI-related classes and routines
//
// Copyright (C) 2003-2004 Ivan Polyacov, Apus Software (ivan@apus-software.com)
// This file is licensed under the terms of BSD-3 license (see license.txt)
// This file is a part of the Apus Game Engine (http://apus-software.com/engine/)
unit Apus.Engine.UIScene;
interface
uses Apus.Crossplatform, Apus.Types, Apus.Engine.Scene, Apus.Engine.UITypes;
var
defaultScale:single=1.0;
windowScale:single=1.0;
const
defaultHintStyle:integer=0; // style of hints, can be changed
modalShadowColor:cardinal=0; // color of global "under modal" shadow
type
// Very useful simple scene that contains an UI layer
// Almost all game scenes can be instances from this type, however sometimes
// it is reasonable to use different scene(s)
TUIScene=class(TGameScene)
UI:TUIElement; // root UI element: size = render area size
frameTime:int64; // time elapsed from the last frame
constructor Create(scenename:string='';fullScreen:boolean=true);
procedure SetStatus(st:TSceneStatus); override;
function Process:boolean; override;
procedure Render; override;
procedure onResize; override;
function GetArea:TRect; override; // screen area occupied by any non-transparent UI elements (i.e. which part of screen can't be ignored)
procedure WriteKey(key:cardinal); override;
procedure onMouseMove(x,y:integer); override;
procedure onMouseBtn(btn:byte;pressed:boolean); override;
procedure onMouseWheel(delta:integer); override;
// These are markers for drawing scenes background to properly handle alpha channel of the render target to avoid wrong alpha blending
// This is important ONLY if you are drawing semi-transparent pixels over the undefined (previous) content
procedure BackgroundRenderBegin; virtual;
procedure BackgroundRenderEnd; virtual;
private
lastRenderTime:int64;
// prevModal:TUIControl;
end;
// Get scene by name
function UIScene(name:String8):TUIScene;
// No need to call manually as it is called when any UIScene object is created
procedure InitUI;
// Установка размера (виртуального) экрана для UI (зачем!?)
procedure SetDisplaySize(width,height:integer);
// Создать всплывающее окно, прицепить его к указанному предку
procedure ShowSimpleHint(msg:string;parent:TUIElement;x,y,time:integer;font:cardinal=0);
implementation
uses SysUtils, Types,
Apus.Common, Apus.EventMan, Apus.Publics, Apus.Geom2D,
Apus.Engine.UI, Apus.Engine.UIWidgets, Apus.Engine.UIRender,
Apus.Engine.CmdProc, Apus.Engine.Console, Apus.Engine.API;
const
statuses:array[TSceneStatus] of string=('frozen','background','active');
var
curCursor:integer;
initialized:boolean=false;
rootWidth,rootHeight,oldRootWidth,oldAreaHeight:integer; // размер области отрисовки
LastHandleTime:int64;
// параметры хинтов
curHint:TUIHint=nil;
hintRect:tRect; // область, к которой относится хинт
// переменные для работы с хинтами элементов
hintMode:cardinal; // время (в тиках), до которого длится режим показа хинтов
// в этом режиме хинты выпадают гораздо быстрее
itemShowHintTime:cardinal; // момент времени, когда элемент должен показать хинт
lastHint:string; // текст хинта, соответствующего элементу, над которым была мышь в предыдущем кадре
designMode:boolean; // режим "дизайна", в котором можно таскать элементы по экрану правой кнопкой мыши
hookedItem:TUIElement; // element to drag with mouse
curShadowValue,oldShadowValue,needShadowValue:integer; // 0..255
startShadowChange,shadowChangeDuration:int64;
lastShiftState:byte;
function UIScene(name:String8):TUIScene;
var
scene:TObject;
begin
scene:=TUIScene.FindByName(name);
ASSERT(scene<>nil,'Scene '+name+' not found!');
ASSERT(scene is TUIScene,'Scene '+name+' is not a TUIScene');
result:=scene as TUIScene;
end;
procedure SetDisplaySize(width,height:integer);
begin
LogMessage('UIScene.SDS');
oldRootWidth:=rootWidth;
oldAreaHeight:=rootHeight;
rootWidth:=width;
rootHeight:=height;
end;
procedure ShowSimpleHint(msg:string;parent:TUIElement;x,y,time:integer;font:cardinal=0);
var
hint:TUIHint;
i:integer;
begin
LogMessage('ShowHint: '+msg);
msg:=Translate(Str16(msg));
if (x=-1) or (y=-1) then begin
x:=curMouseX; y:=curMouseY;
hintRect:=Rect(x-8,y-8,x+8,y+8);
end else begin
hintRect:=Rect(0,0,4000,4000);
end;
if parent=nil then begin
FindElementAt(x,y,parent);
if parent=nil then begin
for i:=0 to high(rootElements) do
if rootElements[i].visible then begin
parent:=rootElements[i]; break;
end;
end else
parent:=parent.GetRoot;
end;
if curhint<>nil then begin
LogMessage('Free previous hint');
curHint.Free;
curHint:=nil;
end;
hint:=TUIHint.Create(X/parent.scale,(Y+10)/parent.scale,msg,parent);
hint.font:=font;
hint.styleClass:=defaultHintStyle;
hint.timer:=time;
hint.order:=10000; // Top
curhint:=hint;
LogMessage('Hint created '+inttohex(cardinal(hint),8));
end;
procedure ActivateEventHandler(event:TEventStr;tag:TTag);
begin
EnterCriticalSection(UICritSect);
try
if tag=0 then
SetFocusTo(nil);
finally
LeaveCriticalSection(UICritSect);
end;
end;
procedure SetUnderMouse(e:TUIElement);
begin
Apus.Engine.UITypes.underMouse:=e;
end;
procedure MouseEventHandler(event:TEventStr;tag:TTag);
var
c,c2:TUIElement;
e1,e2,e:boolean;
x,y:integer;
time:int64;
st:string;
begin
event:=UpperCase(copy(event,7,length(event)-6));
EnterCriticalSection(UICritSect);
time:=MyTickCount;
try
// обновить положение курсора если оно устарело
if event='UPDATEPOS' then begin
Signal('Engine\Cmd\UpdateMousePos');
end;
// Движение
if event='MOVE' then begin
oldMouseX:=curMouseX; oldMouseY:=curMouseY;
curMouseX:=SmallInt(tag and $FFFF); curMouseY:=SmallInt((tag shr 16) and $FFFF);
if ClipMouse<>cmNo then with clipMouseRect do begin
x:=curMouseX; y:=curMouseY;
if X<left then x:=left;
if X>=right then x:=right-1;
if Y<top then y:=top;
if Y>=bottom then y:=bottom-1;
if (clipMouse in [cmReal,cmLimited]) and ((curMouseX<>x) or (curMouseY<>y)) then begin
if clipMouse=cmReal then exit;
end;
if clipmouse=cmVirtual then begin
curMouseX:=x; curMouseY:=y;
end;
end;
if (curMouseX=oldMouseX) and (curMouseY=oldMouseY) then exit;
// если мышь покинула прямоугольник хинта - стереть его
{$IFNDEF IOS}
if (curhint<>nil) and (curhint.visible) and
not PtInRect(hintRect,types.Point(curMouseX,curMouseY)) then curhint.Hide;
{$ENDIF}
if hookedItem<>nil then
hookedItem.MoveBy(curMouseX-oldMouseX,curMouseY-oldMouseY);
e1:=FindElementAt(oldMouseX,oldMouseY,c);
e2:=FindElementAt(curMouseX,curMouseY,c2);
if e2 then SetUnderMouse(c2)
else SetUnderMouse(nil);
if e1 then c.onMouseMove;
if e2 and (c2<>c) then c2.onMouseMove;
e2:=FindElementAt(curMouseX,curMouseY,c2);
// Курсор
if e2 and (c2.cursor<>curCursor) then begin
if curCursor<>CursorID.Default then begin
game.ToggleCursor(curCursor,false);
Signal('UI\Cursor\OFF',curCursor);
end;
curCursor:=c2.cursor;
game.ToggleCursor(curCursor,true);
Signal('UI\Cursor\ON',curCursor);
end;
if not e2 and (curCursor<>CursorID.Default) then begin
Signal('UI\Cursor\OFF',curCursor);
game.ToggleCursor(curCursor,false);
curCursor:=CursorID.Default;
game.ToggleCursor(curCursor);
end;
if c<>c2 then begin
// мышь перешла границу элемента
if c<>nil then Signal('UI\onMouseOut\'+c.ClassName+'\'+c.name);
if c2<>nil then Signal('UI\onMouseOver\'+c2.ClassName+'\'+c2.name);
end;
if (c2<>nil) and (c2.enabled and (c2.hint<>'') or not c2.enabled and (c2.hintIfDisabled<>'')) then begin
if c2.enabled then st:=c2.hint
else st:=c2.hintIfDisabled;
if st<>lastHint then begin
if st='' then begin
ItemShowHintTime:=0;
end else begin
// этот элемент должен показать хинт
if time<hintMode then ItemShowHintTime:=time+250
else ItemShowHintTime:=time+c2.hintDelay;
end;
end;
lastHint:=st;
end else begin
ItemShowHintTime:=0;
lastHint:='';
end;
if clipMouse=cmLimited then begin // запомним скорректированное положение, чтобы не "прыгать" назад
curMouseX:=x; curMouseY:=y;
end;
end;
// Нажатие кнопки
if copy(event,1,7)='BTNDOWN' then begin
c:=nil;
e:=FindElementAt(curMouseX,curMouseY,c);
if e and (c<>nil) then
c.onMouseButtons(tag,true)
else
if (c<>nil) and (not c.enabled) and (c.GetClassAttribute('handleMouseIfDisabled')) then
c.onMouseButtons(tag,true);
// DEBUG FACILITIES
// Drag elements with Ctrl+RMB
if (tag=2) and
(designmode or HasFlag(lastShiftState,sscCtrl)) then hookedItem:=c;
// Показать название и св-ва элемента
if (tag=3) and HasFlag(lastShiftState,sscCtrl) then
if c<>nil then begin
st:=c.name;
c2:=c;
while c2.parent<>nil do begin
c2:=c2.parent;
st:=c2.name+'->'+st;
end;
ShowSimpleHint(c.ClassName+'('+st+')',c.GetRoot,-1,-1,5000);
PutMsg(Format('%s: pos: %.1f,%.1f pivot: %.1f %.1f size: %.1f,%.1f gRect: (%d %d %d %d) ',
[c.name,c.position.x,c.position.y,c.pivot.x,c.pivot.y,c.size.x,c.size.y,
c.globalRect.Left,c.globalRect.top,c.globalRect.right,c.globalRect.bottom]));
if (game.shiftstate and 2>0) and (c.name<>'') then // Shift pressed => select item
ExecCmd('use '+c.name);
end else begin
st:='No opaque item here';
FindAnyElementAt(curMouseX,curMouseY,c);
if c<>nil then st:=st+'; '+c.ClassName+'('+c.name+')';
ShowSimpleHint(st,nil,-1,-1,500+4000*byte(c<>nil));
end;
end;
// Button release
if copy(event,1,5)='BTNUP' then begin
if (hookedItem<>nil) and (tag=2) then begin
PutMsg('x='+inttostr(round(hookeditem.position.x))+' y='+inttostr(round(hookeditem.position.y)));
hookedItem:=nil;
end;
if FindElementAt(curMouseX,curMouseY,c) then
c.onMouseButtons(tag,false);
end;
// Скроллинг
if copy(event,1,6)='SCROLL' then
if FindElementAt(curMouseX,curMouseY,c) then
c.onMouseScroll(tag);
finally
LeaveCriticalSection(UICritSect);
end;
end;
procedure PrintUIlog;
var
st:string;
begin
st:=' mouse clipping: '+inttostr(ord(clipMouse))+' ('+
inttostr(clipMouserect.left)+','+inttostr(clipMouserect.top)+':'+
inttostr(clipMouserect.right)+','+inttostr(clipMouserect.bottom)+')'#13#10;
st:=st+' Modal element: ';
if modalElement<>nil then st:=st+modalElement.name else st:=st+'none';
ForceLogMessage('UI state'#13#10+st);
end;
procedure KbdEventHandler(event:TEventStr;tag:TTag);
var
c:TUIElement;
shift:byte;
key,scancode:integer;
begin
EnterCriticalSection(UICritSect);
try
lastShiftState:=game.shiftState;
shift:=game.shiftState;
key:=GetKeyEventVirtualCode(tag); // virtual key code
scancode:=GetKeyEventScancode(tag);
event:=UpperCase(copy(event,5,length(event)-4));
if event='KEYDOWN' then // Win+Ctrl+S
if (key=ord('S')) and (shift=8+2) then PrintUILog;
c:=FocusedElement;
// No focused element - handle hotkey for all elements
if (event='KEYDOWN') and (c=nil) then begin
ProcessHotKey(key,shift);
exit;
end;
if c.IsEnabled then begin
if event='KEYDOWN' then
if c.onKey(key,true,shift) then
ProcessHotKey(key,shift); // Hotkey processing is allowed by onKey handler
if event='KEYUP' then
if not FocusedElement.onKey(key,false,shift) then exit;
{ if event='CHAR' then
focusedControl.onChar(chr(tag and $FF),tag shr 8);
if event='UNICHAR' then
focusedControl.onUniChar(WideChar(tag and $FFFF),tag shr 16);}
end;
finally
LeaveCriticalSection(UICritSect);
end;
end;
{ TUIScene }
constructor TUIScene.Create;
begin
InitUI;
inherited Create(fullscreen);
if sceneName='' then sceneName:=ClassName;
name:=scenename;
UI:=TUIElement.Create(rootWidth,rootHeight,nil,sceneName);
UI.enabled:=false;
UI.visible:=false;
if fullscreen then begin
UI.shape:=shapeFull;
UI.SetScale(defaultScale);
end else begin
// windowed
UI.shape:=shapeEmpty;
UI.SetScale(windowScale);
end;
if classType=TUIScene then onCreate;
if game<>nil then game.AddScene(self);
end;
function TUIScene.GetArea:TRect;
var
i:integer;
r:TRect;
begin
result:=Rect(0,0,0,0); // empty
if UI=nil then exit;
if UI.shape<>shapeEmpty then
result:=Rect(0,0,round(UI.size.x),round(UI.size.y));
for i:=0 to high(UI.children) do
with UI.children[i] do
if shape<>shapeEmpty then begin
r:=GetPosOnScreen;
if IsRectEmpty(result) then
result:=r
else
UnionRect(result,result,r); // именно в таком порядке, иначе - косяк!
end;
OffsetRect(result,round(UI.position.x),round(UI.position.y)); // actually, UI root shouldn't be displaced, but...
end;
procedure TUIScene.onMouseBtn(btn:byte;pressed:boolean);
begin
if (UI<>nil) and (not UI.enabled) then exit;
inherited;
end;
procedure TUIScene.onMouseMove(x,y:integer);
begin
if (UI<>nil) and (not UI.enabled) then exit;
inherited;
end;
procedure TUIScene.onMouseWheel(delta:integer);
begin
if (UI<>nil) and (not UI.enabled) then exit;
inherited;
if (modalElement=nil) or (modalElement=UI) then begin
Signal('UI\'+name+'\MouseWheel',delta);
end;
end;
procedure TUIScene.onResize;
begin
inherited;
rootWidth:=game.renderWidth;
rootHeight:=game.renderHeight;
if UI<>nil then UI.Resize(rootWidth,rootHeight);
end;
function TUIScene.Process: boolean;
var
delta:integer;
c:TUIElement;
time:cardinal;
st:string;
procedure ProcessElementTree(c:TUIElement);
var
cnt:integer;
list:TUIElements;
child:TUIElement;
begin
if c=nil then exit;
if c.timer>0 then
if c.timer<=delta then begin
c.timer:=0;
c.onTimer;
end else dec(c.timer,delta);
list:=c.children;
for child in list do ProcessElementTree(child);
end;
begin
result:=true;
Signal('Scenes\ProcessScene\'+name);
EnterCriticalSection(UICritSect);
// отложенное удаление элементов
// Размер корневого эл-та - полный экран
{ if (UI.ClassType=TUIControl) and (UI.x=0) and (UI.y=0) then begin
UI.width:=areaWidth;
UI.height:=areaHeight;
end;}
try
FindElementAt(curMouseX,curMouseY,c);
SetUnderMouse(c);
// Обработка фокуса: если элемент с фокусом невидим или недоступен - убрать с него фокус
// Исключение: корневой UI-элемент (при закрытии сцены фокус должен убрать эффект перехода)
c:=FocusedElement;
if c<>nil then begin
repeat
if not (c.visible and c.enabled) or
((modalElement<>nil) and (c.parent=nil) and (c<>modalElement)) then begin
SetFocusTo(nil);
LogMessage(UI.name);
break;
end;
c:=c.parent;
until (c=nil) or (c.parent=nil);
end;
// Обработка захвата: если элемент, захвативший мышь, невидим или недоступен - убрать захват и фокус
if hooked<>nil then begin
if not (hooked.IsVisible and hooked.IsEnabled) or
((modalElement<>nil) and (hooked.GetRoot<>modalElement)) then begin
hooked.onLostFocus;
hooked:=nil;
clipMouse:=cmNo;
end;
end;
if LastHandleTime=0 then begin // первая обработка скипается
LastHandleTime:=MyTickCount;
exit;
end;
time:=MyTickCount;
delta:=time-LastHandleTime;
ProcessElementTree(UI);
// обработка хинтов
if (itemShowHintTime>LastHandleTime) and (itemShowHintTime<=Time) then begin
FindElementAt(game.mouseX,game.mouseY,c);
if (c<>nil) then begin
if c.enabled then st:=c.hint
else st:=c.hintIfDisabled;
if st<>'' then begin
ShowSimpleHint(st,nil,-1,-1,c.hintDuration);
HintRect:=c.globalRect;
HintMode:=time+5000;
Signal('UI\onHint\'+c.ClassName+'\'+c.name);
end;
end;
end;
LastHandleTime:=time;
finally
LeaveCriticalSection(UICritSect);
end;
end;
// tag: low 8 bit - new shadow value, next 16 bit - duration in ms
procedure onSetGlobalShadow(event:TEventStr;tag:TTag);
begin
startShadowChange:=MyTickCount;
shadowChangeDuration:=tag shr 8;
oldShadowValue:=curShadowValue;
needShadowValue:=tag and $FF;
end;
//
procedure onSetFocus(event:TEventStr;tag:TTag);
begin
delete(event,1,length('UI\SETFOCUS\'));
if (event<>'') and (event<>'NIL') then
FindElement(event,true).setFocus
else
SetFocusTo(nil);
end;
procedure TUIScene.Render;
var
t:int64;
begin
t:=MyTickCount;
if t>=lastRenderTime then
frametime:=t-lastRenderTime
else begin
frameTime:=1;
ForceLogMessage('Kosyak! '+inttostr(t)+' '+inttostr(lastRenderTime));
end;
lastRenderTime:=t;
//Apus.Engine.UIRender.Frametime:=frametime;
Signal('Scenes\'+name+'\BeforeRender');
StartMeasure(11);
if UI<>nil then begin
Signal('Scenes\'+name+'\BeforeUIRender');
EnterCriticalSection(UICritSect);
try
try
DrawUI(UI);
except
on e:exception do raise EError.Create('UI.DrawUI '+name+' Err '+e.message);
end;
finally
LeaveCriticalSection(UICritSect);
end;
Signal('Scenes\'+name+'\AfterUIRender');
end;
EndMeasure2(11);
end;
procedure InitUI;
begin
if initialized then exit;
// асинхронная обработка: сигналы обрабатываются в том же потоке, что и вызываются,
// независимо от того из какого потока вызывается ф-ция InitUI
SetEventHandler('Mouse',MouseEventHandler,emInstant);
SetEventHandler('Kbd',KbdEventHandler,emInstant);
SetEventHandler('Engine\ActivateWnd',ActivateEventHandler,emInstant);
SetEventHandler('UI\SetGlobalShadow',onSetGlobalShadow,emInstant);
SetEventHandler('UI\SetFocus',onSetFocus,emInstant);
PublishVar(@rootWidth,'rootWidth',TVarTypeInteger);
PublishVar(@rootHeight,'rootHeight',TVarTypeInteger);
initialized:=true;
end;
procedure TUIScene.SetStatus(st:TSceneStatus);
begin
inherited;
ForceLogMessage('Scene '+name+' status changed to '+statuses[st]);
// LogMessage('Scene '+name+' status changed to '+statuses[st],5);
if (status=ssActive) and (UI=nil) then begin
UI:=TUIElement.Create(rootWidth,rootHeight,nil);
UI.name:=name;
UI.enabled:=false;
UI.visible:=false;
end;
if UI<>nil then begin
UI.enabled:=status=ssActive;
ui.visible:=ui.enabled;
if ui.enabled and (UI is TUIWindow) then
UI.SetFocus;
end;
end;
procedure TUIScene.WriteKey(key:cardinal);
var
scanCode:byte;
charCode:integer;
begin
if (UI<>nil) and (not UI.enabled) then exit;
inherited;
if (FocusedElement<>nil) and (FocusedElement.HasParent(UI)) then begin
charCode:=key shr 16;
scanCode:=(key shr 8) and $FF;
FocusedElement.onUniChar(WideChar(charCode),scanCode);
end;
end;
procedure TUIScene.BackgroundRenderBegin;
begin
Apus.Engine.UIRender.BackgroundRenderBegin;
end;
procedure TUIScene.BackgroundRenderEnd;
begin
Apus.Engine.UIRender.BackgroundRenderEnd;
end;
end.