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.

818 lines
26 KiB

  1. /*****************************************************************************\
  2. * *
  3. * penwin.h - Pen Windows functions, types, and definitions *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * Copyright (c) 1992, Microsoft Corp. All rights reserved. *
  8. * *
  9. \*****************************************************************************/
  10. #ifndef _INC_WINDOWS
  11. #include <windows.h> /* <windows.h> must be pre-included */
  12. #endif /* _INC_WINDOWS */
  13. #ifndef _INC_PENWIN /* prevent multiple includes */
  14. #define _INC_PENWIN
  15. #ifndef RC_INVOKED
  16. #pragma pack(1)
  17. #endif /* RC_INVOKED */
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif /* __cplusplus */
  21. /****** General Pen Windows Definitions *************************************/
  22. typedef int REC;
  23. typedef LONG SYV;
  24. typedef SYV FAR *LPSYV;
  25. typedef HANDLE HREC;
  26. typedef int CL;
  27. typedef LONG ALC;
  28. typedef UINT HKP;
  29. typedef int (CALLBACK * LPDF)(int, LPVOID, LPVOID, int, DWORD, DWORD);
  30. #define BITPENUP 0x8000
  31. #define FPenUpX(x) (((x) & BITPENUP)!=0)
  32. /* Default pen cursor to indicate writing, points northwest */
  33. #define IDC_PEN MAKEINTRESOURCE(32631)
  34. /* alternate select cursor: upsidedown standard arrow, points southeast */
  35. #define IDC_ALTSELECT MAKEINTRESOURCE(32501)
  36. #define RC_WDEFAULT (0xFFFF)
  37. #define RC_LDEFAULT (0xFFFFFFFFL)
  38. #define RC_WDEFAULTFLAGS (0x8000)
  39. #define RC_LDEFAULTFLAGS (0x80000000L)
  40. /* HIWORD(SYV) defines and detection macros */
  41. #define SYVHI_SPECIAL 0
  42. #define FIsSpecial(syv) (HIWORD((syv))==SYVHI_SPECIAL)
  43. #define SYVHI_ANSI 1
  44. #define FIsAnsi(syv) (HIWORD((syv))==SYVHI_ANSI)
  45. #define SYVHI_GESTURE 2
  46. #define FIsGesture(syv) (HIWORD((syv))==SYVHI_GESTURE)
  47. #define SYVHI_KANJI 3
  48. #define FIsKanji(syv) (HIWORD((syv))==SYVHI_KANJI)
  49. #define SYVHI_SHAPE 4
  50. #define FIsShape(syv) (HIWORD((syv))==SYVHI_SHAPE)
  51. #define SYVHI_UNICODE 5
  52. #define FIsUniCode(syv) (HIWORD((syv))==SYVHI_UNICODE)
  53. #define SYVHI_VKEY 6
  54. #define FIsVKey(syv) (HIWORD((syv))==SYVHI_VKEY)
  55. /* Macros to convert between SYV and ANSI */
  56. #define ChSyvToAnsi(syv) ((BYTE) (LOBYTE(LOWORD((syv)))))
  57. #define SyvCharacterToSymbol(c) ((LONG)(unsigned char)(c) | 0x00010000)
  58. #define SyvKanjiToSymbol(c) ((LONG)(WORD)(c) | 0x00030000)
  59. /* SYV values with special meanings to Pen Windows */
  60. #define SYV_NULL 0x00000000L
  61. #define SYV_UNKNOWN 0x00000001L
  62. #define SYV_EMPTY 0x00000003L
  63. #define SYV_BEGINOR 0x00000010L
  64. #define SYV_ENDOR 0x00000011L
  65. #define SYV_OR 0x00000012L
  66. #define SYV_SOFTNEWLINE 0x00000020L
  67. #define SYV_SPACENULL SyvCharacterToSymbol('\0')
  68. /* SYV values for gestures (map into UNICODE space) */
  69. #define SYV_KKCONVERT 0x0002FFD4L
  70. #define SYV_CLEAR 0x0002FFD5L
  71. #define SYV_EXTENDSELECT 0x0002FFD8L
  72. #define SYV_UNDO 0x0002FFD9L
  73. #define SYV_COPY 0x0002FFDAL
  74. #define SYV_CUT 0x0002FFDBL
  75. #define SYV_PASTE 0x0002FFDCL
  76. #define SYV_CLEARWORD 0x0002FFDDL
  77. #define SYV_USER 0x0002FFDEL /* ;Reserved */
  78. #define SYV_CORRECT 0x0002FFDFL
  79. #define SYV_BACKSPACE 0x00020008L
  80. #define SYV_TAB 0x00020009L
  81. #define SYV_RETURN 0x0002000DL
  82. #define SYV_SPACE 0x00020020L
  83. #define FIsStdGesture(syv) \
  84. ((syv) == SYV_CLEAR \
  85. || (syv) == SYV_EXTENDSELECT\
  86. || (syv) == SYV_UNDO \
  87. || (syv) == SYV_COPY \
  88. || (syv) == SYV_CUT \
  89. || (syv) == SYV_PASTE \
  90. || (syv) == SYV_CLEARWORD \
  91. || (syv) == SYV_KKCONVERT \
  92. || (syv) == SYV_USER \
  93. || (syv) == SYV_CORRECT)
  94. #define FIsAnsiGesture(syv) \
  95. ((syv) == SYV_BACKSPACE \
  96. || (syv) == SYV_TAB \
  97. || (syv) == SYV_RETURN \
  98. || (syv) == SYV_SPACE)
  99. /* Application specific gestures, Circle a-z and Circle A-Z */
  100. #define SYV_APPGESTUREMASK 0x00020000L
  101. #define SYV_CIRCLEUPA 0x000224B6L
  102. #define SYV_CIRCLEUPZ 0x000224CFL
  103. #define SYV_CIRCLELOA 0x000224D0L
  104. #define SYV_CIRCLELOZ 0x000224E9L
  105. /* Gesture Macros */
  106. #define FIsLoAppGesture(syv) (syv >= SYV_CIRCLELOA && syv <= SYV_CIRCLELOZ)
  107. #define FIsUpAppGesture(syv) (syv >= SYV_CIRCLEUPA && syv <= SYV_CIRCLEUPZ)
  108. #define FIsAppGesture(syv) (syv>=SYV_CIRCLEUPA && syv<=SYV_CIRCLELOZ)
  109. #define SyvAppGestureFromLoAnsi(ansi) ((DWORD)(BYTE)ansi- 'a' + SYV_CIRCLELOA)
  110. #define SyvAppGestureFromUpAnsi(ansi) ((DWORD)(BYTE)ansi- 'A' + SYV_CIRCLEUPA)
  111. #define AnsiFromSyvAppGesture(syv) ChSyvToAnsi( \
  112. syv-(FIsUpAppGesture(syv)? SYV_CIRCLEUPA-(SYV)'A': SYV_CIRCLELOA-(SYV)'a'))
  113. /* SYV definitions for shapes */
  114. #define SYV_SHAPELINE 0x00040001L
  115. #define SYV_SHAPEELLIPSE 0x00040002L
  116. #define SYV_SHAPERECT 0x00040003L
  117. #define SYV_SHAPEMIN SYV_SHAPELINE
  118. #define SYV_SHAPEMAX SYV_SHAPERECT
  119. /****** Recognition Error Codes *********************************************/
  120. #define REC_OEM (-1024)
  121. #define REC_LANGUAGE (-48)
  122. #define REC_GUIDE (-47)
  123. #define REC_PARAMERROR (-46)
  124. #define REC_INVALIDREF (-45)
  125. #define REC_RECTEXCLUDE (-44)
  126. #define REC_RECTBOUND (-43)
  127. #define REC_PCM (-42)
  128. #define REC_RESULTMODE (-41)
  129. #define REC_HWND (-40)
  130. #define REC_ALC (-39)
  131. #define REC_ERRORLEVEL (-38)
  132. #define REC_CLVERIFY (-37)
  133. #define REC_DICT (-36)
  134. #define REC_HREC (-35)
  135. #define REC_BADEVENTREF (-33)
  136. #define REC_NOCOLLECTION (-32)
  137. #define REC_DEBUG (-32)
  138. #define REC_POINTEREVENT (-31)
  139. #define REC_BADHPENDATA (-9)
  140. #define REC_OOM (-8)
  141. #define REC_NOINPUT (-7)
  142. #define REC_NOTABLET (-6)
  143. #define REC_BUSY (-5)
  144. #define REC_BUFFERTOOSMALL (-4)
  145. #define REC_ABORT (-3)
  146. #define REC_OVERFLOW (-1)
  147. #define REC_OK 0
  148. #define REC_TERMBOUND 1
  149. #define REC_TERMEX 2
  150. #define REC_TERMPENUP 3
  151. #define REC_TERMRANGE 4
  152. #define REC_TERMTIMEOUT 5
  153. #define REC_DONE 6
  154. #define REC_TERMOEM 512
  155. /****** Pen Driver Structures and Entry points ******************************/
  156. typedef struct tagOEMPENINFO
  157. {
  158. UINT wPdt;
  159. UINT wValueMax;
  160. UINT wDistinct;
  161. }
  162. OEMPENINFO, FAR *LPOEMPENINFO;
  163. #define PDT_NULL 0
  164. #define PDT_PRESSURE 1
  165. #define PDT_HEIGHT 2
  166. #define PDT_ANGLEXY 3
  167. #define PDT_ANGLEZ 4
  168. #define PDT_BARRELROTATION 5
  169. #define PDT_OEMSPECIFIC 16
  170. #define MAXOEMDATAWORDS 6
  171. typedef struct tagPENPACKET
  172. {
  173. UINT wTabletX;
  174. UINT wTabletY;
  175. UINT wPDK;
  176. UINT rgwOemData[MAXOEMDATAWORDS];
  177. }
  178. PENPACKET, FAR *LPPENPACKET;
  179. typedef BOOL (CALLBACK * LPFNRAWHOOK)(LPPENPACKET);
  180. typedef struct tagPENINFO
  181. {
  182. UINT cxRawWidth;
  183. UINT cyRawHeight;
  184. UINT wDistinctWidth;
  185. UINT wDistinctHeight;
  186. int nSamplingRate;
  187. int nSamplingDist;
  188. LONG lPdc;
  189. int cPens;
  190. int cbOemData;
  191. OEMPENINFO rgoempeninfo[MAXOEMDATAWORDS];
  192. UINT rgwReserved[8];
  193. }
  194. PENINFO, FAR *LPPENINFO;
  195. #define PDC_INTEGRATED 0x00000001L
  196. #define PDC_PROXIMITY 0x00000002L
  197. #define PDC_RANGE 0x00000004L
  198. #define PDC_INVERT 0x00000008L
  199. #define PDC_RELATIVE 0x00000010L
  200. #define PDC_BARREL1 0x00000020L
  201. #define PDC_BARREL2 0x00000040L
  202. #define PDC_BARREL3 0x00000080L
  203. typedef struct tagSTROKEINFO
  204. {
  205. UINT cPnt;
  206. UINT cbPnts;
  207. UINT wPdk;
  208. DWORD dwTick;
  209. }
  210. STROKEINFO, FAR *LPSTROKEINFO;
  211. typedef struct tagCALBSTRUCT
  212. {
  213. int wOffsetX;
  214. int wOffsetY;
  215. int wDistinctWidth;
  216. int wDistinctHeight;
  217. }
  218. CALBSTRUCT, FAR *LPCALBSTRUCT;
  219. /****** DRV_ values for pen driver specific messages ************************/
  220. #define DRV_SetPenDriverEntryPoints DRV_RESERVED+1
  221. #define DRV_RemovePenDriverEntryPoints DRV_RESERVED+2
  222. #define DRV_SetPenSamplingRate DRV_RESERVED+3
  223. #define DRV_SetPenSamplingDist DRV_RESERVED+4
  224. #define DRV_GetName DRV_RESERVED+5
  225. #define DRV_GetVersion DRV_RESERVED+6
  226. #define DRV_GetPenInfo DRV_RESERVED+7
  227. #define DRV_GetCalibration DRV_RESERVED+11
  228. #define DRV_SetCalibration DRV_RESERVED+12
  229. VOID WINAPI UpdatePenInfo(LPPENINFO);
  230. BOOL WINAPI EndPenCollection(REC);
  231. REC WINAPI GetPenHwData(LPPOINT, LPVOID, int, UINT, LPSTROKEINFO);
  232. REC WINAPI GetPenHwEventData(UINT, UINT, LPPOINT, LPVOID, int, LPSTROKEINFO);
  233. VOID WINAPI PenPacket(VOID);
  234. BOOL WINAPI SetPenHook(HKP, LPFNRAWHOOK);
  235. /****** Pen Hardware Constants **********************************************/
  236. #define PDK_UP 0x0000
  237. #define PDK_DOWN 0x0001
  238. #define PDK_BARREL1 0x0002
  239. #define PDK_BARREL2 0x0004
  240. #define PDK_BARREL3 0x0008
  241. #define PDK_TRANSITION 0x0010
  242. #define PDK_INVERTED 0x0080
  243. #define PDK_OUTOFRANGE 0x4000
  244. #define PDK_DRIVER 0x8000
  245. #define PDK_TIPMASK 0x0001
  246. #define PDK_SWITCHES (PDK_DOWN|PDK_BARREL1|PDK_BARREL2|PDK_BARREL3)
  247. #define PCM_PENUP 0x00000001L
  248. #define PCM_RANGE 0x00000002L
  249. #define PCM_INVERT 0x00000020L
  250. #define PCM_RECTEXCLUDE 0x00002000L
  251. #define PCM_RECTBOUND 0x00004000L
  252. #define PCM_TIMEOUT 0x00008000L
  253. #define PCM_ADDDEFAULTS RC_LDEFAULTFLAGS /* 0x80000000L */
  254. /****** Virtual Event Layer *************************************************/
  255. VOID WINAPI PostVirtualKeyEvent(UINT, BOOL);
  256. VOID WINAPI PostVirtualMouseEvent(UINT, int, int);
  257. VOID WINAPI AtomicVirtualEvent(BOOL);
  258. #define VWM_MOUSEMOVE 0x0001
  259. #define VWM_MOUSELEFTDOWN 0x0002
  260. #define VWM_MOUSELEFTUP 0x0004
  261. #define VWM_MOUSERIGHTDOWN 0x0008
  262. #define VWM_MOUSERIGHTUP 0x0010
  263. /****** RC Definition *************************************************************/
  264. #define CL_NULL 0
  265. #define CL_MINIMUM 1
  266. #define CL_MAXIMUM 100
  267. #define INKWIDTH_MINIMUM 0
  268. #define INKWIDTH_MAXIMUM 15
  269. #define ENUM_MINIMUM 1
  270. #define ENUM_MAXIMUM 4096
  271. #define MAXDICTIONARIES 16
  272. typedef struct tagGUIDE
  273. {
  274. int xOrigin;
  275. int yOrigin;
  276. int cxBox;
  277. int cyBox;
  278. int cxBase;
  279. int cyBase;
  280. int cHorzBox;
  281. int cVertBox;
  282. int cyMid;
  283. }
  284. GUIDE, FAR *LPGUIDE;
  285. typedef BOOL (CALLBACK * RCYIELDPROC)(VOID);
  286. #define cbRcLanguageMax 44
  287. #define cbRcUserMax 32
  288. #define cbRcrgbfAlcMax 32
  289. #define cwRcReservedMax 8
  290. typedef struct tagRC
  291. {
  292. HREC hrec;
  293. HWND hwnd;
  294. UINT wEventRef;
  295. UINT wRcPreferences;
  296. LONG lRcOptions;
  297. RCYIELDPROC lpfnYield;
  298. BYTE lpUser[cbRcUserMax];
  299. UINT wCountry;
  300. UINT wIntlPreferences;
  301. char lpLanguage[cbRcLanguageMax];
  302. LPDF rglpdf[MAXDICTIONARIES];
  303. UINT wTryDictionary;
  304. CL clErrorLevel;
  305. ALC alc;
  306. ALC alcPriority;
  307. BYTE rgbfAlc[cbRcrgbfAlcMax];
  308. UINT wResultMode;
  309. UINT wTimeOut;
  310. LONG lPcm;
  311. RECT rectBound;
  312. RECT rectExclude;
  313. GUIDE guide;
  314. UINT wRcOrient;
  315. UINT wRcDirect;
  316. int nInkWidth;
  317. COLORREF rgbInk;
  318. DWORD dwAppParam;
  319. DWORD dwDictParam;
  320. DWORD dwRecognizer;
  321. UINT rgwReserved[cwRcReservedMax];
  322. }
  323. RC, FAR *LPRC;
  324. typedef HANDLE HPENDATA;
  325. typedef struct tagSYC
  326. {
  327. UINT wStrokeFirst;
  328. UINT wPntFirst;
  329. UINT wStrokeLast;
  330. UINT wPntLast;
  331. BOOL fLastSyc;
  332. }
  333. SYC, FAR *LPSYC;
  334. #define wPntAll (UINT)0xFFFF
  335. #define iSycNull (-1)
  336. typedef struct tagSYE
  337. {
  338. SYV syv;
  339. LONG lRecogVal;
  340. CL cl;
  341. int iSyc;
  342. }
  343. SYE, FAR *LPSYE;
  344. #define MAXHOTSPOT 8
  345. typedef struct tagSYG
  346. {
  347. POINT rgpntHotSpots[MAXHOTSPOT];
  348. int cHotSpot;
  349. int nFirstBox;
  350. LONG lRecogVal;
  351. LPSYE lpsye;
  352. int cSye;
  353. LPSYC lpsyc;
  354. int cSyc;
  355. }
  356. SYG, FAR *LPSYG;
  357. typedef int (CALLBACK *ENUMPROC)(LPSYV, int, VOID FAR *);
  358. typedef struct tagRCRESULT
  359. {
  360. SYG syg;
  361. UINT wResultsType;
  362. int cSyv;
  363. LPSYV lpsyv;
  364. HANDLE hSyv;
  365. int nBaseLine;
  366. int nMidLine;
  367. HPENDATA hpendata;
  368. RECT rectBoundInk;
  369. POINT pntEnd;
  370. LPRC lprc;
  371. }
  372. RCRESULT, FAR *LPRCRESULT;
  373. #define RCRT_DEFAULT 0x0000
  374. #define RCRT_UNIDENTIFIED 0x0001
  375. #define RCRT_GESTURE 0x0002
  376. #define RCRT_NOSYMBOLMATCH 0x0004
  377. #define RCRT_PRIVATE 0x4000
  378. #define RCRT_NORECOG 0x8000
  379. #define RCRT_ALREADYPROCESSED 0x0008
  380. #define RCRT_GESTURETRANSLATED 0x0010
  381. #define RCRT_GESTURETOKEYS 0x0020
  382. #define HKP_SETHOOK 0
  383. #define HKP_UNHOOK 0xFFFF
  384. #define HWR_RESULTS 0
  385. #define HWR_APPWIDE 1
  386. #define PEN_NOINKWIDTH 0
  387. #define LPDFNULL ((LPDF)NULL)
  388. #define RPA_DEFAULT 1
  389. /* GetGlobalRC return codes */
  390. #define GGRC_OK 0
  391. #define GGRC_DICTBUFTOOSMALL 1
  392. #define GGRC_PARAMERROR 2
  393. /* SetGlobalRC return code flags */
  394. #define SGRC_OK 0x0000
  395. #define SGRC_USER 0x0001
  396. #define SGRC_PARAMERROR 0x0002
  397. #define SGRC_RC 0x0004
  398. #define SGRC_RECOGNIZER 0x0008
  399. #define SGRC_DICTIONARY 0x0010
  400. #define SGRC_INIFILE 0x0020
  401. #define GetWEventRef() (LOWORD(GetMessageExtraInfo()))
  402. HREC WINAPI InstallRecognizer(LPSTR);
  403. VOID WINAPI UninstallRecognizer(HREC);
  404. UINT WINAPI GetGlobalRC(LPRC, LPSTR, LPSTR, int);
  405. UINT WINAPI SetGlobalRC(LPRC, LPSTR, LPSTR);
  406. VOID WINAPI RegisterPenApp(UINT, BOOL);
  407. UINT WINAPI IsPenAware(VOID);
  408. BOOL WINAPI SetRecogHook(UINT, UINT, HWND);
  409. VOID WINAPI InitRC(HWND, LPRC);
  410. REC WINAPI Recognize(LPRC);
  411. REC WINAPI RecognizeData(LPRC, HPENDATA);
  412. BOOL WINAPI TrainInk(LPRC, HPENDATA, LPSYV);
  413. BOOL WINAPI TrainContext(LPRCRESULT, LPSYE, int, LPSYC, int);
  414. REC WINAPI ProcessWriting(HWND, LPRC);
  415. BOOL WINAPI CorrectWriting(HWND, LPSTR, UINT, LPRC, DWORD, DWORD);
  416. VOID WINAPI EmulatePen(BOOL);
  417. int WINAPI GetSymbolMaxLength(LPSYG);
  418. int WINAPI GetSymbolCount(LPSYG);
  419. VOID WINAPI FirstSymbolFromGraph(LPSYG, LPSYV, int, int FAR *);
  420. UINT WINAPI EnumSymbols(LPSYG, WORD, ENUMPROC, LPVOID);
  421. /****** Miscellaneous Functions *********************************************/
  422. BOOL WINAPI TPtoDP(LPPOINT, int);
  423. BOOL WINAPI DPtoTP(LPPOINT, int);
  424. VOID WINAPI BoundingRectFromPoints(LPPOINT, int, LPRECT);
  425. BOOL WINAPI SymbolToCharacter(LPSYV, int, LPSTR, LPINT);
  426. int WINAPI CharacterToSymbol(LPSTR, int, LPSYV);
  427. UINT WINAPI GetVersionPenWin(VOID);
  428. BOOL WINAPI ExecuteGesture(HWND, SYV, LPRCRESULT);
  429. /****** RC Options and Flags ***********************************************/
  430. #define ALC_ALL 0x000043FFL
  431. #define ALC_DEFAULT 0x00000000L
  432. #define ALC_LCALPHA 0x00000001L
  433. #define ALC_UCALPHA 0x00000002L
  434. #define ALC_ALPHA 0x00000003L
  435. #define ALC_NUMERIC 0x00000004L
  436. #define ALC_ALPHANUMERIC 0x00000007L
  437. #define ALC_PUNC 0x00000008L
  438. #define ALC_MATH 0x00000010L
  439. #define ALC_MONETARY 0x00000020L
  440. #define ALC_OTHER 0x00000040L
  441. #define ALC_WHITE 0x00000100L
  442. #define ALC_NONPRINT 0x00000200L
  443. #define ALC_GESTURE 0x00004000L
  444. #define ALC_USEBITMAP 0x00008000L
  445. #define ALC_DBCS 0x00000400L
  446. #define ALC_HIRAGANA 0x00010000L
  447. #define ALC_KATAKANA 0x00020000L
  448. #define ALC_KANJI 0x00040000L
  449. #define ALC_OEM 0x0FF80000L
  450. #define ALC_RESERVED 0xF0003800L
  451. #define ALC_NOPRIORITY 0x00000000L
  452. #define ALC_SYSMINIMUM (ALC_ALPHANUMERIC | ALC_PUNC | ALC_WHITE | ALC_GESTURE)
  453. #define MpAlcB(lprc,i) ((lprc)->rgbfAlc[((i) & 0xff) >> 3])
  454. #define MpIbf(i) ((BYTE)(1 << ((i) & 7)))
  455. #define SetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) |= MpIbf(i);} while (0)
  456. #define ResetAlcBitAnsi(lprc,i) do {MpAlcB(lprc,i) &= ~MpIbf(i);} while (0)
  457. #define IsAlcBitAnsi(lprc, i) ((MpAlcB(lprc,i) & MpIbf(i)) != 0)
  458. #define RCD_DEFAULT 0
  459. #define RCD_LR 1
  460. #define RCD_RL 2
  461. #define RCD_TB 3
  462. #define RCD_BT 4
  463. #define RCO_NOPOINTEREVENT 0x00000001L
  464. #define RCO_SAVEALLDATA 0x00000002L
  465. #define RCO_SAVEHPENDATA 0x00000004L
  466. #define RCO_NOFLASHUNKNOWN 0x00000008L
  467. #define RCO_TABLETCOORD 0x00000010L
  468. #define RCO_NOSPACEBREAK 0x00000020L
  469. #define RCO_NOHIDECURSOR 0x00000040L
  470. #define RCO_NOHOOK 0x00000080L
  471. #define RCO_BOXED 0x00000100L
  472. #define RCO_SUGGEST 0x00000200L
  473. #define RCO_DISABLEGESMAP 0x00000400L
  474. #define RCO_NOFLASHCURSOR 0x00000800L
  475. #define RCO_COLDRECOG 0x00008000L
  476. #define RCP_LEFTHAND 0x0001
  477. #define RCP_MAPCHAR 0x0004
  478. #define RCOR_NORMAL 1
  479. #define RCOR_RIGHT 2
  480. #define RCOR_UPSIDEDOWN 3
  481. #define RCOR_LEFT 4
  482. #define RRM_STROKE 0
  483. #define RRM_SYMBOL 1
  484. #define RRM_WORD 2
  485. #define RRM_NEWLINE 3
  486. #define RRM_COMPLETE 16
  487. #define RCIP_ALLANSICHAR 0x0001
  488. #define RCIP_MASK 0x0001
  489. #define CWR_STRIPCR 0x00000001L
  490. #define CWR_STRIPLF 0x00000002L
  491. #define CWR_STRIPTAB 0x00000004L
  492. #define CWR_SINGLELINEEDIT 0x00000007L
  493. #define CWR_TITLE 0x00000010L
  494. #define CWR_KKCONVERT 0x00000020L
  495. #define MAP_GESTOGES (RCRT_GESTURE|RCRT_GESTURETRANSLATED)
  496. #define MAP_GESTOVKEYS (RCRT_GESTURETOKEYS|RCRT_ALREADYPROCESSED)
  497. #define IsGestureToGesture(lprcresult) (((lprcresult)->wResultstype & MAP_GESTOGES \
  498. ) == MAP_GESTOGES)
  499. #define IsGestureToVkeys(lprcresult) (((lprcresult)->wResultstype & MAP_GESTOVKEYS \
  500. ) == MAP_GESTOVKEYS)
  501. #define SetAlreadyProcessed(lprcresult) ((lprcresult)->wResultsType = ((lprcresult)->wResultsType \
  502. & ~RCRT_GESTURETOKEYS) | RCRT_ALREADYPROCESSED)
  503. /****** Pen Data Type *******************************************************/
  504. typedef struct tagPENDATAHEADER
  505. {
  506. UINT wVersion;
  507. UINT cbSizeUsed;
  508. UINT cStrokes;
  509. UINT cPnt;
  510. UINT cPntStrokeMax;
  511. RECT rectBound;
  512. UINT wPndts;
  513. int nInkWidth;
  514. DWORD rgbInk;
  515. }
  516. PENDATAHEADER, FAR *LPPENDATAHEADER, FAR *LPPENDATA;
  517. #define PDTS_LOMETRIC 0x0000
  518. #define PDTS_HIMETRIC 0x0001
  519. #define PDTS_HIENGLISH 0x0002
  520. #define PDTS_SCALEMAX 0x0003
  521. #define PDTS_DISPLAY 0x0003
  522. #define PDTS_ARBITRARY 0x0004
  523. #define PDTS_SCALEMASK 0x000F
  524. #define PDTS_STANDARDSCALE PDTS_HIENGLISH
  525. #define PDTS_NOPENINFO 0x0100
  526. #define PDTS_NOUPPOINTS 0x0200
  527. #define PDTS_NOOEMDATA 0x0400
  528. #define PDTS_NOCOLINEAR 0x0800
  529. #define PDTS_COMPRESSED 0x8000
  530. #define PDTS_COMPRESSMETHOD 0x00F0
  531. #define PDTS_COMPRESS2NDDERIV 0x0010
  532. #define PDTT_DEFAULT 0x0000
  533. #define PDTT_PENINFO PDTS_NOPENINFO
  534. #define PDTT_UPPOINTS PDTS_NOUPPOINTS
  535. #define PDTT_OEMDATA PDTS_NOOEMDATA
  536. #define PDTT_COLINEAR PDTS_NOCOLINEAR
  537. #define PDTT_COMPRESS PDTS_COMPRESSED
  538. #define PDTT_DECOMPRESS 0x4000
  539. #define PDTT_ALL (PDTT_PENINFO|PDTT_UPPOINTS|PDTT_OEMDATA|PDTT_COLINEAR)
  540. #define DestroyPenData(hpendata) (GlobalFree(hpendata)==NULL)
  541. #define EndEnumStrokes(hpendata) GlobalUnlock(hpendata)
  542. BOOL WINAPI IsPenEvent(UINT, LONG);
  543. BOOL WINAPI GetPenAsyncState(UINT);
  544. BOOL WINAPI GetPenDataInfo(HPENDATA, LPPENDATAHEADER, LPPENINFO, DWORD);
  545. BOOL WINAPI GetPenDataStroke(LPPENDATA, UINT, LPPOINT FAR *, LPVOID FAR *, LPSTROKEINFO );
  546. BOOL WINAPI GetPointsFromPenData(HPENDATA, UINT, UINT, UINT, LPPOINT);
  547. VOID WINAPI DrawPenData(HDC, LPRECT, HPENDATA);
  548. BOOL WINAPI MetricScalePenData(HPENDATA, UINT);
  549. BOOL WINAPI ResizePenData(HPENDATA, LPRECT);
  550. BOOL WINAPI OffsetPenData(HPENDATA, int, int);
  551. BOOL WINAPI RedisplayPenData(HDC, HPENDATA, LPPOINT, LPPOINT, int, DWORD);
  552. HPENDATA WINAPI CompactPenData(HPENDATA, UINT );
  553. HPENDATA WINAPI DuplicatePenData(HPENDATA, UINT);
  554. HPENDATA WINAPI CreatePenData(LPPENINFO, int, UINT, UINT);
  555. HPENDATA WINAPI AddPointsPenData(HPENDATA, LPPOINT, LPVOID, LPSTROKEINFO);
  556. LPPENDATA WINAPI BeginEnumStrokes(HPENDATA );
  557. /****** New Windows Messages ************************************************/
  558. #define WM_RCRESULT (WM_PENWINFIRST+1)
  559. #define WM_HOOKRCRESULT (WM_PENWINFIRST+2)
  560. #define WM_GLOBALRCCHANGE (WM_PENWINFIRST+3)
  561. #define WM_SKB (WM_PENWINFIRST+4)
  562. #define WM_HEDITCTL (WM_PENWINFIRST+5)
  563. /****** Dictionary **********************************************************/
  564. #define cbDictPathMax 255
  565. #define DIRQ_QUERY 1
  566. #define DIRQ_DESCRIPTION 2
  567. #define DIRQ_CONFIGURE 3
  568. #define DIRQ_OPEN 4
  569. #define DIRQ_CLOSE 5
  570. #define DIRQ_SETWORDLISTS 6
  571. #define DIRQ_STRING 7
  572. #define DIRQ_SUGGEST 8
  573. #define DIRQ_ADD 9
  574. #define DIRQ_DELETE 10
  575. #define DIRQ_FLUSH 11
  576. #define DIRQ_RCCHANGE 12
  577. #define DIRQ_SYMBOLGRAPH 13
  578. #define DIRQ_INIT 14
  579. #define DIRQ_CLEANUP 15
  580. #define DIRQ_COPYRIGHT 16
  581. #define DIRQ_USER 4096
  582. BOOL WINAPI DictionarySearch(LPRC, LPSYE, int, LPSYV, int);
  583. /****** Handwriting Edit Control ********************************************/
  584. #define HE_GETRC 3
  585. #define HE_SETRC 4
  586. #define HE_GETINFLATE 5
  587. #define HE_SETINFLATE 6
  588. #define HE_GETUNDERLINE 7
  589. #define HE_SETUNDERLINE 8
  590. #define HE_GETINKHANDLE 9
  591. #define HE_SETINKMODE 10
  592. #define HE_STOPINKMODE 11
  593. #define HE_GETRCRESULTCODE 12
  594. #define HE_DEFAULTFONT 13
  595. #define HE_CHARPOSITION 14
  596. #define HE_CHAROFFSET 15
  597. #define HE_GETRCRESULT 22
  598. #define HE_KKCONVERT 30
  599. #define HE_GETKKCONVERT 31
  600. #define HE_CANCELKKCONVERT 32
  601. #define HE_FIXKKCONVERT 33
  602. #define HEKK_DEFAULT 0
  603. #define HEKK_CONVERT 1
  604. #define HEKK_CANDIDATE 2
  605. #define HEP_NORECOG 0
  606. #define HEP_RECOG 1
  607. #define HEP_WAITFORTAP 2
  608. #define HN_ENDREC 4
  609. #define HN_DELAYEDRECOGFAIL 5
  610. #define HN_RCRESULT 20
  611. #define HN_ENDKKCONVERT 30
  612. typedef struct tagRECTOFS
  613. {
  614. int dLeft;
  615. int dTop;
  616. int dRight;
  617. int dBottom;
  618. }
  619. RECTOFS, FAR *LPRECTOFS;
  620. /****** Boxed Edit Control **************************************************/
  621. typedef struct tagBOXLAYOUT
  622. {
  623. int cyCusp;
  624. int cyEndCusp;
  625. UINT style;
  626. DWORD rgbText;
  627. DWORD rgbBox;
  628. DWORD rgbSelect;
  629. }
  630. BOXLAYOUT, FAR *LPBOXLAYOUT;
  631. #define BXS_NONE 0U
  632. #define BXS_RECT 1U
  633. #define BXS_ENDTEXTMARK 2U
  634. #define BXS_MASK 3U
  635. #define HE_GETBOXLAYOUT 20
  636. #define HE_SETBOXLAYOUT 21
  637. #define BXD_CELLWIDTH 12
  638. #define BXD_CELLHEIGHT 16
  639. #define BXD_BASEHEIGHT 13
  640. #define BXD_BASEHORZ 0
  641. #define BXD_CUSPHEIGHT 2
  642. #define BXD_ENDCUSPHEIGHT 4
  643. /****** Screen Keyboard *****************************************************/
  644. typedef struct tagSKBINFO
  645. {
  646. HWND hwnd;
  647. UINT nPad;
  648. BOOL fVisible;
  649. BOOL fMinimized;
  650. RECT rect;
  651. DWORD dwReserved;
  652. }
  653. SKBINFO, FAR *LPSKBINFO;
  654. #define SKB_QUERY 0x0000
  655. #define SKB_SHOW 0x0001
  656. #define SKB_HIDE 0x0002
  657. #define SKB_CENTER 0x0010
  658. #define SKB_MOVE 0x0020
  659. #define SKB_MINIMIZE 0x0040
  660. #define SKB_FULL 0x0100
  661. #define SKB_BASIC 0x0200
  662. #define SKB_NUMPAD 0x0400
  663. #define OBM_SKBBTNUP 32767
  664. #define OBM_SKBBTNDOWN 32766
  665. #define OBM_SKBBTNDISABLED 32765
  666. #define SKN_CHANGED 1
  667. #define SKN_POSCHANGED 1
  668. #define SKN_PADCHANGED 2
  669. #define SKN_MINCHANGED 4
  670. #define SKN_VISCHANGED 8
  671. #define SKN_TERMINATED 0xffff
  672. BOOL WINAPI ShowKeyboard(HWND, UINT, LPPOINT, LPSKBINFO);
  673. /****** New ComboBox Notifications *****************************************/
  674. #define CBN_ENDREC 16
  675. #define CBN_DELAYEDRECOGFAIL 17
  676. #define CBN_RCRESULT 18
  677. #ifdef __cplusplus
  678. }
  679. #endif /* __cplusplus */
  680. #ifndef RC_INVOKED
  681. #pragma pack()
  682. #endif /* RC_INVOKED */
  683. #endif /* #define _INC_PENWIN */