sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// wins\specific\multitouch.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
#ifndef MULTITOUCH_H
|
sl@0
|
18 |
#define MULTITOUCH_H
|
sl@0
|
19 |
|
sl@0
|
20 |
#include <e32err.h>
|
sl@0
|
21 |
#include <emulator.h>
|
sl@0
|
22 |
#include <commctrl.h>
|
sl@0
|
23 |
#include "multitouchwindowsheader.h"
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef WM_INPUT
|
sl@0
|
26 |
#define WM_INPUT 0x00ff
|
sl@0
|
27 |
#endif
|
sl@0
|
28 |
|
sl@0
|
29 |
/**
|
sl@0
|
30 |
* The main class for Multitouch
|
sl@0
|
31 |
*/
|
sl@0
|
32 |
class DMultiTouch
|
sl@0
|
33 |
{
|
sl@0
|
34 |
public:
|
sl@0
|
35 |
DMultiTouch(TInt aProximityStep, TInt aPressureStep);
|
sl@0
|
36 |
void OnWmInput(HWND aHWnd,TUint aMessage,TUint aWParam,TUint aLParam,HWND aParentHwnd);
|
sl@0
|
37 |
void ShowPrimaryCursor(HWND aHWnd);
|
sl@0
|
38 |
static bool Init();
|
sl@0
|
39 |
static void ShowCursors();
|
sl@0
|
40 |
static void HideCursors();
|
sl@0
|
41 |
BOOL Register();
|
sl@0
|
42 |
BOOL UnRegister();
|
sl@0
|
43 |
|
sl@0
|
44 |
public:
|
sl@0
|
45 |
static int iNumberOfMice;
|
sl@0
|
46 |
static bool iMultiTouchSupported;
|
sl@0
|
47 |
static bool iMultiTouchCreated;
|
sl@0
|
48 |
static bool iMultiTouchTempEnabled;
|
sl@0
|
49 |
int iZMaxRange;
|
sl@0
|
50 |
int iPressureStep;
|
sl@0
|
51 |
int iProximityStep;
|
sl@0
|
52 |
int iMaxPressure;
|
sl@0
|
53 |
};
|
sl@0
|
54 |
|
sl@0
|
55 |
extern DMultiTouch* TheMultiTouch;
|
sl@0
|
56 |
extern void MultiTouchWndPointer(TUint message,TInt aXpos,TInt aYpos, TInt aPointerId, TInt aZ);
|
sl@0
|
57 |
|
sl@0
|
58 |
/**
|
sl@0
|
59 |
* The class of the Cursor Window
|
sl@0
|
60 |
*/
|
sl@0
|
61 |
class CursorWindow
|
sl@0
|
62 |
{
|
sl@0
|
63 |
public:
|
sl@0
|
64 |
CursorWindow();
|
sl@0
|
65 |
HWND Create(HMODULE hm, HWND hwndParent, int number);
|
sl@0
|
66 |
BOOL SetCursor(HCURSOR hc);
|
sl@0
|
67 |
void GetPosition(POINT& pt);
|
sl@0
|
68 |
void SetPosition(POINT& pt);
|
sl@0
|
69 |
void Show();
|
sl@0
|
70 |
void Hide();
|
sl@0
|
71 |
|
sl@0
|
72 |
HWND iHwnd;
|
sl@0
|
73 |
int iNumber;
|
sl@0
|
74 |
HCURSOR iCursor;
|
sl@0
|
75 |
POINT iHotspot;
|
sl@0
|
76 |
};
|
sl@0
|
77 |
|
sl@0
|
78 |
/**
|
sl@0
|
79 |
* The class encapsulating each mouse device
|
sl@0
|
80 |
*/
|
sl@0
|
81 |
class DMultiMouse
|
sl@0
|
82 |
{
|
sl@0
|
83 |
public:
|
sl@0
|
84 |
DMultiMouse();
|
sl@0
|
85 |
static TInt Add(RAWINPUTDEVICELIST& aDev);
|
sl@0
|
86 |
static DMultiMouse* Find(HANDLE aHandle);
|
sl@0
|
87 |
void HandleRawMouseEvent(RAWMOUSE& aEvent, HWND aWnd);
|
sl@0
|
88 |
void CreateCursor(LPVOID aArg, HWND aWnd);
|
sl@0
|
89 |
enum
|
sl@0
|
90 |
{KMaxMice = 8};
|
sl@0
|
91 |
|
sl@0
|
92 |
private:
|
sl@0
|
93 |
void CorrectSystemMouse();
|
sl@0
|
94 |
void ShowMousePos(HWND aHWnd);
|
sl@0
|
95 |
|
sl@0
|
96 |
private:
|
sl@0
|
97 |
int iX;
|
sl@0
|
98 |
int iY;
|
sl@0
|
99 |
int iZ;
|
sl@0
|
100 |
HANDLE iDevice;
|
sl@0
|
101 |
int iId;
|
sl@0
|
102 |
|
sl@0
|
103 |
public:
|
sl@0
|
104 |
bool iIsPrimary;
|
sl@0
|
105 |
CursorWindow iCursorWnd;
|
sl@0
|
106 |
|
sl@0
|
107 |
static DMultiMouse iMice[KMaxMice];
|
sl@0
|
108 |
static int iNumMice;
|
sl@0
|
109 |
static DMultiMouse* iPrimary;
|
sl@0
|
110 |
static int iMouseId;
|
sl@0
|
111 |
};
|
sl@0
|
112 |
|
sl@0
|
113 |
#endif
|