wintab16.c 13.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Tablet Win16
 *
 * Copyright 2002 Patrik Stridvall
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22
 */

#include "config.h"

23 24
#include <stdarg.h>

25
#include "windef.h"
26
#include "winbase.h"
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504

#include "wintab.h"

#include "wine/windef16.h"
#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(wintab);

/**********************************************************************/

#define DECLARE_HANDLE16(a) \
	typedef HANDLE16 a##16; \
	typedef a##16 *P##a##16; \
	typedef a##16 *NP##a##16; \
	typedef a##16 *LP##a##16

DECLARE_HANDLE16(HMGR);     /* manager handle */
DECLARE_HANDLE16(HCTX);     /* context handle */
DECLARE_HANDLE16(HWTHOOK);  /* hook handle */

/**********************************************************************/

typedef struct tagLOGCONTEXT16 {
    char    lcName[LCNAMELEN];
    UINT16  lcOptions;
    UINT16  lcStatus;
    UINT16  lcLocks;
    UINT16  lcMsgBase;
    UINT16  lcDevice;
    UINT16  lcPktRate;
    WTPKT   lcPktData;
    WTPKT   lcPktMode;
    WTPKT   lcMoveMask;
    DWORD   lcBtnDnMask;
    DWORD   lcBtnUpMask;
    LONG    lcInOrgX;
    LONG    lcInOrgY;
    LONG    lcInOrgZ;
    LONG    lcInExtX;
    LONG    lcInExtY;
    LONG    lcInExtZ;
    LONG    lcOutOrgX;
    LONG    lcOutOrgY;
    LONG    lcOutOrgZ;
    LONG    lcOutExtX;
    LONG    lcOutExtY;
    LONG    lcOutExtZ;
    FIX32   lcSensX;
    FIX32   lcSensY;
    FIX32   lcSensZ;
    BOOL16  lcSysMode;
    INT16   lcSysOrgX;
    INT16   lcSysOrgY;
    INT16   lcSysExtX;
    INT16   lcSysExtY;
    FIX32   lcSysSensX;
    FIX32   lcSysSensY;
} LOGCONTEXT16, *PLOGCONTEXT16, *NPLOGCONTEXT16, *LPLOGCONTEXT16;

/**********************************************************************/

typedef BOOL16 (WINAPI * WTENUMPROC16)(HCTX16, LPARAM);  /* changed CALLBACK->WINAPI, 1.1 */
typedef BOOL16 (WINAPI * WTCONFIGPROC16)(HCTX16, HWND16);
typedef LRESULT (WINAPI * WTHOOKPROC16)(INT16, WPARAM16, LPARAM);
typedef WTHOOKPROC16 *LPWTHOOKPROC16;

/***********************************************************************
 *		WTInfo (WINTAB.20)
 */
UINT16 WINAPI WTInfo16(UINT16 wCategory, UINT16 nIndex, LPVOID lpOutput)
{
    FIXME("(%hu, %hu, %p): stub\n", wCategory, nIndex, lpOutput);

    return 0;
}

/***********************************************************************
 *		WTOpen (WINTAB.21)
 */
HCTX16 WINAPI WTOpen16(HWND16 hWnd, LPLOGCONTEXT16 lpLogCtx, BOOL16 fEnable)
{
    FIXME("(0x%04hx, %p, %hu): stub\n", hWnd, lpLogCtx, fEnable);

    return 0;
}

/***********************************************************************
 *		WTClose (WINTAB.22)
 */
BOOL16 WINAPI WTClose16(HCTX16 hCtx)
{
    FIXME("(0x%04hx): stub\n", hCtx);

    return TRUE;
}

/***********************************************************************
 *		WTPacketsGet (WINTAB.23)
 */
INT16 WINAPI WTPacketsGet16(HCTX16 hCtx, INT16 cMaxPkts, LPVOID lpPkts)
{
    FIXME("(0x%04hx, %hd, %p): stub\n", hCtx, cMaxPkts, lpPkts);

    return 0;
}

/***********************************************************************
 *		WTPacket (WINTAB.24)
 */
BOOL16 WINAPI WTPacket16(HCTX16 hCtx, UINT16 wSerial, LPVOID lpPkt)
{
    FIXME("(0x%04hx, %hd, %p): stub\n", hCtx, wSerial, lpPkt);

    return FALSE;
}

/***********************************************************************
 *		WTEnable (WINTAB.40)
 */
