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.

232 lines
8.3 KiB

  1. /*
  2. File: PMPrintingDialogExtensions.h
  3. Contains: Mac OS X Printing Manager Print Dialog Extension Interfaces.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1999-2001 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 __MACTYPES__
  11. #include <MacTypes.h>
  12. #endif
  13. #ifndef __CFSTRING__
  14. #include <CFString.h>
  15. #endif
  16. #ifndef __PMAPPLICATION__
  17. #include <PMApplication.h>
  18. #endif
  19. #ifndef __PMTICKET__
  20. #include <PMTicket.h>
  21. #endif
  22. #ifndef __PMPLUGINHEADER__
  23. #include <PMPluginHeader.h>
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35. #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37. #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39. #pragma pack(2)
  40. #endif
  41. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. Constants
  43. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  44. /*
  45. Feature request flags...
  46. */
  47. typedef UInt32 PMPDEFlags;
  48. enum {
  49. kPMPDENoFlags = 0x00000000, /* Empty flag word. */
  50. kPMPDENoSummary = 0x00000001, /* Won't provide summary string. */
  51. kPMPDEAllFlags = (unsigned long)0xFFFFFFFF /* All flags set.*/
  52. };
  53. /*
  54. Parameters for printing events:
  55. kEventPrintingPDEResize
  56. --> kEventParamDirectObject typeControlRef
  57. --> kEventParamPDEHeight typeUInt32
  58. When sent to the this event is sent to the PageSetup or Print Dialog, the PDE pane
  59. will be resized to match the new height. The kEventParamDirectObject needs to be the
  60. embedderUserPane that is passed into Initialize
  61. */
  62. enum {
  63. kEventClassPrinting = FOUR_CHAR_CODE('prnt'),
  64. kEventPrintingPDEResize = FOUR_CHAR_CODE('rqsz'),
  65. kEventParamPDEHeight = FOUR_CHAR_CODE('pdeh')
  66. };
  67. /*
  68. Define Printing Dialog Extensions CFPlugIn constants.
  69. First, the base string for all constants relating to Printing Dialog Extensions.
  70. */
  71. #define kPMPDEBase "com.apple.printing.pde"
  72. /*
  73. Define the Type and Interface keys for Printing Dialog Extensions.
  74. */
  75. #define kPMPDEAppType CFSTR("com.apple.printing.pde.app")
  76. #define KPMPDEPrinterType CFSTR("com.apple.printing.pde.pm")
  77. #define kPMPDEInterface CFSTR("com.apple.printing.pde.ui")
  78. /*
  79. Define the Kind IDs for Universal and Standard Printing Dialog Extensions.
  80. */
  81. /* Implemented Universal */
  82. #define kPMPageAttributesKindID CFSTR("com.apple.print.pde.PageAttributesKind")
  83. #define kPMCopiesAndPagesPDEKindID CFSTR("com.apple.print.pde.CopiesAndPagesKind")
  84. #define kPMLayoutPDEKindID CFSTR("com.apple.print.pde.LayoutUserOptionKind")
  85. #define kPMOutputOptionsPDEKindID CFSTR("com.apple.print.pde.OutputOptionsKind")
  86. #define kPMDuplexPDEKindID CFSTR("com.apple.print.pde.DuplexKind")
  87. /* Unimplemented Universal */
  88. #define kPMCoverPagePDEKindID CFSTR("com.apple.print.pde.CoverPageKind")
  89. #define kPMPaperSourcePDEKindID CFSTR("com.apple.print.pde.PaperSourceKind")
  90. #define kPMPriorityPDEKindID CFSTR("com.apple.print.pde.PriorityKind")
  91. #define kPMRotationScalingPDEKindID CFSTR("com.apple.print.pde.RotationScalingKind")
  92. /* Implemented Standard */
  93. #define kPMPaperFeedPDEKindID CFSTR("com.apple.print.pde.PaperFeedKind")
  94. /* Unimplemented Standard */
  95. #define kPMColorPDEKindID CFSTR("com.apple.print.pde.ColorKind")
  96. #define kPMQualityMediaPDEKindID CFSTR("com.apple.print.pde.QualityMediaPDEKind")
  97. /* These constants are used by PDE's to obtain the PMTicketRef data for the corresponding
  98. piece of data.
  99. */
  100. #define kPDE_PMPrintSettingsRef CFSTR("PMPrintSettingsTicket")
  101. #define kPDE_PMPageFormatRef CFSTR("PMPageFormatTicket")
  102. #define kPDE_PMJobTemplateRef CFSTR("PMJobTemplateTicket")
  103. #define kPDE_PMPrinterInfoRef CFSTR("PMPrinterInfoTicket")
  104. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  105. Type Definitions
  106. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  107. /*
  108. Basic types...
  109. */
  110. typedef struct OpaquePMPDERef* PMPDERef;
  111. typedef struct OpaquePMPDEContext* PMPDEContext;
  112. /* Just for testing this .... */
  113. /*#define TEST_PLUGINS_LINKED_IN 1 */
  114. /* Type and Interface IDs. */
  115. #define kDialogExtensionIntfIDStr CFSTR("A996FD7E-B738-11D3-8519-0050E4603277")
  116. #define kGeneralPageSetupDialogTypeIDStr CFSTR("6E6ED964-B738-11D3-952F-0050E4603277")
  117. #define kGeneralPrintDialogTypeIDStr CFSTR("C1BF838E-B72A-11D3-9644-0050E4603277")
  118. #define kAppPageSetupDialogTypeIDStr CFSTR("B9A0DA98-E57F-11D3-9E83-0050E4603277")
  119. #define kAppPrintDialogTypeIDStr CFSTR("BCB07250-E57F-11D3-8CA6-0050E4603277")
  120. #define kPrinterModuleTypeIDStr CFSTR("BDB091F4-E57F-11D3-B5CC-0050E4603277")
  121. /* Versioning info. */
  122. /* Update following values when you append new APIs to the end of interface: */
  123. #define kPDEBuildVersionMajor 1
  124. #define kPDEBuildVersionMinor 0
  125. /* Update following values when you obsolete some APIs in the interface. */
  126. /* Since this will break the upward compatibility chain such practice is */
  127. /* strongly discouraged - if it can be helped at all. */
  128. #define kPDEBaseVersionMajor 1
  129. #define kPDEBaseVersionMinor 0
  130. /* Interface layout - object and vtable: */
  131. typedef CALLBACK_API_C( OSStatus , PMPDEPrologueProcPtr )(PMPDEContext *context, OSType *creator, CFStringRef *userOptionKind, CFStringRef *title, UInt32 *maxH, UInt32 *maxV);
  132. typedef CALLBACK_API_C( OSStatus , PMPDEInitializeProcPtr )(PMPDEContext context, PMPDEFlags *flags, PMPDERef ref, ControlRef embedderUserPane, PMPrintSession printSession);
  133. typedef CALLBACK_API_C( OSStatus , PMPDESyncProcPtr )(PMPDEContext context, PMPrintSession printSession, Boolean reinitializePlugIn);
  134. typedef CALLBACK_API_C( OSStatus , PMPDEGetSummaryTextProcPtr )(PMPDEContext context, CFArrayRef *titleArray, CFArrayRef *summaryArray);
  135. typedef CALLBACK_API_C( OSStatus , PMPDEOpenProcPtr )(PMPDEContext context);
  136. typedef CALLBACK_API_C( OSStatus , PMPDECloseProcPtr )(PMPDEContext context);
  137. typedef CALLBACK_API_C( OSStatus , PMPDETerminateProcPtr )(PMPDEContext context, OSStatus status);
  138. struct PlugInIntfVTable {
  139. /* ---- API 'IMMUTABLE' Begin: ----*/
  140. /* The plugin header is required with all plugins.*/
  141. /* This must lead object's layout.*/
  142. PMPlugInHeader plugInHeader;
  143. /* ---- API Version 1.0 Begin: ----*/
  144. /* Entry points for Printing Dialog Extension modules...*/
  145. PMPDEPrologueProcPtr Prologue;
  146. PMPDEInitializeProcPtr Initialize;
  147. PMPDESyncProcPtr Sync;
  148. PMPDEGetSummaryTextProcPtr GetSummaryText;
  149. PMPDEOpenProcPtr Open;
  150. PMPDECloseProcPtr Close;
  151. PMPDETerminateProcPtr Terminate;
  152. };
  153. typedef struct PlugInIntfVTable PlugInIntfVTable;
  154. struct PlugInIntf {
  155. /* Plugin interface is an object containing vtable address:*/
  156. PlugInIntfVTable * vtable;
  157. };
  158. typedef struct PlugInIntf PlugInIntf;
  159. /* Some commonly used routines used by PDEs */
  160. /*
  161. * PMCreateLocalizedPaperSizeCFString()
  162. *
  163. * Availability:
  164. * Non-Carbon CFM: not available
  165. * CarbonLib: not available
  166. * Mac OS X: in version 10.0 and later
  167. */
  168. EXTERN_API_C( CFStringRef )
  169. PMCreateLocalizedPaperSizeCFString(
  170. PMTicketRef listofPaperTickets,
  171. UInt16 paperToUse);
  172. /* Lower level version of the same function, this time passing the single PaperInfo.*/
  173. /*
  174. * PMCreatePaperSizeCFString()
  175. *
  176. * Availability:
  177. * Non-Carbon CFM: not available
  178. * CarbonLib: not available
  179. * Mac OS X: in version 10.1 and later
  180. */
  181. EXTERN_API_C( CFStringRef )
  182. PMCreatePaperSizeCFString(PMTicketRef selectedPaper);
  183. #if PRAGMA_STRUCT_ALIGN
  184. #pragma options align=reset
  185. #elif PRAGMA_STRUCT_PACKPUSH
  186. #pragma pack(pop)
  187. #elif PRAGMA_STRUCT_PACK
  188. #pragma pack()
  189. #endif
  190. #ifdef PRAGMA_IMPORT_OFF
  191. #pragma import off
  192. #elif PRAGMA_IMPORT
  193. #pragma import reset
  194. #endif
  195. #ifdef __cplusplus
  196. }
  197. #endif