home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / SMF.ZIP / SMF.H < prev    next >
Text File  |  1990-05-21  |  5KB  |  162 lines

  1. /* smf.h.  Header file for smokey magic fixer
  2.  *  contains defines, user messages, function prototypes, & global variables
  3.  */
  4.  
  5. #define ID_RESOURCE  1
  6.  
  7. /* sizes and locations of the metric windows */
  8. #define CXMET   180
  9. #define CYMET   265
  10. #define XMET0    5
  11. #define YMET0    5
  12. #define XMET1   455
  13. #define YMET1    5
  14.  
  15. /* general width for many windows */
  16. #define WIDTH   180
  17.  
  18. /* number of steps for FlyWinWin() */
  19. #define FWW_SHORT   10
  20. #define FWW_MEDIUM  30
  21. #define FWW_LONG    50
  22.  
  23. #define FWW_MODSIZE  5
  24.  
  25.  
  26. /* window ids of the buttons on the main window */
  27. #define ID_SF_SELECT        0x0300
  28. #define ID_SF_CREATE        0x0301
  29. #define ID_SF_SETCHB        0x0302
  30.  
  31. #define ID_SF_TEST          0x0500
  32.  
  33.  
  34. /* font identifier for gpicreatelogfont.  just some unique number [1,255] */
  35. #define OUR_LCID        27L
  36.  
  37. /* the following are messages passed to or from the main window */
  38.  
  39. #define WM_ALL_MAIN_FONTSELECTED  WM_USER+100
  40.  
  41. #define WM_MAIN_MET_CHANGE        WM_USER+200
  42.                                        /* mp1: &fm
  43.                                         */
  44. #define WM_MAIN_FAT_CHANGE   WM_USER+201
  45.                                        /* mp1: &fm
  46.                                         */
  47. #define WM_MAIN_CHB_FILLCHB  WM_USER+300
  48.                                        /* mp1: hps
  49.                                         */
  50. #define WM_MAIN_CHB_READ     WM_USER+301
  51.                                        /* mp1: &charbundle,
  52.                                         * return: TRUE iff successful
  53.                                         */
  54. #define WM_MAIN_FAT_READ     WM_USER+302
  55.                                        /* mp1: &fattrs
  56.                                         * return: TRUE iff successful
  57.                                         */
  58.  
  59. #define WM_MAIN_TEST_GETPS  WM_USER+400
  60.                                         /* return: hps */
  61. #define WM_MAIN_TEST_GETFM  WM_USER+401
  62.                                         /* return: &fm */
  63.  
  64.  
  65. /* entry field i.d.s for the FATTRS dialog box */
  66. #define F_usRecordLength    0x1001
  67. #define F_fsSelection       0x1002
  68. #define F_lMatch            0x1003
  69. #define F_szFacename        0x1004
  70. #define F_idRegistry        0x1005
  71. #define F_usCodePage        0x1006
  72. #define F_lMaxBaselineExt   0x1007
  73. #define F_lAveCharWidth     0x1008
  74. #define F_fsType            0x1009
  75. #define F_fsFontUse         0x100A
  76.  
  77. /* entry field i.d.s for the Charbundle dialog box */
  78. #define CB_lColor           0x2001
  79. #define CB_lBackColor       0x2002
  80. #define CB_usMixMode        0x2003
  81. #define CB_usBackMixMode    0x2004
  82. #define CB_usSet            0x2005
  83. #define CB_usPrecision      0x2006
  84. #define CB_sizfxCell_X      0x2007
  85. #define CB_sizfxCell_Y      0x2008
  86. #define CB_ptlAngle_X       0x2009
  87. #define CB_ptlAngle_Y       0x200A
  88. #define CB_ptlShear_X       0x200B
  89. #define CB_ptlShear_Y       0x200C
  90. #define CB_usDirection      0x200D
  91.  
  92.  
  93.  
  94. /* function prototypes and window handles */
  95.  
  96. VOID    FrameInit(HWND);
  97. MRESULT EXPENTRY ClientWndProc (HWND, USHORT, MPARAM, MPARAM);
  98. HWND    hwndFrame, hwndMain;  /* hwndMain is the main client area */
  99. HWND    hwndCreate, hwndSelect, hwndSetCHB;
  100.  
  101. VOID    AllInit (HWND);
  102. MRESULT EXPENTRY allWndProc (HWND, USHORT, MPARAM, MPARAM);
  103. HWND    hwndAll;
  104.  
  105. int cdecl MetInit (HWND);
  106. MRESULT EXPENTRY MetWndProc (HWND, USHORT, MPARAM, MPARAM );
  107. HWND    hMet0, hMet1;
  108.  
  109. VOID    FattrInit(HWND);
  110. MRESULT EXPENTRY FattrWndProc (HWND, USHORT, MPARAM, MPARAM);
  111. HWND    hwndFattrs, hwndCharbundle;
  112.  
  113. VOID    TestInit(HWND);
  114. MRESULT EXPENTRY TestWndProc (HWND, USHORT, MPARAM, MPARAM);
  115. HWND    hwndTest;
  116.  
  117.  
  118. /* metric windows contain an index in their extra bytes.
  119.  *  It indexes an array of the following structures.
  120.  *  The array is global, but only referenced by the metwndproc
  121.  */
  122. typedef struct  _metExtraBytes {
  123.     HWND   hwndVscroll ;
  124.     SHORT  sVscrollMax;
  125.     SHORT  sVscrollPos;
  126.     SHORT  cxChar;
  127.     SHORT  cyChar;
  128.     SHORT  cyDesc;
  129.     SHORT  cxClient;
  130.     SHORT  cyClient;
  131.     HPS    hFontPS;
  132.     HDC    hFontDC;
  133.     LONG   theFontSem;
  134.     FONTMETRICS theFont;
  135. } metExtraBytes;
  136.  
  137.  
  138.  
  139. /* a small font.  used to setting pres params */
  140. static CHAR  szCourier[] = "8.Tms Rmn";
  141.  
  142. /* see GpiSetAttrs/ GpiQueryAttrs */
  143. static LONG  flAttrsMask =
  144.      CBB_COLOR | CBB_BACK_COLOR | CBB_MIX_MODE |
  145.      CBB_BACK_MIX_MODE | CBB_SET | CBB_MODE | CBB_BOX |
  146.      CBB_ANGLE | CBB_SHEAR | CBB_DIRECTION;
  147.  
  148.  
  149.  
  150.  
  151. /* global variables. */
  152.  
  153. HAB     hab;
  154.  
  155. CHARBUNDLE  charbundle;  /* mirrors the charbundle window */
  156. FATTRS      fattrs;      /* mirrors the fattrs window */
  157.  
  158. #define NCHAR 100
  159. CHAR   buffer[NCHAR];  /* storage for the face name pulled out of window */
  160.  
  161. FONTMETRICS  fm;    /* holds dynamic f.m. after create log font */
  162.