PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/cde/lib/DtPrint/Print.h

https://bitbucket.org/tifan/cde
C Header | 233 lines | 136 code | 23 blank | 74 comment | 0 complexity | 57a4fa50556a68f499973bb92f9261b0 MD5 | raw file
Possible License(s): LGPL-2.1, IPL-1.0, 0BSD
  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 librararies 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. #include <X11/extensions/Print.h>
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. /*
  46. * Class record constants
  47. */
  48. externalref WidgetClass dtPrintSetupBoxWidgetClass;
  49. typedef struct _DtPrintSetupBoxClassRec * DtPrintSetupBoxWidgetClass;
  50. typedef struct _DtPrintSetupBoxRec * DtPrintSetupBoxWidget;
  51. #ifndef DtIsPrintSetupBox
  52. #define DtIsPrintSetupBox(w) (XtIsSubclass (w, dtPrintSetupBoxWidgetClass))
  53. #endif
  54. /*
  55. * Resource Names
  56. */
  57. #define DtNcancelCallback "cancelCallback"
  58. #define DtNclosePrintDisplayCallback "closePrintDisplayCallback"
  59. #define DtNcopies "copies"
  60. #define DtNdescription "description"
  61. #define DtNdestroyContextCallback "destroyContextCallback"
  62. #define DtNfileName "fileName"
  63. #ifndef DtNminimizeButtons
  64. # define DtNminimizeButtons "minimizeButtons"
  65. #endif
  66. #define DtNoptionCount "optionCount"
  67. #define DtNoptions "options"
  68. #define DtNprintCallback "printCallback"
  69. #define DtNprintDestination "printDestination"
  70. #define DtNprinterInfoProc "printerInfoProc"
  71. #define DtNprinterName "printerName"
  72. #define DtNprintSetupMode "printSetupMode"
  73. #define DtNselectFileProc "selectFileProc"
  74. #define DtNselectPrinterProc "selectPrinterProc"
  75. #define DtNsetupCallback "setupCallback"
  76. #define DtNverifyPrinterProc "verifyPrinterProc"
  77. #define DtNworkAreaLocation "workAreaLocation"
  78. #define DtCCancelCallback "CancelCallback"
  79. #define DtCClosePrintDisplayCallback "ClosePrintDisplayCallback"
  80. #define DtCCopies "Copies"
  81. #define DtCDescription "Description"
  82. #define DtCDestroyContextCallback "DestroyContextCallback"
  83. #define DtCFileName "FileName"
  84. #ifndef DtCMinimizeButtons
  85. # define DtCMinimizeButtons "MinimizeButtons"
  86. #endif
  87. #define DtCOptionCount "OptionCount"
  88. #define DtCOptions "Options"
  89. #define DtCPrintCallback "PrintCallback"
  90. #define DtCPrintDestination "PrintDestination"
  91. #define DtCPrinterInfoProc "PrinterInfoProc"
  92. #define DtCPrinterName "PrinterName"
  93. #define DtCPrintSetupMode "PrintSetupMode"
  94. #define DtCSelectFileProc "SelectFileProc"
  95. #define DtCSelectPrinterProc "SelectPrinterProc"
  96. #define DtCSetupCallback "SetupCallback"
  97. #define DtCVerifyPrinterProc "VerifyPrinterProc"
  98. #define DtCWorkAreaLocation "WorkAreaLocation"
  99. #define DtRPrintSetupProc "PrintSetupProc"
  100. /*
  101. * DtNsetupMode Resource Values
  102. */
  103. enum {
  104. DtPRINT_SETUP_PLAIN,
  105. DtPRINT_SETUP_XP
  106. };
  107. /*
  108. * DtNworkAreaLocation Resource Values
  109. */
  110. enum {
  111. DtWORK_AREA_NONE,
  112. DtWORK_AREA_TOP,
  113. DtWORK_AREA_TOP_AND_BOTTOM,
  114. DtWORK_AREA_BOTTOM
  115. };
  116. /*
  117. * DtNprintDestination Resource Values
  118. */
  119. enum { DtPRINT_NO_DESTINATION, DtPRINT_TO_PRINTER, DtPRINT_TO_FILE };
  120. /*
  121. * DtNprinterNameMode Resource Values
  122. */
  123. enum { DtSHORT_NAME, DtMEDIUM_NAME, DtLONG_NAME };
  124. /*
  125. * Mode values for DtPrintSetupBoxResetConnection()
  126. */
  127. typedef enum {
  128. DtPRINT_CLOSE_CONNECTION,
  129. DtPRINT_RELEASE_CONNECTION
  130. } DtPrintResetConnectionMode;
  131. /*
  132. * Callback Reasons
  133. */
  134. enum {
  135. DtPRINT_CR_NONE,
  136. DtPRINT_CR_CANCEL,
  137. DtPRINT_CR_CLOSE_PRINT_DISPLAY,
  138. DtPRINT_CR_PRINT,
  139. DtPRINT_CR_SETUP
  140. };
  141. /*
  142. * DtPrint proecdure return values
  143. */
  144. enum {
  145. DtPRINT_SUCCESS,
  146. DtPRINT_BAD_PARM,
  147. DtPRINT_FAILURE,
  148. DtPRINT_INVALID_DISPLAY,
  149. DtPRINT_NOT_XP_DISPLAY,
  150. DtPRINT_NO_CONNECTION,
  151. DtPRINT_NO_DEFAULT,
  152. DtPRINT_NO_DEFAULT_DISPLAY,
  153. DtPRINT_NO_PRINTER,
  154. DtPRINT_PRINTER_MISSING
  155. };
  156. enum {
  157. DtPRINT_HINT_MESSAGES_OK,
  158. DtPRINT_HINT_NO_MESSAGES
  159. };
  160. /*
  161. * PrintSetupBox Callback Structure Definition
  162. */
  163. typedef struct _DtPrintSetupData
  164. {
  165. String printer_name;
  166. Display *print_display;
  167. XPContext print_context;
  168. XtEnum destination;
  169. String dest_info;
  170. XtEnum messages_hint;
  171. } DtPrintSetupData;
  172. typedef struct _DtPrintSetupCallbackStruct
  173. {
  174. int reason;
  175. XEvent *event;
  176. DtPrintSetupData *print_data;
  177. } DtPrintSetupCallbackStruct;
  178. /*
  179. * PrintSetupBox Procedure Resource Type Definition
  180. */
  181. typedef XtEnum (*DtPrintSetupProc)(Widget, DtPrintSetupData*);
  182. /*
  183. * Public Function Declarations
  184. */
  185. extern Widget DtCreatePrintSetupBox(
  186. Widget p,
  187. String name,
  188. ArgList args,
  189. Cardinal n) ;
  190. extern Widget DtCreatePrintSetupDialog(
  191. Widget ds_p,
  192. String name,
  193. ArgList sb_args,
  194. Cardinal sb_n) ;
  195. extern DtPrintSetupData* DtPrintCopySetupData(
  196. DtPrintSetupData* target,
  197. const DtPrintSetupData* source);
  198. extern XtEnum DtPrintFillSetupData(
  199. Widget psub,
  200. DtPrintSetupData* print_data);
  201. extern void DtPrintFreeSetupData(
  202. DtPrintSetupData* target);
  203. extern XtEnum DtPrintResetConnection(
  204. Widget psub,
  205. DtPrintResetConnectionMode m);
  206. #ifdef __cplusplus
  207. } /* Close scope of 'extern "C"' declaration which encloses file. */
  208. #endif
  209. #endif /* _DtPrint_h */
  210. /* DON'T ADD ANYTHING AFTER THIS #endif */