PalmAPI.pas

Un article de Wikipedia.

(Différences entre les versions)
(Nouvelle page : <code pascal n> { PalmAPI Version 7 - November 24, 2004 PalmAPI is a set of common Palm OS API calls and types definitions for the Palm OS Pascal Compiler Made by Laurent Duv...)
Version actuelle (11 mars 2008 à 12:13) (modifier) (défaire)
 
Ligne 2 : Ligne 2 :
{ PalmAPI
{ PalmAPI
Version 7 - November 24, 2004
Version 7 - November 24, 2004
 +
PalmAPI is a set of common
PalmAPI is a set of common
Palm OS API calls and types
Palm OS API calls and types
definitions for the
definitions for the
Palm OS Pascal Compiler
Palm OS Pascal Compiler
 +
Made by Laurent Duveau
Made by Laurent Duveau
& Philippe Guillot
& Philippe Guillot
Ligne 12 : Ligne 14 :
e-Mail = info@aldweb.com
e-Mail = info@aldweb.com
e-Mail = ph.guillot@wanadoo.fr
e-Mail = ph.guillot@wanadoo.fr
 +
 +
Use: insert {$i PalmAPI.pas}
Use: insert {$i PalmAPI.pas}
in your PP source code
in your PP source code
 +
}
 +
 +
// Palm OS Types Definitions
// Palm OS Types Definitions
 +
Const
Const
SYSTRAP = $4E4F;
SYSTRAP = $4E4F;
HIGH_DENSITY_TRAP = $A3EC;
HIGH_DENSITY_TRAP = $A3EC;
VFS_TRAP = $A348;
VFS_TRAP = $A348;
 +
nilEvent = 0;
nilEvent = 0;
penDownEvent = 1;
penDownEvent = 1;
Ligne 54 : Ligne 63 :
sclExitEvent = 33;
sclExitEvent = 33;
sclRepeatEvent = 34;
sclRepeatEvent = 34;
 +
firstUserEvent = $6000;
firstUserEvent = $6000;
 +
dmModeReadOnly = 1;
dmModeReadOnly = 1;
dmModeWrite = 2;
dmModeWrite = 2;
dmModeReadWrite = 3;
dmModeReadWrite = 3;
 +
evtWaitForever = -1;
evtWaitForever = -1;
 +
noPreferenceFound = -1;
noPreferenceFound = -1;
 +
sndInfo = 1;
sndInfo = 1;
sndWarning = 2;
sndWarning = 2;
Ligne 67 : Ligne 81 :
sndConfirmation = 6;
sndConfirmation = 6;
sndClick = 7;
sndClick = 7;
 +
sysAppLaunchCmdNormalLaunch = 0;
sysAppLaunchCmdNormalLaunch = 0;
sysAppLaunchCmdOpenDB = 52;
sysAppLaunchCmdOpenDB = 52;
 +
noFrame = 0;
noFrame = 0;
simpleFrame = 1;
simpleFrame = 1;
Ligne 77 : Ligne 93 :
popupFrame = $205;
popupFrame = $205;
dialogFrame = $302;
dialogFrame = $302;
 +
noFocus = $FFFF;
noFocus = $FFFF;
 +
stdFont = 0;
stdFont = 0;
boldFont = 1;
boldFont = 1;
Ligne 87 : Ligne 105 :
largeBoldFont = 7;
largeBoldFont = 7;
fntAppFontCustomBase = 128;
fntAppFontCustomBase = 128;
 +
sysFtrCreator = $70737973; // 'psys'
sysFtrCreator = $70737973; // 'psys'
sysFtrNumWinVersion = 24;
sysFtrNumWinVersion = 24;
 +
vfsIteratorStart = 0;
vfsIteratorStart = 0;
vfsIteratorStop = $FFFFFFFF;
vfsIteratorStop = $FFFFFFFF;
vfsFtrIDVersion = 0;
vfsFtrIDVersion = 0;
 +
Type
Type
Byte = 0..255;
Byte = 0..255;
Ligne 105 : Ligne 126 :
Err = UInt16;
Err = UInt16;
Coord = UInt16;
Coord = UInt16;
 +
Opaque = record end;
Opaque = record end;
MemHandle = ^Opaque;
MemHandle = ^Opaque;
ListPtr = ^Opaque;
ListPtr = ^Opaque;
FieldPtr = ^Opaque;
FieldPtr = ^Opaque;
 +
MemPtr = Pointer;
MemPtr = Pointer;
DmOpenRef = Pointer;
DmOpenRef = Pointer;
 +
PointType = record
PointType = record
x,y:Coord;
x,y:Coord;
end;
end;
 +
EventType = record
EventType = record
eType:UInt16;
eType:UInt16;
Ligne 132 : Ligne 157 :
10:(frmTitleEnter:record formID:UInt16 end);
10:(frmTitleEnter:record formID:UInt16 end);
end;
end;
 +
AbsRectType = record
AbsRectType = record
left,top,right,bottom:Coord;
left,top,right,bottom:Coord;
end;
end;
 +
FrameType = UInt16;
FrameType = UInt16;
Ligne 140 : Ligne 167 :
topLeft,extent:PointType;
topLeft,extent:PointType;
end;
end;
 +
BitmapType = record end;
BitmapType = record end;
BitmapPtr = ^BitmapType;
BitmapPtr = ^BitmapType;
 +
RGBColorType = record
RGBColorType = record
index,r,g,b:UInt8;
index,r,g,b:UInt8;
end;
end;
 +
IndexedColorType = UInt8;
IndexedColorType = UInt8;
// 0..215 combination of
// 0..215 combination of
Ligne 156 : Ligne 186 :
// 225..229 = specials: light gray,marron,purple,green,cyan
// 225..229 = specials: light gray,marron,purple,green,cyan
// 230..255 = unused (black)
// 230..255 = unused (black)
 +
FrameBitsType = record
FrameBitsType = record
bits,word:UInt16;
bits,word:UInt16;
end;
end;
 +
WinHandle = ^WindowType;
WinHandle = ^WindowType;
WindowType = record end;
WindowType = record end;
 +
FormObjListType = record end;
FormObjListType = record end;
 +
FormType = record end;
FormType = record end;
FormPtr = ^FormType;
FormPtr = ^FormType;
 +
MenuBarPtr = ^MenuBarType;
MenuBarPtr = ^MenuBarType;
MenuBarType = record end;
MenuBarType = record end;
 +
ControlPtr = ^ControlType;
ControlPtr = ^ControlType;
ControlType = record end;
ControlType = record end;
 +
DmSearchStateType = record
DmSearchStateType = record
info:array[0..7] of UInt32;
info:array[0..7] of UInt32;
end;
end;
 +
clipboardFormatType=(
clipboardFormatType=(
clipboardText,
clipboardText,
clipboardInk,
clipboardInk,
clipboardBitmap);
clipboardBitmap);
 +
FontID=UInt8;
FontID=UInt8;
 +
UnderlineModeType=(
UnderlineModeType=(
noUnderline,
noUnderline,
Ligne 181 : Ligne 221 :
solidUnderline,
solidUnderline,
colorUnderline);
colorUnderline);
 +
WinScreenModeOperation=(
WinScreenModeOperation=(
winScreenModeGetDefaults,
winScreenModeGetDefaults,
Ligne 188 : Ligne 229 :
winScreenModeGetSupportedDepths,
winScreenModeGetSupportedDepths,
winScreenModeGetSupportsColor);
winScreenModeGetSupportsColor);
 +
WinDirectionType=(
WinDirectionType=(
WinUp,
WinUp,
Ligne 193 : Ligne 235 :
WinLeft,
WinLeft,
WinRight);
WinRight);
 +
WinDrawOperation=(
WinDrawOperation=(
winPaint,
winPaint,
Ligne 201 : Ligne 244 :
winPaintInverse,
winPaintInverse,
winSwap);
winSwap);
 +
ScrollBarType = opaque;
ScrollBarType = opaque;
ScrollBarPtr = ^ScrollBarType;
ScrollBarPtr = ^ScrollBarType;
 +
DateTimeType = record
DateTimeType = record
second,minute,hour,day,month,year,weekDay:Int16;
second,minute,hour,day,month,year,weekDay:Int16;
end;
end;
DateTimePtr = ^DateTimeType;
DateTimePtr = ^DateTimeType;
 +
DateFormatType=(
DateFormatType=(
dfMDYWithSlashes, // 12/31/95
dfMDYWithSlashes, // 12/31/95
Ligne 224 : Ligne 270 :
dfMYMed, // Dec '95
dfMYMed, // Dec '95
dfMYMedNoPost); // Dec 95 (added for French 2.0 ROM)
dfMYMedNoPost); // Dec 95 (added for French 2.0 ROM)
 +
TimeFormatType=(
TimeFormatType=(
tfColon,
tfColon,
Ligne 234 : Ligne 281 :
tfHours24h, // 13
tfHours24h, // 13
tfComma24h); // 13,00
tfComma24h); // 13,00
 +
SelectDayType=(
SelectDayType=(
selectDayByDay, // return d/m/y
selectDayByDay, // return d/m/y
selectDayByWeek, // return d/m/y with d as same day of the week
selectDayByWeek, // return d/m/y with d as same day of the week
selectDayByMonth); // return d/m/y with d as same day of the month
selectDayByMonth); // return d/m/y with d as same day of the month
 +
SysBatteryKind=(
SysBatteryKind=(
sysBatteryKindAlkaline=0,
sysBatteryKindAlkaline=0,
Ligne 246 : Ligne 295 :
sysBatteryKindLiIon1400,
sysBatteryKindLiIon1400,
sysBatteryKindLast=255); // insert new battery types BEFORE this one
sysBatteryKindLast=255); // insert new battery types BEFORE this one
 +
DlkSyncStateType=(
DlkSyncStateType=(
dlkSyncStateNeverSynced=0, // never synced
dlkSyncStateNeverSynced=0, // never synced
Ligne 262 : Ligne 312 :
memIDPtr,
memIDPtr,
memIDHandle);
memIDHandle);
 +
FileInfoPtr = ^FileInfoType;
FileInfoPtr = ^FileInfoType;
FileInfoType = record
FileInfoType = record
Ligne 268 : Ligne 319 :
nameBufLen:UInt16; // size of nameP buffer, in bytes
nameBufLen:UInt16; // size of nameP buffer, in bytes
end;
end;
 +
WinScreenAttrType=(
WinScreenAttrType=(
winScreenWidth,
winScreenWidth,
Ligne 278 : Ligne 330 :
winScreenResolutionX,
winScreenResolutionX,
winScreenResolutionY);
winScreenResolutionY);
 +
 +
// Palm OS API calls
// Palm OS API calls
 +
function BmpCreate(width,height:Coord;depth:UInt8;colortableP:pointer;var error:UInt16):BitmapPtr; inline(SYSTRAP,$A3DD);
function BmpCreate(width,height:Coord;depth:UInt8;colortableP:pointer;var error:UInt16):BitmapPtr; inline(SYSTRAP,$A3DD);
 +
procedure ClipboardAddItem(format:ClipboardFormatType;var ptr;length:UInt16); inline(SYSTRAP,$A10A);
procedure ClipboardAddItem(format:ClipboardFormatType;var ptr;length:UInt16); inline(SYSTRAP,$A10A);
function ClipboardGetItem(format:ClipboardFormatType;var length:UInt16):MemHandle;inline(SYSTRAP,$A10C);
function ClipboardGetItem(format:ClipboardFormatType;var length:UInt16):MemHandle;inline(SYSTRAP,$A10C);
 +
function CtlGetLabel(const controlP: ControlPtr):StringPtr; inline(SYSTRAP,$A113);
function CtlGetLabel(const controlP: ControlPtr):StringPtr; inline(SYSTRAP,$A113);
function CtlGetValue(controlP:ControlPtr):UInt16;inline(SYSTRAP,$A111);
function CtlGetValue(controlP:ControlPtr):UInt16;inline(SYSTRAP,$A111);
Ligne 288 : Ligne 345 :
procedure CtlSetLabel(controlP:ControlPtr;const newLabel:StringPtr); inline(SYSTRAP,$A114);
procedure CtlSetLabel(controlP:ControlPtr;const newLabel:StringPtr); inline(SYSTRAP,$A114);
procedure CtlSetValue(ControlP:ControlPtr;newValue:Int16); inline(SYSTRAP,$A112);
procedure CtlSetValue(ControlP:ControlPtr;newValue:Int16); inline(SYSTRAP,$A112);
 +
procedure DateToAscii(months,days:UInt8;years:UInt16;dateFormat:DateFormatType;var pString:String); inline(SYSTRAP,$A266);
procedure DateToAscii(months,days:UInt8;years:UInt16;dateFormat:DateFormatType;var pString:String); inline(SYSTRAP,$A266);
 +
function DlkGetSyncInfo(var succSyncDateP,lastSyncDateP:UInt32;var syncStateP:DlkSyncStateType;var nameBufP,logBufP:string;var logLenP:Int32):UInt16; inline(SYSTRAP,$A2A9);
function DlkGetSyncInfo(var succSyncDateP,lastSyncDateP:UInt32;var syncStateP:DlkSyncStateType;var nameBufP,logBufP:string;var logLenP:Int32):UInt16; inline(SYSTRAP,$A2A9);
 +
function DmCloseDatabase(dbP:DmOpenRef):UInt16; inline(SYSTRAP,$A04A);
function DmCloseDatabase(dbP:DmOpenRef):UInt16; inline(SYSTRAP,$A04A);
function DmCreateDatabase(cardNo:UInt16;const name:String;c,t:UInt32;resDB:Boolean):UInt16; inline(SYSTRAP,$A041);
function DmCreateDatabase(cardNo:UInt16;const name:String;c,t:UInt32;resDB:Boolean):UInt16; inline(SYSTRAP,$A041);
Ligne 322 : Ligne 382 :
function DmSetDatabaseInfo(cardNo:UInt16;dbID:LocalID;const name:String;var attributes,version:UInt16;var crDate,modDate,bkpUpDate,modNum:UInt32;var appInfoID,sortInfoID:LocalID;var t,c:UInt32):UInt16; inline(SYSTRAP,$A047);
function DmSetDatabaseInfo(cardNo:UInt16;dbID:LocalID;const name:String;var attributes,version:UInt16;var crDate,modDate,bkpUpDate,modNum:UInt32;var appInfoID,sortInfoID:LocalID;var t,c:UInt32):UInt16; inline(SYSTRAP,$A047);
function DmWrite(recordP:Pointer;offset:UInt32;srcP:Pointer;bytes:UInt32):UInt16; inline(SYSTRAP,$A076);
function DmWrite(recordP:Pointer;offset:UInt32;srcP:Pointer;bytes:UInt32):UInt16; inline(SYSTRAP,$A076);
 +
procedure EvtGetEvent(var event:EventType;timeout:UInt32); inline(SYSTRAP,$A11D);
procedure EvtGetEvent(var event:EventType;timeout:UInt32); inline(SYSTRAP,$A11D);
 +
procedure FldDrawField(fldP:FieldPtr); inline(SYSTRAP,$A135);
procedure FldDrawField(fldP:FieldPtr); inline(SYSTRAP,$A135);
procedure FldGetAttributes(fldP:FieldPtr;var attrP:UInt16); inline(SYSTRAP,$A14F);
procedure FldGetAttributes(fldP:FieldPtr;var attrP:UInt16); inline(SYSTRAP,$A14F);
Ligne 332 : Ligne 394 :
procedure FldSetSelection(fldP:FieldPtr;startPosition,endPosition:UInt16); inline(SYSTRAP,$A142);
procedure FldSetSelection(fldP:FieldPtr;startPosition,endPosition:UInt16); inline(SYSTRAP,$A142);
procedure FldSetTextHandle(fldP:FieldPtr;textHandle:MemHandle); inline(SYSTRAP,$A158);
procedure FldSetTextHandle(fldP:FieldPtr;textHandle:MemHandle); inline(SYSTRAP,$A158);
 +
procedure FntCharsInWidth(const Chars:String;var stringWidthP,stringLengthP:Int16;var fitWithinWidth:Boolean); inline(SYSTRAP,$A16D);
procedure FntCharsInWidth(const Chars:String;var stringWidthP,stringLengthP:Int16;var fitWithinWidth:Boolean); inline(SYSTRAP,$A16D);
function FntCharsWidth(const Chars:String;Len:Int16):Int16; inline(SYSTRAP,$A16B);
function FntCharsWidth(const Chars:String;Len:Int16):Int16; inline(SYSTRAP,$A16B);
Ligne 338 : Ligne 401 :
function FntSetFont(font:FontID):FontID; inline(SYSTRAP,$A164);
function FntSetFont(font:FontID):FontID; inline(SYSTRAP,$A164);
function FontSelect(font:FontID):FontID; inline(SYSTRAP,$A320);
function FontSelect(font:FontID):FontID; inline(SYSTRAP,$A320);
 +
function FrmAlert(alertId:UInt16):UInt16; inline(SYSTRAP,$A192);
function FrmAlert(alertId:UInt16):UInt16; inline(SYSTRAP,$A192);
procedure FrmCloseAllForms;inline(SYSTRAP,$A1A1);
procedure FrmCloseAllForms;inline(SYSTRAP,$A1A1);
Ligne 374 : Ligne 438 :
procedure FrmSetTitle(formP:FormPtr;const newTitle:string);inline(SYSTRAP,$A191);
procedure FrmSetTitle(formP:FormPtr;const newTitle:string);inline(SYSTRAP,$A191);
procedure FrmShowObject(formP:FormPtr;objIndex:UInt16); inline(SYSTRAP,$A185);
procedure FrmShowObject(formP:FormPtr;objIndex:UInt16); inline(SYSTRAP,$A185);
 +
function FtrGet(creator:UInt32;featureNum:UInt16;var valueP:UInt32):Err; inline(SYSTRAP,$A27B);
function FtrGet(creator:UInt32;featureNum:UInt16;var valueP:UInt32):Err; inline(SYSTRAP,$A27B);
 +
function GetCharCaselessValue:pointer; inline(SYSTRAP,$A296);
function GetCharCaselessValue:pointer; inline(SYSTRAP,$A296);
 +
Procedure GsiInitialize; inline(SYSTRAP,$A29B);
Procedure GsiInitialize; inline(SYSTRAP,$A29B);
Procedure GsiSetLocation(x,y:Int16); inline(SYSTRAP,$A29C);
Procedure GsiSetLocation(x,y:Int16); inline(SYSTRAP,$A29C);
Ligne 381 : Ligne 448 :
Function GsiEnabled:Boolean; inline(SYSTRAP,$A29E);
Function GsiEnabled:Boolean; inline(SYSTRAP,$A29E);
Procedure GsiSetShiftState(lockFlags,tempShift:UInt16); inline(SYSTRAP,$A29F);
Procedure GsiSetShiftState(lockFlags,tempShift:UInt16); inline(SYSTRAP,$A29F);
 +
procedure InsPtEnable(enableIt:Boolean); inline(SYSTRAP,$A1AB);
procedure InsPtEnable(enableIt:Boolean); inline(SYSTRAP,$A1AB);
procedure InsPtSetHeight(Height:Int16); inline(SYSTRAP,$A1AD);
procedure InsPtSetHeight(Height:Int16); inline(SYSTRAP,$A1AD);
procedure InsPtSetLocation(x,y:Int16); inline(SYSTRAP,$A1A9);
procedure InsPtSetLocation(x,y:Int16); inline(SYSTRAP,$A1A9);
 +
function KeyCurrentState:UInt32;inline(SYSTRAP,$A2A2);
function KeyCurrentState:UInt32;inline(SYSTRAP,$A2A2);
 +
procedure LstDrawList(ListP:ListPtr);inline(SYSTRAP,$A1B1);
procedure LstDrawList(ListP:ListPtr);inline(SYSTRAP,$A1B1);
procedure LstEraseList(ListP:ListPtr);inline(SYSTRAP,$A1B2);
procedure LstEraseList(ListP:ListPtr);inline(SYSTRAP,$A1B2);
Ligne 398 : Ligne 468 :
procedure LstSetSelection(ListP:ListPtr;itemNum:Int16); inline(SYSTRAP,$A1B7);
procedure LstSetSelection(ListP:ListPtr;itemNum:Int16); inline(SYSTRAP,$A1B7);
procedure LstSetTopItem(ListP:ListPtr;itemNum:Int16);inline(SYSTRAP,$A2B5);
procedure LstSetTopItem(ListP:ListPtr;itemNum:Int16);inline(SYSTRAP,$A2B5);
 +
function MemCardInfo(cardNo:UInt16;var cardNameP,manufNameP:String;var versionP:UInt16;var crDateP,romSizeP,ramSizeP,freeBytesP:UInt32):Err; inline(SYSTRAP,$A004);
function MemCardInfo(cardNo:UInt16;var cardNameP,manufNameP:String;var versionP:UInt16;var crDateP,romSizeP,ramSizeP,freeBytesP:UInt32):Err; inline(SYSTRAP,$A004);
function MemHandleFree(h: MemHandle):UInt16; inline(SYSTRAP,$A02B);
function MemHandleFree(h: MemHandle):UInt16; inline(SYSTRAP,$A02B);
Ligne 419 : Ligne 490 :
function MemPtrSetOwner(p:MemPtr;owner:UInt16):UInt16; inline(SYSTRAP,$A01B);
function MemPtrSetOwner(p:MemPtr;owner:UInt16):UInt16; inline(SYSTRAP,$A01B);
procedure MemSet(var dst;numBytes:integer;value:UInt8); inline(SYSTRAP,$A027);
procedure MemSet(var dst;numBytes:integer;value:UInt8); inline(SYSTRAP,$A027);
 +
procedure MenuEraseStatus(menuP:Pointer); inline(SYSTRAP,$A1C1);
procedure MenuEraseStatus(menuP:Pointer); inline(SYSTRAP,$A1C1);
function MenuHandleEvent(menuP:Pointer;var event:EventType;var error:UInt16):Boolean; inline(SYSTRAP,$A1BF);
function MenuHandleEvent(menuP:Pointer;var event:EventType;var error:UInt16):Boolean; inline(SYSTRAP,$A1BF);
 +
function PrefGetAppPreferences(creator:UInt32;id:UInt16;var prefs;var prefsSize:UInt16;saved:Boolean):Int16; inline(SYSTRAP,$A2D3);
function PrefGetAppPreferences(creator:UInt32;id:UInt16;var prefs;var prefsSize:UInt16;saved:Boolean):Int16; inline(SYSTRAP,$A2D3);
procedure PrefSetAppPreferences(creator:UInt32;id,version:UInt16;var prefs;prefsSize:UInt16;saved:Boolean); inline(SYSTRAP,$A2D4);
procedure PrefSetAppPreferences(creator:UInt32;id,version:UInt16;var prefs;prefsSize:UInt16;saved:Boolean); inline(SYSTRAP,$A2D4);
 +
function RctPtInRectangle(x,y:Coord;var r:RectangleType):Boolean; inline(SYSTRAP,$A1C8);
function RctPtInRectangle(x,y:Coord;var r:RectangleType):Boolean; inline(SYSTRAP,$A1C8);
procedure RctSetRectangle(var r:RectangleType;left,top,width,height:Coord); inline(SYSTRAP,$A1C4);
procedure RctSetRectangle(var r:RectangleType;left,top,width,height:Coord); inline(SYSTRAP,$A1C4);
 +
procedure SclSetScrollBar(barP:ScrollBarPtr;value,min,max,pageSize:Int16); inline(SYSTRAP,$A2B6);
procedure SclSetScrollBar(barP:ScrollBarPtr;value,min,max,pageSize:Int16); inline(SYSTRAP,$A2B6);
 +
function SelectDay(selectDayBy:SelectDayType;var month,day,year:Int16;Const title:String):Boolean; inline(SYSTRAP,$A2D0);
function SelectDay(selectDayBy:SelectDayType;var month,day,year:Int16;Const title:String):Boolean; inline(SYSTRAP,$A2D0);
function SelectOneTime(var hour,minute:Int16;Const title:String):Boolean; inline(SYSTRAP,$A34F);
function SelectOneTime(var hour,minute:Int16;Const title:String):Boolean; inline(SYSTRAP,$A34F);
 +
procedure SndPlaySystemSound(beepID:Int8); inline(SYSTRAP,$A234);
procedure SndPlaySystemSound(beepID:Int8); inline(SYSTRAP,$A234);
 +
function StrAToI(const S:string):integer; inline(SYSTRAP,$a0ce);
function StrAToI(const S:string):integer; inline(SYSTRAP,$a0ce);
function StrCaselessCompare(const s1,s2:string):Int16; inline(SYSTRAP,$A0CA);
function StrCaselessCompare(const s1,s2:string):Int16; inline(SYSTRAP,$A0CA);
Ligne 436 : Ligne 514 :
procedure StrNCopy(var dst:String;src:MemPtr;n:Int16); inline(SYSTRAP,$A2CE);
procedure StrNCopy(var dst:String;src:MemPtr;n:Int16); inline(SYSTRAP,$A2CE);
function StrStr(const str,token:String):Pointer; inline(SYSTRAP,$A0CD);
function StrStr(const str,token:String):Pointer; inline(SYSTRAP,$A0CD);
 +
function SysBatteryInfo(doSet:Boolean;var warnThresholdP,criticalThresholdP:UInt16;var maxTicksP:Int16;var kindP:SysBatteryKind;var pluggedIn:Boolean;var percentP:UInt8):UInt16; inline(SYSTRAP,$A324);
function SysBatteryInfo(doSet:Boolean;var warnThresholdP,criticalThresholdP:UInt16;var maxTicksP:Int16;var kindP:SysBatteryKind;var pluggedIn:Boolean;var percentP:UInt8):UInt16; inline(SYSTRAP,$A324);
function SysCurAppDatabase(var cardNo:UInt16;var dbID:LocalID):UInt16; inline(SYSTRAP,$A0AC);
function SysCurAppDatabase(var cardNo:UInt16;var dbID:LocalID):UInt16; inline(SYSTRAP,$A0AC);
Ligne 443 : Ligne 522 :
function SysTicksPerSecond:UInt16; inline(SYSTRAP,$A2E9);
function SysTicksPerSecond:UInt16; inline(SYSTRAP,$A2E9);
function SysUIAppSwitch(cardNo:UInt16;dbID:LocalID;cmd:UInt16;cmdPBP:Pointer):UInt16; inline(SYSTRAP,$A0A7);
function SysUIAppSwitch(cardNo:UInt16;dbID:LocalID;cmd:UInt16;cmdPBP:Pointer):UInt16; inline(SYSTRAP,$A0A7);
 +
Procedure TimeToAscii(hours,minutes:UInt8;timeFormat:TimeFormatType;var pString:String); inline(SYSTRAP,$A268);
Procedure TimeToAscii(hours,minutes:UInt8;timeFormat:TimeFormatType;var pString:String); inline(SYSTRAP,$A268);
 +
function TimGetSeconds:UInt32; inline(SYSTRAP,$A0F5);
function TimGetSeconds:UInt32; inline(SYSTRAP,$A0F5);
function TimGetTicks:UInt32; inline(SYSTRAP,$A0F7);
function TimGetTicks:UInt32; inline(SYSTRAP,$A0F7);
procedure TimSecondsToDateTime(seconds:UInt32;dateTimeP:DateTimePtr); inline(SYSTRAP,$A0FC);
procedure TimSecondsToDateTime(seconds:UInt32;dateTimeP:DateTimePtr); inline(SYSTRAP,$A0FC);
 +
function UIPickColor(var indexP:IndexedColorType;var rgbP:RGBColorType;start:UInt16;const titleP,tipP:String):Boolean; inline(SYSTRAP,$A3AC);
function UIPickColor(var indexP:IndexedColorType;var rgbP:RGBColorType;start:UInt16;const titleP,tipP:String):Boolean; inline(SYSTRAP,$A3AC);
 +
function WinCreateBitmapWindow(bitmapP:BitmapPtr;var error:UInt16):WinHandle; inline(SYSTRAP,$A3E4);
function WinCreateBitmapWindow(bitmapP:BitmapPtr;var error:UInt16):WinHandle; inline(SYSTRAP,$A3E4);
procedure WinDeleteWindow(win:WinHandle;eraseIt:boolean); inline(SYSTRAP,$A1F8);
procedure WinDeleteWindow(win:WinHandle;eraseIt:boolean); inline(SYSTRAP,$A1F8);
Ligne 470 : Ligne 553 :
function WinSetTextColor(foreColor:IndexedColorType):IndexedColorType; inline(SYSTRAP,$A39A);
function WinSetTextColor(foreColor:IndexedColorType):IndexedColorType; inline(SYSTRAP,$A39A);
function WinSetDrawMode(newMode:WinDrawOperation):WinDrawOperation; inline(SYSTRAP,$A397);
function WinSetDrawMode(newMode:WinDrawOperation):WinDrawOperation; inline(SYSTRAP,$A397);
 +
// VFS functions
// VFS functions
function VFSDirEntryEnumerate(dirRef:UInt32;var dirEntryIteratorP:UInt32;var infoP:FileInfoType):Err; inline($7414,SYSTRAP,VFS_TRAP);
function VFSDirEntryEnumerate(dirRef:UInt32;var dirEntryIteratorP:UInt32;var infoP:FileInfoType):Err; inline($7414,SYSTRAP,VFS_TRAP);
Ligne 478 : Ligne 562 :
function VFSVolumeGetLabel(volRefNum:UInt16;const labelP:String;bufLen:UInt16):Err; inline($741D,SYSTRAP,VFS_TRAP);
function VFSVolumeGetLabel(volRefNum:UInt16;const labelP:String;bufLen:UInt16):Err; inline($741D,SYSTRAP,VFS_TRAP);
function VFSVolumeSize(volRefNum:UInt16;var volumeUsedP:UInt32;var volumeTotalP:UInt32):Err; inline($741F,SYSTRAP,VFS_TRAP);
function VFSVolumeSize(volRefNum:UInt16;var volumeUsedP:UInt32;var volumeTotalP:UInt32):Err; inline($741F,SYSTRAP,VFS_TRAP);
 +
// HighRes functions
// HighRes functions
function WinScreenGetAttribute(selector:WinScreenAttrType;var attrP:UInt32):Err; inline($740E,SYSTRAP,HIGH_DENSITY_TRAP);
function WinScreenGetAttribute(selector:WinScreenAttrType;var attrP:UInt32):Err; inline($740E,SYSTRAP,HIGH_DENSITY_TRAP);
 +
 +
// Special Functions
// Special Functions
 +
const
const
V100 = $0100;
V100 = $0100;
Ligne 492 : Ligne 580 :
V410 = $0410;
V410 = $0410;
V500 = $0500;
V500 = $0500;
 +
function VersionSupported(MinVersion:UInt32):boolean;
function VersionSupported(MinVersion:UInt32):boolean;
 +
var
ErrNo:Err;
ErrNo:Err;
ROMVersion:UInt32;
ROMVersion:UInt32;
Ligne 499 : Ligne 589 :
VersionSupported:=ROMVersion>=MinVersion*$10000;
VersionSupported:=ROMVersion>=MinVersion*$10000;
end;
end;
 +
function HandlerNONE(var e:EventType):boolean;
function HandlerNONE(var e:EventType):boolean;
// Needed for Palm OS < v3
// Needed for Palm OS < v3

Version actuelle

  1. { PalmAPI
  2. Version 7 - November 24, 2004
  3.  
  4. PalmAPI is a set of common
  5. Palm OS API calls and types
  6. definitions for the
  7. Palm OS Pascal Compiler
  8.  
  9. Made by Laurent Duveau
  10.   & Philippe Guillot
  11.   web site = www.aldweb.com
  12.   web site = http://ppcompiler.free.fr
  13.   e-Mail = info@aldweb.com
  14.   e-Mail = ph.guillot@wanadoo.fr
  15.  
  16.  
  17. Use: insert {$i PalmAPI.pas}
  18. in your PP source code
  19. }
  20.  
  21.  
  22. // Palm OS Types Definitions
  23.  
  24. Const
  25. SYSTRAP = $4E4F;
  26. HIGH_DENSITY_TRAP = $A3EC;
  27. VFS_TRAP = $A348;
  28.  
  29. nilEvent = 0;
  30. penDownEvent = 1;
  31. penUpEvent = 2;
  32. penMoveEvent = 3;
  33. keyDownEvent = 4;
  34. winEnterEvent = 5;
  35. winExitEvent = 6;
  36. ctlEnterEvent = 7;
  37. ctlExitEvent = 8;
  38. ctlSelectEvent = 9;
  39. ctlRepeatEvent = 10;
  40. lstEnterEvent = 11;
  41. lstSelectEvent = 12;
  42. lstExitEvent = 13;
  43. popSelectEvent = 14;
  44. fldEnterEvent = 15;
  45. fldHeightChangedEvent = 16;
  46. fldChangedEvent = 17;
  47. tblEnterEvent = 18;
  48. tblSelectEvent = 19;
  49. daySelectEvent = 20;
  50. menuEvent = 21;
  51. appStopEvent = 22;
  52. frmLoadEvent = 23;
  53. frmOpenEvent = 24;
  54. frmGotoEvent = 25;
  55. frmUpdateEvent = 26;
  56. frmSaveEvent = 27;
  57. frmCloseEvent = 28;
  58. frmTitleEnterEvent = 29;
  59. frmTitleSelectEvent = 30;
  60. tblExitEvent = 31;
  61. sclEnterEvent = 32;
  62. sclExitEvent = 33;
  63. sclRepeatEvent = 34;
  64.  
  65. firstUserEvent = $6000;
  66.  
  67. dmModeReadOnly = 1;
  68. dmModeWrite = 2;
  69. dmModeReadWrite = 3;
  70.  
  71. evtWaitForever = -1;
  72.  
  73. noPreferenceFound = -1;
  74.  
  75. sndInfo = 1;
  76. sndWarning = 2;
  77. sndError = 3;
  78. sndStartUp = 4;
  79. sndAlarm = 5;
  80. sndConfirmation = 6;
  81. sndClick = 7;
  82.  
  83. sysAppLaunchCmdNormalLaunch = 0;
  84. sysAppLaunchCmdOpenDB = 52;
  85.  
  86. noFrame = 0;
  87. simpleFrame = 1;
  88. rectangleFrame = 1;
  89. simple3DFrame = $12;
  90. roundFrame = $401;
  91. boldRoundFrame = $702;
  92. popupFrame = $205;
  93. dialogFrame = $302;
  94.  
  95. noFocus = $FFFF;
  96.  
  97. stdFont = 0;
  98. boldFont = 1;
  99. largeFont = 2;
  100. symbolFont = 3;
  101. symbol11Font = 4;
  102. symbol7Font = 5;
  103. ledFont = 6;
  104. largeBoldFont = 7;
  105. fntAppFontCustomBase = 128;
  106.  
  107. sysFtrCreator = $70737973; // 'psys'
  108. sysFtrNumWinVersion = 24;
  109.  
  110. vfsIteratorStart = 0;
  111. vfsIteratorStop = $FFFFFFFF;
  112. vfsFtrIDVersion = 0;
  113.  
  114. Type
  115. Byte = 0..255;
  116. Int16 = -32768..32767;
  117. UInt16 = 0..65535;
  118. Int8 = -128..127;
  119. UInt8 = 0..255;
  120. Int32 = Integer;
  121. UInt32 = 0..MaxInt;
  122. WChar = UInt16;
  123. StringPtr = ^String;
  124. LocalID = UInt32;
  125. Err = UInt16;
  126. Coord = UInt16;
  127.  
  128. Opaque = record end;
  129. MemHandle = ^Opaque;
  130. ListPtr = ^Opaque;
  131. FieldPtr = ^Opaque;
  132.  
  133. MemPtr = Pointer;
  134. DmOpenRef = Pointer;
  135.  
  136. PointType = record
  137. x,y:Coord;
  138. end;
  139.  
  140. EventType = record
  141. eType:UInt16;
  142. penDown:Boolean;
  143. tapCount:UInt8;
  144. screenX,screenY:Int16;
  145. case integer of
  146. 0: (datum:array[0..7] of UInt16);
  147. 1: (PenUp:record start,finish:PointType end);
  148. 2: (chrc:WChar;keyCode,modifiers:UInt16);
  149. 3: (FrmLoad:record FormID:UInt16 end);
  150. 4: (ctlSelect:record controlID:UInt16;pControl:pointer;on:Boolean;reserved1:UInt8;value:UInt16 end);
  151. 5: (menu:record itemID:UInt16 end);
  152. 6: (ctlEnter:record controlID:UInt16;pControl:pointer end);
  153. 7: (ctlRepeat:record controlID:UInt16;pControl:pointer;time:UInt32;value:UInt16 end);
  154. 8: (sclRepeat:record scrollBarID:UInt16;pScrollbar:pointer;value,newValue:Int16;time:UInt32 end);
  155. 9: (popSelect:record controlID:UInt16;pcontrol:pointer;listID:UInt16;plist:pointer;selection,priorselection:Int16 end);
  156. 10:(frmTitleEnter:record formID:UInt16 end);
  157. end;
  158.  
  159. AbsRectType = record
  160. left,top,right,bottom:Coord;
  161. end;
  162.  
  163. FrameType = UInt16;
  164.  
  165. RectangleType = record
  166. topLeft,extent:PointType;
  167. end;
  168.  
  169. BitmapType = record end;
  170. BitmapPtr = ^BitmapType;
  171.  
  172. RGBColorType = record
  173. index,r,g,b:UInt8;
  174. end;
  175.  
  176. IndexedColorType = UInt8;
  177. // 0..215 combination of
  178. // ff cc 99 66 33 00
  179. // B : 0 6 12 108 114 120
  180. // R : 0 18 36 54 72 90
  181. // G : 0 1 2 3 4 5
  182. // e.g 12+54+5 = $99 B + $66 R +$0 G
  183. // 216..224
  184. // gray 22 44 55 77 88 aa bb dd
  185. // 225..229 = specials: light gray,marron,purple,green,cyan
  186. // 230..255 = unused (black)
  187.  
  188. FrameBitsType = record
  189. bits,word:UInt16;
  190. end;
  191.  
  192. WinHandle = ^WindowType;
  193. WindowType = record end;
  194.  
  195. FormObjListType = record end;
  196.  
  197. FormType = record end;
  198. FormPtr = ^FormType;
  199.  
  200. MenuBarPtr = ^MenuBarType;
  201. MenuBarType = record end;
  202.  
  203. ControlPtr = ^ControlType;
  204. ControlType = record end;
  205.  
  206. DmSearchStateType = record
  207. info:array[0..7] of UInt32;
  208. end;
  209.  
  210. clipboardFormatType=(
  211. clipboardText,
  212. clipboardInk,
  213. clipboardBitmap);
  214.  
  215. FontID=UInt8;
  216.  
  217. UnderlineModeType=(
  218. noUnderline,
  219. grayUnderline,
  220. solidUnderline,
  221. colorUnderline);
  222.  
  223. WinScreenModeOperation=(
  224. winScreenModeGetDefaults,
  225. winScreenModeGet,
  226. winScreenModeSetToDefaults,
  227. winScreenModeSet,
  228. winScreenModeGetSupportedDepths,
  229. winScreenModeGetSupportsColor);
  230.  
  231. WinDirectionType=(
  232. WinUp,
  233. WinDown,
  234. WinLeft,
  235. WinRight);
  236.  
  237. WinDrawOperation=(
  238. winPaint,
  239. winErase,
  240. winMask,
  241. winInvert,
  242. winOverlay,
  243. winPaintInverse,
  244. winSwap);
  245.  
  246. ScrollBarType = opaque;
  247. ScrollBarPtr = ^ScrollBarType;
  248.  
  249. DateTimeType = record
  250. second,minute,hour,day,month,year,weekDay:Int16;
  251. end;
  252. DateTimePtr = ^DateTimeType;
  253.  
  254. DateFormatType=(
  255. dfMDYWithSlashes, // 12/31/95
  256. dfDMYWithSlashes, // 31/12/95
  257. dfDMYWithDots, // 31.12.95
  258. dfDMYWithDashes, // 31-12-95
  259. dfYMDWithSlashes, // 95/12/31
  260. dfYMDWithDots, // 95.12.31
  261. dfYMDWithDashes, // 95-12-31
  262. dfMDYLongWithComma, // Dec 31, 1995
  263. dfDMYLong, // 31 Dec 1995
  264. dfDMYLongWithDot, // 31. Dec 1995
  265. dfDMYLongNoDay, // Dec 1995
  266. dfDMYLongWithComma, // 31 Dec, 1995
  267. dfYMDLongWithDot, // 1995.12.31
  268. dfYMDLongWithSpace, // 1995 Dec 31
  269. dfMYMed, // Dec '95
  270. dfMYMedNoPost); // Dec 95 (added for French 2.0 ROM)
  271.  
  272. TimeFormatType=(
  273. tfColon,
  274. tfColonAMPM, // 1:00 pm
  275. tfColon24h, // 13:00
  276. tfDot,
  277. tfDotAMPM, // 1.00 pm
  278. tfDot24h, // 13.00
  279. tfHoursAMPM, // 1 pm
  280. tfHours24h, // 13
  281. tfComma24h); // 13,00
  282.  
  283. SelectDayType=(
  284. selectDayByDay, // return d/m/y
  285. selectDayByWeek, // return d/m/y with d as same day of the week
  286. selectDayByMonth); // return d/m/y with d as same day of the month
  287.  
  288. SysBatteryKind=(
  289. sysBatteryKindAlkaline=0,
  290. sysBatteryKindNiCad,
  291. sysBatteryKindLiIon,
  292. sysBatteryKindRechAlk,
  293. sysBatteryKindNiMH,
  294. sysBatteryKindLiIon1400,
  295. sysBatteryKindLast=255); // insert new battery types BEFORE this one
  296.  
  297. DlkSyncStateType=(
  298. dlkSyncStateNeverSynced=0, // never synced
  299. dlkSyncStateInProgress, // sync is in progress
  300. dlkSyncStateLostConnection, // connection lost during sync
  301. dlkSyncStateLocalCan, // cancelled by local user on handheld
  302. dlkSyncStateRemoteCan, // cancelled by user from desktop
  303. dlkSyncStateLowMemoryOnTD, // sync ended due to low memory on handheld
  304. dlkSyncStateAborted, // sync was aborted for some other reason
  305. dlkSyncStateCompleted, // sync completed normally
  306. // Added in PalmOS v3.0:
  307. dlkSyncStateIncompatibleProducts); // sync ended because desktop HotSync product
  308. // is incompatible with this version
  309. // of the handheld HotSync
  310. LocalIDKind=(
  311. memIDPtr,
  312. memIDHandle);
  313.  
  314. FileInfoPtr = ^FileInfoType;
  315. FileInfoType = record
  316. attributes:UInt32;
  317. nameP:Pointer; // buffer to receive full name; pass NULL to avoid getting name
  318. nameBufLen:UInt16; // size of nameP buffer, in bytes
  319. end;
  320.  
  321. WinScreenAttrType=(
  322. winScreenWidth,
  323. winScreenHeight,
  324. winScreenRowBytes,
  325. winScreenDepth,
  326. winScreenAllDepths,
  327. winScreenDensity,
  328. winScreenPixelFormat,
  329. winScreenResolutionX,
  330. winScreenResolutionY);
  331.  
  332.  
  333. // Palm OS API calls
  334.  
  335. function BmpCreate(width,height:Coord;depth:UInt8;colortableP:pointer;var error:UInt16):BitmapPtr; inline(SYSTRAP,$A3DD);
  336.  
  337. procedure ClipboardAddItem(format:ClipboardFormatType;var ptr;length:UInt16); inline(SYSTRAP,$A10A);
  338. function ClipboardGetItem(format:ClipboardFormatType;var length:UInt16):MemHandle;inline(SYSTRAP,$A10C);
  339.  
  340. function CtlGetLabel(const controlP: ControlPtr):StringPtr; inline(SYSTRAP,$A113);
  341. function CtlGetValue(controlP:ControlPtr):UInt16;inline(SYSTRAP,$A111);
  342. function CtlNewControl(formP:FormPtr;objID:UInt16;style:Byte;const text:String;x,y,width,height:Coord;font:FontID;group:UInt8;leftAnchor:Boolean):ControlPtr; inline(SYSTRAP,$A32C);
  343. function CtlNewGraphicControl(formP:FormPtr;objID:UInt16;style:Byte;bitmapID,selectedBitmapID:UInt16;x,y,width,height:Coord;group:UInt8;leftAnchor:Boolean):ControlPtr; inline(SYSTRAP,$A3A9);
  344. procedure CtlSetLabel(controlP:ControlPtr;const newLabel:StringPtr); inline(SYSTRAP,$A114);
  345. procedure CtlSetValue(ControlP:ControlPtr;newValue:Int16); inline(SYSTRAP,$A112);
  346.  
  347. procedure DateToAscii(months,days:UInt8;years:UInt16;dateFormat:DateFormatType;var pString:String); inline(SYSTRAP,$A266);
  348.  
  349. function DlkGetSyncInfo(var succSyncDateP,lastSyncDateP:UInt32;var syncStateP:DlkSyncStateType;var nameBufP,logBufP:string;var logLenP:Int32):UInt16; inline(SYSTRAP,$A2A9);
  350.  
  351. function DmCloseDatabase(dbP:DmOpenRef):UInt16; inline(SYSTRAP,$A04A);
  352. function DmCreateDatabase(cardNo:UInt16;const name:String;c,t:UInt32;resDB:Boolean):UInt16; inline(SYSTRAP,$A041);
  353. function DmDatabaseInfo(cardNo:UInt16;dbID:LocalID;var name:String;var attributes,version:UInt16;var crDate,modDate,bkpUpDate,modNum:UInt32;var appInfoID,sortInfoID:LocalID;var t,c:UInt32):UInt16; inline(SYSTRAP,$A046);
  354. function DmDatabaseSize(cardNo:UInt16;dbID:LocalID;var numRecords,totalBytes,dataBytes:UInt32):Err; inline(SYSTRAP,$A048);
  355. function DmDeleteDatabase(cardNo:UInt16;dbID:LocalID):UInt16; inline(SYSTRAP,$A042);
  356. function DmFindDatabase(cardNo:UInt16;const name:String):LocalID; inline(SYSTRAP,$A045);
  357. function DmFindResource(dbP:DmOpenRef;ResType:UInt32;ResID:UInt16;resH:MemHandle):UInt16; inline(SYSTRAP,$A065);
  358. function DmGetDatabase(cardNo:UInt16;index:UInt16):LocalID; inline(SYSTRAP,$A044);
  359. function DmGetNextDatabaseByTypeCreator(newSearch:Boolean;var stateInfo:DmSearchStateType;t,c:UInt32;onlyLastVers:Boolean;var cardNo:UInt16;var dbIDP:LocalID):UInt16; inline(SYSTRAP,$A078);
  360. function DmGetRecord(dbP:DmOpenRef;index:UInt16):MemHandle; inline(SYSTRAP,$A05C);
  361. function DmGetResource(typ:UInt32;resID:UInt16):Memhandle; inline(SYSTRAP,$A05F);
  362. function DmGetResourceIndex(dbP:DmOpenRef;index:UInt16):MemHandle; inline(SYSTRAP,$A06E);
  363. function DmGet1Resource(resType: UInt32;resID: UInt16): MemHandle; inline(SYSTRAP,$A060);
  364. function DmNewRecord(dbP:DmOpenRef;var at:UInt16;size:UInt32):MemHandle; inline(SYSTRAP,$A055);
  365. function DmNewResource(dbP:DmOpenRef;ResType:UInt32;ResID:UInt16;size:UInt32):MemHandle; inline(SYSTRAP,$A06C);
  366. function DmNumDatabases(cardNo:UInt16):UInt16;inline(SYSTRAP,$A043);
  367. function DmNumRecords(dbP:DmOpenRef):UInt16; inline(SYSTRAP,$A04F);
  368. function DmNumRecordsInCategory(dbP:DmOpenRef;category:UInt16):UInt16; inline(SYSTRAP,$A071);
  369. function DmNumResources(dbP:DmOpenRef):UInt16; inline(SYSTRAP,$A067);
  370. function DmOpenDatabase(cardNo:UInt16;dbID:LocalID;mode:UInt16):DmOpenRef; inline(SYSTRAP,$A049);
  371. function DmOpenDatabaseByTypeCreator(typo,creator:UInt32;mode:UInt16):DmOpenRef; inline(SYSTRAP,$A075);
  372. function DmOpenDatabaseInfo(dbP:DmOpenRef;var dbIDP:LocalID;var openCountP,modeP,cardNoP:UInt16; var resDBP: Boolean):Err; inline(SYSTRAP,$A04C);
  373. function DmQueryRecord(dbP:DmOpenRef;index:UInt16):MemHandle; inline(SYSTRAP,$A05B);
  374. function DmRecordInfo(dbP:DmOpenRef;index:UInt16;var attrP:UInt16;var uniqueIDP:UInt32;var chunkIDP:LocalID):Err; inline(SYSTRAP,$A050);
  375. function DmReleaseRecord(dbP:DmOpenRef;index:UInt16;dirty:Boolean):UInt16; inline(SYSTRAP,$A05E);
  376. function DmReleaseResource(resourceH:MemHandle):Err; inline(SYSTRAP,$A061);
  377. function DmRemoveRecord(dbP:DmOpenRef;index:UInt16):Err; inline(SYSTRAP,$A056);
  378. function DmRemoveResource(dbP:DmOpenRef;index:UInt16):Err; inline(SYSTRAP,$A06D);
  379. function DmResourceInfo(dbP:DmOpenRef;index:UInt16;var ResTypeP:UInt32;var ResID:UInt16;var chunkLocalIDP:LocalID):Err; inline(SYSTRAP,$A068);
  380. function DmSet(rec:Pointer;offset:UInt32;bytes:UInt32;value:UInt8):UInt16; inline(SYSTRAP,$A07E);
  381. function DmSetDatabaseInfo(cardNo:UInt16;dbID:LocalID;const name:String;var attributes,version:UInt16;var crDate,modDate,bkpUpDate,modNum:UInt32;var appInfoID,sortInfoID:LocalID;var t,c:UInt32):UInt16; inline(SYSTRAP,$A047);
  382. function DmWrite(recordP:Pointer;offset:UInt32;srcP:Pointer;bytes:UInt32):UInt16; inline(SYSTRAP,$A076);
  383.  
  384. procedure EvtGetEvent(var event:EventType;timeout:UInt32); inline(SYSTRAP,$A11D);
  385.  
  386. procedure FldDrawField(fldP:FieldPtr); inline(SYSTRAP,$A135);
  387. procedure FldGetAttributes(fldP:FieldPtr;var attrP:UInt16); inline(SYSTRAP,$A14F);
  388. function FldGetTextHandle(fldP:FieldPtr):MemHandle;inline(SYSTRAP,$A153);
  389. function FldGetTextLength(fldP:FieldPtr):UInt16;inline(SYSTRAP,$A14B);
  390. function FldGetTextPtr(fldP:FieldPtr):StringPtr; inline(SYSTRAP,$A139);
  391. function FldNewField(formP:FormPtr;ObjID:UInt16;x,y,width,height:Coord;font:FontID;maxChars:UInt32;editable:Boolean;underlined:UnderlineModeType;singleLine,dynamicSize:Boolean;justification:Byte;autoShift,hasScrollBar,numeric:Boolean):FieldPtr; inline(SYSTRAP,$A32D);
  392. procedure FldSetAttributes(fldP:FieldPtr;var attrP:UInt16); inline(SYSTRAP,$A150);
  393. procedure FldSetSelection(fldP:FieldPtr;startPosition,endPosition:UInt16); inline(SYSTRAP,$A142);
  394. procedure FldSetTextHandle(fldP:FieldPtr;textHandle:MemHandle); inline(SYSTRAP,$A158);
  395.  
  396. procedure FntCharsInWidth(const Chars:String;var stringWidthP,stringLengthP:Int16;var fitWithinWidth:Boolean); inline(SYSTRAP,$A16D);
  397. function FntCharsWidth(const Chars:String;Len:Int16):Int16; inline(SYSTRAP,$A16B);
  398. function FntDefineFont(font:FontID;fontP:pointer):UInt16; inline(SYSTRAP,$A321);
  399. function FntGetFont:FontID; inline(SYSTRAP,$A163);
  400. function FntSetFont(font:FontID):FontID; inline(SYSTRAP,$A164);
  401. function FontSelect(font:FontID):FontID; inline(SYSTRAP,$A320);
  402.  
  403. function FrmAlert(alertId:UInt16):UInt16; inline(SYSTRAP,$A192);
  404. procedure FrmCloseAllForms;inline(SYSTRAP,$A1A1);
  405. procedure FrmCopyLabel(FormP:FormPtr;labelID:UInt16;Const newLabel:String); inline(SYSTRAP,$A18C);
  406. function FrmCustomAlert(alertId:UInt16;const s1,s2,s3:String):UInt16; inline(SYSTRAP,$A194);
  407. procedure FrmDeleteForm(FormP:FormPtr); inline(SYSTRAP,$A170);
  408. function FrmDispatchEvent(var event:EventType):Boolean; inline(SYSTRAP,$A1A0);
  409. function FrmDoDialog(formP:FormPtr):UInt16; inline(SYSTRAP,$A193);
  410. procedure FrmDrawForm(FormP:FormPtr); inline(SYSTRAP,$A171);
  411. procedure FrmEraseForm(FormP:FormPtr); inline(SYSTRAP,$A172);
  412. function FrmGetActiveForm:FormPtr; inline(SYSTRAP,$A173);
  413. function FrmGetFocus(formP:FormPtr):UInt16;inline(SYSTRAP,$A178);
  414. function FrmGetFormId(const formP:FormPtr):UInt16; inline(SYSTRAP,$A17D);
  415. function FrmGetFormPtr(formId:UInt16):FormPtr; inline(SYSTRAP,$A17E);
  416. function FrmGetLabel(formP:FormPtr;labelID:UInt16):StringPtr; inline(SYSTRAP,$A18E);
  417. procedure FrmGetObjectBounds(formP:FormPtr;objIndex:UInt16;var r:RectangleType); inline(SYSTRAP,$A199);
  418. function FrmGetObjectId(formP:FormPtr;objIndex:UInt16):UInt16; inline(SYSTRAP,$A181);
  419. function FrmGetObjectIndex(formP:FormPtr;objID:UInt16):UInt16; inline(SYSTRAP,$A180);
  420. function FrmGetObjectPtr(formP:FormPtr;objIndex:UInt16):pointer; inline(SYSTRAP,$A183);
  421. procedure FrmGotoForm(FormID:UInt16); inline(SYSTRAP,$A19B);
  422. function FrmHandleEvent(formP:FormPtr;var event:EventType):Boolean; inline(SYSTRAP,$A17A);
  423. procedure FrmHelp(helpMsgId:UInt16); inline(SYSTRAP,$A195);
  424. procedure FrmHideObject(formP:FormPtr;objIndex:UInt16); inline(SYSTRAP,$A184);
  425. function FrmInitForm(rscID:UInt16):FormPtr; inline(SYSTRAP,$A16F);
  426. function FrmNewLabel(formP:FormPtr;objID:UInt16;const textP:String;x,y:Coord;font:FontID):ControlPtr; inline(SYSTRAP,$A32F);
  427. procedure FrmPopupForm(formId:UInt16); inline(SYSTRAP,$A19C);
  428. function FrmRemoveObject(formP:FormPtr;objIndex:UInt16):Err; inline(SYSTRAP,$A345);
  429. procedure FrmReturnToForm(formId:UInt16); inline(SYSTRAP,$A19E);
  430. procedure FrmSetActiveForm(FormP:FormPtr); inline(SYSTRAP,$A174);
  431. procedure FrmSetControlGroupSelection(formP:FormPtr;groupNum:UInt8;controlID:UInt16); inline(SYSTRAP,$A18B);
  432. procedure FrmSetControlValue(formP:FormPtr;objIndex:UInt16;newValue:UInt16); inline(SYSTRAP,$A189);
  433. procedure FrmSetEventHandler(FormP:FormPtr;function handler(var event:Eventtype):Boolean); inline(SYSTRAP,$A19F);
  434. procedure FrmSetFocus(formP:FormPtr;fieldIndex:UInt16);inline(SYSTRAP,$A179);
  435. procedure FrmSetObjectBounds(formP:FormPtr;objIndex:UInt16;var r:RectangleType); inline(SYSTRAP,$A303);
  436. procedure FrmSetObjectPosition(FormP:FormPtr;objIndex:UInt16;x,y:Coord); inline(SYSTRAP,$A187);
  437. procedure FrmSetTitle(formP:FormPtr;const newTitle:string);inline(SYSTRAP,$A191);
  438. procedure FrmShowObject(formP:FormPtr;objIndex:UInt16); inline(SYSTRAP,$A185);
  439.  
  440. function FtrGet(creator:UInt32;featureNum:UInt16;var valueP:UInt32):Err; inline(SYSTRAP,$A27B);
  441.  
  442. function GetCharCaselessValue:pointer; inline(SYSTRAP,$A296);
  443.  
  444. Procedure GsiInitialize; inline(SYSTRAP,$A29B);
  445. Procedure GsiSetLocation(x,y:Int16); inline(SYSTRAP,$A29C);
  446. Procedure GsiEnable(enableIt:Boolean); inline(SYSTRAP,$A29D);
  447. Function GsiEnabled:Boolean; inline(SYSTRAP,$A29E);
  448. Procedure GsiSetShiftState(lockFlags,tempShift:UInt16); inline(SYSTRAP,$A29F);
  449.  
  450. procedure InsPtEnable(enableIt:Boolean); inline(SYSTRAP,$A1AB);
  451. procedure InsPtSetHeight(Height:Int16); inline(SYSTRAP,$A1AD);
  452. procedure InsPtSetLocation(x,y:Int16); inline(SYSTRAP,$A1A9);
  453.  
  454. function KeyCurrentState:UInt32;inline(SYSTRAP,$A2A2);
  455.  
  456. procedure LstDrawList(ListP:ListPtr);inline(SYSTRAP,$A1B1);
  457. procedure LstEraseList(ListP:ListPtr);inline(SYSTRAP,$A1B2);
  458. function LstGetNumberOfItems(ListP:ListPtr):Int16;inline(SYSTRAP,$A1BA);
  459. function LstGetSelection(ListP:ListPtr):Int16; inline(SYSTRAP,$A1B3);
  460. function LstGetSelectionText(ListP:ListPtr;intemNum:Int16):StringPtr; inline(SYSTRAP,$A1B4);
  461. function LstGetVisibleItems(ListP:ListPtr):Int16;inline(SYSTRAP,$A2FF);
  462. procedure LstMakeItemVisible(ListP:ListPtr;itemNum:Int16); inline(SYSTRAP,$A0B9);
  463. function LstNewList(formP:FormPtr;id:UInt16;x,y,width,height:Coord;font:FontID;visibleItems,triggerId:Int16):Err; inline(SYSTRAP,$A32E);
  464. function LstPopupList(listP:ListPtr):Int16; inline(SYSTRAP,$A1BB);
  465. function LstScrollList(ListP:ListPtr;direction:WinDirectionType;itemCount:Int16):Boolean;inline(SYSTRAP,$A2FB);
  466. procedure LstSetListChoices(listP:ListPtr;itemsText:Pointer;numItems:Int16); inline(SYSTRAP,$A1B8);
  467. procedure LstSetSelection(ListP:ListPtr;itemNum:Int16); inline(SYSTRAP,$A1B7);
  468. procedure LstSetTopItem(ListP:ListPtr;itemNum:Int16);inline(SYSTRAP,$A2B5);
  469.  
  470. function MemCardInfo(cardNo:UInt16;var cardNameP,manufNameP:String;var versionP:UInt16;var crDateP,romSizeP,ramSizeP,freeBytesP:UInt32):Err; inline(SYSTRAP,$A004);
  471. function MemHandleFree(h: MemHandle):UInt16; inline(SYSTRAP,$A02B);
  472. function MemHandleLock(h:MemHandle):MemPtr; inline(SYSTRAP,$A021);
  473. function MemHandleNew(size:UInt32):MemHandle;inline(SYSTRAP,$A01E);
  474. function MemHandleSize(h:MemHandle):UInt32; inline(SYSTRAP,$A02D);
  475. function MemHandleUnlock(h:MemHandle):UInt16; inline(SYSTRAP,$A022);
  476. function MemHeapDynamic(heapID:UInt16):Boolean; inline(SYSTRAP,$A03E);
  477. function MemHeapFlags(heapID:UInt16):UInt16; inline(SYSTRAP,$A00D);
  478. function MemHeapFreeBytes(heapID:UInt16;var freeP,maxP:UInt32):Err; inline(SYSTRAP,$A00B);
  479. function MemHeapID(cardNo,heapIndex:UInt16):UInt16; inline(SYSTRAP,$A009);
  480. function MemHeapSize(heapID:UInt16):UInt32; inline(SYSTRAP,$A00C);
  481. function MemLocalIDKind(local:LocalID):LocalIDKind; inline(SYSTRAP,$A024);
  482. function MemLocalIDToPtr(local:LocalID;cardNo:UInt16):Pointer; inline(SYSTRAP,$A025);
  483. procedure MemMove(var dst,s;numBytes:Int32); inline(SYSTRAP,$A026);
  484. function MemNumCards:UInt16; inline(SYSTRAP,$A03A);
  485. function MemNumHeaps(cardNo:UInt16):UInt16; inline(SYSTRAP,$A007);
  486. function MemPtrFree(p:MemPtr):UInt16; inline(SYSTRAP,$A012);
  487. function MemPtrHeapID(p:Pointer):UInt16; inline(SYSTRAP,$A018);
  488. function MemPtrNew(size:UInt32):MemPtr; inline(SYSTRAP,$A013);
  489. function MemPtrSetOwner(p:MemPtr;owner:UInt16):UInt16; inline(SYSTRAP,$A01B);
  490. procedure MemSet(var dst;numBytes:integer;value:UInt8); inline(SYSTRAP,$A027);
  491.  
  492. procedure MenuEraseStatus(menuP:Pointer); inline(SYSTRAP,$A1C1);
  493. function MenuHandleEvent(menuP:Pointer;var event:EventType;var error:UInt16):Boolean; inline(SYSTRAP,$A1BF);
  494.  
  495. function PrefGetAppPreferences(creator:UInt32;id:UInt16;var prefs;var prefsSize:UInt16;saved:Boolean):Int16; inline(SYSTRAP,$A2D3);
  496. procedure PrefSetAppPreferences(creator:UInt32;id,version:UInt16;var prefs;prefsSize:UInt16;saved:Boolean); inline(SYSTRAP,$A2D4);
  497.  
  498. function RctPtInRectangle(x,y:Coord;var r:RectangleType):Boolean; inline(SYSTRAP,$A1C8);
  499. procedure RctSetRectangle(var r:RectangleType;left,top,width,height:Coord); inline(SYSTRAP,$A1C4);
  500.  
  501. procedure SclSetScrollBar(barP:ScrollBarPtr;value,min,max,pageSize:Int16); inline(SYSTRAP,$A2B6);
  502.  
  503. function SelectDay(selectDayBy:SelectDayType;var month,day,year:Int16;Const title:String):Boolean; inline(SYSTRAP,$A2D0);
  504. function SelectOneTime(var hour,minute:Int16;Const title:String):Boolean; inline(SYSTRAP,$A34F);
  505.  
  506. procedure SndPlaySystemSound(beepID:Int8); inline(SYSTRAP,$A234);
  507.  
  508. function StrAToI(const S:string):integer; inline(SYSTRAP,$a0ce);
  509. function StrCaselessCompare(const s1,s2:string):Int16; inline(SYSTRAP,$A0CA);
  510. procedure StrCopy(dst:MemPtr;const src:String); inline(SYSTRAP,$A0C5);
  511. procedure StrIToA(var S:string;N:integer); inline(SYSTRAP,$A0C9);
  512. function StrIToH(var s:String;i:UInt32):StringPtr; inline(SYSTRAP,$A0CB);
  513. procedure StrNCopy(var dst:String;src:MemPtr;n:Int16); inline(SYSTRAP,$A2CE);
  514. function StrStr(const str,token:String):Pointer; inline(SYSTRAP,$A0CD);
  515.  
  516. function SysBatteryInfo(doSet:Boolean;var warnThresholdP,criticalThresholdP:UInt16;var maxTicksP:Int16;var kindP:SysBatteryKind;var pluggedIn:Boolean;var percentP:UInt8):UInt16; inline(SYSTRAP,$A324);
  517. function SysCurAppDatabase(var cardNo:UInt16;var dbID:LocalID):UInt16; inline(SYSTRAP,$A0AC);
  518. function SysFormPointerArrayToStrings(c:Pointer;StringCount:Int16):MemHandle; inline(SYSTRAP,$A0C1);
  519. function SysHandleEvent(var event:EventType):Boolean; inline(SYSTRAP,$A0A9);
  520. function SysTaskDelay(delay:Int32):Err; inline(SYSTRAP,$A0A0);
  521. function SysTicksPerSecond:UInt16; inline(SYSTRAP,$A2E9);
  522. function SysUIAppSwitch(cardNo:UInt16;dbID:LocalID;cmd:UInt16;cmdPBP:Pointer):UInt16; inline(SYSTRAP,$A0A7);
  523.  
  524. Procedure TimeToAscii(hours,minutes:UInt8;timeFormat:TimeFormatType;var pString:String); inline(SYSTRAP,$A268);
  525.  
  526. function TimGetSeconds:UInt32; inline(SYSTRAP,$A0F5);
  527. function TimGetTicks:UInt32; inline(SYSTRAP,$A0F7);
  528. procedure TimSecondsToDateTime(seconds:UInt32;dateTimeP:DateTimePtr); inline(SYSTRAP,$A0FC);
  529.  
  530. function UIPickColor(var indexP:IndexedColorType;var rgbP:RGBColorType;start:UInt16;const titleP,tipP:String):Boolean; inline(SYSTRAP,$A3AC);
  531.  
  532. function WinCreateBitmapWindow(bitmapP:BitmapPtr;var error:UInt16):WinHandle; inline(SYSTRAP,$A3E4);
  533. procedure WinDeleteWindow(win:WinHandle;eraseIt:boolean); inline(SYSTRAP,$A1F8);
  534. procedure WinDrawBitmap(bitmapP:BitmapPtr;x,y:Coord); inline(SYSTRAP,$A226);
  535. procedure WinDrawChars(const chars:string;len:Int16;x,y:Coord); inline(SYSTRAP,$A220);
  536. procedure WinDrawChar(theChar:WChar;x,y:Coord); inline(SYSTRAP,$A350);
  537. procedure WinDrawLine(x1,y1,x2,y2:Coord); inline(SYSTRAP,$A213);
  538. procedure WinDrawRectangle(var r:RectangleType;cornerDiam:UInt16); inline(SYSTRAP,$A218);
  539. procedure WinDrawRectangleFrame(frame:FrameType;var rP:RectangleType); inline(SYSTRAP,$A21B);
  540. procedure WinDrawTruncChars(const chars:String;len:Int16;x,y,maxWidth:Coord); inline(SYSTRAP,$A351);
  541. procedure WinEraseLine(x1,y1,x2,y2:Coord); inline(SYSTRAP,$A215);
  542. procedure WinEraseRectangle(var r:RectangleType;cornerDiam:UInt16); inline(SYSTRAP,$A219);
  543. procedure WinEraseRectangleFrame(frame:FrameType;var rP:RectangleType); inline(SYSTRAP,$A21D);
  544. procedure WinIndexToRGB(i:IndexedColorType;var rgbP:RGBColorType); inline(SYSTRAP,$A39F);
  545. procedure WinPopDrawState; inline(SYSTRAP,$A396);
  546. procedure WinPushDrawState; inline(SYSTRAP,$A395);
  547. function WinRGBToIndex(var rgbP:RGBColorType):IndexedColorType; inline(SYSTRAP,$A39E);
  548. function WinScreenMode(operation:WinScreenModeOperation;var widthP,heightP,depthP:UInt32;var enableColorP:Boolean):Err; inline(SYSTRAP,$A33E);
  549. function WinSetDrawWindow(win:WinHandle):WinHandle; inline(SYSTRAP,$A1FD);
  550. function WinSetForeColor(foreColor:IndexedColorType):IndexedColorType; inline(SYSTRAP,$A398);
  551. function WinSetBackColor(foreColor:IndexedColorType):IndexedColorType; inline(SYSTRAP,$A399);
  552. function WinSetTextColor(foreColor:IndexedColorType):IndexedColorType; inline(SYSTRAP,$A39A);
  553. function WinSetDrawMode(newMode:WinDrawOperation):WinDrawOperation; inline(SYSTRAP,$A397);
  554.  
  555. // VFS functions
  556. function VFSDirEntryEnumerate(dirRef:UInt32;var dirEntryIteratorP:UInt32;var infoP:FileInfoType):Err; inline($7414,SYSTRAP,VFS_TRAP);
  557. function VFSFileClose(fileRefP:UInt32):Err; inline($7404,SYSTRAP,VFS_TRAP);
  558. function VFSFileOpen(volRefNum:UInt16;pathNameP:Pointer;openMode:UInt16;var fileRefP:UInt32):Err; inline($7403,SYSTRAP,VFS_TRAP);
  559. function VFSFileSize(fileRefP:UInt32;var fileSizeP:UInt32):Err; inline($7412,SYSTRAP,VFS_TRAP);
  560. function VFSVolumeEnumerate(var volRefNumP:UInt16;var volIteratorP:UInt32):Err; inline($741B,SYSTRAP,VFS_TRAP);
  561. function VFSVolumeGetLabel(volRefNum:UInt16;const labelP:String;bufLen:UInt16):Err; inline($741D,SYSTRAP,VFS_TRAP);
  562. function VFSVolumeSize(volRefNum:UInt16;var volumeUsedP:UInt32;var volumeTotalP:UInt32):Err; inline($741F,SYSTRAP,VFS_TRAP);
  563.  
  564. // HighRes functions
  565. function WinScreenGetAttribute(selector:WinScreenAttrType;var attrP:UInt32):Err; inline($740E,SYSTRAP,HIGH_DENSITY_TRAP);
  566.  
  567.  
  568. // Special Functions
  569.  
  570. const
  571. V100 = $0100;
  572. V200 = $0200;
  573. V300 = $0300;
  574. V310 = $0310;
  575. V320 = $0320;
  576. V330 = $0330;
  577. V350 = $0350;
  578. V400 = $0400;
  579. V410 = $0410;
  580. V500 = $0500;
  581.  
  582. function VersionSupported(MinVersion:UInt32):boolean;
  583. var
  584. ErrNo:Err;
  585. ROMVersion:UInt32;
  586. begin
  587. ErrNo:=FtrGet(sysFtrCreator,1,ROMVersion);
  588. VersionSupported:=ROMVersion>=MinVersion*$10000;
  589. end;
  590.  
  591. function HandlerNONE(var e:EventType):boolean;
  592. // Needed for Palm OS < v3
  593. begin
  594. HandlerNONE:=false;
  595. end;