1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tcontaindrawer/wscontaindrawer.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,121 @@
1.4 +// Copyright (c) 2007-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 +// The plug-in provides the client side CWsGraphic instance CWsListen, which is used in
1.18 +// GRAPHICS-WSERV-0438.
1.19 +// This also provides Test Case INC103472: CRedrawRegion::ContainsDrawers does not look for all drawers.
1.20 +// The customer incident "INC103472" reports CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers in wnredraw.cpp
1.21 +// is suppose to return whether some drawers are contained within a specific region.
1.22 +// But right now it doesn't check for drawers in drawers.
1.23 +// So if one drawer from the iDrawerArray contains one of the drawers passed along
1.24 +// in aDrawers it will still return EFalse when it should return ETrue.
1.25 +// The fix is added in CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers(const TArray& aDrawers,const RRegion& aRegion).
1.26 +// The drawer->Contains() call will end up in HasAsChild(const TArray& aIds),
1.27 +// where the CWsGraphicDrawer has to look for its own nested drawers and return ETrue or EFalse.
1.28 +//
1.29 +//
1.30 +
1.31 +/**
1.32 + @file
1.33 + @test
1.34 + @internalComponent - Internal Symbian test code
1.35 +*/
1.36 +//CWsGraphic
1.37 +#include "wscontaindrawer.h"
1.38 +
1.39 +CWsContainGraphicBitmap::CWsContainGraphicBitmap()
1.40 + {
1.41 + }
1.42 +
1.43 +EXPORT_C CWsContainGraphicBitmap::~CWsContainGraphicBitmap()
1.44 + {
1.45 + iIsReady = EFalse;
1.46 + }
1.47 +
1.48 +EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL()
1.49 + {
1.50 + CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
1.51 + CleanupStack::PushL(self);
1.52 + self->BaseConstructL(KContainDrawerImplId,KNullDesC8());
1.53 + self->iIsReady = ETrue;
1.54 + CleanupStack::Pop(self);
1.55 + return self;
1.56 + }
1.57 +
1.58 +EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(TUid aUid)
1.59 + {
1.60 + CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
1.61 + CleanupStack::PushL(self);
1.62 + self->BaseConstructL(aUid,KContainDrawerImplId,KNullDesC8());
1.63 + self->iIsReady = ETrue;
1.64 + CleanupStack::Pop(self);
1.65 + return self;
1.66 + }
1.67 +
1.68 +EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(const TWsGraphicId& aReplace)
1.69 + {
1.70 + CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
1.71 + CleanupStack::PushL(self);
1.72 + self->BaseConstructL(aReplace,KContainDrawerImplId,KNullDesC8());
1.73 + self->iIsReady = ETrue;
1.74 + CleanupStack::Pop(self);
1.75 + return self;
1.76 + }
1.77 +
1.78 +EXPORT_C TInt CWsContainGraphicBitmap::UpdateColor(TRgb aColor)
1.79 + {
1.80 + if (!iIsReady)
1.81 + return KErrNotReady;
1.82 + // Send the color the server side
1.83 + TBuf8<3> cmd;
1.84 + TInt red = aColor.Red();
1.85 + TInt green = aColor.Green();
1.86 + TInt blue = aColor.Blue();
1.87 + //Append the color
1.88 + cmd.Append(red);
1.89 + cmd.Append(green);
1.90 + cmd.Append(blue);
1.91 +
1.92 + SendMessage(cmd);
1.93 + return Flush();
1.94 + }
1.95 +
1.96 +
1.97 +EXPORT_C void CWsContainGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
1.98 + {
1.99 + }
1.100 +
1.101 +EXPORT_C void CWsContainGraphicBitmap::OnReplace()
1.102 + {
1.103 + }
1.104 +
1.105 +EXPORT_C TInt CWsContainGraphicBitmap::ShareGlobally()
1.106 + {
1.107 + return CWsGraphic::ShareGlobally();
1.108 + }
1.109 +
1.110 +EXPORT_C TInt CWsContainGraphicBitmap::UnShareGlobally()
1.111 + {
1.112 + return CWsGraphic::UnShareGlobally();
1.113 + }
1.114 +
1.115 +EXPORT_C TInt CWsContainGraphicBitmap::Share(TSecureId aClientId)
1.116 + {
1.117 + return CWsGraphic::Share(aClientId);
1.118 + }
1.119 +
1.120 +EXPORT_C TInt CWsContainGraphicBitmap::UnShare(TSecureId aClientId)
1.121 + {
1.122 + return CWsGraphic::UnShare(aClientId);
1.123 + }
1.124 +