|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // omap3530\beagle_variant\inc\serialmouse.h |
|
15 // Header for serial mouse driver |
|
16 // |
|
17 |
|
18 #ifndef __VSERIALMOUSE_H__ |
|
19 #define __VSERIALMOUSE_H__ |
|
20 |
|
21 #include <e32cmn.h> |
|
22 #include <assp/omap3530_assp/omap3530_uart.h> |
|
23 |
|
24 |
|
25 class TSerialMouse |
|
26 { |
|
27 public: |
|
28 TSerialMouse(); |
|
29 ~TSerialMouse(); |
|
30 TInt Create(); |
|
31 static void Isr(TAny* aPtr); |
|
32 TInt HalFunction(TInt aFunction, TAny* a1, TAny* a2); |
|
33 |
|
34 private: |
|
35 static void KeyDfcFn(TAny* aPtr); |
|
36 inline void KeyDfc(); |
|
37 |
|
38 TInt Scale(const TInt& aVal); |
|
39 void Clip(TInt& aX, TInt& aY); |
|
40 void GetScreenInfo(); |
|
41 |
|
42 enum TState { ENormal, EEscapingStart, EEscapingType1, EEscapingType2 }; |
|
43 private: |
|
44 TDfc iKeyDfc; |
|
45 TUint iKey; |
|
46 TInt iDebugPort; |
|
47 TState iState; |
|
48 Omap3530Uart::TUart iUart; |
|
49 TUint iPrmClientId; |
|
50 |
|
51 private: |
|
52 TInt iScreenWidth; |
|
53 TInt iScreenHeight; |
|
54 TInt iByteIndex; |
|
55 TUint8 iB0; |
|
56 TUint8 iB1; |
|
57 TUint8 iB2; |
|
58 TInt iX; |
|
59 TInt iY; |
|
60 TInt iLastX; |
|
61 TInt iLastY; |
|
62 TBool iLastLeftButtonDown; |
|
63 TBool iLastRightButtonDown; |
|
64 |
|
65 #ifdef _FRAME_BUFFER_CURSOR_ |
|
66 void DrawCursor(TInt x, TInt y); |
|
67 void Blit(TInt x, TInt y, TUint16 aColour); |
|
68 TUint8* iVideoAddress; |
|
69 TUint16* iCursorBuffer; |
|
70 #endif |
|
71 |
|
72 }; |
|
73 |
|
74 |
|
75 #endif /* __VSERIALMOUSE_H__ */ |