windowing/windowserver/graphicsresourcewrapper/graphicsresourcewrapper_stub.cpp
changeset 0 5d03bc08d59c
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2008-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 "graphicsresourcewrapper.h"
       
    17 
       
    18 /*
       
    19 This file is used to create a stub DLL for ROMs where graphics
       
    20 resource isn't present, hence all functions are empty. However,
       
    21 it is not expected this DLL will ever be loaded since the user
       
    22 won't be able to create a RSgDrawable in the first place (and
       
    23 this class is only used when trying to draw an existing RSgDrawable).
       
    24 */
       
    25 
       
    26 class CGraphicsResourceWrapperImpl : public CGraphicsResourceWrapper
       
    27 	{
       
    28 public:
       
    29 	IMPORT_C static CGraphicsResourceWrapper* New();
       
    30 
       
    31 	RSgDrawable* NewDrawableL();
       
    32 	TInt Open(RSgDrawable& aDrawable, const TSgDrawableId& aDrawableId);
       
    33 	void Close(RSgDrawable& aDrawable);
       
    34 	TBool IsNull(const RSgDrawable& aDrawable);
       
    35 	TSgDrawableId Id(const RSgDrawable& aDrawable);
       
    36 	};
       
    37 
       
    38 EXPORT_C CGraphicsResourceWrapper* CGraphicsResourceWrapperImpl::New()
       
    39 	{
       
    40 	return new CGraphicsResourceWrapperImpl;
       
    41 	}
       
    42 
       
    43 RSgDrawable* CGraphicsResourceWrapperImpl::NewDrawableL()
       
    44 	{
       
    45 	User::Leave(KErrNotSupported);
       
    46 	return NULL;
       
    47 	}
       
    48 
       
    49 TInt CGraphicsResourceWrapperImpl::Open(RSgDrawable& /*aDrawable*/, const TSgDrawableId& /*aDrawableId*/)
       
    50 	{
       
    51 	return KErrNotSupported;
       
    52 	}
       
    53 
       
    54 void CGraphicsResourceWrapperImpl::Close(RSgDrawable& /*aDrawable*/)
       
    55 	{
       
    56 	}
       
    57 
       
    58 TBool CGraphicsResourceWrapperImpl::IsNull(const RSgDrawable& /*aDrawable*/)
       
    59 	{
       
    60 	return ETrue;
       
    61 	}
       
    62 
       
    63 TSgDrawableId CGraphicsResourceWrapperImpl::Id(const RSgDrawable& /*aDrawable*/)
       
    64 	{
       
    65 	return TSgDrawableId();
       
    66 	}