sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __STDPANIC_H__ sl@0: #define __STDPANIC_H__ sl@0: sl@0: enum TStdPluginPanic sl@0: { sl@0: EStdPanicTemp = 0, sl@0: EStdPanicNoDisplayModeFound = 1, sl@0: EStdPanicCreatedOffScreenBitmapInWrongDimensions = 2, sl@0: EStdPanicStdRenderStageMustBeFinal = 3, sl@0: EStdPanicFlickerBufferRenderStageMustNotBeFinal = 4, sl@0: EStdPanicIniFileMissing = 5, // can't find an MWsIniFile instance sl@0: EStdPanicPreviousUiSurfaceUnregisterable = 6, sl@0: EStdPanicDuplicateUiLayer = 7, // occurs when trying to add a UI layer when another UI layer is already part of the scene sl@0: EStdPanicNonMatchingRemovalOfUiLayer = 8, // occurs when removing a UI layer, when it's not the current UI layer sl@0: EStdPanicUiSurfaceIsNull = 9, // occurs when the UI surface is NULL sl@0: EStdPanicScreenDeviceMissing = 10, // can't get MWsScreenDevice from the next render stage sl@0: EStdPanicCompositionContextMissing = 11, // can't get MWsCompositionContext from the next render stage sl@0: EStdPanicPopGcSettings = 12, // problem when popping gc settings, previously saved sl@0: EStdPanicDrawCommandsInvalidState = 13, //The draw commands state doesn't match with the action that is occuring sl@0: EStdPanicInvalidCursorType = 14, // invalid cursor sl@0: EStdPanicRegionError = 15, //Region is not NULL and TRegion::CheckError() has returned ETrue, or validation of region state has failed sl@0: EStdPanicBadBeginEndSequence = 16, // End() has been called without corresponding Begin(), or Begin() has been called twice. sl@0: EStdPanicRedrawNotCompleted = 17, // A redraw has been requested before the previous redraw has completed. sl@0: EStdPanicNoContext = 18, // Graphics context from the next rendering stage is not available sl@0: }; sl@0: sl@0: void Panic(TStdPluginPanic aPanic); sl@0: sl@0: #ifdef _DEBUG sl@0: #define STD_ASSERT_DEBUG(c, p) \ sl@0: do { \ sl@0: if(!(c)) \ sl@0: { \ sl@0: Panic(p); \ sl@0: } \ sl@0: } while (EFalse) sl@0: #else sl@0: #define STD_ASSERT_DEBUG(c, p) sl@0: #endif //_DEBUG sl@0: sl@0: #define STD_ASSERT_ALWAYS(c, p) \ sl@0: do { \ sl@0: if(!(c)) \ sl@0: { \ sl@0: Panic(p); \ sl@0: } \ sl@0: } while (EFalse) sl@0: sl@0: #endif //__STDPANIC_H__