Defines | |
#define | EXTERN_C |
#define | LCD_X 320 |
#define | LCD_Y 240 |
Typedefs | |
typedef void * | HEPADINKCONTEXT |
typedef void * | INKUSB_DEVICE_CONTEXT |
Enumerations | |
enum | TEXT_LAYER { TEXT_LAYER0 = 1, TEXT_LAYER1 = 2, TEXT_LAYER2 = 4 } |
enum | SYNC_LAYER { SYNC_LAYER_0 = 1, SYNC_LAYER_1 = 2, SYNC_LAYER_2 = 4, SYNC_ALL = 7 } |
Functions | |
EXTERN_C HEPADINKCONTEXT | ePadInk_CreateContext (IWedge *pRef) |
EXTERN_C HEPADINKCONTEXT | ePadInk_CreateContextH (INKUSB_DEVICE_CONTEXT pHandle) |
EXTERN_C HEPADINKCONTEXT | ePadInk_CreateSilentContext (IWedge *pRef) |
EXTERN_C HEPADINKCONTEXT | ePadInk_CreateSilentContextH (INKUSB_DEVICE_CONTEXT pHandle) |
EXTERN_C HRESULT | ePadInk_DestroyContext (HEPADINKCONTEXT hctx) |
EXTERN_C HRESULT | ePadInk_TextOut (HEPADINKCONTEXT hctx, TEXT_LAYER layer, int xStart, int ySTart, LPCTSTR lpString, int nCount) |
EXTERN_C HRESULT | ePadInk_SetFont (HEPADINKCONTEXT hctx, LOGFONT *pFont) |
EXTERN_C HRESULT | ePadInk_GetBlackThreshold (HEPADINKCONTEXT hctx, int *pInt) |
EXTERN_C HRESULT | ePadInk_SetBlackThreshold (HEPADINKCONTEXT hctx, int threshold) |
EXTERN_C HRESULT | ePadInk_GetWhiteThreshold (HEPADINKCONTEXT hctx, int *pInt) |
EXTERN_C HRESULT | ePadInk_SetWhiteThreshold (HEPADINKCONTEXT hctx, int threshold) |
EXTERN_C HRESULT | ePadInk_SetUseSlowMethod (HEPADINKCONTEXT hctx, BOOL bUseSlowMethod) |
EXTERN_C HRESULT | ePadInk_GetUseSlowMethod (HEPADINKCONTEXT hctx, BOOL *bUseSlowMethod) |
EXTERN_C HRESULT | ePadInk_SyncToDevice (HEPADINKCONTEXT hctx, SYNC_LAYER layerMask) |
EXTERN_C HRESULT | ePadInk_LoadBitmapToDevice (HEPADINKCONTEXT hctx, SYNC_LAYER layerMask, LPCTSTR lpFilename, BOOL bStretch, int xPos, int yPos) |
EXTERN_C HRESULT | ePadInk_ClrScrn (HEPADINKCONTEXT hctx) |
EXTERN_C HDC | ePadInk_GetDC (HEPADINKCONTEXT hctx) |
EXTERN_C HRESULT | ePadInk_ReleaseDC (HEPADINKCONTEXT hctx, HDC hdc, BOOLEAN fSyncToDevice) |
#define EXTERN_C |
#define LCD_X 320 |
#define LCD_Y 240 |
typedef void* HEPADINKCONTEXT |
Handle to ePadInk context for graphics operations.
typedef void* INKUSB_DEVICE_CONTEXT |
enum SYNC_LAYER |
Layer indicators for sync function. Note that SYNC_LAYER_0 is reserved for ink and cannot be used. SYNC_LAYER_1 is ON|OFF and SYNC_LAYER_2 is HALF_ON / OFF.
00179 { 00180 SYNC_LAYER_0 = 1, 00181 SYNC_LAYER_1 = 2, 00182 SYNC_LAYER_2 = 4, 00183 SYNC_ALL = 7
enum TEXT_LAYER |
Available text layers. TEXT_LAYER0 is reserved for inking and should cannot have text written to it.
00116 { 00117 TEXT_LAYER0 = 1, 00118 TEXT_LAYER1 = 2, 00119 TEXT_LAYER2 = 4
EXTERN_C HRESULT ePadInk_ClrScrn | ( | HEPADINKCONTEXT | hctx | ) |
Clears display to "Black".
EXTERN_C HEPADINKCONTEXT ePadInk_CreateContext | ( | IWedge * | pRef | ) |
Creates a context for graphics operations. Note that this library does not manage threads; this means that it is the caller's responsibility to ensure that the object has been created to allow for multiple thread calling *or* to ensure that the same thread that created the object is used to operate on the object using these methods.
This library does *not* increment the reference count on the object.
Upon creation the default font is "System". Returns NULL on failure, else valid context.
EXTERN_C HEPADINKCONTEXT ePadInk_CreateContextH | ( | INKUSB_DEVICE_CONTEXT | pHandle | ) |
EXTERN_C HEPADINKCONTEXT ePadInk_CreateSilentContext | ( | IWedge * | pRef | ) |
Creates a context like ePadInk_CreateContext but creates it in such a way as to avoid I/O to the device from 'waking up' the screen saver. Used primarily by the internal screen saver code. Most users should not use this constructor.
EXTERN_C HEPADINKCONTEXT ePadInk_CreateSilentContextH | ( | INKUSB_DEVICE_CONTEXT | pHandle | ) |
EXTERN_C HRESULT ePadInk_DestroyContext | ( | HEPADINKCONTEXT | hctx | ) |
Destroys the graphics context. Any future accesses to a destroyed object will have unpredictable results.
EXTERN_C HRESULT ePadInk_GetBlackThreshold | ( | HEPADINKCONTEXT | hctx, | |
int * | pInt | |||
) |
Returns the current black threshold value [-128..whiteThreshold)
EXTERN_C HDC ePadInk_GetDC | ( | HEPADINKCONTEXT | hctx | ) |
Returns an HDC for the device. Note that this should be followed by an ePadInk_ReleaseDC call.
EXTERN_C HRESULT ePadInk_GetUseSlowMethod | ( | HEPADINKCONTEXT | hctx, | |
BOOL * | bUseSlowMethod | |||
) |
Return the current value of UseSlowMethod ( TRUE or FALSE )
EXTERN_C HRESULT ePadInk_GetWhiteThreshold | ( | HEPADINKCONTEXT | hctx, | |
int * | pInt | |||
) |
Returns the current white threshold value (blackThreshold..127]
EXTERN_C HRESULT ePadInk_LoadBitmapToDevice | ( | HEPADINKCONTEXT | hctx, | |
SYNC_LAYER | layerMask, | |||
LPCTSTR | lpFilename, | |||
BOOL | bStretch, | |||
int | xPos, | |||
int | yPos | |||
) |
Loads a given BMP to the device using the layerMask. To display a "3-color" bitmap (ON/OFF/HALF_ON) you must supply a layerMask of SYNC_LAYER1|SYNC_LAYER2. bStretch flag to enable/disable Stretch image to fit for device size If not stretch, xPos, yPos will be the starting drawing point of image
EXTERN_C HRESULT ePadInk_ReleaseDC | ( | HEPADINKCONTEXT | hctx, | |
HDC | hdc, | |||
BOOLEAN | fSyncToDevice | |||
) |
Releases the DC and (optionally) synchronizes to the device.
EXTERN_C HRESULT ePadInk_SetBlackThreshold | ( | HEPADINKCONTEXT | hctx, | |
int | threshold | |||
) |
Sets the black threshold -- must be of the range [-128..whiteThreshold)
EXTERN_C HRESULT ePadInk_SetFont | ( | HEPADINKCONTEXT | hctx, | |
LOGFONT * | pFont | |||
) |
Allows the user to set the default font of this context.
EXTERN_C HRESULT ePadInk_SetUseSlowMethod | ( | HEPADINKCONTEXT | hctx, | |
BOOL | bUseSlowMethod | |||
) |
Sets the m_bUseSlowMethod -- must be either TRUE or FALSE. If TRUE then graphics conversion uses the GDI GetPixel call. GetPixel always works and returns the correct RGB data but is much slower than direct access. The default is to NOT use GetPixel and instead use direct access to convert the colors to an LCD-compatible colorspace.
Note that the default setting can be overridden creating the registry key:
HKLM\Software\InterlinkElectronics\IE_ePadInk\SlowMethod
(Note that the type and value of the above key do not matter.)
EXTERN_C HRESULT ePadInk_SetWhiteThreshold | ( | HEPADINKCONTEXT | hctx, | |
int | threshold | |||
) |
Sets the current white threshold -- must be in the range of (blackThreshold..127]
EXTERN_C HRESULT ePadInk_SyncToDevice | ( | HEPADINKCONTEXT | hctx, | |
SYNC_LAYER | layerMask | |||
) |
Sends the current contents of the context to the device. Default is to sync all layers, but the programmer can override with a specific layer.
EXTERN_C HRESULT ePadInk_TextOut | ( | HEPADINKCONTEXT | hctx, | |
TEXT_LAYER | layer, | |||
int | xStart, | |||
int | ySTart, | |||
LPCTSTR | lpString, | |||
int | nCount | |||
) |
This is a helper function to allow one to write text to the device. It uses the current font. Generally speaking for custom graphics one will obtain the HDC directly and use GDI operations on it.