1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/stdpanic.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,64 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef __STDPANIC_H__
1.20 +#define __STDPANIC_H__
1.21 +
1.22 +enum TStdPluginPanic
1.23 +{
1.24 + EStdPanicTemp = 0,
1.25 + EStdPanicNoDisplayModeFound = 1,
1.26 + EStdPanicCreatedOffScreenBitmapInWrongDimensions = 2,
1.27 + EStdPanicStdRenderStageMustBeFinal = 3,
1.28 + EStdPanicFlickerBufferRenderStageMustNotBeFinal = 4,
1.29 + EStdPanicIniFileMissing = 5, // can't find an MWsIniFile instance
1.30 + EStdPanicPreviousUiSurfaceUnregisterable = 6,
1.31 + EStdPanicDuplicateUiLayer = 7, // occurs when trying to add a UI layer when another UI layer is already part of the scene
1.32 + EStdPanicNonMatchingRemovalOfUiLayer = 8, // occurs when removing a UI layer, when it's not the current UI layer
1.33 + EStdPanicUiSurfaceIsNull = 9, // occurs when the UI surface is NULL
1.34 + EStdPanicScreenDeviceMissing = 10, // can't get MWsScreenDevice from the next render stage
1.35 + EStdPanicCompositionContextMissing = 11, // can't get MWsCompositionContext from the next render stage
1.36 + EStdPanicPopGcSettings = 12, // problem when popping gc settings, previously saved
1.37 + EStdPanicDrawCommandsInvalidState = 13, //The draw commands state doesn't match with the action that is occuring
1.38 + EStdPanicInvalidCursorType = 14, // invalid cursor
1.39 + EStdPanicRegionError = 15, //Region is not NULL and TRegion::CheckError() has returned ETrue, or validation of region state has failed
1.40 + EStdPanicBadBeginEndSequence = 16, // End() has been called without corresponding Begin(), or Begin() has been called twice.
1.41 + EStdPanicRedrawNotCompleted = 17, // A redraw has been requested before the previous redraw has completed.
1.42 + EStdPanicNoContext = 18, // Graphics context from the next rendering stage is not available
1.43 +};
1.44 +
1.45 +void Panic(TStdPluginPanic aPanic);
1.46 +
1.47 +#ifdef _DEBUG
1.48 +#define STD_ASSERT_DEBUG(c, p) \
1.49 + do { \
1.50 + if(!(c)) \
1.51 + { \
1.52 + Panic(p); \
1.53 + } \
1.54 + } while (EFalse)
1.55 +#else
1.56 +#define STD_ASSERT_DEBUG(c, p)
1.57 +#endif //_DEBUG
1.58 +
1.59 +#define STD_ASSERT_ALWAYS(c, p) \
1.60 + do { \
1.61 + if(!(c)) \
1.62 + { \
1.63 + Panic(p); \
1.64 + } \
1.65 + } while (EFalse)
1.66 +
1.67 +#endif //__STDPANIC_H__