arosunits: Removed Objfpc in all units, changed "array of const" to "array of PtrUInt"

git-svn-id: trunk@32996 -
This commit is contained in:
marcus 2016-01-24 14:00:54 +00:00
parent 356ab8f63d
commit e8cb0d0415
13 changed files with 470 additions and 682 deletions

View File

@ -15,9 +15,7 @@
unit agraphics;
{$mode delphi}{$H+}
Interface
interface
uses
Exec, Hardware, Utility;
@ -2200,7 +2198,7 @@ procedure ScrollVPort(Vp: PViewPort); syscall GfxBase 98;
procedure SetABPenDrMd(Rp: PRastPort; APen: LongWord; BPen: LongWord; DrawMode: LongWord); syscall GfxBase 149;
procedure SetAPen(Rp: PRastPort; Pen: LongWord); syscall GfxBase 57;
procedure SetBPen(Rp: PRastPort; Pen: LongWord); syscall GfxBase 58;
function SetChipRev(ChipRev: LongWord): LongWord; platform; syscall GfxBase 148;
function SetChipRev(ChipRev: LongWord): LongWord; syscall GfxBase 148; platform;
procedure SetCollision(Num: LongWord; Routine: TProcedure; GInfo: PGelsInfo); syscall GfxBase 24;
procedure SetDisplayDriverCallback(CallBack: TDriverNotifyFunc; UserData: APTR); syscall GfxBase 186;
procedure SetDrMd(Rp: PRastPort; DrawMode: LongWord); syscall GfxBase 59;
@ -2226,7 +2224,7 @@ function TextFit(Rp: PRastPort; const String_: STRPTR; StrLen: LongWord; TextExt
function TextLength(Rp: PRastPort; const string_: STRPTR; Count: LongWord): SmallInt; syscall GfxBase 9;
function UCopperListInit(Ucl: PUCopList; n: SmallInt): PCopList; syscall GfxBase 99;
procedure UnlockLayerRom(l: PLayer); syscall GfxBase 73;
function VBeamPos: LongInt; platform; syscall GfxBase 64;
function VBeamPos: LongInt; syscall GfxBase 64; platform;
function VideoControl(Cm: PColorMap; Tags: PTagItem): LongWord; syscall GfxBase 118; unimplemented;
procedure WaitBlit; syscall GfxBase 38; unimplemented;
procedure WaitBOVP(Vp: PViewPort); syscall GfxBase 67; unimplemented;
@ -2242,15 +2240,15 @@ function XorRectRegionND(Reg: PRegion; Rect: PRectangle): PRegion; syscall GfxBa
function XorRegionRegion(SrcRegion: PRegion; DestRegion: PRegion): LongBool; syscall GfxBase 103;
function XorRegionRegionND(R1: PRegion; R2: PRegion): PRegion; syscall GfxBase 151;
function BestModeID(Tags: array of const): LongWord;
function AllocSpriteData(Bitmap: PBitMap; Tags: array of const): PExtSprite;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; Tags: array of const): LongInt;
function ExtendFontTags(Font: PTextFont; Tags: array of const): LongWord;
function GetExtSprite(Sprite: PExtSprite; Tags: array of const): LongInt;
procedure GetRPAttrs(Rp: PRastPort; Tags: array of const);
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; Tags: array of const): LongInt;
procedure SetRPAttrs(Rp: PRastPort; Tags: array of const);
function VideoControlTags(Cm: PColorMap; Tags: array of const): LongWord; unimplemented;
function BestModeID(const Tags: array of PtrUInt): LongWord;
function AllocSpriteData(Bitmap: PBitMap; const Tags: array of PtrUInt): PExtSprite;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; const Tags: array of PtrUInt): LongInt;
function ExtendFontTags(Font: PTextFont; const Tags: array of PtrUInt): LongWord;
function GetExtSprite(Sprite: PExtSprite; const Tags: array of PtrUInt): LongInt;
procedure GetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt);
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; const Tags: array of PtrUInt): LongInt;
procedure SetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt);
function VideoControlTags(Cm: PColorMap; const Tags: array of PtrUInt): LongWord; unimplemented;
// gfxmacros
@ -2284,80 +2282,50 @@ procedure CEND(c: PUCopList);
implementation
uses
tagsarray;
function BestModeID(Tags: array of const): LongWord;
var
TagList: TTagsList;
function BestModeID(const Tags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, Tags);
Result := BestModeIDA(GetTagPtr(TagList));
BestModeID := BestModeIDA(@Tags);
end;
function AllocSpriteData(Bitmap: PBitMap; Tags: array of const): PExtSprite;
var
TagList: TTagsList;
function AllocSpriteData(Bitmap: PBitMap; const Tags: array of PtrUInt): PExtSprite; inline;
begin
AddTags(TagList, Tags);
Result := AllocSpriteDataA(Bitmap, GetTagPtr(TagList));
AllocSpriteData := AllocSpriteDataA(Bitmap, @Tags);
end;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; Tags: array of const): LongInt;
var
TagList: TTagsList;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
Result := ChangeExtSpriteA(Vp, Oldsprite, NewSprite, GetTagPtr(TagList));
ChangeExtSprite := ChangeExtSpriteA(Vp, Oldsprite, NewSprite, @Tags);
end;
function ExtendFontTags(Font: PTextFont; Tags: array of const): LongWord;
var
TagList: TTagsList;
function ExtendFontTags(Font: PTextFont; const Tags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, Tags);
Result := ExtendFont(Font, GetTagPtr(TagList));
ExtendFontTags := ExtendFont(Font, @Tags);
end;
function GetExtSprite(Sprite: PExtSprite; Tags: array of const): LongInt;
var
TagList: TTagsList;
function GetExtSprite(Sprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
Result := GetExtSpriteA(Sprite, GetTagPtr(TagList));
GetExtSprite := GetExtSpriteA(Sprite, @Tags);
end;
procedure GetRPAttrs(Rp: PRastPort; Tags: array of const);
var
TagList: TTagsList;
procedure GetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
begin
AddTags(TagList, Tags);
GetRPAttrsA(Rp, GetTagPtr(TagList));
GetRPAttrsA(Rp, @Tags);
end;
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; Tags: array of const): LongInt;
var
TagList: TTagsList;
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
Result := ObtainBestPenA(Cm, r, g, b, GetTagPtr(TagList));
ObtainBestPen := ObtainBestPenA(Cm, r, g, b, @Tags);
end;
procedure SetRPAttrs(Rp: PRastPort; Tags: array of const);
var
TagList: TTagsList;
procedure SetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
begin
AddTags(TagList, Tags);
SetRPAttrsA(Rp, GetTagPtr(TagList));
SetRPAttrsA(Rp, @Tags);
end;
function VideoControlTags(Cm: PColorMap; Tags: array of const): LongWord;
var
TagList: TTagsList;
function VideoControlTags(Cm: PColorMap; const Tags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, Tags);
{$WARNINGS OFF} // suppress unimplemented Warning
Result := VideoControl(Cm, GetTagPtr(TagList));
VideoControlTags := VideoControl(Cm, @Tags);
{$WARNINGS ON}
end;
@ -2383,7 +2351,7 @@ end;
function RasSize(w, h: Word): Integer; inline;
begin
Result := h * (((w + 15) shr 3) and $FFFE);
RasSize := h * (((w + 15) shr 3) and $FFFE);
end;
function BitmapFlags_are_Extended(f: LongInt): Boolean; inline;
@ -2404,7 +2372,7 @@ end;
function SetAOlPen(Rp: PRastPort; Pen: LongWord): LongWord; inline;
begin
Result := SetOutlinePen(Rp, Pen);
SetAOlPen := SetOutlinePen(Rp, Pen);
end;
procedure BNDRYOFF (w: PRastPort); inline;
@ -2446,12 +2414,12 @@ end;
function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
begin
Result := AreaEllipse(Rp, xCenter, yCenter, r, r);
AreaCircle := AreaEllipse(Rp, xCenter, yCenter, r, r);
end;
function CINIT(c: PUCopList; n: SmallInt): PCopList; inline;
begin
Result := UCopperListInit(c, n);
CINIT := UCopperListInit(c, n);
end;
procedure CMOVE1(c: PUCopList; a: Pointer; b: LongInt);

View File

@ -23,7 +23,7 @@
{$define AROS_FAST_BPTR}
unit amigados;
{$mode objfpc}
interface
uses
@ -2418,10 +2418,10 @@ function WriteChar(c: LongInt): LongInt;
function UnReadChar(c: LongInt): LongInt;
// Special functions for var args
function AllocDosObjectTags(const Type_: LongWord; const Tags: array of const): APTR;
function CreateNewProcTags(const Tags: array of const): PProcess;
function NewLoadSegTags(const File_: STRPTR; const Tags: array of const): BPTR;
function SystemTags(const Command: STRPTR; const Tags: array of const): LongInt;
function AllocDosObjectTags(const Type_: LongWord; const Tags: array of PtrUInt): APTR;
function CreateNewProcTags(const Tags: array of PtrUInt): PProcess;
function NewLoadSegTags(const File_: STRPTR; const Tags: array of PtrUInt): BPTR;
function SystemTags(const Command: STRPTR; const Tags: array of PtrUInt): LongInt;
// elf.h
@ -2436,7 +2436,6 @@ function ELF_R_TYPE(i: LongWord): LongWord;
function ELF_R_INFO(Sym: LongWord; Type_: LongWord): LongWord;
{$endif}
const
BNULL = nil;
@ -2445,76 +2444,61 @@ function BADDR(a: BPTR): APTR;
implementation
uses
tagsarray;
function ELF_ST_TYPE(i: LongWord): LongWord;
function ELF_ST_TYPE(i: LongWord): LongWord; inline;
begin
Result := i and $0F;
ELF_ST_TYPE := i and $0F;
end;
{$ifdef ELF_64BIT}
function ELF_R_SYM(i: QWord): QWord;
function ELF_R_SYM(i: QWord): QWord; inline;
begin
Result := i shr 32;
ELF_R_SYM := i shr 32;
end;
function ELF_R_TYPE(i: QWord): QWord;
function ELF_R_TYPE(i: QWord): QWord; inline;
begin
Result := i and $ffffffff;
ELF_R_TYPE := i and $ffffffff;
end;
function ELF_R_INFO(Sym: QWord; Type_: QWord): QWord;
function ELF_R_INFO(Sym: QWord; Type_: QWord): QWord; inline;
begin
Result := Sym shl 32 + Type_;
ELF_R_INFO := Sym shl 32 + Type_;
end;
{$else}
function ELF_R_SYM(i: LongWord): LongWord;
function ELF_R_SYM(i: LongWord): LongWord; inline;
begin
Result := i shr 8;
ELF_R_SYM := i shr 8;
end;
function ELF_R_TYPE(i: LongWord): LongWord;
function ELF_R_TYPE(i: LongWord): LongWord; inline;
begin
Result := i and $ff;
ELF_R_TYPE := i and $ff;
end;
function ELF_R_INFO(Sym: LongWord; Type_: LongWord): LongWord;
function ELF_R_INFO(Sym: LongWord; Type_: LongWord): LongWord; inline;
begin
Result := Sym shl 8 + (Type_ and $ff);
ELF_R_INFO := Sym shl 8 + (Type_ and $ff);
end;
{$endif}
function AllocDosObjectTags(const Type_: LongWord; const Tags: array of const): APTR;
var
TagList: TTagsList;
function AllocDosObjectTags(const Type_: LongWord; const Tags: array of PtrUInt): APTR; inline;
begin
AddTags(TagList, Tags);
AllocDosObjectTags := AllocDosObject(Type_, GetTagPtr(TagList));
AllocDosObjectTags := AllocDosObject(Type_, @Tags);
end;
function CreateNewProcTags(const Tags: array of const): PProcess;
var
TagList: TTagsList;
function CreateNewProcTags(const Tags: array of PtrUInt): PProcess; inline;
begin
AddTags(TagList, Tags);
CreateNewProcTags := CreateNewProc(GetTagPtr(TagList));
CreateNewProcTags := CreateNewProc(@Tags);
end;
function NewLoadSegTags(const File_: STRPTR; const Tags: array of const): BPTR;
var
TagList: TTagsList;
function NewLoadSegTags(const File_: STRPTR; const Tags: array of PtrUInt): BPTR; inline;
begin
AddTags(TagList, Tags);
NewLoadSegTags := NewLoadSeg(File_, GetTagPtr(TagList));
NewLoadSegTags := NewLoadSeg(File_, @Tags);
end;
function SystemTags(const Command: STRPTR; const Tags: array of const): LongInt;
var
TagList: TTagsList;
function SystemTags(const Command: STRPTR; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
SystemTags := SystemTagList(Command, GetTagPtr(TagList));
SystemTags := SystemTagList(Command, @Tags);
end;
function MKBADDR(a: APTR): BPTR; inline;
@ -2535,17 +2519,17 @@ begin
{$endif}
end;
function ReadChar(): LongInt;
function ReadChar(): LongInt; inline;
begin
ReadChar := FGetC(DosInput());
end;
function WriteChar(c: LongInt): LongInt;
function WriteChar(c: LongInt): LongInt; inline;
begin
WriteChar := FPutC(DosOutput(), c);
end;
function UnReadChar(c: LongInt): LongInt;
function UnReadChar(c: LongInt): LongInt; inline;
begin
UnReadChar := UnGetC(DosInput(),c);
end;

View File

@ -15,12 +15,10 @@
unit asl;
{$mode objfpc}
interface
uses
exec, utility, workbench, agraphics, tagsarray;
exec, utility, workbench, agraphics;
const
ASLNAME: PChar = 'asl.library';
@ -508,34 +506,25 @@ function RequestFile(FileReq: PFileRequester): LongBool; syscall ASLBase 7;
procedure AbortAslRequest(Requester: Pointer); syscall ASLBase 13;
procedure ActivateAslRequest(Requester: Pointer); syscall ASLBase 14;
function AllocAslRequest(ReqType: LongWord; const Tags: array of const): Pointer;
function AslRequest(Requester: Pointer; const Tags: array of const): LongBool;
function AslRequestTags(Requester: Pointer; const Tags: array of const): LongBool;
function AllocAslRequest(ReqType: LongWord; const Tags: array of PtrUInt): Pointer;
function AslRequest(Requester: Pointer; const Tags: array of PtrUInt): LongBool;
function AslRequestTags(Requester: Pointer; const Tags: array of PtrUInt): LongBool;
implementation
function AllocAslRequest(ReqType: LongWord; const Tags: array of const): Pointer;
var
TagList: TTagsList;
function AllocAslRequest(ReqType: LongWord; const Tags: array of PtrUInt): Pointer; inline;
begin
AddTags(TagList, Tags);
AllocAslRequest := AllocAslRequestA(reqType , GetTagPtr(TagList));
AllocAslRequest := AllocAslRequestA(reqType, @Tags);
end;
function AslRequest(Requester: Pointer; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function AslRequest(Requester: Pointer; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
AslRequest := AslRequestA(Requester , GetTagPtr(TagList));
AslRequest := AslRequestA(Requester, @Tags);
end;
function AslRequestTags(Requester: Pointer; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function AslRequestTags(Requester: Pointer; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
AslRequestTags := AslRequestA(Requester , GetTagPtr(TagList));
AslRequestTags := AslRequestA(Requester, @Tags);
end;
initialization

View File

@ -16,8 +16,7 @@
unit clipboard;
interface
{$mode objfpc}{$H+}
{$H+}
uses exec;
@ -74,8 +73,8 @@ type
chm_ClipID : LongInt; { the clip identifier of the new data }
END;
function GetTextFromClip(ClipUnit: Byte): string;
function PutTextToClip(ClipUnit: Byte; Text: string): Boolean;
function GetTextFromClip(ClipUnit: Byte): AnsiString;
function PutTextToClip(ClipUnit: Byte; Text: AnsiString): Boolean;
implementation
@ -87,7 +86,7 @@ const
ID_FTXT = 1179932756;
ID_CHRS = 1128813139;
function GetTextFromClip(ClipUnit: Byte): string;
function GetTextFromClip(ClipUnit: Byte): AnsiString;
var
Iff: PIffHandle;
Error: LongInt;
@ -96,7 +95,7 @@ var
Len: Integer;
Cu: LongInt;
begin
Result := '';
GetTextFromClip := '';
Cu := ClipUnit;
Iff := AllocIff;
if Assigned(Iff) then
@ -124,15 +123,12 @@ begin
begin
GetMem(Buf, Len + 1);
FillChar(Buf^, Len + 1, #0);
try
ReadChunkBytes(Iff, Buf, Len);
Result := Result + string(Buf);
finally
GetTextFromClip := GetTextFromClip + AnsiString(Buf);
FreeMem(Buf);
end;
end;
end;
end;
CloseIff(Iff);
end;
CloseClipboard(PClipBoardHandle(iff^.iff_Stream));
@ -141,13 +137,13 @@ begin
end;
end;
function PutTextToClip(ClipUnit: Byte; Text: string): Boolean;
function PutTextToClip(ClipUnit: Byte; Text: AnsiString): Boolean;
var
Iff: PIffHandle;
TText: string;
TText: AnsiString;
Len: Integer;
begin
Result := False;
PutTextToClip := False;
Iff := AllocIff;
if Assigned(Iff) then
begin
@ -163,7 +159,7 @@ begin
begin
Len := Length(Text);
TText := Text + #0;
Result := WriteChunkBytes(iff, @(TText[1]), Len) = len;
PutTextToClip := WriteChunkBytes(iff, @(TText[1]), Len) = len;
PopChunk(iff);
end;
PopChunk(iff);

View File

@ -14,7 +14,7 @@
**********************************************************************}
unit cybergraphics;
{$mode objfpc}
interface
uses
@ -236,68 +236,47 @@ procedure BltTemplateAlpha(src: APTR; srcx: LongInt; srcmod: LongInt; rp: PRastP
procedure ProcessPixelArray(rp: PRastPort; destX: LongWord; destY: LongWord; sizeX: LongWord; sizeY: LongWord; operation: LongWord; value: LongInt; taglist: PTagItem); syscall CyberGfxBase 38;
// Functions and procedures with array of const go here
function AllocCModeListTags(const ModeListTags: array of const): PList;
function BestCModeIDTags(const BestModeIDTags: array of const): LongWord;
procedure CVideoCtrlTags(ViewPort: PViewPort; const TagList: array of const);
procedure DoCDrawMethodTags(Hook: PHook; a1arg: PRastPort; const TagList: array of const);
function LockBitMapTags(BitMap: APTR; const TagList: array of const): APTR;
procedure UnLockBitMapTags(Handle: APTR; const TagList: array of const);
function AllocCModeListTags(const ModeListTags: array of PtrUInt): PList;
function BestCModeIDTags(const BestModeIDTags: array of PtrUInt): LongWord;
procedure CVideoCtrlTags(ViewPort: PViewPort; const TagList: array of PtrUInt);
procedure DoCDrawMethodTags(Hook: PHook; a1arg: PRastPort; const TagList: array of PtrUInt);
function LockBitMapTags(BitMap: APTR; const TagList: array of PtrUInt): APTR;
procedure UnLockBitMapTags(Handle: APTR; const TagList: array of PtrUInt);
function SHIFT_PIXFMT(fmt: LongInt): LongInt;
function DOWNSHIFT_PIXFMT(fmt: LongInt): LongInt;
implementation
uses
tagsarray;
// Functions and procedures with array of const go here
function AllocCModeListTags(const ModeListTags: array of const): PList;
var
TagList: TTagsList;
function AllocCModeListTags(const ModeListTags: array of PtrUInt): PList; inline;
begin
AddTags(TagList, ModeListTags);
AllocCModeListTags := AllocCModeListTagList(GetTagPtr(TagList));
AllocCModeListTags := AllocCModeListTagList(@ModeListTags);
end;
function BestCModeIDTags(const BestModeIDTags: array of const): LongWord;
var
TagList: TTagsList;
function BestCModeIDTags(const BestModeIDTags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, BestModeIDTags);
BestCModeIDTags := BestCModeIDTagList(GetTagPtr(TagList));
BestCModeIDTags := BestCModeIDTagList(@BestModeIDTags);
end;
procedure CVideoCtrlTags(ViewPort: PViewPort; const TagList: array of const);
var
TagsList: TTagsList;
procedure CVideoCtrlTags(ViewPort: PViewPort; const TagList: array of PtrUInt); inline;
begin
AddTags(TagsList, TagList);
CVideoCtrlTagList(ViewPort, GetTagPtr(TagsList));
CVideoCtrlTagList(ViewPort, @TagList);
end;
procedure DoCDrawMethodTags(Hook: PHook; a1arg: PRastPort; const TagList: array of const);
var
TagsList: TTagsList;
procedure DoCDrawMethodTags(Hook: PHook; a1arg: PRastPort; const TagList: array of PtrUInt); inline;
begin
AddTags(TagsList, TagList);
DoCDrawMethodTagList(Hook, a1arg, GetTagPtr(TagsList));
DoCDrawMethodTagList(Hook, a1arg, @TagList);
end;
function LockBitMapTags(BitMap: APTR; const TagList: array of const): APTR;
var
TagsList: TTagsList;
function LockBitMapTags(BitMap: APTR; const TagList: array of PtrUInt): APTR; inline;
begin
AddTags(TagsList, TagList);
LockBitMapTags := LockBitMapTagList(BitMap, GetTagPtr(TagsList));
LockBitMapTags := LockBitMapTagList(BitMap, @TagList);
end;
procedure UnLockBitMapTags(Handle: APTR; const TagList: array of const);
var
TagsList: TTagsList;
procedure UnLockBitMapTags(Handle: APTR; const TagList: array of PtrUInt); inline;
begin
AddTags(TagsList, TagList);
UnLockBitMapTagList(Handle, GetTagPtr(TagsList));
UnLockBitMapTagList(Handle, @TagList);
end;
function SHIFT_PIXFMT(fmt: LongInt): LongInt;

View File

@ -15,73 +15,59 @@
unit diskfont;
{$mode objfpc}
INTERFACE
interface
uses exec, agraphics,utility;
const
MAXFONTPATH = 256;
type
pFontContents = ^tFontContents;
tFontContents = record
fc_FileName : Array [0..MAXFONTPATH-1] of Char;
PFontContents = ^TFontContents;
TFontContents = record
fc_FileName: array[0..MAXFONTPATH - 1] of Char;
fc_YSize: Word;
fc_Style: Byte;
fc_Flags: Byte;
end;
pTFontContents = ^tTFontContents;
tTFontContents = record
tfc_FileName : Array[0..MAXFONTPATH-3] of Char;
PTFontContents = ^TTFontContents;
TTFontContents = record
tfc_FileName: array[0..MAXFONTPATH - 3] of Char;
tfc_TagCount: Word;
tfc_YSize: Word;
tfc_Style,
tfc_Flags: Byte;
END;
end;
const
FCH_ID = $0f00;
TFCH_ID = $0f02;
OFCH_ID = $0f03;
type
pFontContentsHeader = ^tFontContentsHeader;
tFontContentsHeader = record
PFontContentsHeader = ^TFontContentsHeader;
TFontContentsHeader = record
fch_FileID: Word;
fch_NumEntries: Word;
end;
const
DFH_ID = $0f80;
MAXFONTNAME = 32;
type
pDiskFontHeader = ^tDiskFontHeader;
tDiskFontHeader = record
dfh_DF : tNode;
PDiskFontHeader = ^TDiskFontHeader;
TDiskFontHeader = record
dfh_DF: TNode;
dfh_FileID: Word;
dfh_Revision: Word;
dfh_Segment: Longint;
dfh_Name : Array [0..MAXFONTNAME-1] of Char;
dfh_TF : tTextFont;
dfh_Name: array [0..MAXFONTNAME-1] of Char;
dfh_TF: TTextFont;
end;
const
AFB_MEMORY = 0;
AFF_MEMORY = 1;
AFB_DISK = 1;
@ -93,23 +79,21 @@ const
AFB_TAGGED = 16;
AFF_TAGGED = $10000;
type
pAvailFonts = ^tAvailFonts;
tAvailFonts = record
PAvailFonts = ^TAvailFonts;
TAvailFonts = record
af_Type: Word;
af_Attr : tTextAttr;
af_Attr: TTextAttr;
end;
pTAvailFonts = ^tTAvailFonts;
tTAvailFonts = record
PTAvailFonts = ^TTAvailFonts;
TTAvailFonts = record
taf_Type: Word;
taf_Attr : tTTextAttr;
taf_Attr: TTTextAttr;
end;
pAvailFontsHeader = ^tAvailFontsHeader;
tAvailFontsHeader = record
PAvailFontsHeader = ^TAvailFontsHeader;
TAvailFontsHeader = record
afh_NumEntries: Word;
end;

View File

@ -15,8 +15,6 @@
unit icon;
{$mode delphi}
interface
uses
@ -248,43 +246,43 @@ procedure ChangeToSelectedIconColor(Cr: Pointer); syscall IconBase 33; //TODO: p
{macros}
function PACK_ICON_ASPECT_RATIO(Num, Den: LongInt): LongInt;
procedure UNPACK_ICON_ASPECT_RATIO(Aspect: LongInt; out Num, Den: LongInt);
procedure UNPACK_ICON_ASPECT_RATIO(Aspect: LongInt; var Num, Den: LongInt);
type
TToolTypeArray= array of string;
TToolTypeArray= array of AnsiString;
function GetToolTypes(Filename: string): TToolTypeArray;
function GetToolTypes(Filename: AnsiString): TToolTypeArray;
implementation
function GetToolTypes(Filename: string): TToolTypeArray;
function GetToolTypes(Filename: AnsiString): TToolTypeArray;
var
DObj: PDiskObject;
Tooltype: PPChar;
Idx: Integer;
begin
SetLength(Result, 0);
SetLength(GetToolTypes, 0);
DObj := GetDiskObject(PChar(FileName));
if not Assigned(Dobj) then
Exit;
Tooltype := DObj^.do_Tooltypes;
while Assigned(ToolType^) do
begin
Idx := Length(Result);
SetLength(Result, Idx + 1);
Result[Idx] := ToolType^;
Idx := Length(GetToolTypes);
SetLength(GetToolTypes, Idx + 1);
GetToolTypes[Idx] := ToolType^;
Inc(ToolType);
end;
FreeDiskObject(DObj);
end;
function PACK_ICON_ASPECT_RATIO(Num, Den: LongInt): LongInt;
function PACK_ICON_ASPECT_RATIO(Num, Den: LongInt): LongInt; inline;
begin
PACK_ICON_ASPECT_RATIO := (Num shl 4) or Den;
end;
procedure UNPACK_ICON_ASPECT_RATIO(Aspect: LongInt; out Num, Den: LongInt);
procedure UNPACK_ICON_ASPECT_RATIO(Aspect: LongInt; var Num, Den: LongInt); inline;
begin
Num := (Aspect shr 4) and $F;
Den := Aspect and $15;

View File

@ -17,11 +17,8 @@ unit iffparse;
interface
{$mode objfpc}
uses exec, clipboard, utility;
const
IFFPARSENAME : PChar = 'iffparse.library';
@ -259,7 +256,7 @@ function Make_ID(str: String): LongInt;
implementation
function Make_ID(str: String): LongInt;
function Make_ID(str: String): LongInt; inline;
begin
Make_ID:= (LongInt(Ord(Str[1])) shl 24) or
(LongInt(Ord(Str[2])) shl 16 ) or

View File

@ -14,8 +14,6 @@
**********************************************************************}
unit Intuition;
{$mode objfpc}
{$define INTUI_V36_NAMES_ONLY}
interface
@ -3339,25 +3337,25 @@ procedure WindowToFront(Window: PWindow); syscall IntuitionBase 52;
procedure ZipWindow(Window: PWindow); syscall IntuitionBase 84;
// VarArgs Versions
function SetAttrs(Obj: APTR; const Tags: array of const): LongWord;
function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of const): APTR;
function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of const): PWindow;
function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of const): IPTR;
function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of const): LongInt;
function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of const): PScreen;
function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of const): PWindow;
function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of const): IPTR;
procedure SetWindowPointer(Win: PWindow; const Tags: array of const);
function SetAttrs(Obj: APTR; const Tags: array of PtrUInt): LongWord;
function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of PtrUInt): APTR;
function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of PtrUInt): PWindow;
function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of PtrUInt): IPTR;
function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of PtrUInt): LongInt;
function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of PtrUInt): PScreen;
function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of PtrUInt): PWindow;
function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of PtrUInt): IPTR;
procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt);
// Function wrapper
function SetSuperAttrsA(cl: PIClass; Obj: PObject_; TagList: PTagItem): IPTR;
function SetSuperAttrs(cl: PIClass; Obj: PObject_; Tags: array of const): IPTR;
function SetSuperAttrs(cl: PIClass; Obj: PObject_; const Tags: array of PtrUInt): IPTR;
function DoMethodA(Obj: PObject_; Message: APTR): IPTR;
function DoMethod(Obj: PObject_; MethodID: LongWord; Args: array of const): IPTR;
function DoMethod(Obj: PObject_; const Args: array of PtrUInt): IPTR;
function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
function CoerceMethod(cl: PIClass; Obj: PObject_; MethodID: LongWord; const Args: array of const): IPTR;
function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR;
function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
function DoSuperMethod(cl: PIClass; Obj: PObject_; Args: array of const): IPTR;
function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR;
function Has_Children(Win: PWindow): Boolean;
function Is_Children(Win: PWindow): Boolean;
@ -3391,154 +3389,110 @@ function SHAKNUM(x: Word): Word;
implementation
uses
tagsarray, longarray;
function SetAttrs(Obj: APTR; const Tags: array of const): LongWord;
var
TagList: TTagsList;
function SetAttrs(Obj: APTR; const Tags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, Tags);
Result := SetAttrsA(Obj, GetTagPtr(TagList));
SetAttrs := SetAttrsA(Obj, @Tags);
end;
function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of const): APTR;
var
TagList: TTagsList;
function NewObject(ClassPtr: PIClass; ClassID: PChar; const Tags: array of PtrUInt): APTR; inline;
begin
AddTags(TagList, Tags);
Result := NewObjectA(ClassPtr, ClassID, GetTagPtr(TagList));
NewObject := NewObjectA(ClassPtr, ClassID, @Tags);
end;
function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of const): PWindow;
var
ArgList: TArgList;
function BuildEasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP: LongWord; const Args: array of PtrUInt): PWindow; inline;
begin
AddArguments(ArgList, Args);
Result := BuildEasyRequestArgs(Window, EasyStruct, IDCMP, GetArgPtr(ArgList));
BuildEasyRequest := BuildEasyRequestArgs(Window, EasyStruct, IDCMP, @Args);
end;
function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of const): IPTR;
var
ArgList: TArgList;
function DoGadgetMethod(Gad: PGadget; Win: PWindow; Req: PRequester; const Args: array of PtrUInt): IPTR; inline;
begin
AddArguments(ArgList, Args);
{$ifdef i386}
Result := DoGadgetMethodA(Gad, Win, Req, TMsg(ArgList));
DoGadgetMethod := DoGadgetMethodA(Gad, Win, Req, TMsg(@Args));
{$else}
{$warning fix me!}
{$endif}
end;
function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of const): LongInt;
var
ArgList: TArgList;
function EasyRequest(Window: PWindow; EasyStruct: PEasyStruct; IDCMP_Ptr: PLongWord; const Args: array of PtrUInt): LongInt; inline;
begin
AddArguments(ArgList, Args);
Result := EasyRequestArgs(Window, EasyStruct, IDCMP_Ptr, @(ArgList[0]));
EasyRequest := EasyRequestArgs(Window, EasyStruct, IDCMP_Ptr, @Args);
end;
function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of const): PScreen;
var
TagList: TTagsList;
function OpenScreenTags(NewScreen: PNewScreen; const Tags: array of PtrUInt): PScreen; inline;
begin
AddTags(TagList, Tags);
Result := OpenScreenTagList(NewScreen, GetTagPtr(TagList));
OpenScreenTags := OpenScreenTagList(NewScreen, @Tags);
end;
function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of const): PWindow;
var
TagList: TTagsList;
function OpenWindowTags(NewWindow: PNewWindow; const Tags: array of PtrUInt): PWindow; inline;
begin
AddTags(TagList, Tags);
Result := OpenWindowTagList(NewWindow, GetTagPtr(TagList));
OpenWindowTags := OpenWindowTagList(NewWindow, @Tags);
end;
function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of const): IPTR;
var
TagList: TTagsList;
function SetGadgetAttrs(Gadget: PGadget; Window: PWindow; Requester: PRequester; const Tags: array of PtrUInt): IPTR; inline;
begin
AddTags(TagList, Tags);
Result := SetGadgetAttrsA(Gadget, Window, Requester, GetTagPtr(TagList));
SetGadgetAttrs := SetGadgetAttrsA(Gadget, Window, Requester, @Tags);
end;
procedure SetWindowPointer(Win: PWindow; const Tags: array of const);
var
TagList: TTagsList;
procedure SetWindowPointer(Win: PWindow; const Tags: array of PtrUInt); inline;
begin
AddTags(TagList, Tags);
SetWindowPointerA(Win, GetTagPtr(TagList));
SetWindowPointerA(Win, @Tags);
end;
// Functions wrapper
function DoMethodA(Obj: PObject_; Message: APTR): IPTR;
function DoMethodA(Obj: PObject_; Message: APTR): IPTR; inline;
begin
Result := 0;
DoMethodA := 0;
if Obj = nil then
Exit;
Result := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, Message);
DoMethodA := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, Message);
end;
function DoMethod(Obj: PObject_; MethodID: LongWord; Args: array of const): IPTR;
var
ArgList: TArgList;
function DoMethod(Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
begin
Result := 0;
DoMethod := 0;
if obj = nil then
Exit;
AddArguments(ArgList, [MethodID]);
AddArguments(ArgList, Args);
Result := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, @(ArgList[0]));
DoMethod := CALLHOOKPKT_(PHook(OCLASS(Obj)), Obj, @Args);
end;
function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
function DoSuperMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR; inline;
begin
Result := 0;
DoSuperMethodA := 0;
if (cl = nil) or (obj = nil) then
Exit;
Result := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, Message);
DoSuperMethodA := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, Message);
end;
function DoSuperMethod(cl: PIClass; Obj: PObject_; Args: array of const): IPTR;
var
ArgList: TArgList;
function DoSuperMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
begin
Result := 0;
DoSuperMethod := 0;
if (cl = nil) or (obj = nil) then
Exit;
AddArguments(ArgList, Args);
Result := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, @(ArgList[0]));
DoSuperMethod := CALLHOOKPKT_(PHook(cl^.cl_Super), Obj, @Args);
end;
function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR;
function CoerceMethodA(cl: PIClass; Obj: PObject_; Message: APTR): IPTR; inline;
begin
Result := 0;
CoerceMethodA := 0;
if (cl = nil) or (obj = nil) then
Exit;
Result := CALLHOOKPKT_(PHook(cl), Obj, Message);
CoerceMethodA := CALLHOOKPKT_(PHook(cl), Obj, Message);
end;
function CoerceMethod(cl: PIClass; Obj: PObject_; MethodID: LongWord; const Args: array of const): IPTR;
var
ArgList: TArgList;
function CoerceMethod(cl: PIClass; Obj: PObject_; const Args: array of PtrUInt): IPTR; inline;
begin
AddArguments(ArgList,[MethodID]);
AddArguments(ArgList, Args);
Result := CoerceMethodA(cl, Obj, @(ArgList[0]));
CoerceMethod := CoerceMethodA(cl, Obj, @Args);
end;
function SetSuperAttrs(cl: PIClass; Obj: PObject_; Tags: array of const): IPTR;
function SetSuperAttrs(cl: PIClass; Obj: PObject_; const Tags: array of PtrUInt): IPTR;
var
TagList: TTagsList;
ops: TopSet;
begin
AddTags(TagList, Tags);
ops.MethodID := OM_SET;
ops.ops_AttrList := GetTagPtr(TagList);
ops.ops_AttrList := @Tags;
ops.ops_GInfo := nil;
Result := DoSuperMethodA(cl, obj, @ops);
SetSuperAttrs := DoSuperMethodA(cl, obj, @ops);
end;
function SetSuperAttrsA(cl: PIClass; Obj: PObject_; TagList: PTagItem): IPTR;
@ -3548,21 +3502,20 @@ begin
ops.MethodID := OM_SET;
ops.ops_AttrList := TagList;
ops.ops_GInfo := nil;
Result := DoSuperMethodA(cl, obj, @ops);
SetSuperAttrsA := DoSuperMethodA(cl, obj, @ops);
end;
function INST_DATA(Cl: PIClass; O: P_Object): Pointer;
function INST_DATA(Cl: PIClass; O: P_Object): Pointer; inline;
begin
INST_DATA := Pointer(PtrUInt(O) + Cl^.cl_InstOffset);
end;
function SIZEOF_INSTANCE(Cl: PIClass): LongInt;
function SIZEOF_INSTANCE(Cl: PIClass): LongInt; inline;
begin
SIZEOF_INSTANCE := Cl^.cl_InstOffset + Cl^.cl_InstSize + SizeOf(T_Object);
end;
function BASEOBJECT(O: P_Object): Pointer;
function BASEOBJECT(O: P_Object): Pointer; inline;
begin
BASEOBJECT := Pointer(PtrUInt(O) + SizeOf(T_Object));
end;
@ -3587,17 +3540,17 @@ begin
SHIFTITEM := (N and $3f) shl 5
end;
function SHIFTMENU(N: SmallInt): Word;
function SHIFTMENU(N: SmallInt): Word; inline;
begin
SHIFTMENU := N and $1f
end;
function SHIFTSUB(N: SmallInt): Word;
function SHIFTSUB(N: SmallInt): Word; inline;
begin
SHIFTSUB := (N and $1f) shl 11
end;
function FULLMENUNUM(Menu, Item, Sub: SmallInt): Word;
function FULLMENUNUM(Menu, Item, Sub: SmallInt): Word; inline;
begin
FULLMENUNUM := ((Sub and $1f) shl 11) or ((Item and $3f) shl 5) or (Menu and $1f);
end;
@ -3608,84 +3561,84 @@ end;
in pascal, of course!
}
function IM_BGPEN(Im: PImage): Byte;
function IM_BGPEN(Im: PImage): Byte; inline;
begin
IM_BGPEN := Im^.PlaneOnOff;
end;
function IM_BOX(Im: PImage): PIBox;
function IM_BOX(Im: PImage): PIBox; inline;
begin
IM_BOX := PIBox(@Im^.LeftEdge);
END;
function IM_FGPEN (Im: PImage): Byte;
function IM_FGPEN (Im: PImage): Byte; inline;
begin
IM_FGPEN := Im^.PlanePick;
end;
function GADGET_BOX(G: PGadget): PIBox;
function GADGET_BOX(G: PGadget): PIBox; inline;
begin
GADGET_BOX := PIBox(@G^.LeftEdge);
end;
function CUSTOM_HOOK (Gadget: PGadget): PHook;
function CUSTOM_HOOK (Gadget: PGadget): PHook; inline;
begin
CUSTOM_HOOK := PHook(Gadget^.MutualExclude);
end;
function ITEMNUM(N: Word): Word;
function ITEMNUM(N: Word): Word; inline;
begin
ITEMNUM := (N shr 5) and $3F
end;
function MENUNUM(N: Word): Word;
function MENUNUM(N: Word): Word; inline;
begin
MENUNUM := N and $1f
end;
function SUBNUM(N: Word): Word;
function SUBNUM(N: Word): Word; inline;
begin
SUBNUM := (N shr 11) and $1f
end;
function IAM_Resolution(x, y: Word): LongWord;
function IAM_Resolution(x, y: Word): LongWord; inline;
begin
Result := (x shl 16) or y;
IAM_Resolution := (x shl 16) or y;
end;
function SRBNUM(x: Word): Word;
function SRBNUM(x: Word): Word; inline;
begin
SRBNUM := $08 - (x shr 4);
end;
function SWBNUM(x: Word): Word;
function SWBNUM(x: Word): Word; inline;
begin
SWBNUM := $08 - (x and $0f);
end;
function SSBNUM(x: Word): Word;
function SSBNUM(x: Word): Word; inline;
begin
SSBNUM := $01 + (x shr 4);
end;
function SPARNUM(x: Word): Word;
function SPARNUM(x: Word): Word; inline;
begin
SPARNUM := x shr 4;
end;
function SHAKNUM(x: Word): Word;
function SHAKNUM(x: Word): Word; inline;
begin
SHAKNUM := x and $0f;
end;
function Has_Children(Win: PWindow): Boolean;
function Has_Children(Win: PWindow): Boolean; inline;
begin
Result := Assigned(Win^.FirstChild);
Has_Children := Assigned(Win^.FirstChild);
end;
function Is_Children(Win: PWindow): Boolean;
function Is_Children(Win: PWindow): Boolean; inline;
begin
Result := Assigned(Win^.Parent2);
Is_Children := Assigned(Win^.Parent2);
end;
initialization

