windowing/windowserver/stdgraphic/BITMAPGRAPHIC.CPP
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 1995-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 //
       
    15 
       
    16 #include "W32STDGRAPHIC.H"
       
    17 
       
    18 LOCAL_C const TUid KStdBitmapType = {0x10281921};
       
    19 
       
    20 NONSHARABLE_STRUCT(TBitmapInit)
       
    21 	{
       
    22 	TBitmapInit(const CFbsBitmap* aBitmap,const CFbsBitmap* aMask);
       
    23 	TInt iBitmapHandle;
       
    24 	TInt iMaskHandle;
       
    25 	};
       
    26 	
       
    27 TBitmapInit::TBitmapInit(const CFbsBitmap* aBitmap,const CFbsBitmap* aMask)
       
    28 	{
       
    29 	iBitmapHandle = (aBitmap?aBitmap->Handle():0);
       
    30 	iMaskHandle = (aMask?aMask->Handle():0);
       
    31 	}
       
    32 
       
    33 CWsGraphicBitmap::CWsGraphicBitmap()
       
    34 	{
       
    35 	}
       
    36 
       
    37 EXPORT_C CWsGraphicBitmap::~CWsGraphicBitmap()
       
    38 	{
       
    39 	}
       
    40 
       
    41 EXPORT_C CWsGraphicBitmap* CWsGraphicBitmap::NewL(const CFbsBitmap* aBitmap,const CFbsBitmap* aMask)
       
    42 /** 
       
    43 Constructs the client representation of a window-server-side CFbsBitmap owned by this Client.
       
    44 The base class CWsGraphic is therefore constructed having KStdBitmapType as artwork type.
       
    45 
       
    46 @param aBitmap CFbsBitmap owned by the Client 
       
    47 @param aMask Bitmap's Mask.
       
    48 */
       
    49 	{
       
    50 	CWsGraphicBitmap* self = new(ELeave) CWsGraphicBitmap;
       
    51 	CleanupStack::PushL(self);
       
    52 	const TPckgBuf<TBitmapInit> data(TBitmapInit(aBitmap,aMask));
       
    53 	self->BaseConstructL(KStdBitmapType,data);
       
    54 	CleanupStack::Pop(self);
       
    55 	return self;
       
    56 	}
       
    57 
       
    58 EXPORT_C CWsGraphicBitmap* CWsGraphicBitmap::NewL(TUid aUid,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask)
       
    59 /** 
       
    60 Constructs the client representation of a window-server-side CFbsBitmap owned by this Client.
       
    61 The base class CWsGraphic is therefore constructed having KStdBitmapType as artwork type.
       
    62 
       
    63 @param aUid	Graphic Bitmap UID.
       
    64 @param aBitmap CFbsBitmap owned by the Client 
       
    65 @param aMask Bitmap's Mask.
       
    66 */
       
    67 	{
       
    68 	CWsGraphicBitmap* self = new(ELeave) CWsGraphicBitmap;
       
    69 	CleanupStack::PushL(self);
       
    70 	const TPckgBuf<TBitmapInit> data(TBitmapInit(aBitmap,aMask));
       
    71 	self->BaseConstructL(aUid,KStdBitmapType,data);
       
    72 	CleanupStack::Pop(self);
       
    73 	return self;
       
    74 	}
       
    75 	
       
    76 EXPORT_C CWsGraphicBitmap* CWsGraphicBitmap::NewL(const TWsGraphicId& aReplace,const CFbsBitmap* aBitmap,const CFbsBitmap* aMask)
       
    77 /** 
       
    78 Constructs the client representation of a window-server-side CFbsBitmap owned by this Client.
       
    79 The base class CWsGraphic is therefore constructed having KStdBitmapType as artwork type.
       
    80 
       
    81 Atomically replace the artwork that already exists with this artwork (i.e. aBitmap) .
       
    82 If failure to properly construct the replacement artwork occurs, the replacee artwork will remain
       
    83 
       
    84 @param aReplace Bitmap artwork which will be replaced.
       
    85 @param aBitmap CFbsBitmap owned by the Client 
       
    86 @param aMask Bitmap's Mask.
       
    87 */	
       
    88 	{
       
    89 	CWsGraphicBitmap* self = new(ELeave) CWsGraphicBitmap;
       
    90 	CleanupStack::PushL(self);
       
    91 	const TPckgBuf<TBitmapInit> data(TBitmapInit(aBitmap,aMask));
       
    92 	self->BaseConstructL(aReplace,KStdBitmapType,data);
       
    93 	CleanupStack::Pop(self);
       
    94 	return self;
       
    95 	}
       
    96 
       
    97 EXPORT_C void CWsGraphicBitmap::HandleMessage(const TDesC8& /*aData*/)
       
    98 	{
       
    99 	}
       
   100 
       
   101 EXPORT_C void CWsGraphicBitmap::OnReplace()
       
   102 	{
       
   103 	}
       
   104 
       
   105 EXPORT_C TInt CWsGraphicBitmap::ShareGlobally()
       
   106 	{
       
   107 	return CWsGraphic::ShareGlobally();
       
   108 	}
       
   109 
       
   110 EXPORT_C TInt CWsGraphicBitmap::UnShareGlobally()
       
   111 	{
       
   112 	return CWsGraphic::UnShareGlobally();
       
   113 	}
       
   114 
       
   115 EXPORT_C TInt CWsGraphicBitmap::Share(TSecureId aClientId)
       
   116 	{
       
   117 	return CWsGraphic::Share(aClientId);
       
   118 	}
       
   119 
       
   120 EXPORT_C TInt CWsGraphicBitmap::UnShare(TSecureId aClientId)
       
   121 	{
       
   122 	return CWsGraphic::UnShare(aClientId);
       
   123 	}