-
Notifications
You must be signed in to change notification settings - Fork 5
/
uPSC_std.pas
87 lines (68 loc) · 2.56 KB
/
uPSC_std.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
{ Compiletime TObject, TPersistent and TComponent definitions }
unit uPSC_std;
{$I PascalScript.inc}
interface
uses
uPSCompiler, uPSUtils;
{
Will register files from:
System
Classes (Only TComponent and TPersistent)
}
procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler);
procedure SIRegisterTObject(CL: TPSPascalCompiler);
procedure SIRegisterTPersistent(Cl: TPSPascalCompiler);
procedure SIRegisterTComponent(Cl: TPSPascalCompiler);
procedure SIRegister_Std(Cl: TPSPascalCompiler);
implementation
procedure SIRegisterTObject(CL: TPSPascalCompiler);
begin
with Cl.AddClassN(nil, 'TObject') do
begin
RegisterMethod('constructor Create');
RegisterMethod('procedure Free');
end;
end;
procedure SIRegisterTPersistent(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TObject'), 'TPersistent') do
begin
RegisterMethod('procedure Assign(Source: TPersistent)');
end;
end;
procedure SIRegisterTComponent(Cl: TPSPascalCompiler);
begin
with Cl.AddClassN(cl.FindClass('TPersistent'), 'TComponent') do
begin
RegisterMethod('function FindComponent(AName: string): TComponent;');
RegisterMethod('constructor Create(AOwner: TComponent); virtual;');
RegisterProperty('Owner', 'TComponent', iptRW);
RegisterMethod('procedure DestroyComponents');
RegisterMethod('procedure Destroying');
RegisterMethod('procedure FreeNotification(AComponent: TComponent)');
RegisterMethod('procedure InsertComponent(AComponent: TComponent)');
RegisterMethod('procedure RemoveComponent(AComponent: TComponent)');
RegisterProperty('Components', 'TComponent Integer', iptr);
RegisterProperty('ComponentCount', 'Integer', iptr);
RegisterProperty('ComponentIndex', 'Integer', iptrw);
RegisterProperty('ComponentState', 'Byte', iptr);
RegisterProperty('DesignInfo', 'LongInt', iptrw);
RegisterProperty('Name', 'string', iptrw);
RegisterProperty('Tag', 'LongInt', iptrw);
end;
end;
procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler);
begin
Cl.AddTypeS('TComponentStateE', '(csLoading, csReading, csWriting, csDestroying, csDesigning, csAncestor, csUpdating, csFixups, csFreeNotification, csInline, csDesignInstance)');
cl.AddTypeS('TComponentState', 'set of TComponentStateE');
Cl.AddTypeS('TRect', 'record Left, Top, Right, Bottom: Integer; end;');
end;
procedure SIRegister_Std(Cl: TPSPascalCompiler);
begin
SIRegister_Std_TypesAndConsts(Cl);
SIRegisterTObject(CL);
SIRegisterTPersistent(Cl);
SIRegisterTComponent(Cl);
end;
// PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)
End.