1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/nga/SERVER/windowgroup.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,229 @@
1.4 +// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// CWsWindow and associated classes definitions
1.18 +//
1.19 +//
1.20 +
1.21 +#ifndef __WINDOWGROUP_H__
1.22 +#define __WINDOWGROUP_H__
1.23 +
1.24 +#include "server.h"
1.25 +#include "tcursor.h"
1.26 +
1.27 +class CWsWindowGroup : public CWsWindowBase, public MWsWindowGroup
1.28 + {
1.29 +private:
1.30 + enum {EMaxIdentifierCount=10000}; // Could go as high as the highest signed int, but this would be impractical to test
1.31 + enum TGroupWindowFlags {
1.32 + EGroupFlagDisableKeyClick=0x01,
1.33 + EGroupFlagReceivesFocus= 0x02,
1.34 + EGroupFlagAutoForeground= 0x04,
1.35 + EGroupFlagHandlesDeviceChange= 0x08,
1.36 + EGroupFlagScreenDeviceDeleted= 0x10,
1.37 + EGroupFlagMsgQueueActive= 0x20,
1.38 + EGroupFlagMsgQueueNew= 0x40,
1.39 + EGroupFlagMessageSignalled= 0x80,
1.40 + };
1.41 +public:
1.42 + static CWsWindowGroup* NewL(CWsClient* aOwner, CScreen* aScreen,
1.43 + const TWsClCmdCreateWindowGroup& aCmd);
1.44 + ~CWsWindowGroup();
1.45 +private:
1.46 + CWsWindowGroup(CWsClient* aOwner,CScreen* aScreen);
1.47 + void ConstructL(const TWsClCmdCreateWindowGroup &aCmd);
1.48 +public: // virtual functions from CWsObject
1.49 + void CommandL(TInt aOpcode, const TAny *aCmdData);
1.50 +public: // virtual functions from CWsWindowBase
1.51 + TPoint Origin() const;
1.52 + TRect AbsRect() const;
1.53 + TSize Size() const;
1.54 + void SendState(MWsWindowTreeObserver& aWindowTreeObserver) const;
1.55 + void SendStateWindowGroupChain(MWsWindowTreeObserver& aWindowTreeObserver) const;
1.56 +
1.57 +public: // virtual functions from MWsWindowGroup
1.58 + TInt Identifier() const;
1.59 + TPtrC Name() const;
1.60 + TBool IsFocusable() const;
1.61 + TInt OrdinalPriority() const;
1.62 + const MWsClient * Client() const;
1.63 +
1.64 +public:
1.65 + CWsTopClientWindow *Child() const;
1.66 + inline CWsWindowGroup *PrevSibling() const;
1.67 + inline CWsWindowGroup *NextSibling() const;
1.68 + CWsRootWindow *Parent() const;
1.69 + virtual void AreaCovered(TRegion &aRegion);
1.70 + void UpdateOrdinalPriority(TBool aDoAdjust);
1.71 + void LostFocus();
1.72 + void ReceivedFocus();
1.73 + inline RWsTextCursor *TextCursor();
1.74 + inline TBool ReceivesFocus() const;
1.75 + static TInt NumWindowGroups(TBool aAllPriorities, TInt aPriority);
1.76 + static TInt SendWindowGroupListAndChainL(TBool aAllPriorities, TInt aPriority, TInt aCount);
1.77 + static TBool SendEventToAllGroups(TBool aAllPriorities,TBool aOnePerClient,const TWsClCmdSendEventToWindowGroup& aData);
1.78 + static void SendMessageToAllGroupsL(CWsClient& aSender,TBool aAllPriorities,const TWsClCmdSendMessageToWindowGroup& aData);
1.79 + static void GetFocusWindowGroupL();
1.80 + static void ReleasePendedMessagesToAllGroups(CWsClient * aClient);
1.81 + virtual void SetOrdinalPosition(TInt pos);
1.82 + TBool SetOrdinalPosition(TInt pos,CWsWindowGroup *aClosingWindow);
1.83 + void SetOrdinalPriority(TInt aPos, TInt aPriority);
1.84 + void QueueMessageL(TUid aUid, TInt aDataLength, CWsClient& aSender);
1.85 + void AddPriorityKeyL(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
1.86 + void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifiers);
1.87 + void RemoveAllPriorityKeys();
1.88 + TBool CheckForPriorityKey(const TKeyEvent &aKeyEvent);
1.89 + inline CWsPointerCursor *GroupPointerCursor() const;
1.90 + static CWsWindowGroup *WindowGroupFromIdentifier(TInt aIdentifier);
1.91 + static CWsWindowGroup *WindowGroupFromIdentifierL(TInt aIdentifier);
1.92 + static CWsWindowGroup *FindWindowGroupL(CWsClient* aClient,TInt aIdentifier,TInt aOffset,const TPtrC *aMatch,const TThreadId *aThreadId);
1.93 + inline HBufC *GroupName();
1.94 + inline void SetNextDefaultOwningWindow(CWsWindowGroup *aNext);
1.95 + inline CWsWindowGroup **NextDefaultOwningWindowPtr();
1.96 + void SetScreenDeviceValidState(const DWsScreenDevice *aDevice);
1.97 + void SetScreenChangeEventStateL(TBool aEnabled);
1.98 + TBool ScreenDeviceValid() const;
1.99 + TBool CanReceiveFocus() const;
1.100 + static void SetScreenDeviceValidStates(const DWsScreenDevice *aDevice);
1.101 + static void SetScreenDeviceValidStates(CScreen* aScreen);
1.102 + static void NewOrientation(TInt aMode,CFbsBitGc::TGraphicsOrientation aRotation, CWsRootWindow* aRootWindow);
1.103 + inline DWsScreenDevice *Device();
1.104 + void FetchMessageL();
1.105 + static inline void SetFocusGainPreprocessing(TBool aDo);
1.106 + TBool IsChained(TInt& aParentId);
1.107 + inline TInt NumWindowGroupsOnMyScreen(TInt aPriority);
1.108 + static TInt NumWindowGroupsOnScreen(const CWsWindowGroup* aGroupWin,TBool aAllPriorities,TInt aPriority);
1.109 + inline void SetScreenDeviceDeleted();
1.110 + inline TBool ScreenDeviceDeleted() const;
1.111 + static TInt SendWindowGroupListL(TInt aScreenNumber, TBool aAllPriorities, TInt aPriority, TInt aCount);
1.112 + static void GetFocusWindowGroupL(TInt aScreenNumber);
1.113 + void SetScreenDevice(DWsScreenDevice *aDevice);
1.114 + static void SetEventQueueTestState(TBool aEventQueState);
1.115 + TBool HasVisibleTranslucentChild();
1.116 + void ReleasePendedMessage();
1.117 +private:
1.118 + void SwitchToOwningWindow(CWsWindowGroup *aClosingWindow);
1.119 + void MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow);
1.120 + TBool DoSetOrdinalPosition1(TInt aPos,CWsWindowGroup *aClosingWindow);
1.121 + void DoSetOrdinalPosition2(TInt aPos,CWsWindowGroup *aClosingWindow);
1.122 + TBool SignalMessageReady();
1.123 + static void AdvanceIdentifierCount();
1.124 + void StatusDump(TDes &aBuf);
1.125 + void PurgeCapturedKeys();
1.126 + inline void UpdateKeyClickState();
1.127 + void ResetFocus(CWsWindowGroup *aClosingWindow);
1.128 + static TInt GetWindowGroupListL(TInt aScreenNo,TBool aAllPriorities,TInt aPriority,TInt aCount,CArrayFixFlat<TInt>* aList);
1.129 + inline CWsWindowGroup* BeforeInChain();
1.130 + static void GetWindowGroupListAndChainL(TInt aScreen,TBool aAllPriorities,TInt aPriority
1.131 + ,RArray<RWsSession::TWindowGroupChainInfo>& list,TInt& aCountLeft);
1.132 + TBool CheckCapability(TInt& aOrdinalPriority);
1.133 + void DeleteQueue(TDblQue<CWsWindowGroup>* aQueue);
1.134 + TInt NumClientWindowGroups();
1.135 + void DisconnectFloatingSprites();
1.136 +private:
1.137 + RWsTextCursor iTextCursor;
1.138 + TInt iFlags;
1.139 + TInt iOrdinalPriorityBase;
1.140 + TInt iOrdinalPriorityAdjust;
1.141 + TPriorityKey *iPriorityKeys;
1.142 + TInt iOwningWindowGroup;
1.143 + HBufC *iGroupName;
1.144 + TInt iIdentifier;
1.145 + CWsWindowGroup *iNextDefaultOwningWindow;
1.146 + CArrayVarSeg<TWsMessage> *iMessageArray;
1.147 + static TInt iIdentifierCount;
1.148 + DWsScreenDevice *iScreenDevice;
1.149 + static RPointerArray< TDblQue<CWsWindowGroup> > iChains;
1.150 + TDblQue<CWsWindowGroup>* iQueue;
1.151 + TDblQueLink iChainLink;
1.152 + TUint32 iChildSID;
1.153 + static TBool iFocusGainPreProcess; //'REMOVEFADINGONFOCUSGAIN' flag in INI file
1.154 + // used for eventqueue testing
1.155 +#if defined(_DEBUG)
1.156 + static TInt iSkipCount;
1.157 +#endif
1.158 + static TBool iEventQueueTest;
1.159 + friend class TWsPointer;
1.160 + };
1.161 +
1.162 +inline CWsTopClientWindow *CWsWindowGroup::Child() const
1.163 + {
1.164 + return (CWsTopClientWindow *)iChild;
1.165 + }
1.166 +
1.167 +inline CWsWindowGroup *CWsWindowGroup::NextSibling() const
1.168 + {
1.169 + return (CWsWindowGroup *)iSibling;
1.170 + }
1.171 +
1.172 +inline CWsWindowGroup *CWsWindowGroup::PrevSibling() const
1.173 + {
1.174 + return (CWsWindowGroup *)GetPrevSibling();
1.175 + }
1.176 +
1.177 +inline CWsRootWindow *CWsWindowGroup::Parent() const
1.178 + {
1.179 + return (CWsRootWindow *)iParent;
1.180 + }
1.181 +
1.182 +inline TBool CWsWindowGroup::ReceivesFocus() const
1.183 + {
1.184 + return(iFlags&EGroupFlagReceivesFocus);
1.185 + }
1.186 +
1.187 +inline RWsTextCursor *CWsWindowGroup::TextCursor()
1.188 + {
1.189 + return &iTextCursor;
1.190 + }
1.191 +
1.192 +inline HBufC *CWsWindowGroup::GroupName()
1.193 + {
1.194 + return iGroupName;
1.195 + }
1.196 +
1.197 +inline void CWsWindowGroup::SetNextDefaultOwningWindow(CWsWindowGroup *aNext)
1.198 + {
1.199 + iNextDefaultOwningWindow=aNext;
1.200 + }
1.201 +
1.202 +inline CWsWindowGroup **CWsWindowGroup::NextDefaultOwningWindowPtr()
1.203 + {
1.204 + return &iNextDefaultOwningWindow;
1.205 + }
1.206 +
1.207 +/**
1.208 +@return A pointer to the DWsScreenDevice used by this window-group, or
1.209 + NULL when there is no DWsScreenDevice used by the window-group.
1.210 +*/
1.211 +inline DWsScreenDevice *CWsWindowGroup::Device()
1.212 + {
1.213 + return iScreenDevice;
1.214 + }
1.215 +
1.216 +inline void CWsWindowGroup::SetFocusGainPreprocessing(TBool aDo)
1.217 + {
1.218 + iFocusGainPreProcess=aDo;
1.219 + }
1.220 +
1.221 +inline void CWsWindowGroup::SetScreenDeviceDeleted()
1.222 + {
1.223 + iFlags|=EGroupFlagScreenDeviceDeleted;
1.224 + iScreenDevice = NULL; // PDEF100409
1.225 + }
1.226 +
1.227 +inline TBool CWsWindowGroup::ScreenDeviceDeleted() const
1.228 + {
1.229 + return (iFlags&EGroupFlagScreenDeviceDeleted);
1.230 + }
1.231 +
1.232 +#endif