PMDefinitions.pas 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. {
  2. File: PMDefinitions.p
  3. Contains: Carbon Printing Manager Interfaces.
  4. Version: Technology: Mac OS X
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1998-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit PMDefinitions;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MacErrors,CFString;
  92. {$ALIGN MAC68K}
  93. { Printing objects }
  94. type
  95. PMObject = Ptr;
  96. PMDialog = ^SInt32; { an opaque 32-bit type }
  97. PMDialogPtr = ^PMDialog; { when a var xx:PMDialog parameter can be nil, it is changed to xx: PMDialogPtr }
  98. PMPrintSettings = ^SInt32; { an opaque 32-bit type }
  99. PMPrintSettingsPtr = ^PMPrintSettings; { when a var xx:PMPrintSettings parameter can be nil, it is changed to xx: PMPrintSettingsPtr }
  100. PMPageFormat = ^SInt32; { an opaque 32-bit type }
  101. PMPageFormatPtr = ^PMPageFormat; { when a var xx:PMPageFormat parameter can be nil, it is changed to xx: PMPageFormatPtr }
  102. PMPrintContext = ^SInt32; { an opaque 32-bit type }
  103. PMPrintContextPtr = ^PMPrintContext; { when a var xx:PMPrintContext parameter can be nil, it is changed to xx: PMPrintContextPtr }
  104. PMPrintSession = ^SInt32; { an opaque 32-bit type }
  105. PMPrintSessionPtr = ^PMPrintSession; { when a var xx:PMPrintSession parameter can be nil, it is changed to xx: PMPrintSessionPtr }
  106. PMPrinter = ^SInt32; { an opaque 32-bit type }
  107. PMPrinterPtr = ^PMPrinter; { when a var xx:PMPrinter parameter can be nil, it is changed to xx: PMPrinterPtr }
  108. const
  109. kPMCancel = $0080; { user hit cancel button in dialog }
  110. kPMNoData = nil; { for general use }
  111. kPMDontWantSize = nil; { for parameters which return size information }
  112. kPMDontWantData = nil; { for parameters which return data }
  113. kPMDontWantBoolean = nil; { for parameters which take a boolean reference }
  114. kPMNoReference = nil; { for parameters which take an address pointer }
  115. { for parameters which take a PrintSettings reference }
  116. kPMNoPrintSettings = nil;
  117. { for parameters which take a PageFormat reference }
  118. kPMNoPageFormat = nil;
  119. { for parameters which take a Server reference }
  120. kPMServerLocal = nil;
  121. type
  122. PMDestinationType = UInt16;
  123. const
  124. kPMDestinationInvalid = 0;
  125. kPMDestinationPrinter = 1;
  126. kPMDestinationFile = 2;
  127. kPMDestinationFax = 3;
  128. kPMDestinationPreview = 4;
  129. kPMDestinationTypeDefault = kPMDestinationPrinter;
  130. type
  131. PMTag = UInt32;
  132. const
  133. { common tags }
  134. kPMCurrentValue = $63757272 (* 'curr' *); { current setting or value }
  135. kPMDefaultValue = $64666C74 (* 'dflt' *); { default setting or value }
  136. kPMMinimumValue = $6D696E76 (* 'minv' *); { the minimum setting or value }
  137. kPMMaximumValue = $6D617876 (* 'maxv' *); { the maximum setting or value }
  138. { profile tags }
  139. kPMSourceProfile = $73726370 (* 'srcp' *); { source profile }
  140. { resolution tags }
  141. kPMMinRange = $6D6E7267 (* 'mnrg' *); { Min range supported by a printer }
  142. kPMMaxRange = $6D787267 (* 'mxrg' *); { Max range supported by a printer }
  143. kPMMinSquareResolution = $6D696E73 (* 'mins' *); { Min with X and Y resolution equal }
  144. kPMMaxSquareResolution = $6D617873 (* 'maxs' *); { Max with X and Y resolution equal }
  145. kPMDefaultResolution = $64667472 (* 'dftr' *); { printer default resolution }
  146. type
  147. PMOrientation = UInt16;
  148. const
  149. kPMPortrait = 1;
  150. kPMLandscape = 2;
  151. kPMReversePortrait = 3; { will revert to kPortrait for current drivers }
  152. kPMReverseLandscape = 4; { will revert to kLandscape for current drivers }
  153. { Printer states }
  154. type
  155. PMPrinterState = UInt16;
  156. const
  157. kPMPrinterIdle = 3;
  158. kPMPrinterProcessing = 4;
  159. kPMPrinterStopped = 5;
  160. kSizeOfTPrint = 120; { size of old TPrint record }
  161. type
  162. PMColorMode = UInt16;
  163. const
  164. kPMBlackAndWhite = 1;
  165. kPMGray = 2;
  166. kPMColor = 3;
  167. kPMColorModeDuotone = 4; { 2 channels }
  168. kPMColorModeSpecialColor = 5; { to allow for special colors such as metalic, light cyan, etc. }
  169. type
  170. PMColorSpaceModel = UInt32;
  171. const
  172. kPMUnknownColorSpaceModel = 0;
  173. kPMGrayColorSpaceModel = 1;
  174. kPMRGBColorSpaceModel = 2;
  175. kPMCMYKColorSpaceModel = 3;
  176. kPMDevNColorSpaceModel = 4;
  177. kPMColorSpaceModelCount = 4; { total number of color space models supported }
  178. { Constants to define the ColorSync Intents. These intents may be used }
  179. { to set an intent part way through a page or for an entire document. }
  180. type
  181. PMColorSyncIntent = UInt32;
  182. const
  183. kPMColorIntentUndefined = $0000; { User or application have not declared an intent, use the printer's default. }
  184. kPMColorIntentAutomatic = $0001; { Automatically match for photos and graphics anywhere on the page. }
  185. kPMColorIntentPhoto = $0002; { Use Photographic (cmPerceptual) intent for all contents. }
  186. kPMColorIntentBusiness = $0004; { Use Business Graphics (cmSaturation) intent for all contents. }
  187. kPMColorIntentRelColor = $0008; { Use Relative Colormetrics (Logo Colors) for the page. }
  188. kPMColorIntentAbsColor = $0010; { Use absolute colormetric for the page. }
  189. kPMColorIntentUnused = $FFE0; { Remaining bits unused at this time. }
  190. { Print quality modes "standard options" }
  191. type
  192. PMQualityMode = UInt32;
  193. const
  194. kPMQualityLowest = $0000; { Absolute lowest print quality }
  195. kPMQualityInkSaver = $0001; { Saves ink but may be slower }
  196. kPMQualityDraft = $0004; { Print at highest speed, ink used is secondary consideration }
  197. kPMQualityNormal = $0008; { Print in printers "general usage" mode for good balance between quality and speed }
  198. kPMQualityPhoto = $000B; { Optimize quality of photos on the page. Speed is not a concern }
  199. kPMQualityBest = $000D; { Get best quality output for all objects and photos. }
  200. kPMQualityHighest = $000F; { Absolute highest quality attained from a printers }
  201. { Constants for our "standard" paper types }
  202. type
  203. PMPaperType = UInt32;
  204. const
  205. kPMPaperTypeUnknown = $0000; { Not sure yet what paper type we have. }
  206. kPMPaperTypePlain = $0001; { Plain paper }
  207. kPMPaperTypeCoated = $0002; { Has a special coating for sharper images and text }
  208. kPMPaperTypePremium = $0003; { Special premium coated paper }
  209. kPMPaperTypeGlossy = $0004; { High gloss special coating }
  210. kPMPaperTypeTransparency = $0005; { Used for overheads }
  211. kPMPaperTypeTShirt = $0006; { Used to iron on t-shirts }
  212. { Scaling alignment: }
  213. type
  214. PMScalingAlignment = UInt16;
  215. const
  216. kPMScalingPinTopLeft = 1;
  217. kPMScalingPinTopRight = 2;
  218. kPMScalingPinBottomLeft = 3;
  219. kPMScalingPinBottomRight = 4;
  220. kPMScalingCenterOnPaper = 5;
  221. kPMScalingCenterOnImgArea = 6;
  222. { Duplex binding directions: }
  223. type
  224. PMDuplexBinding = UInt16;
  225. const
  226. kPMDuplexBindingLeftRight = 1;
  227. kPMDuplexBindingTopDown = 2;
  228. { Layout directions: }
  229. type
  230. PMLayoutDirection = UInt16;
  231. const
  232. { Horizontal-major directions: }
  233. kPMLayoutLeftRightTopBottom = 1; { English reading direction. }
  234. kPMLayoutLeftRightBottomTop = 2;
  235. kPMLayoutRightLeftTopBottom = 3;
  236. kPMLayoutRightLeftBottomTop = 4; { Vertical-major directions: }
  237. kPMLayoutTopBottomLeftRight = 5;
  238. kPMLayoutTopBottomRightLeft = 6;
  239. kPMLayoutBottomTopLeftRight = 7;
  240. kPMLayoutBottomTopRightLeft = 8;
  241. { Page borders: }
  242. type
  243. PMBorderType = UInt16;
  244. const
  245. kPMBorderSingleHairline = 1;
  246. kPMBorderDoubleHairline = 2;
  247. kPMBorderSingleThickline = 3;
  248. kPMBorderDoubleThickline = 4;
  249. { Useful Constants for PostScript Injection }
  250. kPSPageInjectAllPages = -1; { specifies to inject on all pages }
  251. kPSInjectionMaxDictSize = 5; { maximum size of a dictionary used for PSInjection }
  252. { PostScript Injection values for kPSInjectionPlacementKey }
  253. type
  254. PSInjectionPlacement = UInt16;
  255. const
  256. kPSInjectionBeforeSubsection = 1;
  257. kPSInjectionAfterSubsection = 2;
  258. kPSInjectionReplaceSubsection = 3;
  259. { PostScript Injection values for kPSInjectionSectionKey }
  260. type
  261. PSInjectionSection = SInt32;
  262. const
  263. { Job }
  264. kInjectionSectJob = 1; { CoverPage }
  265. kInjectionSectCoverPage = 2;
  266. { PostScript Injection values for kPSInjectionSubSectionKey }
  267. type
  268. PSInjectionSubsection = SInt32;
  269. const
  270. kInjectionSubPSAdobe = 1; { %!PS-Adobe }
  271. kInjectionSubPSAdobeEPS = 2; { %!PS-Adobe-3.0 EPSF-3.0 }
  272. kInjectionSubBoundingBox = 3; { BoundingBox }
  273. kInjectionSubEndComments = 4; { EndComments }
  274. kInjectionSubOrientation = 5; { Orientation }
  275. kInjectionSubPages = 6; { Pages }
  276. kInjectionSubPageOrder = 7; { PageOrder }
  277. kInjectionSubBeginProlog = 8; { BeginProlog }
  278. kInjectionSubEndProlog = 9; { EndProlog }
  279. kInjectionSubBeginSetup = 10; { BeginSetup }
  280. kInjectionSubEndSetup = 11; { EndSetup }
  281. kInjectionSubBeginDefaults = 12; { BeginDefaults }
  282. kInjectionSubEndDefaults = 13; { EndDefaults }
  283. kInjectionSubDocFonts = 14; { DocumentFonts }
  284. kInjectionSubDocNeededFonts = 15; { DocumentNeededFonts }
  285. kInjectionSubDocSuppliedFonts = 16; { DocumentSuppliedFonts }
  286. kInjectionSubDocNeededRes = 17; { DocumentNeededResources }
  287. kInjectionSubDocSuppliedRes = 18; { DocumentSuppliedResources }
  288. kInjectionSubDocCustomColors = 19; { DocumentCustomColors }
  289. kInjectionSubDocProcessColors = 20; { DocumentProcessColors }
  290. kInjectionSubPlateColor = 21; { PlateColor }
  291. kInjectionSubPageTrailer = 22; { PageTrailer }
  292. kInjectionSubTrailer = 23; { Trailer }
  293. kInjectionSubEOF = 24; { EOF }
  294. kInjectionSubBeginFont = 25; { BeginFont }
  295. kInjectionSubEndFont = 26; { EndFont }
  296. kInjectionSubBeginResource = 27; { BeginResource }
  297. kInjectionSubEndResource = 28; { EndResource }
  298. kInjectionSubPage = 29; { Page }
  299. kInjectionSubBeginPageSetup = 30; { BeginPageSetup }
  300. kInjectionSubEndPageSetup = 31; { EndPageSetup }
  301. type
  302. PMPPDDomain = UInt16;
  303. const
  304. kAllPPDDomains = 1;
  305. kSystemPPDDomain = 2;
  306. kLocalPPDDomain = 3;
  307. kNetworkPPDDomain = 4;
  308. kUserPPDDomain = 5;
  309. kCUPSPPDDomain = 6;
  310. { Description types }
  311. {$ifc USE_CFSTR_CONSTANT_MACROS}
  312. {$definec kPMPPDDescriptionType CFSTRP('PMPPDDescriptionType')}
  313. {$endc}
  314. { Document format strings }
  315. {$ifc USE_CFSTR_CONSTANT_MACROS}
  316. {$definec kPMDocumentFormatDefault CFSTRP('com.apple.documentformat.default')}
  317. {$endc}
  318. {$ifc USE_CFSTR_CONSTANT_MACROS}
  319. {$definec kPMDocumentFormatPDF CFSTRP('application/pdf')}
  320. {$endc}
  321. {$ifc USE_CFSTR_CONSTANT_MACROS}
  322. {$definec kPMDocumentFormatPICT CFSTRP('application/vnd.apple.printing-pict')}
  323. {$endc}
  324. {$ifc USE_CFSTR_CONSTANT_MACROS}
  325. {$definec kPMDocumentFormatPICTPS CFSTRP('application/vnd.apple.printing-pict-ps')}
  326. {$endc}
  327. {$ifc USE_CFSTR_CONSTANT_MACROS}
  328. {$definec kPMDocumentFormatPICTPSwPSNormalizer CFSTRP('application/vnd.apple.printing-pict-ps-viapsnormalizer')}
  329. {$endc}
  330. {$ifc USE_CFSTR_CONSTANT_MACROS}
  331. {$definec kPMDocumentFormatPostScript CFSTRP('application/postscript')}
  332. {$endc}
  333. { Graphic context strings }
  334. {$ifc USE_CFSTR_CONSTANT_MACROS}
  335. {$definec kPMGraphicsContextDefault CFSTRP('com.apple.graphicscontext.default')}
  336. {$endc}
  337. {$ifc USE_CFSTR_CONSTANT_MACROS}
  338. {$definec kPMGraphicsContextQuickdraw CFSTRP('com.apple.graphicscontext.quickdraw')}
  339. {$endc}
  340. {$ifc USE_CFSTR_CONSTANT_MACROS}
  341. {$definec kPMGraphicsContextCoreGraphics CFSTRP('com.apple.graphicscontext.coregraphics')}
  342. {$endc}
  343. { Data format strings }
  344. {$ifc USE_CFSTR_CONSTANT_MACROS}
  345. {$definec kPMDataFormatPS CFSTRP('application/postscript')}
  346. {$endc}
  347. {$ifc USE_CFSTR_CONSTANT_MACROS}
  348. {$definec kPMDataFormatPDF CFSTRP('application/pdf')}
  349. {$endc}
  350. {$ifc USE_CFSTR_CONSTANT_MACROS}
  351. {$definec kPMDataFormatPICT CFSTRP('application/vnd.apple.printing-pict-ps')}
  352. {$endc}
  353. {$ifc USE_CFSTR_CONSTANT_MACROS}
  354. {$definec kPMDataFormatPICTwPS CFSTRP('application/vnd.apple.printing-pict-ps')}
  355. {$endc}
  356. { PostScript Injection Dictionary Keys }
  357. {$ifc USE_CFSTR_CONSTANT_MACROS}
  358. {$definec kPSInjectionSectionKey CFSTRP('section')}
  359. {$endc}
  360. {$ifc USE_CFSTR_CONSTANT_MACROS}
  361. {$definec kPSInjectionSubSectionKey CFSTRP('subsection')}
  362. {$endc}
  363. {$ifc USE_CFSTR_CONSTANT_MACROS}
  364. {$definec kPSInjectionPageKey CFSTRP('page')}
  365. {$endc}
  366. {$ifc USE_CFSTR_CONSTANT_MACROS}
  367. {$definec kPSInjectionPlacementKey CFSTRP('place')}
  368. {$endc}
  369. {$ifc USE_CFSTR_CONSTANT_MACROS}
  370. {$definec kPSInjectionPostScriptKey CFSTRP('psdata')}
  371. {$endc}
  372. { PDF Workflow Keys }
  373. { kPDFWorkFlowItemURLKey CFSTR("itemURL"); defined in GPCMacros.inc }
  374. { kPDFWorkflowForlderURLKey CFSTR("folderURL"); defined in GPCMacros.inc }
  375. { kPDFWorkflowDisplayNameKey CFSTR("displayName"); defined in GPCMacros.inc }
  376. { kPDFWorkflowItemsKey CFSTR("items"); defined in GPCMacros.inc }
  377. { OSStatus return codes }
  378. kPMNoError = 0;
  379. kPMGeneralError = -30870;
  380. kPMOutOfScope = -30871; { an API call is out of scope }
  381. kPMInvalidParameter = -50; { a required parameter is missing or invalid }
  382. kPMNoDefaultPrinter = -30872; { no default printer selected }
  383. kPMNotImplemented = -30873; { this API call is not supported }
  384. kPMNoSuchEntry = -30874; { no such entry }
  385. kPMInvalidPrintSettings = -30875; { the printsettings reference is invalid }
  386. kPMInvalidPageFormat = -30876; { the pageformat reference is invalid }
  387. kPMValueOutOfRange = -30877; { a value passed in is out of range }
  388. kPMLockIgnored = -30878; { the lock value was ignored }
  389. kPMInvalidPrintSession = -30879; { the print session is invalid }
  390. kPMInvalidPrinter = -30880; { the printer reference is invalid }
  391. kPMObjectInUse = -30881; { the object is in use }
  392. kPMInvalidPreset = -30882; { the preset is invalid }
  393. kPMPrintAllPages = $FFFFFFFF;
  394. kPMUnlocked = false;
  395. kPMLocked = true;
  396. type
  397. PMRectPtr = ^PMRect;
  398. PMRect = record
  399. top: Double;
  400. left: Double;
  401. bottom: Double;
  402. right: Double;
  403. end;
  404. PMResolutionPtr = ^PMResolution;
  405. PMResolution = record
  406. hRes: Double;
  407. vRes: Double;
  408. end;
  409. PMLanguageInfoPtr = ^PMLanguageInfo;
  410. PMLanguageInfo = record
  411. level: Str32;
  412. version: Str32;
  413. release: Str32;
  414. pad: SInt8
  415. end;
  416. PMPaperMargins = PMRect;
  417. {$ALIGN MAC68K}
  418. end.