PalmAPI.pas

Un article de Wikipedia.

(Différences entre les versions)

Ziglooadmin (Discuter | Contributions)
(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...)
Différence suivante →

Version du 11 mars 2008 à 12:08

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