|
1 // Copyright (c) 2000-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 "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 // Defines the screen device class |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __SCRDEV_H__ |
|
19 #define __SCRDEV_H__ |
|
20 |
|
21 #ifndef __E32STD_H__ |
|
22 #include <e32std.h> |
|
23 #endif |
|
24 #ifndef __E32BASE_H__ |
|
25 #include <e32base.h> |
|
26 #endif |
|
27 #ifndef __OBJECT_H__ |
|
28 #include "OBJECT.H" |
|
29 #endif |
|
30 #ifndef __SCREEN_H__ |
|
31 #include "screen.h" |
|
32 #endif |
|
33 |
|
34 class DWsBitmap : public CWsObject |
|
35 { |
|
36 public: |
|
37 DWsBitmap(CWsClient *aOwner); |
|
38 void ConstructL(const TWsClCmdCreateBitmap &aParams); |
|
39 inline CFbsBitmap *FbsBitmap() const; |
|
40 void CommandL(TInt aOpcode, const TAny *aCmdData); |
|
41 void CloseObject(); |
|
42 void IncRefCount(); |
|
43 void DecRefCount(); |
|
44 private: |
|
45 ~DWsBitmap(); |
|
46 private: |
|
47 enum // Flags |
|
48 { |
|
49 EWsBitmapClientObjectFreed = 0x00000001 // Set if the associated CWsBitmap object has been deleted |
|
50 }; |
|
51 private: |
|
52 CFbsBitmap *iFbsBitmap; |
|
53 TInt iRefCount; |
|
54 TUint32 iFlags; |
|
55 }; |
|
56 |
|
57 class DWsScreenDevice : public CWsScreenObject |
|
58 { |
|
59 public: |
|
60 DWsScreenDevice(CWsClient* aOwner, TInt aDefaultScreenNumber, TUint aClientScreenDevicePointer); |
|
61 ~DWsScreenDevice(); |
|
62 void CommandL(TInt aOpcode, const TAny *aCmdData); |
|
63 void ConstructL(); |
|
64 void GetDefaultScreenSizeAndRotationCmd(); |
|
65 void GetDefaultScreenSizeAndRotationCmd2(); |
|
66 void GetScreenSizeAndRotationCmd(TInt aMode); |
|
67 void GetScreenSizeAndRotationCmd2(TInt aMode); |
|
68 void GetScreenModeOriginCmd(TInt aMode); |
|
69 void GetScreenScale(TInt aMode); |
|
70 void SetAppScreenMode(TInt aMode); |
|
71 void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSar); |
|
72 void SetScreenSizeAndRotation(const TPixelsAndRotation &aSar); |
|
73 TBool ScreenDeviceValidState() const; |
|
74 void SetPaletteL(); |
|
75 void GetPalette(TInt aNumColors); |
|
76 inline TPoint ScreenModeOrigin(); |
|
77 void GetCurrentScreenModeAttributes(); |
|
78 void SetCurrentScreenModeAttributes(const TSizeMode &aModeData); |
|
79 // |
|
80 inline CFbsBitGc::TGraphicsOrientation Orientation(); |
|
81 void NewOrientation(TInt aMode,CFbsBitGc::TGraphicsOrientation aRotation); |
|
82 void SetScreenMode(TInt aMode); |
|
83 inline TInt AppMode(); |
|
84 void GetScreenModeDisplayMode(TInt aMode); |
|
85 inline TDisplayMode DefaultDisplayMode(); |
|
86 TUint ClientDevicePointer(); |
|
87 private: |
|
88 void CopyScreenToBitmapL(const TRect &aRect, TInt aHandle); |
|
89 void SetScreenDeviceValidStates(const DWsScreenDevice *aDevice); |
|
90 private: |
|
91 // Non-static app specific data |
|
92 TSize iAppScreenSizeInPixels; |
|
93 TSize iAppScreenSizeInTwips; |
|
94 CFbsBitGc::TGraphicsOrientation iAppRotation; |
|
95 TInt iAppMode; |
|
96 TSize iAppScale; |
|
97 TUint iClientScreenDevicePointer; //This is the pointer to the screen device on the client side CWsScreenDevice |
|
98 }; |
|
99 |
|
100 |
|
101 // |
|
102 // inlines // |
|
103 // |
|
104 |
|
105 // |
|
106 // DWsScreenDevice |
|
107 // |
|
108 inline CFbsBitGc::TGraphicsOrientation DWsScreenDevice::Orientation() |
|
109 {return iAppRotation;} |
|
110 inline TInt DWsScreenDevice::AppMode() |
|
111 {return iAppMode;} |
|
112 inline TPoint DWsScreenDevice::ScreenModeOrigin() |
|
113 {return iScreen->ScreenModeOrigin(iAppMode);} |
|
114 inline TDisplayMode DWsScreenDevice::DefaultDisplayMode() |
|
115 {return iScreen->DefaultDisplayMode(iAppMode);} |
|
116 |
|
117 // |
|
118 // DWsBitmap |
|
119 // |
|
120 inline CFbsBitmap* DWsBitmap::FbsBitmap() const |
|
121 {return(iFbsBitmap);} |
|
122 |
|
123 #endif |