LZScene

Форк
0
/
uPSI_GLUtils.pas 
140 строк · 6.7 Кб
1
unit uPSI_GLUtils;
2
{
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
8

9
}
10
interface
11
 
12
uses
13
   SysUtils
14
  ,Classes
15
  ,uPSComponent
16
  ,uPSRuntime
17
  ,uPSCompiler
18
  ;
19
 
20
type 
21
(*----------------------------------------------------------------------------*)
22
  TPSImport_GLUtils = class(TPSPlugin)
23
  protected
24
    procedure CompileImport1(CompExec: TPSScript); override;
25
    procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
26
  end;
27
 
28

29
{ compile-time registration functions }
30
procedure SIRegister_GLUtils(CL: TPSPascalCompiler);
31

32
{ run-time registration functions }
33
procedure RIRegister_GLUtils_Routines(S: TPSExec);
34
procedure RIRegister_GLUtils(CL: TPSRuntimeClassImporter);
35

36
procedure Register;
37

38
implementation
39

40

41
uses
42
   Graphics
43
  ,Controls
44
  ,GLVectorGeometry
45
  ,GLCrossPlatform
46
  ,GLUtils
47
  ;
48
 
49
 
50
procedure Register;
51
begin
52
  RegisterComponents('Pascal Script', [TPSImport_GLUtils]);
53
end;
54

55
(* === compile-time registration functions === *)
56
(*----------------------------------------------------------------------------*)
57
procedure SIRegister_GLUtils(CL: TPSPascalCompiler);
58
begin
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');
85
end;
86

87
(* === run-time registration functions === *)
88
(*----------------------------------------------------------------------------*)
89
procedure RIRegister_GLUtils_Routines(S: TPSExec);
90
begin
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);
115
end;
116

117
(*----------------------------------------------------------------------------*)
118
procedure RIRegister_GLUtils(CL: TPSRuntimeClassImporter);
119
begin
120
  with CL.Add(EGLUtilsException) do
121
end;
122

123
 
124
 
125
{ TPSImport_GLUtils }
126
(*----------------------------------------------------------------------------*)
127
procedure TPSImport_GLUtils.CompileImport1(CompExec: TPSScript);
128
begin
129
  SIRegister_GLUtils(CompExec.Comp);
130
end;
131
(*----------------------------------------------------------------------------*)
132
procedure TPSImport_GLUtils.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter);
133
begin
134
  RIRegister_GLUtils(ri);
135
  RIRegister_GLUtils_Routines(CompExec.Exec); // comment it if no routines
136
end;
137
(*----------------------------------------------------------------------------*)
138
 
139
 
140
end.
141

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.