windowing/windowserver/tcontaindrawer/wssimpledrawer.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 wheather some drawers are contained within a specific region. 
       
    19 // But it currently fails to 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 "wssimpledrawer.h"
       
    35 #include <s32mem.h>
       
    36 
       
    37 CWsSimpleGraphicBitmap::CWsSimpleGraphicBitmap()
       
    38 	{
       
    39 	}
       
    40 
       
    41 EXPORT_C CWsSimpleGraphicBitmap::~CWsSimpleGraphicBitmap()
       
    42 	{
       
    43 	iIsReady = EFalse;
       
    44 	}
       
    45 
       
    46 EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL()
       
    47 	{
       
    48 	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
       
    49 	CleanupStack::PushL(self);
       
    50  	self->BaseConstructL(KSimpleDrawerImplId,KNullDesC8());
       
    51 	self->iIsReady = ETrue;
       
    52 	CleanupStack::Pop(self);
       
    53 	return self;
       
    54 	}
       
    55 
       
    56 EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL(TUid aUid)
       
    57 	{
       
    58 	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
       
    59 	CleanupStack::PushL(self);
       
    60 	self->BaseConstructL(aUid,KSimpleDrawerImplId,KNullDesC8());
       
    61 	self->iIsReady = ETrue;
       
    62 	CleanupStack::Pop(self);
       
    63 	return self;
       
    64 	}
       
    65 	
       
    66 EXPORT_C CWsSimpleGraphicBitmap* CWsSimpleGraphicBitmap::NewL(const TWsGraphicId& aReplace)
       
    67 	{
       
    68 	CWsSimpleGraphicBitmap* self = new(ELeave) CWsSimpleGraphicBitmap;
       
    69 	CleanupStack::PushL(self);
       
    70 	self->BaseConstructL(aReplace,KSimpleDrawerImplId,KNullDesC8());
       
    71 	self->iIsReady = ETrue;
       
    72  	CleanupStack::Pop(self);
       
    73 	return self;
       
    74 	}
       
    75 
       
    76 EXPORT_C TInt CWsSimpleGraphicBitmap::UpdateColor(TRgb aColor)
       
    77 	{
       
    78 	if (!iIsReady)
       
    79 		return KErrNotReady;
       
    80 	// Send the message to server side
       
    81 	TBuf8<3> cmd;
       
    82 	TInt red = aColor.Red();
       
    83 	TInt green = aColor.Green();
       
    84 	TInt blue = aColor.Blue();
       
    85     //Append the color
       
    86 	cmd.Append(red);
       
    87 	cmd.Append(green);
       
    88 	cmd.Append(blue);
       
    89 	
       
    90 	SendMessage(cmd);
       
    91 	return Flush();
       
    92 	}
       
    93 
       
    94 EXPORT_C void CWsSimpleGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
       
    95 	{
       
    96 	}
       
    97 
       
    98 EXPORT_C void CWsSimpleGraphicBitmap::OnReplace()
       
    99 	{
       
   100 	}
       
   101 
       
   102 EXPORT_C TInt CWsSimpleGraphicBitmap::ShareGlobally()
       
   103 	{
       
   104 	return CWsGraphic::ShareGlobally();
       
   105 	}
       
   106 
       
   107 EXPORT_C TInt CWsSimpleGraphicBitmap::UnShareGlobally()
       
   108 	{
       
   109 	return CWsGraphic::UnShareGlobally();
       
   110 	}
       
   111 
       
   112 EXPORT_C TInt CWsSimpleGraphicBitmap::Share(TSecureId aClientId)
       
   113 	{
       
   114 	return CWsGraphic::Share(aClientId);
       
   115 	}
       
   116 
       
   117 EXPORT_C TInt CWsSimpleGraphicBitmap::UnShare(TSecureId aClientId)
       
   118 	{
       
   119 	return CWsGraphic::UnShare(aClientId);
       
   120 	}  		 
       
   121 
       
   122 EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL()
       
   123 	{
       
   124 	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
       
   125 	CleanupStack::PushL(self);
       
   126 	self->BaseConstructL(KInvisibleDrawerImplId1,KNullDesC8());
       
   127 	self->iIsReady = ETrue;
       
   128 	CleanupStack::Pop(self);
       
   129 	return self;
       
   130 	}
       
   131 
       
   132 EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL(TUid aUid)
       
   133 	{
       
   134 	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
       
   135 	CleanupStack::PushL(self);
       
   136 	self->BaseConstructL(aUid,KInvisibleDrawerImplId1,KNullDesC8());
       
   137 	self->iIsReady = ETrue;
       
   138 	CleanupStack::Pop(self);
       
   139 	return self;
       
   140 	}
       
   141 	
       
   142 EXPORT_C CWsInvisibleGraphicBitmap1* CWsInvisibleGraphicBitmap1::NewL(const TWsGraphicId& aReplace)
       
   143 	{
       
   144 	CWsInvisibleGraphicBitmap1* self = new(ELeave) CWsInvisibleGraphicBitmap1;
       
   145 	CleanupStack::PushL(self);
       
   146 	self->BaseConstructL(aReplace,KInvisibleDrawerImplId1,KNullDesC8());
       
   147 	self->iIsReady = ETrue;
       
   148 	CleanupStack::Pop(self);
       
   149 	return self;
       
   150 	}
       
   151 
       
   152 EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL()
       
   153 	{
       
   154 	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
       
   155 	CleanupStack::PushL(self);
       
   156  	self->BaseConstructL(KInvisibleDrawerImplId2,KNullDesC8());
       
   157 	self->iIsReady = ETrue;
       
   158 	CleanupStack::Pop(self);
       
   159 	return self;
       
   160 	}
       
   161 
       
   162 EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL(TUid aUid)
       
   163 	{
       
   164 	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
       
   165 	CleanupStack::PushL(self);
       
   166 	self->BaseConstructL(aUid,KInvisibleDrawerImplId2,KNullDesC8());
       
   167 	self->iIsReady = ETrue;
       
   168  	CleanupStack::Pop(self);
       
   169 	return self;
       
   170 	}
       
   171 	
       
   172 EXPORT_C CWsInvisibleGraphicBitmap2* CWsInvisibleGraphicBitmap2::NewL(const TWsGraphicId& aReplace)
       
   173 	{
       
   174 	CWsInvisibleGraphicBitmap2* self = new(ELeave) CWsInvisibleGraphicBitmap2;
       
   175 	CleanupStack::PushL(self);
       
   176 	self->BaseConstructL(aReplace,KInvisibleDrawerImplId2,KNullDesC8());
       
   177 	self->iIsReady = ETrue;
       
   178  	CleanupStack::Pop(self);
       
   179 	return self;
       
   180 	}
       
   181