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