home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
wpentk.zip
/
WBPENTK4.DSK
/
IDRRECO.IDL
< prev
next >
Wrap
Text File
|
1994-10-07
|
17KB
|
515 lines
//# This file was generated by the SOM Compiler.
//# FileName: idrreco.id2.
//# Generated using:
//# SOM Precompiler somopc: 2.7
//# SOM Emitter emitidl: 2.22
//
// CLASS: IDRReco
//
// CLASS HIERARCHY:
//
// SOMObject
// └── IDRReco
//
// DESCRIPTION:
//
// Generic input data recognition class.
#ifndef idrreco_idl
#define idrreco_idl
#include <somobj.idl>
#include <somcls.idl>
#include "pentypes.idl"
#include "idftypes.idl"
interface M_IDRReco;
exception IDR_PROB { ULONG ulErrorCode; };
interface IDOStroke;
interface IDRReco : SOMObject
{
exception IDR_PROB { ULONG ulErrorCode; };
APIRET idrGetDescriptionFromFile( in PSZ pszFileName, in PSZ pszDescription);
// Method : idrGetDescriptionFromFile
//
// Purpose : Get the description from backed up trainer file
//
// Parameters: pszFileName - .HWS file
//
// pszDescription - place to put description
//
// Returns:
// NO_ERROR - okay
//
// History:
// 05-16-94 - MikeD created
VOID idrSetSymbolSubset( in PIDR_SYMSET pSymSet ) raises(IDR_PROB);
// Method : idrSetSymbolSubset
//
// Purpose : Set the symbol subsets to be used for recognition.
//
// Synopsis : VOID idrSetSymbolSubset( PIDR_SYMSET pSymSet )
//
// pSymSet... The symbol set to be used.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
//
// Notes :
// This method will constrain the recognition object to use the specified
// subset of recognizable symbols.
//
// Usage :
// Callable - During Alive state.
// Override - Override by subclasses.
VOID idrGetSymbolSubset( in PIDR_SYMSET pSymSet,
in PULONG pulSize ) raises(IDR_PROB);
// Method : idrGetSymbolSubset
//
// Purpose : Get the symbol subsets being used for recognition.
//
// Synopsis : VOID idrGetSymbolSubset( INOUT PIDR_SYMSET pSymSet,
// INOUT PULONG pulSize )
//
// pSymSet... Pointer to symbol set.
// Suggested size: sizeof (IDR_SYMSET)
// pulSize... Pointer to size variable.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
// IDRERR_BUF_TOO_SMALL...Larger buffer is required.
//
// Notes :
// This method will return the symbol set being used by the recognition
// object as recognizable symbols.
// Two invocations may be required to get the data:
// 1) Invoke with pulSize pointing to the initial size of the
// buffer at pSymSet.
// 2) On return, if the buffer size passed in was large enough,
// pSymSet will contain the information. Otherwise,
// IDRERR_BUF_TOO_SMALL will be returned and
// pulSize will point to the size of the required buffer.
// 3) Reallocate the buffer needed and invoke the method again.
//
// Usage :
// Callable - During Alive state.
// Override - Override by subclasses.
VOID idrGetSymbolSubsetInfo(in ULONG ulSymSets,
in PULONG pulSymCnt,
in PIDR_SYM pSyms) raises(IDR_PROB);
// Method : idrGetSymbolSubsetInfo
//
// Purpose : Get the symbols associated with the specified subsets.
//
// Synopsis : VOID idrGetSymbolSubsetInfo( IN ULONG ulSymSets,
// INOUT PULONG pulSymCnt,
// INOUT PIDR_SYM pSyms)
//
// ulSymSets.. Mask of symbol sets.
// pulSymCnt.. Pointer to the number of symbols
// pSyms...... Pointer to the array of symbols. This is a contiguous
// array of IDR_SYMs.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
// IDRERR_BUF_TOO_SMALL...Larger buffer is required.
//
// Notes :
// This method will enumerate the symbols in the given symbol subsets.
// Two invocations may be required to get the data:
// 1) Invoke with pSyms pointing to a buffer of size
// *pulSymCnt*sizeof(IDR_SYM).
// 2) On return, if the buffer size passed in was large enough,
// pSyms will contain the symbols. Otherwise,
// IDRERR_BUF_TOO_SMALL will be returned and
// pulSymCnt will point to the number of symbols to return.
// 3) Reallocate *pulSymCnt*sizeof(IDR_SYM) and point to it with
// pSyms. Invoke the method again.
//
// Usage :
// Callable - During Alive state.
// Override - Override by subclasses.
VOID idrSetMetrics(in PIDR_INKMETRICS pMetrics) raises(IDR_PROB);
// Method : idrSetMetrics
//
// Purpose : Set the metrics.
//
// Synopsis : VOID idrSetMetrics( IN PIDR_INKMETRICS pMetrics )
//
// pMetrics....... Pointer to metrics structure.
//
// Returns :
// NO_ERROR.................. Success.
// IDRERR_ERROR.............. Error.
//
// Notes :
//
// Usage :
// Callable - Always.
// Override - By subclasses if metrics are defaulted.
VOID idrGetMetrics(in PIDR_INKMETRICS pMetrics) raises(IDR_PROB);
// Method : idrGetMetrics
//
// Purpose : Get the metrics in use by the object.
//
// Synopsis : VOID idrGetMetrics( INOUT PVOID pMetrics )
//
// pMetrics....... Pointer to metrics structure.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
//
// Notes :
VOID idrAddStroke(in PSTROKEDATA pData,
in HWND hRelative ) raises(IDR_PROB);
// Method : idrAddStroke
//
// Purpose : Add stroke data to recognition process.
//
// Synopsis : VOID idrAddStroke(in PSTROKEDATA pData,
// in HWND hRelative )
//
// pData... Pointer to a stroke data structure. If this is NULL,
// the stroke data will be queried by this object.
// hRelative... If the pData parameter is NULL, this HWND is the
// window for which the stroke data is to be queried.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
//
// Notes :
// Once an application adds strokes via this method, it should
// continue to use only this method to add strokes until the
// recognition occurs and the engine returns to the Alive state.
//
VOID idrAddStrokefromStrokeObject(in IDOStroke pStrokeObj ) raises(IDR_PROB);
// Method : idrAddStrokefromStrokeObject
//
// Purpose : Add a stroke object's stroke data to this recognition process.
//
// Synopsis : VOID idrAddStrokefromStrokeObject(in IDOStroke pStrokeObj )
//
// pStrokeObj..... Source stroke object.
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
//
// Notes :
// Once an application adds strokes via this method, it should
// continue to use only this method to add strokes until the
// recognition occurs and the engine returns to the Alive state.
VOID idrClearStrokes() raises(IDR_PROB);
// Method : idrClearStrokes
//
// Purpose : Clear all strokes from the engine.
//
// Synopsis : VOID idrClearStrokes()
//
// Returns :
// NO_ERROR.............. Success.
// IDRERR_ERROR.......... Error.
//
// Notes :
// Clears strokes; does NOT reset the object's processing options.
// Resets the engine back to the Alive state.
#ifdef __SOMIDL__
implementation {
releaseorder:idrSetSymSet,idrGetSymSet,
idrSetSymbolSubset,idrGetSymbolSubset,
idrGetSymbolSubsetInfo,idrSetMetrics,idrGetMetrics,
idrAddStroke,idrAddStrokefromStrokeObject,idrClearStrokes,
idrSetEngEntryPts,
idrSetInstHdls,idrSetCfgValues,idrSetDefaults,
idrResetToDefaults,idrSetSymSubsets,
idrSetLngMdlUsage,idrSetTrainData,idrGetDefaults,idrGetInstHdls,
idrGetEngEntryPts,idrGetCfgValues,idrGetSymSubsets,
idrGetLngMdlUsage,idrGetCompCfgCaps,idrGetDataCfgCaps,
idrGetTrainData,idrAddRawData,idrDelData,
idrDelRawData,idrDataComplete,idrDataClear,
idrGetGrf,idrCopyGrf,idrGetGrfChildAltCnt,idrGetGrfChildHndls,
idrGetGrfInfoAltCnt,idrGetGrfInfo,idrSetXlateInfo,idrGetXlateInfo,
idrXlateSym,idrSetMetricsDefaults,idrGetMetricsDefaults,
idrSetState,idrGetState,
idrSaveCfg,idrRestoreCfg,idrGetDescriptionFromFile,
idrCopyEnviron,idrIGetTrainStatus;
//# Class Modifiers
functionprefix = IDRReco;
majorversion = 0;
minorversion = 1;
local;
filestem = idrreco;
metaclass = M_IDRReco;
callstyle = idl;
passthru C_h_before = ""
""
""
"#pragma pack(2)"
""
"/*"
"** Input Data Recognition (IDR) error codes."
"** Certain OS/2 error codes are also used directly. (for ex. NO_ERROR)"
"*/"
"#include \"idrerror.h\""
""
"/*"
"** Defines for symbol types."
"*/"
""
"#define IDR_TYPE_ASCII (USHORT)(0x0002)"
"#define IDR_TYPE_CTRL (USHORT)(0xffff)"
"#define IDR_TYPE_SYSGESTURE (USHORT)(0x8001)"
"#define IDR_TYPE_LETTERGESTURE (USHORT)(0x8002)"
""
""
"typedef struct _IDR_SYM /* Basic symbol */"
"{"
" USHORT usSymType; /* Symbol, e.g. ASCII, etc. */"
" USHORT usSymVal; /* Symbol value, For IDR_TYPE_ASCII and "
" IDR_TYPE_LETTERGESTURE, this is the"
" \"code point\" on the current code page."
" For IDR_TYPE_SYSGESTURE this is the"
" gesture's virtual id. */ "
"} IDR_SYM,"
" *PIDR_SYM,"
" **PPIDR_SYM;"
""
"/*"
"** Defines for text and gesture symbol subsets."
"*/"
""
"#define IDR_SYMSET_FULL (0x10000000) /* full symbol set; this is the default */"
""
"/*"
"** Defines for text symbol subsets. These are valid in text mode only."
"*/"
""
"#define IDR_SYMSET_ALPHALO (0x00000001) /* lower-alphabetic text symbols */"
"#define IDR_SYMSET_ALPHAHI (0x00000002) /* upper-alphabetic text symbols */"
"#define IDR_SYMSET_DIGIT (0x00000004) /* digits; 0 through 9 */"
"#define IDR_SYMSET_MONETARY (0x00000008) /* monetary symbols */"
"#define IDR_SYMSET_MATH (0x00000010) /* mathematical symbols */"
"#define IDR_SYMSET_PUNCTUATION (0x00000020) /* punctuation symbols */"
"#define IDR_SYMSET_SPECIAL (0x00000040) /* special symbols */"
""
""
"typedef struct _IDR_SYMSET /* Symbol set */"
"{"
" ULONG ulSymSets; /* Symbol subset mask */"
" ULONG ulSymCnt; /* Count of symbols in the symbol list. */"
" IDR_SYM SymList[1]; /* Contiguous array of symbols. */"
"} IDR_SYMSET,"
" *PIDR_SYMSET,"
" **PPIDR_SYMSET;"
""
""
"/*"
"** Defines used for setting the metrics."
"** Space disabling is only used if all strokes are known to belong to one word."
"** Direction is defaulted by the object."
"*/"
""
"#define IDR_INKFORM_SINGLE_SYM (0x00000002)"
"#define IDR_INKFORM_BOXED (0x00000004)"
"#define IDR_INKFORM_LINED (0x00000008)"
"#define IDR_INKFORM_UNLINED (0x00000010)"
""
"#define IDR_INKSPACE_DISABLE_OFF (0x00000000)"
"#define IDR_INKSPACE_DISABLE_ON (0x00000001)"
""
"#define IDR_INKDIRECT_RIGHT_DOWN (0x00000001) /* Left->right, top->bottom */ "
""
""
"typedef struct _IDR_INKMETRICS"
"{"
" ULONG ulSSize; /* IDR_INKMETRICS size */"
" ULONG ulRecoForm; /* Type of segmentation */"
" ULONG ulSpaceDisable; /* Don't return any whitespace */"
" ULONG ulDirection; /* Direction of \"normal\" writing */"
" POINTL ptlOrigin; /* Origin */"
" POINTL ptlOffset; /* Offset of \"gray\" area from Origin */"
" POINTL ptlBox; /* Box extents (width & height) */"
" POINTL ptlGray; /* \"Gray\" area between boxes */"
" LONG lOffsetBline; /* Baseline offset from bottom of Box */"
" ULONG ulRowCount; /* Row count, 0 == indeterminate */"
" ULONG ulColCount; /* Column count, 0 == indeterminate */"
"} IDR_INKMETRICS,"
" *PIDR_INKMETRICS,"
" **PPIDR_INKMETRICS;"
""
"#pragma pack()"
""
"";
passthru C_h_after = ""
"";
//# Method Modifiers
somInit: override;
somUninit: override;
//# Data Modifiers
};
#endif /* __SOMIDL__ */
};
interface M_IDRReco : SOMClass
{
VOID idrclsGetEngineDescription( in PULONG pulSize,
in PSZ pszDescription ) raises(IDR_PROB);
// Method : idrclsGetEngineDescription
//
// Purpose : Get the text description of the recognition engine.
//
// Synopsis : VOID idrclsGetEngineDescription( inout PULONG pulSize,
// out PSZ pszDescription )
//
// pulsize......... Buffer size required.
// Suggested initial size: 50 bytes.
// pszDescription.. Description of the engine.
//
// Returns :
// NO_ERROR............... Success.
// IDRERR_ERROR........... Error.
// IDRERR_BUF_TOO_SMALL... A larger buffer is needed.
//
// Notes : Two invocations of this method may be required.
//
// Usage :
// Callable - Always.
// Override - By subclasses.
IDRReco idrclsNewIDRReco(in PVOID pCfg ) raises(IDR_PROB);
// Method : idrclsNewIDRReco
//
// Purpose : Construct a base data transformer object using a specific
// recognition configuration.
//
// Synopsis : APIRET idrclsNewIDRReco( IN PVOID pCfg )
//
// pCfg...... Recognition configuration to use when constructing
// the object.
// IDRReco * pObject.. Pointer to the newly created object.
//
// Returns :
// NO_ERROR.......... Object created, ready for use.
// IDRERR_ERROR...... Object creation failed.
//
// Notes : If an error occurs *'ppObject' is set to NULL.
//
// Usage :
// Callable - Always.
// Override - By subclasses.
VOID idrclsFreeIDR(in IDRReco pObject) raises(IDR_PROB);
// Method : idrclsFreeIDR
//
// Purpose : Destroy a base data transformer object created via
// idrclsNewIDRReco().
//
// Synopsis : VOID idrclsFreeIDR( IN IDRReco *pObject )
//
// pObject... Object to free.
//
// Returns :
// NO_ERROR.......... Success.
// IDRERR_ERROR...... Error, object freed as much as possible.
//
// Notes :
// This should be overridden by any meta-class for a descendant of the
// IDRReco class. The override should perform any sub-class specific
// cleanup and then invoke this method via parent_idrclsFreeIDR().
//
// Usage :
// Callable - Always.
// Override - By subclasses.
#ifdef __SOMIDL__
implementation {
releaseorder: idrclsGetEngineDescription,idrclsNewIDRReco,idrclsFreeIDR,
idrclsSetCfgType,idrclsGetCfgType,idrclsSetCfgTypes,
idrclsSetCfgDescs,idrclsSetCfg,idrclsAddCfgDesc,idrclsDelCfgDesc,
idrclsAddCfg,idrclsReplaceCfg,idrclsDelCfg,idrclsSetDefaultCfg,
idrclsGetCfgTypes,idrclsGetCfgDescs,idrclsGetCfg,idrclsNewCfgFromBase,
idrclsNewDirFromBase,idrclsDelPath,idrclsGetDefaultCfg,
idrclsGetCtlrHandle,idrclsEngCtlrResolve,idrclsCopyCfg,
idrclsFreeCfg,idrclsCfgToInstance,idrclsCfgToInUse,
idrclsCfgCompDataMatch,idrclsCfgCompMatch,idrclsCfgIniToCfg,
idrclsCfgToCfgIni,idrclsInUseListAdd,idrclsInUseListRemove,
idrclsInUseListLock,idrclsInUseListUnlock,idrclsInstListAdd,
idrclsInstListRemove,idrclsInstListLock,idrclsInstListUnlock,
idrclsGlobalLock,idrclsGlobalUnlock;
//# Class Modifiers
functionprefix = IDRRecoM;
majorversion = 0;
minorversion = 1;
local;
filestem = idrreco;
callstyle = idl;
//# Method Modifiers
somInit: override;
somUninit: override;
//# Data Modifiers
};
#endif /* __SOMIDL__ */
};
#endif /* idrreco_idl */