View File

@ -16,9 +16,7 @@
unit Keymap;
INTERFACE
{$mode objfpc}
interface
uses exec, inputevent;

View File

@ -12,7 +12,6 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$mode objfpc}
{$packrecords C}
unit mui;
@ -3763,17 +3762,14 @@ function MUIV_Window_Width_Screen(p: LongInt): LongInt;
// Functions and procedures with array of const go here
function MUI_AllocAslRequestTags(ReqTyp: Longword; const Tags: array of const): Pointer;
function MUI_AslRequestTags(req: Pointer; const Tags : array of const): LongBool;
function MUI_MakeObject(_type: LongInt; const Params : array of const): PLongWord;
function MUI_NewObject(a0arg: PCHAR; const Tags: array of const): PLongWord;
function MUI_Request(App: Pointer; Win: Pointer; Flags: LongWord; Title: PChar; Gadgets: PChar; Format: PChar; const Params: array of const): LongInt;
function MUI_AllocAslRequestTags(ReqTyp: Longword; const Tags: array of PtrUInt): Pointer;
function MUI_AslRequestTags(req: Pointer; const Tags : array of PtrUInt): LongBool;
function MUI_MakeObject(_Type: LongInt; const Params : array of PtrUInt): PObject_;
function MUI_NewObject(a0arg: PChar; const Tags: array of PtrUInt): PObject_;
function MUI_Request(App: Pointer; win: Pointer; Flags: LongWord; Title: PChar; Gadgets: PChar; Format: PChar; const Params: Array Of PtrUInt): LongInt;
implementation
uses
tagsarray, longarray;
function MUINotifyData(Obj: APTR): PMUI_NotifyData; inline;
begin
MUINotifyData := PMUI_NotifyData(@P__dummyAreaData__(Obj)^.mnd);
@ -4043,44 +4039,29 @@ end;
// Functions and procedures with array of const go here
function MUI_AllocAslRequestTags(ReqTyp : longword; const tags : Array Of Const) : Pointer;
var
TagList: TTagsList;
function MUI_AllocAslRequestTags(ReqTyp : longword; const Tags: array of PtrUInt) : Pointer; inline;
begin
AddTags(TagList, Tags);
MUI_AllocAslRequestTags := MUI_AllocAslRequest(ReqTyp, GetTagPtr(TagList));
MUI_AllocAslRequestTags := MUI_AllocAslRequest(ReqTyp, @Tags);
end;
function MUI_AslRequestTags(req : Pointer; const tags : Array Of Const) : LongBool;
var
TagList: TTagsList;
function MUI_AslRequestTags(Req: Pointer; const Tags: array of PtrUInt) : LongBool; inline;
begin
AddTags(TagList, Tags);
MUI_AslRequestTags := MUI_AslRequest(req, GetTagPtr(TagList));
MUI_AslRequestTags := MUI_AslRequest(Req, @Tags);
end;
function MUI_MakeObject(_type : LongInt; const params : Array Of Const) : pLongWord;
var
Args: TArgList;
function MUI_MakeObject(_Type : LongInt; const Params: array of PtrUInt): PObject_; inline;
begin
AddArguments(Args, params);
MUI_MakeObject := MUI_MakeObjectA(_type, GetArgPtr(Args));
MUI_MakeObject := MUI_MakeObjectA(_Type, @Params);
end;
function MUI_NewObject(a0arg : pCHAR; const tags : Array Of Const) : pLongWord;
var
TagList: TTagsList;
function MUI_NewObject(a0arg: PChar; const Tags: array of PtrUInt): PObject_; inline;
begin
AddTags(TagList, Tags);
MUI_NewObject := MUI_NewObjectA(a0arg , GetTagPtr(TagList));
MUI_NewObject := MUI_NewObjectA(a0arg , @Tags);
end;
function MUI_Request(app : Pointer; win : Pointer; flags : longword; title : pCHAR; gadgets : pCHAR; format : pCHAR; const params : Array Of Const) : LongInt;
var
Args: TArgList;
function MUI_Request(App: Pointer; win: Pointer; Flags: LongWord; Title: PChar; Gadgets: PChar; Format: PChar; const Params: Array Of PtrUInt): LongInt;
begin
AddArguments(Args, params);
MUI_Request := MUI_RequestA(app , win , flags , title , gadgets , format , GetArgPtr(Args));
MUI_Request := MUI_RequestA(App, Win, Flags, Title, Gadgets, Format, @Params);
end;
const

