Gorilla.Script.Types
Unit Gorilla.Script.Types.pasClasses
- EGorillaScriptExecutionError = class ( Exception )
- EGorillaScriptRuntimeError = class ( EAbort )
- TGorillaScriptObjectEventHandler = class ( TObject )
- TGorillaScriptObject = class ( TInterfacedObject )
- TCustomNativeAttribute = class ( TCustomAttribute )
- _NATIVE_ = class ( TCustomNativeAttribute )
- TCustomGLSLAttribute = class ( _NATIVE_ )
- GLSL = class ( TCustomGLSLAttribute )
- UNIFORM = class ( TCustomGLSLAttribute )
- ATTRIBUTE = class ( TCustomGLSLAttribute )
- VARYING = class ( TCustomGLSLAttribute )
- TGLSL = class ( TObject )
- TShader = class ( TObject )
- TVertexShader = class ( TObject )
- TPixelShader = class ( TObject )
- TGorillaScriptIOHandler = class ( TObject )
Interfaces
- interface IGorillaScriptObject
Records
- record TGorillaScriptRegisteredType
- record TGorillaStringHelper
- record TGorillaInt8Helper
- record TGorillaUInt8Helper
- record TGorillaInt16Helper
- record TGorillaUInt16Helper
- record TGorillaInt32Helper
- record TGorillaUInt32Helper
- record TGorillaInt64Helper
- record TGorillaUInt64Helper
- record TGorillaSingleHelper
- record TGorillaDoubleHelper
- record TGorillaBooleanHelper
- record TGorillaTValueHelper
- record _System
Enumerations
- enum TGorillaScriptVariableFlag = ( vfNone, vfVariable, vfConstant, vfLocal, vfParameter, vfField, vfProperty, vfInput, vfOutput, vfNative ) ;
- enum TGorillaScriptMethodFlag = ( mfDefault, mfConstruct, mfDestruct, mfNative, mfStatic ) ;
- enum TGorillaScriptMethodDirective = ( mdEmpty, mdVirtual, mdOverload, mdOverride ) ;
- enum TGorillaScriptVisibility = ( mvPrivate, mvProtected, mvPublic, mvPublished ) ;
Constants
Mics. types
- type TGorillaScriptObjectEventHandlerClass = class of TGorillaScriptObjectEventHandler;
- type TGorillaScriptIOHandlerClass = class of TGorillaScriptIOHandler;
TGorillaScriptVariableFlag
A variable flag defines the type of variable handling.
Remarks
A variable can be local or a parameter. If it is a parameter, we can define if its an output or input variable.TGorillaStringHelper
Methods
- public function ToInteger ( AValue : string ) : Integer ; static;
- public function ToInt64 ( AValue : string ) : Int64 ; static;
- public function ToSingle ( AValue : string ) : Single ; static;
- public function ToDouble ( AValue : string ) : Double ; static;
- public function ToBoolean ( AValue : string ) : Boolean ; static;
- public function ToValue ( AValue : string ) : TValue ; static;
TGorillaInt8Helper
Methods
- public function ToString ( AValue : ShortInt ) : string ; static;
- public function ToSingle ( AValue : ShortInt ) : Single ; static;
- public function ToDouble ( AValue : ShortInt ) : Double ; static;
- public function ToValue ( AValue : ShortInt ) : TValue ; static;
- public function ToChar ( AValue : ShortInt ) : string ; static;
TGorillaUInt8Helper
Methods
- public function ToString ( AValue : Byte ) : string ; static;
- public function ToSingle ( AValue : Byte ) : Single ; static;
- public function ToDouble ( AValue : Byte ) : Double ; static;
- public function ToValue ( AValue : Byte ) : TValue ; static;
- public function ToChar ( AValue : Byte ) : string ; static;
TGorillaInt16Helper
Methods
- public function ToString ( AValue : SmallInt ) : string ; static;
- public function ToSingle ( AValue : SmallInt ) : Single ; static;
- public function ToDouble ( AValue : SmallInt ) : Double ; static;
- public function ToValue ( AValue : SmallInt ) : TValue ; static;
- public function ToChar ( AValue : SmallInt ) : string ; static;
TGorillaUInt16Helper
Methods
- public function ToString ( AValue : Word ) : string ; static;
- public function ToSingle ( AValue : Word ) : Single ; static;
- public function ToDouble ( AValue : Word ) : Double ; static;
- public function ToValue ( AValue : Word ) : TValue ; static;
- public function ToChar ( AValue : Word ) : string ; static;
TGorillaInt32Helper
Methods
- public function ToString ( AValue : Integer ) : string ; static;
- public function ToSingle ( AValue : Integer ) : Single ; static;
- public function ToDouble ( AValue : Integer ) : Double ; static;
- public function ToValue ( AValue : Integer ) : TValue ; static;
- public function ToChar ( AValue : Integer ) : string ; static;
TGorillaUInt32Helper
Methods
- public function ToString ( AValue : Cardinal ) : string ; static;
- public function ToSingle ( AValue : Cardinal ) : Single ; static;
- public function ToDouble ( AValue : Cardinal ) : Double ; static;
- public function ToValue ( AValue : Cardinal ) : TValue ; static;
- public function ToChar ( AValue : Cardinal ) : string ; static;
TGorillaInt64Helper
Methods
- public function ToString ( AValue : Int64 ) : string ; static;
- public function ToSingle ( AValue : Int64 ) : Single ; static;
- public function ToDouble ( AValue : Int64 ) : Double ; static;
- public function ToValue ( AValue : Int64 ) : TValue ; static;
- public function ToChar ( AValue : Int64 ) : string ; static;
TGorillaUInt64Helper
Methods
- public function ToString ( AValue : UInt64 ) : string ; static;
- public function ToSingle ( AValue : UInt64 ) : Single ; static;
- public function ToDouble ( AValue : UInt64 ) : Double ; static;
- public function ToValue ( AValue : UInt64 ) : TValue ; static;
- public function ToChar ( AValue : UInt64 ) : string ; static;
TGorillaBooleanHelper
Methods
- public function ToString ( AValue : Boolean ) : string ; static;
- public function ToInteger ( AValue : Boolean ) : Integer ; static;
- public function ToInt64 ( AValue : Boolean ) : Int64 ; static;
- public function ToSingle ( AValue : Boolean ) : Single ; static;
- public function ToDouble ( AValue : Boolean ) : Double ; static;
- public function ToValue ( AValue : Boolean ) : TValue ; static;
TGorillaTValueHelper
Methods
- public function ToBoolean ( const AValue : TValue ) : Boolean ; static;
- public function ToInt8 ( const AValue : TValue ) : ShortInt ; static;
- public function ToUInt8 ( const AValue : TValue ) : Byte ; static;
- public function ToInt16 ( const AValue : TValue ) : SmallInt ; static;
- public function ToUInt16 ( const AValue : TValue ) : Word ; static;
- public function ToInt32 ( const AValue : TValue ) : Integer ; static;
- public function ToUInt32 ( const AValue : TValue ) : Cardinal ; static;
- public function ToInteger ( const AValue : TValue ) : Integer ; static;
- public function ToInt64 ( const AValue : TValue ) : Int64 ; static;
- public function ToUInt64 ( const AValue : TValue ) : UInt64 ; static;
- public function ToSingle ( const AValue : TValue ) : Single ; static;
- public function ToDouble ( const AValue : TValue ) : Double ; static;
- public function ToArray ( const AValue : TValue ) : TArray<System.Rtti.TValue> ; static;
- public function ToObject ( const AValue : TValue ) : TObject ; static;
- public function ToString ( const AValue : TValue ) : string ; static;
_System
Methods
- public procedure WriteLn ( _Self : Pointer; AValue : string ) ; static inline;
- public procedure Write ( _Self : Pointer; AValue : string ) ; static inline;
- public function Read ( _Self : Pointer ) : string ; static inline;
- public function ReadLn ( _Self : Pointer ) : string ; static inline;
- public procedure FreeAndNil ( _Self : Pointer; AValue : TObject ) ; static inline;
- public function Random ( _Self : Pointer; ARange : Integer ) : Integer ; static inline;
- public function RandomRange ( _Self : Pointer; AMin : Integer; AMax : Integer ) : Integer ; static inline;
- public function RandomFloat ( _Self : Pointer ) : Single ; static inline;
- public function RandomFloatRange ( _Self : Pointer; AMin : Single; AMax : Single ) : Single ; static inline;
- public procedure Sleep ( _Self : Pointer; ATimeInMs : Integer ) ; static inline;
TGorillaScriptObjectEventHandler
To intercept Delphi native events we need this event handler, which registers event wrapper routines and dispatches to GorillaScript on call.
Ancestors
Members
Fields
- public DefaultHandlerClass :
TGorillaScriptObjectEventHandlerClass
- public EventMethods :
TGorillaScriptNativeEventMethods
- public Executor :
TObject
- public Data :
Pointer
- public Name :
string
- public _Type :
PTypeInfo
- public Method :
TMethod
- public IsField :
Boolean
- public Handler :
TValue
Methods
- class private procedure Create@ ( ) ; class constructor noself;
- class private procedure Destroy@ ( ) ; class destructor noself;
- public procedure AddEventMethod
(
const
ATypeInfo :
PTypeInfo; const
AMethodAddr :
Pointer
)
;
class;
Use this method to register a specific native event type and link it to a event wrapper routine, like "CallNotifyEvent()".
- public function GetEventMethod
(
const
ATypeInfo :
PTypeInfo
)
: Pointer
;
class;
Used on native event assignment to find a wrapper routine.
- public function GetHashKey
(
)
: Int64
;
virtual;
Returns a hash key build from data-pointer, name and type-pointer. This value should be unique, but it is possible that it collides with another event handler.
- public procedure Dispatch
(
const
AArgs :
TArray<System.Rtti.TValue>
)
;
virtual;
This method should be called when the event method wrapper was called to dispatch the native call to GorillaScript.
- public procedure CallNotifyEvent
(
ASender :
TObject
)
;
This method getting called by the native delphi UI event handler. We than have the possibility to redirect the event call to GorillaScript.
TGorillaScriptObject
The ScriptObject is a helper class for handling delphi instances inherited by TObject.
Ancestors
Members
Fields
- protected FScriptClassType :
Pointer
- protected FExecutor :
TObject
- protected FFields :
TGorillaScriptObjectFields
- protected FEventHandlers :
TGorillaScriptEventHandlers
Methods
- public constructor Create ( ) ;
- public destructor Destroy ( ) ;
- protected procedure VerifyEventHandlers ( ) ;
- protected procedure DestroyEventHandlers ( ) ;
- protected procedure DoOnEventHandlersNotify ( ASender : TObject; const AItem : TGorillaScriptObjectEventHandler; AAction : TCollectionNotification ) ;
- public function GetField ( const AName : string ) : TValue ; virtual;
- public procedure SetField ( const AName : string; const AValue : TValue ) ; virtual;
- public function AddEventHandler ( const AExecutor : TObject; const AData : Pointer; const AName : string; const AIsField : Boolean; const ANativeType : PTypeInfo; AMethod : TMethod ) : TValue ;
- public function ToJSON ( ) : string ; virtual;
Properties
TCustomNativeAttribute
This is the basic attribute class for native language attributes like GLSL.
Ancestors
TCustomGLSLAttribute
This is the basic class for further GLSL attributes: GLSL, VARYING, UNIFORM, ATTRIBUTE, ...
Ancestors
GLSL
Defining the default GLSL attribute for marking GLSL native methods.
Remarks
[GLSL] procedure Main(); override;
Ancestors
UNIFORM
Defining the default GLSL uniform attribute for marking native uniform variables.
Remarks
[UNIFORM] _ModelViewProjMatrix : TMatrix3D;
Ancestors
ATTRIBUTE
Defining the default GLSL attribute attribute for marking native attributes.
Remarks
[ATTRIBUTE] a_Position : TPoint3D;
Ancestors
VARYING
Defining the default GLSL attribute for varying arguments.
Remarks
[VARYING] v_VertexColor : TAlphaColorF;
Ancestors
TGLSL
Providing a number of GLSL functions available in GLSL scripting.
Ancestors
Members
TShader
Custom shader class for all shaders programmed within scripting
Ancestors
Members
TVertexShader
Custom vertex shader class for all vertex shaders programmed within scripting.
Ancestors
Members
TPixelShader
Custom vertex shader class for all pixel/fragment shaders programmed within scripting.
Ancestors
Members
TGorillaScriptIOHandler
IO Handler for intercepting std IO functions.