diff --git a/.gitignore b/.gitignore index 736fe5460..7d45fa9ff 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ backup/ /DocGen/build/genindex.html /DocGen/build/index.html /DocGen/build/objects.inv +/DocGen/build/_images diff --git a/DocGen/docgen.simba b/DocGen/docgen.simba index 99b6e9bfc..c33505be7 100644 --- a/DocGen/docgen.simba +++ b/DocGen/docgen.simba @@ -177,6 +177,7 @@ end; procedure BuildAPI; begin + ParseSourceFile('simba.import_system', 'System' ); ParseSourceFile('simba.import_colormath', 'Color Math' ); ParseSourceFile('simba.import_point', 'TPoint' ); ParseSourceFile('simba.import_tpa', 'TPointArray' ); diff --git a/Source/editor/simba.editor_autocomplete.pas b/Source/editor/simba.editor_autocomplete.pas index 335d3bf70..5947681ab 100644 --- a/Source/editor/simba.editor_autocomplete.pas +++ b/Source/editor/simba.editor_autocomplete.pas @@ -48,12 +48,13 @@ TSimbaAutoComplete_Hint = class(TSynBaseCompletionHint) function UseBGThemes: Boolean; override; function UseFGThemes: Boolean; override; procedure ActivateSub; override; - procedure EraseBackground(DC: HDC); override; - procedure Paint; override; public AutoComplete: TSimbaAutoComplete; TextWidth: Integer; + procedure EraseBackground(DC: HDC); override; + procedure Paint; override; + constructor Create(AOwner: TComponent); override; end; diff --git a/Source/forms/simba.functionlistform.pas b/Source/forms/simba.functionlistform.pas index 558860605..6b240b80b 100644 --- a/Source/forms/simba.functionlistform.pas +++ b/Source/forms/simba.functionlistform.pas @@ -163,6 +163,7 @@ function GetURL(const Section: String): String; 'Misc': Result := 'https://villavu.github.io/Simba/Misc.html'; 'Dialogs': Result := 'https://villavu.github.io/Simba/Dialogs.html'; 'DTM': Result := 'https://villavu.github.io/Simba/DTM.html'; + 'System': Result := 'https://villavu.github.io/Simba/System.html'; end; end; diff --git a/Source/script/imports/simba/simba.import_system.pas b/Source/script/imports/simba/simba.import_system.pas index 7982bc4d2..6eaf254ee 100644 --- a/Source/script/imports/simba/simba.import_system.pas +++ b/Source/script/imports/simba/simba.import_system.pas @@ -14,8 +14,14 @@ implementation uses Graphics, - lptypes, lpvartypes, lpparser, ffi, - simba.nativeinterface, simba.env, simba.threading; + lptypes, lpvartypes, lpparser, + simba.nativeinterface, simba.env; + +(* +System +====== +Base methods and types. +*) procedure _LapePreciseSleep(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV begin @@ -49,6 +55,286 @@ procedure _LapeGetEnvVars(const Params: PParamArray; const Result: Pointer); LAP PStringArray(Result)^ := _GetEnvVars(); end; +(* +GetMem +~~~~~~ +> function GetMem(i: SizeInt): Pointer; +*) + +(* +AllocMem +~~~~~~~~ +> function AllocMem(i: SizeInt): Pointer; +*) + +(* +FreeMem +~~~~~~~ +> procedure FreeMem(p: Pointer); +*) + +(* +ReallocMem +~~~~~~~~~~ +> procedure ReallocMem(var p: Pointer; s: SizeInt); +*) + +(* +FillMem +~~~~~~~ +> procedure FillMem(var p; s: SizeInt; b: UInt8 = 0); +*) + +(* +Move +~~~~ +> procedure Move(constref Src; var Dst; s: SizeInt); +*) + +(* +CompareMem +~~~~~~~~~~ +> function CompareMem(constref p1, p2; Length: SizeInt): EvalBool; +*) + +(* +Assigned +~~~~~~~~ +> function Assigned(constref p): EvalBool; +*) + +(* +Delete +~~~~~~ +> procedure Delete(A: array; Index: Int32; Count: Int32 = Length(A)); +*) + +(* +Insert +~~~~~~ +> procedure Insert(Item: Anything; A: array; Index: Int32); +*) + +(* +Copy +~~~~ +> procedure Copy(A: array; Index: Int32 = 0; Count: Int32 = Length(A)); +*) + +(* +SetLength +~~~~~~~~~ +> procedure SetLength(A: array; Length: Int32); +*) + +(* +Low +~~~ +> function Low(A: array): Int32; +*) + +(* +High +~~~~ +> function High(A: array): Int32; +*) + +(* +Length +~~~~~~ +> function Length(A: array): Int32; +*) + +(* +WriteLn +~~~~~~~ +> procedure WriteLn(Args: Anything); +*) + +(* +Write +~~~~~ +> procedure Write(Args: Anything); +*) + +(* +Swap +~~~~ +> procedure Swap(var A, B: Anything); +*) + +(* +SizeOf +~~~~~~ +> function SizeOf(A: Anything): Int32; +*) + +(* +ToString +~~~~~~~~ +> function ToString(A: Anything): String; +*) + +(* +ToStr +~~~~~ +> function ToStr(A: Anything): String; +*) + +(* +Inc +~~~ +> function Inc(var X: Ordinal; Amount: SizeInt = 1): Ordinal; +*) + +(* +Dec +~~~ +> function Dec(var X: Ordinal; Amount: SizeInt = 1): Ordinal; +*) + +(* +Ord +~~~ +> function Ord(X: Ordinal): Int32; +*) + +(* +SleepUntil +~~~~~~~~~~ +> function SleepUntil(Condition: BoolExpr; Interval, Timeout: Int32): Boolean; +*) + +(* +Default +~~~~~~~ +> function Default(T: AnyType): AnyType; +*) + +(* +Sort +~~~~ +> procedure Sort(var A: array); +> procedure Sort(var A: array; Weights: array of Ordinal; LowToHigh: Boolean); +> procedure Sort(var A: array; CompareFunc: function(constref L, R: Anything): Int32); +*) + +(* +Sorted +~~~~~~ +> function Sorted(const A: array): array; overload; +> function Sorted(const A: array; CompareFunc: function(constref L, R: Anything): Int32): array; +> function Sorted(const A: array; Weights: array of Ordinal; LowToHigh: Boolean): array; +*) + +(* +Unique +~~~~~~ +> function Unique(const A: array): array; +*) + +(* +Reverse +~~~~~~~ +> procedure Reverse(var A: array); +*) + +(* +Reversed +~~~~~~~~ +> function Reversed(const A: array): array; +*) + +(* +IndexOf +~~~~~~~ +> function IndexOf(const Item: T; const A: array): Integer; +*) + +(* +IndicesOf +~~~~~~~~~ +> function IndicesOf(const Item: T; const A: array): TIntegerArray; +*) + +(* +Contains +~~~~~~~~ +> function Contains(const Item: T; const A: array): Boolean; +*) + +(* +GetCallerAddress +~~~~~~~~~~~~~~~~ +> function GetCallerAddress: Pointer; +*) + +(* +GetCallerName +~~~~~~~~~~~~~ +> function GetCallerName: String; +*) + +(* +GetCallerLocation +~~~~~~~~~~~~~~~~~ +> function GetCallerLocation: Pointer; +*) + +(* +GetCallerLocationStr +~~~~~~~~~~~~~~~~~~~~ +> function GetCallerLocationStr: String; +*) + +(* +GetExceptionLocation +~~~~~~~~~~~~~~~~~~~~ +> function GetExceptionLocation: Pointer; +*) + +(* +GetExceptionLocationStr +~~~~~~~~~~~~~~~~~~~~~~~ +> function GetExceptionLocationStr: String; +*) + +(* +GetExceptionMessage +~~~~~~~~~~~~~~~~~~~ +> function GetExceptionMessage: String; +*) + +(* +GetScriptMethodName +~~~~~~~~~~~~~~~~~~~ +> function GetScriptMethodName(Address: Pointer): String; +*) + +(* +DumpCallStack +~~~~~~~~~~~~~ +> function DumpCallStack(Start: Integer = 0): String; +*) + +(* +LoadLibrary +~~~~~~~~~~~ +> function LoadLibrary(const Name: string): TLibHandle; +*) + +(* +GetProcAddress +~~~~~~~~~~~~~~ +> function GetProcAddress(Lib: TlibHandle; const ProcName: string): ConstPointer; +*) + +(* +FreeLibrary +~~~~~~~~~~~ +> function FreeLibrary(Lib: TLibHandle): EvalBool; +*) + procedure ImportSystem(Compiler: TSimbaScript_Compiler); begin with Compiler do diff --git a/Source/script/imports/simbaclasses/simba.import_class_dtm.pas b/Source/script/imports/simbaclasses/simba.import_class_dtm.pas index 72e8076d1..37370c6ce 100644 --- a/Source/script/imports/simbaclasses/simba.import_class_dtm.pas +++ b/Source/script/imports/simbaclasses/simba.import_class_dtm.pas @@ -21,7 +21,7 @@ implementation === DTM related methods -Image:: ../images/dtm.png +Image:: ../../images/dtm.png *) (*