Print.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: Print.h /main/13 1996/10/31 02:09:08 cde-hp $ */
  24. /*
  25. * DtPrint/Print.h
  26. */
  27. /* (c) Copyright 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC.
  28. * ALL RIGHTS RESERVED
  29. * (c) Copyright 1989, 1996 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
  30. * (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1995, 1996,
  31. * HEWLETT-PACKARD COMPANY
  32. * (c) Copyright 1996 International Business Machines Corp.
  33. * (c) Copyright 1996 Sun Microsystems, Inc.
  34. * (c) Copyright 1996 Novell, Inc.
  35. * (c) Copyright 1996 FUJITSU LIMITED.
  36. * (c) Copyright 1996 Hitachi.
  37. */
  38. #ifndef _DtPrint_h
  39. #define _DtPrint_h
  40. #include <Xm/Xm.h>
  41. #if 0 && defined(PRINTING_SUPPORTED)
  42. #include <X11/extensions/Print.h>
  43. #endif /* PRINTING_SUPPORTED */
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /*
  48. * Class record constants
  49. */
  50. externalref WidgetClass dtPrintSetupBoxWidgetClass;
  51. typedef struct _DtPrintSetupBoxClassRec * DtPrintSetupBoxWidgetClass;
  52. typedef struct _DtPrintSetupBoxRec * DtPrintSetupBoxWidget;
  53. #ifndef DtIsPrintSetupBox
  54. #define DtIsPrintSetupBox(w) (XtIsSubclass (w, dtPrintSetupBoxWidgetClass))
  55. #endif
  56. /*
  57. * Resource Names
  58. */
  59. #define DtNcancelCallback "cancelCallback"
  60. #define DtNclosePrintDisplayCallback "closePrintDisplayCallback"
  61. #define DtNcopies "copies"
  62. #define DtNdescription "description"
  63. #define DtNdestroyContextCallback "destroyContextCallback"
  64. #define DtNfileName "fileName"
  65. #ifndef DtNminimizeButtons
  66. # define DtNminimizeButtons "minimizeButtons"
  67. #endif
  68. #define DtNoptionCount "optionCount"
  69. #define DtNoptions "options"
  70. #define DtNprintCallback "printCallback"
  71. #define DtNprintDestination "printDestination"
  72. #define DtNprinterInfoProc "printerInfoProc"
  73. #define DtNprinterName "printerName"
  74. #define DtNprintSetupMode "printSetupMode"
  75. #define DtNselectFileProc "selectFileProc"
  76. #define DtNselectPrinterProc "selectPrinterProc"
  77. #define DtNsetupCallback "setupCallback"
  78. #define DtNverifyPrinterProc "verifyPrinterProc"
  79. #define DtNworkAreaLocation "workAreaLocation"
  80. #define DtCCancelCallback "CancelCallback"
  81. #define DtCClosePrintDisplayCallback "ClosePrintDisplayCallback"
  82. #define DtCCopies "Copies"
  83. #define DtCDescription "Description"
  84. #define DtCDestroyContextCallback "DestroyContextCallback"
  85. #define DtCFileName "FileName"
  86. #ifndef DtCMinimizeButtons
  87. # define DtCMinimizeButtons "MinimizeButtons"
  88. #endif
  89. #define DtCOptionCount "OptionCount"
  90. #define DtCOptions "Options"
  91. #define DtCPrintCallback "PrintCallback"
  92. #define DtCPrintDestination "PrintDestination"
  93. #define DtCPrinterInfoProc "PrinterInfoProc"
  94. #define DtCPrinterName "PrinterName"
  95. #define DtCPrintSetupMode "PrintSetupMode"
  96. #define DtCSelectFileProc "SelectFileProc"
  97. #define DtCSelectPrinterProc "SelectPrinterProc"
  98. #define DtCSetupCallback "SetupCallback"
  99. #define DtCVerifyPrinterProc "VerifyPrinterProc"
  100. #define DtCWorkAreaLocation "WorkAreaLocation"
  101. #define DtRPrintSetupProc "PrintSetupProc"
  102. /*
  103. * DtNsetupMode Resource Values
  104. */
  105. enum {
  106. DtPRINT_SETUP_PLAIN,
  107. DtPRINT_SETUP_XP
  108. };
  109. /*
  110. * DtNworkAreaLocation Resource Values
  111. */
  112. enum {
  113. DtWORK_AREA_NONE,
  114. DtWORK_AREA_TOP,
  115. DtWORK_AREA_TOP_AND_BOTTOM,
  116. DtWORK_AREA_BOTTOM
  117. };
  118. /*
  119. * DtNprintDestination Resource Values
  120. */
  121. enum { DtPRINT_NO_DESTINATION, DtPRINT_TO_PRINTER, DtPRINT_TO_FILE };
  122. /*
  123. * DtNprinterNameMode Resource Values
  124. */
  125. enum { DtSHORT_NAME, DtMEDIUM_NAME, DtLONG_NAME };
  126. /*
  127. * Mode values for DtPrintSetupBoxResetConnection()
  128. */
  129. typedef enum {
  130. DtPRINT_CLOSE_CONNECTION,
  131. DtPRINT_RELEASE_CONNECTION
  132. } DtPrintResetConnectionMode;
  133. /*
  134. * Callback Reasons
  135. */
  136. enum {
  137. DtPRINT_CR_NONE,
  138. DtPRINT_CR_CANCEL,
  139. DtPRINT_CR_CLOSE_PRINT_DISPLAY,
  140. DtPRINT_CR_PRINT,
  141. DtPRINT_CR_SETUP
  142. };
  143. /*
  144. * DtPrint proecdure return values
  145. */
  146. enum {
  147. DtPRINT_SUCCESS,
  148. DtPRINT_BAD_PARM,
  149. DtPRINT_FAILURE,
  150. DtPRINT_INVALID_DISPLAY,
  151. DtPRINT_NOT_XP_DISPLAY,
  152. DtPRINT_NO_CONNECTION,
  153. DtPRINT_NO_DEFAULT,
  154. DtPRINT_NO_DEFAULT_DISPLAY,
  155. DtPRINT_NO_PRINTER,
  156. DtPRINT_PRINTER_MISSING
  157. };
  158. enum {
  159. DtPRINT_HINT_MESSAGES_OK,
  160. DtPRINT_HINT_NO_MESSAGES
  161. };
  162. /*
  163. * PrintSetupBox Callback Structure Definition
  164. */
  165. typedef struct _DtPrintSetupData
  166. {
  167. String printer_name;
  168. Display *print_display;
  169. #ifdef PRINTING_SUPPORT
  170. XPContext print_context;
  171. #endif /* PRINTING_SUPPORTED */
  172. XtEnum destination;
  173. String dest_info;
  174. XtEnum messages_hint;
  175. } DtPrintSetupData;
  176. typedef struct _DtPrintSetupCallbackStruct
  177. {
  178. int reason;
  179. XEvent *event;
  180. DtPrintSetupData *print_data;
  181. } DtPrintSetupCallbackStruct;
  182. /*
  183. * PrintSetupBox Procedure Resource Type Definition
  184. */
  185. typedef XtEnum (*DtPrintSetupProc)(Widget, DtPrintSetupData*);
  186. /*
  187. * Public Function Declarations
  188. */
  189. extern Widget DtCreatePrintSetupBox(
  190. Widget p,
  191. String name,
  192. ArgList args,
  193. Cardinal n) ;
  194. extern Widget DtCreatePrintSetupDialog(
  195. Widget ds_p,
  196. String name,
  197. ArgList sb_args,
  198. Cardinal sb_n) ;
  199. extern DtPrintSetupData* DtPrintCopySetupData(
  200. DtPrintSetupData* target,
  201. const DtPrintSetupData* source);
  202. extern XtEnum DtPrintFillSetupData(
  203. Widget psub,
  204. DtPrintSetupData* print_data);
  205. extern void DtPrintFreeSetupData(
  206. DtPrintSetupData* target);
  207. extern XtEnum DtPrintResetConnection(
  208. Widget psub,
  209. DtPrintResetConnectionMode m);
  210. #ifdef __cplusplus
  211. } /* Close scope of 'extern "C"' declaration which encloses file. */
  212. #endif
  213. #endif /* _DtPrint_h */
  214. /* DON'T ADD ANYTHING AFTER THIS #endif */