palmcompatibility.pp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. {$MACRO ON}
  2. {$define Rsc := }
  3. (******************************************************************************
  4. *
  5. * Copyright (c) 1994-2000 Palm, Inc. or its subsidiaries.
  6. * All rights reserved.
  7. *
  8. * File: PalmCompatibility.h
  9. *
  10. * Release: Palm OS SDK 4.0 (63220)
  11. *
  12. * Description:
  13. * Type & macro definitions for compile-time compatibility between
  14. * old and new header files.
  15. *
  16. * History:
  17. * 4/26/99 BRM Created.
  18. * 99-10-22 jwm Added old-style data types.
  19. * 10/23/99 jmp Added more win-to-scr-oriented aliases.
  20. * 99-10-26 jwm Added old-style nWORD_INLINE macros.
  21. * 11/23/99 jmp Added ScrDisplayModeOperation-to-WinScreenModeOperation
  22. * definitions by request from Tool team.
  23. * 05/03/00 CS Added LanguageType..countryCount, which have been
  24. * subsumed by typedefs and #defines in new Locale Manager.
  25. * 05/16/00 CS LmCountryType/LmLanguageType are now back to
  26. * CountryType/LanguageType.
  27. * CS Added #defines for deprecated countryNameLength,
  28. * currencyNameLength, and currencySymbolLength,
  29. * although nobody seems to be using them anyway.
  30. * 05/30/00 kwk Added missing #ifndef __PALMCOMPATIBILITY_H__
  31. * 05/31/00 CS Redefined languageFirst..countryCount so that they'll
  32. * take on their original values, rather than the new
  33. * ISO sets, which don't all correspond to entries in
  34. * either the old country or new locale settings resources.
  35. * 10/04/00 kwk Fixed up countryCount macro - countryLast was countrylast.
  36. * 11/13/00 sjm Added deprecated expansion manager names.
  37. *
  38. *****************************************************************************)
  39. unit palmcompatibility;
  40. interface
  41. uses palmos, localemgr, palmlocale, window, fslib;
  42. // The data types Byte, Word, DWord and so on are now deprecated. We
  43. // recommend that you use the corresponding new data types: for example,
  44. // use Int16 instead of SWord and UInt32 instead of DWord. In particular,
  45. // the unfortunate distinction between Handle/VoidHand has been fixed:
  46. // use MemHandle instead.
  47. type
  48. SByte = Int8;
  49. SWord = Int16;
  50. Word = UInt16;
  51. SDWord = Int32;
  52. DWord = UInt32;
  53. // Logical data types
  54. SChar= Int8;
  55. UChar = UInt8;
  56. Short = Int16;
  57. UShort = UInt16;
  58. Int = Int16;
  59. UInt = UInt16;
  60. Long = Int32;
  61. ULong = UInt32;
  62. // Pointer Types
  63. VoidPtr = MemPtr;
  64. VoidHand = MemHandle;
  65. Ptr = MemPtr;
  66. Handle = MemHandle;
  67. // Because "const BytePtr" means "const pointer to Byte" rather than "pointer
  68. // to const Byte", all these XXXXPtr types are deprecated: you're better off
  69. // just using "Byte *" and so on. (Even better, use "UInt8 *"!)
  70. SBytePtr = ^SByte;
  71. BytePtr = ^Byte;
  72. SWordPtr = ^SWord;
  73. WordPtr = ^Word;
  74. UInt16Ptr = ^UInt16;
  75. SDWordPtr = ^SDWord;
  76. DWordPtr = ^DWord;
  77. // Logical data types
  78. BooleanPtr = ^Boolean;
  79. CharPtr = ^Char;
  80. SCharPtr = ^SChar;
  81. UCharPtr = ^UChar;
  82. WCharPtr = ^WChar;
  83. ShortPtr = ^Short;
  84. UShortPtr = ^UShort;
  85. IntPtr = ^Int;
  86. UIntPtr = ^UInt;
  87. LongPtr = ^Long;
  88. ULongPtr = ^ULong;
  89. // Instead of indexing through countries and languages, developers should call
  90. // the Locale Manager to index through known locales:
  91. const
  92. languageFirst = lEnglish; // From Preferences.pas
  93. languageLast = lDutch; // From Preferences.pas
  94. languageCount = languageLast - languageFirst + 1; // From Preferences.pas
  95. countryFirst = cAustralia; // From Preferences.pas
  96. countryLast = cTaiwan; // From Preferences.pas
  97. countryCount = countryLast - countryFirst + 1; // From Preferences.pas
  98. // Incorporated into the Locale Manager:
  99. countryNameLength = kMaxCountryNameLen + 1; // From Preferences.pas
  100. currencyNameLength = kMaxCurrencyNameLen + 1; // From Preferences.pas
  101. currencySymbolLength = kMaxCurrencySymbolLen + 1; // From Preferences.pas
  102. (********************************************************************
  103. *
  104. * Deprecated screen stuff
  105. *
  106. ********************************************************************)
  107. const
  108. scrCopy = winPaint;
  109. scrAND = winErase;
  110. scrANDNOT = winMask;
  111. scrXOR = winInvert;
  112. scrOR = winOverlay;
  113. scrCopyNOT = winPaintInverse;
  114. scrDisplayModeGetDefaults = winScreenModeGetDefaults;
  115. scrDisplayModeGet = winScreenModeGet;
  116. scrDisplayModeSetToDefaults = winScreenModeSetToDefaults;
  117. scrDisplayModeSet = winScreenModeSet;
  118. scrDisplayModeGetSupportedDepths = winScreenModeGetSupportedDepths;
  119. scrDisplayModeGetSupportsColor = winScreenModeGetSupportsColor;
  120. // ScrOperation = WinDrawOperation;
  121. // ScrDisplayMode(op, widthP, heightP, depthP, enableColorP) WinScreenMode(op, widthP, heightP, depthP, enableColorP)
  122. // ScrInit() WinScreenInit()
  123. (********************************************************************
  124. *
  125. * Deprecated resource ids
  126. *
  127. ********************************************************************)
  128. // Resources with system ids (>= 10000) are subject to change, and
  129. // should _not_ be relied upon.
  130. // System date string resources. You should use DateTemplateToAscii
  131. // (Palm OS 3.5 or later) or DateGlueTemplateToAscii (backwards
  132. // compatible) instead of these resources.
  133. const
  134. daysOfWeekStrID = 10000;
  135. dayFullNamesStrID = 10001;
  136. monthNamesStrID = 10002;
  137. monthFullNamesStrID = 10003;
  138. // More system date string resources, introduced in Palm OS 3.5. If you use
  139. // these, you are limiting yourself to running on nothing earlier than 3.5,
  140. // so you likely might as well use DateTempalateToAscii instead.
  141. daysOfWeekShortStrListID = 10200;
  142. daysOfWeekStdStrListID = 10201;
  143. daysOfWeekLongStrListID = 10202;
  144. monthNamesShortStrListID = 10203;
  145. monthNamesStdStrListID = 10204;
  146. monthNamesLongStrListID = 10205;
  147. // The country table resource has changed between versions, and is
  148. // now completely obsolete. Use LmGetLocaleSetting (4.0 or later)
  149. // or LmGlueGetLocaleSetting instead of this resource.
  150. sysResTCountries = Rsc('cnty');
  151. sysResIDCountries = 10000;
  152. (********************************************************************
  153. *
  154. * Deprecated Expansion Manager names
  155. *
  156. ********************************************************************)
  157. // Expansion Manager
  158. {!!!
  159. invalidSlotRefNum = expInvalidSlotRefNum;
  160. expErrInvalidSlotRefNumber = expErrInvalidSlotRefNum;
  161. ExpMediaType_Any = expMediaType_Any;
  162. ExpMediaType_MemoryStick = expMediaType_MemoryStick;
  163. ExpMediaType_CompactFlash = expMediaType_CompactFlash;
  164. ExpMediaType_SecureDigital = expMediaType_SecureDigital;
  165. ExpMediaType_MultiMediaCard = expMediaType_MultiMediaCard;
  166. ExpMediaType_SmartMedia = expMediaType_SmartMedia;
  167. ExpMediaType_RAMDisk = expMediaType_RAMDisk;
  168. ExpMediaType_PoserHost = expMediaType_PoserHost;
  169. ExpMediaType_MacSim = expMediaType_MacSim;
  170. // VFS Manager:
  171. // VFSMountClass_SlotDriver = vfsMountClass_SlotDriver;
  172. // VFSMountClass_Simulator = vfsMountClass_Simulator;
  173. fsOriginBeginning = vfsOriginBeginning;
  174. fsOriginCurrent = vfsOriginCurrent;
  175. fsOriginEnd = vfsOriginEnd;
  176. fsFilesystemType_VFAT = vfsFilesystemType_VFAT;
  177. fsFilesystemType_FAT = vfsFilesystemType_FAT;
  178. fsFilesystemType_NTFS = vfsFilesystemType_NTFS;
  179. fsFilesystemType_HFSPlus = vfsFilesystemType_HFSPlus;
  180. fsFilesystemType_HFS = vfsFilesystemType_HFS;
  181. fsFilesystemType_MFS = vfsFilesystemType_MFS;
  182. fsFilesystemType_EXT2 = vfsFilesystemType_EXT2;
  183. fsFilesystemType_FFS = vfsFilesystemType_FFS;
  184. fsFilesystemType_NFS = vfsFilesystemType_NFS;
  185. fsFilesystemType_AFS = vfsFilesystemType_AFS;
  186. fsFilesystemType_Novell = vfsFilesystemType_Novell;
  187. fsFilesystemType_HPFS = vfsFilesystemType_HPFS;
  188. VFSFileAttributesGet = VFSFileGetAttributes;
  189. VFSFileAttributesSet = VFSFileSetAttributes;
  190. VFSFileDateGet = VFSFileGetDate;
  191. VFSFileDateSet = VFSFileSetDate;
  192. VFSVolumeLabelGet = VFSVolumeGetLabel;
  193. VFSVolumeLabelSet = VFSVolumeSetLabel;
  194. // FSLib:
  195. FS_LIB_APIVersion = fsLibAPIVersion;
  196. FSFileAttributesGet = FSFileGetAttributes;
  197. FSFileAttributesSet = FSFileSetAttributes;
  198. FSFileDateGet = FSFileGetDate;
  199. FSFileDateSet = FSFileSetDate;
  200. FSVolumeLabelGet = FSVolumeGetLabel;
  201. FSVolumeLabelSet = FSVolumeSetLabel;
  202. // SlotDrvrLib:
  203. SlotDrvr_LIB_APIVersion = slotDrvrAPIVersion;
  204. Slot_SECTOR_SIZE = slotSectorSize;
  205. }
  206. implementation
  207. end.