home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / prtgrafc.zip / PRTGRAFC.H < prev    next >
Text File  |  1995-12-17  |  16KB  |  320 lines

  1. // **********************************************************************
  2. // Project     : PRTGRAPH                 Date    : 95/12/16
  3. // Module      : C Library
  4. // Filename    : prtgrafc.h               Author  : Peter Kanis
  5. // **********************************************************************
  6. //
  7. // Description: Export header file for PRTGRC.DLL
  8. //
  9. // **********************************************************************
  10. //
  11. // (c) ADD Consulting  All Rights Reserved
  12. //
  13. // **********************************************************************
  14.  
  15. #ifndef     PRTGRC_DEFINED
  16.     #define     PRTGRC_DEFINED
  17.  
  18. #ifdef __cplusplus
  19.     extern "C" {
  20. #endif
  21.  
  22. // **********************************************************************
  23. // Error return Constants
  24. // **********************************************************************
  25.  
  26. #define     PRTGR_OK                    0       // Success 
  27. #define     PRTGR_ERR_INV_HANDLE        1       // Invalid handle passed to function 
  28. #define     PRTGR_ERR_NO_PRINTER        2       // No printer has been defined 
  29. #define     PRTGR_ERR_PARAMETER         3       // Parameter was out of range 
  30. #define     PRTGR_ERR_INV_BITMAP        4       // Not a valid bitmap 
  31. #define     PRTGR_ERR_INV_FILENAME      5       // File not found 
  32. #define     PRTGR_ERR_INV_FONT          6       // Failed to load font 
  33. #define     PRTGR_ERR_JOB_OPEN          7       // Failed to open job 
  34. #define     PRTGR_ERR_NOT_TABLE         8       // Col/row func outside of table 
  35. #define     PRTGR_ERR_TABLE_HEADER      9       // Col/row func outside of table 
  36. #define     PRTGR_ERR_NO_JOB            10      // No print job is running 
  37. #define     PRTGR_ERR_PRINTING          11      // A print job is running 
  38. #define     PRTGR_ERR_READONLY          12      // You tried setting a read only property 
  39. #define     PRTGR_ERR_INV_PROP          13      // Invalid property requested 
  40. #define     PRTGR_ERR_INV_VALUE         14      // Property value is invalid 
  41.  
  42. // **********************************************************************
  43. // Fill Styles
  44. // **********************************************************************
  45.  
  46. #define     FILL_NONE           ( ULONG)0   // No fill for box 
  47. #define     FILL_FULL           ( ULONG)1   // full fill for box 
  48. #define     FILL_90             ( ULONG)2   // 90% tone fill for box 
  49. #define     FILL_80             ( ULONG)3   // 80% fill for box 
  50. #define     FILL_75             ( ULONG)4   // 75% fill for box 
  51. #define     FILL_70             ( ULONG)5   // 70% fill for box 
  52. #define     FILL_60             ( ULONG)6   // 60% fill for box 
  53. #define     FILL_HALF           ( ULONG)7   // Half tone fill for box 
  54. #define     FILL_LIGHT          ( ULONG)8   // Light tone fill for box 
  55. #define     FILL_VERT           ( ULONG)9   // Vertical line fill for box 
  56. #define     FILL_HORIZ          ( ULONG)10  // Horizontal line fill for box 
  57. #define     FILL_DIAGR45        ( ULONG)11  // 45° Diagonal left to right line fill for box 
  58. #define     FILL_DIAGR33        ( ULONG)12  // 33° Diagonal left to right line fill for box 
  59. #define     FILL_DIAGL45        ( ULONG)13  // 45° Diagonal right to left line fill for box 
  60. #define     FILL_DIAGL33        ( ULONG)14  // 33° Diagonal right to left line fill for box 
  61.  
  62. // **********************************************************************
  63. // Line thicknesses
  64. // **********************************************************************
  65.  
  66. #define     LINE_NONE           ( ULONG)0   // No line for box 
  67. #define     LINE_THIN           ( ULONG)14  // Thin line (0.25mm for box 
  68. #define     LINE_MEDIUM         ( ULONG)28  // meduium line (0.5mm) for box 
  69. #define     LINE_THICK          ( ULONG)56  // Thick line (1mm) for box 
  70.  
  71. #define     MSR_METRIC          "Metric"
  72. #define     MSR_INCH            "Inch"
  73.  
  74. // **********************************************************************
  75. // Print styles for Printing files
  76. // **********************************************************************
  77.  
  78. #define     PRT_CENTER          0
  79. #define     PRT_JUSTIFIED       1
  80. #define     PRT_RIGHT           2
  81. #define     PRT_LEFT            3
  82.  
  83. // **********************************************************************
  84. // max number of lines in a header
  85. // **********************************************************************
  86.  
  87. #define     PRTGR_MAX_HLINES    5           // Max lines in page header 
  88.  
  89. // **********************************************************************
  90. // Handle to a graphic printer
  91. // **********************************************************************
  92.  
  93. typedef LHANDLE   HGRPRT;
  94.  
  95. // **********************************************************************
  96. // Handle to header Definition
  97. // **********************************************************************
  98.  
  99. typedef LHANDLE   HHEADER;
  100.  
  101. // **********************************************************************
  102. // Handle to footer Definition
  103. // **********************************************************************
  104.  
  105. typedef LHANDLE   HFOOTER;
  106.  
  107. // **********************************************************************
  108. // Handle to table Definition
  109. // **********************************************************************
  110.  
  111. typedef LHANDLE   HTABLE;
  112.  
  113. // **********************************************************************
  114. // Hook function for new page. A call will be made to this function
  115. // every time a new page is created internally by the library and
  116. // before the page is printed. The format of the function is:
  117. //
  118. // BOOL APIENTRY MyNewPageFunc( HGRPRT    hp,
  119. //                              ULONG     page_num,
  120. //                              BOOL      in_table);
  121. //
  122. // first_page is set to true if this is the first page of the document
  123. //            i.e. during the PrtGOpenPrintJob call
  124. //
  125. // in_table   is set to true if a table is being printed that will
  126. //            continue over to the new page.
  127. // **********************************************************************
  128.  
  129. typedef VOID (APIENTRY FNNP)(HGRPRT, USHORT, BOOL);
  130. typedef FNNP *PFNNP;
  131.  
  132. // **********************************************************************
  133. // Type used for setting and getting properties for the printer
  134. // **********************************************************************
  135.  
  136. typedef union
  137.     {
  138.     BOOL    flag;           // Boolean property 
  139.     ULONG   numeric;        // Numeric properties 
  140.     PSZ     string;         // String properties 
  141.     } PROP_TYPE;
  142.  
  143. // **********************************************************************
  144. // Properties for the printer
  145. // **********************************************************************
  146.  
  147. #define     PRT_LEFTMARGIN          0
  148. #define     PRT_RIGHTMARGIN         1
  149. #define     PRT_TOPMARGIN           2
  150. #define     PRT_BOTTOMMARGIN        3
  151. #define     PRT_PAGEWIDTH           4
  152. #define     PRT_PAGEHEIGHT          5
  153. #define     PRT_PRINTING            6
  154. #define     PRT_CURRENTPRINTER      7
  155. #define     PRT_CURRENTDEVICE       8
  156. #define     PRT_DEFAULTPRINTER      9
  157. #define     PRT_LINESPACE           10 
  158. #define     PRT_VERSION             11
  159. #define     PRT_PRINTCOLOR          12
  160. #define     PRT_COLORENABLED        13
  161. #define     PRT_MEASURES            14
  162. #define     PRT_PAGENUM             15
  163. #define     PRT_JOBNAME             16
  164. #define     PRT_MINLEFTMAR          17
  165. #define     PRT_MINRIGHTMAR         18
  166. #define     PRT_MINTOPMAR           19
  167. #define     PRT_MINBOTTOMMAR        20
  168. #define     PRT_FORMNAME            21
  169. #define     PRT_FORMWIDTH           22
  170. #define     PRT_FORMHEIGHT          23
  171. #define     PRT_WORDBREAK           24
  172. #define     PRT_SHOWPROGRESS        25
  173. #define     PRT_PRINTERNUM          26
  174.  
  175. // **********************************************************************
  176. // Exported function definitions
  177. // **********************************************************************
  178.  
  179. USHORT  APIENTRY PrtGAbortPrintJob( HGRPRT);
  180. USHORT  APIENTRY PrtGClosePrintJob( HGRPRT);
  181. USHORT  APIENTRY PrtGSetMargins( HGRPRT, ULONG, ULONG, ULONG, ULONG, ULONG, ULONG);
  182. USHORT  APIENTRY PrtGSetFooter( HGRPRT, HFOOTER);
  183. USHORT  APIENTRY PrtGSetHeader( HGRPRT, HHEADER);
  184. USHORT  APIENTRY PrtGOpenPrintJob( HGRPRT, PSZ, USHORT, USHORT);
  185. USHORT  APIENTRY PrtGPrintLine( HGRPRT, PSZ, ULONG, PSZ);
  186. USHORT  APIENTRY PrtGPrintRight( HGRPRT, PSZ, ULONG, PSZ);
  187. USHORT  APIENTRY PrtGPrintJustified( HGRPRT, PSZ, ULONG, PSZ);
  188. USHORT  APIENTRY PrtGPrintCentered( HGRPRT, PSZ, ULONG, PSZ);
  189. USHORT  APIENTRY PrtGPrintLeft( HGRPRT, PSZ, ULONG, PSZ);
  190. USHORT  APIENTRY PrtGGoto( HGRPRT, ULONG, ULONG, BOOL);
  191. USHORT  APIENTRY PrtGPrintBox( HGRPRT, ULONG, ULONG, ULONG, ULONG, ULONG, ULONG, LONG, LONG);
  192. USHORT  APIENTRY PrtGTab(  HGRPRT);
  193. USHORT  APIENTRY PrtGStartTable( HGRPRT, HTABLE);
  194. USHORT  APIENTRY PrtGStartRow( HGRPRT);
  195. USHORT  APIENTRY PrtGStartCol( HGRPRT, USHORT);
  196. USHORT  APIENTRY PrtGEndRow( HGRPRT);
  197. USHORT  APIENTRY PrtGEndTable( HGRPRT);
  198. USHORT  APIENTRY PrtGNewPage( HGRPRT);
  199. VOID    APIENTRY PrtGPrinterList( HGRPRT, BOOL, PSZ*);
  200. PSZ     APIENTRY PrtGPrinterDialog( HGRPRT, HWND, PSZ);
  201. PSZ     APIENTRY PrtGFontDialog( HGRPRT, PSZ, PSZ);
  202. HGRPRT  APIENTRY PrtGInit( PFNNP);
  203. VOID    APIENTRY PrtGTerm( HGRPRT);
  204. USHORT  APIENTRY PrtGJobProperties( HGRPRT, HWND);
  205. USHORT  APIENTRY PrtGSetPrinter( HGRPRT, USHORT);
  206. USHORT  APIENTRY PrtGPrintBitmap( HGRPRT, PSZ, ULONG, ULONG, ULONG, ULONG, ULONG, LONG);
  207. USHORT  APIENTRY PrtGGetPageSize( HGRPRT, PULONG, PULONG);
  208. PSZ     APIENTRY PrtGCurrentPrinter( HGRPRT);
  209. USHORT  APIENTRY PrtGSetDlgButtonTexts( HGRPRT, PSZ, PSZ, PSZ);
  210.  
  211. USHORT  APIENTRY PrtGSetPrintColors( HGRPRT, LONG, LONG, LONG);
  212. USHORT  APIENTRY PrtGResetColHeader( HGRPRT, USHORT, PSZ);
  213.  
  214. BOOL    APIENTRY PrtGBlockFits( HGRPRT, PSZ, ULONG, PSZ);
  215. BOOL    APIENTRY PrtGLineFits( HGRPRT, PSZ, ULONG, PSZ);
  216. USHORT  APIENTRY PrtGPrintFile( HGRPRT, PSZ, ULONG, USHORT, PSZ);
  217. USHORT  APIENTRY PrtGPrintWinImage( HGRPRT, HWND, ULONG, ULONG, ULONG, ULONG, ULONG, LONG);
  218. USHORT  APIENTRY PrtGMoveX( HGRPRT, LONG, BOOL);
  219. USHORT  APIENTRY PrtGMoveY( HGRPRT, LONG, BOOL);
  220.  
  221. // **********************************************************************
  222. // Structure building Functions
  223. // **********************************************************************
  224.  
  225. HHEADER APIENTRY PrtGDefineHeader( BOOL,            // TRUE=print page headers 
  226.                                    BOOL,            // TRUE= on all pages 
  227.                                    PSZ,             // Font name 
  228.                                    ULONG,           // Font points 
  229.                                    ULONG,           // Box mode 
  230.                                    ULONG,           // Box line 
  231.                                    USHORT);         // Number of lines 
  232.  
  233. USHORT  APIENTRY PrtGDefineHdrColors( HHEADER,
  234.                                       LONG,         // text colour 
  235.                                       LONG,         // border colour 
  236.                                       LONG);        // fill colour 
  237.  
  238. USHORT  APIENTRY PrtGAddHeaderLine( HHEADER,        // handle returned by PrtGBuildHeader 
  239.                                     USHORT,         // line index (1 to 5) 
  240.                                     PSZ);           // Text 
  241.  
  242. USHORT  APIENTRY PrtGSetHdrLineFont( HHEADER,       // handle returned by PrtGBuildHeader 
  243.                                      USHORT,        // line index (1 to 5) 
  244.                                      PSZ,           // font for the line 
  245.                                      ULONG);        // point size for the line 
  246.  
  247. HFOOTER APIENTRY PrtGDefineFooter( BOOL,            // TRUE=print footers 
  248.                                    PSZ,             // Font for footer 
  249.                                    ULONG,           // Font points 
  250.                                    ULONG,           // box mode 
  251.                                    ULONG,           // box line 
  252.                                    PSZ);            // Text 
  253.  
  254. USHORT  APIENTRY PrtGDefineFtrColors( HFOOTER,
  255.                                       LONG,         // text colour 
  256.                                       LONG,         // border colour 
  257.                                       LONG);        // fill colour 
  258.  
  259. HTABLE  APIENTRY PrtGDefineTable( BOOL,             // TRUE=boxed 
  260.                                   BOOL,             // TRUE= header defined 
  261.                                   BOOL,             // TRUE=print header on all pages 
  262.                                   ULONG,            // Cell line thickness 
  263.                                   ULONG,            // Cell fill type 
  264.                                   ULONG,            // Header line thickness 
  265.                                   ULONG,            // Header fill type 
  266.                                   PSZ,              // Header font 
  267.                                   ULONG,            // Header font points 
  268.                                   USHORT,           // Number of columns 
  269.                                   ULONG);           // Left edge of table
  270.  
  271. USHORT  APIENTRY PrtGDefineTableColors( HTABLE,        // handle to the table definition 
  272.                                         LONG,          // cell text colour 
  273.                                         LONG,          // cell border colour 
  274.                                         LONG,          // cell fill colour 
  275.                                         LONG,          // header text colour 
  276.                                         LONG,          // header border colour 
  277.                                         LONG);         // header fill colour 
  278.  
  279. USHORT  APIENTRY PrtGAddColumn( HTABLE,             // Handle returned from PrtGDefineTable 
  280.                                 USHORT,             // Column number (1 to 12) 
  281.                                 ULONG,              // width in in units of measure 
  282.                                 PSZ);               // Header text 
  283.  
  284. HHEADER APIENTRY PrtGDestroyHdrDef( HHEADER);
  285. HFOOTER APIENTRY PrtGDestroyFtrDef( HFOOTER);
  286. HTABLE  APIENTRY PrtGDestroyTblDef( HTABLE);
  287.  
  288.  
  289. // *********************************************************************
  290. // Old functions still supported
  291. // *********************************************************************
  292.  
  293. USHORT  APIENTRY PrtGBox( HGRPRT, ULONG, ULONG, ULONG, ULONG, ULONG, ULONG);
  294. USHORT  APIENTRY PrtGBoxColor( HGRPRT, ULONG, ULONG, ULONG, ULONG, ULONG, ULONG, LONG, LONG);
  295. USHORT  APIENTRY PrtGBitMap( HGRPRT, PSZ, ULONG, ULONG, ULONG, ULONG, ULONG);
  296. USHORT  APIENTRY PrtGBitMapColor( HGRPRT, PSZ, ULONG, ULONG, ULONG, ULONG, ULONG, LONG);
  297. USHORT  APIENTRY PrtGSetLineSpace( HGRPRT, USHORT);
  298. USHORT  APIENTRY PrtGWriteln( HGRPRT, PSZ, ULONG, PSZ);
  299. USHORT  APIENTRY PrtGJustRight( HGRPRT, PSZ, ULONG, PSZ);
  300. USHORT  APIENTRY PrtGJustified( HGRPRT, PSZ, ULONG, PSZ);
  301. USHORT  APIENTRY PrtGCentre( HGRPRT, PSZ, ULONG, PSZ);
  302. USHORT  APIENTRY PrtGWrite( HGRPRT, PSZ, ULONG, PSZ);
  303. PSZ     APIENTRY PrtGPrinterDlg( HGRPRT, HWND, PSZ);
  304. PSZ     APIENTRY PrtGFontDlg( HGRPRT, PSZ, PSZ);
  305. USHORT  APIENTRY PrtGJobProps( HGRPRT, HWND);
  306. PSZ     APIENTRY PrtGVersion( VOID);
  307.  
  308. #ifdef __cplusplus
  309.     }
  310. #endif
  311.  
  312. #endif
  313. // **********************************************************************
  314. //
  315. //                         (c) ADD Consulting 1995
  316. //
  317. //                               END OF FILE.
  318. //
  319. // **********************************************************************
  320.