os/graphics/graphicsdeviceinterface/directgdiadaptation/cmnsrc/directgdiadapter.h
First public contribution.
1 // Copyright (c) 2007-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef DIRECTGDIADAPTER_H
17 #define DIRECTGDIADAPTER_H
26 _LIT(KComponentPanicCategory, "DGDIAdapter");
27 #define SYMBIAN_PANIC_CATEGORY KComponentPanicCategory
29 #include "directgditypes.h"
30 #include <graphics/directgdipanics.h>
34 Enumeration of DirectGDI panic codes. These should be used in conjunction with
35 the ASSERT_ALWAYS and ASSERT_DEBUG macros defined below.
37 enum TDirectGdiAdapterPanicCode
39 /** The requested functionality has not been implemented - do not use.
41 EDirectGdiPanicNotImplemented = 1,
43 /** An unexpected error has occured.
45 EDirectGdiPanicUnexpectedError = 2,
47 /** Invalid reference count to DirectGDI driver.
49 EDirectGdiPanicDriverInvalidRefCount = 6,
51 /** NULL bitmap specified.
53 EDirectGdiPanicInvalidBitmap = 7,
55 /** Invalid region passed into function.
57 EDirectGdiPanicInvalidRegion = 8,
59 /** An attempt has been made to use a patterned brush style when a patterned brush has not been set.
61 EDirectGdiPanicPatternedBrushNotSet = 12,
63 /** Unable to bind a rendering API.
65 EDirectGdiPanicBindApi = 23,
67 /** No drawing surface configurations are available.
69 EDirectGdiPanicNoAvailableConfigs = 24,
71 /** No available drawing surface configurations match specific attributes.
73 EDirectGdiPanicNoMatchingConfig = 25,
75 /** CVgEngine::DrawPolygon() was passed an invalid fill-rule.
77 EDirectGdiPanicInvalidFillRule = 26,
79 /** An array defining a polyline/polygon has too few points.
81 EDirectGdiPanicInvalidPointArray = 27,
83 /** RSgImage::GetPixelFormats() returns pixel count = 0.
85 EDirectGdiPanicNoValidPixelFormats = 29,
87 /** Open count error in CDirectGdiDrawableRef::Close().
89 EDirectGdiPanicDrawableRefCountError = 30,
91 /** Attempt to get a handle to a drawable resource using CDirectGdiDriverImpl::GetImageTargetFromHandle(),
92 * CDirectGdiDriverImpl::GetImageSourceFromHandle(), CDirectGdiDriverImpl::GetDrawableSourceFromHandle()
93 * or CSwDirectGdiDriverImpl::FindImageTargetImpl() failed.
95 EDirectGdiPanicResourceHandleNotFound = 32,
97 /** Driver Process State has not been initialised.
99 EDirectGdiPanicProcessStateNotInitialized = 33,
101 /** Attempt to activate a target in CVgEngine::Activate() or CSwDirectGdiEngine::Activate() with a NULL handle.
103 EDirectGdiPanicActivateWithNullHandle = 34,
105 /** Unable to initialise a display.
107 EDirectGdiPanicInitializeDisplay = 35,
109 /** No display to which graphics are drawn.
111 EDirectGdiPanicNoDisplay = 36,
113 /** Unable to close a drawable handle.
115 EDirectGdiPanicCloseDrawableHandleFailure = 37,
117 /** Attempt to destroy a NULL engine in CDirectGdiDriverImpl::DestroyEngine().
119 EDirectGdiPanicDestroyNullEngine = 38,
121 /** Attempt to activate a NULL target in CDirectGdiDriverImpl::Activate().
123 EDirectGdiPanicNullTargetActivate = 39,
125 /** Failed to find a config for a particular pixel type.
127 EDirectGdiPanicNoConfigFound = 41,
129 /** Failed to create a drawing surface.
131 EDirectGdiPanicNoDrawingSurface = 42,
133 /** Failed to create a drawing context.
135 EDirectGdiPanicNoContext = 43,
137 /** Attempt to delete a CDirectGdiDrawableRef object when its reference count is non-zero.
139 EDirectGdiPanicDrawableRefDestructorError = 44,
141 /** A driver was closed while some drawable items were still in the drawable array.
143 EDirectGdiPanicItemsLeftInImageArray = 45,
145 /** Inconsistency in internal data of glyph cache structure.
147 EDirectGdiPanicGlyphCacheDataInconsistent = 46,
149 /** Valid reference to image source not found.
151 EDirectGdiPanicImageSourceNotFound = 47,
153 /** An invalid image handle was passed to the CImageSourceData constructor.
155 EDirectGdiPanicImageSourceDataConstructorError = 48,
157 /** The reference count was not zero in the destructor of CImageSourceData.
159 EDirectGdiPanicImageSourceDataRefCountError = 49,
161 /** The instance count was not zero in the destructor of CDirectGdiDriverProcessState.
163 EDirectGdiPanicProcessStateInstanceCountError = 50,
165 /** The image count was not zero in the destructor of CDirectGdiDriverProcessState.
167 EDirectGdiPanicProcessStateImageCountError = 51,
169 /** This panic only occurs when _DEBUG_DIRECTGDI is defined. One of the methods in
170 CDirectGdiDriverProcessState was called without the image's mutex being held.
172 EDirectGdiPanicImageMutexError = 52,
174 /** Attempt to activate a target in CSwDirectGdiEngine::Activate() with a NULL draw device.
176 EDirectGdiPanicActivateWithNullDrawDevice = 53,
178 /** Attempt to deactive a NULL target in CDirectGdiDriverImpl.
180 EDirectGdiPanicNullTargetDeactivate = 55,
182 /** This panic occurs when DrawGlyph is called on an unsupported glyph bitmap type.
184 EDirectGdiPanicInvalidGlyphBitmapType = 56,
186 /** Attempt to create a new image source/drawable source using a handle that already has
187 an image source/drawable source associated with it.
189 EDirectGdiPanicSourceHandleNotNull = 57,
191 /** Attempt to create a new image target using a handle that is already has an image target associated with it.
193 EDirectGdiPanicTargetHandleNotNull = 58,
195 /** An egl Api returned a failure. The actual egl error code is reported in the log.
199 /** In a call to DestroyEngine(), the engine could not be found in the internal list of engines.
201 EDirectGdiPanicEngineNotFound = 60,
203 /** Glyph image storage was not created.
205 EDirectGdiPanicGlyphImageStorageNotCreated = 61,
207 /** Pen end cap style expected to be rounded, but found not to be.
209 EDirectGdiPanicPenEndCapStyleNotRound = 62,
211 /** eglWaitClient error.
213 EDirectGdiPanicFinish = 63,
215 /** An error code from vgGetError which is caused by incorrect usage of OpenVG.
217 EDirectGdiPanicVgError = 64,
219 /** Whilst performing a Clear() the clear-brush is not a recognised paint brush.
221 EDirectGdiPanicClearBrushInvalid = 65,
223 /** Panic codes corresponding to the old BitGdi codes (+1000).
224 Any more panic codes from BitGDI generic DirectGDI should be added in this section.
226 EDirectGdiPanicInvalidParameter = 1006,
227 EDirectGdiPanicInvalidDisplayMode = 1009,
229 /** Attempt to draw outside of clipping region.
231 EDirectGdiPanicOutOfBounds = 1013,
232 EDirectGdiPanicPolygonFiller = 1015,
233 EDirectGdiPanicZeroLength = 1016,
234 EDirectGdiPanicInvalidPointer = 1018,
235 EDirectGdiPanicInvalidArg = 1021,
236 EDirectGdiPanicNegativeShift = 1022,
239 This panic may occur if MOutlineAndShadowBlend interface is not implemented, or
240 the MSgImage_Sw interface is not implemented on RSgImage.
242 EDirectGdiPanicInvalidInterfaceHandle = 1023,
243 // End of panic codes corresponding to the old BitGDI codes.
247 Log current eglGetError() to the debug stream, along with line number and source file name.
248 This must be #defined so that we retain the line and source file information at the
249 point in which LogEglError() is invoked.
252 #define LogEglError() {TBuf16<256> message; message.Format(_L16("EGL Error: %x\n"), eglGetError()); GRAPHICS_LOGD_DEBUG(message);}
254 #define LogEglError() {}
257 #endif /*DIRECTGDIADAPTER_H*/