Main Page   Compound List   File List   Compound Members   File Members  

wtboard.c File Reference

#include <windows.h>
#include <limits.h>
#include <stdio.h>
#include <Commdlg.h>
#include <math.h>
#include "..\whiteboardproject\include\wintab.h"
#include "..\whiteboardproject\include\pktdef.h"
#include "wtboard.h"

Defines

#define PACKETDATA
#define PACKETMODE   0
#define PKT_SIZE_BUFFER   1000

Functions

typedef UINT (API *WTINFO)(UINT
void _WTBPosGlobalToClient (POINT *p, RECT *prcClient)
void _WTBPressureGlobalToClient (unsigned char *p, int widthmin, int widthmax)
void WTBSetCallback (WTB_HookPtr hook, DWORD dwSrcClass)
void WTBLButtonDown (float *boardpos, int texture_size)
void WTBMouseMove (float *boardpos, int texture_size)
void WTBLButtonUp (float *boardpos, int texture_size)
LRESULT FAR PASCAL WTBoardWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL WTBInitialize (HINSTANCE hInstance)
BOOL WTBUninitialize ()
BOOL WTBIsReceiverVisible ()
void WTBShowReceiver (BOOL bShow)
WTBOARDDOCUMENT * WTBAttachDocToReceiver (WTBOARDDOCUMENT *pDoc)
WTBOARDDOCUMENT * WTBDetachDocFromReceiver ()
WTBOARDDOCUMENT * WTBNewDocument ()
int WTBRemoveEmptyPages (WTBOARDDOCUMENT *pDoc)
WTBOARDDOCUMENT * WTBLoadDocument (LPCSTR lpcsFileName)
BOOL WTBSaveDocument (WTBOARDDOCUMENT *pDoc, LPCSTR lpcsFileName)
void _WTBFreeDocumentPages (WTBOARDDOCUMENT *pDoc, WTBOARDPAGE *pPage)
void WTBCloseDocument (WTBOARDDOCUMENT *pDoc)
WTBOARDPAGE * WTBInsPage (WTBOARDDOCUMENT *pDoc, BOOL bNotify)
WTBOARDPAGE * WTBNewPage (WTBOARDDOCUMENT *pDoc, BOOL bNotify)
WTBOARDPAGE * WTBFindPage (WTBOARDDOCUMENT *pDoc, UINT nPageID)
BOOL WTBBrowseToPage (WTBOARDDOCUMENT *pDoc, WTBOARDPAGE *pPage, BOOL bNotify)
BOOL WTBBrowseToNextPage (WTBOARDDOCUMENT *pDoc)
BOOL WTBBrowseToPrevPage (WTBOARDDOCUMENT *pDoc)
void _WTBFreePageStrokes (WTBOARDPAGE *pPage, WTBOARDDATASTROKE *pStroke)
BOOL WTBClearPage (WTBOARDDOCUMENT *pDoc, WTBOARDPAGE *pPage)
BOOL WTBDeletePage (WTBOARDDOCUMENT *pDoc, WTBOARDPAGE *pPage)
WTBOARDDATASTROKE * WTBNewStroke (WTBOARDPAGE *pPage, WTBOARDDATANODELIST *pList, BOOL bNotify)
WTBOARDDATASTROKE * WTBNewStrokeFromArray (WTBOARDPAGE *pPage, UINT nStrokeID, COLORREF StrokeColor, UINT nNodeCount, WTBOARDDATANODE *pNodeArray, BOOL bNotify)
WTBOARDDATASTROKE * WTBFindStroke (WTBOARDPAGE *pPage, UINT nStrokeID)
void WTBSetTool (short tool_id)
void WTBSetStrokeColor (WTBOARDDATASTROKE *pStroke, COLORREF clr)
COLORREF WTBGetStrokeColor (WTBOARDDATASTROKE *pStroke)
BOOL WTBDeleteStroke (WTBOARDPAGE *pPage, WTBOARDDATASTROKE *pStroke, BOOL bNotify)
WTBOARDDATANODELIST * WTBAddNodeToList (WTBOARDDATANODELIST *pList, unsigned short x, unsigned short y, unsigned char p)
void WTBDeleteNodeList (WTBOARDDATANODELIST *pList)
int _WTBGetListNodeCount (WTBOARDDATANODELIST *pList)
void WTBGenerateStrokeFromNodeList (WTBOARDDATASTROKE *pStroke, WTBOARDDATANODELIST *pList)

Variables

WTBOARDRECEIVER g_wtBoardReceiver
WTB_HookPtr g_wtBoardHookPtr = NULL
DWORD g_wtBoardHookSrc = 0
HINSTANCE ghWintab
typedef UINT
typedef LPVOID
PACKET pkt [PKT_SIZE_BUFFER]

Detailed Description

Date:
2001/10/08 (created)
Author:
David Yuheng Zhao - www.ministars.com , Lars Winkler Pettersson - www.handwritten.net , Magnus Andersson
This file contains function definitions for winTab enabled whiteboard.

Copyright (c) 2001,2002 Stefan Seipel, Department of Information Technology, Uppsala University

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Define Documentation

#define PACKETDATA
 

Value:

(PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | \
PK_ORIENTATION | PK_CURSOR)
Defines the interaction mode with the wacom tablet
See also:
http://www.wacomeng.com/devsupport/ibmpc/wacomwindevfaq.html#FAQ2.2

#define PACKETMODE   0
 

...

#define PKT_SIZE_BUFFER   1000
 

The size buffer which WinTab packets are read to - buffer is used to optimize for performation - the buffer used by the wintab/wacom device


Function Documentation

void _WTBFreeDocumentPages (  WTBOARDDOCUMENT *    pDoc,
WTBOARDPAGE *    pPage
) 
 

Clear a whiteboard document

void _WTBFreePageStrokes (  WTBOARDPAGE *    pPage,
WTBOARDDATASTROKE *    pStroke
) 
 

Clear the page from strokes

int _WTBGetListNodeCount (  WTBOARDDATANODELIST *    pList ) 
 

Get the size of the node list

void _WTBPosGlobalToClient (  POINT *    p,
RECT *    prcClient
) 
 

Convert the global coordinate system to the one used with the whiteboard

Parameters:
p 
prcClient 

void _WTBPressureGlobalToClient (  unsigned char *    p,
int    widthmin,
int    widthmax
) 
 

Use the pressure to set a local width of a stroke drawn on the virtual whiteboard

Parameters:
p 
widthmin 
widthmax 

typedef UINT (  API *    WTINFO ) 
 

Used for loading the wacom board...

WTBOARDDATANODELIST* WTBAddNodeToList (  WTBOARDDATANODELIST *    pList,
unsigned short    x,
unsigned short    y,
unsigned char    p
) 
 

Add one node to the stroke currently being buildt Input pList can be null, then a new list will be generated

WTBOARDDOCUMENT* WTBAttachDocToReceiver (  WTBOARDDOCUMENT *    pDoc ) 
 

Present the WTBOARDDOCUMENT in the wtboard receiver window

BOOL WTBBrowseToNextPage (  WTBOARDDOCUMENT *    pDoc ) 
 

Change to next page

BOOL WTBBrowseToPage (  WTBOARDDOCUMENT *    pDoc,
WTBOARDPAGE *    pPage,
BOOL    bNotify
) 
 

Change page

BOOL WTBBrowseToPrevPage (  WTBOARDDOCUMENT *    pDoc ) 
 

Change to previous page

BOOL WTBClearPage (  WTBOARDDOCUMENT *    pDoc,
WTBOARDPAGE *    pPage
) 
 

Clear the page from strokes and update its view

void WTBCloseDocument (  WTBOARDDOCUMENT *    pDoc ) 
 

Close the whiteboard document

void WTBDeleteNodeList (  WTBOARDDATANODELIST *    pList ) 
 

Erase the node list

BOOL WTBDeletePage (  WTBOARDDOCUMENT *    pDoc,
WTBOARDPAGE *    pPage
) 
 

Remove a page from a whiteboard document

BOOL WTBDeleteStroke (  WTBOARDPAGE *    pPage,
WTBOARDDATASTROKE *    pStroke,
BOOL    bNotify
) 
 

Delete a stroke

WTBOARDDOCUMENT* WTBDetachDocFromReceiver (    ) 
 

Remove the WTBOARDDOCUMENT from the wtboard receiver window

WTBOARDPAGE* WTBFindPage (  WTBOARDDOCUMENT *    pDoc,
UINT    nPageID
) 
 

Using the page id and a WTBOARDDOCUMENT return the page or null

WTBOARDDATASTROKE* WTBFindStroke (  WTBOARDPAGE *    pPage,
UINT    nStrokeID
) 
 

Finds a stroke on the current page

void WTBGenerateStrokeFromNodeList (  WTBOARDDATASTROKE *    pStroke,
WTBOARDDATANODELIST *    pList
) 
 

Add the list of nodes to the stroke pStroke

COLORREF WTBGetStrokeColor (  WTBOARDDATASTROKE *    pStroke ) 
 

Get stroke color

BOOL WTBInitialize (  HINSTANCE    hInstance ) 
 

Initialize the wtboard window. By creating a hidden wtboard window

Parameters:
hInstance 

WTBOARDPAGE* WTBInsPage (  WTBOARDDOCUMENT *    pDoc,
BOOL    bNotify
) 
 

Create a page in a whiteboard document

position it in the before active page

BOOL WTBIsReceiverVisible (    ) 
 

Check if the wtboard receiver window is visible

void WTBLButtonDown (  float *    boardpos,
int    texture_size
) 
 

Starts registring a stroke when the left mouse button is pressed

Parameters:
boardpos  the texel position on the whiteboard where a stroke starts
texture_size  the size of the texture on which strokes are rendered

void WTBLButtonUp (  float *    boardpos,
int    texture_size
) 
 

Ends a registration of a stroke when left mouse button is released

Parameters:
boardpos  the texel position on the whiteboard where a stroke starts
texture_size  the size of the texture on which strokes are rendered

WTBOARDDOCUMENT* WTBLoadDocument (  LPCSTR    lpcsFileName ) 
 

Open a whiteboard document stored on file

Parameters:
lpcsFileName  the name of the stored file
Returns :
a whiteboard document

void WTBMouseMove (  float *    boardpos,
int    texture_size
) 
 

Adds nodes to a stroke as long as the left mouse button is down and the mouse is moved.

Parameters:
boardpos  the texel position on the whiteboard where a stroke starts
texture_size  the size of the texture on which strokes are rendered

WTBOARDDOCUMENT* WTBNewDocument (    ) 
 

Create a new whiteboard document structure

Returns :
a whiteboard document

WTBOARDPAGE* WTBNewPage (  WTBOARDDOCUMENT *    pDoc,
BOOL    bNotify
) 
 

Create a page in a whiteboard document

add a new page after the active page

WTBOARDDATASTROKE* WTBNewStroke (  WTBOARDPAGE *    pPage,
WTBOARDDATANODELIST *    pList,
BOOL    bNotify
) 
 

Adds a stroke to the current page

WTBOARDDATASTROKE* WTBNewStrokeFromArray (  WTBOARDPAGE *    pPage,
UINT    nStrokeID,
COLORREF    StrokeColor,
UINT    nNodeCount,
WTBOARDDATANODE *    pNodeArray,
BOOL    bNotify
) 
 

Creates a WTBOARDDATASTROKE from an array of WTBOARDDATANODE

LRESULT FAR PASCAL WTBoardWndProc (  HWND    hwnd,
UINT    message,
WPARAM    wParam,
LPARAM    lParam
) 
 

------------------------------------------------------------------------- The message loop for the window

Parameters:
hwnd 
message 
wParam 
lParam 

int WTBRemoveEmptyPages (  WTBOARDDOCUMENT *    pDoc ) 
 

Remove empty pages in a document

Parameters:
pDoc  document to have its empty pages removed
Returns :
number of pages removed

BOOL WTBSaveDocument (  WTBOARDDOCUMENT *    pDoc,
LPCSTR    lpcsFileName
) 
 

Save a whiteboard document to file

Parameters:
pDoc  the document to store
lpcsFileName  the name of the file
Returns :
a whiteboard document

void WTBSetCallback (  WTB_HookPtr    hook,
DWORD    dwSrcClass
) 
 

Callback funktion to vpiwhiteboard

Parameters:
hook 
dwSrcClass 

void WTBSetStrokeColor (  WTBOARDDATASTROKE *    pStroke,
COLORREF    clr
) 
 

Set stroke color

void WTBSetTool (  short    tool_id ) 
 

Set pen or eraser as current tool

void WTBShowReceiver (  BOOL    bShow ) 
 

Make the wtboard receiver window visible

BOOL WTBUninitialize (    ) 
 

Close the wtboard window


Variable Documentation

WTB_HookPtr g_wtBoardHookPtr = NULL
 

document

DWORD g_wtBoardHookSrc = 0
 

document

WTBOARDRECEIVER g_wtBoardReceiver
 

document

HINSTANCE ghWintab
 

document

PACKET pkt[PKT_SIZE_BUFFER]
 

the current packet


Generated on Mon Sep 9 21:01:17 2002 for vpiWhiteboard by doxygen1.2.17