3
This file has been generated by UnitParser v0.7, written by M. Knight
4
and updated by NP. v/d Spek and George Birbilis.
5
Source Code from Carlo Kok has been used to implement various sections of
6
UnitParser. Components of ROPS are used in the construction of UnitParser,
7
code implementing the class wrapper is taken from Carlo Kok's conv utility
21
(*----------------------------------------------------------------------------*)
22
TPSImport_XCollection = class(TPSPlugin)
24
procedure CompileImport1(CompExec: TPSScript); override;
25
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
29
{ compile-time registration functions }
30
procedure SIRegister_TGLXCollection(CL: TPSPascalCompiler);
31
procedure SIRegister_TGLXCollectionItem(CL: TPSPascalCompiler);
32
procedure SIRegister_EFilerException(CL: TPSPascalCompiler);
33
procedure SIRegister_XCollection(CL: TPSPascalCompiler);
35
{ run-time registration functions }
36
procedure RIRegister_XCollection_Routines(S: TPSExec);
37
procedure RIRegister_TGLXCollection(CL: TPSRuntimeClassImporter);
38
procedure RIRegister_TGLXCollectionItem(CL: TPSRuntimeClassImporter);
39
procedure RIRegister_EFilerException(CL: TPSRuntimeClassImporter);
40
procedure RIRegister_XCollection(CL: TPSRuntimeClassImporter);
54
RegisterComponents('GLS ROPS', [TPSImport_XCollection]);
57
(* === compile-time registration functions === *)
58
(*----------------------------------------------------------------------------*)
59
procedure SIRegister_TGLXCollection(CL: TPSPascalCompiler);
61
//with RegClassS(CL,'TPersistent', 'TGLXCollection') do
62
with CL.AddClassN(CL.FindClass('TPersistent'),'TGLXCollection') do
64
RegisterMethod('Constructor Create( aOwner : TPersistent)');
65
RegisterMethod('Procedure Loaded');
66
RegisterProperty('Owner', 'TPersistent', iptrw);
67
RegisterMethod('Function ItemsClass : TGLXCollectionItemClass');
68
RegisterProperty('Items', 'TGLXCollectionItem Integer', iptr);
69
SetDefaultPropery('Items');
70
RegisterProperty('Count', 'Integer', iptr);
71
RegisterMethod('Function Add( anItem : TGLXCollectionItem) : Integer');
72
RegisterMethod('Function GetOrCreate( anItem : TGLXCollectionItemClass) : TGLXCollectionItem');
73
RegisterMethod('Procedure Delete( index : Integer)');
74
RegisterMethod('Procedure Remove( anItem : TGLXCollectionItem)');
75
RegisterMethod('Procedure Clear');
76
RegisterMethod('Function IndexOf( anItem : TGLXCollectionItem) : Integer');
77
RegisterMethod('Function IndexOfClass( aClass : TGLXCollectionItemClass) : Integer');
78
RegisterMethod('Function GetByClass( aClass : TGLXCollectionItemClass) : TGLXCollectionItem');
79
RegisterMethod('Function IndexOfName( const aName : String) : Integer');
80
RegisterMethod('Function CanAdd( aClass : TGLXCollectionItemClass) : Boolean');
84
(*----------------------------------------------------------------------------*)
85
procedure SIRegister_TGLXCollectionItem(CL: TPSPascalCompiler);
87
//with RegClassS(CL,'TPersistent', 'TGLXCollectionItem') do
88
with CL.AddClassN(CL.FindClass('TPersistent'),'TGLXCollectionItem') do
90
RegisterMethod('Constructor Create( aOwner : TGLXCollection)');
91
RegisterProperty('Owner', 'TGLXCollection', iptr);
92
RegisterMethod('Procedure MoveUp');
93
RegisterMethod('Procedure MoveDown');
94
RegisterMethod('Function Index : Integer');
95
RegisterMethod('Function FriendlyName : String');
96
RegisterMethod('Function FriendlyDescription : String');
97
RegisterMethod('Function ItemCategory : String');
98
RegisterMethod('Function UniqueItem : Boolean');
99
RegisterMethod('Function CanAddTo( collection : TGLXCollection) : Boolean');
100
RegisterProperty('Name', 'String', iptrw);
104
(*----------------------------------------------------------------------------*)
105
procedure SIRegister_EFilerException(CL: TPSPascalCompiler);
107
//with RegClassS(CL,'Exception', 'EFilerException') do
108
with CL.AddClassN(CL.FindClass('Exception'),'EFilerException') do
113
(*----------------------------------------------------------------------------*)
114
procedure SIRegister_XCollection(CL: TPSPascalCompiler);
116
CL.AddClassN(CL.FindClass('TOBJECT'),'TGLXCollection');
117
SIRegister_EFilerException(CL);
118
SIRegister_TGLXCollectionItem(CL);
119
//CL.AddTypeS('TGLXCollectionItemClass', 'class of TGLXCollectionItem');
120
SIRegister_TGLXCollection(CL);
121
CL.AddConstantN('cUnknownArchiveVersion','String').SetString( 'Unknown archive version : ');
122
CL.AddDelphiFunction('Procedure RegisterXCollectionDestroyEvent( notifyEvent : TNotifyEvent)');
123
CL.AddDelphiFunction('Procedure DeRegisterXCollectionDestroyEvent( notifyEvent : TNotifyEvent)');
125
CL.AddDelphiFunction('Procedure RegisterXCollectionItemClass( aClass : TGLXCollectionItemClass)');
126
CL.AddDelphiFunction('Procedure UnregisterXCollectionItemClass( aClass : TGLXCollectionItemClass)');
127
CL.AddDelphiFunction('Function FindXCollectionItemClass( const className : String) : TGLXCollectionItemClass');
128
CL.AddDelphiFunction('Function GetXCollectionItemClassesList( baseClass : TGLXCollectionItemClass) : TList');
132
(* === run-time registration functions === *)
133
(*----------------------------------------------------------------------------*)
134
procedure TGLXCollectionCount_R(Self: TGLXCollection; var T: Integer);
135
begin T := Self.Count; end;
137
(*----------------------------------------------------------------------------*)
138
procedure TGLXCollectionItems_R(Self: TGLXCollection; var T: TGLXCollectionItem; const t1: Integer);
139
begin T := Self.Items[t1]; end;
141
(*----------------------------------------------------------------------------*)
142
procedure TGLXCollectionOwner_W(Self: TGLXCollection; const T: TPersistent);
143
begin Self.Owner := T; end;
145
(*----------------------------------------------------------------------------*)
146
procedure TGLXCollectionOwner_R(Self: TGLXCollection; var T: TPersistent);
147
begin T := Self.Owner; end;
149
(*----------------------------------------------------------------------------*)
150
procedure TGLXCollectionItemName_W(Self: TGLXCollectionItem; const T: String);
151
begin Self.Name := T; end;
153
(*----------------------------------------------------------------------------*)
154
procedure TGLXCollectionItemName_R(Self: TGLXCollectionItem; var T: String);
155
begin T := Self.Name; end;
157
(*----------------------------------------------------------------------------*)
158
procedure TGLXCollectionItemOwner_R(Self: TGLXCollectionItem; var T: TGLXCollection);
159
begin T := Self.Owner; end;
161
(*----------------------------------------------------------------------------*)
162
procedure RIRegister_XCollection_Routines(S: TPSExec);
164
S.RegisterDelphiFunction(@RegisterXCollectionDestroyEvent, 'RegisterXCollectionDestroyEvent', cdRegister);
165
S.RegisterDelphiFunction(@DeRegisterXCollectionDestroyEvent, 'DeRegisterXCollectionDestroyEvent', cdRegister);
167
S.RegisterDelphiFunction(@RegisterXCollectionItemClass, 'RegisterXCollectionItemClass', cdRegister);
168
S.RegisterDelphiFunction(@UnregisterXCollectionItemClass, 'UnregisterXCollectionItemClass', cdRegister);
169
S.RegisterDelphiFunction(@FindXCollectionItemClass, 'FindXCollectionItemClass', cdRegister);
170
S.RegisterDelphiFunction(@GetXCollectionItemClassesList, 'GetXCollectionItemClassesList', cdRegister);
174
(*----------------------------------------------------------------------------*)
175
procedure RIRegister_TGLXCollection(CL: TPSRuntimeClassImporter);
177
with CL.Add(TGLXCollection) do
179
RegisterVirtualConstructor(@TGLXCollection.Create, 'Create');
180
RegisterMethod(@TGLXCollection.Loaded, 'Loaded');
181
RegisterPropertyHelper(@TGLXCollectionOwner_R,@TGLXCollectionOwner_W,'Owner');
182
RegisterVirtualMethod(@TGLXCollection.ItemsClass, 'ItemsClass');
183
RegisterPropertyHelper(@TGLXCollectionItems_R,nil,'Items');
184
RegisterPropertyHelper(@TGLXCollectionCount_R,nil,'Count');
185
RegisterMethod(@TGLXCollection.Add, 'Add');
186
RegisterMethod(@TGLXCollection.GetOrCreate, 'GetOrCreate');
187
RegisterMethod(@TGLXCollection.Delete, 'Delete');
188
RegisterMethod(@TGLXCollection.Remove, 'Remove');
189
RegisterMethod(@TGLXCollection.Clear, 'Clear');
190
RegisterMethod(@TGLXCollection.IndexOf, 'IndexOf');
191
RegisterMethod(@TGLXCollection.IndexOfClass, 'IndexOfClass');
192
RegisterMethod(@TGLXCollection.GetByClass, 'GetByClass');
193
RegisterMethod(@TGLXCollection.IndexOfName, 'IndexOfName');
194
RegisterVirtualMethod(@TGLXCollection.CanAdd, 'CanAdd');
198
(*----------------------------------------------------------------------------*)
199
procedure RIRegister_TGLXCollectionItem(CL: TPSRuntimeClassImporter);
201
with CL.Add(TGLXCollectionItem) do
203
RegisterVirtualConstructor(@TGLXCollectionItem.Create, 'Create');
204
RegisterPropertyHelper(@TGLXCollectionItemOwner_R,nil,'Owner');
205
RegisterMethod(@TGLXCollectionItem.MoveUp, 'MoveUp');
206
RegisterMethod(@TGLXCollectionItem.MoveDown, 'MoveDown');
207
RegisterMethod(@TGLXCollectionItem.Index, 'Index');
208
// RegisterVirtualAbstractMethod(@TGLXCollectionItem, @!.FriendlyName, 'FriendlyName');
209
RegisterVirtualMethod(@TGLXCollectionItem.FriendlyDescription, 'FriendlyDescription');
210
RegisterVirtualMethod(@TGLXCollectionItem.ItemCategory, 'ItemCategory');
211
RegisterVirtualMethod(@TGLXCollectionItem.UniqueItem, 'UniqueItem');
212
RegisterVirtualMethod(@TGLXCollectionItem.CanAddTo, 'CanAddTo');
213
RegisterPropertyHelper(@TGLXCollectionItemName_R,@TGLXCollectionItemName_W,'Name');
217
(*----------------------------------------------------------------------------*)
218
procedure RIRegister_EFilerException(CL: TPSRuntimeClassImporter);
220
with CL.Add(EFilerException) do
225
(*----------------------------------------------------------------------------*)
226
procedure RIRegister_XCollection(CL: TPSRuntimeClassImporter);
228
with CL.Add(TGLXCollection) do
229
RIRegister_EFilerException(CL);
230
RIRegister_TGLXCollectionItem(CL);
231
RIRegister_TGLXCollection(CL);
236
{ TPSImport_XCollection }
237
(*----------------------------------------------------------------------------*)
238
procedure TPSImport_XCollection.CompileImport1(CompExec: TPSScript);
240
SIRegister_XCollection(CompExec.Comp);
242
(*----------------------------------------------------------------------------*)
243
procedure TPSImport_XCollection.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
245
RIRegister_XCollection(ri);
246
RIRegister_XCollection_Routines(CompExec.Exec); // comment it if no routines
248
(*----------------------------------------------------------------------------*)