BOOL16 WINAPI WTEnable16(HCTX16 hCtx, BOOL16 fEnable)
{
    FIXME("(0x%04hx, %hu): stub\n", hCtx, fEnable);

    return FALSE;
}

/***********************************************************************
 *		WTOverlap (WINTAB.41)
 */
BOOL16 WINAPI WTOverlap16(HCTX16 hCtx, BOOL16 fToTop)
{
    FIXME("(0x%04hx, %hu): stub\n", hCtx, fToTop);

    return FALSE;
}

/***********************************************************************
 *		WTConfig (WINTAB.60)
 */
BOOL16 WINAPI WTConfig16(HCTX16 hCtx, HWND16 hWnd)
{
    FIXME("(0x%04hx, 0x%04hx): stub\n", hCtx, hWnd);

    return FALSE;
}

/***********************************************************************
 *		WTGet (WINTAB.61)
 */
BOOL16 WINAPI WTGet16(HCTX16 hCtx, LPLOGCONTEXT16 lpLogCtx)
{
    FIXME("(0x%04hx, %p): stub\n", hCtx, lpLogCtx);

    return FALSE;
}

/***********************************************************************
 *		WTSet (WINTAB.62)
 */
BOOL16 WINAPI WTSet16(HCTX16 hCtx, LPLOGCONTEXT16 lpLogCtx)
{
    FIXME("(0x%04hx, %p): stub\n", hCtx, lpLogCtx);

    return FALSE;
}

/***********************************************************************
 *		WTExtGet (WINTAB.63)
 */
BOOL16 WINAPI WTExtGet16(HCTX16 hCtx, UINT16 wExt, LPVOID lpData)
{
    FIXME("(0x%04hx, %hu, %p): stub\n", hCtx, wExt, lpData);

    return FALSE;
}

/***********************************************************************
 *		WTExtSet (WINTAB.64)
 */
BOOL16 WINAPI WTExtSet16(HCTX16 hCtx, UINT16 wExt, LPVOID lpData)
{
    FIXME("(0x%04hx, %hu, %p): stub\n", hCtx, wExt, lpData);

    return FALSE;
}

/***********************************************************************
 *		WTSave (WINTAB.65)
 */
BOOL16 WINAPI WTSave16(HCTX16 hCtx, LPVOID lpSaveInfo)
{
    FIXME("(0x%04hx, %p): stub\n", hCtx, lpSaveInfo);

    return FALSE;
}

/***********************************************************************
 *		WTRestore (WINTAB.66)
 */
HCTX16 WINAPI WTRestore16(HWND16 hWnd, LPVOID lpSaveInfo, BOOL16 fEnable)
{
    FIXME("(0x%04hx, %p, %hu): stub\n", hWnd, lpSaveInfo, fEnable);

    return 0;
}

/***********************************************************************
 *		WTPacketsPeek (WINTAB.80)
 */
INT16 WINAPI WTPacketsPeek16(HCTX16 hCtx, INT16 cMaxPkts, LPVOID lpPkts)
{
    FIXME("(0x%04hx, %hd, %p): stub\n", hCtx, cMaxPkts, lpPkts);

    return 0;
}

/***********************************************************************
 *		WTDataGet (WINTAB.81)
 */
INT16 WINAPI WTDataGet16(HCTX16 hCtx, UINT16 wBegin, UINT16 wEnd,
			 INT16 cMaxPkts, LPVOID lpPkts, LPINT16 lpNPkts)
{
    FIXME("(0x%04hx, %hu, %hu, %hd, %p, %p): stub\n",
	  hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts);

    return 0;
}

/***********************************************************************
 *		WTDataPeek (WINTAB.82)
 */
INT16 WINAPI WTDataPeek16(HCTX16 hCtx, UINT16 wBegin, UINT16 wEnd,
			  INT16 cMaxPkts, LPVOID lpPkts, LPINT16 lpNPkts)
{
    FIXME("(0x%04hx, %hu, %hu, %hd, %p, %p): stub\n",
	  hCtx, wBegin, wEnd, cMaxPkts, lpPkts, lpNPkts);

    return 0;
}

/***********************************************************************
 *		WTQueuePackets (WINTAB.83)
 *
 * OBSOLETE IN WIN32!
 */
DWORD WINAPI WTQueuePackets16(HCTX16 hCtx)
{
    FIXME("(0x%04hx): stub\n", hCtx);

    return 0;
}

/***********************************************************************
 *		WTQueuePacketsEx (WINTAB.200)
 */
