Skip to content

Commit

Permalink
Add system doc headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 9, 2023
1 parent 667e92e commit 8c1180f
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ backup/
/DocGen/build/genindex.html
/DocGen/build/index.html
/DocGen/build/objects.inv
/DocGen/build/_images
1 change: 1 addition & 0 deletions DocGen/docgen.simba
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
5 changes: 3 additions & 2 deletions Source/editor/simba.editor_autocomplete.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions Source/forms/simba.functionlistform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
290 changes: 288 additions & 2 deletions Source/script/imports/simba/simba.import_system.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ implementation
===
DTM related methods
Image:: ../images/dtm.png
Image:: ../../images/dtm.png
*)

(*
Expand Down

0 comments on commit 8c1180f

Please sign in to comment.