windowing/windowserver/tcontaindrawer/wscontaindrawer.cpp
changeset 116 171fae344dd4
parent 103 2717213c588a
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
     1 // Copyright (c) 2007-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 // The plug-in provides the client side CWsGraphic instance CWsListen, which is used in 
       
    15 // GRAPHICS-WSERV-0438. 
       
    16 // This also provides Test Case INC103472: CRedrawRegion::ContainsDrawers does not look for all drawers. 
       
    17 // The customer incident "INC103472" reports CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers in wnredraw.cpp 
       
    18 // is suppose to return whether some drawers are contained within a specific region. 
       
    19 // But right now it doesn't check for drawers in drawers.
       
    20 // So if one drawer from the iDrawerArray contains one of the drawers passed along 
       
    21 // in aDrawers it will still return EFalse when it should return ETrue.
       
    22 // The fix is added in CWsRedrawMsgWindow::CRedrawRegion::ContainsDrawers(const TArray& aDrawers,const RRegion& aRegion).
       
    23 // The drawer->Contains() call will end up in HasAsChild(const TArray& aIds), 
       
    24 // where the CWsGraphicDrawer has to look for its own nested drawers and return ETrue or EFalse.
       
    25 // 
       
    26 //
       
    27 
       
    28 /**
       
    29  @file
       
    30  @test
       
    31  @internalComponent - Internal Symbian test code
       
    32 */
       
    33 //CWsGraphic
       
    34 #include "wscontaindrawer.h"
       
    35 
       
    36 CWsContainGraphicBitmap::CWsContainGraphicBitmap()
       
    37 	{
       
    38 	}
       
    39 
       
    40 EXPORT_C CWsContainGraphicBitmap::~CWsContainGraphicBitmap()
       
    41 	{
       
    42 	iIsReady = EFalse;
       
    43 	}
       
    44 
       
    45 EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL()
       
    46 	{
       
    47 	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
       
    48 	CleanupStack::PushL(self);
       
    49 	self->BaseConstructL(KContainDrawerImplId,KNullDesC8());
       
    50 	self->iIsReady = ETrue;
       
    51 	CleanupStack::Pop(self);
       
    52 	return self;
       
    53 	}
       
    54 
       
    55 EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(TUid aUid)
       
    56 	{
       
    57 	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
       
    58 	CleanupStack::PushL(self);
       
    59 	self->BaseConstructL(aUid,KContainDrawerImplId,KNullDesC8());
       
    60  	self->iIsReady = ETrue;
       
    61   	CleanupStack::Pop(self);
       
    62 	return self;
       
    63 	}
       
    64 	
       
    65 EXPORT_C CWsContainGraphicBitmap* CWsContainGraphicBitmap::NewL(const TWsGraphicId& aReplace)
       
    66 	{
       
    67 	CWsContainGraphicBitmap* self = new(ELeave) CWsContainGraphicBitmap;
       
    68 	CleanupStack::PushL(self);
       
    69     self->BaseConstructL(aReplace,KContainDrawerImplId,KNullDesC8());
       
    70   	self->iIsReady = ETrue;
       
    71   	CleanupStack::Pop(self);
       
    72 	return self;
       
    73 	}
       
    74 
       
    75 EXPORT_C TInt CWsContainGraphicBitmap::UpdateColor(TRgb aColor)
       
    76 	{
       
    77 	if (!iIsReady)
       
    78 		return KErrNotReady;
       
    79 	// Send the color the server side
       
    80 	TBuf8<3> cmd;
       
    81 	TInt red = aColor.Red();
       
    82 	TInt green = aColor.Green();
       
    83 	TInt blue = aColor.Blue();
       
    84     //Append the color
       
    85 	cmd.Append(red);
       
    86 	cmd.Append(green);
       
    87 	cmd.Append(blue);
       
    88 	
       
    89 	SendMessage(cmd);
       
    90 	return Flush();
       
    91 	}
       
    92 
       
    93 
       
    94 EXPORT_C void CWsContainGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
       
    95 	{
       
    96 	}
       
    97 
       
    98 EXPORT_C void CWsContainGraphicBitmap::OnReplace()
       
    99 	{
       
   100 	}
       
   101 
       
   102 EXPORT_C TInt CWsContainGraphicBitmap::ShareGlobally()
       
   103 	{
       
   104 	return CWsGraphic::ShareGlobally();
       
   105 	}
       
   106 
       
   107 EXPORT_C TInt CWsContainGraphicBitmap::UnShareGlobally()
       
   108 	{
       
   109 	return CWsGraphic::UnShareGlobally();
       
   110 	}
       
   111 
       
   112 EXPORT_C TInt CWsContainGraphicBitmap::Share(TSecureId aClientId)
       
   113 	{
       
   114 	return CWsGraphic::Share(aClientId);
       
   115 	}
       
   116 
       
   117 EXPORT_C TInt CWsContainGraphicBitmap::UnShare(TSecureId aClientId)
       
   118 	{
       
   119 	return CWsGraphic::UnShare(aClientId);
       
   120 	}   
       
   121