os/graphics/windowing/windowserver/nonnga/SERVER/cliwin.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-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 // CWsClientWindow and associated classes definitions
    15 // 
    16 //
    17 
    18 #ifndef __CLIWIN_H__
    19 #define __CLIWIN_H__
    20 
    21 #include "server.h"
    22 #include "window.h"
    23 
    24 class CWsClientWindow : public CWsWindow
    25 	{
    26 protected:
    27 	enum
    28 		{
    29 		KWinRedrawPriBitsPerLevel=4,
    30 		KWinRedrawPriMaxOrdinal=(1<<KWinRedrawPriBitsPerLevel)-1,		// 15
    31 		KWinRedrawPriMaxLevel=32/KWinRedrawPriBitsPerLevel-1,			// 7
    32 		};
    33 				
    34 public:
    35   	CWsClientWindow(CWsClient* aOwner, CScreen* aScreen);
    36 	~CWsClientWindow();
    37 	virtual void ConstructL(const TWsClCmdCreateWindow &aCmd,CWsWindowBase *aParent, TBool aScreenDeviceIsInvalid);
    38 	CWsClientWindow *Child() const;
    39 	inline CWsClientWindow *PrevSibling() const;
    40 	inline CWsClientWindow *NextSibling() const;
    41 	inline CWsClientWindow *PrevSiblingMultiParent() const;
    42 	inline CWsClientWindow *NextSiblingMultiParent() const;
    43 	virtual const TRegion& WindowArea() const;
    44 	virtual void GenerateWindowRegion(RWsRegion &aRegion) const;
    45 	void GenerateTopRegion(RWsRegion &aRegion) const;
    46 	
    47 public:	// from CWsObject
    48 	virtual void CommandL(TInt aOpcode, const TAny *aCmdData);
    49 
    50 public: // from MWsWindow
    51 	virtual void Invalidate(const TRect * aRect = 0);
    52 	
    53 public:
    54 	void GcActivated(CWsGc *aGc);
    55 	void GcDeactivated(CWsGc *aGc);
    56 	void ResetHiddenFlag();
    57 	void SetClippedBaseArea(RWsRegion &aRegion) const;
    58 	void SetOpaqueClippedBaseArea(RWsRegion &aRegion) const;
    59 	inline const TRegion *BaseArea() const;
    60 	virtual TUint RedrawPriority(TInt *aShift=NULL) const;
    61 	inline void UpdateAnimArea();
    62 	void AddKeyRectL(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
    63 	void RemoveAllKeyRects();
    64 	void SetVisible(TBool aState);
    65 	inline TBool IsFadeBehind() const;
    66 //
    67 	TBool IsHidden();
    68 	void SetFaded(TBool aFade,TUint8 aBlackMap,TUint8 aWhiteMap); 
    69 	void RecalcChildAbs(const TPoint *aOffset);
    70 	void ResetHiddenFlagsInParentAndChildren();
    71 	static inline void SetAbsoluteFading(TBool aAbsoluteFading);
    72 	inline const TRegion * GetUserOpaqueRegion();
    73 	void OffsetUserTransparentRegion(const TPoint& aOffset);
    74 	void SetUserOpaqueRegion();
    75 	void ReactivateGcs();
    76 	void ScheduleRegionUpdate(const TRegion* aDefinitelyDirty);
    77 	
    78 	void DoMoveWindowToGroupL(TInt aIdentifier);
    79 	void SetScreenDeviceValidState(TBool aState);
    80 	TBool SetScreenDeviceValidStateFlag(TBool aState);
    81 	void SetInactive();
    82 protected:
    83 	void Activate();
    84 	void SetExtentL(const TPoint *aPos, const TSize *aSize);
    85 	static void ClipWindows(TRegion &region,const CWsClientWindow *start, const CWsClientWindow *end, TBool aClipTranslucent);
    86 	void GenerateArea(RWsRegion &aArea, TBool aClipTranslucent) const;
    87 	void SetAbsFromRel();
    88 	void Scroll(const TRect &aClipRect, const TPoint &aPoint, const TRect &aRect);
    89 	void CalcBaseArea();
    90 	void OffsetBaseArea(const TPoint &aOffset);
    91 	void DeleteBaseArea();
    92 	void SetCornerTypeL(TCornerType aType, TInt aFlags, TRegion *aNewBaseArea=NULL);
    93 	void ResetHiddenFlags();
    94 	TDblQue<TPointerKeyList> *PointerKeyList() const;
    95 	void SetUserTransparentRegion(RWsRegion* aRegion);
    96 	// from CWsWindowBase thru CWsWindow
    97 	TBool IsDSAHost() const;
    98 	
    99 private:
   100 	TInt iCornerData;
   101 	TUint iBackupsRequested;
   102 	TRegion *iBaseArea;			// The base area of the window without any clipping from windows taken into account
   103 	TDblQue<TPointerKeyList> *iPointerKeyList;
   104 	static TBool iAbsoluteFading;
   105 	/**
   106 	By default the full window region is transparent if the window is marked 
   107 	as transparent. If this is not the desired behaviour the client can
   108 	define the transparent region itself.
   109 	
   110 	@see RWindow::SetTransparentRegion()
   111 	*/
   112 	RWsRegion* iUserDefinedTransparentRegion;
   113 	RWsRegion* iUserDefinedOpaqueRegion;
   114 	};
   115 
   116 inline CWsClientWindow *CWsClientWindow::Child() const
   117 	{
   118 	return((CWsClientWindow *)iChild);
   119 	}
   120 
   121 inline CWsClientWindow *CWsClientWindow::NextSibling() const
   122 	{
   123 	return((CWsClientWindow *)iSibling);
   124 	}
   125 
   126 inline CWsClientWindow *CWsClientWindow::PrevSibling() const
   127 	{
   128 	return((CWsClientWindow *)GetPrevSibling());
   129 	}
   130 
   131 inline const TRegion *CWsClientWindow::BaseArea() const
   132 	{
   133 	return iBaseArea;
   134 	}
   135 
   136 inline void CWsClientWindow::UpdateAnimArea()
   137 	{
   138 	iRedraw->UpdateAnimArea();
   139 	}
   140 
   141 inline TBool CWsClientWindow::IsFadeBehind() const
   142 	{
   143 	return(iFlags&EFlagFadeBehind);
   144 	}
   145 
   146 inline void CWsClientWindow::SetAbsoluteFading(TBool aAbsoluteFading)
   147 	{
   148 	iAbsoluteFading=aAbsoluteFading;
   149 	}
   150 
   151 inline CWsClientWindow *CWsClientWindow::PrevSiblingMultiParent() const
   152 	{
   153 	return((CWsClientWindow *)CWsWindowBase::PrevSiblingMultiParent());
   154 	}
   155 
   156 inline CWsClientWindow *CWsClientWindow::NextSiblingMultiParent() const
   157 	{
   158 	return((CWsClientWindow *)CWsWindowBase::NextSiblingMultiParent());
   159 	}
   160 
   161 inline const TRegion * CWsClientWindow::GetUserOpaqueRegion()
   162 	{
   163 	return iUserDefinedOpaqueRegion;
   164 	}
   165 	
   166 #endif