home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / penwin.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  106KB  |  2,360 lines

  1. /****************************************************************************\
  2. *                                                                            *
  3. * PENWIN.H -  Pen Windows functions, types, and definitions                  *
  4. *                                                                            *
  5. *             Version 2.0                                                    *
  6. *                                                                            *
  7. *             Copyright (c) 1992-1995 Microsoft Corp. All rights reserved.   *
  8. *                                                                            *
  9. *******************************************************************************
  10. *
  11. * The following symbols control inclusion of various parts of this file;
  12. * (indented identifiers are included by the previous main identifier):
  13. *
  14. * #define:         To prevent inclusion of:
  15. *
  16. * PENVER           Pen Windows version number (0x0200).  To exclude
  17. *                   definitions introduced in version 2.0 (or above)
  18. *                   #define PENVER 0x0100 before #including <penwin.h>
  19. *
  20. * NOPENALC         Alphabet Code definitions and macros
  21. * NOPENAPPS        Pen Applications: Screen Keyboard
  22. * NOPENCTL         H/BEDIT, IEDIT, and pen-enabled USER controls, including:
  23. *   NOPENBEDIT      : Boxed Edit Control
  24. *   NOPENIEDIT      : Ink Edit Control
  25. *   NOPENHEDIT      : (H)Edit control
  26. * NOPENDATA        PenData APIs and definitions
  27. * NOPENDICT        Dictionary support
  28. * NOPENDRIVER      Pen Driver definitions, incl OEM
  29. * NOPENHRC         Handwriting Recognizer APIs and definitions
  30. * NOPENINKPUT      Inking and Input APIs and definitions
  31. * NOPENMISC        Miscellaneous Info and Utility APIs and definitions
  32. * NOPENMSGS        Pen Messages and definitions
  33. * NOPENNLS         National Language Support
  34. * NOPENRC1         Recognition Context APIs and definitions (1.0)
  35. * NOPENRES         Pen resources, including:
  36. *   NOPENBMP        : Pen-related bitmaps
  37. *   NOPENCURS       : Pen-related cursors
  38. * NOPENTARGET      Targeting APIs and definitions
  39. * NOPENVIRTEVENT   Virtual Event layer APIs
  40. *
  41. * _WIN32           non-Win32 components, subincludes:
  42. *                   : NOPENAPPS, NOPENDICT, NOPENRC1, NOPENVIRTEVENT
  43. *
  44. * "FBC" in the comments means that the feature exists only for
  45. * backward compatibility. It should not be used by new applications.
  46. \****************************************************************************/
  47.  
  48. #ifndef _INC_PENWIN
  49. #define _INC_PENWIN
  50.  
  51. #include <windows.h>
  52.  
  53. #ifndef _WIN32
  54. #ifndef RC_INVOKED
  55. #pragma pack(1)
  56. #endif /* RC_INVOKED */
  57. #endif //!_WIN32
  58.  
  59. #ifdef __cplusplus
  60. extern "C" {
  61. #endif /* __cplusplus */
  62.  
  63. #ifndef PENVER      /* may be pre-defined; otherwise assume version 2.0 */
  64.     #define PENVER  0x0200
  65. #endif //!PENVER
  66.  
  67. #ifdef _WIN32
  68.     #define NOPENAPPS
  69.     #define NOPENDICT
  70.     #define NOPENRC1
  71.     #define NOPENVIRTEVENT
  72.     #define NOPENAPIFUN
  73. #endif //_WIN32
  74.  
  75. #ifndef NOPENAPPS   // not available in WIN32
  76. #ifndef RC_INVOKED
  77.     #include <skbapi.h>
  78. #endif /* !RC_INVOKED */
  79. #endif /*!NOPENAPPS */
  80.  
  81. // other subsets:
  82.  
  83. #ifdef NOPENCTL
  84.     #define NOPENBEDIT
  85.     #define NOPENIEDIT
  86. #endif /* NOPENCTL */
  87.  
  88. #ifdef NOPENRES
  89.     #define NOPENBMP
  90.     #define NOPENCURS
  91. #endif /* NOPENRES */
  92.  
  93. //////////////////////////////////////////////////////////////////////////////
  94. /****** Definitions 1: for everything including RC compiler *****************/
  95.  
  96. //---------------------------------------------------------------------------
  97. #ifndef NOPENALC
  98.  
  99. // Enabled Alphabet:
  100. #define ALC_DEFAULT          0x00000000L // nothing
  101. #define ALC_LCALPHA          0x00000001L // a..z
  102. #define ALC_UCALPHA          0x00000002L // A..Z
  103. #define ALC_NUMERIC          0x00000004L // 0..9
  104. #define ALC_PUNC             0x00000008L // !-;`"?()&.,; and backslash
  105. #define ALC_MATH             0x00000010L // %^*()-+={}<>,/.
  106. #define ALC_MONETARY         0x00000020L // ,.$ or local
  107. #define ALC_OTHER            0x00000040L // @#|_~[]
  108. #define ALC_ASCII            0x00000080L // restrict to 7-bit chars 20..7f
  109. #define ALC_WHITE            0x00000100L // white space
  110. #define ALC_NONPRINT         0x00000200L // sp tab ret ctrl glyphs
  111. #define ALC_DBCS             0x00000400L // allow DBCS variety of SBCS
  112. #define ALC_JIS1             0x00000800L // kanji JPN, ShiftJIS 1 only
  113. #define ALC_GESTURE          0x00004000L // gestures
  114. #define ALC_USEBITMAP        0x00008000L // use rc.rgbfAlc to enable chars
  115. #define ALC_HIRAGANA         0x00010000L // hiragana JPN
  116. #define ALC_KATAKANA         0x00020000L // katakana JPN
  117. #define ALC_KANJI            0x00040000L // kanji JPN, ShiftJIS 1+2+3
  118. #define ALC_GLOBALPRIORITY   0x10000000L
  119. #define ALC_OEM              0x0FF80000L // OEM recognizer-specific
  120. #define ALC_RESERVED         0xE0003000L // avail for future use
  121. #define ALC_NOPRIORITY       0x00000000L // for alcPriority == none
  122.  
  123. #define ALC_ALPHA\
  124.     (ALC_LCALPHA | ALC_UCALPHA)                                // 0x00000003L
  125.  
  126. #define ALC_ALPHANUMERIC\
  127.     (ALC_ALPHA | ALC_NUMERIC)                                  // 0x00000007L
  128.  
  129. #define ALC_SYSMINIMUM\
  130.     (ALC_ALPHANUMERIC | ALC_PUNC | ALC_WHITE | ALC_GESTURE)    // 0x0000410FL
  131.  
  132. #define ALC_ALL\
  133.     (ALC_SYSMINIMUM | ALC_MATH | ALC_MONETARY\
  134.     | ALC_OTHER | ALC_NONPRINT)                                // 0x0000437FL
  135.  
  136. #define ALC_KANJISYSMINIMUM\
  137.     (ALC_SYSMINIMUM | ALC_HIRAGANA | ALC_KATAKANA | ALC_JIS1)  // 0x0003490FL
  138.  
  139. #define ALC_KANJIALL\
  140.     (ALC_ALL | ALC_HIRAGANA | ALC_KATAKANA | ALC_KANJI)        // 0x0007437FL
  141.  
  142. #endif /*!NOPENALC */
  143.  
  144. //---------------------------------------------------------------------------
  145. #ifndef NOPENBEDIT
  146. // box edit styles:
  147. #define BXS_NONE             0x0000U // none
  148. #define BXS_RECT             0x0001U // use rectangle instead of cusp
  149. #define BXS_BOXCROSS         0x0004U // use cross at box center
  150. #define BXS_MASK             0x0007U // mask for above
  151.  
  152. #endif /*!NOPENBEDIT */
  153.  
  154. //---------------------------------------------------------------------------
  155. #ifndef NOPENBMP
  156.  
  157. // Public Bitmaps :
  158. #define OBM_SKBBTNUP            32767
  159. #define OBM_SKBBTNDOWN          32766
  160. #define OBM_SKBBTNDISABLED      32765
  161.  
  162. #define OBM_ZENBTNUP            32764
  163. #define OBM_ZENBTNDOWN          32763
  164. #define OBM_ZENBTNDISABLED      32762
  165.  
  166. #define OBM_HANBTNUP            32761
  167. #define OBM_HANBTNDOWN          32760
  168. #define OBM_HANBTNDISABLED      32759
  169.  
  170. #define OBM_KKCBTNUP            32758
  171. #define OBM_KKCBTNDOWN          32757
  172. #define OBM_KKCBTNDISABLED      32756
  173.  
  174. #define OBM_SIPBTNUP            32755
  175. #define OBM_SIPBTNDOWN          32754
  176. #define OBM_SIPBTNDISABLED      32753
  177.  
  178. #define OBM_PTYBTNUP            32752
  179. #define OBM_PTYBTNDOWN          32751
  180. #define OBM_PTYBTNDISABLED      32750
  181. #endif /*!NOPENBMP */
  182.  
  183. //---------------------------------------------------------------------------
  184. #ifndef NOPENCURS
  185. // Default pen cursor to indicate writing, points northwest
  186. #define IDC_PEN         MAKEINTRESOURCE(32631)
  187.  
  188. // alternate select cursor: upsidedown standard arrow, points southeast
  189. #define IDC_ALTSELECT   MAKEINTRESOURCE(32501)
  190.  
  191. #endif /*!NOPENCURS */
  192.  
  193. //---------------------------------------------------------------------------
  194. #ifndef NOPENHRC
  195. // special SYV values:
  196. #define SYV_NULL                0x00000000L
  197. #define SYV_UNKNOWN             0x00000001L
  198. #define SYV_EMPTY               0x00000003L
  199. #define SYV_BEGINOR             0x00000010L
  200. #define SYV_ENDOR               0x00000011L
  201. #define SYV_OR                  0x00000012L
  202. #define SYV_SOFTNEWLINE         0x00000020L
  203. #define SYV_SPACENULL           0x00010000L   // SyvCharacterToSymbol('\0')
  204.  
  205. // SYV values for gestures:
  206. #define SYV_SELECTFIRST         0x0002FFC0L   // . means circle in following
  207. #define SYV_LASSO               0x0002FFC1L   // lasso o-tap
  208. #define SYV_SELECTLEFT          0x0002FFC2L   // no glyph
  209. #define SYV_SELECTRIGHT         0x0002FFC3L   // no glyph
  210. #define SYV_SELECTLAST          0x0002FFCFL   // 16 SYVs reserved for selection
  211.  
  212. #define SYV_CLEARCHAR           0x0002FFD2L   // d.
  213. #define SYV_HELP                0x0002FFD3L   // no glyph
  214. #define SYV_KKCONVERT           0x0002FFD4L   // k.
  215. #define SYV_CLEAR               0x0002FFD5L   // d.
  216. #define SYV_INSERT              0x0002FFD6L   // ^.
  217. #define SYV_CONTEXT             0x0002FFD7L   // m.
  218. #define SYV_EXTENDSELECT        0x0002FFD8L   // no glyph
  219. #define SYV_UNDO                0x0002FFD9L   // u.
  220. #define SYV_COPY                0x0002FFDAL   // c.
  221. #define SYV_CUT                 0x0002FFDBL   // x.
  222. #define SYV_PASTE               0x0002FFDCL   // p.
  223. #define SYV_CLEARWORD           0x0002FFDDL   // no glyph
  224. #define SYV_USER                0x0002FFDEL   // reserved
  225. #define SYV_CORRECT             0x0002FFDFL   // check.
  226.  
  227. #define SYV_BACKSPACE           0x00020008L   // no glyph
  228. #define SYV_TAB                 0x00020009L   // t.
  229. #define SYV_RETURN              0x0002000DL   // n.
  230. #define SYV_SPACE               0x00020020L   // s.
  231.  
  232. // Application specific gestures, Circle a-z and Circle A-Z:
  233. #define SYV_APPGESTUREMASK      0x00020000L
  234. #define SYV_CIRCLEUPA           0x000224B6L   // map into Unicode space
  235. #define SYV_CIRCLEUPZ           0x000224CFL   //  for circled letters
  236. #define SYV_CIRCLELOA           0x000224D0L
  237. #define SYV_CIRCLELOZ           0x000224E9L
  238.  
  239. // SYV definitions for shapes:
  240. #define SYV_SHAPELINE           0x00040001L
  241. #define SYV_SHAPEELLIPSE        0x00040002L
  242. #define SYV_SHAPERECT           0x00040003L
  243. #define SYV_SHAPEMIN            SYV_SHAPELINE // alias
  244. #define SYV_SHAPEMAX            SYV_SHAPERECT // alias
  245.  
  246. // SYV classes:
  247. #define SYVHI_SPECIAL           0
  248. #define SYVHI_ANSI              1
  249. #define SYVHI_GESTURE           2
  250. #define SYVHI_KANJI             3
  251. #define SYVHI_SHAPE             4
  252. #define SYVHI_UNICODE           5
  253. #define SYVHI_VKEY              6
  254. #endif //!NOPENHRC
  255.  
  256. //---------------------------------------------------------------------------
  257. #ifndef NOPENIEDIT
  258.  
  259. // IEdit Pop-up Menu Command Items
  260. #define IEM_UNDO                1          // Undo
  261. #define IEM_CUT                 2          // Cut
  262. #define IEM_COPY                3          // Copy
  263. #define IEM_PASTE               4          // Paste
  264. #define IEM_CLEAR               5          // Clear
  265. #define IEM_SELECTALL           6          // Select All Strokes
  266. #define IEM_ERASE               7          // Use Eraser
  267. #define IEM_PROPERTIES          8          // DoProperties
  268. #define IEM_LASSO               9          // Use Lasso
  269. #define IEM_RESIZE              10         // Resize
  270.  
  271. #define IEM_USER                    100    // first menu item# available to app
  272.  
  273. // IEdit Style Attributes
  274. #define IES_BORDER              0x0001   // ctl has a border
  275. #define IES_HSCROLL             0x0002   // ctl is horizontally scrollable
  276. #define IES_VSCROLL             0x0004   // ctl is vertically scrollable
  277. #define IES_OWNERDRAW           0x0008   // ctl will be drawn by parent window
  278.  
  279. #endif /*!NOPENIEDIT */
  280.  
  281. #ifndef RC_INVOKED  // ... rest of file of no interest to rc compiler
  282. //////////////////////////////////////////////////////////////////////////////
  283.  
  284. /****** Definitions 2: RC compiler excluded ********************************/
  285.  
  286. //---------------------------------------------------------------------------
  287. #ifndef NOPENDATA
  288.  
  289. // PenData API constants:
  290.  
  291. // ANIMATEINFO callback options:
  292. #define AI_CBSTROKE             0xFFFF  // Animate callback after every stroke
  293.  
  294. // ANIMATEINFO options:
  295. #define AI_SKIPUPSTROKES        0x0001  // ignore upstrokes in animation
  296.  
  297. // CompressPenData() API options:
  298. #define CMPD_COMPRESS           0x0001
  299. #define CMPD_DECOMPRESS         0x0002
  300.  
  301. // CreatePenDataRegion types:
  302. #define CPDR_BOX                1       // bounding box
  303. #define CPDR_LASSO              2       // lasso
  304.  
  305. // CreatePenData (CPD) and Pen Hardware (PHW) Flags;
  306. // The order of PHW flags is important:
  307. #define CPD_DEFAULT             0x047F  // CPD_TIME | PHW_ALL
  308. #define CPD_USERBYTE            0x0100  // alloc 8 bits/stroke
  309. #define CPD_USERWORD            0x0200  // alloc 16 bits/stroke
  310. #define CPD_USERDWORD           0x0300  // alloc 32 bits/stroke
  311. #define CPD_TIME                0x0400  // maintain abs time info per stroke
  312.  
  313. // DrawPenDataEx() flags/options:
  314. #define DPD_HDCPEN              0x0001  // use pen selected in HDC
  315. #define DPD_DRAWSEL             0x0002  // draw the selection
  316.  
  317. // ExtractPenDataPoints options (EPDP_xx):
  318. #define EPDP_REMOVE             0x0001  // Remove points from the pendata
  319.  
  320. // ExtractPenDataStrokes options and modifiers (EPDS_xx):
  321. #define EPDS_SELECT             1       // selected strokes
  322. #define EPDS_STROKEINDEX        2       // index
  323. #define EPDS_USER               3       // user-specific value
  324. #define EPDS_PENTIP             4       // complete pentip
  325. #define EPDS_TIPCOLOR           5       // pentip color
  326. #define EPDS_TIPWIDTH           6       // pentip width
  327. #define EPDS_TIPNIB             7       // pentip nib style
  328. #define EPDS_INKSET             8       // inkset match
  329.  
  330. #define EPDS_EQ                 0x0000  // default: same as
  331. #define EPDS_LT                 0x0010  // all strokes less than
  332. #define EPDS_GT                 0x0020  // all strokes greater than
  333. #define EPDS_NOT                0x0040  // all strokes not matching
  334. #define EPDS_NE                 0x0040  // alias
  335. #define EPDS_GTE                0x0050  // alias for NOT LT
  336. #define EPDS_LTE                0x0060  // alias for NOT GT
  337.  
  338. #define EPDS_REMOVE             0x8000  // remove matching strokes from source
  339.  
  340. // GetPenDataAttributes options (GPA_xx):
  341. #define GPA_MAXLEN              1   // length of longest stroke
  342. #define GPA_POINTS              2   // total number of points
  343. #define GPA_PDTS                3   // PDTS_xx bits
  344. #define GPA_RATE                4   // get sampling rate
  345. #define GPA_RECTBOUND           5   // bounding rect of all points
  346. #define GPA_RECTBOUNDINK        6   // ditto, adj for fat ink
  347. #define GPA_SIZE                7   // size of pendata in bytes
  348. #define GPA_STROKES             8   // total number of strokes
  349. #define GPA_TIME                9   // absolute time at creation of pendata
  350. #define GPA_USER                10  // number of user bytes available: 0, 1, 2, 4
  351. #define GPA_VERSION             11  // version number of pendata
  352.  
  353. // GetStrokeAttributes options (GSA_xx):
  354. #define GSA_PENTIP              1   // get stroke pentip (color, width, nib)
  355. #define GSA_PENTIPCLASS         2   // same as GSA_PENTIP
  356. #define GSA_USER                3   // get stroke user value
  357. #define GSA_USERCLASS           4   // get stroke's class user value
  358. #define GSA_TIME                5   // get time of stroke
  359. #define GSA_SIZE                6   // get size of stroke in points and bytes
  360. #define GSA_SELECT              7   // get selection status of stroke
  361. #define GSA_DOWN                8   // get up/down state of stroke
  362. #define GSA_RECTBOUND           9   // get the bounding rectangle of the stroke
  363.  
  364. // GetStrokeTableAttributes options (GSA_xx):
  365. #define GSA_PENTIPTABLE         10  // get table-indexed pentip
  366. #define GSA_SIZETABLE           11  // get count of Stroke Class Table entries
  367. #define GSA_USERTABLE           12  // get table-indexed user value
  368.  
  369. #ifndef IX_END
  370. #define IX_END                  0xFFFF  // to or past last available index
  371. #endif //!IX_END
  372.  
  373. // PenTip:
  374. #define PENTIP_NIBDEFAULT       ((BYTE)0)       // default pen tip nib style
  375. #define PENTIP_HEIGHTDEFAULT    ((BYTE)0)       // default pen tip nib height
  376. #define PENTIP_OPAQUE           ((BYTE)0xFF)    // default opaque ink
  377. #define PENTIP_HILITE           ((BYTE)0x80)
  378. #define PENTIP_TRANSPARENT      ((BYTE)0)
  379.  
  380. // General PenData API return values (PDR_xx):
  381. #define PDR_NOHIT               3       // hit test failed
  382. #define PDR_HIT                 2       // hit test succeeded
  383. #define PDR_OK                  1       // success
  384. #define PDR_CANCEL              0       // callback cancel or impasse
  385.  
  386. #define PDR_ERROR               (-1)    // parameter or unspecified error
  387. #define PDR_PNDTERR             (-2)    // bad pendata
  388. #define PDR_VERSIONERR          (-3)    // pendata version error
  389. #define PDR_COMPRESSED          (-4)    // pendata is compressed
  390. #define PDR_STRKINDEXERR        (-5)    // stroke index error
  391. #define PDR_PNTINDEXERR         (-6)    // point index error
  392. #define PDR_MEMERR              (-7)    // memory error
  393. #define PDR_INKSETERR           (-8)    // bad inkset
  394. #define PDR_ABORT               (-9)    // pendata has become invalid, e.g.
  395. #define PDR_NA                  (-10)   // option not available (pw kernel)
  396.  
  397. #define PDR_USERDATAERR         (-16)   // user data error
  398. #define PDR_SCALINGERR          (-17)   // scale error
  399. #define PDR_TIMESTAMPERR        (-18)   // timestamp error
  400. #define PDR_OEMDATAERR          (-19)   // OEM data error
  401. #define PDR_SCTERR              (-20)   // SCT error (full)
  402.  
  403. // PenData Scaling (PDTS):
  404. #define PDTS_LOMETRIC           0       // 0.01mm
  405. #define PDTS_HIMETRIC           1       // 0.001mm
  406. #define PDTS_HIENGLISH          2       // 0.001"
  407. #define PDTS_STANDARDSCALE      2       // PDTS_HIENGLISH   alias
  408. #define PDTS_DISPLAY            3       // display pixel
  409. #define PDTS_ARBITRARY          4       // app-specific scaling
  410. #define PDTS_SCALEMASK          0x000F  // scaling values in low nibble
  411.  
  412. // CompactPenData() API trim options:
  413. #define PDTT_DEFAULT            0x0000
  414. #define PDTT_PENINFO            0x0100
  415. #define PDTT_UPPOINTS           0x0200
  416. #define PDTT_OEMDATA            0x0400
  417. #define PDTT_COLLINEAR          0x0800
  418. #define PDTT_COLINEAR           0x0800  // alt sp alias
  419. #define PDTT_DECOMPRESS         0x4000  // decompress the data
  420. #define PDTT_COMPRESS           0x8000
  421. #define PDTT_ALL                0x0F00  // PENINFO|UPPOINTS|OEMDATA|COLLINEAR
  422.  
  423. #define PHW_NONE                0x0000  // no OEMdata
  424. #define PHW_PRESSURE            0x0001  // report pressure in OEMdata if avail
  425. #define PHW_HEIGHT              0x0002  // ditto height
  426. #define PHW_ANGLEXY             0x0004  // ditto xy angle
  427. #define PHW_ANGLEZ              0x0008  // ditto z angle
  428. #define PHW_BARRELROTATION      0x0010  // ditto barrel rotation
  429. #define PHW_OEMSPECIFIC         0x0020  // ditto OEM-specific value
  430. #define PHW_PDK                 0x0040  // report per-point PDK_xx in OEM data
  431. #define PHW_ALL                 0x007F  // report everything
  432.  
  433. // compact pen data trim options: matches PDTT_values (see above)
  434. #define PDTS_COMPRESS2NDDERIV   0x0010  // compress using 2nd deriv
  435. #define PDTS_COMPRESSMETHOD     0x00F0  // sum of compress method flags
  436. #define PDTS_NOPENINFO          0x0100  // removes PENINFO struct from header
  437. #define PDTS_NOUPPOINTS         0x0200  // remove up pts
  438. #define PDTS_NOOEMDATA          0x0400  // remove OEM data
  439. #define PDTS_NOCOLLINEAR        0x0800  // remove successive identical pts
  440. #define PDTS_NOCOLINEAR         0x0800  // alt sp alias
  441. #define PDTS_NOTICK             0x1000  // remove timing info (2.0)
  442. #define PDTS_NOUSER             0x2000  // remove user info (2.0)
  443. #define PDTS_NOEMPTYSTROKES     0x4000  // remove empty strokes (2.0)
  444. #define PDTS_COMPRESSED         0x8000  // perform lossless compression
  445.  
  446. // SetStrokeAttributes options (SSA_xx):
  447. #define SSA_PENTIP              1       // set stroke tip (color, width, nib)
  448. #define SSA_PENTIPCLASS         2       // set stroke's class pentip
  449. #define SSA_USER                3       // set stroke user value
  450. #define SSA_USERCLASS           4       // set stroke's class user value
  451. #define SSA_TIME                5       // set time of stroke
  452. #define SSA_SELECT              6       // set selection status of stroke
  453. #define SSA_DOWN                7       // set up/down state of stroke
  454.  
  455. // SetStrokeTableAttributes options (SSA_xx):
  456. #define SSA_PENTIPTABLE         8       // set table-indexed pentip
  457. #define SSA_USERTABLE           9       // set table-indexed user value
  458.  
  459. // PenTip flag bits:
  460. #define TIP_ERASECOLOR          1       // erase specific color pentip.rgb
  461.  
  462. // TrimPenData() API options:
  463. #define TPD_RECALCSIZE          0x0000  // no trim, used for resize calc
  464. #define TPD_USER                0x0080  // per-stroke user info
  465. #define TPD_TIME                0x0100  // per-stroke timing info
  466. #define TPD_UPPOINTS            0x0200  // x-y data up points
  467. #define TPD_COLLINEAR           0x0400  // colinear and coincident points
  468. #define TPD_COLINEAR            0x0400  // alt sp alias
  469. #define TPD_PENINFO             0x0800  // PenInfo struct and all OEM
  470. #define TPD_PHW                 0x1000  // OEM & pdk except stroke tick or user
  471. #define TPD_OEMDATA             0x1000  // ditto
  472. #define TPD_EMPTYSTROKES        0x2000  // strokes with zero points
  473. #define TPD_EVERYTHING          0x3FFF  // everything (incl PHW_xx) except down pts
  474.  
  475. #endif /*!NOPENDATA */
  476.  
  477. //---------------------------------------------------------------------------
  478. #ifndef NOPENDICT   // not available in WIN32
  479.  
  480. // Dictionary:
  481. #define cbDictPathMax           255
  482. #define DIRQ_QUERY              1
  483. #define DIRQ_DESCRIPTION        2
  484. #define DIRQ_CONFIGURE          3
  485. #define DIRQ_OPEN               4
  486. #define DIRQ_CLOSE              5
  487. #define DIRQ_SETWORDLISTS       6
  488. #define DIRQ_STRING             7
  489. #define DIRQ_SUGGEST            8
  490. #define DIRQ_ADD                9
  491. #define DIRQ_DELETE             10
  492. #define DIRQ_FLUSH              11
  493. #define DIRQ_RCCHANGE           12
  494. #define DIRQ_SYMBOLGRAPH        13
  495. #define DIRQ_INIT               14
  496. #define DIRQ_CLEANUP            15
  497. #define DIRQ_COPYRIGHT          16
  498. #define DIRQ_USER               4096
  499. #endif /*!NOPENDICT */
  500.  
  501. //---------------------------------------------------------------------------
  502. #ifndef NOPENDRIVER
  503.  
  504. // Pen driver:
  505. #define BITPENUP                0x8000
  506.  
  507. // Pen Driver messages:
  508. #define DRV_SetPenDriverEntryPoints     DRV_RESERVED+1
  509. #define DRV_SetEntryPoints              DRV_RESERVED+1  // alias
  510. #define DRV_RemovePenDriverEntryPoints  DRV_RESERVED+2
  511. #define DRV_RemoveEntryPoints           DRV_RESERVED+2  // alias
  512. #define DRV_SetPenSamplingRate          DRV_RESERVED+3
  513. #define DRV_SetPenSamplingDist          DRV_RESERVED+4
  514. #define DRV_GetName                     DRV_RESERVED+5
  515. #define DRV_GetVersion                  DRV_RESERVED+6
  516. #define DRV_GetPenInfo                  DRV_RESERVED+7
  517. #define DRV_PenPlayStart                DRV_RESERVED+8
  518. #define DRV_PenPlayBack                 DRV_RESERVED+9
  519. #define DRV_PenPlayStop                 DRV_RESERVED+10
  520. #define DRV_GetCalibration              DRV_RESERVED+11
  521. #define DRV_SetCalibration              DRV_RESERVED+12
  522. #define DRV_Reserved1                   DRV_RESERVED+13
  523. #define DRV_Reserved2                   DRV_RESERVED+14
  524. #define DRV_Query                       DRV_RESERVED+15
  525. #define DRV_GetPenSamplingRate          DRV_RESERVED+16
  526. #define DRV_Calibrate                   DRV_RESERVED+17
  527.  
  528. // Pen Driver Playback constants:
  529. #define PLAY_VERSION_10_DATA 0
  530. #define PLAY_VERSION_20_DATA 1
  531.  
  532. // Pen Driver return values:
  533. #define DRV_FAILURE             0x00000000
  534. #define DRV_SUCCESS             0x00000001
  535. #define DRV_BADPARAM1           0xFFFFFFFF
  536. #define DRV_BADPARAM2           0xFFFFFFFE
  537. #define DRV_BADSTRUCT           0xFFFFFFFD
  538.  
  539. // Pen Driver register messages flags:
  540. #define PENREG_DEFAULT          0x00000002
  541. #define PENREG_WILLHANDLEMOUSE  0x00000001
  542.  
  543. #define MAXOEMDATAWORDS         6             // rgwOemData[MAXOEMDATAWORDS]
  544.  
  545. // Pen Collection Mode termination conditions:
  546. // (note update doc for PCMINFO struct if change these)
  547. #define PCM_PENUP               0x00000001L   // stop on penup
  548. #define PCM_RANGE               0x00000002L   // stop on leaving range
  549. #define PCM_INVERT              0x00000020L   // stop on tap of opposite end
  550. #define PCM_RECTEXCLUDE         0x00002000L   // click in exclude rect
  551. #define PCM_RECTBOUND           0x00004000L   // click outside bounds rect
  552. #define PCM_TIMEOUT             0x00008000L   // no activity for timeout ms
  553. // new for 2.0:
  554. #define PCM_RGNBOUND            0x00010000L   // click outside bounding region
  555. #define PCM_RGNEXCLUDE          0x00020000L   // click in exclude region
  556. #define PCM_DOPOLLING           0x00040000L   // polling mode
  557. #define PCM_TAPNHOLD            0x00080000L   // check for Tap And Hold
  558. #define PCM_ADDDEFAULTS         RC_LDEFAULTFLAGS /* 0x80000000L */
  559.  
  560. // Pen Device Capabilities:
  561. #define PDC_INTEGRATED          0x00000001L   // display==digitizer
  562. #define PDC_PROXIMITY           0x00000002L   // detect non-contacting pen
  563. #define PDC_RANGE               0x00000004L   // event on out-of-range
  564. #define PDC_INVERT              0x00000008L   // pen opposite end detect
  565. #define PDC_RELATIVE            0x00000010L   // pen driver coords
  566. #define PDC_BARREL1             0x00000020L   // barrel button 1 present
  567. #define PDC_BARREL2             0x00000040L   // ditto 2
  568. #define PDC_BARREL3             0x00000080L   // ditto 3
  569.  
  570. // Pen Driver Kit states:
  571. #define PDK_NULL                0x0000  // default to no flags set
  572. #define PDK_UP                  0x0000  // PDK_NULL alias
  573. #define PDK_DOWN                0x0001  // pentip switch ON due to contact
  574. #define PDK_BARREL1             0x0002  // barrel1 switch depressed
  575. #define PDK_BARREL2             0x0004  // ditto 2
  576. #define PDK_BARREL3             0x0008  // ditto 3
  577. #define PDK_SWITCHES            0x000f  // sum of down + barrels 1,2,3
  578. #define PDK_TRANSITION          0x0010  // set by GetPenHwData
  579. #define PDK_UNUSED10            0x0020
  580. #define PDK_UNUSED20            0x0040
  581. #define PDK_INVERTED            0x0080  // other end of pen used as tip
  582. #define PDK_PENIDMASK           0x0F00  // bits 8..11 physical pen id (0..15)
  583. #define PDK_UNUSED1000          0x1000
  584. #define PDK_INKSTOPPED          0x2000  // Inking stopped
  585. #define PDK_OUTOFRANGE          0x4000  // pen left range (OEM data invalid)
  586. #define PDK_DRIVER              0x8000  // pen (not mouse) event
  587.  
  588. #define PDK_TIPMASK             0x0001  // mask for testing PDK_DOWN
  589.  
  590. // OEM-specific values for Pen Driver:
  591. #define PDT_NULL                0
  592. #define PDT_PRESSURE            1       // pressure supported
  593. #define PDT_HEIGHT              2       // height above tablet
  594. #define PDT_ANGLEXY             3       // xy (horiz) angle supported
  595. #define PDT_ANGLEZ              4       // z (vert) angle supported
  596. #define PDT_BARRELROTATION      5       // barrel is rotated
  597. #define PDT_OEMSPECIFIC         16      // max
  598.  
  599. // Denotes the ID of the current packet
  600. #define PID_CURRENT             (UINT)(-1)
  601.  
  602. // Recognition and GetPenHwData Returns:
  603. #define REC_OEM                 (-1024) // first recognizer-specific debug val
  604. #define REC_LANGUAGE            (-48)   // unsupported language field
  605. #define REC_GUIDE               (-47)   // invalid GUIDE struct
  606. #define REC_PARAMERROR          (-46)   // bad param
  607. #define REC_INVALIDREF          (-45)   // invalid data ref param
  608. #define REC_RECTEXCLUDE         (-44)   // invalid rect
  609. #define REC_RECTBOUND           (-43)   // invalid rect
  610. #define REC_PCM                 (-42)   // invalid lPcm parameter
  611. #define REC_RESULTMODE          (-41)
  612. #define REC_HWND                (-40)   // invalid window to send results to
  613. #define REC_ALC                 (-39)   // invalid enabled alphabet
  614. #define REC_ERRORLEVEL          (-38)   // invalid errorlevel
  615. #define REC_CLVERIFY            (-37)   // invalid verification level
  616. #define REC_DICT                (-36)   // invalid dict params
  617. #define REC_HREC                (-35)   // invalid recognition handle
  618. #define REC_BADEVENTREF         (-33)   // invalid wEventRef
  619. #define REC_NOCOLLECTION        (-32)   // collection mode not set
  620. #define REC_DEBUG               (-32)   // beginning of debug values
  621. #define REC_POINTEREVENT        (-31)   // tap or tap&hold event
  622. #define REC_BADHPENDATA         (-9)    // invalid hpendata header or locking
  623. #define REC_OOM                 (-8)    // out of memory error
  624. #define REC_NOINPUT             (-7)    // no data collected before termination
  625. #define REC_NOTABLET            (-6)    // tablet not physically present
  626. #define REC_BUSY                (-5)    // another task is using recognizer
  627. #define REC_BUFFERTOOSMALL      (-4)    // ret by GetPenHwEventData()
  628. #define REC_ABORT               (-3)    // recog stopped by EndPenCollection()
  629. #define REC_NA                  (-2)    // function not available
  630. #define REC_OVERFLOW            (-1)    // data overflow
  631. #define REC_OK                  0       // interrim completion
  632. #define REC_TERMBOUND           1       // hit outside bounding rect
  633. #define REC_TERMEX              2       // hit inside exclusion rect
  634. #define REC_TERMPENUP           3       // pen up
  635. #define REC_TERMRANGE           4       // pen left proximity
  636. #define REC_TERMTIMEOUT         5       // no writing for timeout ms
  637. #define REC_DONE                6       // normal completion
  638. #define REC_TERMOEM             512     // first recognizer-specific retval
  639.  
  640. #endif /*!NOPENDRIVER */
  641.  
  642. //---------------------------------------------------------------------------
  643. #ifndef NOPENHRC
  644.  
  645. // Handwriting Recognizer:
  646.  
  647. // GetResultsHRC options:
  648. #define GRH_ALL                 0       // get all results
  649. #define GRH_GESTURE             1       // get only gesture results
  650. #define GRH_NONGESTURE          2       // get all but gesture results
  651.  
  652. // Gesture sets for EnableGestureSetHRC (bit flags):
  653. #define GST_SEL                 0x00000001L   // sel & lasso
  654. #define GST_CLIP                0x00000002L   // cut copy paste
  655. #define GST_WHITE               0x00000004L   // sp tab ret
  656. #define GST_KKCONVERT           0x00000008L   // kkconvert
  657. #define GST_EDIT                0x00000010L   // insert correct undo clear
  658. #define GST_SYS                 0x00000017L   // all of the above
  659. #define GST_CIRCLELO            0x00000100L   // lowercase circle
  660. #define GST_CIRCLEUP            0x00000200L   // uppercase circle
  661. #define GST_CIRCLE              0x00000300L   // all circle
  662. #define GST_ALL                 0x00000317L   // all of the above
  663.  
  664. // General HRC API return values (HRCR_xx):
  665. #define HRCR_NORESULTS          4       // No possible results  to be found
  666. #define HRCR_COMPLETE           3       // finished recognition
  667. #define HRCR_GESTURE            2       // recognized gesture
  668. #define HRCR_OK                 1       // success
  669. #define HRCR_INCOMPLETE         0       // recognizer is processing input
  670. #define HRCR_ERROR              (-1)    // invalid param or unspecified error
  671. #define HRCR_MEMERR             (-2)    // memory error
  672. #define HRCR_INVALIDGUIDE       (-3)    // invalid GUIDE struct
  673. #define HRCR_INVALIDPNDT        (-4)    // invalid pendata
  674. #define HRCR_UNSUPPORTED        (-5)    // recognizer does not support feature
  675. #define HRCR_CONFLICT           (-6)    // training conflict
  676. #define HRCR_HOOKED             (-8)    // hookasaurus ate the result
  677.  
  678. // system wordlist for AddWordsHWL:
  679. #define HWL_SYSTEM              ((HWL)1)   // magic value means system wordlist
  680.  
  681. // inkset returns:
  682. #define ISR_ERROR               (-1)    // Memory or other error
  683. #define ISR_BADINKSET           (-2)    // bad source inkset
  684. #define ISR_BADINDEX            (-3)    // bad inkset index
  685.  
  686. #ifndef IX_END
  687. #define IX_END                  0xFFFF  // to or past last available index
  688. #endif //!IX_END
  689.  
  690. #define MAXHOTSPOT              8       // max number of hotspots possible
  691.  
  692. // ProcessHRC time constants:
  693. #define PH_MAX                  0xFFFFFFFFL   // recognize rest of ink
  694. #define PH_DEFAULT              0xFFFFFFFEL   // reasonable time
  695. #define PH_MIN                  0xFFFFFFFDL   // minimum time
  696.  
  697. // ResultsHookHRC options:
  698. #define RHH_STD                 0       // GetResultsHRC
  699. #define RHH_BOX                 1       // GetBoxResultsHRC
  700.  
  701. // SetWordlistCoercionHRC options:
  702. #define SCH_NONE                0       // turn off coercion
  703. #define SCH_ADVISE              1       // macro is hint only
  704. #define SCH_FORCE               2       // some result is forced from macro
  705.  
  706. // Symbol Context Insert Modes
  707. #define SCIM_INSERT             0       // insert
  708. #define SCIM_OVERWRITE          1       // overwrite
  709.  
  710. // SetResultsHookHREC options:
  711. #define SRH_HOOKALL             (HREC)1 // hook all recognizers
  712.  
  713. // SetInternationalHRC options:
  714. #define SSH_RD                  1       // to right and down (English)
  715. #define SSH_RU                  2       // to right and up
  716. #define SSH_LD                  3       // to left and down (Hebrew)
  717. #define SSH_LU                  4       // to left and up
  718. #define SSH_DL                  5       // down and to the left (Chinese)
  719. #define SSH_DR                  6       // down and to the right (Chinese)
  720. #define SSH_UL                  7       // up and to the left
  721. #define SSH_UR                  8       // up and to the right
  722.  
  723. #define SIH_ALLANSICHAR         1       // use all ANSI
  724.  
  725. // TrainHREC options:
  726. #define TH_QUERY                0       // query the user if conflict
  727. #define TH_FORCE                1       // ditto no query
  728. #define TH_SUGGEST              2       // abandon training if conflict
  729.  
  730. // Return values for WCR_TRAIN Function
  731. #define TRAIN_NONE              0x0000
  732. #define TRAIN_DEFAULT           0x0001
  733. #define TRAIN_CUSTOM            0x0002
  734. #define TRAIN_BOTH              (TRAIN_DEFAULT | TRAIN_CUSTOM)
  735.  
  736. // Control values for TRAINSAVE
  737. #define TRAIN_SAVE              0       // save changes that have been made
  738. #define TRAIN_REVERT            1       // discard changes that have been made
  739. #define TRAIN_RESET             2       // use factory settings
  740.  
  741. // ConfigRecognizer and ConfigHREC options:
  742. #define WCR_RECOGNAME           0       // ConfigRecognizer 1.0
  743. #define WCR_QUERY               1
  744. #define WCR_CONFIGDIALOG        2
  745. #define WCR_DEFAULT             3
  746. #define WCR_RCCHANGE            4
  747. #define WCR_VERSION             5
  748. #define WCR_TRAIN               6
  749. #define WCR_TRAINSAVE           7
  750. #define WCR_TRAINMAX            8
  751. #define WCR_TRAINDIRTY          9
  752. #define WCR_TRAINCUSTOM         10
  753. #define WCR_QUERYLANGUAGE       11
  754. #define WCR_USERCHANGE          12
  755.  
  756. // ConfigHREC options:
  757. #define WCR_PWVERSION           13      // ver of PenWin recognizer supports
  758. #define WCR_GETALCPRIORITY      14      // get recognizer's ALC priority
  759. #define WCR_SETALCPRIORITY      15      // set recognizer's ALC priority
  760. #define WCR_GETANSISTATE        16      // get ALLANSICHAR state
  761. #define WCR_SETANSISTATE        17      // set ALLANSICHAR if T
  762. #define WCR_GETHAND             18      // get writing hand
  763. #define WCR_SETHAND             19      // set writing hand
  764. #define WCR_GETDIRECTION        20      // get writing direction
  765. #define WCR_SETDIRECTION        21      // set writing direction
  766. #define WCR_INITRECOGNIZER      22      // init recognizer and set user name
  767. #define WCR_CLOSERECOGNIZER     23      // close recognizer
  768.  
  769. #define WCR_PRIVATE             1024
  770.  
  771. // sub-functions of WCR_USERCHANGE
  772. #define CRUC_NOTIFY             0       // user name change
  773. #define CRUC_REMOVE             1       // user name deleted
  774.  
  775. // Word List Types:
  776. #define WLT_STRING              0       // one string
  777. #define WLT_STRINGTABLE         1       // array of strings
  778. #define WLT_EMPTY               2       // empty wordlist
  779. #define WLT_WORDLIST            3       // handle to a wordlist
  780.  
  781. #endif /*!NOPENHRC */
  782.  
  783. //---------------------------------------------------------------------------
  784. #ifndef NOPENIEDIT
  785.  
  786. // IEdit Background Options
  787. #define IEB_DEFAULT             0       // default (use COLOR_WINDOW)
  788. #define IEB_BRUSH               1       // paint background with brush
  789. #define IEB_BIT_UL              2       // bitmap, upper-left aligned
  790. #define IEB_BIT_CENTER          3       // bitmap, centered in control
  791. #define IEB_BIT_TILE            4       // bitmap, tiled repeatedly in ctl
  792. #define IEB_BIT_STRETCH         5       // bitmap, stretched to fit ctl
  793. #define IEB_OWNERDRAW           6       // parent window will draw background
  794.  
  795. // IEdit Drawing Options
  796. #define IEDO_NONE               0x0000  // no drawing
  797. #define IEDO_FAST               0x0001  // ink drawn as fast as possible (def)
  798. #define IEDO_SAVEUPSTROKES      0x0002  // save upstrokes
  799. #define IEDO_RESERVED           0xFFFC  // reserved bits
  800.  
  801. // IEdit Input Options
  802. #define IEI_MOVE                0x0001  // move ink into ctl
  803. #define IEI_RESIZE              0x0002  // resize ink to fit within ctl
  804. #define IEI_CROP                0x0004  // discard ink outside of ctl
  805. #define IEI_DISCARD             0x0008  // discard all ink if any outside ctl
  806. #define IEI_RESERVED            0xFFF0  // reserved
  807.  
  808. // IEdit IE_GETINK options
  809. #define IEGI_ALL                0x0000  // get all ink from control
  810. #define IEGI_SELECTION          0x0001  // get selected ink from control
  811.  
  812. // IEdit IE_SETMODE/IE_GETMODE (mode) options
  813. #define IEMODE_READY            0       // default inking, moving, sizing mode
  814. #define IEMODE_ERASE            1       // erasing Mode
  815. #define IEMODE_LASSO            2       // lasso selection mode
  816.  
  817. // IEdit    Notification Bits
  818. #define IEN_NULL                0x0000  // null notification
  819. #define IEN_PDEVENT             0x0001  // notify about pointing device events
  820. #define IEN_PAINT               0x0002  // send painting-related notifications
  821. #define IEN_FOCUS               0x0004  // send focus-related notifications
  822. #define IEN_SCROLL              0x0008  // send scrolling notifications
  823. #define IEN_EDIT                0x0010  // send editing/change notifications
  824. #define IEN_PROPERTIES          0x0020  // send properties dialog notification
  825. #define IEN_RESERVED            0xFF80  // reserved
  826.  
  827. // IEdit Return Values
  828. #define IER_OK                  0       // success
  829. #define IER_NO                  0       // ctl cannot do request
  830. #define IER_YES                 1       // ctl can do request
  831. #define IER_ERROR               (-1)    // unspecified error; operation failed
  832. #define IER_PARAMERR            (-2)    // bogus lParam value, bad handle, etc
  833. #define IER_OWNERDRAW           (-3)    // can't set drawopts in ownerdraw ctl
  834. #define IER_SECURITY            (-4)    // security protection disallows action
  835. #define IER_SELECTION           (-5)    // nothing selected in control
  836. #define IER_SCALE               (-6)    // merge:  incompatible scaling factors
  837. #define IER_MEMERR              (-7)    // memory error
  838. #define IER_NOCOMMAND           (-8)    // tried IE_GETCOMMAND w/no command
  839. #define IER_NOGESTURE           (-9)    // tried IE_GETGESTURE w/no gesture
  840. #define IER_NOPDEVENT           (-10)   // tried IE_GETPDEVENT but no event
  841. #define IER_NOTINPAINT          (-11)   // tried IE_GETPAINTSTRUCT but no paint
  842. #define IER_PENDATA             (-12)   // can't do request with NULL hpd in ctl
  843.  
  844. // IEdit Recognition Options
  845. #define IEREC_NONE              0x0000  // No recognition
  846. #define IEREC_GESTURE           0x0001  // Gesture recognition
  847. #define IEREC_ALL               (IEREC_GESTURE)
  848. #define IEREC_RESERVED          0xFFFE  // Reserved
  849.  
  850. // IEdit Security Options
  851. #define IESEC_NOCOPY            0x0001  // copying disallowed
  852. #define IESEC_NOCUT             0x0002  // cutting disallowed
  853. #define IESEC_NOPASTE           0x0004  // pasting disallowed
  854. #define IESEC_NOUNDO            0x0008  // undoing disallowed
  855. #define IESEC_NOINK             0x0010  // inking  disallowed
  856. #define IESEC_NOERASE           0x0020  // erasing disallowed
  857. #define IESEC_NOGET             0x0040  // IE_GETINK message verboten
  858. #define IESEC_NOSET             0x0080  // IE_SETINK message verboten
  859. #define IESEC_RESERVED          0xFF00  // reserved
  860.  
  861. // IEdit IE_SETFORMAT/IE_GETFORMAT options
  862. #define IESF_ALL                0x0001  // set/get stk fmt of all ink
  863. #define IESF_SELECTION          0x0002  // set/get stk fmt of selected ink
  864. #define IESF_STROKE             0x0004  // set/get stk fmt of specified stroke
  865. //
  866. #define IESF_TIPCOLOR           0x0008  // set color
  867. #define IESF_TIPWIDTH           0x0010  // set width
  868. #define IESF_PENTIP             (IESF_TIPCOLOR|IESF_TIPWIDTH)
  869. //
  870.  
  871. // IEdit IE_SETINK options
  872. #define IESI_REPLACE            0x0000  // replace ink in control
  873. #define IESI_APPEND             0x0001  // append ink to existing control ink
  874.  
  875. // Ink Edit Control (IEdit) definitions
  876. // IEdit Notifications
  877. #define IN_PDEVENT      ((IEN_PDEVENT<<8)|0)   // pointing device event occurred
  878. #define IN_ERASEBKGND   ((IEN_NULL<<8)|1)      // control needs bkgnd erased
  879. #define IN_PREPAINT     ((IEN_PAINT<<8)|2)     // before control paints its ink
  880. #define IN_PAINT        ((IEN_NULL<<8)|3)      // control needs to be painted
  881. #define IN_POSTPAINT    ((IEN_PAINT<<8)|4)     // after control has painted
  882. #define IN_MODECHANGED  ((IEN_EDIT<<8)|5)      // mode changed
  883. #define IN_CHANGE       ((IEN_EDIT<<8)|6)      // contents changed & painted
  884. #define IN_UPDATE       ((IEN_EDIT<<8)|7)      // contents changed & !painted
  885. #define IN_SETFOCUS     ((IEN_FOCUS<<8)|8)     // IEdit is getting focus
  886. #define IN_KILLFOCUS    ((IEN_FOCUS<<8)|9)     // IEdit is losing focus
  887. #define IN_MEMERR       ((IEN_NULL<<8)|10)     // memory error
  888. #define IN_HSCROLL      ((IEN_SCROLL<<8)|11)   // horz scrolled, not painted
  889. #define IN_VSCROLL      ((IEN_SCROLL<<8)|12)   // vert scrolled, not painted
  890. #define IN_GESTURE      ((IEN_EDIT<<8)|13)     // user has gestured on control
  891. #define IN_COMMAND      ((IEN_EDIT<<8)|14)     // command selected from menu
  892. #define IN_CLOSE        ((IEN_NULL<<8)|15)     // I-Edit is being closed
  893. #define IN_PROPERTIES   ((IEN_PROPERTIES<<8)|16) // properties dialog
  894.  
  895. #endif /*!NOPENIEDIT */
  896.  
  897. //---------------------------------------------------------------------------
  898. #ifndef NOPENINKPUT
  899.  
  900. // PenIn[k]put API constants
  901.  
  902. // Default Processing
  903. #define LRET_DONE               1L
  904. #define LRET_ABORT              (-1L)
  905. #define LRET_HRC                (-2L)
  906. #define LRET_HPENDATA           (-3L)
  907. #define LRET_PRIVATE            (-4L)
  908.  
  909. // Inkput:
  910. #define PCMR_OK                 0
  911. #define PCMR_ALREADYCOLLECTING  (-1)
  912. #define PCMR_INVALIDCOLLECTION  (-2)
  913. #define PCMR_EVENTLOCK          (-3)
  914. #define PCMR_INVALID_PACKETID   (-4)
  915. #define PCMR_TERMTIMEOUT        (-5)
  916. #define PCMR_TERMRANGE          (-6)
  917. #define PCMR_TERMPENUP          (-7)
  918. #define PCMR_TERMEX             (-8)
  919. #define PCMR_TERMBOUND          (-9)
  920. #define PCMR_APPTERMINATED      (-10)
  921. #define PCMR_TAP                (-11)   // alias PCMR_TAPNHOLD_LAST
  922. #define PCMR_SELECT             (-12)   // ret because of tap & hold
  923. #define PCMR_OVERFLOW           (-13)
  924. #define PCMR_ERROR              (-14)   // parameter or unspecified error
  925. #define PCMR_DISPLAYERR         (-15)   // inking only
  926. #define PCMR_TERMINVERT         (-16)   // termination due to tapping opposite end of pen
  927.  
  928. #define PII_INKCLIPRECT         0x0001
  929. #define PII_INKSTOPRECT         0x0002
  930. #define PII_INKCLIPRGN          0x0004
  931. #define PII_INKSTOPRGN          0x0008
  932. #define PII_INKPENTIP           0x0010
  933. #define PII_SAVEBACKGROUND      0x0020
  934. #define PII_CLIPSTOP            0x0040
  935.  
  936. #define PIT_RGNBOUND            0x0001
  937. #define PIT_RGNEXCLUDE          0x0002
  938. #define PIT_TIMEOUT             0x0004
  939. #define PIT_TAPNHOLD            0x0008
  940.  
  941. #endif /*!NOPENINKPUT */
  942.  
  943. //---------------------------------------------------------------------------
  944. #ifndef NOPENMISC
  945.  
  946. // Misc RC Definitions:
  947. #define CL_NULL                 0
  948. #define CL_MINIMUM              1       // minimum confidence level
  949. #define CL_MAXIMUM              100     // max (require perfect recog)
  950. #define cwRcReservedMax         8       // rc.rgwReserved[cwRcReservedMax]
  951. #define ENUM_MINIMUM            1
  952. #define ENUM_MAXIMUM            4096
  953.  
  954. #define HKP_SETHOOK             0       // SetRecogHook()
  955. #define HKP_UNHOOK              0xFFFF
  956.  
  957. #define HWR_RESULTS             0
  958. #define HWR_APPWIDE             1
  959.  
  960. #define iSycNull                (-1)
  961. #define LPDFNULL                ((LPDF)NULL)
  962. #define MAXDICTIONARIES         16      // rc.rglpdf[MAXDICTIONARIES]
  963. #define wPntAll                 (UINT)0xFFFF
  964. #define cbRcLanguageMax         44      // rc.lpLanguage[cbRcLanguageMax]
  965. #define cbRcUserMax             32      // rc.lpUser[cbRcUserMax]
  966. #define cbRcrgbfAlcMax          32      // rc.rgbfAlc[cbRcrgbfAlcMax]
  967. #define RC_WDEFAULT             0xffff
  968. #define RC_LDEFAULT             0xffffffffL
  969. #define RC_WDEFAULTFLAGS        0x8000
  970. #define RC_LDEFAULTFLAGS        0x80000000L
  971.  
  972. // CorrectWriting() API constants:
  973. // LOWORD values:
  974. #define CWR_REPLACECR           0x0001  // replace carriage ret (\r) with space
  975. #define CWR_STRIPCR             CWR_REPLACECR  // alias for backward compatibility
  976. #define CWR_STRIPLF             0x0002  // strip linefeed (\n)
  977. #define CWR_REPLACETAB          0x0004  // replace tab with space (\t)
  978. #define CWR_STRIPTAB            CWR_REPLACETAB // alias for backward compatibility
  979. #define CWR_SINGLELINEEDIT      (CWR_REPLACECR|CWR_STRIPLF|CWR_REPLACETAB)  // all of the above
  980. #define CWR_INSERT              0x0008  // use "Insert Text" instead of "Edit Text" in the title
  981. #define CWR_TITLE               0x0010  // interpret dwParam as title string
  982. #define CWR_KKCONVERT           0x0020  // JPN initiate IME
  983. #define CWR_SIMPLE              0x0040  // simple dialog (lens)
  984. #define CWR_HEDIT               0x0080  // HEDIT CorrectWriting
  985. #define CWR_KEYBOARD            0x0100  // keyboard lens
  986. #define CWR_BOXES               0x0200  // bedit lens
  987.  
  988. // HIWORD values: keyboard types
  989. #define CWRK_DEFAULT            0       // default keyboard type
  990. #define CWRK_BASIC              1       // basic keyboard
  991. #define CWRK_FULL               2       // full keyboard
  992. #define CWRK_NUMPAD             3       // numeric keyboard
  993. #define CWRK_TELPAD             4       // Telephone type keyboard
  994.  
  995. #ifdef JAPAN
  996. #define GPMI_OK                 0L
  997. #define GPMI_INVALIDPMI         0x8000L
  998. #endif // JAPAN
  999.  
  1000. // inkwidth limits
  1001. #define INKWIDTH_MINIMUM        0           // 0 invisible, 1..15 pixel widths
  1002. #define INKWIDTH_MAXIMUM        15          // max width in pixels
  1003.  
  1004. // Get/SetPenMiscInfo:
  1005. // PMI_RCCHANGE is for WM_GLOBALRCCHANGE compatability only:
  1006. #define PMI_RCCHANGE            0       // invalid for Get/SetPenMiscInfo
  1007.  
  1008. #define PMI_BEDIT               1       // boxed edit info
  1009. #define PMI_IMECOLOR            2       // input method editor color
  1010. #define PMI_CXTABLET            3       // tablet width
  1011. #define PMI_CYTABLET            4       // tablet height
  1012. #define PMI_PENTIP              6       // pen tip: color, width, nib
  1013. #define PMI_ENABLEFLAGS         7       // PWE_xx enablements
  1014. #define PMI_TIMEOUT             8       // handwriting timeout
  1015. #define PMI_TIMEOUTGEST         9       // gesture timeout
  1016. #define PMI_TIMEOUTSEL          10      // select (press&hold) timeout
  1017. #define PMI_SYSFLAGS            11      // component load configuration
  1018. #define PMI_INDEXFROMRGB        12      // color table index from RGB
  1019. #define PMI_RGBFROMINDEX        13      // RGB from color table index
  1020. #define PMI_SYSREC              14      // handle to system recognizer
  1021. #define PMI_TICKREF             15      // reference absolute time
  1022.  
  1023. #define PMI_SAVE                0x1000  // save setting to file
  1024.  
  1025. // Set/GetPenMiscInfo/PMI_ENABLEFLAGS flags:
  1026. #define PWE_AUTOWRITE           0x0001  // pen functionality where IBeam
  1027. #define PWE_ACTIONHANDLES       0x0002  // action handles in controls
  1028. #define PWE_INPUTCURSOR         0x0004  // show cursor while writing
  1029. #define PWE_LENS                0x0008  // allow lens popup
  1030.  
  1031. // GetPenMiscInfo/PMI_SYSFLAGS flags:
  1032. #define PWF_RC1                 0x0001  // Windows for Pen 1.0 RC support
  1033. #define PWF_PEN                 0x0004  // pen drv loaded & hdwe init'd
  1034. #define PWF_INKDISPLAY          0x0008  // ink-compatible display drv loaded
  1035. #define PWF_RECOGNIZER          0x0010  // system recognizer installed
  1036. #define PWF_BEDIT               0x0100  // boxed edit support
  1037. #define PWF_HEDIT               0x0200  // free input edit support
  1038. #define PWF_IEDIT               0x0400  // ink edit support
  1039. #define PWF_ENHANCED            0x1000  // enh features (gest, 1ms timing)
  1040. #define PWF_FULL\
  1041.         PWF_RC1|PWF_PEN|PWF_INKDISPLAY|PWF_RECOGNIZER|\
  1042.         PWF_BEDIT|PWF_HEDIT |PWF_IEDIT|PWF_ENHANCED
  1043.  
  1044. // SetPenAppFlags() / RegisterPenApp() API constants:
  1045. #define RPA_DEFAULT             0x0001  // == RPA_HEDIT
  1046. #define RPA_HEDIT               0x0001  // convert EDIT to HEDIT
  1047. #define RPA_KANJIFIXEDBEDIT     0x0002
  1048. #define RPA_DBCSPRIORITY        0x0004  // assume DBCS has priority (Japan)
  1049.  
  1050. #define PMIR_OK                 0L
  1051. #define PMIR_INDEX              (-1L)
  1052. #define PMIR_VALUE              (-2L)
  1053. #define PMIR_INVALIDBOXEDITINFO (-3L)
  1054. #define PMIR_INIERROR           (-4L)
  1055. #define PMIR_ERROR              (-5L)
  1056. #define PMIR_NA                 (-6L)
  1057.  
  1058. #ifdef JAPAN
  1059. #define SPMI_OK                 0L
  1060. #define SPMI_INVALIDBOXEDITINFO 1L
  1061. #define SPMI_INIERROR           2L
  1062. #define SPMI_INVALIDPMI         0x8000L
  1063. #endif //JAPAN
  1064.  
  1065. #endif /*!NOPENMISC */
  1066.  
  1067. //---------------------------------------------------------------------------
  1068. #ifndef NOPENRC1    // not available in WIN32
  1069.  
  1070. // RC Options and Flags:
  1071. // GetGlobalRC() API return codes:
  1072. #define GGRC_OK                 0       // no err
  1073. #define GGRC_DICTBUFTOOSMALL    1       // lpDefDict buffer too small for path
  1074. #define GGRC_PARAMERROR         2       // invalid params: call ignored
  1075. #define GGRC_NA                 3       // function not available
  1076.  
  1077. // RC Direction:
  1078. #define RCD_DEFAULT             0       // def none
  1079. #define RCD_LR                  1       // left to right like English
  1080. #define RCD_RL                  2       // right to left like Arabic
  1081. #define RCD_TB                  3       // top to bottom like Japanese
  1082. #define RCD_BT                  4       // bottom to top like some Chinese
  1083.  
  1084. // RC International Preferences:
  1085. #define RCIP_ALLANSICHAR        0x0001  // all ANSI chars
  1086. #define RCIP_MASK               0x0001
  1087.  
  1088. // RC Options:
  1089. #define RCO_NOPOINTEREVENT      0x00000001L   // no recog tap, tap/hold
  1090. #define RCO_SAVEALLDATA         0x00000002L   // save pen data like upstrokes
  1091. #define RCO_SAVEHPENDATA        0x00000004L   // save pen data for app
  1092. #define RCO_NOFLASHUNKNOWN      0x00000008L   // no ? cursor on unknown
  1093. #define RCO_TABLETCOORD         0x00000010L   // tablet coords used in RC
  1094. #define RCO_NOSPACEBREAK        0x00000020L   // no space break recog -> dict
  1095. #define RCO_NOHIDECURSOR        0x00000040L   // display cursor during inking
  1096. #define RCO_NOHOOK              0x00000080L   // disallow ink hook (passwords)
  1097. #define RCO_BOXED               0x00000100L   // valid rc.guide provided
  1098. #define RCO_SUGGEST             0x00000200L   // for dict suggest
  1099. #define RCO_DISABLEGESMAP       0x00000400L   // disable gesture mapping
  1100. #define RCO_NOFLASHCURSOR       0x00000800L   // no cursor feedback
  1101. #define RCO_BOXCROSS            0x00001000L   // show + at boxedit center
  1102. #define RCO_COLDRECOG           0x00008000L   // result is from cold recog
  1103. #define RCO_SAVEBACKGROUND      0x00010000L   // Save background from ink
  1104. #define RCO_DODEFAULT           0x00020000L   // do default gesture processing
  1105.  
  1106. // RC Orientation of Tablet:
  1107. #define RCOR_NORMAL             1       // tablet not rotated
  1108. #define RCOR_RIGHT              2       // rotated 90 deg anticlockwise
  1109. #define RCOR_UPSIDEDOWN         3       // rotated 180 deg
  1110. #define RCOR_LEFT               4       // rotated 90 deg clockwise
  1111.  
  1112. // RC Preferences:
  1113. #define RCP_LEFTHAND            0x0001  // left handed input
  1114. #define RCP_MAPCHAR             0x0004  // fill in syg.lpsyc (ink) for training
  1115.  
  1116. // RCRESULT wResultsType values:
  1117. #define RCRT_DEFAULT            0x0000  // normal ret
  1118. #define RCRT_UNIDENTIFIED       0x0001  // result contains unidentified results
  1119. #define RCRT_GESTURE            0x0002  // result is a gesture
  1120. #define RCRT_NOSYMBOLMATCH      0x0004  // nothing recognized (no ink match)
  1121. #define RCRT_PRIVATE            0x4000  // recognizer-specific symbol
  1122. #define RCRT_NORECOG            0x8000  // no recog attempted, only data ret
  1123. #define RCRT_ALREADYPROCESSED   0x0008  // GestMgr hooked it
  1124. #define RCRT_GESTURETRANSLATED  0x0010  // GestMgr translated it to ANSI value
  1125. #define RCRT_GESTURETOKEYS      0x0020  // ditto to set of virtual keys
  1126.  
  1127. // RC Result Return Mode specification:
  1128. #define RRM_STROKE              0       // return results after each stroke
  1129. #define RRM_SYMBOL              1       // per symbol (e.g. boxed edits)
  1130. #define RRM_WORD                2       // on recog of a word
  1131. #define RRM_NEWLINE             3       // on recog of a line break
  1132. #define RRM_COMPLETE            16      // on PCM_xx specified completion
  1133.  
  1134. // SetGlobalRC() API return code flags:
  1135. #define SGRC_OK                 0x0000  // no err
  1136. #define SGRC_USER               0x0001  // invalid User name
  1137. #define SGRC_PARAMERROR         0x0002  // param error: call ignored
  1138. #define SGRC_RC                 0x0004  // supplied RC has errors
  1139. #define SGRC_RECOGNIZER         0x0008  // DefRecog name invalid
  1140. #define SGRC_DICTIONARY         0x0010  // lpDefDict path invalid
  1141. #define SGRC_INIFILE            0x0020  // error saving to penwin.ini
  1142. #define SGRC_NA                 0x8000  // function not available
  1143.  
  1144. #endif /*!NOPENRC1 */
  1145.  
  1146. //---------------------------------------------------------------------------
  1147.  
  1148. #ifndef NOPENTARGET
  1149.  
  1150. #define TPT_CLOSEST             0x0001   // Assign to the closest target
  1151. #define TPT_INTERSECTINK        0x0002   // target with intersecting ink
  1152. #define TPT_TEXTUAL             0x0004   // apply textual heuristics
  1153. #define TPT_DEFAULT             (TPT_TEXTUAL | TPT_INTERSECTINK | TPT_CLOSEST)
  1154.  
  1155. #endif /*!NOPENTARGET */
  1156.  
  1157. //---------------------------------------------------------------------------
  1158. #ifndef NOPENVIRTEVENT
  1159.  
  1160. // Virtual Event Layer:
  1161. #define VWM_MOUSEMOVE           0x0001
  1162. #define VWM_MOUSELEFTDOWN       0x0002
  1163. #define VWM_MOUSELEFTUP         0x0004
  1164. #define VWM_MOUSERIGHTDOWN      0x0008
  1165. #define VWM_MOUSERIGHTUP        0x0010
  1166. #endif /*!NOPENVIRTEVENT */
  1167.  
  1168. #endif /* RC_INVOKED */  // ... all the way back from definitions:2
  1169.  
  1170. /****** Messages and Defines ************************************************/
  1171.  
  1172. // Windows Messages WM_PENWINFIRST (0x0380) and WM_PENWINLAST (0x038F)
  1173. // are defined in WINDOWS.H and WINMIN.H
  1174.  
  1175. //---------------------------------------------------------------------------
  1176. #ifndef NOPENMSGS
  1177.  
  1178. #ifndef NOPENRC1    // not available in WIN32
  1179. #define WM_RCRESULT             (WM_PENWINFIRST+1)  // 0x381
  1180. #define WM_HOOKRCRESULT         (WM_PENWINFIRST+2)  // 0x382
  1181. #endif /*!NOPENRC1*/
  1182.  
  1183. #define WM_PENMISCINFO          (WM_PENWINFIRST+3)  // 0x383
  1184. #define WM_GLOBALRCCHANGE       (WM_PENWINFIRST+3)  // alias
  1185.  
  1186. #ifndef NOPENAPPS   // not available in WIN32
  1187. #define WM_SKB                  (WM_PENWINFIRST+4)  // 0x384
  1188. #endif /*!NOPENAPPS */
  1189.  
  1190. #define WM_PENCTL               (WM_PENWINFIRST+5)  // 0x385
  1191. #define WM_HEDITCTL             (WM_PENWINFIRST+5)  // FBC: alias
  1192.  
  1193. // WM_HEDITCTL (WM_PENCTL) wParam options:
  1194. #ifndef _WIN32
  1195. #define HE_GETRC                3       // FBC: get RC from HEDIT/BEDIT control
  1196. #define HE_SETRC                4       // FBC: ditto set
  1197. #define HE_GETINFLATE           5       // FBC: get inflate rect
  1198. #define HE_SETINFLATE           6       // FBC: ditto set
  1199. #endif //!_WIN32
  1200. #define HE_GETUNDERLINE         7       // get underline mode
  1201. #define HE_SETUNDERLINE         8       // ditto set
  1202. #define HE_GETINKHANDLE         9       // get handle to captured ink
  1203. #define HE_SETINKMODE           10      // begin HEDIT cold recog mode
  1204. #define HE_STOPINKMODE          11      // end cold recog mode
  1205. #ifndef _WIN32
  1206. #define HE_GETRCRESULTCODE      12      // FBC: result of recog after HN_ENDREC
  1207. #endif //!_WIN32
  1208. #define HE_DEFAULTFONT          13      // switch BEDIT to def font
  1209. #define HE_CHARPOSITION         14      // BEDIT byte offset -> char position
  1210. #define HE_CHAROFFSET           15      // BEDIT char position -> byte offset
  1211. #define HE_GETBOXLAYOUT         20      // get BEDIT layout
  1212. #define HE_SETBOXLAYOUT         21      // ditto set
  1213. #ifndef _WIN32
  1214. #define HE_GETRCRESULT          22      // FBC: get RCRESULT after HN_RCRESULT
  1215. #define HE_KKCONVERT            30      // JPN start kana-kanji conversion
  1216. #define HE_GETKKCONVERT         31      // JPN get KK state
  1217. #define HE_CANCELKKCONVERT      32      // JPN cancel KK conversion
  1218. #define HE_FIXKKCONVERT         33      // JPN force KK result
  1219. #define HE_GETKKSTATUS          34      // JPN get KK UI state
  1220. #define HE_KKNOCONVERT          35      // JPN revert conversion
  1221. #define HE_SETIMEDEFAULT        36      // JPN set a range of DCS
  1222. #define HE_GETIMEDEFAULT        37      // JPN get a range of DCS
  1223. #endif //!_WIN32
  1224. #define HE_ENABLEALTLIST        40      // en/disable dropdown recog alt's
  1225. #define HE_SHOWALTLIST          41      // show dropdown (assume enabled)
  1226. #define HE_HIDEALTLIST          42      // hide dropdown alternatives
  1227. #define HE_GETLENSTYPE          43      // get lens type: CWR_ and CWRK_ flags
  1228. #define HE_SETLENSTYPE          44      // set lens type: CWR_ and CWRK_ flags
  1229.  
  1230. //------------------------------
  1231. // JPN Kana-to-Kanji conversion subfunctions:
  1232. #define HEKK_DEFAULT            0       // def
  1233. #define HEKK_CONVERT            1       // convert in place
  1234. #define HEKK_CANDIDATE          2       // start conversion dialog
  1235. #define HEKK_DBCSCHAR           3       // convert to DBCS
  1236. #define HEKK_SBCSCHAR           4       // convert to SBCS
  1237. #define HEKK_HIRAGANA           5       // convert to hiragana
  1238. #define HEKK_KATAKANA           6       // convert to katakana
  1239.  
  1240. //------------------------------
  1241. // JPN Return value of HE_GETKKSTATUS
  1242. #define HEKKR_PRECONVERT        1       // in pre conversion mode
  1243. #define HEKKR_CONVERT           2       // in mid conversion mode
  1244. #define HEKKR_TEMPCONFIRM       3       // in post conversion mode
  1245.  
  1246. // HE_STOPINKMODE (stop cold recog) options:
  1247. #define HEP_NORECOG             0       // don't recog ink
  1248. #define HEP_RECOG               1       // recog ink
  1249. #define HEP_WAITFORTAP          2       // recog after tap in window
  1250.  
  1251. // WM_PENCTL notifications:
  1252. #define HN_ENDREC               4       // recog complete
  1253. #define HN_DELAYEDRECOGFAIL     5       // HE_STOPINKMODE (cold recog) failed
  1254. #define HN_RESULT               20      // HEDIT/BEDIT has received new ink/recognition result
  1255. #ifndef _WIN32
  1256. #define HN_RCRESULT             HN_RESULT
  1257. #endif //!_WIN32
  1258. #define HN_ENDKKCONVERT         30      // JPN KK conversion complete
  1259. #define HN_BEGINDIALOG          40      // Lens/EditText/garbage detection dialog
  1260.                                         //  is about to come up on this hedit/bedit
  1261. #define HN_ENDDIALOG            41      // Lens/EditText/garbage detection dialog
  1262.                                         //  has just been destroyed
  1263.  
  1264. //------------------------------
  1265. #ifndef NOPENIEDIT
  1266.  
  1267. // Messages common with other controls:
  1268. #define IE_GETMODIFY          (EM_GETMODIFY)    // gets the mod'n (dirty) bit
  1269. #define IE_SETMODIFY          (EM_SETMODIFY)    // sets the mod'n (dirty) bit
  1270. #define IE_CANUNDO            (EM_CANUNDO)      // queries whether can undo
  1271. #define IE_UNDO               (EM_UNDO)         // undo
  1272. #define IE_EMPTYUNDOBUFFER    (EM_EMPTYUNDOBUFFER) // clears IEDIT undo buffer
  1273.  
  1274. #define IE_MSGFIRST           (WM_USER+150)     // 0x496 == 1174
  1275.  
  1276. // IEdit common messages:
  1277. #define IE_GETINK             (IE_MSGFIRST+0)   // gets ink from the control
  1278. #define IE_SETINK             (IE_MSGFIRST+1)   // sets ink into the control
  1279. #define IE_GETPENTIP          (IE_MSGFIRST+2)   // gets the cur def ink pentip
  1280. #define IE_SETPENTIP          (IE_MSGFIRST+3)   // sets the cur def ink pentip
  1281. #define IE_GETERASERTIP       (IE_MSGFIRST+4)   // gets the cur eraser pentip
  1282. #define IE_SETERASERTIP       (IE_MSGFIRST+5)   // sets the cur eraser pentip
  1283. #define IE_GETBKGND           (IE_MSGFIRST+6)   // gets the bkgnd options
  1284. #define IE_SETBKGND           (IE_MSGFIRST+7)   // sets the bkgnd options
  1285. #define IE_GETGRIDORIGIN      (IE_MSGFIRST+8)   // gets the bkgnd grid origin
  1286. #define IE_SETGRIDORIGIN      (IE_MSGFIRST+9)   // sets the bkgnd grid origin
  1287. #define IE_GETGRIDPEN         (IE_MSGFIRST+10)  // gets the bkgnd grid pen
  1288. #define IE_SETGRIDPEN         (IE_MSGFIRST+11)  // sets the bkgnd grid pen
  1289. #define IE_GETGRIDSIZE        (IE_MSGFIRST+12)  // gets the bkgnd grid size
  1290. #define IE_SETGRIDSIZE        (IE_MSGFIRST+13)  // sets the bkgnd grid size
  1291. #define IE_GETMODE            (IE_MSGFIRST+14)  // gets the current pen mode
  1292. #define IE_SETMODE            (IE_MSGFIRST+15)  // sets the current pen mode
  1293. #define IE_GETINKRECT         (IE_MSGFIRST+16)  // gets the rectbound of the ink
  1294.  
  1295. // IEdit-specific messages:
  1296. #define IE_GETAPPDATA         (IE_MSGFIRST+34)  // gets the user-defined datum
  1297. #define IE_SETAPPDATA         (IE_MSGFIRST+35)  // sets the user-defined data
  1298. #define IE_GETDRAWOPTS        (IE_MSGFIRST+36)  // gets the ink draw options
  1299. #define IE_SETDRAWOPTS        (IE_MSGFIRST+37)  // sets the ink options
  1300. #define IE_GETFORMAT          (IE_MSGFIRST+38)  // gets format of stroke(s)
  1301. #define IE_SETFORMAT          (IE_MSGFIRST+39)  // sets format of stroke(s)
  1302. #define IE_GETINKINPUT        (IE_MSGFIRST+40)  // gets the ink input option
  1303. #define IE_SETINKINPUT        (IE_MSGFIRST+41)  // sets the ink input option
  1304. #define IE_GETNOTIFY          (IE_MSGFIRST+42)  // gets the notification bits
  1305. #define IE_SETNOTIFY          (IE_MSGFIRST+43)  // sets the notification bits
  1306. #define IE_GETRECOG           (IE_MSGFIRST+44)  // gets recognition options
  1307. #define IE_SETRECOG           (IE_MSGFIRST+45)  // sets recognition options
  1308. #define IE_GETSECURITY        (IE_MSGFIRST+46)  // gets the security options
  1309. #define IE_SETSECURITY        (IE_MSGFIRST+47)  // sets the security options
  1310. #define IE_GETSEL             (IE_MSGFIRST+48)  // gets sel status of a stroke
  1311. #define IE_SETSEL             (IE_MSGFIRST+49)  // sets sel status of a stroke
  1312. #define IE_DOCOMMAND          (IE_MSGFIRST+50)  // send command to IEdit
  1313. #define IE_GETCOMMAND         (IE_MSGFIRST+51)  // gets user command
  1314. #define IE_GETCOUNT           (IE_MSGFIRST+52)  // gets count of strks in I-Edit
  1315. #define IE_GETGESTURE         (IE_MSGFIRST+53)  // gets details on user gesture
  1316. #define IE_GETMENU            (IE_MSGFIRST+54)  // gets handle to pop-up menu
  1317. #define IE_GETPAINTDC         (IE_MSGFIRST+55)  // gets the HDC for painting
  1318. #define IE_GETPDEVENT         (IE_MSGFIRST+56)  // gets details of last pd event
  1319. #define IE_GETSELCOUNT        (IE_MSGFIRST+57)  // gets count of selected strks
  1320. #define IE_GETSELITEMS        (IE_MSGFIRST+58)  // gets indices of all sel strks
  1321. #define IE_GETSTYLE           (IE_MSGFIRST+59)  // gets IEdit control styles
  1322.  
  1323. #endif /*!NOPENIEDIT */
  1324.  
  1325. //------------------------------
  1326. #ifndef NOPENHEDIT
  1327.  
  1328. // (H)Edit Control:
  1329. // CTLINITHEDIT.dwFlags values
  1330. #define CIH_NOGDMSG           0x0001  // disable garbage detection message box for this edit
  1331. #define CIH_NOACTIONHANDLE    0x0002  // disable action handles for this edit
  1332. #define CIH_NOEDITTEXT        0x0004  // disable Lens/Edit/Insert text for this edit
  1333. #define CIH_NOFLASHCURSOR     0x0008  // don't flash cursor on tap-n-hold in this (h)edit
  1334.  
  1335. #endif /* !NOPENHEDIT */
  1336.  
  1337. //------------------------------
  1338. #ifndef NOPENBEDIT
  1339.  
  1340. // Boxed Edit Control:
  1341. // box edit alternative list:
  1342. #define HEAL_DEFAULT            -1L     // AltList def value for lParam
  1343.  
  1344. // box edit Info:
  1345. #define BEI_FACESIZE            32      // max size of font name, = LF_FACESIZE
  1346. #define BEIF_BOXCROSS           0x0001
  1347.  
  1348. // box edit size:
  1349. #define BESC_DEFAULT            0
  1350. #define BESC_ROMANFIXED         1
  1351. #define BESC_KANJIFIXED         2
  1352. #define BESC_USERDEFINED        3
  1353.  
  1354. // CTLINITBEDIT.wFlags values
  1355. #define CIB_NOGDMSG           0x0001  // disable garbage detection message box for this bedit
  1356. #define CIB_NOACTIONHANDLE    0x0002  // disable action handles for this bedit
  1357. #define CIB_NOFLASHCURSOR     0x0004  // don't flash cursor on tap-n-hold in this bedit
  1358. #ifdef JAPAN
  1359. #define CIB_NOWRITING         0x0010  // disallow pen input into control
  1360. #endif // JAPAN
  1361.  
  1362. #define BXD_CELLWIDTH           12
  1363. #define BXD_CELLHEIGHT          16
  1364. #define BXD_BASEHEIGHT          13
  1365. #define BXD_BASEHORZ            0
  1366. #define BXD_MIDFROMBASE         0
  1367. #define BXD_CUSPHEIGHT          2
  1368. #define BXD_ENDCUSPHEIGHT       4
  1369.  
  1370. #define BXDK_CELLWIDTH          32
  1371. #define BXDK_CELLHEIGHT         32
  1372. #define BXDK_BASEHEIGHT         28
  1373. #define BXDK_BASEHORZ           0
  1374. #define BXDK_MIDFROMBASE        0
  1375. #define BXDK_CUSPHEIGHT         28
  1376. #define BXDK_ENDCUSPHEIGHT      10
  1377.  
  1378. #ifdef JAPAN
  1379. // IME colors for bedit
  1380. #define COLOR_BE_INPUT             0
  1381. #define COLOR_BE_INPUT_TEXT        1
  1382. #define COLOR_BE_CONVERT           2
  1383. #define COLOR_BE_CONVERT_TEXT      3
  1384. #define COLOR_BE_CONVERTED         4
  1385. #define COLOR_BE_CONVERTED_TEXT    5
  1386. #define COLOR_BE_UNCONVERT         6
  1387. #define COLOR_BE_UNCONVERT_TEXT    7
  1388. #define COLOR_BE_CURSOR            8
  1389. #define COLOR_BE_CURSOR_TEXT       9
  1390. #define COLOR_BE_PRECONVERT        10
  1391. #define COLOR_BE_PRECONVERT_TEXT   11
  1392. #define MAXIMECOLORS               12
  1393. #endif
  1394.  
  1395. #endif /*!NOPENBEDIT */
  1396.  
  1397. #define WM_PENMISC              (WM_PENWINFIRST+6)  // 0x386
  1398.  
  1399. // WM_PENMISC message constants:
  1400. #define PMSC_BEDITCHANGE        1       // broadcast when BEDIT changes
  1401. #ifndef _WIN32
  1402. //#define PMSC_PENUICHANGE      2       // JPN broadcast when PENUI changes
  1403. //#define PMSC_SUBINPCHANGE     3       // JPN broadcast when SUBINPUT changes
  1404. //#define PMSC_KKCTLENABLE      4       // JPN
  1405. #endif //!_WIN32
  1406. #define PMSC_GETPCMINFO         5       // query the window's PCMINFO
  1407. #define PMSC_SETPCMINFO         6       // set the window's PCMINFO
  1408. #define PMSC_GETINKINGINFO      7       // query the window's INKINGINFO
  1409. #define PMSC_SETINKINGINFO      8       // set the window's INKINGINFO
  1410. #define PMSC_GETHRC             9       // query the window's HRC
  1411. #define PMSC_SETHRC             10      // set the window's HRC
  1412. #define PMSC_GETSYMBOLCOUNT     11      // count of symbols in result recd by window
  1413. #define PMSC_GETSYMBOLS         12      // ditto symbols
  1414. #define PMSC_SETSYMBOLS         13      // ditto set symbols
  1415. #define PMSC_LOADPW             15      // broadcast load state on penwin
  1416. #define PMSC_INKSTOP            16
  1417.  
  1418. // PMSCL_xx lParam values for PMSC_xx:
  1419. #define PMSCL_UNLOADED          0L      // penwin just unloaded
  1420. #define PMSCL_LOADED            1L      // penwin just loaded
  1421. #define PMSCL_UNLOADING         2L      // penwin about to unload
  1422.  
  1423. #define WM_CTLINIT              (WM_PENWINFIRST+7)  // 0x387
  1424.  
  1425. // WM_CTLINIT message constants:
  1426. #define CTLINIT_HEDIT           1
  1427. #define CTLINIT_BEDIT           7
  1428. #define CTLINIT_IEDIT           9
  1429. #define CTLINIT_MAX             10
  1430.  
  1431. #define WM_PENEVENT             (WM_PENWINFIRST+8)  // 0x388
  1432.  
  1433. // WM_PENEVENT message values for wParam:
  1434. #define PE_PENDOWN              1       // pen tip down
  1435. #define PE_PENUP                2       // pen tip went from down to up
  1436. #define PE_PENMOVE              3       // pen moved without a tip transition
  1437. #define PE_TERMINATING          4       // Peninput about to terminate
  1438. #define PE_TERMINATED           5       // Peninput terminated
  1439. #define PE_BUFFERWARNING        6       // Buffer half full.
  1440. #define PE_BEGININPUT           7       // begin default input
  1441. #define PE_SETTARGETS           8       // set target data structure (TARGINFO)
  1442. #define PE_BEGINDATA            9       // init message to all targets
  1443. #define PE_MOREDATA             10      // target gets more data
  1444. #define PE_ENDDATA              11      // termination message to all targets
  1445. #define PE_GETPCMINFO           12      // get input collection info
  1446. #define PE_GETINKINGINFO        13      // get inking info
  1447. #define PE_ENDINPUT             14      // Input termination message to window
  1448.                                         //  starting default input
  1449. #define PE_RESULT               15      // sent after ProcessHRC but before GetResultsHRC
  1450.  
  1451. #endif /*!NOPENMSGS */
  1452.  
  1453. /****** Definitions 3: RC compiler excluded ********************************/
  1454.  
  1455. #ifndef RC_INVOKED  // ... rest of file of no interest to rc compiler
  1456.  
  1457. //////////////////////////////////////////////////////////////////////////////
  1458. /****** Macros **************************************************************/
  1459.  
  1460. // misc macros:
  1461. //---------------------------------------------------------------------------
  1462. #ifndef NOPENDRIVER
  1463.  
  1464. #define FPenUpX(x)              ((BOOL)(((x) & BITPENUP) != 0))
  1465. #define GetWEventRef()          (LOWORD(GetMessageExtraInfo()))
  1466. #endif /*!NOPENDRIVER */
  1467.  
  1468. //---------------------------------------------------------------------------
  1469. #ifndef NOPENALC
  1470.  
  1471. // ALC macros:
  1472.  
  1473. #define MpAlcB(lprc,i)          ((lprc)->rgbfAlc[((i) & 0xff) >> 3])
  1474. #define MpIbf(i)                ((BYTE)(1 << ((i) & 7)))
  1475. #define SetAlcBitAnsi(lprc,i)   do {MpAlcB(lprc,i) |= MpIbf(i);} while (0)
  1476. #define ResetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) &= ~MpIbf(i);} while (0)
  1477. #define IsAlcBitAnsi(lprc, i)   ((MpAlcB(lprc,i) & MpIbf(i)) != 0)
  1478. #endif /*!NOPENALC */
  1479.  
  1480. //---------------------------------------------------------------------------
  1481. #ifndef NOPENDATA
  1482.  
  1483. // draw 2.0 pendata using internal stroke formats:
  1484. #define DrawPenDataFmt(hdc, lprect, hpndt)\
  1485.     DrawPenDataEx(hdc, lprect, hpndt, 0, IX_END, 0, IX_END, NULL, NULL, 0)
  1486.  
  1487. #endif /*!NOPENDATA */
  1488.  
  1489. //---------------------------------------------------------------------------
  1490. #ifndef NOPENHRC
  1491.  
  1492. // Handwriting Recognizer:
  1493.  
  1494. // Intervals:
  1495. // difference of two absolute times (at2 > at1 for positive result):
  1496. #define dwDiffAT(at1, at2)\
  1497.     (1000L*((at2).sec - (at1).sec) - (DWORD)(at1).ms + (DWORD)(at2).ms)
  1498.  
  1499. // comparison of two absolute times (TRUE if at1 < at2):
  1500. #define FLTAbsTime(at1, at2)\
  1501.     ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms < (at2).ms))
  1502.  
  1503. #define FLTEAbsTime(at1, at2)\
  1504.     ((at1).sec < (at2).sec || ((at1).sec == (at2).sec && (at1).ms <= (at2).ms))
  1505.  
  1506. #define FEQAbsTime(at1, at2)\
  1507.     ((at1).sec == (at2).sec && (at1).ms == (at2).ms)
  1508.  
  1509. // test if abstime is within an interval:
  1510. #define FAbsTimeInInterval(at, lpi)\
  1511.     (FLTEAbsTime((lpi)->atBegin, at) && FLTEAbsTime(at, (lpi)->atEnd))
  1512.  
  1513. // test if interval (lpiT) is within an another interval (lpiS):
  1514. #define FIntervalInInterval(lpiT, lpiS)\
  1515.     (FLTEAbsTime((lpiS)->atBegin, (lpiT)->atBegin)\
  1516.     && FLTEAbsTime((lpiT)->atEnd, (lpiS)->atEnd))
  1517.  
  1518. // test if interval (lpiT) intersects another interval (lpiS):
  1519. #define FIntervalXInterval(lpiT, lpiS)\
  1520.     (!(FLTAbsTime((lpiT)->atEnd, (lpiS)->atBegin)\
  1521.     || FLTAbsTime((lpiS)->atEnd, (lpiT)->atBegin)))
  1522.  
  1523. // duration of an LPINTERVAL in ms:
  1524. #define dwDurInterval(lpi)  dwDiffAT((lpi)->atBegin, (lpi)->atEnd)
  1525.  
  1526. // fill a pointer to an ABSTIME structure from a count of seconds and ms:
  1527. #define MakeAbsTime(lpat, sec, ms) do {\
  1528.     (lpat)->sec = sec + ((ms) / 1000);\
  1529.     (lpat)->ms = (ms) % 1000;\
  1530.     } while (0)
  1531.  
  1532. // SYV macros:
  1533. #define FIsSpecial(syv)         (HIWORD((syv))==SYVHI_SPECIAL)
  1534. #define FIsAnsi(syv)            (HIWORD((syv))==SYVHI_ANSI)
  1535. #define FIsGesture(syv)         (HIWORD((syv))==SYVHI_GESTURE)
  1536. #define FIsKanji(syv)           (HIWORD((syv))==SYVHI_KANJI)
  1537. #define FIsShape(syv)           (HIWORD((syv))==SYVHI_SHAPE)
  1538. #define FIsUniCode(syv)         (HIWORD((syv))==SYVHI_UNICODE)
  1539. #define FIsVKey(syv)            (HIWORD((syv))==SYVHI_VKEY)
  1540.  
  1541. #define ChSyvToAnsi(syv)        ((BYTE) (LOBYTE(LOWORD((syv)))))
  1542. #define WSyvToKanji(syv)        ((WORD) (LOWORD((syv))))
  1543. #define SyvCharacterToSymbol(c) ((LONG)(unsigned char)(c) | 0x00010000)
  1544. #define SyvKanjiToSymbol(c)     ((LONG)(UINT)(c) | 0x00030000)
  1545.  
  1546. #define FIsSelectGesture(syv)   \
  1547.    ((syv) >= SYVSELECTFIRST && (syv) <= SYVSELECTLAST)
  1548.  
  1549. #define FIsStdGesture(syv)      \
  1550.    (                            \
  1551.    FIsSelectGesture(syv)        \
  1552.    || (syv)==SYV_CLEAR          \
  1553.    || (syv)==SYV_HELP           \
  1554.    || (syv)==SYV_EXTENDSELECT   \
  1555.    || (syv)==SYV_UNDO           \
  1556.    || (syv)==SYV_COPY           \
  1557.    || (syv)==SYV_CUT            \
  1558.    || (syv)==SYV_PASTE          \
  1559.    || (syv)==SYV_CLEARWORD      \
  1560.    || (syv)==SYV_KKCONVERT      \
  1561.    || (syv)==SYV_USER           \
  1562.    || (syv)==SYV_CORRECT        \
  1563.    )
  1564.  
  1565. #define FIsAnsiGesture(syv) \
  1566.    (                            \
  1567.    (syv) == SYV_BACKSPACE       \
  1568.    || (syv) == SYV_TAB          \
  1569.    || (syv) == SYV_RETURN       \
  1570.    || (syv) == SYV_SPACE        \
  1571.    )
  1572.  
  1573. #endif /*!NOPENHRC */
  1574.  
  1575. //---------------------------------------------------------------------------
  1576. #ifndef NOPENINKPUT
  1577.  
  1578. #define SubPenMsgFromWpLp(wp, lp)       (LOWORD(wp))
  1579. #ifdef _WIN32
  1580. #define EventRefFromWpLp(wp, lp)        (HIWORD(wp))
  1581. #define TerminationFromWpLp(wp, lp)     ((int)HIWORD(wp))
  1582. #define HpcmFromWpLp(wp, lp)            ((HPCM)(lp))
  1583. #else
  1584. #define EventRefFromWpLp(wp, lp)        (LOWORD(lp))
  1585. #define TerminationFromWpLp(wp, lp)     ((int)LOWORD(lp))
  1586. #define HpcmFromWpLp(wp, lp)            ((HPCM)HIWORD(lp))
  1587. #endif //_WIN32
  1588.  
  1589. #endif   /*!NOPENINKPUT*/
  1590.  
  1591. //---------------------------------------------------------------------------
  1592. #ifndef NOPENTARGET
  1593. #define HwndFromHtrg(htrg)      ((HWND)(DWORD)(htrg))
  1594. #define HtrgFromHwnd(hwnd)      ((HTRG)(UINT)(hwnd))
  1595. #endif /*!NOPENTARGET*/
  1596.  
  1597. //////////////////////////////////////////////////////////////////////////////
  1598. /****** Typedefs ************************************************************/
  1599.  
  1600. // Simple:
  1601. typedef LONG                    ALC;    // Enabled Alphabet
  1602. typedef int                     CL;     // Confidence Level
  1603. typedef UINT                    HKP;    // Hook Parameter
  1604. typedef int                     REC;    // recognition result
  1605. typedef LONG                    SYV;    // Symbol Value
  1606.  
  1607. #ifndef DECLARE_HANDLE32
  1608. #define DECLARE_HANDLE32(name)\
  1609.     struct name##__ { int unused; };\
  1610.     typedef const struct name##__ FAR* name
  1611. #endif //!DECLARE_HANDLE32
  1612.  
  1613. DECLARE_HANDLE32(HTRG);                 // Handle to target
  1614. DECLARE_HANDLE(HPCM);                   // Handle to Pen Collection Info
  1615. DECLARE_HANDLE(HPENDATA);               // handle to ink
  1616. DECLARE_HANDLE(HREC);                   // handle to recognizer
  1617.  
  1618. // Pointer Types:
  1619. typedef ALC FAR*                LPALC;        // ptr to ALC
  1620. typedef LPVOID                  LPOEM;        // alias
  1621. typedef SYV FAR*                LPSYV;        // ptr to SYV
  1622. typedef HPENDATA FAR*           LPHPENDATA;   // ptr to HPENDATA
  1623.  
  1624. // Function Prototypes:
  1625. typedef int         (CALLBACK *ENUMPROC)(LPSYV, int, VOID FAR*);
  1626. typedef int         (CALLBACK *LPDF)(int, LPVOID, LPVOID, int, DWORD, DWORD);
  1627. typedef BOOL        (CALLBACK *RCYIELDPROC)(VOID);
  1628.  
  1629. // Structures:
  1630.  
  1631. typedef struct tagABSTIME       // 2.0 absolute date/time
  1632.    {
  1633.    DWORD sec;      // number of seconds since 1/1/1970, ret by CRTlib time() fn
  1634.    UINT ms;        // additional offset in ms, 0..999
  1635.    }
  1636.    ABSTIME, FAR *LPABSTIME;
  1637.  
  1638. //---------------------------------------------------------------------------
  1639. #ifndef NOPENHEDIT
  1640.  
  1641. typedef struct tagCTLINITHEDIT  // 2.0 init struct for (h)edit
  1642.    {
  1643.    DWORD cbSize;                // sizeof(CTLINITHEDIT)
  1644.    HWND hwnd;                   // (h)edit window handle
  1645.    int id;                      // its id
  1646.    DWORD dwFlags;               // CIE_xx
  1647.    DWORD dwReserved;            // for future use
  1648.    }
  1649.    CTLINITHEDIT, FAR *LPCTLINITHEDIT;
  1650. #endif /* !NOPENHEDIT */
  1651.  
  1652. //---------------------------------------------------------------------------
  1653. #ifndef NOPENBEDIT
  1654.  
  1655. typedef struct tagBOXLAYOUT     // 1.0 box edit layout
  1656.    {
  1657.    int cyCusp;                  // pixel height of box (BXS_RECT) or cusp
  1658.    int cyEndCusp;               // pixel height of cusps at extreme ends
  1659.    UINT style;                  // BXS_xx style
  1660.    DWORD dwReserved1;           // reserved
  1661.    DWORD dwReserved2;           // reserved
  1662.    DWORD dwReserved3;           // reserved
  1663.    }
  1664.    BOXLAYOUT, FAR *LPBOXLAYOUT;
  1665.  
  1666. typedef struct tagIMECOLORS     // 2.0 IME undetermined string color info.
  1667.    {
  1668.    int cColors;                 // count of colors to be set/get
  1669.    LPINT lpnElem;               // address of array of elements
  1670.    COLORREF FAR *lprgbIme;      // address of array of RGB values
  1671.    }
  1672.    IMECOLORS, FAR *LPIMECOLORS;
  1673.  
  1674. typedef struct tagCTLINITBEDIT  // 2.0 init struct for box edit
  1675.    {
  1676.    DWORD cbSize;                // sizeof(CTLINITBEDIT)
  1677.    HWND hwnd;                   // box edit window handle
  1678.    int id;                      // its id
  1679.    WORD wSizeCategory;          // BESC_xx
  1680.    WORD wFlags;                 // CIB_xx
  1681.    DWORD dwReserved;            // for future use
  1682.    }
  1683.    CTLINITBEDIT, FAR *LPCTLINITBEDIT;
  1684.  
  1685. typedef struct tagBOXEDITINFO   // 1.1 box edit Size Info
  1686.    {
  1687.    int cxBox;                   // width of a single box
  1688.    int cyBox;                   // ditto height
  1689.    int cxBase;                  // in-box x-margin to guideline
  1690.    int cyBase;                  // in-box y offset from top to baseline
  1691.    int cyMid;                   // 0 or distance from baseline to midline
  1692.    BOXLAYOUT boxlayout;         // embedded BOXLAYOUT structure
  1693.    UINT wFlags;                 // BEIF_xx
  1694.    BYTE szFaceName[BEI_FACESIZE];   // font face name
  1695.    UINT wFontHeight;            // font height
  1696.    UINT rgwReserved[8];         // for future use
  1697.    }
  1698.    BOXEDITINFO, FAR *LPBOXEDITINFO;
  1699. #endif /*!NOPENBEDIT */
  1700.  
  1701. //---------------------------------------------------------------------------
  1702. #ifndef NOPENCTL
  1703.  
  1704. typedef struct tagRECTOFS       // 1.0 rectangle offset for nonisometric inflation
  1705.    {
  1706.    int dLeft;                   // inflation leftwards from left side
  1707.    int dTop;                    // ditto upwards from top
  1708.    int dRight;                  // ditto rightwards from right
  1709.    int dBottom;                 // ditto downwards from bottom
  1710.    }
  1711.    RECTOFS, FAR *LPRECTOFS;
  1712. #endif /*!NOPENCTL */
  1713.  
  1714. //---------------------------------------------------------------------------
  1715. #ifndef NOPENDATA
  1716.  
  1717. typedef struct tagPENDATAHEADER // 1.0 main pen data header
  1718.    {
  1719.    UINT wVersion;               // pen data format version
  1720.    UINT cbSizeUsed;             // size of pendata mem block in bytes
  1721.    UINT cStrokes;               // number of strokes (incl up-strokes)
  1722.    UINT cPnt;                   // count of all points
  1723.    UINT cPntStrokeMax;          // length (in points) of longest stroke
  1724.    RECT rectBound;              // bounding rect of all down points
  1725.    UINT wPndts;                 // PDTS_xx bits
  1726.    int  nInkWidth;              // ink width in pixels
  1727.    DWORD rgbInk;                // ink color
  1728.    }
  1729.    PENDATAHEADER, FAR *LPPENDATAHEADER, FAR *LPPENDATA;
  1730.  
  1731. typedef struct tagSTROKEINFO    // 1.0 stroke header
  1732.    {
  1733.    UINT cPnt;                   // count of points in stroke
  1734.    UINT cbPnts;                 // size of stroke in bytes
  1735.    UINT wPdk;                   // state of stroke
  1736.    DWORD dwTick;                // time at beginning of stroke
  1737.    }
  1738.    STROKEINFO, FAR *LPSTROKEINFO;
  1739.  
  1740. typedef struct tagPENTIP        // 2.0 Pen Tip characteristics
  1741.     {
  1742.     DWORD cbSize;               // sizeof(PENTIP)
  1743.     BYTE btype;                 // pen type/nib (calligraphic nib, etc.)
  1744.     BYTE bwidth;                // width of Nib (typically == nInkWidth)
  1745.     BYTE bheight;               // height of Nib
  1746.     BYTE bOpacity;              // 0=transparent, 0x80=hilite, 0xFF=opaque
  1747.     COLORREF rgb;               // pen color
  1748.     DWORD dwFlags;              // TIP_xx flags
  1749.     DWORD dwReserved;           // for future expansion
  1750.     }
  1751.     PENTIP, FAR *LPPENTIP;
  1752.  
  1753. typedef BOOL (CALLBACK *ANIMATEPROC)(HPENDATA, UINT, UINT, UINT FAR*, LPARAM);
  1754.  
  1755. typedef struct tagANIMATEINFO   // 2.0 Animation parameters
  1756.     {
  1757.     DWORD cbSize;               // sizeof(ANIMATEINFO)
  1758.     UINT uSpeedPct;             // speed percent to animate at
  1759.     UINT uPeriodCB;             // time between calls to callback in ms
  1760.     UINT fuFlags;               // animation flags
  1761.     LPARAM lParam;              // value to pass to callback
  1762.     DWORD dwReserved;           // reserved
  1763.     }
  1764.     ANIMATEINFO, FAR *LPANIMATEINFO;
  1765. #endif /*!NOPENDATA */
  1766.  
  1767. //---------------------------------------------------------------------------
  1768. #ifndef NOPENDRIVER
  1769.  
  1770. typedef struct tagOEMPENINFO    // 1.0 OEM pen/tablet hdwe info
  1771.    {
  1772.    UINT wPdt;                   // pen data type
  1773.    UINT wValueMax;              // largest val ret by device
  1774.    UINT wDistinct;              // number of distinct readings possible
  1775.    }
  1776.    OEMPENINFO, FAR *LPOEMPENINFO;
  1777.  
  1778. typedef struct tagPENPACKET     // 1.0 pen packet
  1779.    {
  1780.    UINT wTabletX;               // x in raw coords
  1781.    UINT wTabletY;               // ditto y
  1782.    UINT wPDK;                   // state bits
  1783.    UINT rgwOemData[MAXOEMDATAWORDS]; // OEM-specific data
  1784.    }
  1785.    PENPACKET, FAR *LPPENPACKET;
  1786.  
  1787. typedef struct tagOEM_PENPACKET // 2.0
  1788.    {
  1789.    UINT wTabletX;               // x in raw coords
  1790.    UINT wTabletY;               // ditto y
  1791.    UINT wPDK;                   // state bits
  1792.    UINT rgwOemData[MAXOEMDATAWORDS];  // OEM-specific data
  1793.    DWORD dwTime;
  1794.    }
  1795.     OEM_PENPACKET, FAR *LPOEM_PENPACKET;
  1796.  
  1797. typedef struct tagPENINFO       // 1.0 pen/tablet hdwe info
  1798.    {
  1799.    UINT cxRawWidth;             // max x coord and tablet width in 0.001"
  1800.    UINT cyRawHeight;            // ditto y, height
  1801.    UINT wDistinctWidth;         // number of distinct x values tablet ret
  1802.    UINT wDistinctHeight;        // ditto y
  1803.    int nSamplingRate;           // samples / second
  1804.    int nSamplingDist;           // min distance to move before generating event
  1805.    LONG lPdc;                   // Pen Device Capabilities
  1806.    int cPens;                   // number of pens supported
  1807.    int cbOemData;               // width of OEM data packet
  1808.    OEMPENINFO rgoempeninfo[MAXOEMDATAWORDS]; // supported OEM data types
  1809.    UINT rgwReserved[7];         // for internal use
  1810.    UINT fuOEM;                  // which OEM data, timing, PDK_xx to report
  1811.    }
  1812.    PENINFO, FAR *LPPENINFO;
  1813.  
  1814. typedef struct tagCALBSTRUCT    // 1.0 pen calibration
  1815.    {
  1816.    int wOffsetX;
  1817.    int wOffsetY;
  1818.    int wDistinctWidth;
  1819.    int wDistinctHeight;
  1820.    }
  1821.    CALBSTRUCT, FAR *LPCALBSTRUCT;
  1822.  
  1823. typedef BOOL (CALLBACK *LPFNRAWHOOK)(LPPENPACKET);
  1824. #endif /*!NOPENDRIVER */
  1825.  
  1826. //---------------------------------------------------------------------------
  1827. #ifndef NOPENHRC
  1828.  
  1829. // Handwriting Recognizer:
  1830.  
  1831. DECLARE_HANDLE32(HRC);          // Handwriting Recognition Context
  1832. DECLARE_HANDLE32(HRCRESULT);    // HRC result
  1833. DECLARE_HANDLE32(HWL);          // Handwriting wordlist
  1834. DECLARE_HANDLE32(HRECHOOK);     // Recognition Result hook handle
  1835.  
  1836. typedef HRC                     FAR *LPHRC;
  1837. typedef HRCRESULT               FAR *LPHRCRESULT;
  1838. typedef HWL                     FAR *LPHWL;
  1839.  
  1840. typedef BOOL (CALLBACK *HRCRESULTHOOKPROC)
  1841.     (HREC, HRC, UINT, UINT, UINT, LPVOID);
  1842.  
  1843. // Inksets:
  1844. DECLARE_HANDLE(HINKSET);        // handle to an inkset
  1845. typedef HINKSET                 FAR* LPHINKSET; // ptr to HINKSET
  1846.  
  1847. typedef struct tagINTERVAL      // 2.0 interval structure for inksets
  1848.     {
  1849.     ABSTIME atBegin;            // begining of 1-ms granularity interval
  1850.     ABSTIME atEnd;              // 1 ms past end of interval
  1851.     }
  1852.     INTERVAL, FAR *LPINTERVAL;
  1853.  
  1854. typedef struct tagBOXRESULTS    // 2.0
  1855.     {
  1856.     UINT indxBox;
  1857.     HINKSET hinksetBox;
  1858.     SYV rgSyv[1];
  1859.     }
  1860.     BOXRESULTS, FAR *LPBOXRESULTS;
  1861.  
  1862. typedef struct tagGUIDE         // 1.0 guide structure
  1863.    {
  1864.    int xOrigin;                 // left edge of first box (screen coord))
  1865.    int yOrigin;                 // ditto top edge
  1866.    int cxBox;                   // width of a single box
  1867.    int cyBox;                   // ditto height
  1868.    int cxBase;                  // in-box x-margin to guideline
  1869.    int cyBase;                  // in-box y offset from top to baseline
  1870.    int cHorzBox;                // count of boxed columns
  1871.    int cVertBox;                // ditto rows
  1872.    int cyMid;                   // 0 or distance from baseline to midline
  1873.    }
  1874.    GUIDE, FAR *LPGUIDE;
  1875.  
  1876. #endif /*!NOPENHRC */
  1877.  
  1878. //---------------------------------------------------------------------------
  1879. #ifndef NOPENIEDIT
  1880.  
  1881. typedef struct tagCTLINITIEDIT  // 2.0 init struct for Ink Edit
  1882.     {
  1883.     DWORD cbSize;               // sizeof(CTLINITIEDIT)
  1884.     HWND hwnd;                  // IEdit window handle
  1885.     int id;                     // its ID
  1886.     WORD ieb;                   // IEB_* (background) bits
  1887.     WORD iedo;                  // IEDO_* (draw options) bits
  1888.     WORD iei;                   // IEI_* (ink input) bits
  1889.     WORD ien;                   // IEN_* (notification) bits
  1890.     WORD ierec;                 // IEREC_* (recognition) bits
  1891.     WORD ies;                   // IES_* (style) bits
  1892.     WORD iesec;                 // IESEC_* (security) bits
  1893.     WORD pdts;                  // initial pendata scale factor (PDTS_*)
  1894.     HPENDATA hpndt;             // initial pendata (or NULL if none)
  1895.     HGDIOBJ hgdiobj;            // background brush or bitmap handle
  1896.     HPEN hpenGrid;              // pen to use in drawing grid
  1897.     POINT ptOrgGrid;            // grid lines point of origin
  1898.     WORD wVGrid;                // vertical gridline spacing
  1899.     WORD wHGrid;                // horizontal gridline spacing
  1900.     DWORD dwApp;                // application-defined data
  1901.     DWORD dwReserved;           // reserved for future use
  1902.     }
  1903.     CTLINITIEDIT, FAR *LPCTLINITIEDIT;
  1904.  
  1905. typedef struct tagPDEVENT       // 2.0
  1906.     {
  1907.     DWORD cbSize;               // sizeof(PDEVENT)
  1908.     HWND hwnd;                  // window handle of I-Edit
  1909.     UINT wm;                    // WM_* (window message) of event
  1910.     WPARAM wParam;              // wParam of message
  1911.     LPARAM lParam;              // lParam of message
  1912.     POINT pt;                   // event pt in I-Edit client co-ords
  1913.     BOOL fPen;                  // TRUE if pen (or other inking device)
  1914.     LONG lExInfo;               // GetMessageExtraInfo() return value
  1915.     DWORD dwReserved;           // for future use
  1916.     }
  1917.     PDEVENT, FAR *LPPDEVENT;
  1918.  
  1919. typedef struct tagSTRKFMT       // 2.0
  1920.     {
  1921.     DWORD cbSize;               // sizeof(STRKFMT)
  1922.     UINT iesf;                  // stroke format flags and return bits
  1923.     UINT iStrk;                 // stroke index if IESF_STROKE
  1924.     PENTIP tip;                 // ink tip attributes
  1925.     DWORD dwUser;               // user data for strokes
  1926.     DWORD dwReserved;           // for future use
  1927.     }
  1928.     STRKFMT, FAR *LPSTRKFMT;
  1929. #endif /*!NOPENIEDIT */
  1930.  
  1931. //---------------------------------------------------------------------------
  1932. #ifndef NOPENINKPUT
  1933.  
  1934. typedef struct tagPCMINFO       // 2.0 Pen Collection Mode Information
  1935.    {
  1936.    DWORD cbSize;                // sizeof(PCMINFO)
  1937.    DWORD dwPcm;                 // PCM_xxx flags
  1938.    RECT rectBound;              // if finish on pendown outside this rect
  1939.    RECT rectExclude;            // if finish on pendown inside this rect
  1940.    HRGN hrgnBound;              // if finish on pendown outside this region
  1941.    HRGN hrgnExclude;            // if finish on pendown inside this region
  1942.    DWORD dwTimeout;             // if finish after timeout, this many ms
  1943.    }
  1944.     PCMINFO, FAR *LPPCMINFO;
  1945.  
  1946. typedef struct tagINKINGINFO    // 2.0 Pen Inking Information
  1947.    {
  1948.    DWORD cbSize;                // sizeof(INKINGINFO)
  1949.    UINT wFlags;                 // One of the PII_xx flags
  1950.    PENTIP tip;                  // Pen type, size and color
  1951.    RECT rectClip;               // Clipping rect for the ink
  1952.    RECT rectInkStop;            // Rect in which a pen down stops inking
  1953.    HRGN hrgnClip;               // Clipping region for the ink
  1954.    HRGN hrgnInkStop;            // Region in which a pen down stops inking
  1955.    }
  1956.     INKINGINFO, FAR *LPINKINGINFO;
  1957. #endif /*!NOPENINKPUT */
  1958.  
  1959. //---------------------------------------------------------------------------
  1960. #ifndef NOPENRC1    // not available in WIN32
  1961.  
  1962. typedef struct tagSYC           // 1.0 Symbol Correspondence for Ink
  1963.    {
  1964.    UINT wStrokeFirst;           // first stroke, inclusive
  1965.    UINT wPntFirst;              // first point in first stroke, inclusive
  1966.    UINT wStrokeLast;            // last stroke, inclusive
  1967.    UINT wPntLast;               // last point in last stroke, inclusive
  1968.    BOOL fLastSyc;               // T: no more SYCs follow for current SYE
  1969.    }
  1970.    SYC, FAR *LPSYC;
  1971.  
  1972. typedef struct tagSYE           // 1.0 Symbol Element
  1973.    {
  1974.    SYV syv;                     // symbol value
  1975.    LONG lRecogVal;              // for internal use by recognizer
  1976.    CL cl;                       // confidence level
  1977.    int iSyc;                    // SYC index
  1978.    }
  1979.    SYE, FAR *LPSYE;
  1980.  
  1981. typedef struct tagSYG           // 1.0 Symbol Graph
  1982.    {
  1983.    POINT rgpntHotSpots[MAXHOTSPOT]; // hot spots (max 8)
  1984.    int cHotSpot;                // number of valid hot spots in rgpntHotSpots
  1985.    int nFirstBox;               // row-major index to box of 1st char in result
  1986.    LONG lRecogVal;              // reserved for use by recoognizer
  1987.    LPSYE lpsye;                 // nodes of symbol graph
  1988.    int cSye;                    // number of SYEs in symbol graph
  1989.    LPSYC lpsyc;                 // ptr to corresp symbol ink
  1990.    int cSyc;                    // ditto count
  1991.    }
  1992.    SYG, FAR *LPSYG;
  1993.  
  1994. typedef struct tagRC            // 1.0 Recognition Context (RC)
  1995.    {
  1996.    HREC hrec;                   // handle of recognizer to use
  1997.    HWND hwnd;                   // window to send results to
  1998.    UINT wEventRef;              // index into ink buffer
  1999.    UINT wRcPreferences;         // flags: RCP_xx Preferences
  2000.    LONG lRcOptions;             // RCO_xx options
  2001.    RCYIELDPROC lpfnYield;       // procedure called during Yield()
  2002.    BYTE lpUser[cbRcUserMax];    // current writer
  2003.    UINT wCountry;               // country code
  2004.    UINT wIntlPreferences;       // flags: RCIP_xx
  2005.    char lpLanguage[cbRcLanguageMax]; // language strings
  2006.    LPDF rglpdf[MAXDICTIONARIES];   // list of dictionary functions
  2007.    UINT wTryDictionary;         // max enumerations to search
  2008.    CL clErrorLevel;             // level where recognizer should reject input
  2009.    ALC alc;                     // enabled alphabet
  2010.    ALC alcPriority;             // prioritizes the ALC_ codes
  2011.    BYTE rgbfAlc[cbRcrgbfAlcMax];   // bit field for enabled characters
  2012.    UINT wResultMode;            // RRM_xx when to send (asap or when complete)
  2013.    UINT wTimeOut;               // recognition timeout in ms
  2014.    LONG lPcm;                   // flags: PCM_xx for ending recognition
  2015.    RECT rectBound;              // bounding rect for inking (def:screen coords)
  2016.    RECT rectExclude;            // pen down inside this terminates recognition
  2017.    GUIDE guide;                 // struct: defines guidelines for recognizer
  2018.    UINT wRcOrient;              // RCOR_xx orientation of writing wrt tablet
  2019.    UINT wRcDirect;              // RCD_xx direction of writing
  2020.    int nInkWidth;               // ink width 0 (none) or 1..15 pixels
  2021.    COLORREF rgbInk;             // ink color
  2022.    DWORD dwAppParam;            // for application use
  2023.    DWORD dwDictParam;           // for app use to be passed on to dictionaries
  2024.    DWORD dwRecognizer;          // for app use to be passed on to recognizer
  2025.    UINT rgwReserved[cwRcReservedMax]; // reserved for future use by Windows
  2026.    }
  2027.    RC, FAR *LPRC;
  2028.  
  2029. typedef struct tagRCRESULT      // 1.0 Recognition Result
  2030.    {
  2031.    SYG syg;                     // symbol graph
  2032.    UINT wResultsType;           // see RCRT_xx
  2033.    int cSyv;                    // count of symbol values
  2034.    LPSYV lpsyv;                 // NULL-term ptr to recog's best guess
  2035.    HANDLE hSyv;                 // globally-shared handle to lpsyv mem
  2036.    int nBaseLine;               // 0 or baseline of input writing
  2037.    int nMidLine;                // ditto midline
  2038.    HPENDATA hpendata;           // pen data mem
  2039.    RECT rectBoundInk;           // ink data bounds
  2040.    POINT pntEnd;                // pt that terminated recog
  2041.    LPRC lprc;                   // recog context used
  2042.    }
  2043.    RCRESULT, FAR *LPRCRESULT;
  2044.  
  2045. typedef int         (CALLBACK *LPFUNCRESULTS)(LPRCRESULT, REC);
  2046.  
  2047. #endif /*!NOPENRC1 */
  2048.  
  2049. //---------------------------------------------------------------------------
  2050. #ifndef NOPENTARGET
  2051.  
  2052. #ifndef _WIN32
  2053. #if (WINVER < 0x0400)
  2054. #ifndef _OLE2_H_
  2055. typedef struct tagRECTL
  2056. {                      
  2057.    LONG     left;      
  2058.    LONG     top;       
  2059.    LONG     right;     
  2060.    LONG     bottom;    
  2061. } RECTL;               
  2062. typedef RECTL*       PRECTL; 
  2063. typedef RECTL NEAR*  NPRECTL; 
  2064. typedef RECTL FAR*   LPRECTL;  
  2065. typedef const RECTL FAR* LPCRECTL;
  2066. #endif // !_OLE2_H_
  2067. #endif // WINVER
  2068. #endif // !WIN32
  2069.  
  2070. typedef struct tagTARGET        // 2.0 Geometry for a single target.
  2071.    {
  2072.    DWORD dwFlags;               // individual target flags
  2073.    DWORD idTarget;              // TARGINFO.rgTarget[] index
  2074.    HTRG  htrgTarget;            // HANDLE32 equiv
  2075.    RECTL rectBound;             // Bounding rect of the target
  2076.    DWORD dwData;                // data collection info per target
  2077.    RECTL rectBoundInk;          // Reserved for internal use, must be zero
  2078.    RECTL rectBoundLastInk;      // Reserved for internal use, must be zero
  2079.    }
  2080.    TARGET, FAR *LPTARGET;
  2081.  
  2082. typedef struct tagTARGINFO      // 2.0 A set of targets
  2083.    {
  2084.    DWORD cbSize;                // sizeof(TARGINFO)
  2085.    DWORD dwFlags;               // flags
  2086.    HTRG htrgOwner;              // HANDLE32 equiv
  2087.    WORD cTargets;               // count of targets
  2088.    WORD iTargetLast;            // last target, used by TargetPoints API
  2089.                                 // if TPT_TEXTUAL flag is set
  2090.    TARGET rgTarget[1];          // variable-length array of targets
  2091.    }
  2092.    TARGINFO, FAR *LPTARGINFO;
  2093.  
  2094. typedef struct tagINPPARAMS     // 2.0
  2095.    {
  2096.    DWORD cbSize;                // sizeof(INPPARAMS)
  2097.    DWORD dwFlags;
  2098.    HPENDATA hpndt;
  2099.    TARGET target;               // target structure
  2100.    }
  2101.     INPPARAMS, FAR *LPINPPARAMS;
  2102. #endif /*!NOPENTARGET */
  2103.  
  2104. //////////////////////////////////////////////////////////////////////////////
  2105. /****** APIs and Prototypes *************************************************/
  2106.  
  2107. LRESULT CALLBACK    DefPenWindowProc(HWND, UINT, WPARAM, LPARAM);
  2108.  
  2109. //---------------------------------------------------------------------------
  2110. #ifndef NOPENAPPS   // not available in WIN32
  2111.  
  2112. // Pen System Applications:
  2113. BOOL      WINAPI ShowKeyboard(HWND, UINT, LPPOINT, LPSKBINFO);
  2114.  
  2115. #endif /*!NOPENAPPS */
  2116.  
  2117. //---------------------------------------------------------------------------
  2118. #ifndef NOPENDATA   // these APIs are implemented in PKPD.DLL
  2119.  
  2120. // PenData:
  2121. #ifndef NOPENAPIFUN
  2122. LPPENDATA WINAPI BeginEnumStrokes(HPENDATA);
  2123. LPPENDATA WINAPI EndEnumStrokes(HPENDATA);
  2124. HPENDATA  WINAPI CompactPenData(HPENDATA, UINT);
  2125. HPENDATA  WINAPI CreatePenData(LPPENINFO, int, UINT, UINT);
  2126. VOID      WINAPI DrawPenData(HDC, LPRECT, HPENDATA);
  2127. BOOL      WINAPI GetPenDataStroke(LPPENDATA, UINT, LPPOINT FAR*,
  2128.                                   LPVOID FAR*, LPSTROKEINFO);
  2129. #endif //!NOPENAPIFUN
  2130. HPENDATA  WINAPI AddPointsPenData(HPENDATA, LPPOINT, LPVOID, LPSTROKEINFO);
  2131. int       WINAPI CompressPenData(HPENDATA, UINT, DWORD);
  2132. HPENDATA  WINAPI CreatePenDataEx(LPPENINFO, UINT, UINT, UINT);
  2133. HRGN      WINAPI CreatePenDataRegion(HPENDATA, UINT);
  2134. BOOL      WINAPI DestroyPenData(HPENDATA);
  2135. int       WINAPI DrawPenDataEx(HDC, LPRECT, HPENDATA, UINT, UINT, UINT, UINT,
  2136.                                ANIMATEPROC, LPANIMATEINFO, UINT);
  2137. HPENDATA  WINAPI DuplicatePenData(HPENDATA, UINT);
  2138. int       WINAPI ExtractPenDataPoints(HPENDATA, UINT, UINT, UINT, LPPOINT,
  2139.                                       LPVOID, UINT);
  2140. int       WINAPI ExtractPenDataStrokes(HPENDATA, UINT, LPARAM,
  2141.                                        LPHPENDATA, UINT);
  2142. int       WINAPI GetPenDataAttributes(HPENDATA, LPVOID, UINT);
  2143. BOOL      WINAPI GetPenDataInfo(HPENDATA, LPPENDATAHEADER, LPPENINFO, DWORD);
  2144. BOOL      WINAPI GetPointsFromPenData(HPENDATA, UINT, UINT, UINT, LPPOINT);
  2145. int       WINAPI GetStrokeAttributes(HPENDATA, UINT, LPVOID, UINT);
  2146. int       WINAPI GetStrokeTableAttributes(HPENDATA, UINT, LPVOID, UINT);
  2147. int       WINAPI HitTestPenData(HPENDATA, LPPOINT, UINT, UINT FAR*, UINT FAR*);
  2148. int       WINAPI InsertPenData(HPENDATA, HPENDATA, UINT);
  2149. int       WINAPI InsertPenDataPoints(HPENDATA, UINT, UINT, UINT,
  2150.                                      LPPOINT, LPVOID);
  2151. int       WINAPI InsertPenDataStroke(HPENDATA, UINT, LPPOINT, LPVOID,
  2152.                                      LPSTROKEINFO);
  2153. BOOL      WINAPI MetricScalePenData(HPENDATA, UINT);
  2154. BOOL      WINAPI OffsetPenData(HPENDATA, int, int);
  2155. LONG      WINAPI PenDataFromBuffer(LPHPENDATA, UINT, LPBYTE, LONG, LPDWORD);
  2156. LONG      WINAPI PenDataToBuffer(HPENDATA, LPBYTE, LONG, LPDWORD);
  2157. BOOL      WINAPI RedisplayPenData(HDC, HPENDATA, LPPOINT, LPPOINT,
  2158.                                   int, DWORD);
  2159. int       WINAPI RemovePenDataStrokes(HPENDATA, UINT, UINT);
  2160. BOOL      WINAPI ResizePenData(HPENDATA, LPRECT);
  2161. int       WINAPI SetStrokeAttributes(HPENDATA, UINT, LPARAM, UINT);
  2162. int       WINAPI SetStrokeTableAttributes(HPENDATA, UINT, LPARAM, UINT);
  2163. int       WINAPI TrimPenData(HPENDATA, DWORD, DWORD);
  2164.  
  2165. #endif /*!NOPENDATA */
  2166.  
  2167. //---------------------------------------------------------------------------
  2168. #ifndef NOPENDICT   // not available in WIN32
  2169.  
  2170. // Dictionary:
  2171. BOOL      WINAPI DictionarySearch(LPRC, LPSYE, int, LPSYV, int);
  2172. #endif /*!NOPENDICT */
  2173.  
  2174. //---------------------------------------------------------------------------
  2175. #ifndef NOPENDRIVER
  2176.  
  2177. // Pen Hardware/Driver:
  2178. #ifndef NOPENAPIFUN
  2179. BOOL      WINAPI EndPenCollection(REC);
  2180. REC       WINAPI GetPenHwData(LPPOINT, LPVOID, int, UINT, LPSTROKEINFO);
  2181. REC       WINAPI GetPenHwEventData(UINT, UINT, LPPOINT, LPVOID,
  2182.                                    int, LPSTROKEINFO);
  2183. BOOL      WINAPI SetPenHook(HKP, LPFNRAWHOOK);
  2184. VOID      WINAPI UpdatePenInfo(LPPENINFO);
  2185. #endif //!NOPENAPIFUN
  2186. BOOL      WINAPI GetPenAsyncState(UINT);
  2187. BOOL      WINAPI IsPenEvent(UINT, LONG);
  2188. #endif /*!NOPENDRIVER */
  2189.  
  2190. //---------------------------------------------------------------------------
  2191. #ifndef NOPENHRC
  2192.  
  2193. // Handwriting Recognizer:
  2194. int       WINAPI AddPenDataHRC(HRC, HPENDATA);
  2195. int       WINAPI AddPenInputHRC(HRC, LPPOINT, LPVOID, UINT, LPSTROKEINFO);
  2196. int       WINAPI AddWordsHWL(HWL, LPSTR, UINT);
  2197. int       WINAPI ConfigHREC(HREC, UINT, WPARAM, LPARAM);
  2198. HRC       WINAPI CreateCompatibleHRC(HRC, HREC);
  2199. HWL       WINAPI CreateHWL(HREC, LPSTR, UINT, DWORD);
  2200. HINKSET   WINAPI CreateInksetHRCRESULT(HRCRESULT, UINT, UINT);
  2201. HPENDATA  WINAPI CreatePenDataHRC(HRC);
  2202. int       WINAPI DestroyHRC(HRC);
  2203. int       WINAPI DestroyHRCRESULT(HRCRESULT);
  2204. int       WINAPI DestroyHWL(HWL);
  2205. int       WINAPI EnableGestureSetHRC(HRC, SYV, BOOL);
  2206. int       WINAPI EnableSystemDictionaryHRC(HRC, BOOL);
  2207. int       WINAPI EndPenInputHRC(HRC);
  2208. int       WINAPI GetAlphabetHRC(HRC, LPALC, LPBYTE);
  2209. int       WINAPI GetAlphabetPriorityHRC(HRC, LPALC, LPBYTE);
  2210. int       WINAPI GetAlternateWordsHRCRESULT(HRCRESULT, UINT, UINT,
  2211.                                             LPHRCRESULT, UINT);
  2212. int       WINAPI GetBoxMappingHRCRESULT(HRCRESULT, UINT, UINT, UINT FAR*);
  2213. int       WINAPI GetBoxResultsHRC(HRC, UINT, UINT, UINT, LPBOXRESULTS, BOOL);
  2214. int       WINAPI GetGuideHRC(HRC, LPGUIDE, UINT FAR*);
  2215. int       WINAPI GetHotspotsHRCRESULT(HRCRESULT, UINT, LPPOINT, UINT);
  2216. HREC      WINAPI GetHRECFromHRC(HRC);
  2217. int       WINAPI GetInternationalHRC(HRC, UINT FAR*, LPSTR, UINT FAR*,
  2218.                                      UINT FAR*);
  2219. int       WINAPI GetMaxResultsHRC(HRC);
  2220. int       WINAPI GetResultsHRC(HRC, UINT, LPHRCRESULT, UINT);
  2221. int       WINAPI GetSymbolCountHRCRESULT(HRCRESULT);
  2222. int       WINAPI GetSymbolsHRCRESULT(HRCRESULT, UINT, LPSYV, UINT);
  2223. int       WINAPI GetWordlistHRC(HRC, LPHWL);
  2224. int       WINAPI GetWordlistCoercionHRC(HRC);
  2225. int       WINAPI ProcessHRC(HRC, DWORD);
  2226. int       WINAPI ReadHWL(HWL, HFILE);
  2227. int       WINAPI SetAlphabetHRC(HRC, ALC, LPBYTE);
  2228. int       WINAPI SetAlphabetPriorityHRC(HRC, ALC, LPBYTE);
  2229. int       WINAPI SetBoxAlphabetHRC(HRC, LPALC, UINT);
  2230. int       WINAPI SetGuideHRC(HRC, LPGUIDE, UINT);
  2231. int       WINAPI SetInternationalHRC(HRC, UINT, LPCSTR, UINT, UINT);
  2232. int       WINAPI SetMaxResultsHRC(HRC, UINT);
  2233. HRECHOOK  WINAPI SetResultsHookHREC(HREC, HRCRESULTHOOKPROC);
  2234. int       WINAPI SetWordlistCoercionHRC(HRC, UINT);
  2235. int       WINAPI SetWordlistHRC(HRC, HWL);
  2236. int       WINAPI TrainHREC(HREC, LPSYV, UINT, HPENDATA, UINT);
  2237. int       WINAPI UnhookResultsHookHREC(HREC, HRECHOOK);
  2238. int       WINAPI WriteHWL(HWL, HFILE);
  2239.  
  2240. // Recognizer Installation:
  2241. HREC      WINAPI InstallRecognizer(LPSTR);
  2242. VOID      WINAPI UninstallRecognizer(HREC);
  2243.  
  2244. // Inksets:
  2245. BOOL      WINAPI AddInksetInterval(HINKSET, LPINTERVAL);
  2246. HINKSET   WINAPI CreateInkset(UINT);
  2247. BOOL      WINAPI DestroyInkset(HINKSET);
  2248. int       WINAPI GetInksetInterval(HINKSET, UINT, LPINTERVAL);
  2249. int       WINAPI GetInksetIntervalCount(HINKSET);
  2250.  
  2251. // Symbol Values:
  2252. int       WINAPI CharacterToSymbol(LPSTR, int, LPSYV);
  2253. BOOL      WINAPI SymbolToCharacter(LPSYV, int, LPSTR, LPINT);
  2254. #endif /*!NOPENHRC */
  2255.  
  2256. //---------------------------------------------------------------------------
  2257. #ifndef NOPENINKPUT
  2258.  
  2259. // Pen Input/Inking:
  2260. int       WINAPI DoDefaultPenInput(HWND, UINT);
  2261. int       WINAPI GetPenInput(HPCM, LPPOINT, LPVOID, UINT, UINT, LPSTROKEINFO);
  2262. int       WINAPI PeekPenInput(HPCM, UINT, LPPOINT, LPVOID, UINT);
  2263. int       WINAPI StartInking(HPCM, UINT, LPINKINGINFO);
  2264. HPCM      WINAPI StartPenInput(HWND, UINT, LPPCMINFO, LPINT);
  2265. int       WINAPI StopInking(HPCM);
  2266. int       WINAPI StopPenInput(HPCM, UINT, int);
  2267. #endif /*!NOPENINKPUT */
  2268.  
  2269. //---------------------------------------------------------------------------
  2270. #ifndef NOPENMISC
  2271.  
  2272. // Miscellaneous/Utilities:
  2273. VOID      WINAPI BoundingRectFromPoints(LPPOINT, UINT, LPRECT);
  2274. BOOL      WINAPI DPtoTP(LPPOINT, int);
  2275. UINT      WINAPI GetPenAppFlags(VOID);
  2276. VOID      WINAPI SetPenAppFlags(UINT, UINT);
  2277. LONG      WINAPI GetPenMiscInfo(WPARAM, LPARAM);
  2278. UINT      WINAPI GetVersionPenWin(VOID);
  2279. LONG      WINAPI SetPenMiscInfo(WPARAM, LPARAM);
  2280. BOOL      WINAPI TPtoDP(LPPOINT, int);
  2281. BOOL      WINAPI CorrectWriting(HWND, LPSTR, UINT, LPVOID, DWORD, DWORD);
  2282. #ifndef _WIN32
  2283. UINT      WINAPI IsPenAware(VOID);
  2284. VOID      WINAPI RegisterPenApp(UINT, UINT);
  2285. #endif //!_WIN32
  2286.  
  2287. #endif /*!NOPENMISC */
  2288.  
  2289. //---------------------------------------------------------------------------
  2290. #ifndef NOPENRC1    // not available in WIN32
  2291.  
  2292. // RC1:
  2293. VOID      WINAPI EmulatePen(BOOL);
  2294. UINT      WINAPI EnumSymbols(LPSYG, UINT, ENUMPROC, LPVOID);
  2295. BOOL      WINAPI ExecuteGesture(HWND, SYV, LPRCRESULT);
  2296. VOID      WINAPI FirstSymbolFromGraph(LPSYG, LPSYV, int, LPINT);
  2297. UINT      WINAPI GetGlobalRC(LPRC, LPSTR, LPSTR, int);
  2298. int       WINAPI GetSymbolCount(LPSYG);
  2299. int       WINAPI GetSymbolMaxLength(LPSYG);
  2300. VOID      WINAPI InitRC(HWND, LPRC);
  2301. REC       WINAPI ProcessWriting(HWND, LPRC);
  2302. REC       WINAPI Recognize(LPRC);
  2303. REC       WINAPI RecognizeData(LPRC, HPENDATA);
  2304. UINT      WINAPI SetGlobalRC(LPRC, LPSTR, LPSTR);
  2305. BOOL      WINAPI SetRecogHook(UINT, UINT, HWND);
  2306. BOOL      WINAPI TrainContext(LPRCRESULT, LPSYE, int, LPSYC, int);
  2307. BOOL      WINAPI TrainInk(LPRC, HPENDATA, LPSYV);
  2308.  
  2309. // Custom Recognizer functions - not PenWin APIs (formerly in penwoem.h):
  2310. VOID      WINAPI CloseRecognizer(VOID);
  2311. UINT      WINAPI ConfigRecognizer(UINT, WPARAM, LPARAM);
  2312. BOOL      WINAPI InitRecognizer(LPRC);
  2313. REC       WINAPI RecognizeDataInternal(LPRC, HPENDATA, LPFUNCRESULTS);
  2314. REC       WINAPI RecognizeInternal(LPRC, LPFUNCRESULTS);
  2315. BOOL      WINAPI TrainContextInternal(LPRCRESULT, LPSYE, int, LPSYC, int);
  2316. BOOL      WINAPI TrainInkInternal(LPRC, HPENDATA, LPSYV);
  2317. #endif /*!NOPENRC1 */
  2318.  
  2319. //---------------------------------------------------------------------------
  2320. #ifndef NOPENTARGET
  2321.  
  2322. // Ink Targeting:
  2323. int       WINAPI TargetPoints(LPTARGINFO, LPPOINT, DWORD, UINT, LPSTROKEINFO);
  2324.  
  2325. #endif /*!NOPENTARGET */
  2326.  
  2327. //---------------------------------------------------------------------------
  2328. #ifndef NOPENVIRTEVENT
  2329.  
  2330. // Virtual Event Layer:
  2331. VOID      WINAPI AtomicVirtualEvent(BOOL);
  2332. VOID      WINAPI PostVirtualKeyEvent(UINT, BOOL);
  2333. VOID      WINAPI PostVirtualMouseEvent(UINT, int, int);
  2334. #endif /*!NOPENVIRTEVENT */
  2335.  
  2336. //---------------------------------------------------------------------------
  2337.  
  2338. #ifdef  JAPAN
  2339. // Kanji
  2340. BOOL      WINAPI KKConvert(HWND hwndConvert, HWND hwndCaller,
  2341.                            LPSTR lpBuf, UINT cbBuf, LPPOINT lpPnt);
  2342.  
  2343. #endif //  JAPAN
  2344.  
  2345. #endif /* RC_INVOKED */ // ... all the way back from definitions:3
  2346.  
  2347. /****** End of Header Info *************************************************/
  2348.  
  2349. #ifdef __cplusplus
  2350. }
  2351. #endif /* __cplusplus */
  2352.  
  2353. #ifndef _WIN32
  2354. #ifndef RC_INVOKED
  2355. #pragma pack()
  2356. #endif /* RC_INVOKED */
  2357. #endif //!_WIN32
  2358.  
  2359. #endif /* #define _INC_PENWIN */
  2360.