uigraphics/NVGRenderStage/src/nvgrenderstagefactory.cpp
author William Roberts <williamr@symbian.org>
Tue, 05 Jan 2010 09:38:15 +0000
changeset 15 1bd1043e4812
parent 14 dfd4516c2f08
child 16 8788585969bc
permissions -rw-r--r--
COnfigure NVGRenderStage in wsini.ini, and tweak some comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
1bd1043e4812 COnfigure NVGRenderStage in wsini.ini, and tweak some comments
William Roberts <williamr@symbian.org>
parents: 14
diff changeset
     1
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
14
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     7
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    10
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    11
// Contributors:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    12
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    13
// Description:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    14
//
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    15
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    16
#include "nvgrenderstagefactory.h"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    17
#include "nvgrenderstage.h"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    18
#include "nvgrenderstagepanic.h"
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    19
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    20
_LIT(KNvgRenderStageName, "nvgbitmap");
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    21
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    22
void Panic(TNvgRenderStagePanic aPanic)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    23
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    24
	_LIT(KNvgRenderStagePanic, "NvgRenderStage");
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    25
	User::Panic(KNvgRenderStagePanic, aPanic);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    26
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    27
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    28
CNvgRenderStageFactory* CNvgRenderStageFactory::CreateL()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    29
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    30
	return new(ELeave) CNvgRenderStageFactory;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    31
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    32
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    33
void CNvgRenderStageFactory::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TDesC8& /*aData*/)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    34
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    35
	BaseConstructL(aEnv);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    36
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    37
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    38
CNvgRenderStageFactory::CNvgRenderStageFactory()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    39
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    40
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    41
	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    42
CNvgRenderStageFactory::~CNvgRenderStageFactory()
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    43
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    44
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    45
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    46
/**
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    47
Overidding MWsObjectProvider
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    48
*/
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    49
TAny* CNvgRenderStageFactory::ResolveObjectInterface(TUint aTypeId)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    50
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    51
	switch (aTypeId)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    52
		{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    53
		case KMWsRenderStageFactory:
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    54
			return static_cast<MWsRenderStageFactory*>(this);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    55
		}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    56
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    57
	return NULL;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    58
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    59
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    60
CWsRenderStage* CNvgRenderStageFactory::CreateFinalRenderStageL(MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, TInt /*aScreenNumber*/)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    61
	{	
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    62
	Panic(EExtendedBitmapRenderStageMustNotBeFinal);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    63
	return NULL;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    64
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    65
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    66
#ifndef SYMBIAN_GRAPHICS_GCE
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    67
#error ("must compile with SYMBIAN_GRAPHICS_GCE")
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    68
#endif
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    69
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    70
CWsRenderStage* CNvgRenderStageFactory::CreateRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, CWsRenderStage* aNextStage)
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    71
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    72
	CNvgRenderStage* stage = CNvgRenderStage::NewL(&Env(), aScreen, aScreenRedraw, aNextStage);
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    73
	return stage;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    74
	}
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    75
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    76
const TDesC& CNvgRenderStageFactory::PluginName() const
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    77
	{
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    78
	return KNvgRenderStageName;
dfd4516c2f08 Add new component NVGRenderStage to handle conversion of NVG Icons into CFbsBitmap
William Roberts <williamr@symbian.org>
parents:
diff changeset
    79
	}