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_GLUtils = 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_GLUtils(CL: TPSPascalCompiler);
32
{ run-time registration functions }
33
procedure RIRegister_GLUtils_Routines(S: TPSExec);
34
procedure RIRegister_GLUtils(CL: TPSRuntimeClassImporter);
52
RegisterComponents('Pascal Script', [TPSImport_GLUtils]);
55
(* === compile-time registration functions === *)
56
(*----------------------------------------------------------------------------*)
57
procedure SIRegister_GLUtils(CL: TPSPascalCompiler);
59
CL.AddClassN(CL.FindClass('TOBJECT'),'EGLUtilsException');
60
// CL.AddTypeS('PSqrt255Array', '^TSqrt255Array // will not work');
61
// CL.AddDelphiFunction('Procedure WordToIntegerArray( Source : PWordArray; Dest : PIntegerArray; Count : Cardinal)');
62
CL.AddDelphiFunction('Function RoundUpToPowerOf2( value : Integer) : Integer');
63
CL.AddDelphiFunction('Function RoundDownToPowerOf2( value : Integer) : Integer');
64
CL.AddDelphiFunction('Function IsPowerOf2( value : Integer) : Boolean');
65
CL.AddDelphiFunction('Function ReadCRLFString( aStream : TStream) : AnsiString');
66
CL.AddDelphiFunction('Procedure WriteCRLFString( aStream : TStream; const aString : AnsiString)');
67
CL.AddDelphiFunction('Function TryStrToFloat( const strValue : String; var val : Extended) : Boolean');
68
CL.AddDelphiFunction('Function StrToFloatDef( const strValue : String; defValue : Extended) : Extended');
69
CL.AddDelphiFunction('Function StringToColorAdvancedSafe( const Str : string; const Default : TColor) : TColor');
70
CL.AddDelphiFunction('Function TryStringToColorAdvanced( const Str : string; var OutColor : TColor) : Boolean');
71
CL.AddDelphiFunction('Function StringToColorAdvanced( const Str : string) : TColor');
72
CL.AddDelphiFunction('Function ParseInteger( var p : PChar) : Integer');
73
CL.AddDelphiFunction('Function ParseFloat( var p : PChar) : Extended');
74
CL.AddDelphiFunction('Procedure SaveAnsiStringToFile( const fileName : String; const data : AnsiString)');
75
CL.AddDelphiFunction('Function LoadAnsiStringFromFile( const fileName : String) : AnsiString');
76
CL.AddDelphiFunction('Procedure SaveComponentToFile( const Component : TComponent; const FileName : string; const AsText : Boolean)');
77
CL.AddDelphiFunction('Procedure LoadComponentFromFile( const Component : TComponent; const FileName : string; const AsText : Boolean)');
78
CL.AddDelphiFunction('Function SizeOfFile( const fileName : String) : Int64');
79
// CL.AddDelphiFunction('Function GetSqrt255Array : PSqrt255Array');
80
CL.AddDelphiFunction('Procedure InformationDlg( const msg : String)');
81
CL.AddDelphiFunction('Function QuestionDlg( const msg : String) : Boolean');
82
CL.AddDelphiFunction('Function InputDlg( const aCaption, aPrompt, aDefault : String) : String');
83
CL.AddDelphiFunction('Function SavePictureDialog( var aFileName : String; const aTitle : String) : Boolean');
84
CL.AddDelphiFunction('Function OpenPictureDialog( var aFileName : String; const aTitle : String) : Boolean');
87
(* === run-time registration functions === *)
88
(*----------------------------------------------------------------------------*)
89
procedure RIRegister_GLUtils_Routines(S: TPSExec);
91
// S.RegisterDelphiFunction(@WordToIntegerArray, 'WordToIntegerArray', cdRegister);
92
S.RegisterDelphiFunction(@RoundUpToPowerOf2, 'RoundUpToPowerOf2', cdRegister);
93
S.RegisterDelphiFunction(@RoundDownToPowerOf2, 'RoundDownToPowerOf2', cdRegister);
94
S.RegisterDelphiFunction(@IsPowerOf2, 'IsPowerOf2', cdRegister);
95
S.RegisterDelphiFunction(@ReadCRLFString, 'ReadCRLFString', cdRegister);
96
S.RegisterDelphiFunction(@WriteCRLFString, 'WriteCRLFString', cdRegister);
97
S.RegisterDelphiFunction(@TryStrToFloat, 'TryStrToFloat', cdRegister);
98
S.RegisterDelphiFunction(@StrToFloatDef, 'StrToFloatDef', cdRegister);
99
S.RegisterDelphiFunction(@StringToColorAdvancedSafe, 'StringToColorAdvancedSafe', cdRegister);
100
S.RegisterDelphiFunction(@TryStringToColorAdvanced, 'TryStringToColorAdvanced', cdRegister);
101
S.RegisterDelphiFunction(@StringToColorAdvanced, 'StringToColorAdvanced', cdRegister);
102
S.RegisterDelphiFunction(@ParseInteger, 'ParseInteger', cdRegister);
103
S.RegisterDelphiFunction(@ParseFloat, 'ParseFloat', cdRegister);
104
S.RegisterDelphiFunction(@SaveAnsiStringToFile, 'SaveAnsiStringToFile', cdRegister);
105
S.RegisterDelphiFunction(@LoadAnsiStringFromFile, 'LoadAnsiStringFromFile', cdRegister);
106
S.RegisterDelphiFunction(@SaveComponentToFile, 'SaveComponentToFile', cdRegister);
107
S.RegisterDelphiFunction(@LoadComponentFromFile, 'LoadComponentFromFile', cdRegister);
108
S.RegisterDelphiFunction(@SizeOfFile, 'SizeOfFile', cdRegister);
109
// S.RegisterDelphiFunction(@GetSqrt255Array, 'GetSqrt255Array', cdRegister);
110
S.RegisterDelphiFunction(@InformationDlg, 'InformationDlg', cdRegister);
111
S.RegisterDelphiFunction(@QuestionDlg, 'QuestionDlg', cdRegister);
112
S.RegisterDelphiFunction(@InputDlg, 'InputDlg', cdRegister);
113
S.RegisterDelphiFunction(@SavePictureDialog, 'SavePictureDialog', cdRegister);
114
S.RegisterDelphiFunction(@OpenPictureDialog, 'OpenPictureDialog', cdRegister);
117
(*----------------------------------------------------------------------------*)
118
procedure RIRegister_GLUtils(CL: TPSRuntimeClassImporter);
120
with CL.Add(EGLUtilsException) do
126
(*----------------------------------------------------------------------------*)
127
procedure TPSImport_GLUtils.CompileImport1(CompExec: TPSScript);
129
SIRegister_GLUtils(CompExec.Comp);
131
(*----------------------------------------------------------------------------*)
132
procedure TPSImport_GLUtils.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
134
RIRegister_GLUtils(ri);
135
RIRegister_GLUtils_Routines(CompExec.Exec); // comment it if no routines
137
(*----------------------------------------------------------------------------*)