os/graphics/windowing/windowserver/SERVER/openwfc/panics.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/SERVER/openwfc/panics.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,230 @@
     1.4 +// Copyright (c) 2003-2010 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 +// Window server panics
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef __PANICS_H__
    1.22 +#define __PANICS_H__
    1.23 +
    1.24 +#include <e32def.h>
    1.25 +#include <e32cmn.h>
    1.26 +
    1.27 +enum TWservPanic
    1.28 +	{
    1.29 +	EWsPanicTemp = 0, 				// Used for panics that aren't intended to be left in the code
    1.30 +	EWsPanicInvalidInvalidArea = 1,
    1.31 +	EWsPanicArea = 2,
    1.32 +	EWsPanicRegion = 3,
    1.33 +	EWsPanicQueueUpdateCount = 4,
    1.34 +	EWsPanicUnknownCaptureKey = 5,
    1.35 +	EWsPanicInvalidCursorType = 6,
    1.36 +	EWsPanicInvalidRegion = 7,
    1.37 +	EWsPanicInvalidArea = 8,
    1.38 +	EWsPanicTextCursorFocus = 9,
    1.39 +	
    1.40 +	EWsPanicWindowType = 10,
    1.41 +	EWsPanicRootCommand = 11,
    1.42 +	EWsPanicWindowCheck = 12,
    1.43 +	EWsPanicFailedToInitialise = 13,
    1.44 +	EWsPanicBadActiveGcList = 14,
    1.45 +	//EWsPanicShadowLockingError = 15,
    1.46 +	EWsPanicBackupRegion = 16,
    1.47 +	EWsPanicKeyRepeat = 17 ,
    1.48 +	EWsPanicErrorInRegion = 18,
    1.49 +	EWsPanicRedrawQueueError = 19,
    1.50 +	
    1.51 +	EWsPanicRegionErrorCheck = 20, // NOT USED
    1.52 +	EWsPanicPointerRepeatTimerStatus = 21,
    1.53 +	EWsPanicCheckEventQueue = 22,
    1.54 +	EWsPanicEventQueueCopy = 23,
    1.55 +	EWsPanicFontCacheCount = 24,
    1.56 +	//EWsPanicNegativeShadow = 25,
    1.57 +	EWsPanicPointerClaimGrab = 26,
    1.58 +	EWsPanicPointerCursorAccessCount = 27,
    1.59 +	EWsPanicSetOrdinalPos = 28,
    1.60 +	EWsPanicGcStructSizeError = 29,
    1.61 +	
    1.62 +	EWsPanicPointerTimer = 30,
    1.63 +	EWsPanicNullDeviceHandle = 31,			//A function returned a NULL device handle unexpectantly
    1.64 +	EWsPanicColorModeInconsitency = 32,		//Logic error while analysing the nature of Color Modes
    1.65 +	EWsPanicCurrentlyFaded = 33,			//Should not do while window is fadded
    1.66 +	EWsPanicEventType = 34,					//Must be a pointer event
    1.67 +	EWsPanicObjectIndexError = 35,			//Object being removed has wrong type
    1.68 +	EWsPanicAnimHasNoWindow = 36,			//This AnimDLL function needs the Anim to have a window
    1.69 +	EWsPanicSpriteAlreadyActive = 37,		//An attempt to activate an active sprite
    1.70 +	EWsPanicAlreadyHaveBackup = 38,			//Getting backup behind when already got it
    1.71 +	EWsPanicSpriteHiddenCount = 39,			//The Sprite's hidden count is inconsistent with the action being performed on it
    1.72 +	
    1.73 +	EWsPanicRawEventsTypeChanged = 40,		//Changes to the Raw Event Type List will probably break this code
    1.74 +	EWsPanicEventHandlerInconsistency = 41,	//The number of things claiming to be event handlers doesn't make sence
    1.75 +	EWsPanicBackupStateError = 42,			//Something has gone wrong with the state of the Backup classes
    1.76 +	EWsPanicRegionNull = 43,				//A region shouldn't be NULL or set to the nullRegion at this point
    1.77 +	//EWsPanicShadowError = 44,				//The shadows have not be updated correctly
    1.78 +	EWsPanicDirectScreenAccess = 45,		//Error in the state machine of or logic error in Direct Screen Access code
    1.79 +	EWsPanicClickPluginNotLoaded = 46,		//Trying to call function in Click PlugIn when there isn't one loaded
    1.80 +	EWsPanicChangeClickPlugin = 47,			//Trying to change keyclick plugin when it's fixed
    1.81 +	EWsPanicInvalidScreenSizeMode = 48,		//The current screen size mode is one that does not exist
    1.82 +	EWsPanicDrawCommandsBufferCorrupt = 49,	//The draw commands buffer contains some inconsistent information
    1.83 +	
    1.84 +	EWsPanicDrawCommandsInvalidState = 50,	//The draw commands state doesn't match with the action that is occuring
    1.85 +	EWsPanicDrawCommandsNullSession = 51,	//Session NULL when it shouldn't be
    1.86 +	EWsPanicBitmapOpcodeInvalid = 52,		//At least one of the bitmap opcodes is invalid
    1.87 +	EWsPanicNoDisplayModeFound = 53,			//No display mode has been found when creating the off-screen bitmap
    1.88 +	EWsCreatedOffScreenBitmapInWrongDimensions = 54,	//There is not enough memory to swap the width and the height as the bitmap was not created with the right dimensions
    1.89 +	EWsFailedToAllocateForOffScreenBitmapDevice = 55,	//Couldn't allocate memory for the device after deleting it
    1.90 +	EWsPanicTransparentInvalidState = 56,				//Something required for transparency is not available
    1.91 +	EWsPanicBadDescriptor = 57,							//The descriptor has been badly constructed
    1.92 +	EWsPanicAlphaBlendBadParams = 58,		//Bad parameters were passed in our call to the Alpha Blending function
    1.93 +	EWsPanicInvalidMessageHandle = 59,		//The current screen size mode is one that does not exist	
    1.94 +	
    1.95 +	EWsPanicWindowNull = 60,				//Window handle NULL when it shouldn't be
    1.96 +	EWsPanicPanicFlagError = 61,			//The panic flag setting is inconsistent with other information
    1.97 +	EWsPanicGCDrawingToWrongDevice = 62,	//The device a GC is drawing to has been changed unexpectantly.
    1.98 +	EWsPanicScreenInformationError = 63,	//Conflict between number of screens defined in INI file and HAL
    1.99 +	EWsPanicGroupWindowChainError = 64,		//An error has occured in the group window chain algorithms
   1.100 +	EWsPanicNoScreen = 65,					//There is no screen when there should be one
   1.101 +	EWsPanicWrongNumberBitmapDevices = 66,	//The number of OSB bitmap devices does not match the number of screen modes
   1.102 +	EWsPanicHiddenInvalidError = 67,		//The Hidden Invalid contains area outside of the FullRect of the window
   1.103 +	EWsPanicWsGraphic = 68,					//An issue in internal state in the CWsGraphicDrawer mechanisms, thrown in debug builds only
   1.104 +	EWsPanicOffScreenBitmapMissing = 69,	//Found an unexpected NULL pointer to an OffScreenBitmap
   1.105 +	
   1.106 +	EWsPanicGCDrawRegionError = 70,//NOT USED//A logic error in the code to decide which region to be drawing too
   1.107 +	EWsPanicFailedToSetThread = 71, 		//Setting wserv thread to system permananent is failed 
   1.108 +	EWsPanicAnimationNotScheduled = 72,		//Animation ran when not scheduled
   1.109 +	EWsPanicAnimationAlreadyAnimating = 73,	//Animation already marked as animating
   1.110 +	EWsPanicSpriteBitmapSizeChange = 74,	//A sprite member bitmap has been made larger, since the sprite was activated, without calling UpdateMember
   1.111 +	EWsPanicMsgQueueError = 75, 			//Error occurs if inactive message queue doesn't have expected number of messages
   1.112 +	EWsPanicRedrawRegionArrayEmpty = 76,	//Trying to retrieve the current redraw region when the redraw region array is empty
   1.113 +	EWsPanicIllegalInvalidArea = 77,		//Invalid area includes region outside visible area of the window.
   1.114 +//	EWsPanicTransparencyManagerNotFreed = 78, // incorrect session shutdown
   1.115 +//	EWsPanicFailedToSetProcess = 79,	   	//For future extention
   1.116 +	EWsPanicDebugRegionMemoryLeak = 80,		//Panic code for RRegionWserv memory leak
   1.117 +	EWsPanicDefaultHotKeyNotFound = 81,		//Default hot key was not found
   1.118 +//	EWsPanicInvalidRedrawStoreDiscardParameter = 82,	 // Invalid parameter specified for redraw store discard detection algorithm.
   1.119 +//	EWsPanicOverflowRedrawStoreDiscardParameter = 83, // Parameter specified for redraw store discard detection algorithm will cause overflow.
   1.120 +	EwsPanicDisplayModeNotSupported = 84,	//Display mode is not supported by screen
   1.121 +	EWsPanicCommandBufferStillBeingProcessed = 85, //Previous command buffer still being processed when another one arrives
   1.122 +	EWsPanicNullClientMessage = 86,			//Processing a client message that is NULL
   1.123 +	EWsPanicNoWindowElement = 87,			//Element not found for window
   1.124 +	EWsPanicInvalidNotificationFlag = 88,	//Invalid Notification event
   1.125 +	EWsPanicNotificationTableIsNull = 89,	//Notification table is unexpectedly NULL
   1.126 +	EWsPanicInvalidOperation = 90,			//An internal use of an operation was invalid
   1.127 +	EWsPanicCompositionNotSupported = 91,			//An attempt to use compositor on a screen which doesn't support it XXX UNUSED??
   1.128 +	EWsPanicCompositionErrorIgnored = 92,			//In release the composition error would have been ignored. Occurs in debug builds only. XXX UNUSED??
   1.129 +	EWsPanicExpectedSurfaceChange = 93,		//Surfaces returned by different screen devices unexpectedly match
   1.130 +	EWsPanicSurfaceMapError = 94,			//There was a problem when unregistering a surface from the registered surface map.
   1.131 +	EWsPanicScheduledRedraw = 95,			//Something went horribly wrong in the redraw scheduling code
   1.132 +	EWsPanicRedrawSegmentsInvalidState = 96, //The redraw segments are in a state they should never be able to reach
   1.133 +	EWsPanicMemoryManager = 97,				//The memory manager encountered an inconsistant environment somehow
   1.134 +	EWsPanicAccessList = 98,				//The access list is invalid
   1.135 +	EWsPanicScreenFallback = 99,			//The screens low memory fallback system has failed
   1.136 +	
   1.137 +	EWsPanicActiveScheduler = 100,			//The active scheduler encountered an inconsistant environment somehow
   1.138 +	EWsPanicDrawFailure = 101,				//A draw function which can't leave left
   1.139 +	EWsPanicMemoryLock = 102,				//The memory lock/unlock for memory management failed
   1.140 +	
   1.141 +	EWsPanicRecycleElement = 103,			//No element to recycle
   1.142 +	EWsPanicUnexpectedOpacity = 104,		//Unexpected opacity being set on a window
   1.143 +	EWsPanicMaxPointersOutOfRange = 105,	//HALData::EPointerMaxPointers is out of range
   1.144 +	EWsPanicMaxPointersInconsistent = 106,  //HALData::EPointerMaxPointers is inconsistent with TXYInputType reported by HAL
   1.145 +	EWsPanicPointer3DInconsistent = 107,	//HALData::EPointer3D is inconsistent with TXYInputType reported by HAL
   1.146 +	EWsPanicProxThresholdsInconsist = 108,	//HALData::EPointer3DEnterCloseProximityThreshold is settable, but EPointer3DExitCloseProximityThreshold is not
   1.147 +	EWsPanicPressThresholdsInconsist = 109,	//HALData::EPointer3DEnterHighPressureThreshold is settable, EPointer3DExitHighPressureThreshold is not
   1.148 +	EWsPanicScreenDeviceMissing = 110,		//Can't find an instance of MWsScreenDevice
   1.149 +	EWsPanicSceneMissing = 111,				//Can't find an instance of MWsScene
   1.150 +	EWsPanicNoRenderStagePipeline = 112,	//Failed to create/connect the render stage pipeline
   1.151 +	EWsPanicInvalidChromaKeyColor = 113,	//Chroma key color has to be fully opaque
   1.152 +	EWsPanicTextCursorInterfaceMissing = 114,	//The interface in the Render Stage to support Text Cursors is missing
   1.153 +	EWsPanicSceneErrorIgnored = 115,		//In release the scene error would have been ignored. Occurs in debug builds only.
   1.154 +	EWsPanicNoDisplayControl = 116,	//Display control expected
   1.155 +	EWsPanicVisibleRegionTracking = 117,
   1.156 +	EWsPanicNoChangetracking = 118,			//CHANGETRACKING mode is expected to be set
   1.157 +	EWsPanicNoSprite = 119,
   1.158 +	EWsPanicAnim = 120,
   1.159 +	EWsPanicFloatingSprite = 121,
   1.160 +	EWsPanicRenderstageAPIs = 122,
   1.161 +	EWsPanicBitmapArrayNotEmpty = 123,      //Bitmap array is not empty, when it is expected to be empty
   1.162 +	EWsPanicCounterValue = 124,             //Counter value is not the expected one
   1.163 +	EWsPanicUnexpectedBitmapHandleInArray = 125,     //Bitmap handle in array with no matching bitmap object in bitmap ref array
   1.164 +	EWsPanicBitmapNotFound = 126,           //Failed to find a bitmap in the bitmap ref array
   1.165 +	EWsPanicInvalidRotation = 127,			//Invalid rotation used
   1.166 +	EWsPanicInvalidPointerOffset = 128,      //The pointer offset value in wsini.ini is invalid.
   1.167 +	EWsPanicArrayInsertFailed = 129,	//Array insert failed.           
   1.168 +	EWsPanicAccessBeyondCommandBuf = 130,	//Access beyond wserv command buffer
   1.169 +	EWsPanicKeyEventRouterBadResult = 131,		// Invalid result code from key event routing plug-in
   1.170 +	EWsPanicKeyEventRouterBadWindowGroup = 132,	// Invalid destination window group from key event routing plug-in
   1.171 +	EWsPanicKeyEventRouterLeave = 133,			// Invalid leave from Key event routing plug-in
   1.172 +	};
   1.173 +
   1.174 +void Panic(TWservPanic aPanic);
   1.175 +void PanicWithInfo(TWservPanic aPanic, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
   1.176 +void PanicWithCondAndInfo(TWservPanic aPanic, const TDesC& aCondition, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
   1.177 +
   1.178 +// helper macros
   1.179 +#define WS_ASSERT_FILENAME(f)	_LIT(KPanicFileName, f);
   1.180 +#define WS_ASSERT_PANICNAME(p)	_LIT(KPanicEnum ## p, # p);
   1.181 +#define WS_ASSERT_CONDITION(c)	_LIT(KPanicCondition, c);
   1.182 +
   1.183 +
   1.184 +/* Use these macros for WServ server Asserts & Panics with diagnostic logging:
   1.185 +   WS_ASSERT_ALWAYS, WS_PANIC_ALWAYS, WS_ASSERT_DEBUG and WS_PANIC_DEBUG
   1.186 +   Note that the "do { ... } while (0)" construction forces the invocation to have a ';'
   1.187 +   and makes the macro expansion safe in nested "if ... else ..." clauses that forget to use the
   1.188 +   { braces } in the Coding Standard.
   1.189 + */
   1.190 +#define WS_ASSERT_ALWAYS(c, p) \
   1.191 +		do  { \
   1.192 +			if (!(c)) \
   1.193 +				{ \
   1.194 +				WS_ASSERT_FILENAME(__FILE__); \
   1.195 +				WS_ASSERT_PANICNAME(p); \
   1.196 +				WS_ASSERT_CONDITION(#c); \
   1.197 +				PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
   1.198 +				} \
   1.199 +			} while (0)
   1.200 +
   1.201 +#define WS_PANIC_ALWAYS(p) \
   1.202 +		do  { \
   1.203 +			WS_ASSERT_FILENAME(__FILE__); \
   1.204 +			WS_ASSERT_PANICNAME(p); \
   1.205 +			PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
   1.206 +			} while (0)
   1.207 +
   1.208 +
   1.209 +#if defined(_DEBUG)
   1.210 +#define WS_ASSERT_DEBUG(c, p) \
   1.211 +		do  { \
   1.212 +			if (!(c)) \
   1.213 +				{ \
   1.214 +				WS_ASSERT_FILENAME(__FILE__); \
   1.215 +				WS_ASSERT_PANICNAME(p); \
   1.216 +				WS_ASSERT_CONDITION(#c); \
   1.217 +				PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
   1.218 +				} \
   1.219 +			} while (0)
   1.220 +
   1.221 +#define WS_PANIC_DEBUG(p) \
   1.222 +		do  { \
   1.223 +			WS_ASSERT_FILENAME(__FILE__); \
   1.224 +			WS_ASSERT_PANICNAME(p); \
   1.225 +			PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
   1.226 +			} while (0)
   1.227 +#else
   1.228 +#define WS_ASSERT_DEBUG(c, p)
   1.229 +#define WS_PANIC_DEBUG(p)
   1.230 +#endif
   1.231 +
   1.232 +
   1.233 +#endif