BOOL16 WINAPI WTQueuePacketsEx16(HCTX16 hCtx, UINT16 *lpOld, UINT16 *lpNew)
{
    FIXME("(0x%04hx, %p, %p): stub\n", hCtx, lpOld, lpNew);

    return TRUE;
}

/***********************************************************************
 *		WTQueueSizeGet (WINTAB.84)
 */
INT16 WINAPI WTQueueSizeGet16(HCTX16 hCtx)
{
    FIXME("(0x%04hx): stub\n", hCtx);

    return 0;
}

/***********************************************************************
 *		WTQueueSizeSet (WINTAB.85)
 */
BOOL16 WINAPI WTQueueSizeSet16(HCTX16 hCtx, INT16 nPkts)
{
    FIXME("(0x%04hx, %hd): stub\n", hCtx, nPkts);

    return FALSE;
}

/***********************************************************************
 *		WTMgrOpen (WINTAB.100)
 */
HMGR16 WINAPI WTMgrOpen16(HWND16 hWnd, UINT16 wMsgBase)
{
    FIXME("(0x%04hx, %hu): stub\n", hWnd, wMsgBase);

    return 0;
}

/***********************************************************************
 *		WTMgrClose (WINTAB.101)
 */
BOOL16 WINAPI WTMgrClose16(HMGR16 hMgr)
{
    FIXME("(0x%04hx): stub\n", hMgr);

    return FALSE;
}

/***********************************************************************
 *		WTMgrContextEnum (WINTAB.120)
 */
BOOL16 WINAPI WTMgrContextEnum16(HMGR16 hMgr, WTENUMPROC16 lpEnumFunc, LPARAM lParam)
{
    FIXME("(0x%04hx, %p, %ld): stub\n", hMgr, lpEnumFunc, lParam);

    return FALSE;
}

/***********************************************************************
 *		WTMgrContextOwner (WINTAB.121)
 */
HWND16 WINAPI WTMgrContextOwner16(HMGR16 hMgr, HCTX16 hCtx)
{
    FIXME("(0x%04hx, 0x%04hx): stub\n", hMgr, hCtx);

    return 0;
}

/***********************************************************************
 *		WTMgrDefContext (WINTAB.122)
 */
HCTX16 WINAPI WTMgrDefContext16(HMGR16 hMgr, BOOL16 fSystem)
{
    FIXME("(0x%04hx, %hu): stub\n", hMgr, fSystem);

    return 0;
}

/***********************************************************************
 *		WTMgrDefContextEx (WINTAB.206)
 *
 * 1.1
 */
HCTX16 WINAPI WTMgrDefContextEx16(HMGR16 hMgr, UINT16 wDevice, BOOL16 fSystem)
{
    FIXME("(0x%04hx, %hu, %hu): stub\n", hMgr, wDevice, fSystem);

    return 0;
}

/***********************************************************************
 *		WTMgrDeviceConfig (WINTAB.140)
 */
UINT16 WINAPI WTMgrDeviceConfig16(HMGR16 hMgr, UINT16 wDevice, HWND16 hWnd)
{
    FIXME("(0x%04hx, %hu, 0x%04hx): stub\n", hMgr, wDevice, hWnd);

    return 0;
}

/***********************************************************************
 *		WTMgrConfigReplace (WINTAB.141)
 *
 * OBSOLETE IN WIN32!
 */
BOOL16 WINAPI WTMgrConfigReplace16(HMGR16 hMgr, BOOL16 fInstall,
				   WTCONFIGPROC16 lpConfigProc)
{
    FIXME("(0x%04hx, %hu, %p): stub\n", hMgr, fInstall, lpConfigProc);

    return FALSE;
}

/***********************************************************************
 *		WTMgrConfigReplaceEx (WINTAB.202)
 */
BOOL16 WINAPI WTMgrConfigReplaceEx16(HMGR16 hMgr, BOOL16 fInstall,
				     LPSTR lpszModule, LPSTR lpszCfgProc)
{
    FIXME("(0x%04hx, %hu, %s, %s): stub\n", hMgr, fInstall,
	  debugstr_a(lpszModule), debugstr_a(lpszCfgProc));

    return FALSE;
}

/***********************************************************************
 *		WTMgrPacketHook (WINTAB.160)
 *
 * OBSOLETE IN WIN32!
 */
WTHOOKPROC16 WINAPI WTMgrPacketHook16(HMGR16 hMgr, BOOL16 fInstall,
				      INT16 nType, WTHOOKPROC16 lpFunc)
{
    FIXME("(0x%04hx, %hu, %hd, %p): stub\n", hMgr, fInstall, nType, lpFunc);

    return 0;
}

