Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2397 lines
91 KiB

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