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