windowing/windowserver/SERVER/openwfc/panics.h
changeset 0 5d03bc08d59c
child 19 ac96196b945c
child 116 171fae344dd4
equal deleted inserted replaced
-1:000000000000 0:5d03bc08d59c
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Window server panics
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __PANICS_H__
       
    19 #define __PANICS_H__
       
    20 
       
    21 #include <e32def.h>
       
    22 #include <e32cmn.h>
       
    23 
       
    24 enum TWservPanic
       
    25 	{
       
    26 	EWsPanicTemp = 0, 				// Used for panics that aren't intended to be left in the code
       
    27 	EWsPanicInvalidInvalidArea = 1,
       
    28 	EWsPanicArea = 2,
       
    29 	EWsPanicRegion = 3,
       
    30 	EWsPanicQueueUpdateCount = 4,
       
    31 	EWsPanicUnknownCaptureKey = 5,
       
    32 	EWsPanicInvalidCursorType = 6,
       
    33 	EWsPanicInvalidRegion = 7,
       
    34 	EWsPanicInvalidArea = 8,
       
    35 	EWsPanicTextCursorFocus = 9,
       
    36 	
       
    37 	EWsPanicWindowType = 10,
       
    38 	EWsPanicRootCommand = 11,
       
    39 	EWsPanicWindowCheck = 12,
       
    40 	EWsPanicFailedToInitialise = 13,
       
    41 	EWsPanicBadActiveGcList = 14,
       
    42 	//EWsPanicShadowLockingError = 15,
       
    43 	EWsPanicBackupRegion = 16,
       
    44 	EWsPanicKeyRepeat = 17 ,
       
    45 	EWsPanicErrorInRegion = 18,
       
    46 	EWsPanicRedrawQueueError = 19,
       
    47 	
       
    48 	EWsPanicRegionErrorCheck = 20, // NOT USED
       
    49 	EWsPanicPointerRepeatTimerStatus = 21,
       
    50 	EWsPanicCheckEventQueue = 22,
       
    51 	EWsPanicEventQueueCopy = 23,
       
    52 	EWsPanicFontCacheCount = 24,
       
    53 	//EWsPanicNegativeShadow = 25,
       
    54 	EWsPanicPointerClaimGrab = 26,
       
    55 	EWsPanicPointerCursorAccessCount = 27,
       
    56 	EWsPanicSetOrdinalPos = 28,
       
    57 	EWsPanicGcStructSizeError = 29,
       
    58 	
       
    59 	EWsPanicPointerTimer = 30,
       
    60 	EWsPanicNullDeviceHandle = 31,			//A function returned a NULL device handle unexpectantly
       
    61 	EWsPanicColorModeInconsitency = 32,		//Logic error while analysing the nature of Color Modes
       
    62 	EWsPanicCurrentlyFaded = 33,			//Should not do while window is fadded
       
    63 	EWsPanicEventType = 34,					//Must be a pointer event
       
    64 	EWsPanicObjectIndexError = 35,			//Object being removed has wrong type
       
    65 	EWsPanicAnimHasNoWindow = 36,			//This AnimDLL function needs the Anim to have a window
       
    66 	EWsPanicSpriteAlreadyActive = 37,		//An attempt to activate an active sprite
       
    67 	EWsPanicAlreadyHaveBackup = 38,			//Getting backup behind when already got it
       
    68 	EWsPanicSpriteHiddenCount = 39,			//The Sprite's hidden count is inconsistent with the action being performed on it
       
    69 	
       
    70 	EWsPanicRawEventsTypeChanged = 40,		//Changes to the Raw Event Type List will probably break this code
       
    71 	EWsPanicEventHandlerInconsistency = 41,	//The number of things claiming to be event handlers doesn't make sence
       
    72 	EWsPanicBackupStateError = 42,			//Something has gone wrong with the state of the Backup classes
       
    73 	EWsPanicRegionNull = 43,				//A region shouldn't be NULL or set to the nullRegion at this point
       
    74 	//EWsPanicShadowError = 44,				//The shadows have not be updated correctly
       
    75 	EWsPanicDirectScreenAccess = 45,		//Error in the state machine of or logic error in Direct Screen Access code
       
    76 	EWsPanicClickPluginNotLoaded = 46,		//Trying to call function in Click PlugIn when there isn't one loaded
       
    77 	EWsPanicChangeClickPlugin = 47,			//Trying to change keyclick plugin when it's fixed
       
    78 	EWsPanicInvalidScreenSizeMode = 48,		//The current screen size mode is one that does not exist
       
    79 	EWsPanicDrawCommandsBufferCorrupt = 49,	//The draw commands buffer contains some inconsistent information
       
    80 	
       
    81 	EWsPanicDrawCommandsInvalidState = 50,	//The draw commands state doesn't match with the action that is occuring
       
    82 	EWsPanicDrawCommandsNullSession = 51,	//Session NULL when it shouldn't be
       
    83 	EWsPanicBitmapOpcodeInvalid = 52,		//At least one of the bitmap opcodes is invalid
       
    84 	EWsPanicNoDisplayModeFound = 53,			//No display mode has been found when creating the off-screen bitmap
       
    85 	EWsCreatedOffScreenBitmapInWrongDimensions = 54,	//There is not enough memory to swap the width and the height as the bitmap was not created with the right dimensions
       
    86 	EWsFailedToAllocateForOffScreenBitmapDevice = 55,	//Couldn't allocate memory for the device after deleting it
       
    87 	EWsPanicTransparentInvalidState = 56,				//Something required for transparency is not available
       
    88 	EWsPanicBadDescriptor = 57,							//The descriptor has been badly constructed
       
    89 	EWsPanicAlphaBlendBadParams = 58,		//Bad parameters were passed in our call to the Alpha Blending function
       
    90 	EWsPanicInvalidMessageHandle = 59,		//The current screen size mode is one that does not exist	
       
    91 	
       
    92 	EWsPanicWindowNull = 60,				//Window handle NULL when it shouldn't be
       
    93 	EWsPanicPanicFlagError = 61,			//The panic flag setting is inconsistent with other information
       
    94 	EWsPanicGCDrawingToWrongDevice = 62,	//The device a GC is drawing to has been changed unexpectantly.
       
    95 	EWsPanicScreenInformationError = 63,	//Conflict between number of screens defined in INI file and HAL
       
    96 	EWsPanicGroupWindowChainError = 64,		//An error has occured in the group window chain algorithms
       
    97 	EWsPanicNoScreen = 65,					//There is no screen when there should be one
       
    98 	EWsPanicWrongNumberBitmapDevices = 66,	//The number of OSB bitmap devices does not match the number of screen modes
       
    99 	EWsPanicHiddenInvalidError = 67,		//The Hidden Invalid contains area outside of the FullRect of the window
       
   100 	EWsPanicWsGraphic = 68,					//An issue in internal state in the CWsGraphicDrawer mechanisms, thrown in debug builds only
       
   101 	EWsPanicOffScreenBitmapMissing = 69,	//Found an unexpected NULL pointer to an OffScreenBitmap
       
   102 	
       
   103 	EWsPanicGCDrawRegionError = 70,//NOT USED//A logic error in the code to decide which region to be drawing too
       
   104 	EWsPanicFailedToSetThread = 71, 		//Setting wserv thread to system permananent is failed 
       
   105 	EWsPanicAnimationNotScheduled = 72,		//Animation ran when not scheduled
       
   106 	EWsPanicAnimationAlreadyAnimating = 73,	//Animation already marked as animating
       
   107 	EWsPanicSpriteBitmapSizeChange = 74,	//A sprite member bitmap has been made larger, since the sprite was activated, without calling UpdateMember
       
   108 	EWsPanicMsgQueueError = 75, 			//Error occurs if inactive message queue doesn't have expected number of messages
       
   109 	EWsPanicRedrawRegionArrayEmpty = 76,	//Trying to retrieve the current redraw region when the redraw region array is empty
       
   110 	EWsPanicIllegalInvalidArea = 77,		//Invalid area includes region outside visible area of the window.
       
   111 //	EWsPanicTransparencyManagerNotFreed = 78, // incorrect session shutdown
       
   112 //	EWsPanicFailedToSetProcess = 79,	   	//For future extention
       
   113 	EWsPanicDebugRegionMemoryLeak = 80,		//Panic code for RRegionWserv memory leak
       
   114 	EWsPanicDefaultHotKeyNotFound = 81,		//Default hot key was not found
       
   115 //	EWsPanicInvalidRedrawStoreDiscardParameter = 82,	 // Invalid parameter specified for redraw store discard detection algorithm.
       
   116 //	EWsPanicOverflowRedrawStoreDiscardParameter = 83, // Parameter specified for redraw store discard detection algorithm will cause overflow.
       
   117 	EwsPanicDisplayModeNotSupported = 84,	//Display mode is not supported by screen
       
   118 	EWsPanicCommandBufferStillBeingProcessed = 85, //Previous command buffer still being processed when another one arrives
       
   119 	EWsPanicNullClientMessage = 86,			//Processing a client message that is NULL
       
   120 	EWsPanicNoWindowElement = 87,			//Element not found for window
       
   121 	EWsPanicInvalidNotificationFlag = 88,	//Invalid Notification event
       
   122 	EWsPanicNotificationTableIsNull = 89,	//Notification table is unexpectedly NULL
       
   123 	EWsPanicInvalidOperation = 90,			//An internal use of an operation was invalid
       
   124 	EWsPanicCompositionNotSupported = 91,			//An attempt to use compositor on a screen which doesn't support it XXX UNUSED??
       
   125 	EWsPanicCompositionErrorIgnored = 92,			//In release the composition error would have been ignored. Occurs in debug builds only. XXX UNUSED??
       
   126 	EWsPanicExpectedSurfaceChange = 93,		//Surfaces returned by different screen devices unexpectedly match
       
   127 	EWsPanicSurfaceMapError = 94,			//There was a problem when unregistering a surface from the registered surface map.
       
   128 	EWsPanicScheduledRedraw = 95,			//Something went horribly wrong in the redraw scheduling code
       
   129 	EWsPanicRedrawSegmentsInvalidState = 96, //The redraw segments are in a state they should never be able to reach
       
   130 	EWsPanicMemoryManager = 97,				//The memory manager encountered an inconsistant environment somehow
       
   131 	EWsPanicAccessList = 98,				//The access list is invalid
       
   132 	EWsPanicScreenFallback = 99,			//The screens low memory fallback system has failed
       
   133 	
       
   134 	EWsPanicActiveScheduler = 100,			//The active scheduler encountered an inconsistant environment somehow
       
   135 	EWsPanicDrawFailure = 101,				//A draw function which can't leave left
       
   136 	EWsPanicMemoryLock = 102,				//The memory lock/unlock for memory management failed
       
   137 	
       
   138 	EWsPanicRecycleElement = 103,			//No element to recycle
       
   139 	EWsPanicUnexpectedOpacity = 104,		//Unexpected opacity being set on a window
       
   140 	EWsPanicMaxPointersOutOfRange = 105,	//HALData::EPointerMaxPointers is out of range
       
   141 	EWsPanicMaxPointersInconsistent = 106,  //HALData::EPointerMaxPointers is inconsistent with TXYInputType reported by HAL
       
   142 	EWsPanicPointer3DInconsistent = 107,	//HALData::EPointer3D is inconsistent with TXYInputType reported by HAL
       
   143 	EWsPanicProxThresholdsInconsist = 108,	//HALData::EPointer3DEnterCloseProximityThreshold is settable, but EPointer3DExitCloseProximityThreshold is not
       
   144 	EWsPanicPressThresholdsInconsist = 109,	//HALData::EPointer3DEnterHighPressureThreshold is settable, EPointer3DExitHighPressureThreshold is not
       
   145 	EWsPanicScreenDeviceMissing = 110,		//Can't find an instance of MWsScreenDevice
       
   146 	EWsPanicSceneMissing = 111,				//Can't find an instance of MWsScene
       
   147 	EWsPanicNoRenderStagePipeline = 112,	//Failed to create/connect the render stage pipeline
       
   148 	EWsPanicInvalidChromaKeyColor = 113,	//Chroma key color has to be fully opaque
       
   149 	EWsPanicTextCursorInterfaceMissing = 114,	//The interface in the Render Stage to support Text Cursors is missing
       
   150 	EWsPanicSceneErrorIgnored = 115,		//In release the scene error would have been ignored. Occurs in debug builds only.
       
   151 	EWsPanicNoDisplayControl = 116,	//Display control expected
       
   152 	EWsPanicVisibleRegionTracking = 117,
       
   153 	EWsPanicNoChangetracking = 118,			//CHANGETRACKING mode is expected to be set
       
   154 	EWsPanicNoSprite = 119,
       
   155 	EWsPanicAnim = 120,
       
   156 	EWsPanicFloatingSprite = 121,
       
   157 	EWsPanicRenderstageAPIs = 122,
       
   158 	EWsPanicBitmapArrayNotEmpty = 123,      //Bitmap array is not empty, when it is expected to be empty
       
   159 	EWsPanicCounterValue = 124,             //Counter value is not the expected one
       
   160 	EWsPanicUnexpectedBitmapHandleInArray = 125,     //Bitmap handle in array with no matching bitmap object in bitmap ref array
       
   161 	EWsPanicBitmapNotFound = 126,           //Failed to find a bitmap in the bitmap ref array
       
   162 	EWsPanicInvalidRotation = 127,			//Invalid rotation used
       
   163 	EWsPanicInvalidPointerOffset = 128,      //The pointer offset value in wsini.ini is invalid.
       
   164 	EWsPanicArrayInsertFailed = 129,	//Array insert failed.           
       
   165 	};
       
   166 
       
   167 void Panic(TWservPanic aPanic);
       
   168 void PanicWithInfo(TWservPanic aPanic, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
       
   169 void PanicWithCondAndInfo(TWservPanic aPanic, const TDesC& aCondition, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
       
   170 
       
   171 // helper macros
       
   172 #define WS_ASSERT_FILENAME(f)	_LIT(KPanicFileName, f);
       
   173 #define WS_ASSERT_PANICNAME(p)	_LIT(KPanicEnum ## p, # p);
       
   174 #define WS_ASSERT_CONDITION(c)	_LIT(KPanicCondition, c);
       
   175 
       
   176 
       
   177 /* Use these macros for WServ server Asserts & Panics with diagnostic logging:
       
   178    WS_ASSERT_ALWAYS, WS_PANIC_ALWAYS, WS_ASSERT_DEBUG and WS_PANIC_DEBUG
       
   179    Note that the "do { ... } while (0)" construction forces the invocation to have a ';'
       
   180    and makes the macro expansion safe in nested "if ... else ..." clauses that forget to use the
       
   181    { braces } in the Coding Standard.
       
   182  */
       
   183 #define WS_ASSERT_ALWAYS(c, p) \
       
   184 		do  { \
       
   185 			if (!(c)) \
       
   186 				{ \
       
   187 				WS_ASSERT_FILENAME(__FILE__); \
       
   188 				WS_ASSERT_PANICNAME(p); \
       
   189 				WS_ASSERT_CONDITION(#c); \
       
   190 				PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
       
   191 				} \
       
   192 			} while (0)
       
   193 
       
   194 #define WS_PANIC_ALWAYS(p) \
       
   195 		do  { \
       
   196 			WS_ASSERT_FILENAME(__FILE__); \
       
   197 			WS_ASSERT_PANICNAME(p); \
       
   198 			PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
       
   199 			} while (0)
       
   200 
       
   201 
       
   202 #if defined(_DEBUG)
       
   203 #define WS_ASSERT_DEBUG(c, p) \
       
   204 		do  { \
       
   205 			if (!(c)) \
       
   206 				{ \
       
   207 				WS_ASSERT_FILENAME(__FILE__); \
       
   208 				WS_ASSERT_PANICNAME(p); \
       
   209 				WS_ASSERT_CONDITION(#c); \
       
   210 				PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
       
   211 				} \
       
   212 			} while (0)
       
   213 
       
   214 #define WS_PANIC_DEBUG(p) \
       
   215 		do  { \
       
   216 			WS_ASSERT_FILENAME(__FILE__); \
       
   217 			WS_ASSERT_PANICNAME(p); \
       
   218 			PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
       
   219 			} while (0)
       
   220 #else
       
   221 #define WS_ASSERT_DEBUG(c, p)
       
   222 #define WS_PANIC_DEBUG(p)
       
   223 #endif
       
   224 
       
   225 
       
   226 #endif