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;
@ -26,15 +24,15 @@ uses
const
BITSET = $8000;
BITCLR = 0;
type
TPlanePtr = PByte;
PPoint = ^TPoint;
TPoint = record
x, y: SmallInt;
end;
PBitMap = ^TBitMap;
TBitMap = record
BytesPerRow: Word;
@ -44,7 +42,7 @@ type
Pad: Word;
Planes: array[0..7] of TPlanePtr;
end;
PRectangle = ^TRectangle;
TRectangle = record
MinX,
@ -52,7 +50,7 @@ type
MaxX,
MaxY: SmallInt;
end;
PRect32 = ^TRect32;
TRect32 = record
MinX,
@ -60,12 +58,12 @@ type
MaxX,
MaxY: Longint;
end;
type
// a structure to contain the 16 collision procedure addresses }
PCollTable = ^TCollTable;
TCollTable = array[0..15] of Pointer;
// flags for AllocBitMap, etc.
const
BMB_CLEAR = 0;
@ -73,7 +71,7 @@ const
BMB_INTERLEAVED = 2;
BMB_STANDARD = 3;
BMB_MINPLANES = 4;
BMB_SPECIALFMT = 7; // CyberGfx Flag
BMB_SPECIALFMT = 7; // CyberGfx Flag
BMF_CLEAR = 1 shl BMB_CLEAR;
BMF_DISPLAYABLE = 1 shl BMB_DISPLAYABLE;
@ -89,7 +87,7 @@ const
BMB_HIJACKED = 7;
BMF_HIJACKED = 1 shl 7;
BMB_RTGTAGS = 8;
BMF_RTGTAGS = 1 shl 8;
BMF_RTGTAGS = 1 shl 8;
BMB_RTGCHECK = 9;
BMF_RTGCHECK = 1 shl 9;
BMB_FRIENDISTAG = 10;
@ -99,7 +97,7 @@ const
BMF_CHECKVALUE = BMF_RTGTAGS or BMF_RTGCHECK or BMF_FRIENDISTAG;
BMF_CHECKMASK = BMF_HIJACKED or BMF_CHECKVALUE or BMF_INVALID;
// tags for AllocBitMap */
BMATags_Friend = TAG_USER + 0;
BMATags_Depth = TAG_USER + 1;
@ -157,7 +155,7 @@ const
ISLESSY = 1 shl 1;
ISGRTRX = 1 shl 2;
ISGRTRY = 1 shl 3;
type
// TextAttr node, matches text attributes in RastPort
PTextAttr = ^TTextAttr;
@ -181,7 +179,7 @@ const
// ta_Style/tta_Style
FS_NORMAL = 0; // normal text (no style bits set)
FSB_UNDERLINED = 0; // underlined (under baseline)
FSF_UNDERLINED = 1 shl 0;
FSF_UNDERLINED = 1 shl 0;
FSB_BOLD = 1; // bold face text (ORed w/ shifted)
FSF_BOLD = 1 shl 1;
FSB_ITALIC = 2; // italic (slanted 1:2 right)
@ -205,13 +203,13 @@ const
FPF_WIDEDOT = 1 shl 4;
FPB_PROPORTIONAL = 5; //character sizes can vary from nominal
FPF_PROPORTIONAL = 1 shl 5;
FPB_DESIGNED = 6; // size is "designed", not constructed
FPB_DESIGNED = 6; // size is "designed", not constructed
FPF_DESIGNED = 1 shl 6;
FPB_REMOVED = 7; // the font has been removed
FPF_REMOVED = 1 shl 7;
// tta_Tags
TA_DeviceDPI = TAG_USER + 1; // Tag value is Point union: Hi Longint XDPI, Lo Longint YDPI
MAXFONTMATCHWEIGHT = 32767; { perfect match from WeighTAMatch }
type
@ -229,10 +227,10 @@ type
tf_LoChar: Byte; // the first character described here
tf_HiChar: Byte; // the last character described here
tf_CharData: APTR; // the bit character data
tf_Modulo: Word; // the row modulo for the strike font data
tf_Modulo: Word; // the row modulo for the strike font data
tf_CharLoc: APTR; // ptr to location data for the strike font 2 words: bit offset then size
tf_CharSpace: APTR; // ptr to words of proportional spacing data
tf_CharKern: APTR; // ptr to words of kerning data
tf_CharSpace: APTR; // ptr to words of proportional spacing data
tf_CharKern: APTR; // ptr to words of kerning data
//property tf_extension: PMsgPort read tf_Message.mn_ReplyPort write tf_Message.mn_ReplyPort;
end;
@ -241,11 +239,11 @@ type
tfe_MatchWord: Word; // a magic cookie for the extension
tfe_Flags0: Byte; // (system private flags)
tfe_Flags1: Byte; // (system private flags)
tfe_BackPtr: PTextFont; // validation of compilation
tfe_OrigReplyPort: PMsgPort; // original value in tf_Extension
tfe_Tags: PTagItem; // Text Tags for the font
tfe_OFontPatchS, // (system private use)
tfe_OFontPatchK: PWord; // (system private use)
// this space is reserved for future expansion
@ -261,7 +259,7 @@ type
PColorTextFont = ^TColorTextFont;
TColorTextFont = record
ctf_TF: TTextFont;
ctf_Flags: Word; // extended flags
ctf_Depth, // number of bit planes
ctf_FgColor, // color that is remapped to FgPen
@ -269,9 +267,9 @@ type
ctf_High, // highest color represented here }
ctf_PlanePick, // PlanePick ala Images }
ctf_PlaneOnOff: Byte; // PlaneOnOff ala Images
ctf_ColorFontColors: PColorFontColors; // colors for font
ctf_CharData: array[0..7] of APTR; // pointers to bit planes ala tf_CharData
end;
@ -328,7 +326,7 @@ type
TVUserStuff = SmallInt; // Sprite user stuff
TBUserStuff = SmallInt; // Bob user stuff
TAUserStuff = SmallInt; // AnimOb user stuff
PBob = ^TBob;
PAnimOb = ^TAnimOb;
PAnimComp = ^TAnimComp;
@ -337,7 +335,7 @@ type
list is copied to clear list
must be here in VSprite for system boundary detection
the VSprite positions are defined in (y,x) order to make sorting
sorting easier, since (y,x) as a long Longint}
sorting easier, since (y,x) as a long Longint}
PVSprite = ^TVSprite;
TVSprite = record
// SYSTEM VARIABLES
@ -408,7 +406,7 @@ type
Flags: SmallInt; // AnimComp flags for system & user
Timer: SmallInt; // timer defines how long to keep this component active:
// if set non-zero, timer decrements to zero then switches to nextSeq
// if set to zero, AnimComp never switches
// if set to zero, AnimComp never switches
// USER VARIABLES
TimeSet: SmallInt; // initial value for timer when the AnimComp is activated by the system
NextComp: PAnimComp; // pointer to next and previous components of animation object
@ -450,12 +448,12 @@ const
B2SWAP = 1;
B2BOBBER = 2;
const
MAXSUPERSAVECLIPRECTS = 20; // Max. number of cliprects that are kept preallocated in the list
type
// predefinitions, for record referencing:
// predefinitions, for record referencing:
PRastPort = ^tRastPort;
PLayer_Info = ^TLayer_Info;
PLayer = ^TLayer;
@ -471,10 +469,10 @@ type
_p2: Pointer; // system reserved
reserved: Longint; // system use
Flags: Longint; // only exists in layer allocation
end;
end;
// Layer Structure
// Layer Structure
TLayer = record
Front,
Back: PLayer; // ignored by roms
@ -500,7 +498,7 @@ type
{$ifdef aros}
VisibleRegion: PRegion; // Private!
{$else}
Reserved1: ULONG;
Reserved1: ULONG;
{$endif}
ClipRegion: PRegion;
SaveClipRects: PRegion; // used to back out when in trouble
@ -547,7 +545,7 @@ type
TChangeLayerShapeMsg = record
NewShape: PRegion; // same as passed to ChangeLayerShape()
ClipRect: PClipRect;
Shape: PRegion;
Shape: PRegion;
end;
TCollectPixelsLayerMsg = record
@ -563,7 +561,7 @@ type
end;
// Msg sent through LA_ShapeHook.
PShapeHookMsg = ^TShapeHookMsg;
PShapeHookMsg = ^TShapeHookMsg;
TShapeHookMsg = record
Action: LongInt;
Layer: PLayer;
@ -599,7 +597,7 @@ type
gelHead,
gelTail: PVSprite; // dummy vSprites for list management
NextLine: PSmallInt; // pointer to array of 8 WORDS for sprite available lines
LastColor: ^PSmallInt; // pointer to array of 8 pointers for color-last-assigned to vSprites
LastColor: ^PSmallInt; // pointer to array of 8 pointers for color-last-assigned to vSprites
CollHandler: PCollTable; // Pointeres of collision routines
LeftMost,
RightMost,
@ -608,7 +606,7 @@ type
FirstBlissObj,
LastBlissObj: APTR; // system use only
end;
TRastPort = record
Layer: PLayer; // LayerPtr
BitMap: PBitMap; // BitMapPtr
@ -665,7 +663,7 @@ const
SHAPEHOOKACTION_MOVESIZELAYER = 3;
// Tags for scale layer
LA_SRCX = $4000;
LA_SRCX = $4000;
LA_SRCY = $4001;
LA_DESTX = $4002;
LA_DESTY = $4003;
@ -673,7 +671,7 @@ const
LA_SRCHEIGHT = $4005;
LA_DESTWIDTH = $4006;
LA_DESTHEIGHT = $4007;
ROOTPRIORITY = 0;
BACKDROPPRIORITY = 10;
UPFRONTPRIORITY = 20;
@ -696,7 +694,7 @@ const
LAYERS_NOBACKFILL: PHook = PHook(1);
// LayerInfo Flag
LIFLG_SUPPORTS_OFFSCREEN_LAYERS = 1 shl 8; // Same flag as AmigaOS hack PowerWindowsNG
LIFLG_SUPPORTS_OFFSCREEN_LAYERS = 1 shl 8; // Same flag as AmigaOS hack PowerWindowsNG
// Tags for CreateLayerTagList
LA_Dummy = TAG_USER + 1234;
@ -706,17 +704,17 @@ const
LA_Invisible = LA_Dummy + 4; // LongBool. Default is FALSE
LA_BackFill = LA_Dummy + 5; // PHook. Default is LAYERS_BACKFILL
LA_SuperBitMap = LA_Dummy + 6; // PBitMap. Default is nil (none)
LA_Shape = LA_Dummy + 7; // PRegion. Default is nil (rectangular shape)
LA_Shape = LA_Dummy + 7; // PRegion. Default is nil (rectangular shape)
LPRI_NORMAL = 0;
LPRI_BACKDROP = -50;
LPRI_NORMAL = 0;
LPRI_BACKDROP = -50;
const
// tfe_Flags0 (partial definition)
TE0B_NOREMFONT = 0; // disallow RemFont for this font
TE0F_NOREMFONT = $01;
Const
CleanUp = $40;
CleanMe = CleanUp;
@ -765,7 +763,7 @@ type
xln_Type: Byte; // NT_GRAPHICS
xln_Pri: ShortInt;
xln_Name: PChar;
xln_Subsystem: Byte; // see below
xln_Subsystem: Byte; // see below
xln_Subtype: Byte; // SS_GRAPHICS
xln_Library : Longint;
xln_Init : Pointer;
@ -795,7 +793,7 @@ type
reserved1, // Private do not touch
reserved2,
reserved3: Pointer;
hblank, // Signal timings by themselves
hblank, // Signal timings by themselves
vblank,
hsync,
vsync: TAnalogSignalInterval;
@ -812,26 +810,26 @@ type
DeniseMaxDisplayColumn,
BeamCon0, // Value for beamcon0 Amiga(tm) chipset register
min_row: Word;
ms_Special: PSpecialMonitor; // Synchro signal timings description (optional)
ms_OpenCount: Word; // Driver open count
ms_transform,
ms_translate,
ms_scale: Pointer;
ms_xoffset,
ms_yoffset: Word;
ms_LegalView: TRectangle; // Allowed range for view positioning (right-bottom position included)
ms_maxoscan, // maximum legal overscan
ms_videoscan: Pointer; // video display overscan
DeniseMinDisplayColumn: Word;
DisplayCompatible: ULONG;
DisplayInfoDataBase: TList;
DisplayInfoDataBaseSemaphore: TSignalSemaphore;
ms_MrgCop, // Driver call vectors, unused by AROS
ms_LoadView,
ms_KillView: Pointer;
@ -852,7 +850,7 @@ const
TO_MONITOR = 0;
FROM_MONITOR = 1;
STANDARD_XOFFSET = 9;
STANDARD_YOFFSET = 0;
@ -866,10 +864,10 @@ const
NTSC_MONITOR_NAME: PChar = 'ntsc.monitor';
PAL_MONITOR_NAME: PChar = 'pal.monitor';
VGA_MONITOR_NAME: PChar = 'vga.monitor';
STANDARD_MONITOR_MASK = REQUEST_NTSC or REQUEST_PAL;
// Some standard/default constants for Amiga(tm) chipset
// Some standard/default constants for Amiga(tm) chipset
STANDARD_NTSC_ROWS = 262;
MIN_NTSC_ROW = 21;
STANDARD_PAL_ROWS = 312;
@ -981,7 +979,7 @@ type
Monitor: PMonitorSpec; // Monitor used for displaying this View
TopLine: Word;
end;
// Copper structures
PCopIns = ^TCopIns;
TCopIns = record
@ -997,9 +995,9 @@ type
2:(
HWaitPos: SmallInt; // horizontal wait position
DestData: SmallInt; // data to send
);
);
end;
TCopList = record
Next: PCopList; // next block for this copper list
_CopList: PCopList; // system use
@ -1014,9 +1012,9 @@ type
SLRepeat: Word;
Flags: Word; // EXACT_LINE or HALF_LINE
end;
// Describes a displayed bitmap (or logical screen). Copperlists are relevant only to Amiga(tm) chipset,
// for other hardware they are NULL.
// for other hardware they are NULL.
TViewPort = record
Next: PViewPort;
ColorMap: PColorMap; // table of colors for this viewport if this is nil, MakeVPort assumes default values
@ -1042,13 +1040,13 @@ type
ViewPort: PViewPort; // ViewPort it relates to (backward link)
DisplayClip: TRectangle; // makevp display clipping information, Total size of displayable part
VecTable: APTR; // Unused in AROS
DriverData: array[0..1] of APTR; // Private storage for display drivers. Do not touch!
DriverData: array[0..1] of APTR; // Private storage for display drivers. Do not touch!
Flags: Word; // Flags, see below
Origin: array[0..1] of TPoint; // First visible point relative to the DClip. One for each possible playfield.
cop1ptr, // private
cop2ptr: ULONG; // private
end;
PPaletteExtra = ^TPaletteExtra;
TPaletteExtra = record // structure may be extended so watch out!
pe_Semaphore: TSignalSemaphore; // shared semaphore for arbitration
@ -1072,13 +1070,13 @@ type
color number 4, value: $00ABCDEF
ColorTable[4] := $0ACE,
LowColorBits[4] := $0BDF
SpriteBase fields keep bank number, not a color number. On m68k Amiga colors are divided into
banks, 16 per each. So bank number is color number divided by 16. Base color is a number which
is added to all colors of the sprite in order to look up the actual palette entry.
AROS may run on different hardware where sprites may have base colors that do not divide by 16.
In order to cover this bank numbers have a form: ((c and $0F) shl 8 ) or (c shr 4), where c is actual
color number (i. e. remainder is stored in a high byte of Word).}
color number (i. e. remainder is stored in a high byte of Word).}
TColorMap = record
Flags: Byte; // see below (CMF_*)
Type_: Byte; // Colormap type (reflects version), see below (COLORMAP_*)
@ -1086,23 +1084,23 @@ type
ColorTable: PWord; // Table of high nibbles of color values (see description above)
// The following fields are present only if Type_ >= COLORMAP_TYPE_V36
cm_vpe: PViewPortExtra; // ViewPortExtra, for faster access
LowColorBits: PWord; // Table of low nibbles of color values (see above)
LowColorBits: PWord; // Table of low nibbles of color values (see above)
TransparencyPlane,
SpriteResolution, // see below
SpriteResDefault,
AuxFlags: Byte;
cm_vp: PViewPort; // Points back to a ViewPort this colormap belongs to
NormalDisplayInfo,
CoerceDisplayInfo : APTR;
cm_batch_items: PTagItem;
VPModeID: ULONG;
// The following fields are present only if Type_ >= COLORMAP_TYPE_V39
PalExtra: PPaletteExtra; // Structure controlling palette sharing
SpriteBase_Even, // Color bank for even sprites (see above)
SpriteBase_Odd, // The same for odd sprites
Bp_0_base,
@ -1112,7 +1110,7 @@ type
const
// flags for TColorMap.Flags
CMF_CMTRANS = 0;
COLORMAP_TRANSPARENCY = 1 shl 0;
COLORMAP_TRANSPARENCY = 1 shl 0;
CMF_CPTRANS = 1;
COLORPLANE_TRANSPARENCY = 1 shl 1;
CMF_BRDRBLNK = 2;
@ -1127,13 +1125,13 @@ const
COLORMAP_TYPE_V1_2 = 0;
COLORMAP_TYPE_V36 = 1;
COLORMAP_TYPE_V39 = 2;
// SpriteResolution
SPRITERESN_ECS = $00;
// SpriteResolution
SPRITERESN_ECS = $00;
SPRITERESN_140NS = $01; // ^140ns, except in 35ns viewport, where it is 70ns.
SPRITERESN_70NS = $02;
SPRITERESN_35NS = $03;
SPRITERESN_DEFAULT = $ff;
// Private Flags for TCopList.Flags
EXACT_LINE = 1;
HALF_LINE = 2;
@ -1185,7 +1183,7 @@ const
CMAF_NO_COLOR_LOAD = 1 shl CMAB_NO_COLOR_LOAD;
CMAB_DUALPF_DISABLE = 3;
CMAF_DUALPF_DISABLE = 1 shl CMAB_DUALPF_DISABLE;
const
// flags values for ObtainPen
PENB_EXCLUSIVE = 0;
@ -1260,11 +1258,11 @@ const
DEFAULT_MONITOR_ID = $00000000;
NTSC_MONITOR_ID = $00011000;
PAL_MONITOR_ID = $00021000;
{ the following 22 composite keys are for Modes on the default Monitor.
NTSC & PAL "flavors" of these particular keys may be made by or'ing
the NTSC or PAL MONITOR_ID with the desired MODE_KEY...
For example, to specifically open a PAL HAM interlaced ViewPort
(or intuition screen), you would use the modeid of
(PAL_MONITOR_ID or HAMLACE_KEY)}
@ -1286,7 +1284,7 @@ const
SUPER_KEY = $00008020;
SUPERLACE_KEY = $00008024;
HIRESEHB_KEY = $00008080;
HIRESEHBLACE_KEY = $00008084;
HIRESEHBLACE_KEY = $00008084;
SUPEREHB_KEY = $000080a0;
SUPEREHBLACE_KEY = $000080a4;
HIRESDPF_KEY = $00008400;
@ -1302,7 +1300,7 @@ const
HIRESHAMSDBL_KEY = $00008808;
SUPERHAM_KEY = $00008820;
SUPERHAMLACE_KEY = $00008824;
// VGA identifiers
VGA_MONITOR_ID = $00031000;
@ -1349,7 +1347,7 @@ const
VGAEXTRALORESEHBDBL_KEY = $00031080;
VGALORESEHBDBL_KEY = $00039080;
VGAPRODUCTEHBDBL_KEY = $000390a0;
// A2024 identifiers
// A2024 identifiers
A2024_MONITOR_ID = $00041000;
A2024TENHERTZ_KEY = $00041000;
A2024FIFTEENHERTZ_KEY = $00049000;
@ -1408,7 +1406,7 @@ const
{ Euro36 modeids can be ORed with the default modeids a la NTSC and PAL.
For example, Euro36 SuperHires is
(EURO36_MONITOR_ID OR SUPER_KEY)}
// Super 72
// Super 72
SUPER72_MONITOR_ID = $00081000;
{ Super72 modeids can be ORed with the default modeids a la NTSC and PAL.
For example, Super72 SuperHiresLace (80$600) is
@ -1537,7 +1535,7 @@ const
BIDTAG_BlueBits = $8000000c; // > Match up from the database
BIDTAG_GreenBits = $8000000d; // / Default - 4
BIDTAG_GfxPrivate = $8000000e; // Private
type
// the "public" handle to a DisplayInfoRecord
DisplayInfoHandle = APTR;
@ -1569,7 +1567,7 @@ type
end;
const
// availability TDisplayInfo.NotAvailable
// availability TDisplayInfo.NotAvailable
DI_AVAIL_NOCHIPS = 1 shl 0;
DI_AVAIL_NOMONITOR = 1 shl 1;
DI_AVAIL_NOTWITHGENLOCK = 1 shl 2;
@ -1592,22 +1590,22 @@ const
DIPF_IS_SPRITES_CHNG_RES = 1 shl 14; // supports variable sprite resolution
DIPF_IS_SPRITES_BORDER = 1 shl 15; // sprite can be displayed in the border
DIPF_IS_AA = 1 shl 16; // AA modes - may only be available if machine has correct memory
// type to support required bandwidth - check availability.
// type to support required bandwidth - check availability.
DIPF_IS_SCANDBL = 1 shl 17; // scan doubled
DIPF_IS_SPRITES_CHNG_BASE = 1 shl 18; // can change the sprite base colour
DIPF_IS_SPRITES_CHNG_PRI = 1 shl 19; // can change the sprite priority with respect to the playfield(s).
DIPF_IS_DBUFFER = 1 shl 20; // can support double buffering
DIPF_IS_PROGBEAM = 1 shl 21; // is a programmed beam-sync mode
DIPF_IS_FOREIGN = 1 shl 22; // this mode is not native to the Amiga
// Use these tags for passing to BestModeID()
SPECIAL_FLAGS = DIPF_IS_DUALPF or DIPF_IS_PF2PRI or DIPF_IS_HAM or DIPF_IS_EXTRAHALFBRITE;
SPECIAL_FLAGS = DIPF_IS_DUALPF or DIPF_IS_PF2PRI or DIPF_IS_HAM or DIPF_IS_EXTRAHALFBRITE;
type
PDimensionInfo = ^TDimensionInfo;
TDimensionInfo = record
Header: TQueryHeader;
MaxDepth, // log2(max number of colors)
MaxDepth, // log2(max number of colors)
MinRasterWidth, // minimum width in pixels
MinRasterHeight, // minimum height in pixels
MaxRasterWidth, // maximum width in pixels
@ -1644,7 +1642,7 @@ const
MCOMPAT_NOBODY = -1; // only one viewport at a time
MCOMPAT_MIXED = 0; // can share display with other MCOMPAT_MIXED
MCOMPAT_SELF = 1; // can share only within same monitor
DISPLAYNAMELEN = 32;
type
PNameInfo = ^TNameInfo;
@ -1653,7 +1651,7 @@ type
Name: array[0..DISPLAYNAMELEN - 1] of Char;
Reserved: array[0..1] of IPTR; // terminator
end;
const
DTAG_DISP = TAG_USER;
DTAG_DIMS = TAG_USER + $1000;
@ -1677,16 +1675,16 @@ type
const
// Tags for AddDisplayDriverA()
DDRV_BootMode = TAG_USER + $01; // (LongBool) Boot mode driver which will be
// unloaded when any next driver comes in, default = False
// unloaded when any next driver comes in, default = False
DDRV_MonitorID = TAG_USER + $02; // (ULONG) Monitor ID for this driver, default = next available
DDRV_ReserveIDs = TAG_USER + $03; // (ULONG) How many monitor IDs to reserve, default = 1
DDRV_KeepBootMode = TAG_USER + $04; // (LongBool) Do not shut down boot mode drivers, default = False
DDRV_ResultID = TAG_USER + $05; // (PLongWord) Obtain assigned monitor ID
DDRV_IDMask = TAG_USER + $06; // (ULONG) Use own mask for monitor ID separation
DDRV_ReserveIDs = TAG_USER + $03; // (ULONG) How many monitor IDs to reserve, default = 1
DDRV_KeepBootMode = TAG_USER + $04; // (LongBool) Do not shut down boot mode drivers, default = False
DDRV_ResultID = TAG_USER + $05; // (PLongWord) Obtain assigned monitor ID
DDRV_IDMask = TAG_USER + $06; // (ULONG) Use own mask for monitor ID separation
// Return codes
DD_OK = 0; // No error
DD_NO_MEM = 1; // Out of memory
DD_ID_EXISTS = 2; // Specified MonitorID is already allocated
DD_OK = 0; // No error
DD_NO_MEM = 1; // Out of memory
DD_ID_EXISTS = 2; // Specified MonitorID is already allocated
type
// This structure is subject to change! Private!
@ -1762,7 +1760,7 @@ const
VTAG_FULLPALETTE_GET = $80000039;
VTAG_FULLPALETTE_CLR = $8000003A;
VTAG_DEFSPRITERESN_SET = $8000003B;
VTAG_DEFSPRITERESN_GET = $8000003C;
VTAG_DEFSPRITERESN_GET = $8000003C;
{ all the following tags follow the new, rational standard for videocontrol tags:
VC_xxx,state set the state of attribute 'xxx' to value 'state'
@ -1803,8 +1801,8 @@ type
es_WordWidth: Word; { graphics use only, subject to change }
es_Flags: Word; { graphics use only, subject to change }
{$ifdef aros} // New in AROS
es_Bitmap: PBitmap; // Actual image data.
{$endif}
es_Bitmap: PBitmap; // Actual image data.
{$endif}
end;
const
@ -1859,21 +1857,21 @@ const
// Extensions invented by AROS
RPTAG_PatternOriginX = $800000C0; // SmallInt
RPTAG_PatternOriginY = $800000C1; // SmallInt
RPTAG_ClipRectangle = $800000C2; // PRectangle Clones PRectangle.
RPTAG_ClipRectangle = $800000C2; // PRectangle Clones PRectangle.
RPTAG_ClipRectangleFlags = $800000C3; // LongWord
RPTAG_RemapColorFonts = $800000C4; // LongBool
RPTAG_RemapColorFonts = $800000C4; // LongBool
{$endif}
// Flags for ClipRectangleFlags
RPCRF_RELRIGHT = $01; // ClipRectangle.MaxX is relative to right of layer/bitmap
RPCRF_RELBOTTOM = $02; // ClipRectangle.MaxY is relative to bottom of layer/bitmap
RPCRF_VALID = $04; // private
RPCRF_VALID = $04; // private
type
PGfxBase = ^tGfxBase;
TGfxBase = record
LibNode: TLibrary;
ActiView: PView; // ViewPtr
CopInit: PCopInit; // ptr to copper start up list
Cia: PLongInt; // for 8520 resource use
@ -1887,10 +1885,10 @@ type
vbsrv,
timsrv,
bltsrv: TInterrupt;
TextFonts: TList; // Fonts
DefaultFont: PTextFont;
DefaultFont: PTextFont;
Modes: Word; // copy of current first bplcon0
VBlank: Shortint;
Debug: Shortint;
@ -1905,10 +1903,10 @@ type
BlitWaitQ: TList;
BlitOwner: PTask;
TOF_WaitQ: tList;
DisplayFlags: Word; // NTSC PAL GENLOC etc. Display flags are determined at power on
SimpleSprites: PPSimpleSprite; // SimpleSpritePtr ptr
MaxDisplayRow: Word; // hardware stuff, do not use
MaxDisplayColumn: Word; // hardware stuff, do not use
NormalDisplayRows: Word;
@ -1916,9 +1914,9 @@ type
// the following are for standard non interlace, 1/2 wb width
NormalDPMX: Word; // Dots per meter on display
NormalDPMY: Word; // Dots per meter on display
LastChanceMemory: PSignalSemaphore;
LCMptr: PWord;
MicrosPerLine: Word; // 256 time usec/line
MinDisplayColumn: Word;
@ -1932,7 +1930,7 @@ type
hedley_count: SmallInt;
hedley_flags: Word;
hedley_tmp: SmallInt;
hash_table: ^IPTR; // Hashtable used for GfxAssociate() and GfxLookup() (private!)
current_tot_rows: Word;
current_tot_cclks: Word;
@ -1942,19 +1940,19 @@ type
a2024_sync_raster: PLongWord;
control_delta_pal: Word;
control_delta_ntsc: Word;
Current_Monitor: PMonitorSpec; // MonitorSpec used for current display
MonitorList: TList; // List of all MonitorSpecs in the system
Default_Monitor: PMonitorSpec; // MonitorSpec of "default.monitor"
MonitorListSemaphore: PSignalSemaphore; // Semaphore for MonitorList access
MonitorListSemaphore: PSignalSemaphore; // Semaphore for MonitorList access
DisplayInfoDataBase: Pointer; // nil, unused by AROS
TopLine: Word;
ActiViewCprSemaphore: pSignalSemaphore; // Semaphore for active view access
UtilityBase: PUtilityBase; // for hook AND tag utilities
ExecBase: PExecBase; // to link with rom.lib
bwshifts: PShortInt;
StrtFetchMasks,
StopFetchMasks,
@ -1978,35 +1976,35 @@ type
MonitorFlags: Word;
ScanDoubledSprites,
BP3Bits: Byte;
MonitorVBlank: TAnalogSignalInterval;
Natural_Monitor: PMonitorSpec; // Default MonitorSpec for view without explicit MonitorSpec in ViewExtra
ProgData: APTR; // nil not used in AROS
ExtSprites: Byte;
pad3: Byte;
GfxFlags: Word;
VBCounter: ULONG;
HashTableSemaphore: PSignalSemaphore; // Semaphore for hash_table access, private in fact
ChunkyToPlanarPtr: PLongWord; // HWEmul[0];
HWEmul: array[1..8] of PLongWord;
end;
type
type
// for SetDisplayDriverCallback
TDriverNotifyFunc = function (Obj: APTR; Add: LongBool; userdata: APTR): APTR; cdecl;
const
//DisplayFlags
//DisplayFlags
// Specify some system-wide options for Amiga(tm) chipset
NTSC = 1 shl 0; // Default mode is NTSC
GENLOC = 1 shl 1; // Genlock is in use
PAL = 1 shl 2; // Default mode is PAL
TODA_SAFE = 1 shl 3;
REALLY_PAL = 1 shl 4;
LPEN_SWAP_FRAMES = 1 shl 5; // When light pen is being used on interlaced screens, swap even and odd frames
LPEN_SWAP_FRAMES = 1 shl 5; // When light pen is being used on interlaced screens, swap even and odd frames
// bits defs for ChipRevBits
GFXB_BIG_BLITS = 0 ;
GFXB_HR_AGNUS = 0 ;
@ -2033,7 +2031,7 @@ const
BUS_32 = 1;
NML_CAS = 0;
DBL_CAS = 2;
BANDWIDTH_1X = BUS_16 or NML_CAS;
BANDWIDTH_2XNML = BUS_32;
BANDWIDTH_2XDBL = DBL_CAS;
@ -2043,9 +2041,9 @@ const
{ GfxFlags (private) }
NEW_DATABASE = 1;
GRAPHICSNAME: PChar = 'graphics.library';
var
GfxBase: PGfxBase;
@ -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,19 +2240,19 @@ 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
// This one is used for determining optimal offset for blitting into cliprects
// This one is used for determining optimal offset for blitting into cliprects
function Align_Offset(x: Pointer): Pointer;
function Is_Visible(l: PLayer): Boolean;
procedure InitAnimate(var Animkey: PAnimOb);
@ -2270,7 +2268,7 @@ procedure SetAfPt(w: PRastPort; p: Pointer; n: Byte);
procedure SetDrPt(w: PRastPort; p: Word);
procedure SetOPen(w: PRastPort; c: Byte);
procedure SetWrMsk(w: PRastPort; m: Byte);
function SetAOlPen(Rp: PRastPort; Pen: LongWord): LongWord;
procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt);
@ -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));
end;
function AllocSpriteData(Bitmap: PBitMap; Tags: array of const): PExtSprite;
var
TagList: TTagsList;
begin
AddTags(TagList, Tags);
Result := AllocSpriteDataA(Bitmap, GetTagPtr(TagList));
BestModeID := BestModeIDA(@Tags);
end;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; Tags: array of const): LongInt;
var
TagList: TTagsList;
function AllocSpriteData(Bitmap: PBitMap; const Tags: array of PtrUInt): PExtSprite; inline;
begin
AddTags(TagList, Tags);
Result := ChangeExtSpriteA(Vp, Oldsprite, NewSprite, GetTagPtr(TagList));
AllocSpriteData := AllocSpriteDataA(Bitmap, @Tags);
end;
function ExtendFontTags(Font: PTextFont; Tags: array of const): LongWord;
var
TagList: TTagsList;
function ChangeExtSprite(Vp: PViewPort; Oldsprite: PExtSprite; NewSprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
Result := ExtendFont(Font, GetTagPtr(TagList));
ChangeExtSprite := ChangeExtSpriteA(Vp, Oldsprite, NewSprite, @Tags);
end;
function GetExtSprite(Sprite: PExtSprite; Tags: array of const): LongInt;
var
TagList: TTagsList;
function ExtendFontTags(Font: PTextFont; const Tags: array of PtrUInt): LongWord; inline;
begin
AddTags(TagList, Tags);
Result := GetExtSpriteA(Sprite, GetTagPtr(TagList));
ExtendFontTags := ExtendFont(Font, @Tags);
end;
procedure GetRPAttrs(Rp: PRastPort; Tags: array of const);
var
TagList: TTagsList;
function GetExtSprite(Sprite: PExtSprite; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
GetRPAttrsA(Rp, GetTagPtr(TagList));
GetExtSprite := GetExtSpriteA(Sprite, @Tags);
end;
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; Tags: array of const): LongInt;
var
TagList: TTagsList;
procedure GetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
begin
AddTags(TagList, Tags);
Result := ObtainBestPenA(Cm, r, g, b, GetTagPtr(TagList));
GetRPAttrsA(Rp, @Tags);
end;
procedure SetRPAttrs(Rp: PRastPort; Tags: array of const);
var
TagList: TTagsList;
function ObtainBestPen(Cm: PColorMap; r, g, b: LongWord; const Tags: array of PtrUInt): LongInt; inline;
begin
AddTags(TagList, Tags);
SetRPAttrsA(Rp, GetTagPtr(TagList));
ObtainBestPen := ObtainBestPenA(Cm, r, g, b, @Tags);
end;
function VideoControlTags(Cm: PColorMap; Tags: array of const): LongWord;
var
TagList: TTagsList;
procedure SetRPAttrs(Rp: PRastPort; const Tags: array of PtrUInt); inline;
begin
SetRPAttrsA(Rp, @Tags);
end;
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;
@ -2378,12 +2346,12 @@ end;
procedure RemBob(B: PBob); inline;
begin
B^.Flags := B^.Flags or BOBSAWAY;
B^.Flags := B^.Flags or BOBSAWAY;
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;
@ -2393,18 +2361,18 @@ end;
function GetTextFontReplyPort(Font: PTextFont): PMsgPort; inline;
var
tfe: PTextFontExtension;
tfe: PTextFontExtension;
begin
tfe := PTextFontExtension(ExtendFont(Font, nil));
if Assigned(tfe) then
GetTextFontReplyPort := tfe^.tfe_OrigReplyPort
else
GetTextFontReplyPort := Font^.tf_Message.mn_ReplyPort;
tfe := PTextFontExtension(ExtendFont(Font, nil));
if Assigned(tfe) then
GetTextFontReplyPort := tfe^.tfe_OrigReplyPort
else
GetTextFontReplyPort := Font^.tf_Message.mn_ReplyPort;
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,12 +123,9 @@ begin
begin
GetMem(Buf, Len + 1);
FillChar(Buf^, Len + 1, #0);
try
ReadChunkBytes(Iff, Buf, Len);
Result := Result + string(Buf);
finally
FreeMem(Buf);
end;
ReadChunkBytes(Iff, Buf, Len);
GetTextFromClip := GetTextFromClip + AnsiString(Buf);
FreeMem(Buf);
end;
end;
end;
@ -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
@ -23,8 +23,8 @@ uses
const
CYBERGFXNAME = 'cybergraphics.library';
CYBERGFX_INCLUDE_VERSION = 41;
// ProcessPixelArray Operations (v50)
POP_BRIGHTEN = 0;
@ -62,9 +62,9 @@ const
PPAOPTAG_GRADSYMCENTER = $85231026;
PPAOPTAG_RGBMASK = $85231025;
// Definition of CyberModeNode (Returned in AllocModeList)
type
PCyberModeNode = ^TCyberModeNode;
TCyberModeNode = record
@ -83,9 +83,9 @@ const
CYBRMATTR_XMOD = $80000001; // function returns BytesPerRow if its called with this parameter
CYBRMATTR_BPPIX = $80000002; // BytesPerPixel shall be returned
CYBRMATTR_DISPADR = $80000003; // do not use this ! private tag
CYBRMATTR_PIXFMT = $80000004; // the pixel format is returned
CYBRMATTR_PIXFMT = $80000004; // the pixel format is returned
CYBRMATTR_WIDTH = $80000005; // returns width in pixels
CYBRMATTR_HEIGHT = $80000006; // returns height in lines
CYBRMATTR_HEIGHT = $80000006; // returns height in lines
CYBRMATTR_DEPTH = $80000007; // returns bits per pixel
CYBRMATTR_ISCYBERGFX = $80000008; // returns -1 if supplied bitmap is a cybergfx one
CYBRMATTR_ISLINEARMEM = $80000009; // returns -1 if supplied bitmap is linear accessable
@ -109,7 +109,7 @@ const
CYBRMREQ_WinTitle = CYBRMREQ_TB + 20;
CYBRMREQ_OKText = CYBRMREQ_TB + 21;
CYBRMREQ_CancelText = CYBRMREQ_TB + 22;
CYBRMREQ_Screen = CYBRMREQ_TB + 30; // Screen you wish the Requester to open on
CYBRMREQ_Screen = CYBRMREQ_TB + 30; // Screen you wish the Requester to open on
// Tags for BestCyberModeID()
CYBRBIDTG_TB = TAG_USER + $50000;
// FilterTags
@ -148,26 +148,26 @@ const
PIXFMT_RGB032 = 103;
PIXFMT_0BGR32 = 104;
RECTFMT_RGB15 = 100;
RECTFMT_BGR15 = 101;
RECTFMT_RGB15 = 100;
RECTFMT_BGR15 = 101;
RECTFMT_RGB15PC = 102;
RECTFMT_BGR15PC = 103;
RECTFMT_RGB16 = 104;
RECTFMT_BGR16 = 105;
RECTFMT_RGB16 = 104;
RECTFMT_BGR16 = 105;
RECTFMT_RGB16PC = 106;
RECTFMT_BGR16PC = 107;
RECTFMT_RGB24 = RECTFMT_RGB;
RECTFMT_BGR24 = 109;
RECTFMT_ARGB32 = RECTFMT_ARGB;
RECTFMT_BGRA32 = 111;
RECTFMT_RGBA32 = RECTFMT_RGBA;
RECTFMT_ABGR32 = 113;
RECTFMT_RGB24 = RECTFMT_RGB;
RECTFMT_BGR24 = 109;
RECTFMT_ARGB32 = RECTFMT_ARGB;
RECTFMT_BGRA32 = 111;
RECTFMT_RGBA32 = RECTFMT_RGBA;
RECTFMT_ABGR32 = 113;
RECTFMT_0RGB32 = 114;
RECTFMT_BGR032 = 115;
RECTFMT_RGB032 = 116;
RECTFMT_0BGR32 = 117;
{$endif}
// Parameters for CVideoCtrlTagList()
SETVC_DPMSLevel = $88002001;
DPMS_ON = 0; // Full operation
@ -185,7 +185,7 @@ const
// Tags for UnLockBitMapTagList()
UBMI_UPDATERECTS = $85001001;
UBMI_REALLYUNLOCK = $85001002;
type
// Message passed to the DoCDrawMethodTagList() hook function
PCDrawMsg = ^TCDrawMsg;
@ -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;
@ -311,7 +290,7 @@ begin
end;
initialization
CyberGfxBase := OpenLibrary(CYBERGFXNAME, 0);
CyberGfxBase := OpenLibrary(CYBERGFXNAME, 0);
finalization
CloseLibrary(CyberGfxBase);
end.

View File

@ -15,112 +15,96 @@
unit diskfont;
{$mode objfpc}
INTERFACE
interface
uses exec, agraphics,utility;
const
MAXFONTPATH = 256;
MAXFONTPATH = 256;
type
PFontContents = ^TFontContents;
TFontContents = record
fc_FileName: array[0..MAXFONTPATH - 1] of Char;
fc_YSize: Word;
fc_Style: Byte;
fc_Flags: Byte;
end;
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;
tfc_TagCount : Word;
tfc_YSize : Word;
PTFontContents = ^TTFontContents;
TTFontContents = record
tfc_FileName: array[0..MAXFONTPATH - 3] of Char;
tfc_TagCount: Word;
tfc_YSize: Word;
tfc_Style,
tfc_Flags : Byte;
END;
tfc_Flags: Byte;
end;
const
FCH_ID = $0f00;
TFCH_ID = $0f02;
OFCH_ID = $0f03;
FCH_ID = $0f00;
TFCH_ID = $0f02;
OFCH_ID = $0f03;
type
pFontContentsHeader = ^tFontContentsHeader;
tFontContentsHeader = record
fch_FileID : Word;
fch_NumEntries : Word;
end;
PFontContentsHeader = ^TFontContentsHeader;
TFontContentsHeader = record
fch_FileID: Word;
fch_NumEntries: Word;
end;
const
DFH_ID = $0f80;
MAXFONTNAME = 32;
DFH_ID = $0f80;
MAXFONTNAME = 32;
type
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;
end;
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;
end;
const
AFB_MEMORY = 0;
AFF_MEMORY = 1;
AFB_DISK = 1;
AFF_DISK = 2;
AFB_SCALED = 2;
AFF_SCALED = $0004;
AFB_BITMAP = 3;
AFF_BITMAP = $0008;
AFB_TAGGED = 16;
AFF_TAGGED = $10000;
AFB_MEMORY = 0;
AFF_MEMORY = 1;
AFB_DISK = 1;
AFF_DISK = 2;
AFB_SCALED = 2;
AFF_SCALED = $0004;
AFB_BITMAP = 3;
AFF_BITMAP = $0008;
AFB_TAGGED = 16;
AFF_TAGGED = $10000;
type
PAvailFonts = ^TAvailFonts;
TAvailFonts = record
af_Type: Word;
af_Attr: TTextAttr;
end;
pAvailFonts = ^tAvailFonts;
tAvailFonts = record
af_Type : Word;
af_Attr : tTextAttr;
end;
PTAvailFonts = ^TTAvailFonts;
TTAvailFonts = record
taf_Type: Word;
taf_Attr: TTTextAttr;
end;
pTAvailFonts = ^tTAvailFonts;
tTAvailFonts = record
taf_Type : Word;
taf_Attr : tTTextAttr;
end;
pAvailFontsHeader = ^tAvailFontsHeader;
tAvailFontsHeader = record
afh_NumEntries : Word;
end;
PAvailFontsHeader = ^TAvailFontsHeader;
TAvailFontsHeader = record
afh_NumEntries: Word;
end;
const
DISKFONTNAME : PChar = 'diskfont.library';
DISKFONTNAME: PChar = 'diskfont.library';
var
DiskfontBase: PLibrary;
function AvailFonts(Buffer: PChar; BufBytes: LongInt; Flags: LongInt): LongInt; syscall DiskfontBase 6;
procedure DisposeFontContents(FontContentsHeader: PFontContentsHeader); syscall DiskfontBase 8;
procedure DisposeFontContents(FontContentsHeader: PFontContentsHeader); syscall DiskfontBase 8;
function NewFontContents(FontsLock: BPTR; FontName: PChar): PFontContentsHeader; syscall DiskfontBase 7;
function NewScaledDiskFont(SourceFont: PTextFont; DestTextAttr: PTextAttr): PDiskFontHeader; syscall DiskfontBase 9;
function OpenDiskFont(TextAttr: PTextAttr): PTextFont; syscall DiskfontBase 5;

View File

@ -15,17 +15,15 @@
unit icon;
{$mode delphi}
interface
uses
exec, workbench,utility,amigados, agraphics, intuition;
exec, workbench, utility, amigados, agraphics, intuition;
//,datatypes;
const
ICONNAME : PChar = 'icon.library';
ICONNAME : PChar = 'icon.library';
ICONA_Dummy = TAG_USER + $9000; // Start of icon.library tags
ICONA_ErrorCode = ICONA_Dummy + 1; // Errorcode (PLongInt)
ICONA_ErrorTagItem = ICONA_Dummy + 75; //Points to the tag item that caused the error (^PTagItem).
@ -199,7 +197,7 @@ const
screen, turn the duplicate into that palette mapped icon.}
{ Tags for use with DrawIconStateA() and GetIconRectangleA(). }
ICONDRAWA_DrawInfo = ICONA_Dummy + 66; // Drawing information to use (PDrawInfo).
ICONDRAWA_DrawInfo = ICONA_Dummy + 66; // Drawing information to use (PDrawInfo).
ICONDRAWA_Frameless = ICONA_Dummy + 70; // Draw the icon without the surrounding frame (BOOL).
ICONDRAWA_EraseBackground = ICONA_Dummy + 71; // Erase the background before drawing a frameless icon (BOOL).
ICONDRAWA_Borderless = ICONA_Dummy + 83; // Draw the icon without the surrounding border and frame (BOOL).
@ -213,7 +211,7 @@ const
ICONA_Reserved6 = ICONA_Dummy + 86;
ICONA_Reserved7 = ICONA_Dummy + 87;
ICONA_Reserved8 = ICONA_Dummy + 88;
{ The last Tag}
{ The last Tag}
ICONA_LAST_TAG = ICONA_Dummy + 88;
@ -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;
function GetToolTypes(Filename: string): TToolTypeArray;
TToolTypeArray= array of AnsiString;
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);
@ -4038,49 +4034,34 @@ end;
function MUIV_Window_Width_Screen(p : LongInt) : LongInt; inline;
begin
MUIV_Window_Width_Screen := (-200 - (p));
MUIV_Window_Width_Screen := (-200 - (p));
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;