sl@0: // Copyright (c) 2007-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 DIRECTGDIADAPTER_H sl@0: #define DIRECTGDIADAPTER_H sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #include sl@0: sl@0: _LIT(KComponentPanicCategory, "DGDIAdapter"); sl@0: #define SYMBIAN_PANIC_CATEGORY KComponentPanicCategory sl@0: sl@0: #include "directgditypes.h" sl@0: #include sl@0: sl@0: sl@0: /** sl@0: Enumeration of DirectGDI panic codes. These should be used in conjunction with sl@0: the ASSERT_ALWAYS and ASSERT_DEBUG macros defined below. sl@0: */ sl@0: enum TDirectGdiAdapterPanicCode sl@0: { sl@0: /** The requested functionality has not been implemented - do not use. sl@0: */ sl@0: EDirectGdiPanicNotImplemented = 1, sl@0: sl@0: /** An unexpected error has occured. sl@0: */ sl@0: EDirectGdiPanicUnexpectedError = 2, sl@0: sl@0: /** Invalid reference count to DirectGDI driver. sl@0: */ sl@0: EDirectGdiPanicDriverInvalidRefCount = 6, sl@0: sl@0: /** NULL bitmap specified. sl@0: */ sl@0: EDirectGdiPanicInvalidBitmap = 7, sl@0: sl@0: /** Invalid region passed into function. sl@0: */ sl@0: EDirectGdiPanicInvalidRegion = 8, sl@0: sl@0: /** An attempt has been made to use a patterned brush style when a patterned brush has not been set. sl@0: */ sl@0: EDirectGdiPanicPatternedBrushNotSet = 12, sl@0: sl@0: /** Unable to bind a rendering API. sl@0: */ sl@0: EDirectGdiPanicBindApi = 23, sl@0: sl@0: /** No drawing surface configurations are available. sl@0: */ sl@0: EDirectGdiPanicNoAvailableConfigs = 24, sl@0: sl@0: /** No available drawing surface configurations match specific attributes. sl@0: */ sl@0: EDirectGdiPanicNoMatchingConfig = 25, sl@0: sl@0: /** CVgEngine::DrawPolygon() was passed an invalid fill-rule. sl@0: */ sl@0: EDirectGdiPanicInvalidFillRule = 26, sl@0: sl@0: /** An array defining a polyline/polygon has too few points. sl@0: */ sl@0: EDirectGdiPanicInvalidPointArray = 27, sl@0: sl@0: /** RSgImage::GetPixelFormats() returns pixel count = 0. sl@0: */ sl@0: EDirectGdiPanicNoValidPixelFormats = 29, sl@0: sl@0: /** Open count error in CDirectGdiDrawableRef::Close(). sl@0: */ sl@0: EDirectGdiPanicDrawableRefCountError = 30, sl@0: sl@0: /** Attempt to get a handle to a drawable resource using CDirectGdiDriverImpl::GetImageTargetFromHandle(), sl@0: * CDirectGdiDriverImpl::GetImageSourceFromHandle(), CDirectGdiDriverImpl::GetDrawableSourceFromHandle() sl@0: * or CSwDirectGdiDriverImpl::FindImageTargetImpl() failed. sl@0: */ sl@0: EDirectGdiPanicResourceHandleNotFound = 32, sl@0: sl@0: /** Driver Process State has not been initialised. sl@0: */ sl@0: EDirectGdiPanicProcessStateNotInitialized = 33, sl@0: sl@0: /** Attempt to activate a target in CVgEngine::Activate() or CSwDirectGdiEngine::Activate() with a NULL handle. sl@0: */ sl@0: EDirectGdiPanicActivateWithNullHandle = 34, sl@0: sl@0: /** Unable to initialise a display. sl@0: */ sl@0: EDirectGdiPanicInitializeDisplay = 35, sl@0: sl@0: /** No display to which graphics are drawn. sl@0: */ sl@0: EDirectGdiPanicNoDisplay = 36, sl@0: sl@0: /** Unable to close a drawable handle. sl@0: */ sl@0: EDirectGdiPanicCloseDrawableHandleFailure = 37, sl@0: sl@0: /** Attempt to destroy a NULL engine in CDirectGdiDriverImpl::DestroyEngine(). sl@0: */ sl@0: EDirectGdiPanicDestroyNullEngine = 38, sl@0: sl@0: /** Attempt to activate a NULL target in CDirectGdiDriverImpl::Activate(). sl@0: */ sl@0: EDirectGdiPanicNullTargetActivate = 39, sl@0: sl@0: /** Failed to find a config for a particular pixel type. sl@0: */ sl@0: EDirectGdiPanicNoConfigFound = 41, sl@0: sl@0: /** Failed to create a drawing surface. sl@0: */ sl@0: EDirectGdiPanicNoDrawingSurface = 42, sl@0: sl@0: /** Failed to create a drawing context. sl@0: */ sl@0: EDirectGdiPanicNoContext = 43, sl@0: sl@0: /** Attempt to delete a CDirectGdiDrawableRef object when its reference count is non-zero. sl@0: */ sl@0: EDirectGdiPanicDrawableRefDestructorError = 44, sl@0: sl@0: /** A driver was closed while some drawable items were still in the drawable array. sl@0: */ sl@0: EDirectGdiPanicItemsLeftInImageArray = 45, sl@0: sl@0: /** Inconsistency in internal data of glyph cache structure. sl@0: */ sl@0: EDirectGdiPanicGlyphCacheDataInconsistent = 46, sl@0: sl@0: /** Valid reference to image source not found. sl@0: */ sl@0: EDirectGdiPanicImageSourceNotFound = 47, sl@0: sl@0: /** An invalid image handle was passed to the CImageSourceData constructor. sl@0: */ sl@0: EDirectGdiPanicImageSourceDataConstructorError = 48, sl@0: sl@0: /** The reference count was not zero in the destructor of CImageSourceData. sl@0: */ sl@0: EDirectGdiPanicImageSourceDataRefCountError = 49, sl@0: sl@0: /** The instance count was not zero in the destructor of CDirectGdiDriverProcessState. sl@0: */ sl@0: EDirectGdiPanicProcessStateInstanceCountError = 50, sl@0: sl@0: /** The image count was not zero in the destructor of CDirectGdiDriverProcessState. sl@0: */ sl@0: EDirectGdiPanicProcessStateImageCountError = 51, sl@0: sl@0: /** This panic only occurs when _DEBUG_DIRECTGDI is defined. One of the methods in sl@0: CDirectGdiDriverProcessState was called without the image's mutex being held. sl@0: */ sl@0: EDirectGdiPanicImageMutexError = 52, sl@0: sl@0: /** Attempt to activate a target in CSwDirectGdiEngine::Activate() with a NULL draw device. sl@0: */ sl@0: EDirectGdiPanicActivateWithNullDrawDevice = 53, sl@0: sl@0: /** Attempt to deactive a NULL target in CDirectGdiDriverImpl. sl@0: */ sl@0: EDirectGdiPanicNullTargetDeactivate = 55, sl@0: sl@0: /** This panic occurs when DrawGlyph is called on an unsupported glyph bitmap type. sl@0: */ sl@0: EDirectGdiPanicInvalidGlyphBitmapType = 56, sl@0: sl@0: /** Attempt to create a new image source/drawable source using a handle that already has sl@0: an image source/drawable source associated with it. sl@0: */ sl@0: EDirectGdiPanicSourceHandleNotNull = 57, sl@0: sl@0: /** Attempt to create a new image target using a handle that is already has an image target associated with it. sl@0: */ sl@0: EDirectGdiPanicTargetHandleNotNull = 58, sl@0: sl@0: /** An egl Api returned a failure. The actual egl error code is reported in the log. sl@0: */ sl@0: EEglApiFailure = 59, sl@0: sl@0: /** In a call to DestroyEngine(), the engine could not be found in the internal list of engines. sl@0: */ sl@0: EDirectGdiPanicEngineNotFound = 60, sl@0: sl@0: /** Glyph image storage was not created. sl@0: */ sl@0: EDirectGdiPanicGlyphImageStorageNotCreated = 61, sl@0: sl@0: /** Pen end cap style expected to be rounded, but found not to be. sl@0: */ sl@0: EDirectGdiPanicPenEndCapStyleNotRound = 62, sl@0: sl@0: /** eglWaitClient error. sl@0: */ sl@0: EDirectGdiPanicFinish = 63, sl@0: sl@0: /** An error code from vgGetError which is caused by incorrect usage of OpenVG. sl@0: */ sl@0: EDirectGdiPanicVgError = 64, sl@0: sl@0: /** Whilst performing a Clear() the clear-brush is not a recognised paint brush. sl@0: */ sl@0: EDirectGdiPanicClearBrushInvalid = 65, sl@0: sl@0: /** Panic codes corresponding to the old BitGdi codes (+1000). sl@0: Any more panic codes from BitGDI generic DirectGDI should be added in this section. sl@0: */ sl@0: EDirectGdiPanicInvalidParameter = 1006, sl@0: EDirectGdiPanicInvalidDisplayMode = 1009, sl@0: sl@0: /** Attempt to draw outside of clipping region. sl@0: */ sl@0: EDirectGdiPanicOutOfBounds = 1013, sl@0: EDirectGdiPanicPolygonFiller = 1015, sl@0: EDirectGdiPanicZeroLength = 1016, sl@0: EDirectGdiPanicInvalidPointer = 1018, sl@0: EDirectGdiPanicInvalidArg = 1021, sl@0: EDirectGdiPanicNegativeShift = 1022, sl@0: sl@0: /** sl@0: This panic may occur if MOutlineAndShadowBlend interface is not implemented, or sl@0: the MSgImage_Sw interface is not implemented on RSgImage. sl@0: */ sl@0: EDirectGdiPanicInvalidInterfaceHandle = 1023, sl@0: // End of panic codes corresponding to the old BitGDI codes. sl@0: }; sl@0: sl@0: /** sl@0: Log current eglGetError() to the debug stream, along with line number and source file name. sl@0: This must be #defined so that we retain the line and source file information at the sl@0: point in which LogEglError() is invoked. sl@0: */ sl@0: #ifdef _DEBUG sl@0: #define LogEglError() {TBuf16<256> message; message.Format(_L16("EGL Error: %x\n"), eglGetError()); GRAPHICS_LOGD_DEBUG(message);} sl@0: #else sl@0: #define LogEglError() {} sl@0: #endif //_DEBUG sl@0: sl@0: #endif /*DIRECTGDIADAPTER_H*/ sl@0: sl@0: