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.

2470 lines
108 KiB

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