forked from beNative/Concepts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Concepts.Registration.pas
638 lines (577 loc) · 13.5 KB
/
Concepts.Registration.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
{
Copyright (C) 2013-2022 Tim Sinaeve tim.sinaeve@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
}
unit Concepts.Registration;
{ Handles registration of all supported concept forms. }
interface
uses
Vcl.Graphics;
{$I Concepts.inc}
type
TConcepts = record
strict private
class var FCategoryColor : TColor;
class procedure RegisterSpringConcepts; static;
class procedure RegisterDSharpConcepts; static;
class procedure RegisterDevExpressConcepts; static;
class procedure RegisterKControlsConcepts; static;
class procedure RegisterSystemConcepts; static;
class procedure RegisterVclConcepts; static;
class procedure RegisterWinApiConcepts; static;
class procedure RegisterIndyConcepts; static;
public
class procedure RegisterConcepts; static;
end;
implementation
uses
Winapi.Windows,
System.SysUtils, System.Classes,
{$REGION 'Concept form units'}
{$IFDEF WINAPI}
Concepts.Winapi.LockPaint.Form,
{$ENDIF}
{$IFDEF VCL}
Concepts.Vcl.GridPanel.Form,
{$IFDEF DELPHIX_SEATTLE_UP}
Concepts.Vcl.RelativePanel.Form,
{$ENDIF}
{$ENDIF}
{$IFDEF FIREDAC}
Concepts.FireDAC.Form,
{$ENDIF}
{$IFDEF SYSTEM}
Concepts.System.RTTI.Form,
Concepts.System.Variants.Form,
Concepts.System.Threads.Form,
Concepts.System.RegularExpressions.Form,
Concepts.System.LiveBindings.Form,
Concepts.System.Threading.Form,
Concepts.System.Libraries.Form,
Concepts.System.AnonymousMethods.Form,
Concepts.System.InterfaceImplementationByAggregation.Form,
Concepts.System.StringList.Form,
Concepts.System.VirtualMethodInterceptor.Form,
Concepts.System.VirtualInterface.Form,
Concepts.System.PublishedFields.Form,
Concepts.System.Interfaces.Form,
{$ENDIF}
{$IFDEF DEVEXPRESS}
Concepts.DevExpress.cxEditors.Form,
Concepts.DevExpress.cxGridViewPresenter.Form,
{$ENDIF}
{$IFDEF DSHARP}
Concepts.DSharp.TreeViewPresenter.Tree.Form,
Concepts.DSharp.TreeViewPresenter.List.Form,
{$ENDIF}
{$IFDEF SPRING}
Concepts.Spring.ClassProxy.Form,
Concepts.Spring.Interception.Form,
Concepts.Spring.Collections.Form,
Concepts.Spring.LazyInstantiation.Form,
Concepts.Spring.MulticastEvents.Form,
Concepts.Spring.ObjectDataSet.Form,
Concepts.Spring.Logging.Form,
Concepts.Spring.Types.Form,
Concepts.Spring.Utils.Form,
Concepts.Spring.Persistence.Form,
{$ENDIF}
{$IFDEF BTMEMORYMODULE}
Concepts.BTMemoryModule.Form,
{$ENDIF}
{$IFDEF SQLBUILDER4D}
Concepts.SQLBuilder4D.Form,
{$ENDIF}
{$IFDEF CHROMETABS}
Concepts.ChromeTabs.Form,
{$ENDIF}
{$IFDEF BCEDITOR}
Concepts.BCEditor.Form,
{$ENDIF}
{$IFDEF DDETOURS}
Concepts.DDetours.Form,
{$ENDIF}
{$IFDEF DELPHIZMQ}
Concepts.ZeroMQ.Form,
{$ENDIF}
{$IFDEF ZOBJECTINSPECTOR}
Concepts.zObjectInspector.Form,
{$ENDIF}
{$ENDREGION}
{$IFDEF SYNAPSE}
Concepts.Synapse.Serial.Form,
{$ENDIF}
{$IFDEF INDY}
Concepts.Indy.TCP.Form,
Concepts.Indy.Telnet.Form,
{$ENDIF}
{$IFDEF SYNEDIT}
Concepts.SynEdit.Form,
{$ENDIF}
{$IFDEF VIRTUALTREES}
Concepts.VirtualTreeView.Form,
{$ENDIF}
{$IFDEF KCONTROLS}
Concepts.KControls.KMemo.Form,
{$ENDIF}
Concepts.SynMemoEx.Form,
Concepts.MQTT.Form,
Concepts.FMXContainer.Form,
Concepts.Manager;
const
SPRING_CATEGORY_COLOR = $00DDFFDD;
DSHARP_CATEGORY_COLOR = $00B0FFFF;
INDY_CATEGORY_COLOR = $00C1D6FF;
KCONTROLS_CATEGORY_COLOR = $00FEFAC5;
DEVEXPRESS_CATEGORY_COLOR = $00C1E0FF;
SYSTEM_CATEGORY_COLOR = $00E1E1FF;
VCL_CATEGORY_COLOR = $00FFD9D9;
WINAPI_CATEGORY_COLOR = $00C7E2E2;
procedure EnsureZMQLibExists;
const
LIBZMQ = 'libzmq';
var
LResStream : TResourceStream;
LFileStream : TFileStream;
LPath : string;
begin
LPath := Format('%s\%s.dll', [ExtractFileDir(ParamStr(0)), LIBZMQ]);
if not FileExists(LPath) then
begin
LResStream := TResourceStream.Create(HInstance, LIBZMQ, RT_RCDATA);
try
LFileStream := TFileStream.Create(LPath, fmCreate);
try
LFileStream.CopyFrom(LResStream, 0);
finally
LFileStream.Free;
end;
finally
LResStream.Free;
end;
end;
end;
{$REGION 'private methods'}
class procedure TConcepts.RegisterSpringConcepts;
begin
{$IFDEF SPRING}
FCategoryColor := SPRING_CATEGORY_COLOR;
ConceptManager.Register(
TfrmCollections,
'Collections',
'Spring4D',
'Spring4D collections',
FCategoryColor
);
ConceptManager.Register(
TfrmMultiCastEvents,
'Multicast events',
'Spring4D',
'Multicast events (Event<T> - IEvent<T)',
FCategoryColor
);
ConceptManager.Register(
TfrmLazyInstantiation,
'Lazy instantiation',
'Spring4D',
'Lazy instantiation (Lazy<T> - ILazy<T>)',
FCategoryColor
);
ConceptManager.Register(
TfrmSpringInterception,
'Interception',
'Spring4D',
'Aspect Oriented Programming',
FCategoryColor
);
ConceptManager.Register(
TfrmObjectDataSet,
'TObjectDataSet control',
'Spring4D',
'TObjectDataSet control',
FCategoryColor
);
ConceptManager.Register(
TfrmSpringPersistence,
'ORM',
'Spring4D',
'Spring4D Entities',
FCategoryColor
);
ConceptManager.Register(
TfrmSpringLogging,
'Logging',
'Spring4D',
'Spring4D Logging system',
FCategoryColor
);
ConceptManager.Register(
TfrmSpringTypes,
'Types',
'Spring4D',
'Spring4D Utility types',
FCategoryColor
);
ConceptManager.Register(
TfrmSpringUtils,
'Utils',
'Spring4D',
'Utillity classes and routines',
FCategoryColor
);
ConceptManager.Register(
TfrmClassProxy,
'ClassProxy',
'Spring4D',
'Interception',
FCategoryColor
);
{$ENDIF}
end;
class procedure TConcepts.RegisterDSharpConcepts;
begin
{$IFDEF DSHARP}
FCategoryColor := DSHARP_CATEGORY_COLOR;
ConceptManager.Register(
TfrmTreeViewPresenterList,
'TreeViewPresenter list',
'DSharp',
'TreeViewPresenter list',
FCategoryColor
);
ConceptManager.Register(
TfrmTreeViewPresenterTree,
'TreeViewPresenter tree',
'DSharp',
'TreeViewPresenter tree',
FCategoryColor
);
{$IFDEF DEVEXPRESS}
ConceptManager.Register(
TfrmcxGridViewPresenter,
'Presenters',
'DSharp',
'Specialized presenters',
FCategoryColor
);
{$ENDIF}
{$ENDIF}
end;
class procedure TConcepts.RegisterIndyConcepts;
begin
{$IFDEF INDY}
FCategoryColor := INDY_CATEGORY_COLOR;
ConceptManager.Register(
TfrmIndyTCP,
'TCP',
'Indy',
'Indy TCP client',
FCategoryColor
);
ConceptManager.Register(
TfrmIndyTelnet,
'Telnet',
'Indy',
'Indy Telnet client',
FCategoryColor
);
{$ENDIF}
end;
class procedure TConcepts.RegisterKControlsConcepts;
begin
{$IFDEF KCONTROLS}
FCategoryColor := KCONTROLS_CATEGORY_COLOR;
ConceptManager.Register(
TfrmKMemo,
'TKMemo control',
'KControls',
'Demonstrates the TKMemo control',
FCategoryColor
);
{$ENDIF}
end;
class procedure TConcepts.RegisterDevExpressConcepts;
begin
{$IFDEF DEVEXPRESS}
FCategoryColor := DEVEXPRESS_CATEGORY_COLOR;
ConceptManager.Register(
TfrmcxEditors,
'cxEditors',
'DevExpress',
'Demonstrates the DevExpress edit controls',
FCategoryColor
);
{$ENDIF}
end;
class procedure TConcepts.RegisterSystemConcepts;
begin
{$IFDEF SYSTEM}
FCategoryColor := SYSTEM_CATEGORY_COLOR;
ConceptManager.Register(
TfrmLibraries,
'Libraries',
'System',
'Demonstrates dynamic loading of libraries',
FCategoryColor
);
ConceptManager.Register(
TfrmRTTI,
'RTTI',
'System',
'Demonstrates the extended RTTI',
FCategoryColor
);
ConceptManager.Register(
TfrmVariants,
'Variants',
'System',
'Demonstrates some operations on Variants',
FCategoryColor
);
ConceptManager.Register(
TfrmLiveBindings,
'LiveBindings',
'System',
'Demonstrates Delphi''s LiveBindings system',
FCategoryColor
);
ConceptManager.Register(
TfrmRegularExpressions,
'Regular Expressions',
'System',
'Demonstrates support for regular expressions in the RTL',
FCategoryColor
);
ConceptManager.Register(
TfrmThreading,
'Parallel Programming Library',
'System',
'Demonstrates the Parallel Programming Library (PPL) introduced in Delphi XE7',
FCategoryColor
);
ConceptManager.Register(
TfrmThreads,
'Threads',
'System',
'Demonstrates some basic threading scenarios and primitives',
FCategoryColor
);
ConceptManager.Register(
TfrmAnonymousMethods,
'Anonymous methods',
'System',
'Demonstrates anonymous methods and features like variable capturing',
FCategoryColor
);
ConceptManager.Register(
TfrmInterfaceImplementationByAggregation,
'Interface implementation by aggregation',
'System',
'Demonstrates how an object can implement an interface by delegating ' +
'the implementation to an object property',
FCategoryColor
);
ConceptManager.Register(
TfrmVirtualInterfaceDemo,
'TVirtualInterface class',
'System',
'Demonstrated how a TVirtualInterface object can be created that implements ' +
'any IInvokable ($M+) descendant at runtime',
FCategoryColor
);
ConceptManager.Register(
TfrmVirtualMethodInterceptor,
'TVirtualMethodInterceptor class',
'System',
'TODO',
FCategoryColor
);
ConceptManager.Register(
TfrmStringList,
'TStringList class',
'System',
'Demonstrates some TStringList features',
FCategoryColor
);
ConceptManager.Register(
TfrmPublishedFields,
'Published fields',
'System',
'Demonstrates a form with components without published fields',
FCategoryColor
);
ConceptManager.Register(
TfrmInterfaces,
'Object interfaces',
'System',
'Demonstrates how object interfaces work.',
FCategoryColor
);
{$ENDIF}
end;
class procedure TConcepts.RegisterVclConcepts;
begin
{$IFDEF VCL}
FCategoryColor := VCL_CATEGORY_COLOR;
ConceptManager.Register(
TfrmGridPanel,
'TGridPanel control',
'Vcl',
'Demonstrates the TGridPanel VCL control.',
FCategoryColor
);
{$IFDEF DELPHIX_SEATTLE_UP}
ConceptManager.Register(
TfrmRelativePanel,
'TRelativePanel control',
'Vcl',
'Demonstrates the TRelativePanel VCL control',
FCategoryColor
);
{$ENDIF}
{$ENDIF}
end;
class procedure TConcepts.RegisterWinApiConcepts;
begin
{$IFDEF WINAPI}
FCategoryColor := WINAPI_CATEGORY_COLOR;
ConceptManager.Register(
TfrmLockPaint,
'LockPaint',
'WinApi',
'Demonstrates LockPaint/UnlockPaint routines',
FCategoryColor
);
{$ENDIF}
end;
{$ENDREGION}
{$REGION 'public methods'}
class procedure TConcepts.RegisterConcepts;
begin
{$IFDEF ZOBJECTINSPECTOR}
ConceptManager.Register(
TfrmzObjectInspector,
'TzObjectInspector control',
'TzObjectInspector',
'TzObjectInspector control demo'
);
{$ENDIF}
{$IFDEF DELPHIZMQ}
ConceptManager.Register(
TfrmZMQConcept,
'ZeroMQ',
'ZeroMQ',
'ZeroMQ demo'
);
{$ENDIF}
ConceptManager.Register(
TfrmMQTTNode,
'MQTT',
'MQTT',
'MQTT demo'
);
{$IFDEF DDETOURS}
ConceptManager.Register(
TfrmDDetours,
'DDetours',
'DDetours',
'DDetours library demo'
);
{$ENDIF}
{$IFDEF BCEDITOR}
ConceptManager.Register(
TfrmBCEditor,
'TBCEditor control',
'BCEditor',
'TBCEditor control'
);
{$ENDIF}
{$IFDEF SYNEDIT}
ConceptManager.Register(
TfrmSynEdit,
'TSynEdit control',
'SynEdit',
'Demonstrates the TSynEdit control'
);
{$ENDIF}
{$IFDEF BTMEMORYMODULE}
ConceptManager.Register(
TfrmBTMemoryModule,
'BTMemoryModule',
'BTMemoryModule',
'Demonstrates how to load a DLL direct from memory.'
);
{$ENDIF}
{$IFDEF SQLBUILDER4D}
ConceptManager.Register(
TfrmSQLBuilder4D,
'SQLBuilder4D',
'TfrmSQLBuilder4D',
'Demonstrates the SQLBuilder4D library'
);
{$ENDIF}
{$IFDEF CHROMETABS}
ConceptManager.Register(
TfrmChromeTabs,
'TChromeTabs control',
'TChromeTabs',
'TChromeTabs control demo.'
);
{$ENDIF}
// ConceptManager.Register(
// TfrmRTTEye,
// 'RTTEye',
// 'System',
// 'Reflection-like overview using the extended RTTI.'
// );
{$IFDEF SYNAPSE}
ConceptManager.Register(
TfrmSynapseSerial,
'Serial',
'Synapse',
'Serial communication with the Synapse library'
);
{$ENDIF}
{$IFDEF FMXCONTAINER}
ConceptManager.Register(
TfrmFMXContainer,
'TFireMonkeyContainer contol',
'FMXContainer',
'Demonstrates the Parnassus TFireMonkeyContainer control'
);
{$ENDIF}
{$IFDEF VIRTUALTREES}
ConceptManager.Register(
TfrmVirtualTreeView,
'Virtual treeview control',
'TVirtualStringTree',
'Demonstrates the TVirtualStringTree control'
);
{$ENDIF}
ConceptManager.Register(
TfrmSynMemoEx,
'SynMemoEx control',
'TSynMemoEx',
'TSynMemoEx control'
);
RegisterSpringConcepts;
RegisterDSharpConcepts;
RegisterKControlsConcepts;
RegisterIndyConcepts;
RegisterDevExpressConcepts;
RegisterSystemConcepts;
RegisterVclConcepts;
RegisterWinApiConcepts;
end;
{$ENDREGION}
initialization
EnsureZMQLibExists;
end.