home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / SREC / PENAPP.H_ / PENAPP.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.9 KB  |  85 lines

  1. /************************************************************
  2.  
  3.    Header file for PENAPP.C
  4.  
  5.  
  6. ************************************************************/
  7.  
  8. #ifndef _INC_PENAPP
  9. #define _INC_PENAPP
  10.  
  11. /******** Prototypes *********/
  12.  
  13. LRESULT CALLBACK __export MainWndProc (HWND, UINT, WPARAM, LPARAM);
  14. LRESULT CALLBACK __export InputWndProc (HWND, UINT, WPARAM, LPARAM);
  15. LRESULT CALLBACK __export InfoWndProc (HWND, UINT, WPARAM, LPARAM);
  16. LRESULT CALLBACK __export RawWndProc (HWND, UINT, WPARAM, LPARAM);
  17.  
  18. BOOL FLoadRec (VOID);
  19. BOOL FInitInstance (HANDLE hInstance, HANDLE hPrevInstance, int cmdShow);
  20. BOOL FInitApp (HANDLE hInstance);
  21. VOID CopyRawData (LPRCRESULT lprcresult);
  22. VOID DrawArrow (HWND hwnd, HDC hdc);
  23. VOID DrawShape (HWND hwnd, HDC hdc);
  24. VOID DrawRawData (HDC hdc);
  25. int  NSetRawExtents (HDC hdc, LPPENDATAHEADER lppndt, LPRECT lprectWnd);
  26. VOID EnumerateStrokes (HDC hdc, LPRECT lprectWnd, int nWidth);
  27. VOID SetGraphWindow (int mi);
  28.  
  29. /******** Macros *********/
  30.  
  31. /* GetLPWidth(): Convert given ink width into logical coordinates.  For
  32. ** these purposes, logical coordinates are actually tablet coordinates.
  33. */
  34. #define GetLPWidth(hdc, nInkWidth, pnLPWidth)      \
  35.             {                                      \
  36.             POINT ptT = {nInkWidth, nInkWidth};    \
  37.             DPtoTP(&ptT, 1);                       \
  38.             *pnLPWidth = ptT.x;                    \
  39.             }
  40.  
  41. /* The following macros return window dimensions.
  42. */
  43. #define  XRawWnd(dxParent)    (0)
  44. #define  YRawWnd(dyParent)    (DyInfoWnd(dyParent))
  45. #define  DxRawWnd(dxParent)      ((dxParent)/3)
  46. #define  DyRawWnd(dyParent)      ((dyParent)-DyInfoWnd(dyParent))
  47.  
  48. #define  XInfoWnd(dxParent)      (0)
  49. #define  YInfoWnd(dyParent)      (0)
  50. #define  DxInfoWnd(dxParent)     ((dxParent)/3)
  51. #define  DyInfoWnd(dyParent)     ((dyParent)/2)
  52.  
  53. #define  XInputWnd(dxParent)     (DxRawWnd(dxParent))
  54. #define  YInputWnd(dyParent)     (0)
  55. #define  DxInputWnd(dxParent)    (dxParent-XInputWnd(dxParent))
  56. #define  DyInputWnd(dyParent)    (dyParent-YInputWnd(dyParent))
  57.  
  58.  
  59. /******** Constants *********/
  60.  
  61. #define rcrtNoResults   (RCRT_NOSYMBOLMATCH | RCRT_ALREADYPROCESSED | RCRT_NORECOG)
  62. #define rgbRed          RGB(255, 0, 0)
  63.  
  64. #define szPenAppWnd  "Sample Pen App"        /* Window titles */
  65. #define szInputWnd   "Input"
  66. #define szInfoWnd    "Info"
  67. #define szRawWnd     "Raw Data"
  68.  
  69. #define szPenAppClass      "PASampleClass"   /* Window class names */
  70. #define szPenAppInputClass "PAInputClass"
  71. #define szPenAppInfoClass  "PAInfoClass"
  72. #define szPenAppRawClass   "PARawClass"
  73.  
  74. #define szSampleRec  "SREC.DLL"        /* Recognizer DLL names */
  75. #define szShapeRec   "SHAPEREC.DLL"
  76.  
  77. #define cchMax       256         /* Count of characters for generic buffer */
  78.  
  79. #define dwLength     80          /* Arrow and border dimensions */
  80. #define dxArrow         10
  81. #define dyArrow         5
  82. #define cBorder         5
  83.  
  84. #endif /* !_INC_PENAPP */
  85.