initial
This commit is contained in:
439
public/wintab/examples/cadtest/cadtest.c
Normal file
439
public/wintab/examples/cadtest/cadtest.c
Normal file
@@ -0,0 +1,439 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
CadTest - example of how a cad program might use WinTab.
|
||||
RICO 4/1/92
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include "msgpack.h"
|
||||
#include <commdlg.h>
|
||||
#include <wintab.h>
|
||||
#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS)
|
||||
#define PACKETMODE PK_BUTTONS
|
||||
#include <pktdef.h>
|
||||
#include "cadtest.h"
|
||||
#ifdef USE_X_LIB
|
||||
#include <wintabx.h>
|
||||
#endif
|
||||
|
||||
HANDLE hInst;
|
||||
|
||||
#ifdef WIN32
|
||||
#define GetID() GetCurrentProcessId()
|
||||
#else
|
||||
#define GetID() hInst
|
||||
#endif
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
HANDLE hPrevInstance;
|
||||
LPSTR lpCmdLine;
|
||||
int nCmdShow;
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!hPrevInstance)
|
||||
if (!InitApplication(hInstance))
|
||||
return (FALSE);
|
||||
|
||||
/* Perform initializations that apply to a specific instance */
|
||||
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
return (FALSE);
|
||||
|
||||
/* Acquire and dispatch messages until a WM_QUIT message is received. */
|
||||
|
||||
while (GetMessage(&msg,
|
||||
NULL,
|
||||
0,
|
||||
0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
#ifdef USE_X_LIB
|
||||
_UnlinkWintab();
|
||||
#endif
|
||||
return (msg.wParam);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitApplication(hInstance)
|
||||
HANDLE hInstance;
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
/* Fill in window class structure with parameters that describe the */
|
||||
/* main window. */
|
||||
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = MainWndProc;
|
||||
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
|
||||
wc.lpszMenuName = "CadTestMenu";
|
||||
wc.lpszClassName = "CadTestWClass";
|
||||
|
||||
/* Register the window class and return success/failure code. */
|
||||
|
||||
return (RegisterClass(&wc));
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitInstance(hInstance, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
int nCmdShow;
|
||||
{
|
||||
HWND hWnd;
|
||||
char buf[50];
|
||||
|
||||
/* Save the instance handle in static variable, which will be used in */
|
||||
/* many subsequence calls from this application to Windows. */
|
||||
|
||||
hInst = hInstance;
|
||||
|
||||
/* check if WinTab available. */
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
MessageBox(NULL, "WinTab Services Not Available.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a main window for this application instance. */
|
||||
|
||||
wsprintf(buf, "CadTest:%x", GetID());
|
||||
hWnd = CreateWindow(
|
||||
"CadTestWClass",
|
||||
buf,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL
|
||||
);
|
||||
|
||||
/* If window could not be created, return "failure" */
|
||||
|
||||
if (!hWnd)
|
||||
return (FALSE);
|
||||
|
||||
/* Make the window visible; update its client area; and return "success" */
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* open and save file data. */
|
||||
char szFile[256] = "cadtest.ctx";
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* enforces context rules even if we didn't save the context. */
|
||||
void static NEAR TabletSetup(PLOGCONTEXT pLc)
|
||||
{
|
||||
/* modify the digitizing region */
|
||||
wsprintf(pLc->lcName, "CadTest Digitizing %x", GetID());
|
||||
pLc->lcOptions |= CXO_MESSAGES;
|
||||
pLc->lcMsgBase = WT_DEFBASE;
|
||||
pLc->lcPktData = PACKETDATA;
|
||||
pLc->lcPktMode = PACKETMODE;
|
||||
pLc->lcMoveMask = PACKETDATA;
|
||||
pLc->lcBtnUpMask = pLc->lcBtnDnMask;
|
||||
|
||||
/* output in 10000 x 10000 grid */
|
||||
pLc->lcOutOrgX = pLc->lcOutOrgY = 0;
|
||||
pLc->lcOutExtX = 10000;
|
||||
pLc->lcOutExtY = 10000;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX static TabletRestore(HCTX hCtx, HWND hWnd)
|
||||
{
|
||||
void *save_buf;
|
||||
UINT save_size;
|
||||
HFILE hFile;
|
||||
OFSTRUCT ofs;
|
||||
LOGCONTEXT lc;
|
||||
|
||||
/* alloc a save buffer. */
|
||||
WTInfo(WTI_INTERFACE, IFC_CTXSAVESIZE, &save_size);
|
||||
if (save_buf = (void *)LocalAlloc(LPTR, save_size))
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
|
||||
/* do open file box. */
|
||||
memset(&ofn, 0, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = hWnd;
|
||||
ofn.lpstrFilter = "Context Files\0*.ctx\0";
|
||||
ofn.lpstrFile = szFile;
|
||||
ofn.nMaxFile = sizeof(szFile);
|
||||
ofn.Flags = OFN_FILEMUSTEXIST |OFN_PATHMUSTEXIST;
|
||||
ofn.lpstrDefExt = "ctx";
|
||||
|
||||
if (GetOpenFileName(&ofn)) {
|
||||
|
||||
/* open the file. */
|
||||
if ((hFile = OpenFile(szFile, &ofs, OF_READ)) != HFILE_ERROR)
|
||||
{
|
||||
/* read in the data. */
|
||||
_lread(hFile, save_buf, save_size);
|
||||
|
||||
/* close the file. */
|
||||
_lclose(hFile);
|
||||
}
|
||||
|
||||
/* restore the context, disabled. */
|
||||
if (hCtx)
|
||||
WTClose(hCtx);
|
||||
hCtx = WTRestore(hWnd, save_buf, FALSE);
|
||||
/* re-init the context. */
|
||||
if (hCtx) {
|
||||
WTGet(hCtx, &lc);
|
||||
TabletSetup(&lc);
|
||||
WTSet(hCtx, &lc);
|
||||
|
||||
/* open for real. */
|
||||
WTEnable(hCtx, TRUE);
|
||||
}
|
||||
}
|
||||
/* bag the save buffer. */
|
||||
LocalFree((HLOCAL)save_buf);
|
||||
}
|
||||
return hCtx;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void TabletSave(HCTX hCtx, HWND hWnd, BOOL fAs)
|
||||
{
|
||||
|
||||
void *save_buf;
|
||||
UINT save_size;
|
||||
HFILE hFile;
|
||||
OFSTRUCT ofs;
|
||||
|
||||
/* alloc a save buffer. */
|
||||
WTInfo(WTI_INTERFACE, IFC_CTXSAVESIZE, &save_size);
|
||||
if (save_buf = (void *)LocalAlloc(LPTR, save_size))
|
||||
{
|
||||
/* save the data. */
|
||||
if (WTSave(hCtx, save_buf)) {
|
||||
|
||||
/* if setting file name... */
|
||||
if (fAs) {
|
||||
OPENFILENAME ofn;
|
||||
|
||||
/* do save file box. */
|
||||
memset(&ofn, 0, sizeof(ofn));
|
||||
ofn.lStructSize = sizeof(ofn);
|
||||
ofn.hwndOwner = hWnd;
|
||||
ofn.lpstrFilter = "Context Files\0*.ctx\0";
|
||||
ofn.lpstrFile = szFile;
|
||||
ofn.nMaxFile = sizeof(szFile);
|
||||
ofn.Flags = OFN_PATHMUSTEXIST;
|
||||
ofn.lpstrDefExt = "ctx";
|
||||
|
||||
fAs = GetSaveFileName(&ofn);
|
||||
}
|
||||
else
|
||||
/* assume file name good. */
|
||||
fAs = TRUE;
|
||||
|
||||
/* if good file name... */
|
||||
if (fAs) {
|
||||
/* open the file. */
|
||||
if ((hFile = OpenFile(szFile, &ofs, OF_WRITE | OF_CREATE)) !=
|
||||
HFILE_ERROR)
|
||||
{
|
||||
/* read in the data. */
|
||||
_lwrite(hFile, save_buf, save_size);
|
||||
|
||||
/* close the file. */
|
||||
_lclose(hFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* bag the save buffer. */
|
||||
LocalFree((HLOCAL)save_buf);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX static NEAR TabletInit(HWND hWnd)
|
||||
{
|
||||
LOGCONTEXT lcMine;
|
||||
|
||||
/* get default region */
|
||||
WTInfo(WTI_DEFCONTEXT, 0, &lcMine);
|
||||
|
||||
/* init the data structure */
|
||||
TabletSetup(&lcMine);
|
||||
|
||||
/* open the region */
|
||||
return WTOpen(hWnd, &lcMine, TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
LRESULT FAR PASCAL MainWndProc(hWnd, message, wParam, lParam)
|
||||
HWND hWnd;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
FARPROC lpProcAbout;
|
||||
static HCTX hTab = NULL;
|
||||
static POINT ptOld, ptNew;
|
||||
static RECT rcClient;
|
||||
PAINTSTRUCT psPaint;
|
||||
HDC hDC;
|
||||
PACKET pkt;
|
||||
BOOL fHandled = TRUE;
|
||||
LRESULT lResult = 0L;
|
||||
static int count;
|
||||
static BOOL fPersist;
|
||||
|
||||
|
||||
switch (message) {
|
||||
|
||||
case WM_CREATE:
|
||||
hTab = TabletInit(hWnd);
|
||||
if (!hTab) {
|
||||
MessageBox(NULL, " Could Not Open Tablet Context.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
|
||||
SendMessage(hWnd, WM_DESTROY, 0, 0L);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (GET_WM_COMMAND_ID(wParam, lParam)) {
|
||||
case IDM_ABOUT:
|
||||
lpProcAbout = MakeProcInstance(About, hInst);
|
||||
DialogBox(hInst, "AboutBox", hWnd, lpProcAbout);
|
||||
FreeProcInstance(lpProcAbout);
|
||||
break;
|
||||
|
||||
case IDM_OPEN:
|
||||
hTab = TabletRestore(hTab, hWnd);
|
||||
break;
|
||||
|
||||
case IDM_SAVE:
|
||||
TabletSave(hTab, hWnd, FALSE);
|
||||
break;
|
||||
|
||||
case IDM_SAVE_AS:
|
||||
TabletSave(hTab, hWnd, TRUE);
|
||||
break;
|
||||
|
||||
case IDM_CONFIG:
|
||||
WTConfig(hTab, hWnd);
|
||||
break;
|
||||
|
||||
case IDM_PERSIST:
|
||||
fPersist = !fPersist;
|
||||
CheckMenuItem(GetSubMenu(GetMenu(hWnd), IDM_EDIT),
|
||||
IDM_PERSIST, (fPersist ? MF_CHECKED : MF_UNCHECKED));
|
||||
break;
|
||||
|
||||
default:
|
||||
fHandled = FALSE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WT_PACKET:
|
||||
if (WTPacket((HCTX)lParam, wParam, &pkt)) {
|
||||
if (HIWORD(pkt.pkButtons)==TBN_DOWN) {
|
||||
MessageBeep(0);
|
||||
}
|
||||
ptOld = ptNew;
|
||||
ptNew.x = MulDiv((UINT)pkt.pkX, rcClient.right, 10000);
|
||||
ptNew.y = MulDiv((UINT)pkt.pkY, rcClient.bottom, 10000);
|
||||
if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
if (count++ == 4) {
|
||||
count = 0;
|
||||
UpdateWindow(hWnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if (GET_WM_ACTIVATE_STATE(wParam, lParam))
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
|
||||
/* if switching in the middle, disable the region */
|
||||
if (hTab) {
|
||||
if (!fPersist)
|
||||
WTEnable(hTab, GET_WM_ACTIVATE_STATE(wParam, lParam));
|
||||
if (hTab && GET_WM_ACTIVATE_STATE(wParam, lParam))
|
||||
WTOverlap(hTab, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hTab)
|
||||
WTClose(hTab);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
count = 0;
|
||||
hDC = BeginPaint(hWnd, &psPaint);
|
||||
|
||||
/* redo horz */
|
||||
PatBlt(hDC, rcClient.left, rcClient.bottom - ptNew.y,
|
||||
rcClient.right, 1, BLACKNESS);
|
||||
/* redo vert */
|
||||
PatBlt(hDC, ptNew.x, rcClient.top,
|
||||
1, rcClient.bottom, BLACKNESS);
|
||||
|
||||
EndPaint(hWnd, &psPaint);
|
||||
break;
|
||||
|
||||
default:
|
||||
fHandled = FALSE;
|
||||
break;
|
||||
}
|
||||
if (fHandled)
|
||||
return (lResult);
|
||||
else
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FAR PASCAL About(hDlg, message, wParam, lParam)
|
||||
HWND hDlg;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDOK
|
||||
|| GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) {
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
17
public/wintab/examples/cadtest/cadtest.h
Normal file
17
public/wintab/examples/cadtest/cadtest.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#define IDM_FILE 0
|
||||
#define IDM_EDIT 1
|
||||
#define IDM_HELP 2
|
||||
|
||||
#define IDM_ABOUT 100
|
||||
#define IDM_OPEN 101
|
||||
#define IDM_SAVE 102
|
||||
#define IDM_SAVE_AS 103
|
||||
#define IDM_CONFIG 104
|
||||
#define IDM_PERSIST 105
|
||||
|
||||
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
LRESULT FAR PASCAL MainWndProc(HWND, unsigned, WPARAM, LPARAM);
|
||||
BOOL FAR PASCAL About(HWND, unsigned, WPARAM, LPARAM);
|
||||
|
||||
32
public/wintab/examples/cadtest/cadtest.rc
Normal file
32
public/wintab/examples/cadtest/cadtest.rc
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "windows.h"
|
||||
#include "cadtest.h"
|
||||
|
||||
CadtestMenu MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Open...", IDM_OPEN
|
||||
MENUITEM "&Save", IDM_SAVE
|
||||
MENUITEM "Save &As...", IDM_SAVE_AS
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "&Configure Tablet Context...", IDM_CONFIG
|
||||
MENUITEM "&Persistent Context", IDM_PERSIST
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About Cadtest...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
AboutBox DIALOG 22, 17, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Cadtest"
|
||||
BEGIN
|
||||
CTEXT "LCS/Telegraphics" -1, 0, 5, 144, 8
|
||||
CTEXT "Cadtest Application" -1, 0, 14, 144, 8
|
||||
CTEXT "Version 0.0" -1, 0, 34, 144, 8
|
||||
DEFPUSHBUTTON "OK" IDOK, 53, 59, 32, 14, WS_GROUP
|
||||
END
|
||||
|
||||
23
public/wintab/examples/cadtest/msgpack.h
Normal file
23
public/wintab/examples/cadtest/msgpack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ------------------------------- msgpack.h -------------------------------- */
|
||||
/*------------------------------------------------------------------------------
|
||||
Selected message unpacking macros from windowsx.h
|
||||
to circumvent compile-time memory headaches.
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#else
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#endif
|
||||
|
||||
29
public/wintab/examples/cadtest/win16/cadtest.def
Normal file
29
public/wintab/examples/cadtest/win16/cadtest.def
Normal file
@@ -0,0 +1,29 @@
|
||||
; module-definition file for cadtest -- used by LINK.EXE
|
||||
|
||||
NAME CADTEST ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
|
||||
17
public/wintab/examples/cadtest/win16/doswin16.mak
Normal file
17
public/wintab/examples/cadtest/win16/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug)
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
57
public/wintab/examples/cadtest/win16/makefile
Normal file
57
public/wintab/examples/cadtest/win16/makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = CADTEST
|
||||
|
||||
all: $(proj).exe
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\$(proj).h
|
||||
$(rc) $(cinclude) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!IF defined(CPUTYPE)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Update the object file if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
$(proj).exe: $(proj).obj $(proj).res $(proj).def
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(link) $(linkdebug) $(guiflags) $(proj).obj $(WINTAB)\lib\$(CPU)\wintab32.lib $(guilibs) VERSION.LIB -out:$(proj).exe
|
||||
!ELSE
|
||||
# This is for Windows DOS:
|
||||
$(link) $(guiflags) $(proj).obj ,,, $(WINTAB)\lib\wintab.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
!ENDIF
|
||||
414
public/wintab/examples/cadtest/win16/ntwin32.mak
Normal file
414
public/wintab/examples/cadtest/win16/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
29
public/wintab/examples/cadtest/win16x/cadtest.def
Normal file
29
public/wintab/examples/cadtest/win16x/cadtest.def
Normal file
@@ -0,0 +1,29 @@
|
||||
; module-definition file for cadtest -- used by LINK.EXE
|
||||
|
||||
NAME CADTEST ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
|
||||
53
public/wintab/examples/cadtest/win16x/cadtest.map
Normal file
53
public/wintab/examples/cadtest/win16x/cadtest.map
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
CADTEST
|
||||
|
||||
Start Length Name Class
|
||||
0001:0000 01320H _TEXT CODE
|
||||
0002:0000 00010H NULL BEGDATA
|
||||
0002:0010 002A2H _DATA DATA
|
||||
0002:02B2 0000EH CDATA DATA
|
||||
0002:02C0 00000H XIFB DATA
|
||||
0002:02C0 00000H XIF DATA
|
||||
0002:02C0 00000H XIFE DATA
|
||||
0002:02C0 00000H XIB DATA
|
||||
0002:02C0 00000H XI DATA
|
||||
0002:02C0 00000H XIE DATA
|
||||
0002:02C0 00000H XPB DATA
|
||||
0002:02C0 00000H XP DATA
|
||||
0002:02C0 00000H XPE DATA
|
||||
0002:02C0 00000H XCB DATA
|
||||
0002:02C0 00000H XC DATA
|
||||
0002:02C0 00000H XCE DATA
|
||||
0002:02C0 00000H XCFB DATA
|
||||
0002:02C0 00000H XCFCRT DATA
|
||||
0002:02C0 00000H XCF DATA
|
||||
0002:02C0 00000H XCFE DATA
|
||||
0002:02C0 00000H XIFCB DATA
|
||||
0002:02C0 00000H XIFU DATA
|
||||
0002:02C0 00000H XIFL DATA
|
||||
0002:02C0 00000H XIFM DATA
|
||||
0002:02C0 00000H XIFCE DATA
|
||||
0002:02C0 00000H DBDATA DATA
|
||||
0002:02C0 00000H CONST CONST
|
||||
0002:02C0 00008H HDR MSG
|
||||
0002:02C8 00146H MSG MSG
|
||||
0002:040E 00002H PAD MSG
|
||||
0002:0410 00001H EPAD MSG
|
||||
0002:0412 00014H _BSS BSS
|
||||
0002:0426 00000H XOB BSS
|
||||
0002:0426 00000H XO BSS
|
||||
0002:0426 00000H XOE BSS
|
||||
0002:0426 00000H XOFB BSS
|
||||
0002:0426 00000H XOF BSS
|
||||
0002:0426 00000H XOFE BSS
|
||||
0002:0430 00002H c_common BSS
|
||||
|
||||
Origin Group
|
||||
0002:0 DGROUP
|
||||
|
||||
Address Export Alias
|
||||
|
||||
0001:095A About About
|
||||
0001:0588 MainWndProc MainWndProc
|
||||
|
||||
Program entry point at 0001:0baa
|
||||
17
public/wintab/examples/cadtest/win16x/doswin16.mak
Normal file
17
public/wintab/examples/cadtest/win16x/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug) -DUSE_X_LIB
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
58
public/wintab/examples/cadtest/win16x/makefile
Normal file
58
public/wintab/examples/cadtest/win16x/makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = CADTEST
|
||||
|
||||
all: $(proj).exe
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\$(proj).h
|
||||
$(rc) $(cinclude) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!IF defined(CPU)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Update the object file if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
$(proj).exe: $(proj).obj $(proj).res $(proj).def
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(link) $(linkdebug) $(guiflags) $(proj).obj $(WINTAB)\lib\$(CPU)\wntab32x.lib $(guilibs) VERSION.LIB $(proj).rbj -out:$(proj).exe
|
||||
!ENDIF
|
||||
!if !defined(CPU)
|
||||
# This is for Windows DOS:
|
||||
$(link) $(guiflags) $(proj).obj ,,, $(WINTAB)\lib\wintabx.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
!ENDIF
|
||||
414
public/wintab/examples/cadtest/win16x/ntwin32.mak
Normal file
414
public/wintab/examples/cadtest/win16x/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
106
public/wintab/examples/cadtest/win32/cadtest.dsp
Normal file
106
public/wintab/examples/cadtest/win32/cadtest.dsp
Normal file
@@ -0,0 +1,106 @@
|
||||
# Microsoft Developer Studio Project File - Name="cadtest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=cadtest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "cadtest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "cadtest.mak" CFG="cadtest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "cadtest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "cadtest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "cadtest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "cadtest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\..\lib\I386\wintab32.lib ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "cadtest - Win32 Release"
|
||||
# Name "cadtest - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Cadtest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Cadtest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Cadtest.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Msgpack.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/cadtest/win32/cadtest.dsw
Normal file
29
public/wintab/examples/cadtest/win32/cadtest.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "cadtest"=.\cadtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
239
public/wintab/examples/cadtest/win32/cadtest.mak
Normal file
239
public/wintab/examples/cadtest/win32/cadtest.mak
Normal file
@@ -0,0 +1,239 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=cadtest - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to cadtest - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "cadtest - Win32 Release" && "$(CFG)" !=\
|
||||
"cadtest - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "cadtest.mak" CFG="cadtest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "cadtest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "cadtest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "cadtest - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "cadtest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\cadtest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Cadtest.obj"
|
||||
-@erase "$(INTDIR)\Cadtest.res"
|
||||
-@erase "$(OUTDIR)\cadtest.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG"\
|
||||
/D "_WINDOWS" /Fp"$(INTDIR)/cadtest.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Cadtest.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/cadtest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:no /pdb:"$(OUTDIR)/cadtest.pdb" /machine:I386\
|
||||
/out:"$(OUTDIR)/cadtest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Cadtest.obj" \
|
||||
"$(INTDIR)\Cadtest.res"
|
||||
|
||||
"$(OUTDIR)\cadtest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "cadtest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "cadtest_"
|
||||
# PROP BASE Intermediate_Dir "cadtest_"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "cadtest_"
|
||||
# PROP Intermediate_Dir "cadtest_"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\cadtest_
|
||||
INTDIR=.\cadtest_
|
||||
|
||||
ALL : "$(OUTDIR)\cadtest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Cadtest.obj"
|
||||
-@erase "$(INTDIR)\Cadtest.res"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\cadtest.exe"
|
||||
-@erase "$(OUTDIR)\cadtest.ilk"
|
||||
-@erase "$(OUTDIR)\cadtest.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/cadtest.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\cadtest_/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Cadtest.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/cadtest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/cadtest.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/cadtest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Cadtest.obj" \
|
||||
"$(INTDIR)\Cadtest.res"
|
||||
|
||||
"$(OUTDIR)\cadtest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "cadtest - Win32 Release"
|
||||
# Name "cadtest - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "cadtest - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "cadtest - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Cadtest\Cadtest.c
|
||||
DEP_CPP_CADTE=\
|
||||
"..\Cadtest.h"\
|
||||
"..\Msgpack.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Cadtest.obj" : $(SOURCE) $(DEP_CPP_CADTE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Cadtest\Cadtest.rc
|
||||
DEP_RSC_CADTES=\
|
||||
"..\Cadtest.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "cadtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Cadtest.res" : $(SOURCE) $(DEP_RSC_CADTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Cadtest.res" /i "\wtkit125\Examples\Cadtest"\
|
||||
/d "NDEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "cadtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Cadtest.res" : $(SOURCE) $(DEP_RSC_CADTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Cadtest.res" /i "\wtkit125\Examples\Cadtest"\
|
||||
/d "_DEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
public/wintab/examples/cadtest/win32/cadtest.mdp
Normal file
BIN
public/wintab/examples/cadtest/win32/cadtest.mdp
Normal file
Binary file not shown.
279
public/wintab/examples/fkeys/fkeys.c
Normal file
279
public/wintab/examples/fkeys/fkeys.c
Normal file
@@ -0,0 +1,279 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
FKeys - using fkey input.
|
||||
RICO 4/29/93
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "msgpack.h"
|
||||
#include <wintab.h>
|
||||
#define PACKETDATA 0
|
||||
#define PACKETMODE 0
|
||||
#define PACKETFKEYS PKEXT_ABSOLUTE
|
||||
#include <pktdef.h>
|
||||
#include "fkeys.h"
|
||||
|
||||
HANDLE hInst;
|
||||
WTPKT FKeysMask;
|
||||
UINT FKeysCat;
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
HANDLE hPrevInstance;
|
||||
LPSTR lpCmdLine;
|
||||
int nCmdShow;
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!hPrevInstance)
|
||||
if (!InitApplication(hInstance))
|
||||
return (FALSE);
|
||||
|
||||
/* Perform initializations that apply to a specific instance */
|
||||
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
return (FALSE);
|
||||
|
||||
/* Acquire and dispatch messages until a WM_QUIT message is received. */
|
||||
|
||||
while (GetMessage(&msg,
|
||||
NULL,
|
||||
0,
|
||||
0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
return (msg.wParam);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitApplication(hInstance)
|
||||
HANDLE hInstance;
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
/* Fill in window class structure with parameters that describe the */
|
||||
/* main window. */
|
||||
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = MainWndProc;
|
||||
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
|
||||
wc.lpszMenuName = "FKeysMenu";
|
||||
wc.lpszClassName = "FKeysWClass";
|
||||
|
||||
/* Register the window class and return success/failure code. */
|
||||
|
||||
return (RegisterClass(&wc));
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
UINT ScanExts(UINT wTag)
|
||||
{
|
||||
UINT i;
|
||||
UINT wScanTag;
|
||||
|
||||
/* scan for wTag's info category. */
|
||||
for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) {
|
||||
if (wTag == wScanTag) {
|
||||
/* return category offset from WTI_EXTENSIONS. */
|
||||
return i;
|
||||
}
|
||||
}
|
||||
/* return error code. */
|
||||
return 0xFFFF;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FKeysInit(void)
|
||||
{
|
||||
FKeysCat = ScanExts(WTX_FKEYS);
|
||||
if (FKeysCat != 0xFFFF) {
|
||||
WTInfo(WTI_EXTENSIONS + FKeysCat, EXT_MASK, &FKeysMask);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitInstance(hInstance, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
int nCmdShow;
|
||||
{
|
||||
HWND hWnd;
|
||||
char buf[50];
|
||||
|
||||
/* Save the instance handle in static variable, which will be used in */
|
||||
/* many subsequence calls from this application to Windows. */
|
||||
|
||||
hInst = hInstance;
|
||||
|
||||
/* check if WinTab available. */
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
MessageBox(NULL, "WinTab Services Not Available.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* check if WinTab FKeys Extension available. */
|
||||
if (!FKeysInit()) {
|
||||
MessageBox(NULL, "WinTab Function Keys Extension Not Available.",
|
||||
"WinTab", MB_OK | MB_ICONHAND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a main window for this application instance. */
|
||||
|
||||
wsprintf(buf, "FKeys:%x", hInst);
|
||||
hWnd = CreateWindow(
|
||||
"FKeysWClass",
|
||||
"FKeys Sample Application",
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL
|
||||
);
|
||||
|
||||
/* If window could not be created, return "failure" */
|
||||
|
||||
if (!hWnd)
|
||||
return (FALSE);
|
||||
|
||||
/* Make the window visible; update its client area; and return "success" */
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX static NEAR TabletInit(HWND hWnd)
|
||||
{
|
||||
LOGCONTEXT lcMine;
|
||||
AXIS a;
|
||||
|
||||
/* get default region */
|
||||
WTInfo(WTI_DEFCONTEXT, 0, &lcMine);
|
||||
|
||||
/* modify the digitizing region */
|
||||
wsprintf(lcMine.lcName, "FKeys %x", hInst);
|
||||
lcMine.lcOptions |= CXO_MESSAGES;
|
||||
lcMine.lcPktData = PACKETDATA | FKeysMask;
|
||||
lcMine.lcPktMode = PACKETMODE;
|
||||
lcMine.lcMoveMask = PACKETDATA | FKeysMask;
|
||||
lcMine.lcBtnUpMask = lcMine.lcBtnDnMask = 0;
|
||||
|
||||
lcMine.lcInOrgX = lcMine.lcInOrgY = lcMine.lcInOrgZ = 0;
|
||||
WTInfo(WTI_DEVICES + lcMine.lcDevice, DVC_X, &a);
|
||||
lcMine.lcInExtX = a.axMax;
|
||||
WTInfo(WTI_DEVICES + lcMine.lcDevice, DVC_Y, &a);
|
||||
lcMine.lcInExtY = a.axMax;
|
||||
if (WTInfo(WTI_DEVICES + lcMine.lcDevice, DVC_Z, &a))
|
||||
lcMine.lcInExtZ = a.axMax;
|
||||
|
||||
/* open the region */
|
||||
return WTOpen(hWnd, &lcMine, TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
LRESULT FAR PASCAL MainWndProc(hWnd, message, wParam, lParam)
|
||||
HWND hWnd;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
FARPROC lpProcAbout;
|
||||
static HCTX hTab = NULL;
|
||||
static inOverlap;
|
||||
PACKET pkt;
|
||||
|
||||
switch (message) {
|
||||
case WM_CREATE:
|
||||
hTab = TabletInit(hWnd);
|
||||
if (!hTab) {
|
||||
MessageBox(NULL, " Could Not Open Tablet Context.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
|
||||
SendMessage(hWnd, WM_DESTROY, 0, 0L);
|
||||
}
|
||||
break;
|
||||
|
||||
case WT_PACKET:
|
||||
if (WTPacket((HCTX)lParam, wParam, &pkt)) {
|
||||
static char buf[100];
|
||||
|
||||
if (pkt.pkFKeys) {
|
||||
MessageBeep(0);
|
||||
}
|
||||
wsprintf(buf, "FKeys:%x %d", hInst, pkt.pkFKeys);
|
||||
SetWindowText(hWnd, buf);
|
||||
}
|
||||
break;
|
||||
|
||||
case WT_CTXOVERLAP:
|
||||
if (!inOverlap && !(lParam & CXS_ONTOP)) {
|
||||
inOverlap = TRUE;
|
||||
WTOverlap(hTab, TRUE);
|
||||
inOverlap = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDM_ABOUT) {
|
||||
lpProcAbout = MakeProcInstance(About, hInst);
|
||||
|
||||
DialogBox(hInst,
|
||||
"AboutBox",
|
||||
hWnd,
|
||||
lpProcAbout);
|
||||
|
||||
FreeProcInstance(lpProcAbout);
|
||||
break;
|
||||
}
|
||||
else
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hTab)
|
||||
WTClose(hTab);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FAR PASCAL About(hDlg, message, wParam, lParam)
|
||||
HWND hDlg;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDOK
|
||||
|| GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) {
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
8
public/wintab/examples/fkeys/fkeys.h
Normal file
8
public/wintab/examples/fkeys/fkeys.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#define IDM_ABOUT 100
|
||||
|
||||
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
LRESULT FAR PASCAL MainWndProc(HWND, unsigned, WPARAM, LPARAM);
|
||||
BOOL FAR PASCAL About(HWND, unsigned, WPARAM, LPARAM);
|
||||
|
||||
21
public/wintab/examples/fkeys/fkeys.rc
Normal file
21
public/wintab/examples/fkeys/fkeys.rc
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "windows.h"
|
||||
#include "fkeys.h"
|
||||
|
||||
FKeysMenu MENU
|
||||
BEGIN
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About FKeys...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
AboutBox DIALOG 22, 17, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About FKeys"
|
||||
BEGIN
|
||||
CTEXT "Microsoft Windows" -1, 0, 5, 144, 8
|
||||
CTEXT "FKeys Application" -1, 0, 14, 144, 8
|
||||
CTEXT "Version 3.0" -1, 0, 34, 144, 8
|
||||
DEFPUSHBUTTON "OK" IDOK, 53, 59, 32, 14, WS_GROUP
|
||||
END
|
||||
|
||||
23
public/wintab/examples/fkeys/msgpack.h
Normal file
23
public/wintab/examples/fkeys/msgpack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ------------------------------- msgpack.h -------------------------------- */
|
||||
/*------------------------------------------------------------------------------
|
||||
Selected message unpacking macros from windowsx.h
|
||||
to circumvent compile-time memory headaches.
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#else
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#endif
|
||||
|
||||
17
public/wintab/examples/fkeys/win16/doswin16.mak
Normal file
17
public/wintab/examples/fkeys/win16/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug)
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
29
public/wintab/examples/fkeys/win16/fkeys.def
Normal file
29
public/wintab/examples/fkeys/win16/fkeys.def
Normal file
@@ -0,0 +1,29 @@
|
||||
; module-definition file for fkeys -- used by LINK.EXE
|
||||
|
||||
NAME FKeys ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
|
||||
58
public/wintab/examples/fkeys/win16/makefile
Normal file
58
public/wintab/examples/fkeys/win16/makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = FKEYS
|
||||
|
||||
all: $(proj).exe
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\$(proj).h
|
||||
$(rc) $(cinclude) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!IF defined(CPU)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Update the object file if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
$(proj).exe: $(proj).obj $(proj).res $(proj).def
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(link) $(linkdebug) $(guiflags) $(proj).obj $(WINTAB)\lib\$(CPU)\wintab32.lib $(guilibs) VERSION.LIB $(proj).rbj -out:$(proj).exe
|
||||
!ENDIF
|
||||
!if !defined(CPU)
|
||||
# This is for Windows DOS:
|
||||
$(link) $(guiflags) $(proj).obj ,,, $(WINTAB)\lib\wintab.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
!ENDIF
|
||||
414
public/wintab/examples/fkeys/win16/ntwin32.mak
Normal file
414
public/wintab/examples/fkeys/win16/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
106
public/wintab/examples/fkeys/win32/fkeys.dsp
Normal file
106
public/wintab/examples/fkeys/win32/fkeys.dsp
Normal file
@@ -0,0 +1,106 @@
|
||||
# Microsoft Developer Studio Project File - Name="fkeys" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=fkeys - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "fkeys.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "fkeys.mak" CFG="fkeys - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "fkeys - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "fkeys - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "fkeys - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "fkeys - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ../../../lib/I386/wintab32.lib ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "fkeys - Win32 Release"
|
||||
# Name "fkeys - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Fkeys.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Fkeys.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Fkeys.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Msgpack.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/fkeys/win32/fkeys.dsw
Normal file
29
public/wintab/examples/fkeys/win32/fkeys.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "fkeys"=.\fkeys.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
238
public/wintab/examples/fkeys/win32/fkeys.mak
Normal file
238
public/wintab/examples/fkeys/win32/fkeys.mak
Normal file
@@ -0,0 +1,238 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=fkeys - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to fkeys - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "fkeys - Win32 Release" && "$(CFG)" != "fkeys - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "fkeys.mak" CFG="fkeys - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "fkeys - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "fkeys - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "fkeys - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "fkeys - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\fkeys.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Fkeys.obj"
|
||||
-@erase "$(INTDIR)\Fkeys.res"
|
||||
-@erase "$(OUTDIR)\fkeys.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG"\
|
||||
/D "_WINDOWS" /Fp"$(INTDIR)/fkeys.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Fkeys.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/fkeys.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:no /pdb:"$(OUTDIR)/fkeys.pdb" /machine:I386\
|
||||
/out:"$(OUTDIR)/fkeys.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Fkeys.obj" \
|
||||
"$(INTDIR)\Fkeys.res"
|
||||
|
||||
"$(OUTDIR)\fkeys.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "fkeys - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "fkeys___"
|
||||
# PROP BASE Intermediate_Dir "fkeys___"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "fkeys___"
|
||||
# PROP Intermediate_Dir "fkeys___"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\fkeys___
|
||||
INTDIR=.\fkeys___
|
||||
|
||||
ALL : "$(OUTDIR)\fkeys.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Fkeys.obj"
|
||||
-@erase "$(INTDIR)\Fkeys.res"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\fkeys.exe"
|
||||
-@erase "$(OUTDIR)\fkeys.ilk"
|
||||
-@erase "$(OUTDIR)\fkeys.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/fkeys.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\fkeys___/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Fkeys.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/fkeys.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/fkeys.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/fkeys.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Fkeys.obj" \
|
||||
"$(INTDIR)\Fkeys.res"
|
||||
|
||||
"$(OUTDIR)\fkeys.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "fkeys - Win32 Release"
|
||||
# Name "fkeys - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "fkeys - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "fkeys - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Fkeys\Fkeys.c
|
||||
DEP_CPP_FKEYS=\
|
||||
"..\Fkeys.h"\
|
||||
"..\Msgpack.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Fkeys.obj" : $(SOURCE) $(DEP_CPP_FKEYS) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Fkeys\Fkeys.rc
|
||||
DEP_RSC_FKEYS_=\
|
||||
"..\Fkeys.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "fkeys - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Fkeys.res" : $(SOURCE) $(DEP_RSC_FKEYS_) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Fkeys.res" /i "\wtkit125\Examples\Fkeys" /d\
|
||||
"NDEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "fkeys - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Fkeys.res" : $(SOURCE) $(DEP_RSC_FKEYS_) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Fkeys.res" /i "\wtkit125\Examples\Fkeys" /d\
|
||||
"_DEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
public/wintab/examples/fkeys/win32/fkeys.mdp
Normal file
BIN
public/wintab/examples/fkeys/win32/fkeys.mdp
Normal file
Binary file not shown.
85
public/wintab/examples/mfc_demo/demodoc.cpp
Normal file
85
public/wintab/examples/mfc_demo/demodoc.cpp
Normal file
@@ -0,0 +1,85 @@
|
||||
// MFC_DEMODoc.cpp : implementation of the CMFC_DEMODoc class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
#include "point.h"
|
||||
|
||||
#include "DEMODoc.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMFC_DEMODoc, CDocument)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMODoc, CDocument)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMODoc)
|
||||
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc construction/destruction
|
||||
|
||||
CMFC_DEMODoc::CMFC_DEMODoc()
|
||||
{
|
||||
pt_lst = new list<point>;
|
||||
}
|
||||
|
||||
CMFC_DEMODoc::~CMFC_DEMODoc()
|
||||
{
|
||||
delete pt_lst;
|
||||
}
|
||||
|
||||
BOOL CMFC_DEMODoc::OnNewDocument()
|
||||
{
|
||||
if (!CDocument::OnNewDocument())
|
||||
return FALSE;
|
||||
|
||||
// Clear the point list
|
||||
delete pt_lst;
|
||||
pt_lst = new list<point>;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc serialization
|
||||
|
||||
void CMFC_DEMODoc::Serialize(CArchive& ar)
|
||||
{
|
||||
if (ar.IsStoring())
|
||||
{
|
||||
// TODO: add storing code here
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: add loading code here
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMFC_DEMODoc::AssertValid() const
|
||||
{
|
||||
CDocument::AssertValid();
|
||||
}
|
||||
|
||||
void CMFC_DEMODoc::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CDocument::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMODoc commands
|
||||
66
public/wintab/examples/mfc_demo/demodoc.h
Normal file
66
public/wintab/examples/mfc_demo/demodoc.h
Normal file
@@ -0,0 +1,66 @@
|
||||
// MFC_DEMODoc.h : interface of the CMFC_DEMODoc class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "point.H"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CMFC_DEMODoc : public CDocument
|
||||
{
|
||||
list<point> * pt_lst;
|
||||
|
||||
protected: // create from serialization only
|
||||
CMFC_DEMODoc();
|
||||
DECLARE_DYNCREATE(CMFC_DEMODoc)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
list<point> * GetLst( void ) { return pt_lst; };
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMODoc)
|
||||
public:
|
||||
virtual BOOL OnNewDocument();
|
||||
virtual void Serialize(CArchive& ar);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMFC_DEMODoc();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMFC_DEMODoc)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMODOC_H__B7D0AFEC_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
179
public/wintab/examples/mfc_demo/demoview.cpp
Normal file
179
public/wintab/examples/mfc_demo/demoview.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
// MFC_DEMOView.cpp : implementation of the CMFC_DEMOView class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "DEMODoc.h"
|
||||
#include "DEMOView.h"
|
||||
|
||||
#include <wintab.h>
|
||||
|
||||
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS
|
||||
#define PACKETMODE 0
|
||||
#include <pktdef.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMFC_DEMOView, CView)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMOView, CView)
|
||||
ON_MESSAGE(WT_PACKET, OnWTPacket)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMOView)
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView construction/destruction
|
||||
|
||||
CMFC_DEMOView::CMFC_DEMOView()
|
||||
{
|
||||
csr.x = -1;
|
||||
prev_pkButtons = 0;
|
||||
pWTMutex = new CMutex( TRUE, NULL, NULL );
|
||||
hCtx = 0;
|
||||
}
|
||||
|
||||
CMFC_DEMOView::~CMFC_DEMOView()
|
||||
{
|
||||
delete pWTMutex;
|
||||
if( hCtx )
|
||||
WTClose( hCtx );
|
||||
}
|
||||
|
||||
BOOL CMFC_DEMOView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
return CView::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView drawing
|
||||
|
||||
void CMFC_DEMOView::OnDraw(CDC* pDC)
|
||||
{
|
||||
CMFC_DEMODoc* pDoc = GetDocument();
|
||||
ASSERT_VALID(pDoc);
|
||||
|
||||
csr.x = -1;
|
||||
|
||||
list<point> * lst = pDoc->GetLst();
|
||||
list<point>::iterator i = lst->begin();
|
||||
while( i != lst->end() ) {
|
||||
if( i->x >= 0 )
|
||||
pDC->LineTo(i->x,i->y);
|
||||
else
|
||||
pDC->MoveTo(abs(i->x),abs(i->y));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMFC_DEMOView::AssertValid() const
|
||||
{
|
||||
CView::AssertValid();
|
||||
}
|
||||
|
||||
void CMFC_DEMOView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CView::Dump(dc);
|
||||
}
|
||||
|
||||
CMFC_DEMODoc* CMFC_DEMOView::GetDocument() // non-debug version is inline
|
||||
{
|
||||
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFC_DEMODoc)));
|
||||
return (CMFC_DEMODoc*)m_pDocument;
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOView message handlers
|
||||
|
||||
LRESULT CMFC_DEMOView::OnWTPacket(WPARAM wSerial, LPARAM hCtx)
|
||||
{
|
||||
// Read the packet
|
||||
PACKET pkt;
|
||||
WTPacket( (HCTX)hCtx, wSerial, &pkt );
|
||||
|
||||
// Process packets in order, one at a time
|
||||
CSingleLock lock( pWTMutex, TRUE );
|
||||
|
||||
CDC *pDC = GetDC();
|
||||
|
||||
// Get window size
|
||||
RECT window_rect;
|
||||
GetWindowRect( &window_rect );
|
||||
POINT size;
|
||||
size.x = window_rect.right - window_rect.left;
|
||||
size.y = window_rect.bottom - window_rect.top;
|
||||
|
||||
// Erase the old cursor
|
||||
if( csr.x >= 0 ) {
|
||||
CRgn r;
|
||||
r.CreateRectRgn( csr.x - 2, csr.y - 2, csr.x + 2, csr.y + 2 );
|
||||
pDC->InvertRgn( &r );
|
||||
}
|
||||
|
||||
csr.x = (size.x * pkt.pkX) / lc.lcInExtX;
|
||||
csr.y = size.y - (size.y * pkt.pkY) / lc.lcInExtY;
|
||||
|
||||
if( pkt.pkButtons ) {
|
||||
CMFC_DEMODoc *pDoc = GetDocument();
|
||||
list<point> * lst = pDoc->GetLst();
|
||||
|
||||
if( prev_pkButtons ) {
|
||||
|
||||
list<point>::iterator i = lst->end();
|
||||
i--;
|
||||
pDC->MoveTo(abs(i->x),abs(i->y));
|
||||
|
||||
lst->push_back(csr);
|
||||
pDC->LineTo(csr);
|
||||
} else {
|
||||
POINT pt;
|
||||
pt.x = -csr.x;
|
||||
pt.y = -csr.y;
|
||||
lst->push_back(pt);
|
||||
}
|
||||
}
|
||||
|
||||
prev_pkButtons = pkt.pkButtons;
|
||||
|
||||
// Draw a new cursor
|
||||
CRgn r;
|
||||
r.CreateRectRgn( csr.x - 2, csr.y - 2, csr.x + 2, csr.y + 2 );
|
||||
pDC->InvertRgn( &r );
|
||||
|
||||
ReleaseDC( pDC );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CMFC_DEMOView::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CView::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
// Open a Wintab context
|
||||
|
||||
// Get default context information
|
||||
WTInfo( WTI_DEFCONTEXT, 0, &lc );
|
||||
|
||||
// Open the context
|
||||
lc.lcPktData = PACKETDATA;
|
||||
lc.lcPktMode = PACKETMODE;
|
||||
lc.lcOptions = CXO_MESSAGES;
|
||||
//hCtx = WTOpen( m_hWnd, &lc, TRUE );
|
||||
hCtx = WTOpen( m_hWnd, &lc, TRUE );
|
||||
return 0;
|
||||
}
|
||||
80
public/wintab/examples/mfc_demo/demoview.h
Normal file
80
public/wintab/examples/mfc_demo/demoview.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// MFC_DEMOView.h : interface of the CMFC_DEMOView class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#if !defined(AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#include <afxmt.h>
|
||||
#include <windows.h>
|
||||
#include <wintab.h>
|
||||
|
||||
#include "point.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CMFC_DEMOView : public CView
|
||||
{
|
||||
CMutex *pWTMutex;
|
||||
POINT csr;
|
||||
HCTX hCtx;
|
||||
unsigned prev_pkButtons;
|
||||
LOGCONTEXT lc;
|
||||
|
||||
protected: // create from serialization only
|
||||
CMFC_DEMOView();
|
||||
DECLARE_DYNCREATE(CMFC_DEMOView)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
CMFC_DEMODoc* GetDocument();
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMOView)
|
||||
public:
|
||||
virtual void OnDraw(CDC* pDC); // overridden to draw this view
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
protected:
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMFC_DEMOView();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
afx_msg LRESULT OnWTPacket(WPARAM, LPARAM);
|
||||
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMFC_DEMOView)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnCancelMode();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#ifndef _DEBUG // debug version in MFC_DEMOView.cpp
|
||||
inline CMFC_DEMODoc* CMFC_DEMOView::GetDocument()
|
||||
{ return (CMFC_DEMODoc*)m_pDocument; }
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMOVIEW_H__B7D0AFEE_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
70
public/wintab/examples/mfc_demo/mainfrm.cpp
Normal file
70
public/wintab/examples/mfc_demo/mainfrm.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
// MainFrm.cpp : implementation of the CMainFrame class
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame
|
||||
|
||||
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
|
||||
//{{AFX_MSG_MAP(CMainFrame)
|
||||
ON_WM_PAINT()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame construction/destruction
|
||||
|
||||
CMainFrame::CMainFrame()
|
||||
{
|
||||
// TODO: add member initialization code here
|
||||
|
||||
}
|
||||
|
||||
CMainFrame::~CMainFrame()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Modify the Window class or styles here by modifying
|
||||
// the CREATESTRUCT cs
|
||||
|
||||
return CFrameWnd::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMainFrame::AssertValid() const
|
||||
{
|
||||
CFrameWnd::AssertValid();
|
||||
}
|
||||
|
||||
void CMainFrame::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CFrameWnd::Dump(dc);
|
||||
}
|
||||
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMainFrame message handlers
|
||||
|
||||
void CMainFrame::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
}
|
||||
51
public/wintab/examples/mfc_demo/mainfrm.h
Normal file
51
public/wintab/examples/mfc_demo/mainfrm.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// MainFrm.h : interface of the CMainFrame class
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
class CMainFrame : public CFrameWnd
|
||||
{
|
||||
protected: // create from serialization only
|
||||
CMainFrame();
|
||||
DECLARE_DYNCREATE(CMainFrame)
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMainFrame)
|
||||
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CMainFrame();
|
||||
#ifdef _DEBUG
|
||||
virtual void AssertValid() const;
|
||||
virtual void Dump(CDumpContext& dc) const;
|
||||
#endif
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CMainFrame)
|
||||
afx_msg void OnPaint();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAINFRM_H__B7D0AFEA_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
92
public/wintab/examples/mfc_demo/mfc_demo.clw
Normal file
92
public/wintab/examples/mfc_demo/mfc_demo.clw
Normal file
@@ -0,0 +1,92 @@
|
||||
; CLW file contains information for the MFC ClassWizard
|
||||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=CMFC_DEMOView
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "MFC_DEMO.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=8
|
||||
Class1=CMFC_DEMOApp
|
||||
Class2=CMFC_DEMODoc
|
||||
Class3=CMFC_DEMOView
|
||||
Class4=CMainFrame
|
||||
Class7=CAboutDlg
|
||||
|
||||
ResourceCount=5
|
||||
Resource1=IDD_ABOUTBOX
|
||||
Resource2=IDR_MAINFRAME
|
||||
|
||||
[CLS:CMFC_DEMOApp]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMO.h
|
||||
ImplementationFile=MFC_DEMO.cpp
|
||||
Filter=N
|
||||
|
||||
[CLS:CMFC_DEMODoc]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMODoc.h
|
||||
ImplementationFile=MFC_DEMODoc.cpp
|
||||
Filter=N
|
||||
|
||||
[CLS:CMFC_DEMOView]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMOView.h
|
||||
ImplementationFile=MFC_DEMOView.cpp
|
||||
Filter=C
|
||||
BaseClass=CView
|
||||
VirtualFilter=VWC
|
||||
|
||||
[CLS:CMainFrame]
|
||||
Type=0
|
||||
HeaderFile=MainFrm.h
|
||||
ImplementationFile=MainFrm.cpp
|
||||
Filter=T
|
||||
BaseClass=CFrameWnd
|
||||
VirtualFilter=fWC
|
||||
|
||||
|
||||
|
||||
[CLS:CAboutDlg]
|
||||
Type=0
|
||||
HeaderFile=MFC_DEMO.cpp
|
||||
ImplementationFile=MFC_DEMO.cpp
|
||||
Filter=D
|
||||
|
||||
[DLG:IDD_ABOUTBOX]
|
||||
Type=1
|
||||
Class=CAboutDlg
|
||||
ControlCount=4
|
||||
Control1=IDC_STATIC,static,1342177283
|
||||
Control2=IDC_STATIC,static,1342308480
|
||||
Control3=IDC_STATIC,static,1342308352
|
||||
Control4=IDOK,button,1342373889
|
||||
|
||||
[MNU:IDR_MAINFRAME]
|
||||
Type=1
|
||||
Class=CMainFrame
|
||||
Command1=ID_FILE_NEW
|
||||
Command2=ID_APP_EXIT
|
||||
Command3=ID_APP_ABOUT
|
||||
CommandCount=3
|
||||
|
||||
[ACL:IDR_MAINFRAME]
|
||||
Type=1
|
||||
Class=CMainFrame
|
||||
Command1=ID_FILE_NEW
|
||||
Command2=ID_FILE_OPEN
|
||||
Command3=ID_FILE_SAVE
|
||||
Command4=ID_EDIT_UNDO
|
||||
Command5=ID_EDIT_CUT
|
||||
Command6=ID_EDIT_COPY
|
||||
Command7=ID_EDIT_PASTE
|
||||
Command8=ID_EDIT_UNDO
|
||||
Command9=ID_EDIT_CUT
|
||||
Command10=ID_EDIT_COPY
|
||||
Command11=ID_EDIT_PASTE
|
||||
Command12=ID_NEXT_PANE
|
||||
Command13=ID_PREV_PANE
|
||||
CommandCount=13
|
||||
|
||||
151
public/wintab/examples/mfc_demo/mfc_demo.cpp
Normal file
151
public/wintab/examples/mfc_demo/mfc_demo.cpp
Normal file
@@ -0,0 +1,151 @@
|
||||
// MFC_DEMO.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MFC_DEMO.h"
|
||||
|
||||
#include "MainFrm.h"
|
||||
#include "DEMODoc.h"
|
||||
#include "DEMOView.h"
|
||||
|
||||
#include <wintab.h>
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMFC_DEMOApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CMFC_DEMOApp)
|
||||
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG_MAP
|
||||
// Standard file based document commands
|
||||
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
|
||||
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp construction
|
||||
|
||||
CMFC_DEMOApp::CMFC_DEMOApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CMFC_DEMOApp object
|
||||
|
||||
CMFC_DEMOApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp initialization
|
||||
|
||||
BOOL CMFC_DEMOApp::InitInstance()
|
||||
{
|
||||
// Check if Wintab is available
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef _AFXDLL
|
||||
Enable3dControls(); // Call this when using MFC in a shared DLL
|
||||
#else
|
||||
Enable3dControlsStatic(); // Call this when linking to MFC statically
|
||||
#endif
|
||||
|
||||
// Change the registry key under which our settings are stored.
|
||||
// You should modify this string to be something appropriate
|
||||
// such as the name of your company or organization.
|
||||
SetRegistryKey(_T("LCS/Telegraphics"));
|
||||
|
||||
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
|
||||
|
||||
// Register the application's document templates. Document templates
|
||||
// serve as the connection between documents, frame windows and views.
|
||||
|
||||
CSingleDocTemplate* pDocTemplate;
|
||||
pDocTemplate = new CSingleDocTemplate(
|
||||
IDR_MAINFRAME,
|
||||
RUNTIME_CLASS(CMFC_DEMODoc),
|
||||
RUNTIME_CLASS(CMainFrame), // main SDI frame window
|
||||
RUNTIME_CLASS(CMFC_DEMOView));
|
||||
AddDocTemplate(pDocTemplate);
|
||||
|
||||
// Parse command line for standard shell commands, DDE, file open
|
||||
CCommandLineInfo cmdInfo;
|
||||
ParseCommandLine(cmdInfo);
|
||||
|
||||
// Dispatch commands specified on the command line
|
||||
if (!ProcessShellCommand(cmdInfo))
|
||||
return FALSE;
|
||||
|
||||
// The one and only window has been initialized, so show and update it.
|
||||
m_pMainWnd->ShowWindow(SW_SHOW);
|
||||
m_pMainWnd->UpdateWindow();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// App command to run the dialog
|
||||
void CMFC_DEMOApp::OnAppAbout()
|
||||
{
|
||||
CAboutDlg aboutDlg;
|
||||
aboutDlg.DoModal();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp commands
|
||||
164
public/wintab/examples/mfc_demo/mfc_demo.dsp
Normal file
164
public/wintab/examples/mfc_demo/mfc_demo.dsp
Normal file
@@ -0,0 +1,164 @@
|
||||
# Microsoft Developer Studio Project File - Name="MFC_DEMO" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=MFC_DEMO - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "MFC_DEMO.MAK".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "MFC_DEMO.MAK" CFG="MFC_DEMO - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "MFC_DEMO - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "MFC_DEMO - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "MFC_DEMO - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\lib\i386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "MFC_DEMO - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 6
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 6
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /Zi /Od /Gf /Gy /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /FR /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\lib\i386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "MFC_DEMO - Win32 Release"
|
||||
# Name "MFC_DEMO - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\demodoc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\demoview.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MainFrm.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMO.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMODoc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MFC_DEMOView.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMO.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMO.rc2
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\res\MFC_DEMODoc.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/mfc_demo/mfc_demo.dsw
Normal file
29
public/wintab/examples/mfc_demo/mfc_demo.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "MFC_DEMO"=.\MFC_DEMO.DSP - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
50
public/wintab/examples/mfc_demo/mfc_demo.h
Normal file
50
public/wintab/examples/mfc_demo/mfc_demo.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// MFC_DEMO.h : main header file for the MFC_DEMO application
|
||||
//
|
||||
|
||||
#if !defined(AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMFC_DEMOApp:
|
||||
// See MFC_DEMO.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CMFC_DEMOApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CMFC_DEMOApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMFC_DEMOApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CMFC_DEMOApp)
|
||||
afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MFC_DEMO_H__B7D0AFE6_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
323
public/wintab/examples/mfc_demo/mfc_demo.rc
Normal file
323
public/wintab/examples/mfc_demo/mfc_demo.rc
Normal file
@@ -0,0 +1,323 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#endif\r\n"
|
||||
"#include ""res\\MFC_DEMO.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\MFC_DEMO.ico"
|
||||
IDR_MFC_DETYPE ICON DISCARDABLE "res\\DEMODoc.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
|
||||
MENUITEM "E&xit", ID_APP_EXIT
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About MFC_DEMO...", ID_APP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
|
||||
BEGIN
|
||||
"N", ID_FILE_NEW, VIRTKEY, CONTROL
|
||||
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
|
||||
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
|
||||
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
|
||||
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
||||
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
|
||||
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
|
||||
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
|
||||
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
|
||||
VK_F6, ID_NEXT_PANE, VIRTKEY
|
||||
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About MFC_DEMO"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "MFC_DEMO Version 1.0",IDC_STATIC,40,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 1998 LCS/Telegraphics",IDC_STATIC,40,25,
|
||||
119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "MFC_DEMO MFC Application\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "MFC_DEMO\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 1998\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "MFC_DEMO.EXE\0"
|
||||
VALUE "ProductName", "MFC_DEMO Application\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 210
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
IDR_MAINFRAME "MFC_DEMO\n\nMFC_DE\n\n\nMFCDEMO.Document\nMFC_DE Document"
|
||||
END
|
||||
|
||||
STRINGTABLE PRELOAD DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "MFC_DEMO"
|
||||
AFX_IDS_IDLEMESSAGE "Ready"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_INDICATOR_EXT "EXT"
|
||||
ID_INDICATOR_CAPS "CAP"
|
||||
ID_INDICATOR_NUM "NUM"
|
||||
ID_INDICATOR_SCRL "SCRL"
|
||||
ID_INDICATOR_OVR "OVR"
|
||||
ID_INDICATOR_REC "REC"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_NEW "Create a new document\nNew"
|
||||
ID_FILE_OPEN "Open an existing document\nOpen"
|
||||
ID_FILE_CLOSE "Close the active document\nClose"
|
||||
ID_FILE_SAVE "Save the active document\nSave"
|
||||
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
|
||||
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_FILE_MRU_FILE1 "Open this document"
|
||||
ID_FILE_MRU_FILE2 "Open this document"
|
||||
ID_FILE_MRU_FILE3 "Open this document"
|
||||
ID_FILE_MRU_FILE4 "Open this document"
|
||||
ID_FILE_MRU_FILE5 "Open this document"
|
||||
ID_FILE_MRU_FILE6 "Open this document"
|
||||
ID_FILE_MRU_FILE7 "Open this document"
|
||||
ID_FILE_MRU_FILE8 "Open this document"
|
||||
ID_FILE_MRU_FILE9 "Open this document"
|
||||
ID_FILE_MRU_FILE10 "Open this document"
|
||||
ID_FILE_MRU_FILE11 "Open this document"
|
||||
ID_FILE_MRU_FILE12 "Open this document"
|
||||
ID_FILE_MRU_FILE13 "Open this document"
|
||||
ID_FILE_MRU_FILE14 "Open this document"
|
||||
ID_FILE_MRU_FILE15 "Open this document"
|
||||
ID_FILE_MRU_FILE16 "Open this document"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
|
||||
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
ID_EDIT_CLEAR "Erase the selection\nErase"
|
||||
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
|
||||
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
|
||||
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
|
||||
ID_EDIT_FIND "Find the specified text\nFind"
|
||||
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
|
||||
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
|
||||
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
|
||||
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
|
||||
ID_EDIT_UNDO "Undo the last action\nUndo"
|
||||
ID_EDIT_REDO "Redo the previously undone action\nRedo"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCSIZE "Change the window size"
|
||||
AFX_IDS_SCMOVE "Change the window position"
|
||||
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
|
||||
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
|
||||
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
|
||||
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
|
||||
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
AFX_IDS_SCRESTORE "Restore the window to normal size"
|
||||
AFX_IDS_SCTASKLIST "Activate Task List"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif
|
||||
#include "res\MFC_DEMO.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
19
public/wintab/examples/mfc_demo/point.h
Normal file
19
public/wintab/examples/mfc_demo/point.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef POINT_H
|
||||
#define POINT_H
|
||||
|
||||
class point
|
||||
{
|
||||
public:
|
||||
long x, y;
|
||||
|
||||
point( void ) { ; };
|
||||
point( point const & p ) { x = p.x; y = p.y; };
|
||||
point( POINT const & p ) { x = p.x; y = p.y; };
|
||||
|
||||
bool operator < ( point const & r ) const { return x < r.x || (x == r.x && y < r.y); };
|
||||
bool operator > ( point const & r ) const { return !(*this < r); };
|
||||
bool operator == ( point const & r ) const { return x == r.x && y == r.y; };
|
||||
bool operator != ( point const & r ) const { return !(*this == r); };
|
||||
};
|
||||
|
||||
#endif POINT_H
|
||||
BIN
public/wintab/examples/mfc_demo/res/demodoc.ico
Normal file
BIN
public/wintab/examples/mfc_demo/res/demodoc.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
public/wintab/examples/mfc_demo/res/mfc_demo.ico
Normal file
BIN
public/wintab/examples/mfc_demo/res/mfc_demo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
13
public/wintab/examples/mfc_demo/res/mfc_demo.rc2
Normal file
13
public/wintab/examples/mfc_demo/res/mfc_demo.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MFC_DEMO.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
19
public/wintab/examples/mfc_demo/resource.h
Normal file
19
public/wintab/examples/mfc_demo/resource.h
Normal file
@@ -0,0 +1,19 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by MFC_DEMO.RC
|
||||
//
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_MFC_DETYPE 129
|
||||
#define IDD_ABOUTBOX 100
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 130
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#endif
|
||||
#endif
|
||||
6
public/wintab/examples/mfc_demo/stdafx.cpp
Normal file
6
public/wintab/examples/mfc_demo/stdafx.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// MFC_DEMO.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
24
public/wintab/examples/mfc_demo/stdafx.h
Normal file
24
public/wintab/examples/mfc_demo/stdafx.h
Normal file
@@ -0,0 +1,24 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
#define AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
//#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__B7D0AFE8_20A7_11D2_B1B0_0040053C38B6__INCLUDED_)
|
||||
58
public/wintab/examples/mgrtest/bitbox.c
Normal file
58
public/wintab/examples/mgrtest/bitbox.c
Normal file
@@ -0,0 +1,58 @@
|
||||
#include <windows.h>
|
||||
|
||||
/* test_bitboxes() - use a static text box for selecting/changing a list of bits, hex bytes,
|
||||
or other evenly spaced things. */
|
||||
/* scrPos.x = x coord */
|
||||
/* scrPos.y = y coord */
|
||||
/* box_id = an array of dialog ID's, one for each box */
|
||||
/* ndiv = number of divisions per box */
|
||||
/* nboxes = number of boxes */
|
||||
/* return value = selection number or -1 if point is outside of all boxes */
|
||||
int
|
||||
test_bitboxes( HWND hDlg, unsigned long pos, unsigned ndiv, int nboxes, const int *box_id )
|
||||
{
|
||||
int i;
|
||||
POINT scrPos;
|
||||
|
||||
/* find current position in screen coordinates. */
|
||||
scrPos.x = (int)LOWORD(pos);
|
||||
scrPos.y = (int)HIWORD(pos);
|
||||
ClientToScreen(hDlg, &scrPos);
|
||||
|
||||
for( i = 0; i < nboxes; i++ ) {
|
||||
RECT box;
|
||||
HWND hWndItem;
|
||||
HDC hDC;
|
||||
static char buf[100];
|
||||
|
||||
/* Check point against bounding box of text box */
|
||||
|
||||
hWndItem = GetDlgItem(hDlg, box_id[i]);
|
||||
GetWindowRect(hWndItem, &box);
|
||||
GetWindowText(hWndItem, buf, sizeof(buf));
|
||||
hDC = GetDC(hWndItem);
|
||||
if (hDC) {
|
||||
SIZE stringSize;
|
||||
GetTextExtentPoint(hDC, buf, strlen(buf), &stringSize);
|
||||
|
||||
// heuristic rule: sometimes GetTextExtentPoint lies
|
||||
// when the font is manually reduced in size, say 70%.
|
||||
// So, only believe the string size if it is smaller
|
||||
// than the box size.
|
||||
if (stringSize.cx < (box.right - box.left)) {
|
||||
// now correct the right side of box for string size.
|
||||
box.right=box.left + stringSize.cx;
|
||||
}
|
||||
ReleaseDC(hWndItem,hDC);
|
||||
}
|
||||
|
||||
|
||||
if( scrPos.x > box.left && scrPos.x < box.right &&
|
||||
scrPos.y > box.top && scrPos.y < box.bottom ) {
|
||||
|
||||
/* Check which character the point is in */
|
||||
return (ndiv*i + (ndiv*(scrPos.x - box.left)) / (box.right - box.left));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
176
public/wintab/examples/mgrtest/btnmap.c
Normal file
176
public/wintab/examples/mgrtest/btnmap.c
Normal file
@@ -0,0 +1,176 @@
|
||||
/****************************/
|
||||
/* Set extended button maps */
|
||||
/****************************/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "wintab.h"
|
||||
|
||||
#include "mgrtest.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINT wCsr;
|
||||
BYTE sysBtns[256];
|
||||
BYTE logBtns[256];
|
||||
} xBtn_info;
|
||||
|
||||
|
||||
static const unsigned nbitboxes = 32;
|
||||
static const int bitbox_id[] = {
|
||||
IDC_SYS_1, IDC_SYS_2, IDC_SYS_3, IDC_SYS_4, IDC_SYS_5, IDC_SYS_6, IDC_SYS_7, IDC_SYS_8, IDC_SYS_9, IDC_SYS_10, IDC_SYS_11, IDC_SYS_12, IDC_SYS_13, IDC_SYS_14, IDC_SYS_15, IDC_SYS_16,
|
||||
IDC_LOG_1, IDC_LOG_2, IDC_LOG_3, IDC_LOG_4, IDC_LOG_5, IDC_LOG_6, IDC_LOG_7, IDC_LOG_8, IDC_LOG_9, IDC_LOG_10, IDC_LOG_11, IDC_LOG_12, IDC_LOG_13, IDC_LOG_14, IDC_LOG_15, IDC_LOG_16
|
||||
};
|
||||
|
||||
|
||||
extern HANDLE hInst;
|
||||
|
||||
|
||||
void
|
||||
display_xButton_info( HWND hDlg, const xBtn_info * btn )
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for( i = 0; i < nbitboxes; i++ ) {
|
||||
unsigned j;
|
||||
char buf[100] = "";
|
||||
|
||||
for( j = 0; j < 16; j++ ) {
|
||||
char tmp[5];
|
||||
|
||||
sprintf( tmp, "%2x ", (int)*(btn->sysBtns + i*16 + j) );
|
||||
strcat( buf, tmp );
|
||||
}
|
||||
|
||||
SetWindowText(GetDlgItem(hDlg, bitbox_id[i]), buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
CALLBACK valueProc( HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam )
|
||||
{
|
||||
BOOL fResult;
|
||||
int retval;
|
||||
|
||||
switch( Msg ) {
|
||||
case WM_COMMAND:
|
||||
|
||||
switch( wParam ) {
|
||||
case IDOK:
|
||||
retval = GetDlgItemInt( hDlg, IDC_EDIT, 0, TRUE );
|
||||
EndDialog(hDlg, retval);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, -1);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
default:
|
||||
fResult = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fResult = FALSE;
|
||||
}
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
CALLBACK xButtonDlgProc( HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam )
|
||||
{
|
||||
static xBtn_info * btn;
|
||||
int i;
|
||||
BOOL fResult;
|
||||
|
||||
switch( Msg ) {
|
||||
case WM_INITDIALOG:
|
||||
btn = (xBtn_info *)lParam;
|
||||
display_xButton_info( hDlg, btn );
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN: /* Change the xBtn map */
|
||||
i = test_bitboxes( hDlg, lParam, 16, nbitboxes, bitbox_id );
|
||||
|
||||
if( i > -1 ) {
|
||||
FARPROC lpProcDlg;
|
||||
int val;
|
||||
|
||||
/* Open 'Enter Value' dialog */
|
||||
lpProcDlg = MakeProcInstance( valueProc, hInst );
|
||||
val = DialogBox( hInst, MAKEINTRESOURCE(IDD_VALUE), hDlg, lpProcDlg );
|
||||
FreeProcInstance( lpProcDlg );
|
||||
|
||||
if( val >= 0 && val <= 0xff ) {
|
||||
*(btn->sysBtns + i) = val;
|
||||
display_xButton_info( hDlg, btn );
|
||||
} else
|
||||
if( val != -1 )
|
||||
MessageBox( hDlg, "Invalid value.", "MgrTest", MB_OK | MB_ICONHAND );
|
||||
}
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (wParam == IDOK || wParam == IDCANCEL) {
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
} else
|
||||
fResult = FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
fResult = FALSE;
|
||||
}
|
||||
return fResult;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
set_xBtnMap( HWND hWnd, HMGR hMgr )
|
||||
{
|
||||
FARPROC lpProcDlg;
|
||||
xBtn_info info;
|
||||
unsigned i;
|
||||
int tag;
|
||||
|
||||
/* Open a dialog to choose which cursor to use. */
|
||||
lpProcDlg = MakeProcInstance( CursInfoDlgProc, hInst );
|
||||
info.wCsr = DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hWnd, lpProcDlg, WTI_CURSORS );
|
||||
FreeProcInstance( lpProcDlg );
|
||||
|
||||
if( info.wCsr != 0xffffffff ) {
|
||||
/* Find xBtnMask info */
|
||||
i = 0;
|
||||
while( WTInfo( WTI_EXTENSIONS + i, EXT_TAG, &tag ) && tag != WTX_XBTNMASK )
|
||||
i++;
|
||||
|
||||
if( tag != WTX_XBTNMASK )
|
||||
MessageBox( hWnd, "XBTNMASK extension not supported.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
|
||||
/* Read the xBtn map info */
|
||||
if( !WTInfo( WTI_EXTENSIONS + i, EXT_CURSORS + info.wCsr, info.sysBtns ) )
|
||||
MessageBox( hWnd, "This cursor does not support XBTNMASK.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
else {
|
||||
int id;
|
||||
|
||||
/* Start the XBUTTONS dialog */
|
||||
lpProcDlg = MakeProcInstance( xButtonDlgProc, hInst );
|
||||
id = DialogBoxParam( hInst, MAKEINTRESOURCE(IDD_XBUTTONS),
|
||||
hWnd, lpProcDlg, (long)&info );
|
||||
FreeProcInstance( lpProcDlg );
|
||||
|
||||
if( id == IDOK )
|
||||
if( !WTMgrCsrExt( hMgr, info.wCsr, WTX_XBTNMASK, info.sysBtns ) )
|
||||
MessageBox( hWnd, "WTMgrCsrExt failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
}
|
||||
}
|
||||
}
|
||||
228
public/wintab/examples/mgrtest/btnmask.c
Normal file
228
public/wintab/examples/mgrtest/btnmask.c
Normal file
@@ -0,0 +1,228 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Set the Button Mask and XBTNMASK extension */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "wintab.h"
|
||||
|
||||
#include "Mgrdlg.h"
|
||||
#include "Mgrtest.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
LOGCONTEXT * lc;
|
||||
BOOL xBtnMask_avail;
|
||||
XBTNMASK xBtnMask;
|
||||
} btn_info;
|
||||
|
||||
static const unsigned nbitboxes = 18;
|
||||
static const int bitbox_id[] = {
|
||||
XBU_DISPLAY1, XBU_DISPLAY2, XBU_DISPLAY3, XBU_DISPLAY4, XBU_DISPLAY5, XBU_DISPLAY6, XBU_DISPLAY7, XBU_DISPLAY8,
|
||||
XBD_DISPLAY1, XBD_DISPLAY2, XBD_DISPLAY3, XBD_DISPLAY4, XBD_DISPLAY5, XBD_DISPLAY6, XBD_DISPLAY7, XBD_DISPLAY8,
|
||||
BNU_DISPLAY, BND_DISPLAY
|
||||
};
|
||||
|
||||
|
||||
extern HANDLE hInst;
|
||||
|
||||
extern BOOL FAR PASCAL ButtonDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
void
|
||||
static DisplayBits( HWND hDlg, const btn_info * btn )
|
||||
{
|
||||
static char buf[33];
|
||||
int i;
|
||||
|
||||
buf[32] = 0;
|
||||
|
||||
/* Display the XBTNMASK bits */
|
||||
for( i = 0; i < 8; i++ ) {
|
||||
unsigned j;
|
||||
for( j = 0; j < 32; j++ )
|
||||
buf[j] = '0' + ((btn->xBtnMask.xBtnUpMask[4*i + j/8] >> (j%8)) & 0x01);
|
||||
SetWindowText(GetDlgItem(hDlg, bitbox_id[i]), buf);
|
||||
}
|
||||
|
||||
for( i = 8; i < 16; i++ ) {
|
||||
unsigned j;
|
||||
for( j = 0; j < 32; j++ )
|
||||
buf[j] = '0' + ((btn->xBtnMask.xBtnDnMask[4*(i-8) + j/8] >> (j%8)) & 0x01);
|
||||
SetWindowText(GetDlgItem(hDlg, bitbox_id[i]), buf);
|
||||
}
|
||||
|
||||
/* Display the regular button mask bits */
|
||||
for( i = 0; i < 32; i++ )
|
||||
buf[i] = (char)('0' + ((btn->lc->lcBtnUpMask >> i) & 0x01));
|
||||
SetWindowText(GetDlgItem(hDlg, BNU_DISPLAY), buf);
|
||||
|
||||
for( i = 0; i < 32; i++ )
|
||||
buf[i] = (char)('0' + ((btn->lc->lcBtnDnMask >> i) & 0x01));
|
||||
SetWindowText(GetDlgItem(hDlg, BND_DISPLAY), buf);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL
|
||||
CALLBACK BtnMaskDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
static btn_info * btn;
|
||||
BOOL fResult;
|
||||
int bit;
|
||||
|
||||
switch (Msg) {
|
||||
case WM_INITDIALOG:
|
||||
btn = (btn_info *)lParam;
|
||||
|
||||
if( !btn->xBtnMask_avail ) {
|
||||
EnableWindow( GetDlgItem(hDlg, XBD_BOX), FALSE );
|
||||
EnableWindow( GetDlgItem(hDlg, XBU_BOX), FALSE );
|
||||
|
||||
for( bit = 0; bit < 16; bit++ )
|
||||
EnableWindow( GetDlgItem(hDlg, bitbox_id[bit]), FALSE );
|
||||
}
|
||||
|
||||
DisplayBits(hDlg, btn);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN: /* Change the xBtnMask bits */
|
||||
/* If clicked on a digit in ???_DISPLAY?, then change it's corrisponding bit */
|
||||
/* Luckily 1 and 0 have the same width in the default font */
|
||||
bit = test_bitboxes( hDlg, lParam, 32, nbitboxes, bitbox_id );
|
||||
|
||||
if( bit > -1 ) {
|
||||
/* Flip the bit. The first 32 bits of XBTNMASK should match the regular
|
||||
32 bit button mask */
|
||||
if( bit/32 == 16 ) { /* Regular button mask */
|
||||
btn->lc->lcBtnUpMask ^= 1 << (bit%32);
|
||||
if( btn->xBtnMask_avail )
|
||||
btn->xBtnMask.xBtnUpMask[(bit%32)/8] ^= 1 << (bit%32);
|
||||
} else
|
||||
if( bit/32 == 17 ) {
|
||||
btn->lc->lcBtnDnMask ^= 1 << (bit%32);
|
||||
if( btn->xBtnMask_avail )
|
||||
btn->xBtnMask.xBtnDnMask[(bit%32)/8] ^= 1 << (bit%32);
|
||||
} else /* xBtnMask */
|
||||
if( btn->xBtnMask_avail )
|
||||
if( bit >= 256 ) {
|
||||
btn->xBtnMask.xBtnDnMask[(bit-256)/8] ^= 1 << (bit%8);
|
||||
if( bit-256 < 32 )
|
||||
btn->lc->lcBtnDnMask ^= 1 << (bit%32);
|
||||
} else {
|
||||
btn->xBtnMask.xBtnUpMask[bit / 8] ^= 1 << (bit%8);
|
||||
if( bit < 32 )
|
||||
btn->lc->lcBtnUpMask ^= 1 << (bit%32);
|
||||
}
|
||||
DisplayBits(hDlg, btn);
|
||||
}
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (wParam == IDOK) {
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
}
|
||||
else if (wParam == IDCANCEL) {
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fResult = FALSE;
|
||||
}
|
||||
return fResult;
|
||||
} /* BtnMaskDlgProc */
|
||||
|
||||
|
||||
|
||||
void
|
||||
set_default_BtnMask( HWND hWnd, HMGR hMgr, int fSys )
|
||||
{
|
||||
int wDev;
|
||||
FARPROC lpProcDlg;
|
||||
|
||||
/* Get a device # */
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hWnd);
|
||||
wDev = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hWnd, lpProcDlg, WTI_DDCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
if( wDev >= 0 ) {
|
||||
FARPROC fpProc;
|
||||
btn_info btn;
|
||||
HCTX hCtx;
|
||||
int id;
|
||||
unsigned numDevices;
|
||||
LOGCONTEXT lc;
|
||||
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( wDev < (int)numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, wDev, fSys);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, fSys);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, fSys); /* 'Default Device' was the last choice in the dialog */
|
||||
|
||||
btn.lc = &lc;
|
||||
|
||||
/* Read the button masks */
|
||||
if( !hCtx ) {
|
||||
MessageBox( hWnd, "Failed to open default context.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
return;
|
||||
}
|
||||
if( !WTGet( hCtx, btn.lc ) ) {
|
||||
MessageBox( hWnd, "WTGet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
return;
|
||||
}
|
||||
if( WTExtGet( hCtx, WTX_XBTNMASK, &btn.xBtnMask ) )
|
||||
btn.xBtnMask_avail = TRUE;
|
||||
else {
|
||||
btn.xBtnMask_avail = FALSE;
|
||||
memset( btn.xBtnMask.xBtnDnMask, 0, sizeof(XBTNMASK) );
|
||||
}
|
||||
|
||||
/* Do the button bit dialog */
|
||||
fpProc = MakeProcInstance((FARPROC)BtnMaskDlgProc, hWnd);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_BTNMASKS), hWnd, fpProc, (long)&btn);
|
||||
FreeProcInstance(fpProc);
|
||||
|
||||
/* Set the new button masks */
|
||||
if( id == IDOK ) {
|
||||
if( !WTSet( hCtx, btn.lc ) )
|
||||
MessageBox( hWnd, "WTSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
if( btn.xBtnMask_avail && !WTExtSet( hCtx, WTX_XBTNMASK, &btn.xBtnMask ) )
|
||||
MessageBox( hWnd, "WTExtSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
set_ctx_BtnMask( HWND hWnd, HCTX hCtx, LOGCONTEXT * lc )
|
||||
{
|
||||
FARPROC fpProc;
|
||||
btn_info btn;
|
||||
int id;
|
||||
|
||||
btn.lc = lc;
|
||||
if( WTExtGet( hCtx, WTX_XBTNMASK, &btn.xBtnMask ) )
|
||||
btn.xBtnMask_avail = TRUE;
|
||||
else {
|
||||
btn.xBtnMask_avail = FALSE;
|
||||
memset( btn.xBtnMask.xBtnDnMask, 0, sizeof(XBTNMASK) );
|
||||
}
|
||||
|
||||
fpProc = MakeProcInstance((FARPROC)BtnMaskDlgProc, hWnd);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_BTNMASKS), hWnd, fpProc, (long)&btn);
|
||||
FreeProcInstance(fpProc);
|
||||
|
||||
if( id == IDOK ) {
|
||||
/* Set the new button masks */
|
||||
if( !WTSet( hCtx, btn.lc ) )
|
||||
MessageBox( hWnd, "WTSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
if( btn.xBtnMask_avail && !WTExtSet( hCtx, WTX_XBTNMASK, &btn.xBtnMask ) )
|
||||
MessageBox( hWnd, "WTExtSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
}
|
||||
}
|
||||
183
public/wintab/examples/mgrtest/csrmask.c
Normal file
183
public/wintab/examples/mgrtest/csrmask.c
Normal file
@@ -0,0 +1,183 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "wintab.h"
|
||||
|
||||
#include "Mgrtest.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
static const unsigned textfield[4] = { IDC_TEXT1, IDC_TEXT2, IDC_TEXT3, IDC_TEXT4 };
|
||||
|
||||
extern HANDLE hInst;
|
||||
|
||||
|
||||
static void CsrDisplayBits( HWND hDlg, const BYTE FAR csrmask[16] )
|
||||
{
|
||||
char buf[33];
|
||||
unsigned i, j;
|
||||
|
||||
buf[32] = 0;
|
||||
|
||||
for( i = 0; i < 4; i++ ) {
|
||||
for( j = 0; j < 32; j++ )
|
||||
buf[j] = '0' + ((csrmask[4*i + j/8] >> (j%8)) & 0x01);
|
||||
|
||||
SetWindowText(GetDlgItem(hDlg, textfield[i]), buf);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL
|
||||
CALLBACK CsrmaskDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
static BYTE FAR * csrmask;
|
||||
|
||||
BOOL fResult;
|
||||
|
||||
int i;
|
||||
LRESULT val;
|
||||
|
||||
switch (Msg) {
|
||||
case WM_INITDIALOG:
|
||||
/* Display the Csrmask bitfield bits */
|
||||
csrmask = (BYTE FAR *)lParam;
|
||||
|
||||
CsrDisplayBits(hDlg, csrmask);
|
||||
|
||||
fResult = TRUE;
|
||||
|
||||
|
||||
/* List the available cursors, and highlight them if their Csrmask bits are set */
|
||||
i = 0;
|
||||
while( WTInfo( WTI_CURSORS + i, 0, 0 ) ) {
|
||||
char name[1024];
|
||||
|
||||
WTInfo( WTI_CURSORS + i, CSR_NAME, name );
|
||||
SendDlgItemMessage( hDlg, IDC_CSRLST, LB_ADDSTRING, 0, (LPARAM)((char FAR *)name) );
|
||||
i++;
|
||||
}
|
||||
|
||||
/* for Unknown Reason, sending LB_SETSEL right after LB_ADDSTRING doesn't work reliably */
|
||||
i = 0;
|
||||
while( WTInfo( WTI_CURSORS + i, 0, 0 ) ) {
|
||||
/* Highlight the name in the selection box */
|
||||
SendDlgItemMessage( hDlg, IDC_CSRLST, LB_SETSEL, (csrmask[i/8] >> (i%8)) & 0x01, i );
|
||||
i++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
/* If clicked on a number in IDC_TEXT?, then change it's corrisponding bit */
|
||||
i = test_bitboxes( hDlg, lParam, 32, 4, textfield );
|
||||
|
||||
if( i > -1 ) {
|
||||
/* Flip the bit */
|
||||
csrmask[i / 8] ^= 1 << (i % 8);
|
||||
CsrDisplayBits(hDlg, csrmask);
|
||||
|
||||
/* Highlight the corrisponding cursor in the listbox appropriately */
|
||||
SendDlgItemMessage( hDlg, IDC_CSRLST, LB_SETSEL, (csrmask[i/8] >> (i%8)) & 0x01, i );
|
||||
}
|
||||
fResult = TRUE;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( wParam ) {
|
||||
case IDOK:
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if( HIWORD(wParam) == LBN_SELCHANGE || wParam == IDC_CSRLST ) {
|
||||
/* Set all of the bits according to the selection box selections until error */
|
||||
i = 0;
|
||||
fResult = FALSE;
|
||||
while( !fResult ) {
|
||||
val = SendMessage( (HWND)lParam, LB_GETSEL, i, 0 );
|
||||
if( val > 0 )
|
||||
csrmask[i/8] |= 1 << (i%8);
|
||||
else
|
||||
if( val == 0 )
|
||||
csrmask[i/8] &= ~(1 << (i%8));
|
||||
else
|
||||
fResult = TRUE;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Redisplay the bits */
|
||||
CsrDisplayBits(hDlg, csrmask);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fResult = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
set_default_CsrMask( HWND hWnd, HMGR hMgr, int fSys )
|
||||
{
|
||||
int wDev;
|
||||
FARPROC lpProcDlg;
|
||||
|
||||
/* Get a device # */
|
||||
lpProcDlg = MakeProcInstance( (FARPROC)CursInfoDlgProc, hInst);
|
||||
wDev = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hWnd, lpProcDlg, WTI_DDCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
if( wDev >= 0 ) {
|
||||
FARPROC fpProc;
|
||||
HCTX hCtx;
|
||||
int id;
|
||||
BYTE CsrMask[16];
|
||||
unsigned numDevices;
|
||||
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( wDev < (int)numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, wDev, fSys);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, fSys);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, fSys); /* 'Default Device' was the last choice in the dialog */
|
||||
|
||||
/* Read the button masks */
|
||||
if( !hCtx ) {
|
||||
MessageBox( hWnd, "Failed to open default context.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
return;
|
||||
}
|
||||
if( !WTExtGet( hCtx, WTX_CSRMASK, CsrMask ) ) {
|
||||
MessageBox( hWnd, "Cursor mask not supported on this device.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Do the button bit dialog */
|
||||
fpProc = MakeProcInstance((FARPROC)CsrmaskDlgProc, hInst );
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CSRMASKS), hWnd, fpProc, (long)((BYTE FAR *)CsrMask));
|
||||
FreeProcInstance(fpProc);
|
||||
|
||||
/* Set the new button masks */
|
||||
if( id == IDOK ) {
|
||||
if( !WTExtSet( hCtx, WTX_CSRMASK, CsrMask ) )
|
||||
MessageBox( hWnd, "WTExtSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
}
|
||||
}
|
||||
}
|
||||
203
public/wintab/examples/mgrtest/infodlg.c
Normal file
203
public/wintab/examples/mgrtest/infodlg.c
Normal file
@@ -0,0 +1,203 @@
|
||||
/* ------------------------------- infodlg.c -------------------------------- */
|
||||
|
||||
/* 11-25-91 DMH -- Dialog boxes to mediate cursor/extension info-boxes, */
|
||||
|
||||
/* 6/1/98 Napoli -- Added WTI_DDCTXS, WTI_DSCTXS */
|
||||
/* -- Copied from wttest32 to mgrtest */
|
||||
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include "wintab.h"
|
||||
#include "mgrtest.h"
|
||||
|
||||
#define Abort() EndDialog(hDlg, -2)
|
||||
|
||||
extern HANDLE hInst;
|
||||
|
||||
#ifndef WIN32
|
||||
#define TCHAR char
|
||||
#define wcscpy(a,b) strcpy((a),(b))
|
||||
#define TEXT(a) (a)
|
||||
#endif
|
||||
|
||||
BOOL CALLBACK CursInfoDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam)
|
||||
|
||||
{
|
||||
int cBaseCat;
|
||||
/* Base category -- cursors, devices, extensions? */
|
||||
int cNumCats=0;
|
||||
int nNameCat=1; /* For all three the *_NAME Index is 1. &&&MAGIC&&&*/
|
||||
int cSize;
|
||||
long nCat;
|
||||
TCHAR *szCatName;
|
||||
|
||||
TCHAR PhraseBuf[40];
|
||||
TCHAR TextBuf[40];
|
||||
TCHAR szNameBuf[128];
|
||||
|
||||
|
||||
|
||||
|
||||
lParam = lParam; /* Nuke warning */
|
||||
|
||||
|
||||
|
||||
switch (Msg) {
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
case WM_INITDIALOG:
|
||||
|
||||
cBaseCat = LOWORD(lParam);
|
||||
switch (cBaseCat) {
|
||||
default:
|
||||
EndDialog(hDlg, -2);
|
||||
break;
|
||||
|
||||
case WTI_DDCTXS:
|
||||
case WTI_DSCTXS:
|
||||
case WTI_DEVICES:
|
||||
szCatName = TEXT("Device");
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &cNumCats);
|
||||
|
||||
if( cBaseCat == WTI_DDCTXS || cBaseCat == WTI_DSCTXS ) {
|
||||
WORD ver;
|
||||
if( !WTInfo(WTI_INTERFACE,IFC_SPECVERSION, &ver) ||
|
||||
((ver >> 8) <= 1 && (ver & 0xff) <= 10) ) {
|
||||
/* Apparently, this version of Wintab doesn't support WTI_DDCTXS
|
||||
or WTI_DSCTXS; return cNumCats, to indicate "default device"
|
||||
since no other categories actually exist. */
|
||||
EndDialog(hDlg, cNumCats);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WTI_CURSORS:
|
||||
szCatName = TEXT("Cursor");
|
||||
WTInfo(WTI_INTERFACE, IFC_NCURSORS, &cNumCats);
|
||||
break;
|
||||
|
||||
case WTI_EXTENSIONS:
|
||||
szCatName = TEXT("Extension");
|
||||
WTInfo(WTI_INTERFACE, IFC_NEXTENSIONS, &cNumCats);
|
||||
break;
|
||||
|
||||
/* Failure to support IFC_N* is handled later. */
|
||||
} /* Switch on lParam */
|
||||
|
||||
if (cNumCats == 1)
|
||||
EndDialog(hDlg, 0);
|
||||
|
||||
/*&&& Send message to secret field, indicating this window's
|
||||
cBaseCat. Also, set window's title field and caption. */
|
||||
|
||||
GetWindowText(hDlg, TextBuf, sizeof(TextBuf));
|
||||
wsprintf(PhraseBuf, TextBuf, (LPSTR)szCatName);
|
||||
SetWindowText(hDlg, PhraseBuf);
|
||||
|
||||
GetDlgItemText(hDlg, LBC_TITLE, TextBuf, sizeof(TextBuf));
|
||||
wsprintf(PhraseBuf, TextBuf, (LPSTR)szCatName);
|
||||
SetDlgItemText(hDlg, LBC_TITLE, PhraseBuf);
|
||||
|
||||
SetDlgItemInt(hDlg, LBC_BASECAT, cBaseCat, FALSE);
|
||||
|
||||
|
||||
|
||||
/* How many items are there? Catch un-reported items.*/
|
||||
|
||||
while (WTInfo(cBaseCat + cNumCats, 0, NULL))
|
||||
cNumCats++;
|
||||
|
||||
while (cNumCats > 0 && !WTInfo(cBaseCat + cNumCats-1, 0, NULL))
|
||||
cNumCats--;
|
||||
|
||||
if (cNumCats == 0) {
|
||||
wsprintf(PhraseBuf, TEXT("No %ss defined!"), (LPSTR)szCatName);
|
||||
MessageBox(hInst, PhraseBuf, TEXT("Info Boxes"),
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
EndDialog(hDlg, -2);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* Fill list Box */
|
||||
for (nCat = 0; nCat < cNumCats; nCat++) {
|
||||
|
||||
cSize = WTInfo(cBaseCat + (int)nCat, CSR_NAME,
|
||||
(LPVOID) szNameBuf);
|
||||
|
||||
if (cSize == 0 || szNameBuf[0] == '\0')
|
||||
wsprintf(szNameBuf, TEXT("%s #%d"), (LPSTR)szCatName,(int)nCat);
|
||||
|
||||
|
||||
cSize = (int)SendDlgItemMessage(hDlg, LBC_LISTBOX,
|
||||
LB_INSERTSTRING, (WPARAM)-1, (DWORD)(LPSTR)szNameBuf);
|
||||
|
||||
if (cSize == LB_ERR || cSize == LB_ERRSPACE) {
|
||||
|
||||
MessageBox(hInst, TEXT("Couldn't set an item name!"), TEXT("Info Boxes"),
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
|
||||
/* EndDialog(hDlg, -2);
|
||||
return TRUE; /* Abort on failure */
|
||||
|
||||
} /* Abort on failure */
|
||||
else
|
||||
;
|
||||
|
||||
} /* for each cursor */
|
||||
|
||||
if( cBaseCat == WTI_DDCTXS || cBaseCat == WTI_DSCTXS ) {
|
||||
/* Give a 'Default Device' choice, to fall back to WTI_DEFCONTEXT, WTI_DEFSYSCTX */
|
||||
wcscpy((wchar_t *)szNameBuf, (wchar_t *)TEXT("Default Device"));
|
||||
SendDlgItemMessage(hDlg, LBC_LISTBOX, LB_INSERTSTRING, (WPARAM)-1, (DWORD)(LPSTR)szNameBuf);
|
||||
}
|
||||
|
||||
/* Default selection was current cursor. Now, skipping the whole
|
||||
thing, because there can be multiple active cursors! */
|
||||
|
||||
nCat = 0; /* Index of 0, First item. */
|
||||
if (LB_ERR == (int)SendDlgItemMessage(hDlg, LBC_LISTBOX,
|
||||
LB_SETCURSEL, (int)nCat, (long)NULL))
|
||||
MessageBox(hInst, TEXT("Couldn't set current selection!"),
|
||||
TEXT("Info Boxes"),
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (wParam) {
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
case LBC_LISTBOX:
|
||||
if (HIWORD(lParam)!=LBN_DBLCLK)
|
||||
return FALSE;
|
||||
// fall through on double click!
|
||||
case IDOK:
|
||||
|
||||
cBaseCat = GetDlgItemInt(hDlg, LBC_BASECAT, NULL,
|
||||
FALSE);
|
||||
|
||||
nCat = (int)SendDlgItemMessage(hDlg, LBC_LISTBOX,
|
||||
LB_GETCURSEL, 0,
|
||||
(long)NULL);
|
||||
EndDialog(hDlg, (int)nCat);
|
||||
|
||||
return TRUE;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, -1);
|
||||
return TRUE;
|
||||
|
||||
} /* Switch wParam on WM_COMMAND */
|
||||
|
||||
} /* switch Msg number */
|
||||
|
||||
return FALSE;
|
||||
} /* CursInfoDlgProc */
|
||||
295
public/wintab/examples/mgrtest/mgrdlg.c
Normal file
295
public/wintab/examples/mgrtest/mgrdlg.c
Normal file
@@ -0,0 +1,295 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include "msgpack.h"
|
||||
#include <wintab.h>
|
||||
|
||||
#include "mgrdlg.h"
|
||||
|
||||
extern HMGR hMgr;
|
||||
|
||||
|
||||
|
||||
/* Fake a notification msg to our own dialog. */
|
||||
#define FakeNotify(Ctl, Msg) FORWARD_WM_COMMAND(hDlg, Ctl, \
|
||||
GetDlgItem(hDlg, Ctl), Msg, SendMessage)
|
||||
|
||||
|
||||
char Logical[]="Button #\0\0\0\0\0";
|
||||
char *LogNum= Logical+8;
|
||||
|
||||
WORD wCsr=0xFFFF; /* Current Cursor */
|
||||
unsigned char bLogBtns[32]={0}, bSysBtns[32]={0};
|
||||
|
||||
char *MseActs[]={
|
||||
"No Mouse Action",
|
||||
"Left Click",
|
||||
"Left Double-Click",
|
||||
"Left Drag",
|
||||
|
||||
"Right Click",
|
||||
"Right Double-Click",
|
||||
"Right Drag",
|
||||
|
||||
"Middle Click",
|
||||
"Middle Double-Click",
|
||||
"Middle Drag",
|
||||
NULL
|
||||
};
|
||||
|
||||
char *PenActs[]={
|
||||
"No Pen Action",
|
||||
|
||||
"Tip Click",
|
||||
"Tip Double-Click",
|
||||
"Tip Drag",
|
||||
|
||||
"Inverted Click",
|
||||
"Inverted Double-Click",
|
||||
"Inverted Drag",
|
||||
|
||||
"Barrel 1 Click",
|
||||
"Barrel 1 Double-Click",
|
||||
"Barrel 1 Drag",
|
||||
|
||||
"Barrel 2 Click",
|
||||
"Barrel 2 Double-Click",
|
||||
"Barrel 2 Drag",
|
||||
|
||||
"Barrel 3 Click",
|
||||
"Barrel 3 Double-Click",
|
||||
"Barrel 3 Drag",
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
/* Primitive -- load into globals */
|
||||
void static GetButtonMaps(HWND hDlg)
|
||||
{
|
||||
char NameBuf[500], *Name;
|
||||
|
||||
WTInfo(WTI_CURSORS+wCsr, CSR_BTNNAMES, NameBuf);
|
||||
WTInfo(WTI_CURSORS+wCsr, CSR_BUTTONMAP, bLogBtns);
|
||||
WTInfo(WTI_CURSORS+wCsr, CSR_SYSBTNMAP, bSysBtns);
|
||||
|
||||
/* Clear out old strings */
|
||||
while (SendDlgItemMessage(hDlg, IDC_NAMES,
|
||||
CB_DELETESTRING, 0, 0L))
|
||||
;
|
||||
|
||||
|
||||
for (Name = NameBuf; *Name != '\0';
|
||||
Name += lstrlen(Name)+1)
|
||||
SendDlgItemMessage(hDlg, IDC_NAMES, CB_ADDSTRING,
|
||||
0, (LPARAM)(LPSTR)Name);
|
||||
}
|
||||
|
||||
|
||||
/* Primitive -- Set values from globals */
|
||||
void static SetButtonMaps(HWND hDlg)
|
||||
{
|
||||
if (wCsr == 0xFFFF)
|
||||
return;
|
||||
|
||||
|
||||
WTMgrCsrButtonMap(hMgr, wCsr, bLogBtns, bSysBtns);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Primitive -- Set default values */
|
||||
void static ResetButtonMaps(HWND hDlg)
|
||||
{
|
||||
if (wCsr == 0xFFFF)
|
||||
return;
|
||||
|
||||
|
||||
WTMgrCsrButtonMap(hMgr, wCsr, WTP_LPDEFAULT, WTP_LPDEFAULT);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOL CALLBACK ButtonDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int wTmp, i, wTmpCsr;
|
||||
static char Name[80];
|
||||
WORD id, cmd;
|
||||
HWND hWnd;
|
||||
|
||||
switch (msg) {
|
||||
default:
|
||||
return FALSE;
|
||||
|
||||
case WM_INITDIALOG:
|
||||
/* Cursor names */
|
||||
WTInfo(WTI_INTERFACE, IFC_NCURSORS, &wTmp);
|
||||
for (i = 0; i < wTmp; i++) {
|
||||
BOOL fActive;
|
||||
|
||||
/* remember first active cursor. */
|
||||
WTInfo(WTI_CURSORS+i, CSR_ACTIVE, &fActive);
|
||||
if (fActive) {
|
||||
wTmpCsr = i;
|
||||
}
|
||||
WTInfo(WTI_CURSORS+i, CSR_NAME, Name);
|
||||
SendDlgItemMessage(hDlg, IDC_CURSORS, CB_ADDSTRING, 0,
|
||||
(LPARAM)(LPSTR)Name);
|
||||
}
|
||||
|
||||
/* Logical button numbers */
|
||||
for (i = 0; i < 32; i++) {
|
||||
sprintf( LogNum, "%i", i );
|
||||
/* itoa(i, LogNum, 10); */
|
||||
SendDlgItemMessage(hDlg, IDC_LOGICAL, CB_ADDSTRING, 0,
|
||||
(LPARAM)(LPSTR)Logical);
|
||||
}
|
||||
|
||||
/* Mouse Actions */
|
||||
for (i = 0; MseActs[i] != NULL; i++) {
|
||||
SendDlgItemMessage(hDlg, IDC_MOUSE, CB_ADDSTRING, 0,
|
||||
(LPARAM)(LPSTR)(MseActs[i]));
|
||||
}
|
||||
|
||||
/* Pen Actions */
|
||||
for (i = 0; PenActs[i] != NULL; i++) {
|
||||
SendDlgItemMessage(hDlg, IDC_PEN, CB_ADDSTRING, 0,
|
||||
(LPARAM)(LPSTR)(PenActs[i]));
|
||||
}
|
||||
|
||||
|
||||
SendDlgItemMessage(hDlg, IDC_NAMES, CB_ADDSTRING,
|
||||
0, (LPARAM)(LPSTR)"FOOBAR");
|
||||
|
||||
/* start with current cursor selected. */
|
||||
SendDlgItemMessage(hDlg, IDC_CURSORS,
|
||||
CB_SETCURSEL, wTmpCsr, 0L);
|
||||
|
||||
FakeNotify(IDC_CURSORS, CBN_SELCHANGE);
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
id = GET_WM_COMMAND_ID(wParam, lParam);
|
||||
cmd = GET_WM_COMMAND_CMD(wParam, lParam);
|
||||
hWnd = GET_WM_COMMAND_HWND(wParam, lParam);
|
||||
switch (id) {
|
||||
case IDC_CURSORS:
|
||||
if (cmd == CBN_SELCHANGE) {
|
||||
|
||||
/* Set old values */
|
||||
SetButtonMaps(hDlg);
|
||||
|
||||
/* Set Button names and cascade selections. */
|
||||
|
||||
wCsr = (WORD)SendDlgItemMessage(hDlg, IDC_CURSORS,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
GetButtonMaps(hDlg);
|
||||
|
||||
/* Fake selection to continue cascade */
|
||||
SendDlgItemMessage(hDlg, IDC_NAMES,
|
||||
CB_SETCURSEL, 0, 0L);
|
||||
|
||||
FakeNotify(IDC_NAMES, CBN_SELCHANGE);
|
||||
} /* selchange */
|
||||
break;
|
||||
|
||||
case IDC_NAMES:
|
||||
if (cmd == CBN_SELCHANGE) {
|
||||
|
||||
wTmp = (WORD)SendDlgItemMessage(hDlg, IDC_NAMES,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
/* Fake selection to continue cascade */
|
||||
SendDlgItemMessage(hDlg, IDC_LOGICAL,
|
||||
CB_SETCURSEL, bLogBtns[wTmp], 0L);
|
||||
|
||||
FakeNotify(IDC_LOGICAL, CBN_SELCHANGE);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_LOGICAL:
|
||||
if (cmd == CBN_SELCHANGE) {
|
||||
WORD wButton=0;
|
||||
|
||||
wButton = (WORD)SendDlgItemMessage(hDlg, IDC_NAMES,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
wTmp = (WORD)SendDlgItemMessage(hDlg, IDC_LOGICAL,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
bLogBtns[wButton] = (BYTE)wTmp;
|
||||
|
||||
/* Fake selection to continue cascade */
|
||||
SendDlgItemMessage(hDlg, IDC_MOUSE,
|
||||
CB_SETCURSEL, bSysBtns[wTmp] & 0xF, 0L);
|
||||
SendDlgItemMessage(hDlg, IDC_PEN,
|
||||
CB_SETCURSEL, bSysBtns[wTmp] >> 4, 0L);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDC_MOUSE:
|
||||
if (cmd == CBN_SELCHANGE) {
|
||||
WORD wButton=0;
|
||||
|
||||
wButton = (WORD)SendDlgItemMessage(hDlg, IDC_LOGICAL,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
wTmp = (WORD)SendDlgItemMessage(hDlg, IDC_MOUSE,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
bSysBtns[wButton] &= 0xF0;
|
||||
bSysBtns[wButton] |= wTmp & 0x0F;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDC_PEN:
|
||||
if (cmd == CBN_SELCHANGE) {
|
||||
WORD wButton=0;
|
||||
|
||||
wButton = (WORD)SendDlgItemMessage(hDlg, IDC_LOGICAL,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
wTmp = (WORD)SendDlgItemMessage(hDlg, IDC_PEN,
|
||||
CB_GETCURSEL, 0, 0L);
|
||||
|
||||
bSysBtns[wButton] &= 0x0F;
|
||||
bSysBtns[wButton] |= (wTmp & 0x0F) << 4;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDC_DEFAULT:
|
||||
/* Set maps back to defaults */
|
||||
ResetButtonMaps(hDlg);
|
||||
wCsr = 0xFFFF;
|
||||
FakeNotify(IDC_CURSORS, CBN_SELCHANGE);
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
SetButtonMaps(hDlg);
|
||||
EndDialog(hDlg, id);
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, id);
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} /* Switch id */
|
||||
|
||||
} /* Switch msg */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
33
public/wintab/examples/mgrtest/mgrdlg.dlg
Normal file
33
public/wintab/examples/mgrtest/mgrdlg.dlg
Normal file
@@ -0,0 +1,33 @@
|
||||
DLGINCLUDE RCDATA DISCARDABLE
|
||||
BEGIN
|
||||
"MGRDLG.H\0"
|
||||
END
|
||||
|
||||
IDD_BUTTONS DIALOG 105, -8, 145, 205
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Cursor/Button Settings"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
LTEXT "&Cursor", -1, 12, 9, 22, 8
|
||||
COMBOBOX IDC_CURSORS, 12, 18, 120, 53, CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Physical &Buttons", -1, 12, 33, 55, 8
|
||||
COMBOBOX IDC_NAMES, 12, 42, 120, 53, CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Logical Buttons", -1, 12, 77, 55, 8
|
||||
COMBOBOX IDC_LOGICAL, 12, 86, 120, 53, CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Mouse Action", -1, 12, 123, 55, 8
|
||||
COMBOBOX IDC_MOUSE, 12, 132, 120, 53, CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "&Pen Action", -1, 12, 147, 37, 8
|
||||
COMBOBOX IDC_PEN, 12, 156, 120, 53, CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 6, 185, 40, 14
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 52, 185, 40, 14, WS_GROUP
|
||||
PUSHBUTTON "&Default", IDC_DEFAULT, 98, 185, 40, 14, WS_GROUP
|
||||
CONTROL "", 107, "Static", SS_BLACKFRAME, 6, 6, 132, 55
|
||||
CONTROL "", 108, "Static", SS_BLACKFRAME, 6, 74, 132, 32
|
||||
CONTROL "", 109, "Static", SS_BLACKFRAME, 6, 120, 132, 56
|
||||
END
|
||||
|
||||
31
public/wintab/examples/mgrtest/mgrdlg.h
Normal file
31
public/wintab/examples/mgrtest/mgrdlg.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#define IDD_BUTTONS 100
|
||||
#define IDC_CURSORS 101
|
||||
#define IDC_NAMES 102
|
||||
#define IDC_LOGICAL 103
|
||||
#define IDC_MOUSE 104
|
||||
#define IDC_PEN 105
|
||||
#define IDC_DEFAULT 106
|
||||
|
||||
#define IDD_BTNMASKS 600
|
||||
#define BMD_BASE 601
|
||||
#define BMD_MAX 632
|
||||
#define BMD_DISPLAY 665
|
||||
#define BMU_BASE 633
|
||||
#define BMU_MAX 664
|
||||
#define BMU_DISPLAY 668
|
||||
#define XBD_DISPLAY1 669
|
||||
#define XBD_DISPLAY2 670
|
||||
#define XBD_DISPLAY3 671
|
||||
#define XBD_DISPLAY4 672
|
||||
#define XBD_DISPLAY5 673
|
||||
#define XBD_DISPLAY6 674
|
||||
#define XBD_DISPLAY7 675
|
||||
#define XBD_DISPLAY8 676
|
||||
#define XBU_DISPLAY1 677
|
||||
#define XBU_DISPLAY2 678
|
||||
#define XBU_DISPLAY3 679
|
||||
#define XBU_DISPLAY4 680
|
||||
#define XBU_DISPLAY5 681
|
||||
#define XBU_DISPLAY6 682
|
||||
#define XBU_DISPLAY7 683
|
||||
#define XBU_DISPLAY8 684
|
||||
36
public/wintab/examples/mgrtest/mgrdll.c
Normal file
36
public/wintab/examples/mgrtest/mgrdll.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/* -------------------------------- mgrdll.c -------------------------------- */
|
||||
#include <windows.h>
|
||||
#include <wintab.h>
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Win32 dll entry/exit point. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Win16 dll entry point. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL WINAPI LibMain(HANDLE hModule, WORD wDataSeg, WORD cbHeapSize,
|
||||
LPSTR lpCmdLine)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Win16 dll exit point. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int WINAPI WEP(int nSystemExit)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL CALLBACK CBRTestProc(HCTX hCtx, HWND hWnd)
|
||||
{
|
||||
MessageBox(hWnd, "WTMgrConfigReplace() test succeeded!", "MgrTest",
|
||||
MB_ICONINFORMATION | MB_OK);
|
||||
return(FALSE);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
949
public/wintab/examples/mgrtest/mgrtest.c
Normal file
949
public/wintab/examples/mgrtest/mgrtest.c
Normal file
@@ -0,0 +1,949 @@
|
||||
/* ------------------------------- mgrtest.c -------------------------------- */
|
||||
|
||||
#include <windows.h>
|
||||
//#include <winuser.h>
|
||||
#include <string.h>
|
||||
#include <wintab.h>
|
||||
|
||||
#include "mgrdlg.h"
|
||||
#include "resource.h"
|
||||
#include "msgpack.h"
|
||||
#include "mgrtest.h"
|
||||
|
||||
HANDLE hInst;
|
||||
|
||||
/* application globals */
|
||||
HMGR hMgr = NULL;
|
||||
UINT ObtCat;
|
||||
UINT ObtSize;
|
||||
BOOL *ObtBuf;
|
||||
HMENU hObtMenu = NULL;
|
||||
|
||||
UINT NDevices;
|
||||
|
||||
HMODULE hWintab = NULL;
|
||||
|
||||
|
||||
/* If the exe imports WTMgrDefContextEx(), then we won't be able to run with
|
||||
older Wintab.dll/Wintab32.dll's which are don't support Wintab Spec 1.1.
|
||||
Instead, we'll try to GetProcAddress it ourselves. On failure, just disable
|
||||
features that depend on it. */
|
||||
HCTX (API * pWTMgrDefContextEx)(HMGR, UINT, BOOL);
|
||||
|
||||
extern BOOL FAR PASCAL ButtonDlgProc(HWND, UINT, WPARAM, LPARAM);
|
||||
void set_default_BtnMask( HWND hWnd, HMGR hMgr, int fSys ); /* BtnMask.c */
|
||||
void set_default_CsrMask( HWND hWnd, HMGR hMgr, int fSys ); /* Csrmask.c */
|
||||
void set_xBtnMap( HWND hWnd, HMGR hMgr ); /* btnMap.c */
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
encapsulate non-portable items:
|
||||
wintab string name
|
||||
LoadLibrary behavior
|
||||
Unicode/ANSI function name suffixes
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
/* no Unicode support yet. */
|
||||
#define CHARSET "A"
|
||||
char szWintab[] = "Wintab32";
|
||||
#define LoadLibraryWorked(h) (h)
|
||||
#else
|
||||
#define CHARSET
|
||||
char szWintab[] = "Wintab";
|
||||
#define LoadLibraryWorked(h) (h >= HINSTANCE_ERROR)
|
||||
#endif
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* portable wrappers for non-portable functions. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL ConfigReplace(HMGR h, BOOL f, LPSTR m, LPSTR p)
|
||||
{
|
||||
typedef BOOL (API *CRX)(HMGR, int, LPSTR, LPSTR);
|
||||
typedef BOOL (API *CR)(HMGR, int, WTCONFIGPROC);
|
||||
static CR cr = NULL;
|
||||
static CRX crx = NULL;
|
||||
|
||||
/* if not got wintab handle... */
|
||||
if (!hWintab)
|
||||
/* get wintab handle. */
|
||||
hWintab = LoadLibrary(szWintab);
|
||||
/* failsafe. */
|
||||
if (!LoadLibraryWorked(hWintab))
|
||||
return FALSE;
|
||||
|
||||
/* if not got a proc... */
|
||||
if (!crx && !cr) {
|
||||
/* try for portable version. */
|
||||
crx = (CRX)GetProcAddress(hWintab, "WTMgrConfigReplaceEx" CHARSET);
|
||||
/* if no portable version... */
|
||||
if (!crx)
|
||||
/* try for non-portable version. */
|
||||
cr = (CR)GetProcAddress(hWintab, "WTMgrConfigReplace");
|
||||
}
|
||||
/* failsafe. */
|
||||
if (!crx && !cr)
|
||||
return FALSE;
|
||||
|
||||
/* if portable version... */
|
||||
if (crx) {
|
||||
/* call it. */
|
||||
return crx(h, f, m, p);
|
||||
}
|
||||
else {
|
||||
/* convert arguments to call non-portable version. */
|
||||
static HMODULE curh = NULL;
|
||||
|
||||
/* if args and state legal for installing... */
|
||||
if (f && m && p && !curh) {
|
||||
/* try to get the library. */
|
||||
curh = LoadLibrary(m);
|
||||
/* if got library... */
|
||||
if (LoadLibraryWorked(curh)) {
|
||||
WTCONFIGPROC fp;
|
||||
|
||||
/* try to get the proc. */
|
||||
fp = (WTCONFIGPROC)GetProcAddress(curh, p);
|
||||
/* if got the proc... */
|
||||
if (fp) {
|
||||
/* call the non-portable function to install. */
|
||||
f = cr(h, f, fp);
|
||||
/* if install failed... */
|
||||
if (!f) {
|
||||
/* free library and reset our state. */
|
||||
FreeLibrary(curh);
|
||||
curh = NULL;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
else {
|
||||
/* no proc in the library -- free it and fail. */
|
||||
FreeLibrary(curh);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* couldn't load library -- fail. */
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else if (!f && curh) {
|
||||
/* args and state legal for removing -- try remove. */
|
||||
f = cr(h, f, NULL);
|
||||
/* if removal succeeded... */
|
||||
if (f) {
|
||||
/* free library and reset our state. */
|
||||
FreeLibrary(curh);
|
||||
curh = NULL;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
else {
|
||||
/* args or state illegal. */
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
UINT ScanExts(UINT wTag)
|
||||
{
|
||||
UINT i;
|
||||
UINT wScanTag;
|
||||
|
||||
/* scan for wTag's info category. */
|
||||
for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) {
|
||||
if (wTag == wScanTag) {
|
||||
/* return category offset from WTI_EXTENSIONS. */
|
||||
return i;
|
||||
}
|
||||
}
|
||||
/* return error code. */
|
||||
return 0xFFFF;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL ObtInit(void)
|
||||
{
|
||||
ObtCat = ScanExts(WTX_OBT);
|
||||
if (ObtCat == 0xFFFF)
|
||||
return FALSE;
|
||||
|
||||
ObtSize = WTInfo(WTI_EXTENSIONS + ObtCat, EXT_DEFAULT, NULL);
|
||||
if (ObtBuf = (BOOL *)LocalAlloc(LPTR, ObtSize)) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL ObtGet(UINT wDev)
|
||||
{
|
||||
WTInfo(WTI_EXTENSIONS + ObtCat, EXT_DEFAULT, ObtBuf);
|
||||
return ObtBuf[wDev];
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL ObtSet(UINT wDev, BOOL fOn)
|
||||
{
|
||||
ObtBuf[wDev] = fOn;
|
||||
return WTMgrExt(hMgr, WTX_OBT, ObtBuf);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
HANDLE hPrevInstance;
|
||||
LPSTR lpCmdLine;
|
||||
int nCmdShow;
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!hPrevInstance)
|
||||
if (!InitApplication(hInstance))
|
||||
return (FALSE);
|
||||
|
||||
/* Perform initializations that apply to a specific instance */
|
||||
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
return (FALSE);
|
||||
|
||||
/* Acquire and dispatch messages until a WM_QUIT message is received. */
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
return (msg.wParam);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitApplication(hInstance)
|
||||
HANDLE hInstance;
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
/* Fill in window class structure with parameters that describe the */
|
||||
/* main window. */
|
||||
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = MainWndProc;
|
||||
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(1 + COLOR_APPWORKSPACE);
|
||||
wc.lpszMenuName = "MgrTestMenu";
|
||||
wc.lpszClassName = "MgrTestWClass";
|
||||
|
||||
/* Register the window class and return success/failure code. */
|
||||
|
||||
return (RegisterClass(&wc));
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitInstance(hInstance, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
int nCmdShow;
|
||||
{
|
||||
HWND hWnd;
|
||||
HMENU hMenu, hCsrMenu;
|
||||
char *p;
|
||||
UINT size;
|
||||
int i;
|
||||
|
||||
/* Save the instance handle in static variable, which will be used in */
|
||||
/* many subsequence calls from this application to Windows. */
|
||||
|
||||
hInst = hInstance;
|
||||
|
||||
/* check if WinTab available. */
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
MessageBox(NULL, "WinTab Services Not Available.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a main window for this application instance. */
|
||||
|
||||
hWnd = CreateWindow(
|
||||
"MgrTestWClass",
|
||||
"MgrTest Sample Application",
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL
|
||||
);
|
||||
|
||||
/* If window could not be created, return "failure" */
|
||||
|
||||
if (!hWnd) {
|
||||
if (!hMgr)
|
||||
MessageBox(NULL, "Can't get Manager Handle.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* get device count. */
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &NDevices);
|
||||
|
||||
/* Tack on more menu items. */
|
||||
hMenu = GetSubMenu(GetMenu(hWnd), IDM_EDIT);
|
||||
|
||||
hCsrMenu = CreatePopupMenu();
|
||||
AppendMenu(hMenu, MF_POPUP, (UINT)hCsrMenu, "&Active Cursors");
|
||||
for (i = 0; size = WTInfo(WTI_CURSORS + i, CSR_NAME, NULL); i++) {
|
||||
if (p = (char *)LocalAlloc(LPTR, 1 + size)) {
|
||||
BOOL fActive;
|
||||
|
||||
p[0] = '&';
|
||||
WTInfo(WTI_CURSORS + i, CSR_NAME, p + 1);
|
||||
|
||||
AppendMenu(hCsrMenu, 0, IDM_CURSORS + i, p);
|
||||
LocalFree((HLOCAL)p);
|
||||
WTInfo(WTI_CURSORS + i, CSR_ACTIVE, &fActive);
|
||||
CheckMenuItem(hCsrMenu, IDM_CURSORS + i,
|
||||
(fActive ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
}
|
||||
|
||||
hObtMenu = NULL;
|
||||
if (ObtInit()) {
|
||||
if (NDevices > 1) {
|
||||
hObtMenu = CreatePopupMenu();
|
||||
ModifyMenu(hMenu, IDM_OBT, MF_POPUP, (UINT)hObtMenu,
|
||||
"&Out of Bounds Tracking");
|
||||
}
|
||||
else {
|
||||
CheckMenuItem(hMenu, IDM_OBT,
|
||||
(ObtGet(0) ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
}
|
||||
else {
|
||||
EnableMenuItem(hMenu, IDM_OBT, MF_GRAYED);
|
||||
}
|
||||
|
||||
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
|
||||
for (i = 0; size = WTInfo(WTI_DEVICES + i, DVC_NAME, NULL); i++) {
|
||||
static char suffix[] = " Settings...";
|
||||
|
||||
if (p = (char *)LocalAlloc(LPTR, 1 + size + sizeof(suffix))) {
|
||||
|
||||
p[0] = '&';
|
||||
WTInfo(WTI_DEVICES + i, DVC_NAME, p + 1);
|
||||
strtok(p, ";");
|
||||
|
||||
if (hObtMenu)
|
||||
AppendMenu(hObtMenu, (ObtGet(i) ? MF_CHECKED : MF_UNCHECKED),
|
||||
IDM_OBTDEVS + i, p);
|
||||
|
||||
strcat(p, suffix);
|
||||
|
||||
AppendMenu(hMenu, 0, IDM_DEVICES + i, p);
|
||||
LocalFree((HLOCAL)p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Make the window visible; update its client area; and return "success" */
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* statics for context list painting. */
|
||||
static int nLine = 0;
|
||||
static char buf[200];
|
||||
static SIZE szTextExtent = {0};
|
||||
static LOGCONTEXT lc;
|
||||
static char ownertext[40];
|
||||
static HCTX hCtxOrder[50];
|
||||
static int nCtxs = 0;
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FAR PASCAL Do1Context(HCTX hCtx, LPARAM lParam)
|
||||
{
|
||||
HDC hDC = (HDC)lParam;
|
||||
char *p = buf;
|
||||
HWND hOwner;
|
||||
char status[30] = "";
|
||||
unsigned len;
|
||||
|
||||
hCtxOrder[nLine] = hCtx;
|
||||
WTGet(hCtx, &lc);
|
||||
|
||||
/* Decode status */
|
||||
if( lc.lcStatus & CXS_DISABLED )
|
||||
strcpy( status, "Disabled," );
|
||||
if( lc.lcStatus & CXS_OBSCURED )
|
||||
strcat( status, "Obscured," );
|
||||
if( lc.lcStatus & CXS_ONTOP )
|
||||
strcat( status, "On Top," );
|
||||
len = strlen( status );
|
||||
if( len ) /* Get rid of the last comma */
|
||||
status[len-1] = 0;
|
||||
|
||||
hOwner = WTMgrContextOwner(hMgr, hCtx);
|
||||
GetWindowText(hOwner, ownertext, 40);
|
||||
TextOut(hDC, 0, nLine * szTextExtent.cy, status, len - 1); /* Display status information */
|
||||
_itoa( lc.lcDevice, status, 10 );
|
||||
TextOut(hDC, 17*szTextExtent.cx, nLine*szTextExtent.cy, status, strlen(status) );
|
||||
wsprintf(p, "%s:%s", (LPSTR)lc.lcName, (LPSTR)ownertext);
|
||||
TextOut(hDC, 19 * szTextExtent.cx, nLine++ * szTextExtent.cy, buf, strlen(buf)); /* Display context name */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL ListContexts(HDC hDC, PAINTSTRUCT *ps)
|
||||
{
|
||||
static char info[] = "To edit a context, click on it in the above list.";
|
||||
BOOL fResult;
|
||||
FARPROC fp;
|
||||
|
||||
if (!szTextExtent.cx)
|
||||
GetTextExtentPoint(hDC, "M", 1, &szTextExtent);
|
||||
nLine = 0;
|
||||
|
||||
SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT));
|
||||
SetBkColor(hDC, GetSysColor(COLOR_APPWORKSPACE));
|
||||
|
||||
fp = MakeProcInstance((FARPROC)Do1Context, hInst);
|
||||
fResult = WTMgrContextEnum(hMgr, (WTENUMPROC)fp, (LPARAM)hDC);
|
||||
FreeProcInstance(fp);
|
||||
|
||||
nCtxs = nLine;
|
||||
|
||||
|
||||
TextOut(hDC, 0, (1 + nLine) * szTextExtent.cy, info, strlen(info));
|
||||
return fResult;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX ListPoint(int y)
|
||||
{
|
||||
int n = y / szTextExtent.cy;
|
||||
return ( n < nCtxs ? hCtxOrder[n] : NULL);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL QueryKillCtx(HWND hWnd, HCTX hCtx)
|
||||
{
|
||||
static char msg[] =
|
||||
"Closing this context may cause the owning application %s to crash."
|
||||
"Do you want to close it anyway?";
|
||||
HWND hOwner;
|
||||
|
||||
hOwner = WTMgrContextOwner(hMgr, hCtx);
|
||||
if (IsWindow(hOwner)) {
|
||||
GetWindowText(hOwner, ownertext, 40);
|
||||
wsprintf(buf, msg, (LPSTR)ownertext);
|
||||
return (MessageBox(hWnd, buf, "MgrTest", MB_ICONSTOP|MB_OKCANCEL)==IDOK);
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
void set_default_device( HWND hWnd, int fSys )
|
||||
{
|
||||
int id;
|
||||
HCTX hCtx;
|
||||
FARPROC lpProcDlg;
|
||||
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hInst);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hInst, lpProcDlg, WTI_DEVICES);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
if( id >= 0 ) {
|
||||
LOGCONTEXT log;
|
||||
|
||||
/* Change the default device
|
||||
(the device that is used by WTI_DEFCONTEXT, WTI_DEFSYSCTX and WTMgrDefContext) */
|
||||
hCtx = WTMgrDefContextEx(hMgr, id, fSys);
|
||||
if( !hCtx ) {
|
||||
MessageBox(hWnd, "WTMgrDefContextEx failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
return;
|
||||
}
|
||||
if( !WTGet( hCtx, &log ) ) {
|
||||
MessageBox(hWnd, "WTGet failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
return;
|
||||
}
|
||||
hCtx = WTMgrDefContext(hMgr,fSys);
|
||||
if( !WTSet( hCtx, &log ) ) {
|
||||
MessageBox(hWnd, "WTSet failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Test that an innocent WTSet won't inadvertently change defalt_device */
|
||||
if( id > 0 ) {
|
||||
log.lcDevice = 0;
|
||||
hCtx = WTOpen(hWnd, &log, 0);
|
||||
if( !hCtx ) {
|
||||
MessageBox(hWnd, "WTOpen failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
return;
|
||||
}
|
||||
if( !WTSet(hCtx, &log) )
|
||||
MessageBox(hWnd, "WTSet failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
if( !WTClose(hCtx) )
|
||||
MessageBox(hWnd, "WTClose failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
|
||||
/* Test that the change was actually made */
|
||||
hCtx = WTMgrDefContext(hMgr, fSys);
|
||||
if( !WTGet( hCtx, &log ) ) {
|
||||
MessageBox(hWnd, "WTGet failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
return;
|
||||
}
|
||||
if( (int)log.lcDevice == id )
|
||||
MessageBox(hWnd, "Default device changed.", "MgrTest", MB_ICONINFORMATION | MB_OK);
|
||||
else
|
||||
MessageBox(hWnd, "Default device not changed properly.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL
|
||||
CALLBACK ctx_edit_DlgProc( HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam )
|
||||
{
|
||||
BOOL fResult;
|
||||
|
||||
switch( Msg ) {
|
||||
case WM_COMMAND:
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
default:
|
||||
fResult = FALSE;
|
||||
}
|
||||
return fResult;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* If we can't link WTMgrDefContextEx(), use this instead */
|
||||
HCTX API autofail(HMGR a, UINT b, BOOL c)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
LRESULT FAR PASCAL MainWndProc(hWnd, message, wParam, lParam)
|
||||
HWND hWnd;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
HCTX hCtx;
|
||||
FARPROC lpProcDlg;
|
||||
LRESULT lResult = 0;
|
||||
static BOOL fCBRTest = FALSE;
|
||||
BOOL fEnable;
|
||||
HMENU hMenu;
|
||||
int i;
|
||||
WORD id,specver;
|
||||
HMODULE hModule;
|
||||
|
||||
switch (message) {
|
||||
case WM_CREATE:
|
||||
hMgr = WTMgrOpen(hWnd, WT_DEFBASE);
|
||||
if( !hMgr )
|
||||
MessageBox(hWnd, "WTMgrOpen failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
lResult = !!hMgr - 1;
|
||||
|
||||
|
||||
/* Try to link WTMgrDefContextEx() */
|
||||
hModule = GetModuleHandle(
|
||||
#ifdef _WIN32
|
||||
"wintab32.dll"
|
||||
#else
|
||||
"wintab.dll"
|
||||
#endif
|
||||
);
|
||||
(FARPROC)pWTMgrDefContextEx = GetProcAddress( hModule, "WTMgrDefContextEx" );
|
||||
if( !pWTMgrDefContextEx ) {
|
||||
/* Disable features which depend on WTMgrDefContextEx */
|
||||
pWTMgrDefContextEx = autofail;
|
||||
EnableWindow( GetDlgItem(hWnd, IDM_DEFDEV_DIG), FALSE );
|
||||
EnableWindow( GetDlgItem(hWnd, IDM_DEFDEV_SYS), FALSE );
|
||||
}
|
||||
break;
|
||||
|
||||
case WT_CTXOPEN:
|
||||
case WT_CTXCLOSE:
|
||||
case WT_CTXUPDATE:
|
||||
case WT_CTXOVERLAP:
|
||||
case WT_PROXIMITY:
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
break;
|
||||
|
||||
case WT_INFOCHANGE:
|
||||
FlashWindow(hWnd, TRUE);
|
||||
hMenu = GetSubMenu(GetSubMenu(GetMenu(hWnd),IDM_EDIT), IDM_CSRMENU);
|
||||
if (hMenu) {
|
||||
for (i = 0; WTInfo(WTI_CURSORS+i, CSR_ACTIVE, &fEnable); i++) {
|
||||
CheckMenuItem(hMenu, IDM_CURSORS + i,
|
||||
(fEnable ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
}
|
||||
FlashWindow(hWnd, FALSE);
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
hCtx = ListPoint(HIWORD(lParam));
|
||||
|
||||
if( hCtx ) {
|
||||
LOGCONTEXT lc;
|
||||
|
||||
lpProcDlg = MakeProcInstance(ctx_edit_DlgProc, hInst);
|
||||
id = DialogBox(hInst, MAKEINTRESOURCE(IDD_CTXEDIT), hWnd, lpProcDlg);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
switch( id ) {
|
||||
case IDC_WTCONFIG:
|
||||
WTConfig(hCtx, hWnd);
|
||||
break;
|
||||
|
||||
case IDC_BUTTONS:
|
||||
WTGet(hCtx, &lc);
|
||||
set_ctx_BtnMask(hWnd, hCtx, &lc);
|
||||
break;
|
||||
|
||||
case IDC_MOVEMASK:
|
||||
set_ctx_MoveMask(hWnd, hMgr, hCtx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
hCtx = ListPoint(HIWORD(lParam));
|
||||
if (QueryKillCtx(hWnd, hCtx)) {
|
||||
WTClose(hCtx);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case WM_PAINT:
|
||||
if (hMgr) {
|
||||
HDC hDC;
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
hDC = BeginPaint(hWnd, &ps);
|
||||
|
||||
ListContexts(hDC, &ps);
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
id = GET_WM_COMMAND_ID(wParam, lParam);
|
||||
|
||||
if (id >= IDM_DEVICES &&
|
||||
WTInfo(WTI_DEVICES + id - IDM_DEVICES, DVC_NAME, NULL))
|
||||
{
|
||||
WTMgrDeviceConfig(hMgr, id - IDM_DEVICES, hWnd);
|
||||
}
|
||||
|
||||
if (id >= IDM_CURSORS &&
|
||||
WTInfo(WTI_CURSORS+id-IDM_CURSORS, CSR_ACTIVE, &fEnable))
|
||||
{
|
||||
fEnable ^= WTMgrCsrEnable(hMgr, id - IDM_CURSORS, !fEnable);
|
||||
hMenu = GetSubMenu(GetSubMenu(GetMenu(hWnd), IDM_EDIT),
|
||||
IDM_CSRMENU);
|
||||
CheckMenuItem(hMenu, id,
|
||||
(fEnable ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
|
||||
if (id >= IDM_OBTDEVS &&
|
||||
id < (WORD)(IDM_OBTDEVS + NDevices)) {
|
||||
|
||||
/* one of multiple devices. */
|
||||
ObtSet(id - IDM_OBTDEVS, !ObtGet(id - IDM_OBTDEVS));
|
||||
CheckMenuItem(hObtMenu, id,
|
||||
(ObtGet(0) ? MF_CHECKED : MF_UNCHECKED));
|
||||
}
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case IDM_ABOUT:
|
||||
lpProcDlg = MakeProcInstance(About, hInst);
|
||||
DialogBox(hInst, "AboutBox", hWnd, lpProcDlg);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
break;
|
||||
|
||||
case IDM_BUTTMAPS:
|
||||
lpProcDlg = MakeProcInstance(ButtonDlgProc, hInst);
|
||||
DialogBox(hInst, MAKEINTRESOURCE(IDD_BUTTONS),
|
||||
hWnd, lpProcDlg);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
break;
|
||||
|
||||
case IDM_XBUTTMAPS:
|
||||
set_xBtnMap( hWnd, hMgr );
|
||||
break;
|
||||
|
||||
case IDM_OBT:
|
||||
/* only one device present. */
|
||||
ObtSet(0, !ObtGet(0));
|
||||
hMenu = GetSubMenu(GetMenu(hWnd), IDM_EDIT);
|
||||
CheckMenuItem(hMenu, id,
|
||||
(ObtGet(0) ? MF_CHECKED : MF_UNCHECKED));
|
||||
break;
|
||||
|
||||
case IDM_DEFDIG:
|
||||
|
||||
/* Open a dialog to choose which device to use, if nessicary */
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hInst);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hWnd, lpProcDlg, WTI_DDCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
/* Open the Wintab context config dialog */
|
||||
if (id >= 0) {
|
||||
int numDevices;
|
||||
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( id < numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, id, 0);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, 0);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, 0);
|
||||
|
||||
if( hCtx )
|
||||
WTConfig(hCtx, hWnd);
|
||||
else
|
||||
MessageBox(hWnd, "WTMgrDefContext failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case IDM_DEFSYS:
|
||||
|
||||
/* Open a dialog to choose which device to use, if nessicary */
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hInst);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hInst, lpProcDlg, WTI_DSCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
/* Open the Wintab context dialog */
|
||||
if (id >= 0) {
|
||||
int numDevices;
|
||||
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( id < numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, id, 1);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, 1);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, 1);
|
||||
/* 'Default Device' was the last choice in the dialog */
|
||||
|
||||
if( hCtx )
|
||||
WTConfig(hCtx, hWnd);
|
||||
else
|
||||
MessageBox(hWnd, "WTMgrDefContext failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case IDM_RESET_DEFDIG:
|
||||
//Check for version 1.1
|
||||
WTInfo(WTI_INTERFACE,IFC_SPECVERSION,&specver);
|
||||
if( ( HIBYTE(specver)>=1) && ( LOBYTE(specver)>=1)){
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hInst);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hInst, lpProcDlg, WTI_DDCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
if (id >= 0) {
|
||||
int numDevices;
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( id < numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, id, 0);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, 0);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, 0);
|
||||
|
||||
if( hCtx ) {
|
||||
if( WTSet(hCtx, 0) )
|
||||
MessageBox(hWnd, "Error! WTSet(hCtx, 0)"
|
||||
"returned success.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
if( !WTSet(hCtx, WTP_LPDEFAULT) )
|
||||
MessageBox(hWnd, "WTSet failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
else
|
||||
MessageBox(hWnd, "WTSet succeeded.", "MgrTest",
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
}else
|
||||
MessageBox(hWnd, "WTMgrDefContext failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
}
|
||||
}else
|
||||
MessageBox(hWnd, "This feature is only supported in "
|
||||
"devices using Wintab specification 1.1 and later.",
|
||||
"MgrTest", MB_ICONHAND | MB_OK);
|
||||
break;
|
||||
|
||||
|
||||
case IDM_RESET_DEFSYS:
|
||||
//Check for version 1.1
|
||||
WTInfo(WTI_INTERFACE,IFC_SPECVERSION,&specver);
|
||||
if( ( HIBYTE(specver)>=1) && ( LOBYTE(specver)>=1)){
|
||||
lpProcDlg = MakeProcInstance(CursInfoDlgProc, hInst);
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INFOLIST),
|
||||
hInst, lpProcDlg, WTI_DSCTXS);
|
||||
FreeProcInstance(lpProcDlg);
|
||||
|
||||
if (id >= 0) {
|
||||
int numDevices;
|
||||
WTInfo(WTI_INTERFACE, IFC_NDEVICES, &numDevices);
|
||||
|
||||
if( id < numDevices ) {
|
||||
hCtx = WTMgrDefContextEx(hMgr, id, 1);
|
||||
if( !hCtx )
|
||||
hCtx = WTMgrDefContext(hMgr, 1);
|
||||
} else
|
||||
hCtx = WTMgrDefContext(hMgr, 1);
|
||||
if( hCtx ) {
|
||||
if( WTSet(hCtx, 0) )
|
||||
MessageBox(hWnd, "Error! WTSet(hCtx, 0) "
|
||||
"returned success.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
if( !WTSet(hCtx, WTP_LPDEFAULT) )
|
||||
MessageBox(hWnd, "WTSet failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
else
|
||||
MessageBox(hWnd, "WTSet succeeded.", "MgrTest",
|
||||
MB_OK | MB_ICONINFORMATION);
|
||||
} else
|
||||
MessageBox(hWnd, "WTMgrDefContext failed.", "MgrTest",
|
||||
MB_ICONHAND | MB_OK);
|
||||
}
|
||||
}else
|
||||
MessageBox(hWnd, "This feature is only supported in "
|
||||
"devices using Wintab specification 1.1 and later.",
|
||||
"MgrTest", MB_ICONHAND | MB_OK);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case IDM_DEFDEV_DIG:
|
||||
//Check for version 1.1
|
||||
WTInfo(WTI_INTERFACE,IFC_SPECVERSION,&specver);
|
||||
if( ( HIBYTE(specver)>=1) && ( LOBYTE(specver)>=1)){
|
||||
set_default_device( hWnd, 0 );
|
||||
}else{
|
||||
MessageBox(hWnd, "This feature is only supported in "
|
||||
"devices using Wintab specification 1.1 and later.",
|
||||
"MgrTest", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
break;
|
||||
case IDM_DEFDEV_SYS:
|
||||
//Check for version 1.1
|
||||
WTInfo(WTI_INTERFACE,IFC_SPECVERSION,&specver);
|
||||
if( ( HIBYTE(specver)>=1) && ( LOBYTE(specver)>=1)){
|
||||
set_default_device( hWnd, 1 );
|
||||
}else{
|
||||
MessageBox(hWnd, "This feature is only supported in "
|
||||
"devices using Wintab specification 1.1 and later.",
|
||||
"MgrTest", MB_ICONHAND | MB_OK);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_CSRMASK_DIG:
|
||||
set_default_CsrMask( hWnd, hMgr, 0 );
|
||||
break;
|
||||
|
||||
case IDM_CSRMASK_SYS:
|
||||
set_default_CsrMask( hWnd, hMgr, 1 );
|
||||
break;
|
||||
|
||||
case IDM_XBTN_DIG:
|
||||
set_default_BtnMask( hWnd, hMgr, 0 );
|
||||
break;
|
||||
case IDM_XBTN_SYS:
|
||||
set_default_BtnMask( hWnd, hMgr, 1 );
|
||||
break;
|
||||
|
||||
case IDM_CBRTEST:
|
||||
if (ConfigReplace(hMgr, !fCBRTest,
|
||||
"MgrDLL.DLL", "CBRTestProc")) {
|
||||
fCBRTest = !fCBRTest;
|
||||
}
|
||||
CheckMenuItem(GetSubMenu(GetMenu(hWnd), IDM_TEST),
|
||||
IDM_CBRTEST, (fCBRTest ? MF_CHECKED : MF_UNCHECKED));
|
||||
break;
|
||||
|
||||
case IDM_BMSTEST:
|
||||
BMSTest(hWnd);
|
||||
break;
|
||||
|
||||
case IDM_PMSTEST:
|
||||
PMSTest(hWnd);
|
||||
break;
|
||||
|
||||
case IDM_PRSTEST:
|
||||
PRSTest(hWnd);
|
||||
break;
|
||||
|
||||
case IDM_HMGRTEST:
|
||||
HMGRTest(hWnd);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (fCBRTest) {
|
||||
ConfigReplace(hMgr, FALSE, NULL, NULL);
|
||||
}
|
||||
if (hMgr)
|
||||
WTMgrClose(hMgr);
|
||||
if (LoadLibraryWorked(hWintab))
|
||||
FreeLibrary(hWintab);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
return lResult;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FAR PASCAL About(hDlg, message, wParam, lParam)
|
||||
HWND hDlg;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDOK
|
||||
|| GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) {
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
70
public/wintab/examples/mgrtest/mgrtest.h
Normal file
70
public/wintab/examples/mgrtest/mgrtest.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#include <wintab.h>
|
||||
|
||||
#define IDM_TEST 0
|
||||
#define IDM_EDIT 1
|
||||
#define IDM_DEFCTX 2
|
||||
#define IDM_DEFSCTX 3
|
||||
#define IDM_HELP 4
|
||||
|
||||
#define IDM_CSRMENU 3
|
||||
|
||||
#define IDM_ABOUT 10
|
||||
#define IDM_DEFDIG 11
|
||||
#define IDM_DEFSYS 12
|
||||
#define IDM_CBRTEST 13
|
||||
#define IDM_BMSTEST 14
|
||||
#define IDM_PMSTEST 15
|
||||
#define IDM_PRSTEST 16
|
||||
#define IDM_BUTTMAPS 17
|
||||
#define IDM_OBT 18
|
||||
#define IDM_DEVICES 20
|
||||
#define IDM_CURSORS 30
|
||||
#define IDM_OBTDEVS 40
|
||||
#define IDM_RESET_DEFDIG 40005
|
||||
#define IDM_RESET_DEFSYS 40006
|
||||
#define IDM_HMGRTEST 40007
|
||||
#define IDM_DEFDEV_DIG 40009
|
||||
#define IDM_DEFDEV_SYS 40010
|
||||
#define IDM_XBTN_DIG 40011
|
||||
#define IDM_XBTN_SYS 40012
|
||||
#define IDM_CSRMASK_DIG 40013
|
||||
#define IDM_CSRMASK_SYS 40014
|
||||
|
||||
/* For IDD_INFOLIST */
|
||||
#define LBC_TITLE 3
|
||||
#define LBC_LISTBOX 4
|
||||
#define LBC_BASECAT 5
|
||||
|
||||
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
LRESULT FAR PASCAL MainWndProc(HWND, unsigned, WPARAM, LPARAM);
|
||||
BOOL FAR PASCAL About(HWND, unsigned, WPARAM, LPARAM);
|
||||
|
||||
/* If the exe imports WTMgrDefContextEx(), then we won't be able to run with
|
||||
older Wintab.dll/Wintab32.dll's which are don't support Wintab Spec 1.1.
|
||||
Instead, we'll try to GetProcAddress it ourselves. On failure, just disable
|
||||
features that depend on it. */
|
||||
extern HCTX (API * pWTMgrDefContextEx)(HMGR, UINT, BOOL);
|
||||
#define WTMgrDefContextEx( a, b, c ) pWTMgrDefContextEx( (a), (b), (c) )
|
||||
|
||||
|
||||
BOOL CALLBACK CursInfoDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam);
|
||||
void set_ctx_BtnMask( HWND hWnd, HCTX hCtx, LOGCONTEXT * lc );
|
||||
void set_ctx_MoveMask( HWND hWnd, HMGR hMgr, HCTX hCtx );
|
||||
|
||||
/* tests.c */
|
||||
void BMSTest(HWND hWnd);
|
||||
void PMSTest(HWND hWnd);
|
||||
void PRSTest(HWND hWnd);
|
||||
void HMGRTest(HWND hWnd);
|
||||
|
||||
/* test_bitboxes() - use a static text box for selecting/changing a list of bits, hex bytes,
|
||||
or other evenly spaced things. */
|
||||
/* LOWORD(pos) = x coord */
|
||||
/* HIWORD(pos) = y coord */
|
||||
/* box_id = an array of dialog ID's, one for each box */
|
||||
/* ndiv = number of divisions per box */
|
||||
/* nboxes = number of boxes */
|
||||
/* return value = selection number or -1 if point is outside of all boxes */
|
||||
int test_bitboxes( HWND hDlg, unsigned long pos, unsigned ndiv, int nboxes, const int *box_id );
|
||||
416
public/wintab/examples/mgrtest/mgrtest.rc
Normal file
416
public/wintab/examples/mgrtest/mgrtest.rc
Normal file
@@ -0,0 +1,416 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "mgrtest.h"
|
||||
#include "mgrdlg.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
MGRTESTMENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Test"
|
||||
BEGIN
|
||||
MENUITEM "&Config Box Replacement", IDM_CBRTEST
|
||||
MENUITEM "Pressure Button &Marks Setting", IDM_PMSTEST
|
||||
MENUITEM "Pressure &Response Setting", IDM_PRSTEST
|
||||
MENUITEM "&Old Handle Test", IDM_HMGRTEST
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
POPUP "&Default Contexts"
|
||||
BEGIN
|
||||
MENUITEM "&Digitizing...", IDM_DEFDIG
|
||||
MENUITEM "&System...", IDM_DEFSYS
|
||||
END
|
||||
POPUP "&Reset Default Context"
|
||||
BEGIN
|
||||
MENUITEM "&Digitizing...", IDM_RESET_DEFDIG
|
||||
MENUITEM "&System...", IDM_RESET_DEFSYS
|
||||
END
|
||||
POPUP "Set Default De&vice"
|
||||
BEGIN
|
||||
MENUITEM "&Digitizing...", IDM_DEFDEV_DIG
|
||||
MENUITEM "&System...", IDM_DEFDEV_SYS
|
||||
END
|
||||
POPUP "Set &CsrMask"
|
||||
BEGIN
|
||||
MENUITEM "&Digitizing...", IDM_CSRMASK_DIG
|
||||
MENUITEM "&System...", IDM_CSRMASK_SYS
|
||||
END
|
||||
POPUP "Set &xBtnMask"
|
||||
BEGIN
|
||||
MENUITEM "&Digitizing...", IDM_XBTN_DIG
|
||||
MENUITEM "&System...", IDM_XBTN_SYS
|
||||
END
|
||||
MENUITEM "Cursor &Button Maps", IDM_BUTTMAPS
|
||||
MENUITEM "Extended Cursor Button Maps", IDM_XBUTTMAPS
|
||||
MENUITEM "&Out of Bounds Tracking", IDM_OBT
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About MgrTest...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_INFOLIST DIALOG DISCARDABLE 76, 28, 199, 132
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "%s Choice"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
LTEXT " %s to Use:",LBC_TITLE,24,6,126,12
|
||||
CONTROL "",-1,"Static",SS_BLACKFRAME,24,4,146,16
|
||||
PUSHBUTTON "OK",IDOK,24,104,40,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,130,104,40,14
|
||||
LISTBOX LBC_LISTBOX,24,30,146,58,LBS_SORT | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Hide me!",LBC_BASECAT,78,104,36,8,NOT WS_VISIBLE |
|
||||
WS_DISABLED
|
||||
END
|
||||
|
||||
ABOUTBOX DIALOG DISCARDABLE 22, 17, 144, 95
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About MgrTest"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
CTEXT "Microsoft Windows",IDC_STATIC,0,5,144,8
|
||||
CTEXT "MgrTest Application",IDC_STATIC,0,14,144,8
|
||||
CTEXT "Version 3.01",IDC_STATIC,0,30,144,8
|
||||
DEFPUSHBUTTON "OK",IDOK,55,70,32,14,WS_GROUP
|
||||
LTEXT "Copyright 1998 LCS/Telegraphics",IDC_STATIC,17,48,110,
|
||||
10
|
||||
END
|
||||
|
||||
IDD_BUTTONS DIALOG DISCARDABLE 105, 65528, 145, 205
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Cursor/Button Settings"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
LTEXT "&Cursor",-1,12,9,22,8
|
||||
COMBOBOX IDC_CURSORS,12,18,120,53,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "Physical &Buttons",-1,12,33,55,8
|
||||
COMBOBOX IDC_NAMES,12,42,120,53,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "&Logical Buttons",-1,12,77,55,8
|
||||
COMBOBOX IDC_LOGICAL,12,86,120,53,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "&Mouse Action",-1,12,123,55,8
|
||||
COMBOBOX IDC_MOUSE,12,132,120,53,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
LTEXT "&Pen Action",-1,12,147,37,8
|
||||
COMBOBOX IDC_PEN,12,156,120,53,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "OK",IDOK,6,185,40,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,52,185,40,14,WS_GROUP
|
||||
PUSHBUTTON "&Default",IDC_DEFAULT,98,185,40,14,WS_GROUP
|
||||
CONTROL "",107,"Static",SS_BLACKFRAME,6,6,132,55
|
||||
CONTROL "",108,"Static",SS_BLACKFRAME,6,74,132,32
|
||||
CONTROL "",109,"Static",SS_BLACKFRAME,6,120,132,56
|
||||
END
|
||||
|
||||
IDD_BTNMASKS DIALOG DISCARDABLE 27, 41, 227, 317
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Button Packet Masks"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&OK",IDOK,175,10,40,14,WS_GROUP
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,175,36,40,14
|
||||
GROUPBOX "xBtnMask Release Events",XBU_BOX,10,199,145,100,
|
||||
WS_GROUP
|
||||
GROUPBOX "xBtnMask Press Events",XBD_BOX,10,90,145,100,WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY1,20,105,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY2,20,115,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY3,20,125,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY4,20,135,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY5,20,145,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY6,20,155,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY7,20,165,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBD_DISPLAY8,20,175,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY1,20,215,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY2,20,224,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY3,20,233,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY4,20,242,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY5,20,251,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY6,20,260,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY7,20,269,
|
||||
130,8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",XBU_DISPLAY8,20,278,
|
||||
130,8,NOT WS_GROUP
|
||||
GROUPBOX "BtnMask Press Events",IDC_STATIC,10,10,145,30
|
||||
LTEXT "00000000000000000000000000000000",BND_DISPLAY,20,25,130,
|
||||
8,NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",BNU_DISPLAY,20,65,130,
|
||||
8,NOT WS_GROUP
|
||||
GROUPBOX "BtnMask Release Events",IDC_STATIC,10,50,145,30
|
||||
END
|
||||
|
||||
IDD_CSRMASKS DIALOG DISCARDABLE 27, 41, 227, 201
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Cursor Packet Mask"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&OK",IDOK,175,10,40,14,WS_GROUP
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,175,36,40,14
|
||||
GROUPBOX "CsrMask",-1,10,10,150,175
|
||||
LTEXT "00000000000000000000000000000000",IDC_TEXT1,20,25,130,8,
|
||||
NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",IDC_TEXT2,20,33,130,8,
|
||||
NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",IDC_TEXT3,20,41,130,8,
|
||||
NOT WS_GROUP
|
||||
LTEXT "00000000000000000000000000000000",IDC_TEXT4,20,49,130,8,
|
||||
NOT WS_GROUP
|
||||
LISTBOX IDC_CSRLST,20,71,130,103,LBS_MULTIPLESEL |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL
|
||||
END
|
||||
|
||||
IDD_XBUTTONS DIALOG DISCARDABLE 0, 0, 275, 317
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Extended Button Map"
|
||||
FONT 9, "Fixedsys"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,218,8,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,218,24,50,14
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_1,17,18,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_2,17,26,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_3,17,34,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_4,17,42,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_5,17,50,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_6,17,58,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_7,17,66,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_8,17,74,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_9,17,82,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_10,17,90,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_11,17,98,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_12,17,106,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_13,17,114,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_14,17,122,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_15,17,130,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_SYS_16,17,138,189,8
|
||||
GROUPBOX "System Button Map",IDC_STATIC,7,8,206,146
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_1,17,176,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_2,17,184,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_3,17,192,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_4,17,200,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_5,17,208,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_6,17,216,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_7,17,224,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_8,17,232,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_9,17,240,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_10,17,248,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_11,17,256,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_12,17,264,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_13,17,272,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_14,17,280,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_15,17,288,189,8
|
||||
LTEXT "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f",
|
||||
IDC_LOG_16,17,296,189,8
|
||||
GROUPBOX "Logical Button Map",IDC_STATIC,7,166,206,144
|
||||
END
|
||||
|
||||
IDD_VALUE DIALOG DISCARDABLE 0, 0, 186, 46
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Change Value"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
|
||||
EDITTEXT IDC_EDIT,74,16,30,12,ES_AUTOHSCROLL
|
||||
LTEXT "Enter value:",IDC_STATIC,19,17,39,8
|
||||
END
|
||||
|
||||
IDD_CTXEDIT DIALOG DISCARDABLE 0, 0, 87, 66
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Edit Context"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
PUSHBUTTON "WTConfig",IDC_WTCONFIG,10,10,65,15
|
||||
PUSHBUTTON "Edit Button Masks",IDC_BUTTONS,10,25,65,15
|
||||
PUSHBUTTON "Edit Move Mask",IDC_MOVEMASK,10,40,65,15
|
||||
END
|
||||
|
||||
IDD_MOVEMASK DIALOG DISCARDABLE 27, 41, 227, 201
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
CAPTION "Cursor Packet Mask"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "&OK",IDOK,175,10,40,14,WS_GROUP
|
||||
PUSHBUTTON "&Cancel",IDCANCEL,175,36,40,14
|
||||
GROUPBOX "Move Mask",-1,10,10,150,150
|
||||
LTEXT "00000000000000000000000000000000",IDC_MMTEXT,20,25,130,
|
||||
8,NOT WS_GROUP
|
||||
LISTBOX IDC_LST,20,45,130,103,LBS_MULTIPLESEL |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Data
|
||||
//
|
||||
|
||||
DLGINCLUDE RCDATA DISCARDABLE
|
||||
BEGIN
|
||||
"MGRDLG.H\0"
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""mgrtest.h""\r\n"
|
||||
"#include ""mgrdlg.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_BTNMASKS, DIALOG
|
||||
BEGIN
|
||||
BOTTOMMARGIN, 205
|
||||
END
|
||||
|
||||
IDD_XBUTTONS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 268
|
||||
TOPMARGIN, 8
|
||||
BOTTOMMARGIN, 310
|
||||
END
|
||||
|
||||
IDD_VALUE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 179
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 39
|
||||
END
|
||||
|
||||
IDD_CTXEDIT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 80
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 59
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
153
public/wintab/examples/mgrtest/movemask.c
Normal file
153
public/wintab/examples/mgrtest/movemask.c
Normal file
@@ -0,0 +1,153 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include "wintab.h"
|
||||
|
||||
#include "Mgrtest.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
static const unsigned textfield[1] = { IDC_MMTEXT };
|
||||
static const char * pk_tags[] = {
|
||||
"PK_CONTEXT", "PK_STATUS", "PK_TIME", "PK_CHANGED", "PK_SERIAL_NUMBER", "PK_CURSOR", "PK_BUTTONS",
|
||||
"PK_X", "PK_Y", "PK_Z", "PK_NORMAL_PRESSURE", "PK_TANGENT_PRESSURE", "PK_ORIENTATION", "PK_ROTATION", 0 };
|
||||
extern HANDLE hInst;
|
||||
|
||||
|
||||
static void MoveMask_DisplayBits( HWND hDlg, DWORD MoveMask )
|
||||
{
|
||||
char buf[33];
|
||||
unsigned j;
|
||||
|
||||
buf[32] = 0;
|
||||
|
||||
for( j = 0; j < 32; j++ )
|
||||
buf[j] = '0' + (char)((MoveMask >> j) & 0x01);
|
||||
|
||||
SetWindowText(GetDlgItem(hDlg, IDC_MMTEXT), buf);
|
||||
}
|
||||
|
||||
BOOL
|
||||
CALLBACK MoveMask_DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
static DWORD * MoveMask;
|
||||
|
||||
BOOL fResult;
|
||||
|
||||
int i;
|
||||
LRESULT val;
|
||||
|
||||
switch (Msg) {
|
||||
case WM_INITDIALOG:
|
||||
MoveMask = (DWORD *)lParam;
|
||||
|
||||
/* List the available cursors, and highlight them if their Csrmask bits are set */
|
||||
i = 0;
|
||||
while( pk_tags[i] != NULL ) {
|
||||
SendDlgItemMessage( hDlg, IDC_LST, LB_ADDSTRING, 0, (LPARAM)((char far *)pk_tags[i]) );
|
||||
i++;
|
||||
}
|
||||
|
||||
/* for Unknown Reason, sending LB_SETSEL right after LB_ADDSTRING doesn't work reliably */
|
||||
i = 0;
|
||||
while( pk_tags[i] != NULL ) {
|
||||
/* Highlight the name in the selection box */
|
||||
SendDlgItemMessage( hDlg, IDC_LST, LB_SETSEL, (WPARAM)((*MoveMask >> i) & 0x01), i );
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Display the Csrmask bitfield bits */
|
||||
MoveMask_DisplayBits( hDlg, *MoveMask );
|
||||
|
||||
fResult = TRUE;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
/* If clicked on a number in IDC_TEXT?, then change it's corrisponding bit */
|
||||
i = test_bitboxes( hDlg, lParam, 32, 1, textfield );
|
||||
|
||||
if( i > -1 ) {
|
||||
/* Flip the bit */
|
||||
*MoveMask ^= 1 << i;
|
||||
MoveMask_DisplayBits( hDlg, *MoveMask );
|
||||
|
||||
/* Highlight the corrisponding cursor in the listbox appropriately */
|
||||
SendDlgItemMessage( hDlg, IDC_LST, LB_SETSEL, (WPARAM)((*MoveMask >> i) & 0x01), i );
|
||||
}
|
||||
fResult = TRUE;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
switch( wParam ) {
|
||||
case IDOK:
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, wParam);
|
||||
fResult = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
if( HIWORD(wParam) == LBN_SELCHANGE || wParam == IDC_LST ) {
|
||||
/* Set all of the bits according to the selection box selections until error */
|
||||
i = 0;
|
||||
fResult = FALSE;
|
||||
while( !fResult ) {
|
||||
val = SendMessage( (HWND)lParam, LB_GETSEL, i, 0 );
|
||||
if( val > 0 )
|
||||
*MoveMask |= 1 << i;
|
||||
else
|
||||
if( val == 0 )
|
||||
*MoveMask &= ~(1 << i);
|
||||
else
|
||||
fResult = TRUE;
|
||||
if( i == 31 )
|
||||
fResult = TRUE;
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Redisplay the bits */
|
||||
MoveMask_DisplayBits( hDlg, *MoveMask );
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fResult = FALSE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
void
|
||||
set_ctx_MoveMask( HWND hWnd, HMGR hMgr, HCTX hCtx )
|
||||
{
|
||||
FARPROC fpProc;
|
||||
int id;
|
||||
LOGCONTEXT lc;
|
||||
|
||||
/* Read the button masks */
|
||||
if( !WTGet( hCtx, &lc ) ) {
|
||||
MessageBox( hWnd, "WTGet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
return;
|
||||
}
|
||||
|
||||
/* Do the button bit dialog */
|
||||
fpProc = MakeProcInstance( (FARPROC)MoveMask_DlgProc, hInst );
|
||||
id = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_MOVEMASK), hWnd, fpProc, (LPARAM)((DWORD FAR *)&lc.lcMoveMask));
|
||||
FreeProcInstance(fpProc);
|
||||
|
||||
/* Set the new button masks */
|
||||
if( id == IDOK ) {
|
||||
if( !WTSet( hCtx, &lc ) )
|
||||
MessageBox( hWnd, "WTSet failed.", "MgrTest", MB_ICONHAND | MB_OK );
|
||||
}
|
||||
}
|
||||
23
public/wintab/examples/mgrtest/msgpack.h
Normal file
23
public/wintab/examples/mgrtest/msgpack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ------------------------------- msgpack.h -------------------------------- */
|
||||
/*------------------------------------------------------------------------------
|
||||
Selected message unpacking macros from windowsx.h
|
||||
to circumvent compile-time memory headaches.
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#else
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#endif
|
||||
|
||||
71
public/wintab/examples/mgrtest/resource.h
Normal file
71
public/wintab/examples/mgrtest/resource.h
Normal file
@@ -0,0 +1,71 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by mgrtest.rc
|
||||
//
|
||||
#define IDD_INFOLIST 103
|
||||
#define IDD_XBUTTONS 105
|
||||
#define IDD_VALUE 106
|
||||
#define IDD_CTXEDIT 107
|
||||
#define XBU_BOX 168
|
||||
#define XBD_BOX 169
|
||||
#define IDD_CSRMASKS 601
|
||||
#define IDD_MOVEMASK 602
|
||||
#define BND_DISPLAY 685
|
||||
#define BNU_DISPLAY 686
|
||||
#define IDC_TEXT2 686
|
||||
#define IDC_TEXT3 687
|
||||
#define IDC_TEXT4 688
|
||||
#define IDC_TEXT1 1002
|
||||
#define IDC_CSRLST 1003
|
||||
#define IDC_SYS_1 1004
|
||||
#define IDC_SYS_2 1005
|
||||
#define IDC_SYS_3 1006
|
||||
#define IDC_SYS_4 1007
|
||||
#define IDC_SYS_5 1008
|
||||
#define IDC_SYS_6 1009
|
||||
#define IDC_SYS_7 1010
|
||||
#define IDC_SYS_8 1011
|
||||
#define IDC_SYS_9 1012
|
||||
#define IDC_SYS_10 1013
|
||||
#define IDC_SYS_11 1014
|
||||
#define IDC_SYS_12 1015
|
||||
#define IDC_SYS_13 1016
|
||||
#define IDC_SYS_14 1017
|
||||
#define IDC_SYS_15 1018
|
||||
#define IDC_SYS_16 1019
|
||||
#define IDC_LOG_1 1020
|
||||
#define IDC_LOG_2 1021
|
||||
#define IDC_LOG_3 1022
|
||||
#define IDC_LOG_4 1023
|
||||
#define IDC_LOG_5 1024
|
||||
#define IDC_LOG_6 1025
|
||||
#define IDC_LOG_7 1026
|
||||
#define IDC_LOG_8 1027
|
||||
#define IDC_LOG_9 1028
|
||||
#define IDC_LOG_10 1029
|
||||
#define IDC_LOG_11 1030
|
||||
#define IDC_LOG_12 1031
|
||||
#define IDC_LOG_13 1032
|
||||
#define IDC_LOG_14 1033
|
||||
#define IDC_LOG_15 1034
|
||||
#define IDC_LOG_16 1035
|
||||
#define IDC_EDIT 1036
|
||||
#define IDC_WTCONFIG 1039
|
||||
#define IDC_BUTTONS 1040
|
||||
#define IDC_MOVEMASK 1041
|
||||
#define IDC_LST 1042
|
||||
#define IDC_MMTEXT 1046
|
||||
#define IDM_XBUTTMAPS 40015
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 108
|
||||
#define _APS_NEXT_COMMAND_VALUE 40016
|
||||
#define _APS_NEXT_CONTROL_VALUE 1048
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
305
public/wintab/examples/mgrtest/tests.c
Normal file
305
public/wintab/examples/mgrtest/tests.c
Normal file
@@ -0,0 +1,305 @@
|
||||
/* Various tests to check if Wintab is acting as we would expect */
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "wintab.h"
|
||||
|
||||
|
||||
extern HMGR hMgr;
|
||||
extern HMODULE hWintab;
|
||||
extern char szWintab[];
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define LoadLibraryWorked(h) (h)
|
||||
#else
|
||||
#define LoadLibraryWorked(h) (h >= HINSTANCE_ERROR)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL BtnMarks(HMGR h, UINT c, UINT FAR *n, UINT FAR *t)
|
||||
{
|
||||
typedef BOOL (API *BM)(HMGR, UINT, DWORD, DWORD);
|
||||
typedef BOOL (API *BMX)(HMGR, UINT, UINT FAR *, UINT FAR *);
|
||||
static BM bm = NULL;
|
||||
static BMX bmx = NULL;
|
||||
|
||||
/* if not got wintab handle... */
|
||||
if (!hWintab)
|
||||
/* get wintab handle. */
|
||||
hWintab = LoadLibrary(szWintab);
|
||||
/* failsafe. */
|
||||
if (!LoadLibraryWorked(hWintab))
|
||||
return FALSE;
|
||||
|
||||
/* if not got a proc... */
|
||||
if (!bmx && !bm) {
|
||||
/* try for portable version. */
|
||||
bmx = (BMX)GetProcAddress(hWintab, "WTMgrCsrPressureBtnMarksEx");
|
||||
/* if no portable version... */
|
||||
if (!bmx)
|
||||
/* try for non-portable version. */
|
||||
bm = (BM)GetProcAddress(hWintab, "WTMgrCsrPressureBtnMarks");
|
||||
}
|
||||
/* failsafe. */
|
||||
if (!bmx && !bm)
|
||||
return FALSE;
|
||||
|
||||
/* if portable version... */
|
||||
if (bmx) {
|
||||
/* call it. */
|
||||
return bmx(h, c, n, t);
|
||||
}
|
||||
else {
|
||||
/* convert arguments and call non-portable version. */
|
||||
DWORD dwN, dwT;
|
||||
|
||||
if (!n)
|
||||
dwN = 0;
|
||||
else if (n == WTP_LPDEFAULT)
|
||||
dwN = WTP_DWDEFAULT;
|
||||
else
|
||||
dwN = *(DWORD FAR *)n;
|
||||
|
||||
if (!t)
|
||||
dwT = 0;
|
||||
else if (t == WTP_LPDEFAULT)
|
||||
dwT = WTP_DWDEFAULT;
|
||||
else
|
||||
dwT = *(DWORD FAR *)t;
|
||||
|
||||
return bm(h, c, dwN, dwT);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void BMSTest(HWND hWnd)
|
||||
{
|
||||
typedef BYTE MAP[32];
|
||||
static MAP logSave, sysSave, logTest, sysTest, logPatt, sysPatt;
|
||||
int i;
|
||||
BOOL fResult;
|
||||
char buf[200];
|
||||
|
||||
/* set up funky test patterns. */
|
||||
for (i = 0; i < sizeof(MAP); i++) {
|
||||
logPatt[i] = 31;
|
||||
sysPatt[i] = SBN_LDRAG;
|
||||
}
|
||||
/* loop over cursors... */
|
||||
for (i = 0; WTInfo(WTI_CURSORS + i, CSR_NAME, NULL); i++) {
|
||||
|
||||
/* save the current maps. */
|
||||
WTInfo(WTI_CURSORS + i, CSR_BUTTONMAP, logSave);
|
||||
WTInfo(WTI_CURSORS + i, CSR_SYSBTNMAP, sysSave);
|
||||
|
||||
/* if the function thinks it succeeded... */
|
||||
if (fResult = WTMgrCsrButtonMap(hMgr, i, logPatt, sysPatt)) {
|
||||
|
||||
/* get the resulting maps. */
|
||||
WTInfo(WTI_CURSORS + i, CSR_BUTTONMAP, logTest);
|
||||
WTInfo(WTI_CURSORS + i, CSR_SYSBTNMAP, sysTest);
|
||||
|
||||
/* put back the originals. */
|
||||
WTMgrCsrButtonMap(hMgr, i, logSave, sysSave);
|
||||
|
||||
/* compare what we sent with what we got. */
|
||||
fResult = (!memcmp(logTest, logPatt, sizeof(MAP)) &&
|
||||
!memcmp(sysTest, sysPatt, sizeof(MAP)));
|
||||
}
|
||||
/* report the results. */
|
||||
wsprintf(buf, "WTMgrCsrButtonMap() Test %s for Cursor %d.",
|
||||
(LPSTR)(fResult ? "Succeeded" : "Failed"), i);
|
||||
MessageBox(hWnd, buf, "MgrTest", MB_ICONINFORMATION | MB_OK);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void PMSTest(HWND hWnd)
|
||||
{
|
||||
UINT nSave[2], tSave[2], nTest[2], tTest[2], nPatt[2], tPatt[2];
|
||||
int i;
|
||||
BOOL fResult;
|
||||
BOOL fN, fT;
|
||||
char buf[200];
|
||||
|
||||
/* set up funky test patterns. */
|
||||
nPatt[0] = tPatt[0] = 1;
|
||||
nPatt[1] = tPatt[1] = 2;
|
||||
|
||||
/* loop over cursors... */
|
||||
for (i = 0; WTInfo(WTI_CURSORS + i, CSR_NAME, NULL); i++) {
|
||||
|
||||
/* check which channels to test. */
|
||||
fN = !!WTInfo(WTI_CURSORS + i, CSR_NPBTNMARKS, NULL);
|
||||
fT = !!WTInfo(WTI_CURSORS + i, CSR_TPBTNMARKS, NULL);
|
||||
|
||||
if (!fN && !fT) {
|
||||
fResult = !BtnMarks(hMgr, i, NULL, NULL);
|
||||
fResult &= !BtnMarks(hMgr, i, nPatt, NULL);
|
||||
fResult &= !BtnMarks(hMgr, i, NULL, tPatt);
|
||||
fResult &= !BtnMarks(hMgr, i, nPatt, tPatt);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* save the current maps. */
|
||||
if (fN)
|
||||
WTInfo(WTI_CURSORS + i, CSR_NPBTNMARKS, nSave);
|
||||
if (fT)
|
||||
WTInfo(WTI_CURSORS + i, CSR_TPBTNMARKS, tSave);
|
||||
|
||||
/* if the function thinks it succeeded... */
|
||||
if (BtnMarks(hMgr, i, (fN ? (LPVOID)nPatt : NULL),
|
||||
(fT ? (LPVOID)tPatt : NULL))) {
|
||||
|
||||
/* get the resulting maps. */
|
||||
if (fN)
|
||||
WTInfo(WTI_CURSORS + i, CSR_NPBTNMARKS, nTest);
|
||||
if (fT)
|
||||
WTInfo(WTI_CURSORS + i, CSR_TPBTNMARKS, tTest);
|
||||
|
||||
/* put back the originals. */
|
||||
BtnMarks(hMgr, i, (fN ? (LPVOID)nSave : NULL),
|
||||
(fT ? (LPVOID)tSave : NULL));
|
||||
|
||||
/* compare what we sent with what we got. */
|
||||
fResult = TRUE;
|
||||
if (fN)
|
||||
fResult &= !memcmp(nTest, nPatt, sizeof(nTest));
|
||||
if (fT)
|
||||
fResult &= !memcmp(tTest, tPatt, sizeof(tTest));
|
||||
}
|
||||
else
|
||||
fResult = FALSE;
|
||||
}
|
||||
/* report the results. */
|
||||
wsprintf(buf, "WTMgrCsrPressureBtnMarks() Test %s for Cursor %d.",
|
||||
(LPSTR)(fResult ? "Succeeded" : "Failed"), i);
|
||||
MessageBox(hWnd, buf, "MgrTest", MB_ICONINFORMATION | MB_OK);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void PRSTest(HWND hWnd)
|
||||
{
|
||||
typedef UINT CURVE[256];
|
||||
static CURVE nSave, tSave, nTest, tTest, nPatt, tPatt;
|
||||
int nSize, tSize;
|
||||
int i, j;
|
||||
BOOL fResult;
|
||||
BOOL fN, fT;
|
||||
AXIS p;
|
||||
char buf[200];
|
||||
|
||||
/* loop over devices... */
|
||||
for (j = 0; WTInfo(WTI_DEVICES + j, DVC_FIRSTCSR, &i); j++) {
|
||||
int k;
|
||||
|
||||
/* set up funky test patterns. */
|
||||
if (WTInfo(WTI_DEVICES + j, DVC_NPRESSURE, &p)) {
|
||||
nSize = (int)(p.axMax - p.axMin);
|
||||
for (k = 0; k < nSize; k++)
|
||||
nPatt[k] = (k ? (UINT)p.axMax : (UINT)p.axMin);
|
||||
}
|
||||
|
||||
if (WTInfo(WTI_DEVICES + j, DVC_TPRESSURE, &p)) {
|
||||
tSize = (int)(p.axMax - p.axMin);
|
||||
for (k = 0; k < tSize; k++)
|
||||
tPatt[k] = (k ? (UINT)p.axMax : (UINT)p.axMin);
|
||||
}
|
||||
|
||||
/* loop over cursors... */
|
||||
for (; WTInfo(WTI_CURSORS + i, CSR_NAME, NULL); i++) {
|
||||
|
||||
/* check which channels to test. */
|
||||
fN = !!WTInfo(WTI_CURSORS + i, CSR_NPRESPONSE, NULL);
|
||||
fT = !!WTInfo(WTI_CURSORS + i, CSR_TPRESPONSE, NULL);
|
||||
|
||||
if (!fN && !fT) {
|
||||
fResult = !WTMgrCsrPressureResponse(hMgr, i, NULL, NULL);
|
||||
fResult &= !WTMgrCsrPressureResponse(hMgr, i, nPatt, NULL);
|
||||
fResult &= !WTMgrCsrPressureResponse(hMgr, i, NULL, tPatt);
|
||||
fResult &= !WTMgrCsrPressureResponse(hMgr, i, nPatt, tPatt);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* save the current maps. */
|
||||
if (fN)
|
||||
WTInfo(WTI_CURSORS + i, CSR_NPRESPONSE, nSave);
|
||||
if (fT)
|
||||
WTInfo(WTI_CURSORS + i, CSR_TPRESPONSE, tSave);
|
||||
|
||||
/* if the function thinks it succeeded... */
|
||||
if (WTMgrCsrPressureResponse(hMgr, i,
|
||||
(fN ? (LPVOID)nPatt : NULL),
|
||||
(fT ? (LPVOID)tPatt : NULL))) {
|
||||
|
||||
/* get the resulting maps. */
|
||||
if (fN)
|
||||
WTInfo(WTI_CURSORS + i, CSR_NPRESPONSE, &nTest);
|
||||
if (fT)
|
||||
WTInfo(WTI_CURSORS + i, CSR_TPRESPONSE, &tTest);
|
||||
|
||||
/* put back the originals. */
|
||||
WTMgrCsrPressureResponse(hMgr, i,
|
||||
(fN ? (LPVOID)nSave : NULL),
|
||||
(fT ? (LPVOID)tSave : NULL));
|
||||
|
||||
/* compare what we sent with what we got. */
|
||||
fResult = TRUE;
|
||||
if (fN)
|
||||
fResult &= !memcmp(&nTest, &nPatt, sizeof(nTest));
|
||||
if (fT)
|
||||
fResult &= !memcmp(&tTest, &tPatt, sizeof(nTest));
|
||||
}
|
||||
else
|
||||
fResult = FALSE;
|
||||
}
|
||||
/* report the results. */
|
||||
wsprintf(buf, "WTMgrCsrPressureResponse() Test %s for Cursor %d.",
|
||||
(LPSTR)(fResult ? "Succeeded" : "Failed"), i);
|
||||
MessageBox(hWnd, buf, "MgrTest", MB_ICONINFORMATION | MB_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
void HMGRTest(HWND hWnd)
|
||||
{
|
||||
BOOL success = 1;
|
||||
HMGR old_hMgr = hMgr;
|
||||
HMGR new_hMgr;
|
||||
|
||||
new_hMgr = WTMgrOpen(hWnd, WT_DEFBASE);
|
||||
if( !new_hMgr ) {
|
||||
MessageBox(hWnd, "WTMgrOpen failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
} else {
|
||||
HCTX old_hCtx = WTMgrDefContext(old_hMgr, 0);
|
||||
HCTX new_hCtx = WTMgrDefContext(new_hMgr, 0);
|
||||
LOGCONTEXT ctx;
|
||||
|
||||
if( !old_hCtx || !new_hCtx ) {
|
||||
MessageBox(hWnd, "WTMgrDefContext failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
}
|
||||
if( !WTGet(old_hCtx, &ctx) || !WTGet(old_hCtx, &ctx) ) {
|
||||
MessageBox(hWnd, "WTGet failed before WTMgrClose called.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
}
|
||||
if( !WTMgrClose(old_hMgr) ) {
|
||||
MessageBox(hWnd, "WTMgrClose failed.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
}
|
||||
if( WTGet(old_hCtx, &ctx) ) {
|
||||
MessageBox(hWnd, "Error! WTGet returned success on context handle from a closed manager.", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
}
|
||||
if( !WTGet(new_hCtx, &ctx) ) {
|
||||
MessageBox(hWnd, "WTGet failed for new_hCtx after WTMgrClose(old_hMgr).", "MgrTest", MB_ICONHAND | MB_OK);
|
||||
success = 0;
|
||||
}
|
||||
hMgr = new_hMgr;
|
||||
}
|
||||
if( success )
|
||||
MessageBox(hWnd, "Test Passed.", "MgrTest", MB_ICONINFORMATION | MB_OK);
|
||||
}
|
||||
17
public/wintab/examples/mgrtest/win16/doswin16.mak
Normal file
17
public/wintab/examples/mgrtest/win16/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug)
|
||||
cvars = -D$(ENV)
|
||||
rcvars = -i..\..\..\include
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
108
public/wintab/examples/mgrtest/win16/makefile
Normal file
108
public/wintab/examples/mgrtest/win16/makefile
Normal file
@@ -0,0 +1,108 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = MGRTEST
|
||||
projdll = MGRDLL
|
||||
|
||||
all: $(proj).exe $(projdll).dll
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
-del *.dll
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.lib
|
||||
-del *.exp
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\mgrdlg.dlg $(srcdir)\mgrdlg.h $(srcdir)\$(proj).h
|
||||
$(rc) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!if defined(CPU)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
OBJS = $(proj).obj mgrdlg.obj bitbox.obj btnMap.obj Csrmask.obj Infodlg.obj MoveMask.obj tests.obj BtnMask.obj
|
||||
# Update the object files if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h $(srcdir)\mgrdlg.h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c $(srcdir)\$(proj).h $(srcdir)\mgrdlg.h
|
||||
|
||||
mgrdlg.obj: $(srcdir)\mgrdlg.c $(srcdir)\mgrdlg.h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\mgrdlg.c $(srcdir)\mgrdlg.h
|
||||
|
||||
mgrdll.obj: $(srcdir)\mgrdll.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\mgrdll.c
|
||||
|
||||
bitbox.obj: $(srcdir)\bitbox.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\bitbox.c
|
||||
|
||||
btnMap.obj: $(srcdir)\btnMap.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\btnMap.c
|
||||
|
||||
btnMask.obj: $(srcdir)\btnMask.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\btnMask.c
|
||||
|
||||
Infodlg.obj: $(srcdir)\Infodlg.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\Infodlg.c
|
||||
|
||||
MoveMask.obj: $(srcdir)\MoveMask.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\MoveMask.c
|
||||
|
||||
tests.obj: $(srcdir)\tests.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\tests.c
|
||||
|
||||
Csrmask.obj: $(srcdir)\Csrmask.c
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\Csrmask.c
|
||||
|
||||
|
||||
# Update the exp file if necessary.
|
||||
$(projdll).exp $(projdll).lib: $(projdll).obj $(projdll).def
|
||||
$(implib) -machine:$(CPU) \
|
||||
-def:$(projdll).def \
|
||||
-out:$(projdll).lib $(projdll).obj -verbose
|
||||
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(proj).exe: $(OBJS) $(proj).res $(proj).def
|
||||
$(link) $(linkdebug) $(guiflags) $(OBJS) \
|
||||
$(WINTAB)\lib\$(CPU)\wintab32.lib $(guilibs) VERSION.LIB \
|
||||
$(proj).rbj -out:$(proj).exe /machine:$(CPU)
|
||||
$(projdll).dll: $(projdll).obj $(projdll).def $(projdll).exp
|
||||
$(link) $(linkdebug) $(guiflags) $(projdll).obj $(projdll).exp \
|
||||
$(guilibsdll) VERSION.LIB -out:$(projdll).dll \
|
||||
/machine:$(CPU) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
|
||||
!ENDIF
|
||||
!if !defined(CPU)
|
||||
# This is for Windows DOS:
|
||||
$(proj).exe: $(OBJS) $(proj).res $(proj).def
|
||||
$(link) $(guiflags) $(OBJS) ,,, $(WINTAB)\lib\wintab.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
$(projdll).dll: $(projdll).obj $(projdll).def
|
||||
$(link) $(guiflags) libentry.obj $(projdll).obj ,$(projdll).dll,, \
|
||||
$(WINTAB)\lib\wintab.lib $(guilibsdll) , $(projdll).DEF
|
||||
rc $(projdll).dll
|
||||
!ENDIF
|
||||
10
public/wintab/examples/mgrtest/win16/mgrdll.def
Normal file
10
public/wintab/examples/mgrtest/win16/mgrdll.def
Normal file
@@ -0,0 +1,10 @@
|
||||
LIBRARY MGRDLL
|
||||
DESCRIPTION 'MGRTEST.DLL: Config Box Replace Test DLL'
|
||||
EXETYPE WINDOWS
|
||||
CODE PRELOAD DISCARDABLE
|
||||
DATA FIXED SINGLE PRELOAD
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
CBRTestProc
|
||||
|
||||
|
||||
31
public/wintab/examples/mgrtest/win16/mgrtest.def
Normal file
31
public/wintab/examples/mgrtest/win16/mgrtest.def
Normal file
@@ -0,0 +1,31 @@
|
||||
; module-definition file for mgrtest -- used by LINK.EXE
|
||||
|
||||
NAME MgrTest ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
Do1Context ; enumeration callback function
|
||||
ButtonDlgProc
|
||||
|
||||
414
public/wintab/examples/mgrtest/win16/ntwin32.mak
Normal file
414
public/wintab/examples/mgrtest/win16/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -i..\..\..\include -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
95
public/wintab/examples/mgrtest/win32/mgrdll.dsp
Normal file
95
public/wintab/examples/mgrtest/win32/mgrdll.dsp
Normal file
@@ -0,0 +1,95 @@
|
||||
# Microsoft Developer Studio Project File - Name="mgrdll" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=mgrdll - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrdll.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrdll.mak" CFG="mgrdll - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mgrdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "mgrdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "mgrdll - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll /map /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrdll - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "mgrdll - Win32 Release"
|
||||
# Name "mgrdll - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrdll.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/mgrtest/win32/mgrdll.dsw
Normal file
29
public/wintab/examples/mgrtest/win32/mgrdll.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "mgrdll"=.\mgrdll.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
205
public/wintab/examples/mgrtest/win32/mgrdll.mak
Normal file
205
public/wintab/examples/mgrtest/win32/mgrdll.mak
Normal file
@@ -0,0 +1,205 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=mgrdll - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to mgrdll - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "mgrdll - Win32 Release" && "$(CFG)" != "mgrdll - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrdll.mak" CFG="mgrdll - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mgrdll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "mgrdll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "mgrdll - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "mgrdll - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\mgrdll.dll"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Mgrdll.obj"
|
||||
-@erase "$(OUTDIR)\mgrdll.dll"
|
||||
-@erase "$(OUTDIR)\mgrdll.exp"
|
||||
-@erase "$(OUTDIR)\mgrdll.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG"\
|
||||
/D "_WINDOWS" /Fp"$(INTDIR)/mgrdll.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/mgrdll.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll\
|
||||
/incremental:no /pdb:"$(OUTDIR)/mgrdll.pdb" /machine:I386\
|
||||
/out:"$(OUTDIR)/mgrdll.dll" /implib:"$(OUTDIR)/mgrdll.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Mgrdll.obj"
|
||||
|
||||
"$(OUTDIR)\mgrdll.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrdll - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "mgrdll_0"
|
||||
# PROP BASE Intermediate_Dir "mgrdll_0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "mgrdll_0"
|
||||
# PROP Intermediate_Dir "mgrdll_0"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\mgrdll_0
|
||||
INTDIR=.\mgrdll_0
|
||||
|
||||
ALL : "$(OUTDIR)\mgrdll.dll"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Mgrdll.obj"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\mgrdll.dll"
|
||||
-@erase "$(OUTDIR)\mgrdll.exp"
|
||||
-@erase "$(OUTDIR)\mgrdll.ilk"
|
||||
-@erase "$(OUTDIR)\mgrdll.lib"
|
||||
-@erase "$(OUTDIR)\mgrdll.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/mgrdll.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\mgrdll_0/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/mgrdll.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /dll\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/mgrdll.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/mgrdll.dll" /implib:"$(OUTDIR)/mgrdll.lib"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Mgrdll.obj"
|
||||
|
||||
"$(OUTDIR)\mgrdll.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "mgrdll - Win32 Release"
|
||||
# Name "mgrdll - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "mgrdll - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrdll - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\Mgrdll.c
|
||||
|
||||
"$(INTDIR)\Mgrdll.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
public/wintab/examples/mgrtest/win32/mgrdll.mdp
Normal file
BIN
public/wintab/examples/mgrtest/win32/mgrdll.mdp
Normal file
Binary file not shown.
153
public/wintab/examples/mgrtest/win32/mgrtest.dsp
Normal file
153
public/wintab/examples/mgrtest/win32/mgrtest.dsp
Normal file
@@ -0,0 +1,153 @@
|
||||
# Microsoft Developer Studio Project File - Name="mgrtest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=mgrtest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrtest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrtest.mak" CFG="mgrtest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mgrtest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "mgrtest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\I386\wintab32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "mgrtest - Win32 Release"
|
||||
# Name "mgrtest - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\bitbox.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\btnMap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\BtnMask.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Csrmask.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Infodlg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrdlg.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrdlg.dlg
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrdlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrtest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrtest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Mgrtest.rc
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\MoveMask.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Msgpack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\tests.c
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
44
public/wintab/examples/mgrtest/win32/mgrtest.dsw
Normal file
44
public/wintab/examples/mgrtest/win32/mgrtest.dsw
Normal file
@@ -0,0 +1,44 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "mgrdll"=.\mgrdll.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name mgrtest
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "mgrtest"=.\mgrtest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
656
public/wintab/examples/mgrtest/win32/mgrtest.mak
Normal file
656
public/wintab/examples/mgrtest/win32/mgrtest.mak
Normal file
@@ -0,0 +1,656 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=mgrtest - Win32 thunk Debug
|
||||
!MESSAGE No configuration specified. Defaulting to mgrtest - Win32 thunk\
|
||||
Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "mgrtest - Win32 Release" && "$(CFG)" !=\
|
||||
"mgrtest - Win32 Debug" && "$(CFG)" != "mgrtest - Win32 thunk Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "mgrtest.mak" CFG="mgrtest - Win32 thunk Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "mgrtest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "mgrtest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "mgrtest - Win32 thunk Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "mgrtest - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\mgrtest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\bitbox.obj"
|
||||
-@erase "$(INTDIR)\btnMap.obj"
|
||||
-@erase "$(INTDIR)\BtnMask.obj"
|
||||
-@erase "$(INTDIR)\Csrmask.obj"
|
||||
-@erase "$(INTDIR)\Infodlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrdlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrtest.obj"
|
||||
-@erase "$(INTDIR)\mgrtest.res"
|
||||
-@erase "$(INTDIR)\MoveMask.obj"
|
||||
-@erase "$(INTDIR)\tests.obj"
|
||||
-@erase "$(OUTDIR)\mgrtest.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG"\
|
||||
/D "_WINDOWS" /Fp"$(INTDIR)/mgrtest.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/mgrtest.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/mgrtest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:no /pdb:"$(OUTDIR)/mgrtest.pdb" /machine:I386\
|
||||
/out:"$(OUTDIR)/mgrtest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\bitbox.obj" \
|
||||
"$(INTDIR)\btnMap.obj" \
|
||||
"$(INTDIR)\BtnMask.obj" \
|
||||
"$(INTDIR)\Csrmask.obj" \
|
||||
"$(INTDIR)\Infodlg.obj" \
|
||||
"$(INTDIR)\Mgrdlg.obj" \
|
||||
"$(INTDIR)\Mgrtest.obj" \
|
||||
"$(INTDIR)\mgrtest.res" \
|
||||
"$(INTDIR)\MoveMask.obj" \
|
||||
"$(INTDIR)\tests.obj"
|
||||
|
||||
"$(OUTDIR)\mgrtest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "mgrtest_"
|
||||
# PROP BASE Intermediate_Dir "mgrtest_"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "mgrtest_"
|
||||
# PROP Intermediate_Dir "mgrtest_"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\mgrtest_
|
||||
INTDIR=.\mgrtest_
|
||||
|
||||
ALL : "$(OUTDIR)\mgrtest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\bitbox.obj"
|
||||
-@erase "$(INTDIR)\btnMap.obj"
|
||||
-@erase "$(INTDIR)\BtnMask.obj"
|
||||
-@erase "$(INTDIR)\Csrmask.obj"
|
||||
-@erase "$(INTDIR)\Infodlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrdlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrtest.obj"
|
||||
-@erase "$(INTDIR)\mgrtest.res"
|
||||
-@erase "$(INTDIR)\MoveMask.obj"
|
||||
-@erase "$(INTDIR)\tests.obj"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\mgrtest.exe"
|
||||
-@erase "$(OUTDIR)\mgrtest.ilk"
|
||||
-@erase "$(OUTDIR)\mgrtest.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/mgrtest.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\mgrtest_/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/mgrtest.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/mgrtest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/mgrtest.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/mgrtest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\bitbox.obj" \
|
||||
"$(INTDIR)\btnMap.obj" \
|
||||
"$(INTDIR)\BtnMask.obj" \
|
||||
"$(INTDIR)\Csrmask.obj" \
|
||||
"$(INTDIR)\Infodlg.obj" \
|
||||
"$(INTDIR)\Mgrdlg.obj" \
|
||||
"$(INTDIR)\Mgrtest.obj" \
|
||||
"$(INTDIR)\mgrtest.res" \
|
||||
"$(INTDIR)\MoveMask.obj" \
|
||||
"$(INTDIR)\tests.obj"
|
||||
|
||||
"$(OUTDIR)\mgrtest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "mgrtest0"
|
||||
# PROP BASE Intermediate_Dir "mgrtest0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "mgrtest0"
|
||||
# PROP Intermediate_Dir "mgrtest0"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\mgrtest0
|
||||
INTDIR=.\mgrtest0
|
||||
|
||||
ALL : "$(OUTDIR)\mgrtest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\bitbox.obj"
|
||||
-@erase "$(INTDIR)\btnMap.obj"
|
||||
-@erase "$(INTDIR)\BtnMask.obj"
|
||||
-@erase "$(INTDIR)\Csrmask.obj"
|
||||
-@erase "$(INTDIR)\Infodlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrdlg.obj"
|
||||
-@erase "$(INTDIR)\Mgrtest.obj"
|
||||
-@erase "$(INTDIR)\mgrtest.res"
|
||||
-@erase "$(INTDIR)\MoveMask.obj"
|
||||
-@erase "$(INTDIR)\tests.obj"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\mgrtest.exe"
|
||||
-@erase "$(OUTDIR)\mgrtest.ilk"
|
||||
-@erase "$(OUTDIR)\mgrtest.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/mgrtest.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\mgrtest0/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/mgrtest.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/mgrtest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/mgrtest.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/mgrtest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\bitbox.obj" \
|
||||
"$(INTDIR)\btnMap.obj" \
|
||||
"$(INTDIR)\BtnMask.obj" \
|
||||
"$(INTDIR)\Csrmask.obj" \
|
||||
"$(INTDIR)\Infodlg.obj" \
|
||||
"$(INTDIR)\Mgrdlg.obj" \
|
||||
"$(INTDIR)\Mgrtest.obj" \
|
||||
"$(INTDIR)\mgrtest.res" \
|
||||
"$(INTDIR)\MoveMask.obj" \
|
||||
"$(INTDIR)\tests.obj"
|
||||
|
||||
"$(OUTDIR)\mgrtest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "mgrtest - Win32 Release"
|
||||
# Name "mgrtest - Win32 Debug"
|
||||
# Name "mgrtest - Win32 thunk Debug"
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\tests.c
|
||||
NODEP_CPP_TESTS=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\tests.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\tests.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\tests.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\btnMap.c
|
||||
DEP_CPP_BTNMA=\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
NODEP_CPP_BTNMA=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\btnMap.obj" : $(SOURCE) $(DEP_CPP_BTNMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\btnMap.obj" : $(SOURCE) $(DEP_CPP_BTNMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\btnMap.obj" : $(SOURCE) $(DEP_CPP_BTNMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\BtnMask.c
|
||||
DEP_CPP_BTNMAS=\
|
||||
"..\Mgrdlg.h"\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
NODEP_CPP_BTNMAS=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\BtnMask.obj" : $(SOURCE) $(DEP_CPP_BTNMAS) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\BtnMask.obj" : $(SOURCE) $(DEP_CPP_BTNMAS) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\BtnMask.obj" : $(SOURCE) $(DEP_CPP_BTNMAS) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\Csrmask.c
|
||||
DEP_CPP_CSRMA=\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
NODEP_CPP_CSRMA=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Csrmask.obj" : $(SOURCE) $(DEP_CPP_CSRMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Csrmask.obj" : $(SOURCE) $(DEP_CPP_CSRMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Csrmask.obj" : $(SOURCE) $(DEP_CPP_CSRMA) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\Infodlg.c
|
||||
DEP_CPP_INFOD=\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
NODEP_CPP_INFOD=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Infodlg.obj" : $(SOURCE) $(DEP_CPP_INFOD) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Infodlg.obj" : $(SOURCE) $(DEP_CPP_INFOD) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Infodlg.obj" : $(SOURCE) $(DEP_CPP_INFOD) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\Mgrdlg.c
|
||||
DEP_CPP_MGRDL=\
|
||||
"..\Mgrdlg.h"\
|
||||
"..\Msgpack.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrdlg.obj" : $(SOURCE) $(DEP_CPP_MGRDL) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrdlg.obj" : $(SOURCE) $(DEP_CPP_MGRDL) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrdlg.obj" : $(SOURCE) $(DEP_CPP_MGRDL) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\Mgrtest.c
|
||||
DEP_CPP_MGRTE=\
|
||||
"..\Mgrdlg.h"\
|
||||
"..\Mgrtest.h"\
|
||||
"..\Msgpack.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrtest.obj" : $(SOURCE) $(DEP_CPP_MGRTE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrtest.obj" : $(SOURCE) $(DEP_CPP_MGRTE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Mgrtest.obj" : $(SOURCE) $(DEP_CPP_MGRTE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\mgrtest.rc
|
||||
DEP_RSC_MGRTES=\
|
||||
"..\Mgrdlg.h"\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\mgrtest.res" : $(SOURCE) $(DEP_RSC_MGRTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/mgrtest.res" /i "\wtkit125\Examples\Mgrtest"\
|
||||
/d "NDEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\mgrtest.res" : $(SOURCE) $(DEP_RSC_MGRTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/mgrtest.res" /i "\wtkit125\Examples\Mgrtest"\
|
||||
/d "_DEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\mgrtest.res" : $(SOURCE) $(DEP_RSC_MGRTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/mgrtest.res" /i "\wtkit125\Examples\Mgrtest"\
|
||||
/d "_DEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\MoveMask.c
|
||||
DEP_CPP_MOVEM=\
|
||||
"..\Mgrtest.h"\
|
||||
|
||||
NODEP_CPP_MOVEM=\
|
||||
"..\wintab.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\MoveMask.obj" : $(SOURCE) $(DEP_CPP_MOVEM) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\MoveMask.obj" : $(SOURCE) $(DEP_CPP_MOVEM) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\MoveMask.obj" : $(SOURCE) $(DEP_CPP_MOVEM) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Mgrtest\bitbox.c
|
||||
|
||||
!IF "$(CFG)" == "mgrtest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\bitbox.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\bitbox.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "mgrtest - Win32 thunk Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\bitbox.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
public/wintab/examples/mgrtest/win32/mgrtest.mdp
Normal file
BIN
public/wintab/examples/mgrtest/win32/mgrtest.mdp
Normal file
Binary file not shown.
23
public/wintab/examples/prstest/msgpack.h
Normal file
23
public/wintab/examples/prstest/msgpack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ------------------------------- msgpack.h -------------------------------- */
|
||||
/*------------------------------------------------------------------------------
|
||||
Selected message unpacking macros from windowsx.h
|
||||
to circumvent compile-time memory headaches.
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#else
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#endif
|
||||
|
||||
294
public/wintab/examples/prstest/prstest.c
Normal file
294
public/wintab/examples/prstest/prstest.c
Normal file
@@ -0,0 +1,294 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
PrsTest - using pressure input.
|
||||
RICO 4/1/92
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
#include <windows.h>
|
||||
#include "msgpack.h"
|
||||
#include <wintab.h>
|
||||
#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE)
|
||||
#define PACKETMODE PK_BUTTONS
|
||||
#include <pktdef.h>
|
||||
#include "prstest.h"
|
||||
#ifdef USE_X_LIB
|
||||
#include <wintabx.h>
|
||||
#endif
|
||||
|
||||
HANDLE hInst;
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int PASCAL WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
HANDLE hPrevInstance;
|
||||
LPSTR lpCmdLine;
|
||||
int nCmdShow;
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!hPrevInstance)
|
||||
if (!InitApplication(hInstance))
|
||||
return (FALSE);
|
||||
|
||||
/* Perform initializations that apply to a specific instance */
|
||||
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
return (FALSE);
|
||||
|
||||
/* Acquire and dispatch messages until a WM_QUIT message is received. */
|
||||
|
||||
while (GetMessage(&msg,
|
||||
NULL,
|
||||
0,
|
||||
0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
#ifdef USE_X_LIB
|
||||
_UnlinkWintab();
|
||||
#endif
|
||||
|
||||
return (msg.wParam);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitApplication(hInstance)
|
||||
HANDLE hInstance;
|
||||
{
|
||||
WNDCLASS wc;
|
||||
|
||||
/* Fill in window class structure with parameters that describe the */
|
||||
/* main window. */
|
||||
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = MainWndProc;
|
||||
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = hInstance;
|
||||
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
|
||||
wc.lpszMenuName = "PrsTestMenu";
|
||||
wc.lpszClassName = "PrsTestWClass";
|
||||
|
||||
/* Register the window class and return success/failure code. */
|
||||
|
||||
return (RegisterClass(&wc));
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL InitInstance(hInstance, nCmdShow)
|
||||
HANDLE hInstance;
|
||||
int nCmdShow;
|
||||
{
|
||||
HWND hWnd;
|
||||
char buf[50];
|
||||
|
||||
/* Save the instance handle in static variable, which will be used in */
|
||||
/* many subsequence calls from this application to Windows. */
|
||||
|
||||
hInst = hInstance;
|
||||
|
||||
/* check if WinTab available. */
|
||||
if (!WTInfo(0, 0, NULL)) {
|
||||
MessageBox(NULL, "WinTab Services Not Available.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Create a main window for this application instance. */
|
||||
|
||||
wsprintf(buf, "PrsTest:%x", hInst);
|
||||
hWnd = CreateWindow(
|
||||
"PrsTestWClass",
|
||||
buf,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
NULL,
|
||||
NULL,
|
||||
hInstance,
|
||||
NULL
|
||||
);
|
||||
|
||||
/* If window could not be created, return "failure" */
|
||||
|
||||
if (!hWnd)
|
||||
return (FALSE);
|
||||
|
||||
/* Make the window visible; update its client area; and return "success" */
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
UpdateWindow(hWnd);
|
||||
return (TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX static NEAR TabletInit(HWND hWnd)
|
||||
{
|
||||
LOGCONTEXT lcMine;
|
||||
|
||||
/* get default region */
|
||||
WTInfo(WTI_DEFCONTEXT, 0, &lcMine);
|
||||
|
||||
/* modify the digitizing region */
|
||||
wsprintf(lcMine.lcName, "PrsTest Digitizing %x", hInst);
|
||||
lcMine.lcOptions |= CXO_MESSAGES;
|
||||
lcMine.lcPktData = PACKETDATA;
|
||||
lcMine.lcPktMode = PACKETMODE;
|
||||
lcMine.lcMoveMask = PACKETDATA;
|
||||
lcMine.lcBtnUpMask = lcMine.lcBtnDnMask;
|
||||
|
||||
/* output in 10000 x 10000 grid */
|
||||
lcMine.lcOutOrgX = lcMine.lcOutOrgY = 0;
|
||||
lcMine.lcOutExtX = 10000;
|
||||
lcMine.lcOutExtY = 10000;
|
||||
|
||||
/* open the region */
|
||||
return WTOpen(hWnd, &lcMine, TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
LRESULT FAR PASCAL MainWndProc(hWnd, message, wParam, lParam)
|
||||
HWND hWnd;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
FARPROC lpProcAbout;
|
||||
static HCTX hTab = NULL;
|
||||
static POINT ptOld, ptNew;
|
||||
static UINT prsOld, prsNew;
|
||||
static RECT rcClient;
|
||||
PAINTSTRUCT psPaint;
|
||||
HDC hDC;
|
||||
PACKET pkt;
|
||||
BOOL fHandled = TRUE;
|
||||
LRESULT lResult = 0L;
|
||||
|
||||
|
||||
switch (message) {
|
||||
|
||||
case WM_CREATE:
|
||||
hTab = TabletInit(hWnd);
|
||||
if (!hTab) {
|
||||
MessageBox(NULL, " Could Not Open Tablet Context.", "WinTab",
|
||||
MB_OK | MB_ICONHAND);
|
||||
|
||||
SendMessage(hWnd, WM_DESTROY, 0, 0L);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
GetClientRect(hWnd, &rcClient);
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDM_ABOUT) {
|
||||
lpProcAbout = MakeProcInstance(About, hInst);
|
||||
|
||||
DialogBox(hInst,
|
||||
"AboutBox",
|
||||
hWnd,
|
||||
lpProcAbout);
|
||||
|
||||
FreeProcInstance(lpProcAbout);
|
||||
}
|
||||
else
|
||||
fHandled = FALSE;
|
||||
break;
|
||||
|
||||
case WT_PACKET:
|
||||
if (WTPacket((HCTX)lParam, wParam, &pkt)) {
|
||||
if (HIWORD(pkt.pkButtons)==TBN_DOWN) {
|
||||
MessageBeep(0);
|
||||
}
|
||||
ptOld = ptNew;
|
||||
prsOld = prsNew;
|
||||
ptNew.x = MulDiv((UINT)pkt.pkX, rcClient.right, 10000);
|
||||
ptNew.y = MulDiv((UINT)pkt.pkY, rcClient.bottom, 10000);
|
||||
prsNew = pkt.pkNormalPressure;
|
||||
if (ptNew.x != ptOld.x ||
|
||||
ptNew.y != ptOld.y ||
|
||||
prsNew != prsOld) {
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
if (GET_WM_ACTIVATE_STATE(wParam, lParam))
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
|
||||
/* if switching in the middle, disable the region */
|
||||
if (hTab) {
|
||||
WTEnable(hTab, GET_WM_ACTIVATE_STATE(wParam, lParam));
|
||||
if (hTab && GET_WM_ACTIVATE_STATE(wParam, lParam))
|
||||
WTOverlap(hTab, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if (hTab)
|
||||
WTClose(hTab);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
if (hDC = BeginPaint(hWnd, &psPaint)) {
|
||||
POINT ptHere;
|
||||
|
||||
ptHere.x = ptNew.x;
|
||||
ptHere.y = rcClient.bottom - ptNew.y;
|
||||
|
||||
/* redo horz */
|
||||
Ellipse(hDC, ptHere.x - prsNew, ptHere.y - prsNew,
|
||||
ptHere.x + prsNew, ptHere.y + prsNew);
|
||||
PatBlt(hDC, rcClient.left, ptHere.y,
|
||||
rcClient.right, 1, DSTINVERT);
|
||||
/* redo vert */
|
||||
PatBlt(hDC, ptHere.x, rcClient.top,
|
||||
1, rcClient.bottom, DSTINVERT);
|
||||
|
||||
EndPaint(hWnd, &psPaint);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
fHandled = FALSE;
|
||||
break;
|
||||
}
|
||||
if (fHandled)
|
||||
return (lResult);
|
||||
else
|
||||
return (DefWindowProc(hWnd, message, wParam, lParam));
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL FAR PASCAL About(hDlg, message, wParam, lParam)
|
||||
HWND hDlg;
|
||||
unsigned message;
|
||||
WPARAM wParam;
|
||||
LPARAM lParam;
|
||||
{
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
return (TRUE);
|
||||
|
||||
case WM_COMMAND:
|
||||
if (GET_WM_COMMAND_ID(wParam, lParam) == IDOK
|
||||
|| GET_WM_COMMAND_ID(wParam, lParam) == IDCANCEL) {
|
||||
EndDialog(hDlg, TRUE);
|
||||
return (TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
8
public/wintab/examples/prstest/prstest.h
Normal file
8
public/wintab/examples/prstest/prstest.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#define IDM_ABOUT 100
|
||||
|
||||
int PASCAL WinMain(HANDLE, HANDLE, LPSTR, int);
|
||||
BOOL InitApplication(HANDLE);
|
||||
BOOL InitInstance(HANDLE, int);
|
||||
LRESULT FAR PASCAL MainWndProc(HWND, unsigned, WPARAM, LPARAM);
|
||||
BOOL FAR PASCAL About(HWND, unsigned, WPARAM, LPARAM);
|
||||
|
||||
21
public/wintab/examples/prstest/prstest.rc
Normal file
21
public/wintab/examples/prstest/prstest.rc
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "windows.h"
|
||||
#include "prstest.h"
|
||||
|
||||
PrstestMenu MENU
|
||||
BEGIN
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About Prstest...", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
AboutBox DIALOG 22, 17, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About Prstest"
|
||||
BEGIN
|
||||
CTEXT "LCS/Telegraphics" -1, 0, 5, 144, 8
|
||||
CTEXT "Prstest Application" -1, 0, 14, 144, 8
|
||||
CTEXT "Version 0.0" -1, 0, 34, 144, 8
|
||||
DEFPUSHBUTTON "OK" IDOK, 53, 59, 32, 14, WS_GROUP
|
||||
END
|
||||
|
||||
17
public/wintab/examples/prstest/win16/doswin16.mak
Normal file
17
public/wintab/examples/prstest/win16/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug)
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
58
public/wintab/examples/prstest/win16/makefile
Normal file
58
public/wintab/examples/prstest/win16/makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = PRSTEST
|
||||
|
||||
all: $(proj).exe
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\$(proj).h
|
||||
$(rc) $(cinclude) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!IF defined(CPU)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Update the object file if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
$(proj).exe: $(proj).obj $(proj).res $(proj).def
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(link) $(linkdebug) $(guiflags) $(proj).obj $(WINTAB)\lib\$(CPU)\wintab32.lib $(guilibs) VERSION.LIB $(proj).rbj -out:$(proj).exe
|
||||
!ENDIF
|
||||
!if !defined(CPU)
|
||||
# This is for Windows DOS:
|
||||
$(link) $(guiflags) $(proj).obj ,,, $(WINTAB)\lib\wintab.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
!ENDIF
|
||||
414
public/wintab/examples/prstest/win16/ntwin32.mak
Normal file
414
public/wintab/examples/prstest/win16/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
29
public/wintab/examples/prstest/win16/prstest.def
Normal file
29
public/wintab/examples/prstest/win16/prstest.def
Normal file
@@ -0,0 +1,29 @@
|
||||
; module-definition file for prstest -- used by LINK.EXE
|
||||
|
||||
NAME PRSTEST ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
|
||||
17
public/wintab/examples/prstest/win16x/doswin16.mak
Normal file
17
public/wintab/examples/prstest/win16x/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug) -DUSE_X_LIB
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
58
public/wintab/examples/prstest/win16x/makefile
Normal file
58
public/wintab/examples/prstest/win16x/makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
!IF "$(CPU)" != ""
|
||||
OS=NT
|
||||
ENV=WIN32
|
||||
!ELSE
|
||||
OS=DOS
|
||||
ENV=WIN16
|
||||
!ENDIF
|
||||
|
||||
# Environment variables LIB and INCLUDE should point to your Win SDK libraries
|
||||
# and include files.
|
||||
|
||||
# Define WINTAB to point to your wintab development tree
|
||||
# Example: WINTAB=c:\wintab
|
||||
WINTAB=..\..\..
|
||||
|
||||
!include "$(OS)$(ENV).MAK"
|
||||
cinclude=-I$(srcdir) -I$(WINTAB)\include
|
||||
|
||||
proj = PRSTEST
|
||||
|
||||
all: $(proj).exe
|
||||
|
||||
# force a complete rebuild from source.
|
||||
cleanall: clean
|
||||
-del *.exe
|
||||
|
||||
#clean up everything but the .EXEs.
|
||||
clean:
|
||||
-del *.res
|
||||
-del *.?bj
|
||||
-del *.map
|
||||
|
||||
# Update the resource if necessary
|
||||
$(proj).res: $(srcdir)\$(proj).rc $(srcdir)\$(proj).h
|
||||
$(rc) $(cinclude) $(rcvars) -r -fo $(proj).res $(cvars) $(srcdir)\$(proj).rc
|
||||
!IF defined(CPU)
|
||||
cvtres -$(CPU) $(proj).res -o $(proj).rbj
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Update the object file if necessary
|
||||
$(proj).obj: $(srcdir)\$(proj).c $(srcdir)\$(proj).h
|
||||
$(cc) $(cflags) $(cinclude) $(cvars) $(cdebug) $(srcdir)\$(proj).c
|
||||
|
||||
# Since the link line has some severe differences depending on what
|
||||
# platform we are running on, we need to special case this so that
|
||||
# we execute the correct commands:
|
||||
|
||||
$(proj).exe: $(proj).obj $(proj).res $(proj).def
|
||||
!if defined(CPU)
|
||||
# This is for Windows NT:
|
||||
$(link) $(linkdebug) $(guiflags) $(proj).obj $(WINTAB)\lib\$(CPU)\wintab32.lib $(guilibs) VERSION.LIB $(proj).rbj -out:$(proj).exe
|
||||
!ENDIF
|
||||
!if !defined(CPU)
|
||||
# This is for Windows DOS:
|
||||
$(link) $(guiflags) $(proj).obj ,,, $(WINTAB)\lib\wintabx.lib $(guilibs) , $(proj).DEF
|
||||
rc $(proj).res
|
||||
!ENDIF
|
||||
414
public/wintab/examples/prstest/win16x/ntwin32.mak
Normal file
414
public/wintab/examples/prstest/win16x/ntwin32.mak
Normal file
@@ -0,0 +1,414 @@
|
||||
# =========================================================================
|
||||
# NTWIN32.MAK - Win32 application master NMAKE definitions file for the
|
||||
# Microsoft Win32 SDK for Windows NT programming samples
|
||||
# -------------------------------------------------------------------------
|
||||
# This files should be included at the top of all MAKEFILEs as follows:
|
||||
# !include <ntwin32.mak>
|
||||
# -------------------------------------------------------------------------
|
||||
# NMAKE Options
|
||||
#
|
||||
# Use the table below to determine the additional options for NMAKE to
|
||||
# generate various application debugging, profiling and performance tuning
|
||||
# information.
|
||||
#
|
||||
# Application Information Type Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No Debugging Info nmake nodebug=1
|
||||
# For Working Set Tuner Info nmake tune=1
|
||||
# For Call Attributed Profiling Info nmake profile=1
|
||||
#
|
||||
# Note: Working Set Tuner and Call Attributed Profiling is for available
|
||||
# for the Intel x86 and Pentium systems.
|
||||
#
|
||||
# Note: The three options above are mutually exclusive (you may use only
|
||||
# one to compile/link the application).
|
||||
#
|
||||
# Note: creating the environment variables NODEBUG, TUNE, and PROFILE is an
|
||||
# alternate method to setting these options via the nmake command line.
|
||||
#
|
||||
# Additional NMAKE Options Invoke NMAKE
|
||||
# ---------------------------- ------------
|
||||
# For No ANSI NULL Compliance nmake no_ansi=1
|
||||
# (ANSI NULL is defined as PVOID 0)
|
||||
#
|
||||
# =========================================================================
|
||||
# REVISIONS
|
||||
# RICO 1/26/95 - changed -Zi to -Z7 for use with VC++ 2.0.
|
||||
# RICO 6/16/97 - changed -Ox to -O1 to avoid VC++ 4.x optimizer bug.
|
||||
# =========================================================================
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Get CPU Type - exit if CPU environment variable is not defined
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == ""
|
||||
CPU = $(PROCESSOR_ARCHITECTURE)
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" != "i386"
|
||||
!IF "$(CPU)" != "MIPS"
|
||||
!IF "$(CPU)" != "ALPHA"
|
||||
!IF "$(CPU)" != "PPC"
|
||||
!ERROR Must specify CPU environment variable ( CPU=i386, CPU=MIPS, CPU=ALPHA, CPU=PPC)
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Binaries Declarations
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
# cc = cc
|
||||
# cvtobj = mip2coff
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# binary declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cc = mcl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cc = cl
|
||||
# for compatibility with older-style makefiles
|
||||
cvtobj = REM !!! CVTOBJ is no longer necessary - please remove !!!
|
||||
!ENDIF
|
||||
|
||||
# binary declarations common to all platforms
|
||||
link = link
|
||||
implib = lib
|
||||
rc = rc
|
||||
cvtres = cvtres
|
||||
hc = hc
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Compile Flags - must be specified after $(cc)
|
||||
#
|
||||
# Note: Debug switches are on by default for current release
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables.
|
||||
#
|
||||
# Both compilers now use the same front end - you must still define either
|
||||
# _X86_, _MIPS_, or _ALPHA_. These have replaced the i386, MIPS, and ALPHA
|
||||
# definitions which are not ANSI compliant.
|
||||
#
|
||||
# Common compiler flags:
|
||||
# -c - compile without linking
|
||||
# -W3 - Set warning level to level 3
|
||||
# -Zi - generate debugging information
|
||||
# -Od - disable all optimizations
|
||||
# -O1 - optimize for minimum size
|
||||
# -Zd - generate only public symbols and line numbers for debugging
|
||||
#
|
||||
# i386 specific compiler flags:
|
||||
# -Gz - stdcall
|
||||
#
|
||||
# MS MIPS specific compiler flags:
|
||||
# none.
|
||||
#
|
||||
# *** OLD MIPS ONLY ***
|
||||
#
|
||||
# The following definitions are for the old MIPS compiler:
|
||||
#
|
||||
# OLD MIPS compiler flags:
|
||||
# -c - compile without linking
|
||||
# -std - produce warnings for non-ANSI standard source code
|
||||
# -g2 - produce a symbol table for debugging
|
||||
# -O - invoke the global optimizer
|
||||
# -EL - produce object modules targeted for
|
||||
# "little-endian" byte ordering
|
||||
#
|
||||
# If you are using the old MIPS compiler then define the following:
|
||||
#
|
||||
# # OLD MIPS Complile Flags
|
||||
# !IF 0
|
||||
# !IF "$(CPU)" == "MIPS"
|
||||
# cflags = -c -std -o $(*B).obj -EL -DMIPS=1 -D_MIPS_=1
|
||||
# !IF defined(NODEBUG)
|
||||
# cdebug =
|
||||
# !ELSE
|
||||
# cdebug = -g2
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
# !ENDIF
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all compiler options
|
||||
cinclude = -I$(WDEV)\include
|
||||
ccommon = $(cinclude) -c -W3 -D_CRTAPI1=__cdecl -D_CRTAPI2=__cdecl -Dtry=__try -Dleave=__leave -Dexcept=__except -Dfinally=__finally
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
cflags = $(ccommon) -D_X86_=1
|
||||
scall = -Gz
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
cflags = $(ccommon) -D_MIPS_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "PPC"
|
||||
cflags = $(ccommon) -D_PPC_=1
|
||||
!ELSE
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
cflags = $(ccommon) -D_ALPHA_=1
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
scall =
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
cdebug = -Gh -Zd -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
cdebug = -O1
|
||||
!ELSE
|
||||
cdebug = -Z7 -Od
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module & Subsystem Dependent Compile Defined Variables - must be
|
||||
# specified after $(cc)
|
||||
#
|
||||
# The following table indicates the various acceptable combinations of
|
||||
# the C Run-Time libraries LIBC, LIBCMT, and CRTDLL respect to the creation
|
||||
# of a EXE and/or DLL target object. The appropriate compiler flag macros
|
||||
# that should be used for each combination are also listed.
|
||||
#
|
||||
# Link EXE Create Exe Link DLL Create DLL
|
||||
# with Using with Using
|
||||
# ----------------------------------------------------
|
||||
# LIBC CVARS None None *
|
||||
# LIBC CVARS LIBC CVARS
|
||||
# LIBC CVARS LIBCMT CVARSMT
|
||||
# LIBCMT CVARSMT None None *
|
||||
# LIBCMT CVARSMT LIBC CVARS
|
||||
# LIBCMT CVARSMT LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL None None *
|
||||
# CRTDLL CVARSDLL LIBC CVARS
|
||||
# CRTDLL CVARSDLL LIBCMT CVARSMT
|
||||
# CRTDLL CVARSDLL CRTDLL CVARSDLL *
|
||||
#
|
||||
# * - Denotes the Recommended Configuration
|
||||
#
|
||||
# When building single-threaded applications you can link your executable
|
||||
# with either LIBC, LIBCMT, or CRTDLL, although LIBC will provide the best
|
||||
# performance.
|
||||
#
|
||||
# When building multi-threaded applications, either LIBCMT or CRTDLL can
|
||||
# be used as the C-Runtime library, as both are multi-thread safe.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
# When using DLLs, it is recommended that all of the modules be
|
||||
# linked with CRTDLL.LIB.
|
||||
#
|
||||
# Note: The macros of the form xDLL are used when linking the object with
|
||||
# the DLL version of the C Run-Time (that is, CRTDLL.LIB). They are
|
||||
# not used when the target object is itself a DLL.
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF defined(NO_ANSI)
|
||||
noansi = -DNULL=0
|
||||
!ENDIF
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
cvars = -DWIN32 $(noansi)
|
||||
cvarsmt = $(cvars) -D_MT
|
||||
cvarsdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
cvarsmtdll = $(cvarsmt) -D_DLL
|
||||
|
||||
# for POSIX applications
|
||||
psxvars = -D_POSIX_
|
||||
|
||||
# resource compiler
|
||||
rcvars = -DWIN32 $(noansi)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Platform Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# Note: $(DLLENTRY) should be appended to each -entry: flag on the link
|
||||
# line.
|
||||
#
|
||||
# Note: When creating a DLL that uses C Run-Time functions it is
|
||||
# recommended to include the entry point function of the name DllMain
|
||||
# in the DLL's source code. Also, the MAKEFILE should include the
|
||||
# -entry:_DllMainCRTStartup$(DLLENTRY) option for the creation of
|
||||
# this DLL. (The C Run-Time entry point _DllMainCRTStartup in turn
|
||||
# calls the DLL defined DllMain entry point.)
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# declarations common to all linker options
|
||||
lcommon =
|
||||
|
||||
# declarations for use on Intel i386, i486, and Pentium systems
|
||||
!IF "$(CPU)" == "i386"
|
||||
DLLENTRY = @12
|
||||
lflags = $(lcommon) -align:0x1000
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted MIPS R4x000 systems
|
||||
!IF "$(CPU)" == "MIPS"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted PowerPC systems
|
||||
!IF "$(CPU)" == "PPC"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# declarations for use on self hosted Digital Alpha AXP systems
|
||||
!IF "$(CPU)" == "ALPHA"
|
||||
DLLENTRY =
|
||||
lflags = $(lcommon)
|
||||
!ENDIF
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Target Module Dependent Link Debug Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow the inclusion of the necessary symbolic information
|
||||
# for source level debugging with WinDebug, profiling and/or performance
|
||||
# tuning.
|
||||
#
|
||||
# Note: Debug switches are on by default.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
!IF defined(PROFILE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
ldebug = -debug:partial -debugtype:coff
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
!IF defined(NODEBUG)
|
||||
ldebug =
|
||||
!ELSE
|
||||
ldebug = -debug:full -debugtype:both
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
linkdebug = $(ldebug)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Subsystem Dependent Link Flags - must be specified after $(link)
|
||||
#
|
||||
# These switches allow for source level debugging with WinDebug for local
|
||||
# and global variables. They also provide the standard application type and
|
||||
# entry point declarations.
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
|
||||
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
|
||||
|
||||
# for POSIX applications
|
||||
psxlflags = $(lflags) -subsystem:posix -entry:__PosixProcessStartup
|
||||
|
||||
# for compatibility with older-style makefiles
|
||||
conflags = $(conlflags)
|
||||
guiflags = $(guilflags)
|
||||
psxflags = $(psxlflags)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# C Run-Time Target Module Dependent Link Libraries
|
||||
#
|
||||
# Below is a table which describes which libraries to use depending on the
|
||||
# target module type, although the table specifically refers to Graphical
|
||||
# User Interface apps, the exact same dependencies apply to Console apps.
|
||||
# That is, you could replace all occurrences of 'GUI' with 'CON' in the
|
||||
# following:
|
||||
#
|
||||
# Desired CRT Libraries Desired CRT Libraries
|
||||
# Library to link Library to link
|
||||
# for EXE with EXE for DLL with DLL
|
||||
# ----------------------------------------------------
|
||||
# LIBC GUILIBS None None *
|
||||
# LIBC GUILIBS LIBC GUILIBS
|
||||
# LIBC GUILIBS LIBCMT GUILIBSMT
|
||||
# LIBCMT GUILIBSMT None None *
|
||||
# LIBCMT GUILIBSMT LIBC GUILIBS
|
||||
# LIBCMT GUILIBSMT LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL None None *
|
||||
# CRTDLL GUILIBSDLL LIBC GUILIBS
|
||||
# CRTDLL GUILIBSDLL LIBCMT GUILIBSMT
|
||||
# CRTDLL GUILIBSDLL CRTDLL GUILIBSDLL *
|
||||
#
|
||||
# * - Recommended Configurations.
|
||||
#
|
||||
# Note: Any executable which accesses a DLL linked with CRTDLL.LIB must
|
||||
# also link with CRTDLL.LIB instead of LIBC.LIB or LIBCMT.LIB.
|
||||
#
|
||||
# Note: For POSIX applications, link with $(psxlibs).
|
||||
#
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# optional profiling and tuning libraries
|
||||
!IF "$(CPU)" == "i386"
|
||||
!IF defined(PROFILE)
|
||||
optlibs = cap.lib
|
||||
!ELSE
|
||||
!IF defined(TUNE)
|
||||
optlibs = wst.lib
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ELSE
|
||||
optlibs =
|
||||
!ENDIF
|
||||
|
||||
# basic subsystem specific libraries, less the C Run-Time
|
||||
baselibs = kernel32.lib $(optlibs)
|
||||
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
|
||||
|
||||
# for Windows applications that use the C Run-Time libraries
|
||||
conlibs = libc.lib $(baselibs)
|
||||
conlibsmt = libcmt.lib $(baselibs)
|
||||
conlibsdll = CRTDLL.lib $(baselibs)
|
||||
guilibs = libc.lib $(winlibs)
|
||||
guilibsmt = libcmt.lib $(winlibs)
|
||||
guilibsdll = CRTDLL.lib $(winlibs)
|
||||
|
||||
# for POSIX applications
|
||||
psxlibs = libcpsx.lib psxdll.lib psxrtl.lib
|
||||
|
||||
srcdir = ..
|
||||
29
public/wintab/examples/prstest/win16x/prstest.def
Normal file
29
public/wintab/examples/prstest/win16x/prstest.def
Normal file
@@ -0,0 +1,29 @@
|
||||
; module-definition file for prstest -- used by LINK.EXE
|
||||
|
||||
NAME PRSTEST ; application's module name
|
||||
|
||||
DESCRIPTION 'Sample Microsoft Windows Application'
|
||||
|
||||
EXETYPE WINDOWS ; required for all Windows applications
|
||||
|
||||
STUB 'WINSTUB.EXE' ; Generates error message if application
|
||||
; is run without Windows
|
||||
|
||||
;CODE can be moved in memory and discarded/reloaded
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
;DATA must be MULTIPLE if program can be invoked more than once
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
|
||||
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 5120 ; recommended minimum for Windows applications
|
||||
|
||||
|
||||
; All functions that will be called by any Windows routine
|
||||
; MUST be exported.
|
||||
|
||||
EXPORTS
|
||||
MainWndProc @1 ; name of window processing function
|
||||
About @2 ; name of "About" processing function
|
||||
|
||||
106
public/wintab/examples/prstest/win32/prstest.dsp
Normal file
106
public/wintab/examples/prstest/win32/prstest.dsp
Normal file
@@ -0,0 +1,106 @@
|
||||
# Microsoft Developer Studio Project File - Name="prstest" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=prstest - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "prstest.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "prstest.mak" CFG="prstest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "prstest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "prstest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "prstest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gdi32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "prstest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 ..\..\..\lib\I386\wintab32.lib ..\..\..\lib\i386\wintab32.lib kernel32.lib user32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gdi32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "prstest - Win32 Release"
|
||||
# Name "prstest - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Msgpack.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Prstest.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Prstest.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Prstest.rc
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
public/wintab/examples/prstest/win32/prstest.dsw
Normal file
29
public/wintab/examples/prstest/win32/prstest.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "prstest"=.\prstest.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
239
public/wintab/examples/prstest/win32/prstest.mak
Normal file
239
public/wintab/examples/prstest/win32/prstest.mak
Normal file
@@ -0,0 +1,239 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=prstest - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to prstest - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "prstest - Win32 Release" && "$(CFG)" !=\
|
||||
"prstest - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "prstest.mak" CFG="prstest - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "prstest - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "prstest - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "prstest - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
MTL=mktyplib.exe
|
||||
|
||||
!IF "$(CFG)" == "prstest - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\prstest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Prstest.obj"
|
||||
-@erase "$(INTDIR)\Prstest.res"
|
||||
-@erase "$(OUTDIR)\prstest.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\..\Include" /D "WIN32" /D "NDEBUG"\
|
||||
/D "_WINDOWS" /Fp"$(INTDIR)/prstest.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Prstest.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/prstest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:no /pdb:"$(OUTDIR)/prstest.pdb" /machine:I386\
|
||||
/out:"$(OUTDIR)/prstest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Prstest.obj" \
|
||||
"$(INTDIR)\Prstest.res"
|
||||
|
||||
"$(OUTDIR)\prstest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "prstest - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "prstest_"
|
||||
# PROP BASE Intermediate_Dir "prstest_"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "prstest_"
|
||||
# PROP Intermediate_Dir "prstest_"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\prstest_
|
||||
INTDIR=.\prstest_
|
||||
|
||||
ALL : "$(OUTDIR)\prstest.exe"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Prstest.obj"
|
||||
-@erase "$(INTDIR)\Prstest.res"
|
||||
-@erase "$(INTDIR)\vc40.idb"
|
||||
-@erase "$(INTDIR)\vc40.pdb"
|
||||
-@erase "$(OUTDIR)\prstest.exe"
|
||||
-@erase "$(OUTDIR)\prstest.ilk"
|
||||
-@erase "$(OUTDIR)\prstest.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\..\Include" /D "WIN32" /D\
|
||||
"_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/prstest.pch" /YX /Fo"$(INTDIR)/"\
|
||||
/Fd"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\prstest_/
|
||||
CPP_SBRS=.\.
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /win32
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)/Prstest.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/prstest.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
|
||||
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
|
||||
odbccp32.lib ..\..\..\lib\I386\wintab32.lib /nologo /subsystem:windows\
|
||||
/incremental:yes /pdb:"$(OUTDIR)/prstest.pdb" /debug /machine:I386\
|
||||
/out:"$(OUTDIR)/prstest.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\Prstest.obj" \
|
||||
"$(INTDIR)\Prstest.res"
|
||||
|
||||
"$(OUTDIR)\prstest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "prstest - Win32 Release"
|
||||
# Name "prstest - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "prstest - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "prstest - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Prstest\Prstest.c
|
||||
DEP_CPP_PRSTE=\
|
||||
"..\Msgpack.h"\
|
||||
"..\Prstest.h"\
|
||||
|
||||
|
||||
"$(INTDIR)\Prstest.obj" : $(SOURCE) $(DEP_CPP_PRSTE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=\wtkit125\Examples\Prstest\Prstest.rc
|
||||
DEP_RSC_PRSTES=\
|
||||
"..\Prstest.h"\
|
||||
|
||||
|
||||
!IF "$(CFG)" == "prstest - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\Prstest.res" : $(SOURCE) $(DEP_RSC_PRSTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Prstest.res" /i "\wtkit125\Examples\Prstest"\
|
||||
/d "NDEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "prstest - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\Prstest.res" : $(SOURCE) $(DEP_RSC_PRSTES) "$(INTDIR)"
|
||||
$(RSC) /l 0x409 /fo"$(INTDIR)/Prstest.res" /i "\wtkit125\Examples\Prstest"\
|
||||
/d "_DEBUG" $(SOURCE)
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
public/wintab/examples/prstest/win32/prstest.mdp
Normal file
BIN
public/wintab/examples/prstest/win32/prstest.mdp
Normal file
Binary file not shown.
23
public/wintab/examples/rule/msgpack.h
Normal file
23
public/wintab/examples/rule/msgpack.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* ------------------------------- msgpack.h -------------------------------- */
|
||||
/*------------------------------------------------------------------------------
|
||||
Selected message unpacking macros from windowsx.h
|
||||
to circumvent compile-time memory headaches.
|
||||
------------------------------------------------------------------------------*/
|
||||
#ifdef WIN32
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, MAKEWPARAM((UINT)(id),(UINT)(codeNotify)), (LPARAM)(HWND)(hwndCtl))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#else
|
||||
#define GET_WM_ACTIVATE_STATE(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_ID(wp, lp) (wp)
|
||||
#define GET_WM_COMMAND_HWND(wp, lp) (HWND)LOWORD(lp)
|
||||
#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(lp)
|
||||
#define FORWARD_WM_COMMAND(hwnd, id, hwndCtl, codeNotify, fn) \
|
||||
(void)(fn)((hwnd), WM_COMMAND, (WPARAM)(int)(id), MAKELPARAM((UINT)(hwndCtl), (codeNotify)))
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#endif
|
||||
|
||||
244
public/wintab/examples/rule/rule.c
Normal file
244
public/wintab/examples/rule/rule.c
Normal file
@@ -0,0 +1,244 @@
|
||||
/*------------------------------------------------------------------------------
|
||||
Rule - a simple WinTab program -- polling version.
|
||||
RICO 8/20/91
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <wintab.h>
|
||||
|
||||
#ifdef USE_X_LIB
|
||||
#include <wintabx.h>
|
||||
#endif
|
||||
|
||||
#define PACKETDATA (PK_X | PK_Y | PK_BUTTONS)
|
||||
#define PACKETMODE 0
|
||||
#include <pktdef.h>
|
||||
#include "rule.h"
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
#define Inch2Cm CASTFIX32(2.54)
|
||||
#define Cm2Inch CASTFIX32(1.0/2.54)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
char _szAppName[] = "Rule";
|
||||
HANDLE __hInstance = NULL; /* Our instance handle */
|
||||
|
||||
LRESULT FAR PASCAL RuleAppWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam);
|
||||
BOOL NEAR PASCAL RegisterAppWndClass (HANDLE hInstance);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
|
||||
LPSTR lpszCmdLine, int nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
HWND hWnd;
|
||||
|
||||
__hInstance = hInstance;
|
||||
|
||||
if (hPrevInstance == NULL)
|
||||
if (!RegisterAppWndClass(hInstance))
|
||||
return(0);
|
||||
|
||||
hWnd = CreateDialog( hInstance, _szAppName, NULL, NULL);
|
||||
|
||||
if (hWnd == NULL)
|
||||
return(0);
|
||||
|
||||
ShowWindow(hWnd, nCmdShow);
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
#ifdef USE_X_LIB
|
||||
_UnlinkWintab();
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
BOOL NEAR PASCAL RegisterAppWndClass (HANDLE hInstance)
|
||||
{
|
||||
WNDCLASS WndClass;
|
||||
|
||||
WndClass.style = 0;
|
||||
WndClass.lpfnWndProc = RuleAppWndProc;
|
||||
WndClass.cbClsExtra = 0;
|
||||
WndClass.cbWndExtra = DLGWINDOWEXTRA;
|
||||
WndClass.hInstance = hInstance;
|
||||
WndClass.hIcon = LoadIcon(hInstance, _szAppName);
|
||||
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||
WndClass.lpszMenuName = NULL;
|
||||
WndClass.lpszClassName = _szAppName;
|
||||
return(RegisterClass(&WndClass));
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
HCTX static NEAR TabletInit(HWND hWnd, FIX32 scale[])
|
||||
{
|
||||
LOGCONTEXT lcMine;
|
||||
|
||||
/* get default region */
|
||||
WTInfo(WTI_DEFCONTEXT, 0, &lcMine);
|
||||
|
||||
/* modify the digitizing region */
|
||||
strcpy(lcMine.lcName, "Rule Digitizing");
|
||||
lcMine.lcPktData = PACKETDATA;
|
||||
lcMine.lcPktMode = PACKETMODE;
|
||||
lcMine.lcMoveMask = 0;
|
||||
lcMine.lcBtnUpMask = lcMine.lcBtnDnMask;
|
||||
|
||||
/* output in 1000ths of cm */
|
||||
lcMine.lcOutOrgX = lcMine.lcOutOrgY = 0;
|
||||
lcMine.lcOutExtX = INT(scale[0] * lcMine.lcInExtX);
|
||||
lcMine.lcOutExtY = INT(scale[1] * lcMine.lcInExtY);
|
||||
|
||||
/* open the region */
|
||||
return WTOpen(hWnd, &lcMine, TRUE);
|
||||
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* return scaling factors in thousandths of cm per axis unit */
|
||||
static void TabletScaling(FIX32 scale[])
|
||||
{
|
||||
AXIS aXY[2];
|
||||
int i;
|
||||
UINT wDevice;
|
||||
|
||||
/* get the data */
|
||||
WTInfo(WTI_DEFCONTEXT, CTX_DEVICE, &wDevice);
|
||||
WTInfo(WTI_DEVICES+wDevice, DVC_X, &aXY[0]);
|
||||
WTInfo(WTI_DEVICES+wDevice, DVC_Y, &aXY[1]);
|
||||
|
||||
/* calculate the scaling factors */
|
||||
for (i = 0; i < 2; i++) {
|
||||
FIX_DIV(scale[i], CASTFIX32(1000), aXY[i].axResolution);
|
||||
if (aXY[i].axUnits == TU_INCHES) {
|
||||
FIX_MUL(scale[i], scale[i], Inch2Cm);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
DWORD nsqrt(DWORD x)
|
||||
{
|
||||
/* integer square root via Newton's method. */
|
||||
DWORD guess, oguess;
|
||||
|
||||
if (x <= 1)
|
||||
return x;
|
||||
|
||||
guess = 1;
|
||||
do
|
||||
{
|
||||
oguess = guess;
|
||||
guess = (guess + x/guess)/2;
|
||||
}
|
||||
while (labs(guess - oguess) > 1);
|
||||
|
||||
if (guess == oguess)
|
||||
guess++;
|
||||
|
||||
if (labs((guess * guess) - x) > labs((oguess * oguess) - x))
|
||||
guess = oguess;
|
||||
|
||||
return guess;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
LRESULT FAR PASCAL RuleAppWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static int inMode = ID_CLICK;
|
||||
static LONG x1 = 0, x2 = 0, y1 = 0, y2 = 0;
|
||||
static HCTX hTab = NULL;
|
||||
|
||||
static FIX32 scale[2];
|
||||
|
||||
PAINTSTRUCT psPaint;
|
||||
HDC hDC;
|
||||
|
||||
switch (wMsg) {
|
||||
|
||||
case WM_CREATE:
|
||||
TabletScaling(scale);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
if ((hTab = TabletInit(hWnd, scale)) != NULL) {
|
||||
PACKET pkt;
|
||||
|
||||
inMode = ID_PRESS;
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
|
||||
while (inMode != ID_CLICK) {
|
||||
|
||||
/* poll */
|
||||
if (!WTPacketsGet(hTab, 1, &pkt))
|
||||
continue;
|
||||
|
||||
/* handle it */
|
||||
if (inMode == ID_PRESS && pkt.pkButtons) {
|
||||
x1 = pkt.pkX;
|
||||
y1 = pkt.pkY;
|
||||
inMode = ID_RELEASE;
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
}
|
||||
if (inMode == ID_RELEASE && pkt.pkButtons == 0) {
|
||||
x2 = pkt.pkX;
|
||||
y2 = pkt.pkY;
|
||||
inMode = ID_CLICK;
|
||||
InvalidateRect(hWnd, NULL, TRUE);
|
||||
UpdateWindow(hWnd);
|
||||
}
|
||||
}
|
||||
WTClose(hTab);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
hDC = BeginPaint(hWnd, &psPaint);
|
||||
ShowWindow(GetDlgItem(hWnd, ID_CLICK), inMode == ID_CLICK);
|
||||
ShowWindow(GetDlgItem(hWnd, ID_PRESS), inMode == ID_PRESS);
|
||||
ShowWindow(GetDlgItem(hWnd, ID_RELEASE), inMode == ID_RELEASE);
|
||||
if (inMode == ID_CLICK) {
|
||||
LONG delta[3]; /* horz/vert/diag */
|
||||
int i;
|
||||
|
||||
delta[0] = labs(x2 - x1);
|
||||
delta[1] = labs(y2 - y1);
|
||||
delta[2] = nsqrt(delta[0] * delta[0] + delta[1] * delta[1]);
|
||||
|
||||
for (i = 0; i < 3; i++) { /* direction */
|
||||
char buf[20];
|
||||
|
||||
/* print result in cm */
|
||||
wsprintf(buf, "%d.%3.3d", (UINT)delta[i]/1000,
|
||||
(UINT)delta[i]%1000);
|
||||
SetWindowText(GetDlgItem(hWnd, ID_HC + i), buf);
|
||||
|
||||
/* convert to inches */
|
||||
delta[i] = INT(delta[i] * Cm2Inch);
|
||||
|
||||
/* print result in inches */
|
||||
wsprintf(buf, "%d.%3.3d", (UINT)delta[i]/1000,
|
||||
(UINT)delta[i]%1000);
|
||||
SetWindowText(GetDlgItem(hWnd, ID_HI + i), buf);
|
||||
}
|
||||
}
|
||||
EndPaint(hWnd, &psPaint);
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc(hWnd, wMsg, wParam, lParam);
|
||||
}
|
||||
return (LRESULT)0;
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
29
public/wintab/examples/rule/rule.dlg
Normal file
29
public/wintab/examples/rule/rule.dlg
Normal file
@@ -0,0 +1,29 @@
|
||||
DLGINCLUDE RCDATA DISCARDABLE
|
||||
BEGIN
|
||||
"RULE.H\0"
|
||||
END
|
||||
|
||||
Rule DIALOG 16, 65, 160, 100
|
||||
STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Rule"
|
||||
CLASS "Rule"
|
||||
FONT 8, "Helv"
|
||||
BEGIN
|
||||
LTEXT "Horizontal", 101, 5, 66, 44, 8
|
||||
LTEXT "Vertical", 102, 5, 74, 44, 8
|
||||
LTEXT "Diagonal", 103, 5, 82, 44, 8
|
||||
LTEXT "Inches", 104, 53, 54, 24, 8
|
||||
LTEXT "Centimeters", 105, 83, 54, 42, 8
|
||||
LTEXT "Click me to measure.", ID_CLICK, 8, 22, 138, 8
|
||||
LTEXT "Hold down a button to start.", ID_PRESS, 8, 30, 138, 8,
|
||||
NOT WS_VISIBLE
|
||||
LTEXT "Release the button to finish.", ID_RELEASE, 8, 38, 138,
|
||||
8, NOT WS_VISIBLE
|
||||
LTEXT "0", ID_HI, 53, 66, 24, 8
|
||||
LTEXT "0", ID_VI, 53, 74, 24, 8
|
||||
LTEXT "0", ID_DI, 53, 82, 24, 8
|
||||
LTEXT "0", ID_HC, 83, 66, 42, 8
|
||||
LTEXT "0", ID_VC, 83, 74, 42, 8
|
||||
LTEXT "0", ID_DC, 83, 82, 42, 8
|
||||
END
|
||||
|
||||
11
public/wintab/examples/rule/rule.h
Normal file
11
public/wintab/examples/rule/rule.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#define IDD_RULE 100
|
||||
#define ID_CLICK 106
|
||||
#define ID_PRESS 107
|
||||
#define ID_RELASE 108
|
||||
#define ID_HI 109
|
||||
#define ID_VI 110
|
||||
#define ID_DI 111
|
||||
#define ID_HC 112
|
||||
#define ID_VC 113
|
||||
#define ID_DC 114
|
||||
#define ID_RELEASE 115
|
||||
BIN
public/wintab/examples/rule/rule.ico
Normal file
BIN
public/wintab/examples/rule/rule.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
7
public/wintab/examples/rule/rule.rc
Normal file
7
public/wintab/examples/rule/rule.rc
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
#include "windows.h"
|
||||
#include "rule.h"
|
||||
|
||||
rcinclude rule.dlg
|
||||
Rule ICON rule.ico
|
||||
|
||||
17
public/wintab/examples/rule/win16/doswin16.mak
Normal file
17
public/wintab/examples/rule/win16/doswin16.mak
Normal file
@@ -0,0 +1,17 @@
|
||||
# If no CPUTYPE variable is defined, then we are running on a DOS system
|
||||
# so lets whack in some flags and switches to match the NTWIN32.MAK
|
||||
# settings:
|
||||
srcdir=..
|
||||
model=S
|
||||
rc=rc
|
||||
hcopts = -n
|
||||
cc = cl
|
||||
cdebug = -Zipel -Od
|
||||
cflags = -c -A$(model) -Gsw -W3 $(cdebug)
|
||||
cvars = -D$(ENV)
|
||||
linkdebug =
|
||||
link = link $(linkdebug)
|
||||
guiflags = /NOE /NOD /CO /align:16
|
||||
guilibs = libw $(model)libcew ver commdlg
|
||||
guilibsdll = libw $(model)dllcew ver commdlg
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user