/***********************************************************************
 *		WTMgrPacketHookEx (WINTAB.203)
 */
HWTHOOK16 WINAPI WTMgrPacketHookEx16(HMGR16 hMgr, INT16 nType,
				     LPSTR lpszModule, LPSTR lpszHookProc)
{
    FIXME("(0x%04hx, %hd, %s, %s): stub\n", hMgr, nType,
	  debugstr_a(lpszModule), debugstr_a(lpszHookProc));

    return 0;
}

/***********************************************************************
 *		WTMgrPacketUnhook (WINTAB.204)
 */
BOOL16 WINAPI WTMgrPacketUnhook16(HWTHOOK16 hHook)
{
    FIXME("(0x%04hx): stub\n", hHook);

    return FALSE;
}

/***********************************************************************
 *		WTMgrPacketHookDefProc (WINTAB.161)
 *
 * OBSOLETE IN WIN32!
 */
LRESULT WINAPI WTMgrPacketHookDefProc16(INT16 nCode, WPARAM16 wParam,
					LPARAM lParam, LPWTHOOKPROC16 lplpFunc)
{
    FIXME("(%hd, %hu, %lu, %p): stub\n", nCode, wParam, lParam, lplpFunc);

    return 0;
}

/***********************************************************************
 *		WTMgrPacketHookNext (WINTAB.205)
 */
LRESULT WINAPI WTMgrPacketHookNext16(HWTHOOK16 hHook, INT16 nCode,
				     WPARAM16 wParam, LPARAM lParam)
{
    FIXME("(0x%04hx, %hd, %hu, %lu): stub\n", hHook, nCode, wParam, lParam);

    return 0;
}


/***********************************************************************
 *		WTMgrExt (WINTAB.180)
 */
BOOL16 WINAPI WTMgrExt16(HMGR16 hMgr, UINT16 wExt, LPVOID lpData)
{
    FIXME("(0x%04hx, %hu, %p): stub\n", hMgr, wExt, lpData);

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrEnable (WINTAB.181)
 */
BOOL16 WINAPI WTMgrCsrEnable16(HMGR16 hMgr, UINT16 wCursor, BOOL16 fEnable)
{
    FIXME("(0x%04hx, %hu, %hu): stub\n", hMgr, wCursor, fEnable);

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrButtonMap (WINTAB.182)
 */
BOOL16 WINAPI WTMgrCsrButtonMap16(HMGR16 hMgr, UINT16 wCursor,
				  LPBYTE lpLogBtns, LPBYTE lpSysBtns)
{
    FIXME("(0x%04hx, %hu, %p, %p): stub\n", hMgr, wCursor, lpLogBtns, lpSysBtns);

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrPressureBtnMarks (WINTAB.183)
 *
 * OBSOLETE IN WIN32! (But only according to documentation)
 */
BOOL16 WINAPI WTMgrCsrPressureBtnMarks16(HMGR16 hMgr, UINT16 wCsr,
					 DWORD dwNMarks, DWORD dwTMarks)
{
505
    FIXME("(0x%04hx, %hu, %u, %u): stub\n", hMgr, wCsr, dwNMarks, dwTMarks);
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrPressureBtnMarksEx (WINTAB.201)
 */
BOOL16 WINAPI WTMgrCsrPressureBtnMarksEx16(HMGR16 hMgr, UINT16 wCsr,
					   UINT16 *lpNMarks, UINT16 *lpTMarks)
{
    FIXME("(0x%04hx, %hu, %p, %p): stub\n", hMgr, wCsr, lpNMarks, lpTMarks);

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrPressureResponse (WINTAB.184)
 */
BOOL16 WINAPI WTMgrCsrPressureResponse16(HMGR16 hMgr, UINT16 wCsr,
					 UINT16 *lpNResp, UINT16 *lpTResp)
{
    FIXME("(0x%04hx, %hu, %p, %p): stub\n", hMgr, wCsr, lpNResp, lpTResp);

    return FALSE;
}

/***********************************************************************
 *		WTMgrCsrExt (WINTAB.185)
 */
BOOL16 WINAPI WTMgrCsrExt16(HMGR16 hMgr, UINT16 wCsr, UINT16 wExt, LPVOID lpData)
{
    FIXME("(0x%04hx, %hu, %hu, %p): stub\n", hMgr, wCsr, wExt, lpData);

    return FALSE;
}