Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

359 lines
14 KiB

  1. /*
  2. File: PMDefinitions.h
  3. Contains: Carbon Printing Manager Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1998-2002 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __PMDEFINITIONS__
  11. #define __PMDEFINITIONS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __MACERRORS__
  16. #include <MacErrors.h>
  17. #endif
  18. #ifndef __CFSTRING__
  19. #include <CFString.h>
  20. #endif
  21. #if PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. #if PRAGMA_STRUCT_ALIGN
  28. #pragma options align=mac68k
  29. #elif PRAGMA_STRUCT_PACKPUSH
  30. #pragma pack(push, 2)
  31. #elif PRAGMA_STRUCT_PACK
  32. #pragma pack(2)
  33. #endif
  34. /* Printing objects */
  35. typedef const void * PMObject;
  36. typedef struct OpaquePMDialog* PMDialog;
  37. typedef struct OpaquePMPrintSettings* PMPrintSettings;
  38. typedef struct OpaquePMPageFormat* PMPageFormat;
  39. typedef struct OpaquePMPrintContext* PMPrintContext;
  40. typedef struct OpaquePMPrintSession* PMPrintSession;
  41. typedef struct OpaquePMPrinter* PMPrinter;
  42. typedef struct OpaquePMServer* PMServer;
  43. enum {
  44. kPMCancel = 0x0080 /* user hit cancel button in dialog */
  45. };
  46. #define kPMNoData NULL /* for general use */
  47. #define kPMDontWantSize NULL /* for parameters which return size information */
  48. #define kPMDontWantData NULL /* for parameters which return data */
  49. #define kPMDontWantBoolean NULL /* for parameters which take a boolean reference */
  50. #define kPMNoReference NULL /* for parameters which take an address pointer */
  51. /* for parameters which take a PrintSettings reference */
  52. #define kPMNoPrintSettings ((PMPrintSettings)NULL)
  53. /* for parameters which take a PageFormat reference */
  54. #define kPMNoPageFormat ((PMPageFormat)NULL)
  55. /* for parameters which take a Server reference */
  56. #define kPMServerLocal ((PMServer)NULL)
  57. typedef UInt16 PMDestinationType;
  58. enum {
  59. kPMDestinationInvalid = 0,
  60. kPMDestinationPrinter = 1,
  61. kPMDestinationFile = 2,
  62. kPMDestinationFax = 3,
  63. kPMDestinationPreview = 4
  64. };
  65. #define kPMDestinationTypeDefault kPMDestinationPrinter
  66. typedef UInt32 PMTag;
  67. enum {
  68. /* common tags */
  69. kPMCurrentValue = FOUR_CHAR_CODE('curr'), /* current setting or value */
  70. kPMDefaultValue = FOUR_CHAR_CODE('dflt'), /* default setting or value */
  71. kPMMinimumValue = FOUR_CHAR_CODE('minv'), /* the minimum setting or value */
  72. kPMMaximumValue = FOUR_CHAR_CODE('maxv'), /* the maximum setting or value */
  73. /* profile tags */
  74. kPMSourceProfile = FOUR_CHAR_CODE('srcp'), /* source profile */
  75. /* resolution tags */
  76. kPMMinRange = FOUR_CHAR_CODE('mnrg'), /* Min range supported by a printer */
  77. kPMMaxRange = FOUR_CHAR_CODE('mxrg'), /* Max range supported by a printer */
  78. kPMMinSquareResolution = FOUR_CHAR_CODE('mins'), /* Min with X and Y resolution equal */
  79. kPMMaxSquareResolution = FOUR_CHAR_CODE('maxs'), /* Max with X and Y resolution equal */
  80. kPMDefaultResolution = FOUR_CHAR_CODE('dftr') /* printer default resolution */
  81. };
  82. typedef UInt16 PMOrientation;
  83. enum {
  84. kPMPortrait = 1,
  85. kPMLandscape = 2,
  86. kPMReversePortrait = 3, /* will revert to kPortrait for current drivers */
  87. kPMReverseLandscape = 4 /* will revert to kLandscape for current drivers */
  88. };
  89. /* Printer states */
  90. typedef UInt16 PMPrinterState;
  91. enum {
  92. kPMPrinterIdle = 3,
  93. kPMPrinterProcessing = 4,
  94. kPMPrinterStopped = 5
  95. };
  96. enum {
  97. kSizeOfTPrint = 120 /* size of old TPrint record */
  98. };
  99. typedef UInt16 PMColorMode;
  100. enum {
  101. kPMBlackAndWhite = 1,
  102. kPMGray = 2,
  103. kPMColor = 3,
  104. kPMColorModeDuotone = 4, /* 2 channels */
  105. kPMColorModeSpecialColor = 5 /* to allow for special colors such as metalic, light cyan, etc. */
  106. };
  107. /* Constants to define the ColorSync Intents. These intents may be used */
  108. /* to set an intent part way through a page or for an entire document. */
  109. typedef UInt32 PMColorSyncIntent;
  110. enum {
  111. kPMColorIntentUndefined = 0x0000, /* User or application have not declared an intent, use the printer's default. */
  112. kPMColorIntentAutomatic = 0x0001, /* Automatically match for photos and graphics anywhere on the page. */
  113. kPMColorIntentPhoto = 0x0002, /* Use Photographic (cmPerceptual) intent for all contents. */
  114. kPMColorIntentBusiness = 0x0004, /* Use Business Graphics (cmSaturation) intent for all contents. */
  115. kPMColorIntentRelColor = 0x0008, /* Use Relative Colormetrics (Logo Colors) for the page. */
  116. kPMColorIntentAbsColor = 0x0010, /* Use absolute colormetric for the page. */
  117. kPMColorIntentUnused = 0xFFE0 /* Remaining bits unused at this time. */
  118. };
  119. /* Print quality modes "standard options" */
  120. typedef UInt32 PMQualityMode;
  121. enum {
  122. kPMQualityLowest = 0x0000, /* Absolute lowest print quality */
  123. kPMQualityInkSaver = 0x0001, /* Saves ink but may be slower */
  124. kPMQualityDraft = 0x0004, /* Print at highest speed, ink used is secondary consideration */
  125. kPMQualityNormal = 0x0008, /* Print in printers "general usage" mode for good balance between quality and speed */
  126. kPMQualityPhoto = 0x000B, /* Optimize quality of photos on the page. Speed is not a concern */
  127. kPMQualityBest = 0x000D, /* Get best quality output for all objects and photos. */
  128. kPMQualityHighest = 0x000F /* Absolute highest quality attained from a printers */
  129. };
  130. /* Constants for our "standard" paper types */
  131. typedef UInt32 PMPaperType;
  132. enum {
  133. kPMPaperTypeUnknown = 0x0000, /* Not sure yet what paper type we have. */
  134. kPMPaperTypePlain = 0x0001, /* Plain paper */
  135. kPMPaperTypeCoated = 0x0002, /* Has a special coating for sharper images and text */
  136. kPMPaperTypePremium = 0x0003, /* Special premium coated paper */
  137. kPMPaperTypeGlossy = 0x0004, /* High gloss special coating */
  138. kPMPaperTypeTransparency = 0x0005, /* Used for overheads */
  139. kPMPaperTypeTShirt = 0x0006 /* Used to iron on t-shirts */
  140. };
  141. /* Scaling alignment: */
  142. typedef UInt16 PMScalingAlignment;
  143. enum {
  144. kPMScalingPinTopLeft = 1,
  145. kPMScalingPinTopRight = 2,
  146. kPMScalingPinBottomLeft = 3,
  147. kPMScalingPinBottomRight = 4,
  148. kPMScalingCenterOnPaper = 5,
  149. kPMScalingCenterOnImgArea = 6
  150. };
  151. /* Duplex binding directions: */
  152. typedef UInt16 PMDuplexBinding;
  153. enum {
  154. kPMDuplexBindingLeftRight = 1,
  155. kPMDuplexBindingTopDown = 2
  156. };
  157. /* Layout directions: */
  158. typedef UInt16 PMLayoutDirection;
  159. enum {
  160. /* Horizontal-major directions: */
  161. kPMLayoutLeftRightTopBottom = 1, /* English reading direction. */
  162. kPMLayoutLeftRightBottomTop = 2,
  163. kPMLayoutRightLeftTopBottom = 3,
  164. kPMLayoutRightLeftBottomTop = 4, /* Vertical-major directions: */
  165. kPMLayoutTopBottomLeftRight = 5,
  166. kPMLayoutTopBottomRightLeft = 6,
  167. kPMLayoutBottomTopLeftRight = 7,
  168. kPMLayoutBottomTopRightLeft = 8
  169. };
  170. /* Page borders: */
  171. typedef UInt16 PMBorderType;
  172. enum {
  173. kPMBorderSingleHairline = 1,
  174. kPMBorderDoubleHairline = 2,
  175. kPMBorderSingleThickline = 3,
  176. kPMBorderDoubleThickline = 4
  177. };
  178. /* Useful Constants for PostScript Injection */
  179. enum {
  180. kPSPageInjectAllPages = -1, /* specifies to inject on all pages */
  181. kPSInjectionMaxDictSize = 5 /* maximum size of a dictionary used for PSInjection */
  182. };
  183. /* PostScript Injection values for kPSInjectionPlacementKey */
  184. typedef UInt16 PSInjectionPlacement;
  185. enum {
  186. kPSInjectionBeforeSubsection = 1,
  187. kPSInjectionAfterSubsection = 2,
  188. kPSInjectionReplaceSubsection = 3
  189. };
  190. /* PostScript Injection values for kPSInjectionSectionKey */
  191. typedef SInt32 PSInjectionSection;
  192. enum {
  193. /* Job */
  194. kInjectionSectJob = 1, /* CoverPage */
  195. kInjectionSectCoverPage = 2
  196. };
  197. /* PostScript Injection values for kPSInjectionSubSectionKey */
  198. typedef SInt32 PSInjectionSubsection;
  199. enum {
  200. kInjectionSubPSAdobe = 1, /* %!PS-Adobe */
  201. kInjectionSubPSAdobeEPS = 2, /* %!PS-Adobe-3.0 EPSF-3.0 */
  202. kInjectionSubBoundingBox = 3, /* BoundingBox */
  203. kInjectionSubEndComments = 4, /* EndComments */
  204. kInjectionSubOrientation = 5, /* Orientation */
  205. kInjectionSubPages = 6, /* Pages */
  206. kInjectionSubPageOrder = 7, /* PageOrder */
  207. kInjectionSubBeginProlog = 8, /* BeginProlog */
  208. kInjectionSubEndProlog = 9, /* EndProlog */
  209. kInjectionSubBeginSetup = 10, /* BeginSetup */
  210. kInjectionSubEndSetup = 11, /* EndSetup */
  211. kInjectionSubBeginDefaults = 12, /* BeginDefaults */
  212. kInjectionSubEndDefaults = 13, /* EndDefaults */
  213. kInjectionSubDocFonts = 14, /* DocumentFonts */
  214. kInjectionSubDocNeededFonts = 15, /* DocumentNeededFonts */
  215. kInjectionSubDocSuppliedFonts = 16, /* DocumentSuppliedFonts */
  216. kInjectionSubDocNeededRes = 17, /* DocumentNeededResources */
  217. kInjectionSubDocSuppliedRes = 18, /* DocumentSuppliedResources*/
  218. kInjectionSubDocCustomColors = 19, /* DocumentCustomColors */
  219. kInjectionSubDocProcessColors = 20, /* DocumentProcessColors */
  220. kInjectionSubPlateColor = 21, /* PlateColor */
  221. kInjectionSubPageTrailer = 22, /* PageTrailer */
  222. kInjectionSubTrailer = 23, /* Trailer */
  223. kInjectionSubEOF = 24, /* EOF */
  224. kInjectionSubBeginFont = 25, /* BeginFont */
  225. kInjectionSubEndFont = 26, /* EndFont */
  226. kInjectionSubBeginResource = 27, /* BeginResource */
  227. kInjectionSubEndResource = 28, /* EndResource */
  228. kInjectionSubPage = 29, /* Page */
  229. kInjectionSubBeginPageSetup = 30, /* BeginPageSetup */
  230. kInjectionSubEndPageSetup = 31 /* EndPageSetup */
  231. };
  232. /* Description types */
  233. #define kPMPPDDescriptionType CFSTR("PMPPDDescriptionType")
  234. /* Document format strings */
  235. #define kPMDocumentFormatDefault CFSTR("com.apple.documentformat.default")
  236. #define kPMDocumentFormatPDF CFSTR("application/pdf")
  237. #define kPMDocumentFormatPICT CFSTR("application/vnd.apple.printing-pict")
  238. #define kPMDocumentFormatPICTPS CFSTR("application/vnd.apple.printing-pict-ps")
  239. #define kPMDocumentFormatPostScript CFSTR("application/postscript")
  240. /* Graphic context strings */
  241. #define kPMGraphicsContextDefault CFSTR("com.apple.graphicscontext.default")
  242. #define kPMGraphicsContextQuickdraw CFSTR("com.apple.graphicscontext.quickdraw")
  243. #define kPMGraphicsContextCoreGraphics CFSTR("com.apple.graphicscontext.coregraphics")
  244. /* Data format strings */
  245. #define kPMDataFormatPS kPMDocumentFormatPostScript
  246. #define kPMDataFormatPDF kPMDocumentFormatPDF
  247. #define kPMDataFormatPICT kPMDocumentFormatPICT
  248. #define kPMDataFormatPICTwPS kPMDocumentFormatPICTPS
  249. /* PostScript Injection Dictionary Keys */
  250. #define kPSInjectionSectionKey CFSTR("section")
  251. #define kPSInjectionSubSectionKey CFSTR("subsection")
  252. #define kPSInjectionPageKey CFSTR("page")
  253. #define kPSInjectionPlacementKey CFSTR("place")
  254. #define kPSInjectionPostScriptKey CFSTR("psdata")
  255. /* OSStatus return codes */
  256. enum {
  257. kPMNoError = noErr,
  258. kPMGeneralError = -30870,
  259. kPMOutOfScope = -30871, /* an API call is out of scope */
  260. kPMInvalidParameter = paramErr, /* a required parameter is missing or invalid */
  261. kPMNoDefaultPrinter = -30872, /* no default printer selected */
  262. kPMNotImplemented = -30873, /* this API call is not supported */
  263. kPMNoSuchEntry = -30874, /* no such entry */
  264. kPMInvalidPrintSettings = -30875, /* the printsettings reference is invalid */
  265. kPMInvalidPageFormat = -30876, /* the pageformat reference is invalid */
  266. kPMValueOutOfRange = -30877, /* a value passed in is out of range */
  267. kPMLockIgnored = -30878 /* the lock value was ignored */
  268. };
  269. enum {
  270. kPMInvalidPrintSession = -30879, /* the print session is invalid */
  271. kPMInvalidPrinter = -30880, /* the printer reference is invalid */
  272. kPMObjectInUse = -30881 /* the object is in use */
  273. };
  274. enum {
  275. kPMPrintAllPages = -1
  276. };
  277. enum {
  278. kPMUnlocked = false,
  279. kPMLocked = true
  280. };
  281. struct PMRect {
  282. double top;
  283. double left;
  284. double bottom;
  285. double right;
  286. };
  287. typedef struct PMRect PMRect;
  288. struct PMResolution {
  289. double hRes;
  290. double vRes;
  291. };
  292. typedef struct PMResolution PMResolution;
  293. struct PMLanguageInfo {
  294. Str32 level;
  295. Str32 version;
  296. Str32 release;
  297. };
  298. typedef struct PMLanguageInfo PMLanguageInfo;
  299. #if PRAGMA_STRUCT_ALIGN
  300. #pragma options align=reset
  301. #elif PRAGMA_STRUCT_PACKPUSH
  302. #pragma pack(pop)
  303. #elif PRAGMA_STRUCT_PACK
  304. #pragma pack()
  305. #endif
  306. #ifdef PRAGMA_IMPORT_OFF
  307. #pragma import off
  308. #elif PRAGMA_IMPORT
  309. #pragma import reset
  310. #endif
  311. #endif /* __PMDEFINITIONS__ */