1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tcrx/tcrx.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,128 @@
1.4 +// Copyright (c) 2006-2009 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 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#ifndef __TCRX_H__
1.26 +#define __TCRX_H__
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <w32std.h>
1.30 +
1.31 +class CRedrawHandler;
1.32 +class CWindow;
1.33 +class CWsListen;
1.34 +class CWsRedir;
1.35 +class CTwoWindow;
1.36 +
1.37 +class CClient: public CActive
1.38 + {
1.39 +public:
1.40 + static CClient* NewL();
1.41 + ~CClient();
1.42 + void RunL();
1.43 + void DoCancel();
1.44 + inline RWsSession& Ws();
1.45 + inline RWindowGroup& Group();
1.46 + inline CWindowGc& Gc();
1.47 + inline CWindow* Win();
1.48 + inline CWsScreenDevice* Screen();
1.49 + inline CWsRedir* WsRedir();
1.50 + inline CWsListen* WsListen();
1.51 + void HandleCommand(TInt aCmd);
1.52 +private:
1.53 + CClient();
1.54 + void ConstructL();
1.55 + void MakeRequest();
1.56 + void DrawTwoWindow();
1.57 + void ClearTwoWindow();
1.58 +
1.59 + RWsSession iWs;
1.60 + RWindowGroup iGroup;
1.61 + CWsScreenDevice* iScreen;
1.62 + CWindowGc* iGc;
1.63 + TWsEvent iEvent;
1.64 + CWindow* iWin;
1.65 + CRedrawHandler* iRedraw;
1.66 + CWsListen* iListen;
1.67 + CWsRedir* iRedir;
1.68 + RBlankWindow iBlank;
1.69 + CTwoWindow* iTwo;
1.70 + };
1.71 +
1.72 +class CRedrawHandler: public CActive
1.73 + {
1.74 +public:
1.75 + static CRedrawHandler* NewL(CClient* aClient);
1.76 + ~CRedrawHandler();
1.77 + void RunL();
1.78 + void DoCancel();
1.79 +private:
1.80 + CRedrawHandler(CClient* aClient);
1.81 + void ConstructL();
1.82 + void MakeRequest();
1.83 +
1.84 + CClient* iClient;
1.85 + };
1.86 +
1.87 +class CWindow: public CBase
1.88 + {
1.89 +public:
1.90 + CWindow(CClient* aClient);
1.91 + void ConstructL(CWindow* aParent, TBool aTransparentFlag);
1.92 + ~CWindow();
1.93 + void Draw(const TRect& aRect) const;
1.94 + void DrawMenu() const;
1.95 + inline RWindow& Window();
1.96 + inline CWindow* Parent();
1.97 + inline TSize Size();
1.98 + inline CClient* Client();
1.99 +private:
1.100 + CClient* iClient;
1.101 + RWindow iWin;
1.102 + CWindow* iParent;
1.103 + };
1.104 +
1.105 +// CClient
1.106 +inline RWsSession& CClient::Ws()
1.107 + {return iWs;}
1.108 +inline RWindowGroup& CClient::Group()
1.109 + {return iGroup;}
1.110 +inline CWindowGc& CClient::Gc()
1.111 + {return *iGc;}
1.112 +inline CWindow* CClient::Win()
1.113 + {return iWin;}
1.114 +inline CWsScreenDevice* CClient::Screen()
1.115 + {return iScreen;}
1.116 +inline CWsListen* CClient::WsListen()
1.117 + {return iListen;}
1.118 +inline CWsRedir* CClient::WsRedir()
1.119 + {return iRedir;}
1.120 +// CWindow
1.121 +inline RWindow& CWindow::Window()
1.122 + {return iWin;}
1.123 +inline CWindow* CWindow::Parent()
1.124 + {return iParent;}
1.125 +inline TSize CWindow::Size()
1.126 + {return iWin.Size();}
1.127 +inline CClient* CWindow::Client()
1.128 + {return iClient;}
1.129 +
1.130 +#endif
1.131 +