home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / prnt2.zip / AppDefs.H < prev    next >
C/C++ Source or Header  |  1995-05-04  |  7KB  |  161 lines

  1.  
  2. /* appdefs.h        Created:    1995-02-09  Revised:   1995-03-08    */
  3.  
  4. /* Module Definition Header                        */
  5.  
  6. /************************************************************************/
  7. /************************************************************************/
  8. /************************************************************************/
  9. /* DISCLAIMER OF WARRANTIES:                        */
  10. /* -------------------------                        */
  11. /* The following [enclosed] code is sample code    created    by IBM        */
  12. /* Corporation and Prominare Inc.  This    sample code is not part    of any    */
  13. /* standard IBM    product    and is provided    to you solely for the purpose    */
  14. /* of assisting    you in the development of your applications.  The code    */
  15. /* is provided "AS IS",    without    warranty of any    kind.  Neither IBM nor    */
  16. /* Prominare shall be liable for any damages arising out of your    */
  17. /* use of the sample code, even    if they    have been advised of the    */
  18. /* possibility of such damages.                        */
  19. /************************************************************************/
  20. /************************************************************************/
  21. /************************************************************************/
  22. /*               D I S C L A I M E R                */
  23. /* This    code is    provided on an as is basis with    no implied support.    */
  24. /* It should be    considered freeware that cannot    be rebundled as        */
  25. /* part    of a larger "*ware" offering without our consent.        */
  26. /************************************************************************/
  27. /************************************************************************/
  28. /************************************************************************/
  29.  
  30. /* Copyright ╕ International Business Machines Corp., 1995.        */
  31. /* Copyright ╕ 1995  Prominare Inc.  All Rights    Reserved.        */
  32.  
  33.  
  34.  
  35. /************************************************************************/
  36. /************************************************************************/
  37. /*    Structure Definitions                        */
  38. /************************************************************************/
  39. /************************************************************************/
  40.  
  41.  
  42. typedef    struct _QUEINFO
  43.    {
  44.    PSZ           pszName;           /* Device Name            */
  45.    PSZ           pszDriverName;       /* Driver Name            */
  46.    PSZ           pszPrinters;       /* Printers                */
  47.    PVOID       pDriverData;       /* Device Data            */
  48.    } QUEINFO ;           /* quei */
  49.  
  50. typedef    QUEINFO    *PQUEINFO; /* pquei */
  51.  
  52. typedef    struct _PRN
  53.    {
  54.    HAB        hAB;           /* Anchor block for list        */
  55.    CHAR        szQueue[256];       /* Default Queue            */
  56.    INT        iQueue;           /* Selected Printer Index        */
  57.    INT        cQueues;       /* Total Queue Count            */
  58.    PQUEINFO    pquei;           /* Queue Information            */
  59.    } PRN ;           /* prn */
  60.  
  61. typedef    PRN *PPRN;       /* pprn */
  62.  
  63. /* --- Font Selection Structure    Definitions ---------------------------    */
  64.  
  65. typedef    struct _FONTSEL               /* fsel */
  66.    {
  67.    LONG      lMatch;               /* Font Match Number        */
  68.    BOOL      fFixed;               /* Fixed    Size Flag        */
  69.    LONG      lPointSize;               /* Font Point Size        */
  70.    LONG      lNominalPointSize;           /* Nominal Font Point Size    */
  71.    CHAR      szFacename[32];           /* Font Face Name        */
  72.    } FONTSEL ;
  73.  
  74. typedef    FONTSEL    *PFONTSEL;
  75.  
  76. typedef    struct _FONTSIZE           /* fsiz */
  77.    {
  78.    PSZ      pszSize;               /* Font Match Number        */
  79.    LONG      lPointSize;               /* Font Point Size        */
  80.    } FONTSIZE ;
  81.  
  82. #define    TWIPS_POINT    20L
  83.  
  84. /* --- Re-entrant Printer Support -------------------------------------    */
  85.  
  86. typedef    struct _PRNDATA
  87.    {
  88.    PRN        prn;               /* Printer Information        */
  89.    FONTSEL  fsel;               /* Font Selection        */
  90.    LONG        cPrnFiles;               /* Files    Count            */
  91.    BOOL        fLineNumbers;           /* Include Line Numbers Flag    */
  92.    BOOL        fDateFooter;           /* Date and Time    Footer Flag    */
  93.    CHAR        szTitle[CCHMAXPATH];       /* Print    Title            */
  94.    CHAR        aszFiles[1][CCHMAXPATH];   /* Files    Array Start        */
  95.    } PRNDATA ;           /* prni */
  96.  
  97. #define    PRNDATASIZE (sizeof(PRNDATA) - CCHMAXPATH)
  98.  
  99. typedef    PRNDATA    *PPRNDATA;
  100.  
  101. #define    TAB 9               /* Tab Stop Value            */
  102. #define    LF 10               /* Line Feed    Value            */
  103. #define    CR 13               /* Carriage Return Value        */
  104. #define    TOF 12               /* Top of Form Value            */
  105. #define    EOF_MARK 26           /* End of File Mark Value        */
  106. #define    ESCAPE 27           /* Escape Value            */
  107. #define    TOP_MARGIN 4           /* Printout Top Margin Count        */
  108.  
  109. /************************************************************************/
  110. /************************************************************************/
  111. /*    Global Variable    Definitions                    */
  112. /************************************************************************/
  113. /************************************************************************/
  114.  
  115. extern FONTMETRICS fm;           /* Font Metrics Info            */
  116. extern HSWITCH       hSwitch;       /* Task List    Entry Handle        */
  117. extern HAB       hAB;           /* Program Anchor Block Handle    */
  118.  
  119. extern HPOINTER       hptrWait;       /* Wait Mouse Pointer Handle        */
  120. extern HPOINTER       hptrArrow;       /* Arrow Mouse Pointer Handle    */
  121.  
  122. extern HMQ  hmqPrnSetup;       /* Program Message Queue Handle    */
  123. extern HWND hwndPrnSetup;       /* Client Window Handle        */
  124. extern HWND hwndPrnSetupFrame;       /* Frame Window Handle        */
  125. extern HWND hmenuPrnSetup;       /* Menu Handle            */
  126.  
  127. extern HWND hwndHelp;           /* Help Window Handle        */
  128. extern HELPINIT    helpinit;       /* Help Initialization Table        */
  129.  
  130. extern PRN  prn;           /* Printer Control Holder        */
  131.  
  132.  
  133. /************************************************************************/
  134. /************************************************************************/
  135. /*    Function Prototype Definitions                    */
  136. /************************************************************************/
  137. /************************************************************************/
  138.  
  139. VOID    InitApp(HWND hwndFrame,    HWND hwndClient, PSZ pszWindowListTitle);
  140. HWND    CreateStdWindow(HWND hwndParent, ULONG flStyle,    ULONG flCreateFlags,
  141.             PSZ pszClientClass, PSZ    pszTitle, ULONG    styleClient,
  142.             HMODULE    hmod, ULONG idResources, PHWND phwndClient,
  143.             LONG x,    LONG y,    LONG cx, LONG cy);
  144. MRESULT    PDSKeyProc(HWND    hWnd, ULONG msg, MPARAM    mp1, MPARAM mp2);
  145. VOID    PDSGetTemplate(HWND hWnd, ULONG    id);
  146.  
  147. MRESULT    EXPENTRY PrintDriverWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  148.  
  149. BOOL    PrnCreatePrinterList(PPRN pprn);
  150. BOOL    PrnDestroyPrinterList(PPRN pprn);
  151. HDC    PrnOpenDC(PPRN pprn, PSZ pszDataType);
  152. BOOL    PrnQueryJobProperties(PPRN pprn, INT iQueue);
  153. PSZ    PrnQueryPrinterName(PPRN pprn);
  154. MRESULT    EXPENTRY PrnSetupDlgProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  155. MRESULT    EXPENTRY FilePrintDlgProc(HWND hWnd, ULONG msg,    MPARAM mp1, MPARAM mp2);
  156.  
  157. LONG SelectFont(HDC hDC, HPS hPS, CHAR *pszFacename,
  158.         LONG lPoints);
  159. LONG SelectScalableFont(HPS hPS, CHAR *pszFacename);
  160. LONG ScaleFont(HPS hPS,    CHAR *pszFacename, LONG    lSize);
  161.