Difference between revisions of "Unit GlobalTypes"

From Ultibo.org
Jump to: navigation, search
 
(6 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
'''Ultibo Global Type Definitions unit'''
 
'''Ultibo Global Type Definitions unit'''
 
''To be documented''
 
  
 
=== Constants ===
 
=== Constants ===
Line 38: Line 36:
 
|-
 
|-
 
| <code>TConditionHandle = THandle;</code>
 
| <code>TConditionHandle = THandle;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>TCompletionHandle = THandle;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 116: Line 117:
 
|-
 
|-
 
| <code>PConditionHandle = ^TConditionHandle;</code>
 
| <code>PConditionHandle = ^TConditionHandle;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PCompletionHandle = ^TCompletionHandle;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 173: Line 177:
 
|-
 
|-
 
| <code>LPDWORD = ^DWORD;</code>
 
| <code>LPDWORD = ^DWORD;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PUINT = ^UINT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PUCHAR = ^UCHAR;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PUSHORT = ^USHORT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PULONG = ^ULONG;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 504: Line 520:
 
|-
 
|-
 
|}
 
|}
</div></div>
+
</div></div>
 +
 
 +
'''Display settings'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TDisplaySettings = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>DisplayNumber:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Width:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Height:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Depth:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Pitch:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>VirtualWidth:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>VirtualHeight:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>VirtualWidthOffset:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>VirtualHeightOffset:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>FramebufferAddress:PtrUInt;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 
   
 
   
 
'''Color formatBGR24 (BGR)'''   
 
'''Color formatBGR24 (BGR)'''   
Line 542: Line 599:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>BOOL = LongBool;</code>
+
| <code>BOOL = ByteBool;</code>
| style="width: 40%;"|
+
| style="width: 40%;"|LongBool; (Compatible with built in GCC _Bool type)
 
|-
 
|-
 
|}
 
|}
Line 552: Line 609:
 
|-
 
|-
 
| <code>INT = Integer;</code>
 
| <code>INT = Integer;</code>
| style="width: 40%;"|Declared in system unit
+
| style="width: 40%;"|
 
|-
 
|-
 
| <code>LONG = LongInt;</code>
 
| <code>LONG = LongInt;</code>
Line 584: Line 641:
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
| <code>ULONGLONG = Int64;</code>
+
| <code>ULONGLONG = UInt64;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 596: Line 653:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>SIZE_T = ULONG_PTR;</code>
+
| <code>SIZE_T = SizeUInt;</code>
| style="width: 40%;"|
+
| style="width: 40%;"|ULONG_PTR;
 +
|-
 +
| <code>SSIZE_T = SizeInt;</code>
 +
| style="width: 40%;"|LONG_PTR;
 
|-
 
|-
 
|}
 
|}
Line 618: Line 678:
 
|-
 
|-
 
| <code>WCHAR = WideChar;</code>
 
| <code>WCHAR = WideChar;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PWCHAR = ^WCHAR;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 655: Line 718:
  
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>int8_t = Shortint;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pint8_t = PShortint;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>uint8_t = Byte;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>puint8_t = PByte;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>int16_t = Smallint;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pint16_t = PSmallint;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|colspan="2"|&nbsp;
 
|-
 
|-
 
| <code>uint16_t = Word;</code>
 
| <code>uint16_t = Word;</code>
Line 692: Line 779:
 
|-
 
|-
 
| <code>puint64_t = PQWord;</code>
 
| <code>puint64_t = PQWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>float_t = Single;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pfloat_t = PSingle;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>double_t = Double;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pdouble_t = PDouble;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-

Latest revision as of 04:33, 31 August 2021

Return to Unit Reference


Description


Ultibo Global Type Definitions unit

Constants


None defined

Type definitions



Handle types

TSpinHandle = THandle;
TMutexHandle = THandle;
TCriticalSectionHandle = THandle;
TSemaphoreHandle = THandle;
TSynchronizerHandle = THandle;
TConditionHandle = THandle;
TCompletionHandle = THandle;
TListHandle = THandle;
TQueueHandle = THandle;
TThreadHandle = THandle;
TMessageslotHandle = THandle;
TMailslotHandle = THandle;
TBufferHandle = THandle;
TEventHandle = THandle;
TTimerHandle = THandle;
TWorkerHandle = THandle;
TWindowHandle = THandle;
TFontHandle = THandle;
TKeymapHandle = THandle;
HANDLE = PtrUInt; LongWord
PHANDLE = ^HANDLE;
LPHANDLE = ^HANDLE;
THandle = HANDLE; Declared in system unit
HLOCAL = HANDLE;
HGLOBAL = HANDLE;
HWND = HANDLE;

Pointer types

PMutexHandle = ^TMutexHandle;
PCriticalSectionHandle = ^TCriticalSectionHandle;
PSemaphoreHandle = ^TSemaphoreHandle;
PSynchronizerHandle = ^TSynchronizerHandle;
PConditionHandle = ^TConditionHandle;
PCompletionHandle = ^TCompletionHandle;
PListHandle = ^TListHandle;
PQueueHandle = ^TQueueHandle;
PThreadHandle = ^TThreadHandle;
PMessageslotHandle = ^TMessageslotHandle;
PMailslotHandle = ^TMailslotHandle;
PBufferHandle = ^TBufferHandle;
PEventHandle = ^TEventHandle;
PTimerHandle = ^TTimerHandle;
PWorkerHandle = ^TWorkerHandle;
PWindowHandle = ^TWindowHandle;
PFontHandle = ^TFontHandle;
PKeymapHandle = ^TKeymapHandle;
PVOID = Pointer;
LPVOID = Pointer;
LPCVOID = Pointer;
LPBOOL = ^BOOL;
PLONG = ^LONG;
LPLONG = ^LONG;
LPDWORD = ^DWORD;
PUINT = ^UINT;
PUCHAR = ^UCHAR;
PUSHORT = ^USHORT;
PULONG = ^ULONG;
INT_PTR = PtrInt; Integer
UINT_PTR = PtrUInt; LongWord
LONG_PTR = PtrInt; LongInt
ULONG_PTR = PtrUInt; LongWord
DWORD_PTR = ULONG_PTR;
PDWORD_PTR = ^DWORD_PTR;
TFarProc = Pointer;

Method types

TGetLastError = function:LongWord;
TSetLastError = procedure(LastError:LongWord);

Color format32 (Generic)

PColorFormat32 = ^TColorFormat32;

TColorFormat32 = packed record

case Integer of  
0:(A:Byte;  
B:Byte;  
C:Byte;  
D:Byte);  
1:(Value:LongWord);  
 
case Integer of  
0:(D:Byte;  
C:Byte;  
B:Byte;  
A:Byte);  
1:(Value:LongWord);  

Color format24 (Generic)

PColorFormat24 = ^TColorFormat24;

TColorFormat24 = packed record

A:Byte;  
B:Byte;  
C:Byte;  
 
C:Byte;  
B:Byte;  
A:Byte;  

Color format16 (Generic)

PColorFormat16 = ^TColorFormat16;

TColorFormat16 = packed record

Value:Word;  

Color format8 (Generic)

PColorFormat8 = ^TColorFormat8;

TColorFormat8 = packed record

Value:Byte;  

Color formatARGB32 (RGB)

PColorFormatARGB32 = ^TColorFormatARGB32;

TColorFormatARGB32 = packed record

Alpha:Byte;  
Red:Byte;  
Green:Byte;  
Blue:Byte;  
 
Blue:Byte;  
Green:Byte;  
Red:Byte;  
Alpha:Byte;  

Color formatRGBA32 (RGB)

PColorFormatRGBA32 = ^TColorFormatRGBA32;

TColorFormatRGBA32 = packed record

Red:Byte;  
Green:Byte;  
Blue:Byte;  
Alpha:Byte;  
 
Alpha:Byte;  
Blue:Byte;  
Green:Byte;  
Red:Byte;  

Color formatRGB24 (RGB)

PColorFormatRGB24 = ^TColorFormatRGB24;

TColorFormatRGB24 = packed record

Red:Byte;  
Green:Byte;  
Blue:Byte;  
 
Blue:Byte;  
Green:Byte;  
Red:Byte;  

Color formatABGR32 (BGR)

PColorFormatABGR32 = ^TColorFormatABGR32;

TColorFormatABGR32 = packed record

Alpha:Byte;  
Blue:Byte;  
Green:Byte;  
Red:Byte;  
 
Red:Byte;  
Green:Byte;  
Blue:Byte;  
Alpha:Byte;  

Color formatBGRA32 (BGR)

PColorFormatBGRA32 = ^TColorFormatBGRA32;

TColorFormatBGRA32 = packed record

Blue:Byte;  
Green:Byte;  
Red:Byte;  
Alpha:Byte;  
 
Alpha:Byte;  
Red:Byte;  
Green:Byte;  
Blue:Byte;  

Display settings

TDisplaySettings = record

DisplayNumber:LongWord;  
Width:LongWord;  
Height:LongWord;  
Depth:LongWord;  
Pitch:LongWord;  
VirtualWidth:LongWord;  
VirtualHeight:LongWord;  
VirtualWidthOffset:LongWord;  
VirtualHeightOffset:LongWord;  
FramebufferAddress:PtrUInt;  

Color formatBGR24 (BGR)

PColorFormatBGR24 = ^TColorFormatBGR24;

TColorFormatBGR24 = packed record

Blue:Byte;  
Green:Byte;  
Red:Byte;  
 
Red:Byte;  
Green:Byte;  
Blue:Byte;  

Boolean types

BOOL = ByteBool; LongBool; (Compatible with built in GCC _Bool type)

Signed types

INT = Integer;
LONG = LongInt;

Unsigned types

UINT = LongWord;
UCHAR = Byte;
USHORT = Word;
ULONG = LongWord;

64bit types

LONGLONG = Int64;
ULONGLONG = UInt64;
DWORDLONG = ULONGLONG;

Size types

SIZE_T = SizeUInt; ULONG_PTR;
SSIZE_T = SizeInt; LONG_PTR;

String types

LPSTR = ^CHAR;
LPCSTR = ^CHAR;

Wide string types

WCHAR = WideChar;
PWCHAR = ^WCHAR;
LPWSTR = ^WCHAR;
LPCWSTR = ^WCHAR;

Parameter types

WPARAM = UINT_PTR;
LPARAM = LONG_PTR;
LRESULT = LONG_PTR;

Procedure types

FARPROC = function: Integer;

C types

int8_t = Shortint;
pint8_t = PShortint;
 
uint8_t = Byte;
puint8_t = PByte;
 
int16_t = Smallint;
pint16_t = PSmallint;
 
uint16_t = Word;
puint16_t = PWord;
 
int32_t = LongInt;
pint32_t = PLongInt;
 
uint32_t = LongWord;
puint32_t = PLongWord;
 
int64_t = Int64;
pint64_t = PInt64;
 
uint64_t = QWord;
puint64_t = PQWord;
 
float_t = Single;
pfloat_t = PSingle;
 
double_t = Double;
pdouble_t = PDouble;

Atomic types

patomic_t = ^atomic_t;

atomic_t = record

counter: LongInt;  

Atomic64 types

patomic64_t = ^atomic64_t;

atomic64_t = record

counter: Int64;  

Socket types

TSocket = UINT_PTR;

WSA event

WSAEVENT = THandle;

Overlapped structure types

OVERLAPPED = _OVERLAPPED;

TOverlapped = OVERLAPPED;

POverlapped = LPOVERLAPPED;

LPOVERLAPPED = ^OVERLAPPED;

_OVERLAPPED = record

Internal: ULONG_PTR;  
InternalHigh: ULONG_PTR;  
Union: record  
case Integer of  
0: (  
Offset: DWORD;  
OffsetHigh: DWORD);  
1: (  
Pointer: PVOID);  
 
hEvent: HANDLE;  


Public variables


None defined

Function declarations


None defined


Return to Unit Reference