📄 uihw_new.h
字号:
/*
FileName: hwr_api.h
Description: C header file for handwriting recognition engine interface
*/
#ifndef HWR_API_H
#define HWR_API_H
#include "uikbd_hand.h"
#ifndef BYTE
#define BYTE unsigned char
#endif
#ifndef WORD
#define WORD unsigned short
#endif
#ifndef DWORD
#define DWORD unsigned long
#endif
#define IN_5401_TYPE 1 /* 汉字一级字库 */
#define IN_EUROPE_TYPE 1 /* 欧文版专用,识别欧文字元 */
#define UPPER_ALPHA_TYPE 2 /* 大写字母 */
#define LOWER_ALPHA_TYPE 4 /* 小写字母 */
#define NUMA_TYPE 8 /* 数字 */
#define SYMBOL_TYPE 16 /* 键盘符号及自订符号 */
#define GESTURE_TYPE 32 /* 笔势(特殊命令) */
#define IN_13052_TYPE 64 /* 汉字二级字库 */
#define IN_HK_TYPE 128 /* 香港字 */
#define KATA_TYPE 256 /* 日文片假名 */
#define HIRA_TYPE 512 /* 日文平假名 */
#define RECOG_GB_TYPE 1024 /* 识别後回传GB2312机码 */
#define COMPLEX_TYPE 1024
#define IN_RARE_TYPE 2048
#define SIMPLY_TYPE 4096
#define CONTINUE_TYPE 0x8000
/* Following are the return value definition for the mandatory API functions */
//#define STATUS_OK 0x0000 /* Function finished without error */
#define STATUS_NO_DICT 0x0001 /* No dictionary assigned */
#define STATUS_INVALID_DICT 0x0002 /* Dictionary format wrong */
#define STATUS_INVALID_TYPE 0x0003 /* Required range not in current dictionary */
#define STATUS_INVALID_NUMBER 0x0004 /* Required candidate number is invalid */
#define STATUS_NO_ENOUGH_MEMORY 0x0005 /* Dynamic memory assigned not enough */
#define STATUS_INVALID_HWRDATA_PTR 0x0006 /* NULL HWRDATA Pointer */
#define STATUS_INVALID_PRIVATE_PTR 0x0007 /* NULL Private Data Pointer */
#define STATUS_INVALID_BOX_PTR 0x0008 /* NULL Box Pointer */
#define STATUS_INVALID_TRACE_PTR 0x0009 /* NULL TRACE PTR */
#define STATUS_INVALID_RESULT_PTR 0x000A /* NULL RESULT PTR */
#define STATUS_UNKNOWN 0x00FE /* Unspecified error occured */
/* Following is the data definition for HWR engine */
typedef struct tagHWRData
{
char* pInternalDict; /* The pointer to standard HWR dictionary */
char* pExternalDict; /* The pointer to external/customer HWR dictionary, maybe used for user customization */
char* pPrivate; /* The pointer to RAM for HWR engine internal usage */
} HWRData;
typedef struct tagHWRBOX
{
short left;
short top;
short right;
short bottom;
} HWRBOX;
typedef HWRBOX* LPHWRBOX;
/*
extern const unsigned char HW_DATA[];
typedef struct tagHWR_Region
{
short left,top,right,bottom;
}THWR_Region;
typedef struct tagHWR_Point
{
unsigned char x;
unsigned char y;
}THWR_Point;
*/
#ifndef POINT_TYPE
typedef struct point_type
{
short x;
short y;
} POINT_TYPE;
typedef POINT_TYPE* LPPOINT_TYPE;
#endif
// typedef void (*stru_Kernel)(PF_VOID, struct TKernel* KernelPointer);
#ifndef __WIN32__
/* Following are the mandatory API functions */
unsigned short PPHWRInit(HWRData* pData);
unsigned long PPHWRGetRamSize(void); /* Return the size of memory in pPrivate, in bytes. */
unsigned short PPHWRSetType(HWRData* pData,
DWORD type);
unsigned short PPHWRSetBox(HWRData* pData,
LPHWRBOX pbox);
unsigned short PPHWRSetCandidateNum(HWRData* pData,
WORD number);
unsigned short PPHWRRecognize(HWRData* pData,
WORD* pTrace,
WORD* pResult);
#else
typedef unsigned short (__cdecl *pPPHWRInit)(HWRData* pData);
typedef unsigned long (__cdecl *pPPHWRGetRamSize)(void); /* Return the size of memory in pPrivate, in bytes. */
typedef unsigned short (__cdecl *pPPHWRSetType)(HWRData* pData, DWORD type);
typedef unsigned short (__cdecl *pPPHWRSetBox)(HWRData* pData, LPHWRBOX pbox);
typedef unsigned short (__cdecl *pPPHWRSetCandidateNum)(HWRData* pData, WORD number);
typedef unsigned short (__cdecl *pPPHWRRecognize)(HWRData* pData, WORD* pTrace, WORD* pResult);
pPPHWRInit PPHWRInit;
pPPHWRGetRamSize PPHWRGetRamSize;
pPPHWRSetType PPHWRSetType;
pPPHWRSetBox PPHWRSetBox;
pPPHWRSetCandidateNum PPHWRSetCandidateNum;
pPPHWRRecognize PPHWRRecognize;
#endif
/* Following are the optional API functions */
DWORD PPHWRGetRange(HWRData* pData);
WORD PPHWRGetCandidateNum(HWRData* pData);
char* PPHWRGetDictVersion(HWRData* pData, BYTE index);
char* PPHWRGetEngineVersion(void);
char* PPHWRGetEngineBrand(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -