os/boardsupport/emulator/emulatorbsp/specific/multitouch.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/emulator/emulatorbsp/specific/multitouch.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// wins\specific\multitouch.h
    1.18 +// 
    1.19 +//
    1.20 +#ifndef MULTITOUCH_H
    1.21 +#define MULTITOUCH_H
    1.22 +
    1.23 +#include <e32err.h>
    1.24 +#include <emulator.h>
    1.25 +#include <commctrl.h>
    1.26 +#include "multitouchwindowsheader.h"
    1.27 +
    1.28 +#ifndef WM_INPUT
    1.29 +#define WM_INPUT 0x00ff
    1.30 +#endif
    1.31 +
    1.32 +/**
    1.33 + * The main class for Multitouch
    1.34 +*/
    1.35 +class DMultiTouch
    1.36 +	{
    1.37 +public:
    1.38 +	DMultiTouch(TInt aProximityStep, TInt aPressureStep);
    1.39 +	void OnWmInput(HWND aHWnd,TUint aMessage,TUint aWParam,TUint aLParam,HWND aParentHwnd);
    1.40 +	void ShowPrimaryCursor(HWND aHWnd);
    1.41 +	static bool Init();
    1.42 +	static void ShowCursors();
    1.43 +	static void HideCursors();
    1.44 +	BOOL Register();
    1.45 +	BOOL UnRegister();
    1.46 +
    1.47 +public:
    1.48 +	static int iNumberOfMice;
    1.49 +	static bool iMultiTouchSupported;
    1.50 +	static bool iMultiTouchCreated;
    1.51 +	static bool iMultiTouchTempEnabled;
    1.52 +	int iZMaxRange;
    1.53 +	int iPressureStep;
    1.54 +	int iProximityStep;
    1.55 +	int iMaxPressure;	
    1.56 +	};
    1.57 +
    1.58 +extern DMultiTouch* TheMultiTouch;
    1.59 +extern void MultiTouchWndPointer(TUint message,TInt aXpos,TInt aYpos, TInt aPointerId, TInt aZ);
    1.60 +
    1.61 +/**
    1.62 + * The class of the Cursor Window
    1.63 + */
    1.64 +class CursorWindow
    1.65 +{
    1.66 +public:
    1.67 +	CursorWindow();
    1.68 +	HWND Create(HMODULE hm, HWND hwndParent, int number);
    1.69 +	BOOL SetCursor(HCURSOR hc);
    1.70 +	void GetPosition(POINT& pt);
    1.71 +	void SetPosition(POINT& pt);
    1.72 +	void Show();
    1.73 +	void Hide();
    1.74 +
    1.75 +	HWND iHwnd;
    1.76 +	int iNumber;
    1.77 +	HCURSOR iCursor;
    1.78 +	POINT iHotspot;
    1.79 +};
    1.80 +
    1.81 +/**
    1.82 + * The class encapsulating each mouse device
    1.83 + */
    1.84 +class DMultiMouse
    1.85 +	{
    1.86 +public:
    1.87 +	DMultiMouse();
    1.88 +	static TInt Add(RAWINPUTDEVICELIST& aDev);
    1.89 +	static DMultiMouse* Find(HANDLE aHandle);
    1.90 +	void HandleRawMouseEvent(RAWMOUSE& aEvent, HWND aWnd);
    1.91 +	void CreateCursor(LPVOID aArg, HWND aWnd);
    1.92 +	enum
    1.93 +		{KMaxMice = 8};
    1.94 +
    1.95 +private:
    1.96 +	void CorrectSystemMouse();
    1.97 +	void ShowMousePos(HWND aHWnd);
    1.98 +
    1.99 +private:
   1.100 +	int iX;
   1.101 +	int iY;
   1.102 +	int iZ;
   1.103 +	HANDLE iDevice;
   1.104 +	int iId;
   1.105 +
   1.106 +public:
   1.107 +	bool iIsPrimary;
   1.108 +	CursorWindow iCursorWnd;
   1.109 +
   1.110 +	static DMultiMouse iMice[KMaxMice];
   1.111 +	static int iNumMice;
   1.112 +	static DMultiMouse* iPrimary;
   1.113 +	static int iMouseId;
   1.114 +	};
   1.115 +
   1.116 +#endif