View File

@ -14,7 +14,6 @@
**********************************************************************}
unit utility;
{$mode objfpc}{$H+}
{$PACKRECORDS C}
interface
@ -253,41 +252,32 @@ function UnpackStructureTags(Pack: APTR; PackTable: PLongWord; TagList: PTagItem
function CALLHOOKPKT_(Hook: PHook; Object_: APTR; Message: APTR): IPTR; inline;
// VarArgs Versions
function AllocNamedObject(const Name: STRPTR; const Tags: array of const): PNamedObject;
function CallHook(Hook: PHook; Object_: APTR; const Params: array of const): IPTR;
function AllocNamedObject(const Name: STRPTR; const Tags: array of PtrUInt): PNamedObject;
function CallHook(Hook: PHook; Object_: APTR; const Params: array of PtrUInt): IPTR;
implementation
uses
tagsarray,longarray;
function AllocNamedObject(const Name: STRPTR; const Tags: array of const): PNamedObject;
var
TagList: TTagsList;
function AllocNamedObject(const Name: STRPTR; const Tags: array of PtrUInt): PNamedObject; inline;
begin
AddTags(TagList, Tags);
Result := AllocNamedObjectA(Name, GetTagPtr(TagList));
AllocNamedObject := AllocNamedObjectA(Name, @Tags);
end;
function CallHook(Hook: PHook; Object_: APTR; const Params: array of const): IPTR;
var
Args: TArgList;
function CallHook(Hook: PHook; Object_: APTR; const Params: array of PtrUInt): IPTR; inline;
begin
AddArguments(Args, params);
CallHook := CallHookPkt(Hook, Object_ , GetArgPtr(Args));
CallHook := CallHookPkt(Hook, Object_ , @Params);
end;
function CALLHOOKPKT_(Hook: PHook; Object_: APTR; Message: APTR): IPTR;
var
FuncPtr: THookFunctionProc;
begin
Result := 0;
CALLHOOKPKT_ := 0;
if (Hook = nil) or (Object_ = nil) or (Message = nil) then
Exit;
if (Hook^.h_Entry = 0) then
Exit;
FuncPtr := THookFunctionProc(Hook^.h_Entry);
Result := FuncPtr(Hook, Object_, Message);
CALLHOOKPKT_ := FuncPtr(Hook, Object_, Message);
end;
end.

View File

@ -13,11 +13,8 @@
**********************************************************************}
unit Workbench;
{$MODE OBJFPC} {$H+}
{$PACKRECORDS C}
Interface
Uses
@ -588,90 +585,64 @@ function SendAppWindowMessage(Win: PWindow; NumFiles: LongWord; Files: PPChar; C
function GetNextAppIcon(LastDiskObj: PDiskObject; Text_: PChar): PDiskObject; syscall WorkbenchBase 27;
// varargs versions:
function AddAppIcon(ID: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; Lock: BPTR; DiskObj: PDiskObject; const Tags: array of const): PAppIcon;
function AddAppMenuItem(ID: LongWord; UserData: LongWord; Text_: APTR; MsgPort: PMsgPort; const Tags: array of const): PAppMenuItem;
function AddAppWindow(ID: LongWord; UserData: LongWord; Window: PWindow; MsgPort: PMsgPort; const Tags: array of const): PAppWindow;
function AddAppWindowDropZone(Aw: PAppWindow; ID: LongWord; UserData: LongWord; const Tags: array of const): PAppWindowDropZone;
function CloseWorkbenchObject(Name: STRPTR; const Tags: array of const): LongBool; unimplemented;
function MakeWorkbenchObjectVisible(Name: STRPTR; const Tags: array of const): LongBool; unimplemented;
function OpenWorkbenchObject(Name: STRPTR; const Tags: array of const): LongBool;
function WorkbenchControl(Name: STRPTR; const Tags: array of const): LongBool;
function AddAppIcon(ID: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; Lock: BPTR; DiskObj: PDiskObject; const Tags: array of PtrUInt): PAppIcon;
function AddAppMenuItem(ID: LongWord; UserData: LongWord; Text_: APTR; MsgPort: PMsgPort; const Tags: array of PtrUInt): PAppMenuItem;
function AddAppWindow(ID: LongWord; UserData: LongWord; Window: PWindow; MsgPort: PMsgPort; const Tags: array of PtrUInt): PAppWindow;
function AddAppWindowDropZone(Aw: PAppWindow; ID: LongWord; UserData: LongWord; const Tags: array of PtrUInt): PAppWindowDropZone;
function CloseWorkbenchObject(Name: STRPTR; const Tags: array of PtrUInt): LongBool; unimplemented;
function MakeWorkbenchObjectVisible(Name: STRPTR; const Tags: array of PtrUInt): LongBool; unimplemented;
function OpenWorkbenchObject(Name: STRPTR; const Tags: array of PtrUInt): LongBool;
function WorkbenchControl(Name: STRPTR; const Tags: array of PtrUInt): LongBool;
implementation
uses
TagsArray;
// varargs versions:
function AddAppIcon(ID: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; Lock: BPTR; DiskObj: PDiskObject; const Tags: array of const): PAppIcon;
var
TagList: TTagsList;
function AddAppIcon(ID: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; Lock: BPTR; DiskObj: PDiskObject; const Tags: array of PtrUInt): PAppIcon; inline;
begin
AddTags(TagList, Tags);
AddAppIcon := AddAppIconA(ID, UserData, Text_, MsgPort, Lock, DiskObj, GetTagPtr(TagList));
AddAppIcon := AddAppIconA(ID, UserData, Text_, MsgPort, Lock, DiskObj, @Tags);
end;
function AddAppMenuItem(ID: LongWord; UserData: LongWord; Text_: APTR; MsgPort: PMsgPort; const Tags: array of const): PAppMenuItem;
var
TagList: TTagsList;
function AddAppMenuItem(ID: LongWord; UserData: LongWord; Text_: APTR; MsgPort: PMsgPort; const Tags: array of PtrUInt): PAppMenuItem; inline;
begin
AddAppMenuItem := AddAppMenuItemA(ID, UserData, Text_, MsgPort, GetTagPtr(TagList));
AddAppMenuItem := AddAppMenuItemA(ID, UserData, Text_, MsgPort, @Tags);
end;
function AddAppWindow(ID: LongWord; UserData: LongWord; Window: PWindow; MsgPort: PMsgPort; const Tags: array of const): PAppWindow;
var
TagList: TTagsList;
function AddAppWindow(ID: LongWord; UserData: LongWord; Window: PWindow; MsgPort: PMsgPort; const Tags: array of PtrUInt): PAppWindow; inline;
begin
AddTags(TagList, Tags);
AddAppWindow := AddAppWindowA(ID, UserData, Window, MsgPort, GetTagPtr(TagList));
AddAppWindow := AddAppWindowA(ID, UserData, Window, MsgPort, @Tags);
end;
function AddAppWindowDropZone(Aw: PAppWindow; ID: LongWord; UserData: LongWord; const Tags: array of const): PAppWindowDropZone;
var
TagList: TTagsList;
function AddAppWindowDropZone(Aw: PAppWindow; ID: LongWord; UserData: LongWord; const Tags: array of PtrUInt): PAppWindowDropZone; inline;
begin
AddTags(TagList, Tags);
AddAppWindowDropZone := AddAppWindowDropZoneA(Aw, ID, UserData, GetTagPtr(TagList));
AddAppWindowDropZone := AddAppWindowDropZoneA(Aw, ID, UserData, @Tags);
end;
function CloseWorkbenchObject(Name: STRPTR; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function CloseWorkbenchObject(Name: STRPTR; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
CloseWorkbenchObject := CloseWorkbenchObjectA(Name, GetTagPtr(TagList));
CloseWorkbenchObject := CloseWorkbenchObjectA(Name, @Tags);
end;
function MakeWorkbenchObjectVisible(Name: STRPTR; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function MakeWorkbenchObjectVisible(Name: STRPTR; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
MakeWorkbenchObjectVisible := MakeWorkbenchObjectVisibleA(Name, GetTagPtr(TagList));
MakeWorkbenchObjectVisible := MakeWorkbenchObjectVisibleA(Name, @Tags);
end;
function OpenWorkbenchObject(Name: STRPTR; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function OpenWorkbenchObject(Name: STRPTR; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
OpenWorkbenchObject := OpenWorkbenchObjectA(Name, GetTagPtr(TagList));
OpenWorkbenchObject := OpenWorkbenchObjectA(Name, @Tags);
end;
function WorkbenchControl(Name: STRPTR; const Tags: array of const): LongBool;
var
TagList: TTagsList;
function WorkbenchControl(Name: STRPTR; const Tags: array of PtrUInt): LongBool; inline;
begin
AddTags(TagList, Tags);
WorkbenchControl := WorkbenchControlA(Name, GetTagPtr(TagList));
WorkbenchControl := WorkbenchControlA(Name, @Tags);
end;