windowing/windowserver/nga/SERVER/ScrDev.H
changeset 0 5d03bc08d59c
child 26 15986eb6c500
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     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 #include <graphics/wsdisplaymapping.h>
       
    35 #include <graphics/wsscreendeviceutils.h>
       
    36 
       
    37 class DWsBitmap : public CWsObject
       
    38 	{
       
    39 public:
       
    40 	DWsBitmap(CWsClient *aOwner);
       
    41 	void ConstructL(const TWsClCmdCreateBitmap &aParams);
       
    42 	inline CFbsBitmap *FbsBitmap() const;
       
    43 	void CommandL(TInt aOpcode, const TAny *aCmdData);
       
    44 	void CloseObject();
       
    45 	void IncRefCount();
       
    46 	void DecRefCount();
       
    47 private:
       
    48 	~DWsBitmap();
       
    49 private:
       
    50 	enum // Flags
       
    51 		{
       
    52 		EWsBitmapClientObjectFreed = 0x00000001 // Set if the associated CWsBitmap object has been deleted
       
    53 		};
       
    54 private:
       
    55 	CFbsBitmap *iFbsBitmap;
       
    56 	TInt iRefCount;
       
    57 	TUint32 iFlags;
       
    58 	};
       
    59 
       
    60 class MWsTestScreenCapture;
       
    61 
       
    62 class DWsScreenDevice : public CWsScreenObject, public MWsScreenDeviceUtils
       
    63 	{
       
    64 public:
       
    65 	DWsScreenDevice(CWsClient* aOwner, TInt aDefaultScreenNumber, TUint aClientScreenDevicePointer);
       
    66 	~DWsScreenDevice();
       
    67 	void CommandL(TInt aOpcode, const TAny *aCmdData);
       
    68 	void ExtensionCommandL(TInt aOpcode, const TAny *aCmdData);
       
    69 	void ConstructL();
       
    70 	void GetDefaultScreenSizeAndRotationCmd();
       
    71 	void GetDefaultScreenSizeAndRotationCmd2();
       
    72 	void GetScreenSizeAndRotationCmd(TInt aMode);
       
    73 	void GetScreenSizeAndRotationCmd2(TInt aMode);
       
    74 	void SetAppScreenMode(TInt aMode);
       
    75 	void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSar);
       
    76 	void SetScreenSizeAndRotation(const TPixelsAndRotation &aSar);
       
    77 	TBool ScreenDeviceValidState() const;
       
    78 	void SetPaletteL();
       
    79 	void GetPalette(TInt aNumColors);
       
    80 	void GetCurrentScreenModeAttributes();
       
    81 	void SetCurrentScreenModeAttributes(const TSizeMode &aModeData);
       
    82 //
       
    83 	inline CFbsBitGc::TGraphicsOrientation Orientation();
       
    84 	void NewOrientation(TInt aMode,CFbsBitGc::TGraphicsOrientation aRotation);
       
    85 	void SetScreenMode(TInt aMode);
       
    86 	inline TInt AppMode();
       
    87 	void GetScreenModeDisplayMode(TInt aMode);
       
    88 	inline TDisplayMode DefaultDisplayMode();
       
    89 	TUint ClientDevicePointer();
       
    90 	void TestScreenCaptureL(const TAny* aMessage);
       
    91 private:
       
    92 	void CopyScreenToBitmapL(const TRect &aRect, TInt aHandle);
       
    93 	void SetScreenDeviceValidStates(const DWsScreenDevice *aDevice);
       
    94 	void PanicCurrentClient(TClientPanic aPanic);
       
    95 	TSize AppScreenSizeInPixels()const;
       
    96 	TSize AppScreenSizeInTwips()const;
       
    97 
       
    98 	// Implementing MWsTestScreenCaptureUtils
       
    99 	void PanicCurrentClient(TInt aPanic);
       
   100 	void SetReply(TInt aReply);
       
   101 	void RedrawNowIfPending();
       
   102 	void ReplyBuf(const TAny* aSource, TInt aLength);
       
   103 private:
       
   104 // Non-static app specific data
       
   105 	TSize iAppScreenSizeInPixels;
       
   106 	TSize iAppScreenSizeInTwips;
       
   107 	CFbsBitGc::TGraphicsOrientation iAppRotation;
       
   108 	TInt iAppMode;
       
   109 	TUint iClientScreenDevicePointer; //This is the pointer to the screen device on the client side CWsScreenDevice
       
   110 	MWsDisplayControl* iDispCont;
       
   111 	MWsDisplayMapping* iDispMap;
       
   112 	MWsTestScreenCapture* iTestScreenCapture;
       
   113 	};
       
   114 
       
   115 
       
   116 //
       
   117 // inlines			//
       
   118 //
       
   119 
       
   120 //
       
   121 // DWsScreenDevice
       
   122 //
       
   123 inline CFbsBitGc::TGraphicsOrientation DWsScreenDevice::Orientation()
       
   124 	{return iAppRotation;}
       
   125 inline TInt DWsScreenDevice::AppMode()
       
   126 	{return iAppMode;}
       
   127 inline TDisplayMode DWsScreenDevice::DefaultDisplayMode()
       
   128 	{return iScreen->DefaultDisplayMode(iAppMode);}
       
   129 
       
   130 //
       
   131 // DWsBitmap
       
   132 //
       
   133 inline CFbsBitmap* DWsBitmap::FbsBitmap() const
       
   134 	{return(iFbsBitmap);}
       
   135 
       
   136 #endif