windowing/windowserverplugins/openwfc/inc/panic.h
author Faisal Memon <faisal.memon@nokia.com>
Fri, 14 May 2010 15:41:33 +0100
branchNewGraphicsArchitecture
changeset 64 5c983aa672ea
parent 0 5d03bc08d59c
permissions -rw-r--r--
Merge 1. Pull in cpp files in the performance enhanced Khronos RI OVG files which are newly added. I've ignored platform-specific cpp files for linux, macosx, and null operating systems because this local solution has its own platform glue (i.e. facility to target Bitmaps but no full windowing support). I've ignored sfEGLInterface.cpp because this is used as a bridge to go from EGL to Nokia's Platsim which offers an EGL service. That's not relevant to this implementation because this is ARM side code, not Intel side. I just left a comment to sfEGLInterface.cpp in case we need to pick up this later on. The current code compiles on winscw. Prior to this fix, the code works on winscw, and can launch the SVG tiger (tiger.exe). That takes about 20 seconds to render. I hope to always be able to show this icon on each commit, and the plan is for the render time to reduce with this series of submissions. On this commit, the tiger renders ok in 20 seconds.

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

#ifndef __PANIC_H__
#define __PANIC_H__

enum TStdPluginPanic
	{
	EPluginPanicTemp = 0,
	EPluginPanicNoDisplayModeFound = 1,
	EPluginPanicCreatedOffScreenBitmapInWrongDimensions = 2,
	EPluginPanicDisplayRenderStageMustBeFinal = 3,
	EPluginPanicFlickerBufferRenderStageMustNotBeFinal = 4,
	EPluginPanicIniFileMissing = 5,	// can't find an MWsIniFile instance
	EPluginPanicPreviousUiSurfaceUnregisterable = 6,
	EPluginPanicDuplicateUiElement = 7,	// occurs when trying to add a UI element when another UI element is already part of the scene
	EPluginPanicNonMatchingRemovalOfUiElement = 8, // occurs when removing a UI element, when it's not the current UI element
	EPluginPanicUiSurfaceIsNull = 9,	// occurs when the UI surface is NULL
	EPluginPanicScreenDeviceMissing = 10, // can't get MWsScreenDevice from the next render stage
	EPluginPanicCompositionContextMissing = 11, // can't get MWsCompositionContext from the next render stage
	EPluginPanicPopGcSettings = 12, // problem when popping gc settings, previously saved
	EPluginPanicDrawCommandsInvalidState = 13,	//The draw commands state doesn't match with the action that is occuring
	EPluginPanicInvalidCursorType = 14, // invalid cursor
	EPluginPanicRegionError = 15, //Region is not NULL and TRegion::CheckError() has returned ETrue, or validation of region state has failed
	EPluginPanicBadBeginEndSequence = 16, // End() has been called without corresponding Begin(), or Begin() has been called twice.
	EPluginPanicRedrawNotCompleted = 17, // A redraw has been requested before the previous redraw has completed.  
	EPluginPanicNoContext = 18, // Graphics context from the next rendering stage is not available
	EPluginPanicSizeInTwipsFailed = 19, // HAL has returned a value of zero for display twips
	EPluginPanicMultipleUpdateRequests = 20, // Client has requested an update with updates outstanding
	EPluginPanicObjectConstructionFailed = 21, // Allocation and construction of an object has failed 
	EPluginPanicNoDrawableSourceProvider = 22, // The next render stange doesn't support MWsDrawableSourceProvider
	EPluginPanicDrawableSourceInitializationFailed = 23, // Failure when calling MWsDrawableSourceProvider::OpenDrawable() for an offscreen image
	EPluginPanicInvalidDrawableSource = 24, // Invalid drawable source pointer passed to MWsDrawableSourceProvider
	EPluginPanicDisplayControlMissing = 25, // End() has been called without corresponding Begin(), or Begin() has been called twice.
	EPluginPanicScreenCaptureRenderStageMustNotBeFinal = 26, // A redraw has been requested before the previous redraw has completed.
	EPluginPanicScreenCaptureInvalidCommand=27,  // No Such Command
	EPluginPanicDisplayMappingMissing = 28, // can't get MWsDisplayMapping from the next render stage
	EPluginPanicNewUiSurfaceUnsettable = 30,	//can't set a new ui surface
	EPluginPanicHalSetDisplayState = 31, //error returned when trying to set DisplayState
	EPluginPanicSceneMissing = 32, // can't get MWsScene from the next render stage
	EPluginPanicCompositionSequenceError = 33, // an attempt to compose was made which was out of sequence with Begin()/End() 

	};

void Panic(TStdPluginPanic aPanic);

#ifdef _DEBUG
#define STD_ASSERT_DEBUG(c, p) \
	do { \
		if(!(c)) \
			{ \
			Panic(p); \
			} \
		} while (EFalse)
#else
#define STD_ASSERT_DEBUG(c, p)
#endif //_DEBUG

#define STD_ASSERT_ALWAYS(c, p) \
	do { \
		if(!(c)) \
			{ \
			Panic(p); \
			} \
		} while (EFalse)

#endif //__PANIC_H__