os/graphics/graphicsdeviceinterface/directgdiadaptation/cmnsrc/directgdiadapter.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/directgdiadaptation/cmnsrc/directgdiadapter.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,259 @@
1.4 +// Copyright (c) 2007-2009 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 +//
1.18 +
1.19 +#ifndef DIRECTGDIADAPTER_H
1.20 +#define DIRECTGDIADAPTER_H
1.21 +
1.22 +/**
1.23 +@file
1.24 +@internalComponent
1.25 +*/
1.26 +
1.27 +#include <e32cmn.h>
1.28 +
1.29 +_LIT(KComponentPanicCategory, "DGDIAdapter");
1.30 +#define SYMBIAN_PANIC_CATEGORY KComponentPanicCategory
1.31 +
1.32 +#include "directgditypes.h"
1.33 +#include <graphics/directgdipanics.h>
1.34 +
1.35 +
1.36 +/**
1.37 +Enumeration of DirectGDI panic codes. These should be used in conjunction with
1.38 +the ASSERT_ALWAYS and ASSERT_DEBUG macros defined below.
1.39 +*/
1.40 +enum TDirectGdiAdapterPanicCode
1.41 + {
1.42 + /** The requested functionality has not been implemented - do not use.
1.43 + */
1.44 + EDirectGdiPanicNotImplemented = 1,
1.45 +
1.46 + /** An unexpected error has occured.
1.47 + */
1.48 + EDirectGdiPanicUnexpectedError = 2,
1.49 +
1.50 + /** Invalid reference count to DirectGDI driver.
1.51 + */
1.52 + EDirectGdiPanicDriverInvalidRefCount = 6,
1.53 +
1.54 + /** NULL bitmap specified.
1.55 + */
1.56 + EDirectGdiPanicInvalidBitmap = 7,
1.57 +
1.58 + /** Invalid region passed into function.
1.59 + */
1.60 + EDirectGdiPanicInvalidRegion = 8,
1.61 +
1.62 + /** An attempt has been made to use a patterned brush style when a patterned brush has not been set.
1.63 + */
1.64 + EDirectGdiPanicPatternedBrushNotSet = 12,
1.65 +
1.66 + /** Unable to bind a rendering API.
1.67 + */
1.68 + EDirectGdiPanicBindApi = 23,
1.69 +
1.70 + /** No drawing surface configurations are available.
1.71 + */
1.72 + EDirectGdiPanicNoAvailableConfigs = 24,
1.73 +
1.74 + /** No available drawing surface configurations match specific attributes.
1.75 + */
1.76 + EDirectGdiPanicNoMatchingConfig = 25,
1.77 +
1.78 + /** CVgEngine::DrawPolygon() was passed an invalid fill-rule.
1.79 + */
1.80 + EDirectGdiPanicInvalidFillRule = 26,
1.81 +
1.82 + /** An array defining a polyline/polygon has too few points.
1.83 + */
1.84 + EDirectGdiPanicInvalidPointArray = 27,
1.85 +
1.86 + /** RSgImage::GetPixelFormats() returns pixel count = 0.
1.87 + */
1.88 + EDirectGdiPanicNoValidPixelFormats = 29,
1.89 +
1.90 + /** Open count error in CDirectGdiDrawableRef::Close().
1.91 + */
1.92 + EDirectGdiPanicDrawableRefCountError = 30,
1.93 +
1.94 + /** Attempt to get a handle to a drawable resource using CDirectGdiDriverImpl::GetImageTargetFromHandle(),
1.95 + * CDirectGdiDriverImpl::GetImageSourceFromHandle(), CDirectGdiDriverImpl::GetDrawableSourceFromHandle()
1.96 + * or CSwDirectGdiDriverImpl::FindImageTargetImpl() failed.
1.97 + */
1.98 + EDirectGdiPanicResourceHandleNotFound = 32,
1.99 +
1.100 + /** Driver Process State has not been initialised.
1.101 + */
1.102 + EDirectGdiPanicProcessStateNotInitialized = 33,
1.103 +
1.104 + /** Attempt to activate a target in CVgEngine::Activate() or CSwDirectGdiEngine::Activate() with a NULL handle.
1.105 + */
1.106 + EDirectGdiPanicActivateWithNullHandle = 34,
1.107 +
1.108 + /** Unable to initialise a display.
1.109 + */
1.110 + EDirectGdiPanicInitializeDisplay = 35,
1.111 +
1.112 + /** No display to which graphics are drawn.
1.113 + */
1.114 + EDirectGdiPanicNoDisplay = 36,
1.115 +
1.116 + /** Unable to close a drawable handle.
1.117 + */
1.118 + EDirectGdiPanicCloseDrawableHandleFailure = 37,
1.119 +
1.120 + /** Attempt to destroy a NULL engine in CDirectGdiDriverImpl::DestroyEngine().
1.121 + */
1.122 + EDirectGdiPanicDestroyNullEngine = 38,
1.123 +
1.124 + /** Attempt to activate a NULL target in CDirectGdiDriverImpl::Activate().
1.125 + */
1.126 + EDirectGdiPanicNullTargetActivate = 39,
1.127 +
1.128 + /** Failed to find a config for a particular pixel type.
1.129 + */
1.130 + EDirectGdiPanicNoConfigFound = 41,
1.131 +
1.132 + /** Failed to create a drawing surface.
1.133 + */
1.134 + EDirectGdiPanicNoDrawingSurface = 42,
1.135 +
1.136 + /** Failed to create a drawing context.
1.137 + */
1.138 + EDirectGdiPanicNoContext = 43,
1.139 +
1.140 + /** Attempt to delete a CDirectGdiDrawableRef object when its reference count is non-zero.
1.141 + */
1.142 + EDirectGdiPanicDrawableRefDestructorError = 44,
1.143 +
1.144 + /** A driver was closed while some drawable items were still in the drawable array.
1.145 + */
1.146 + EDirectGdiPanicItemsLeftInImageArray = 45,
1.147 +
1.148 + /** Inconsistency in internal data of glyph cache structure.
1.149 + */
1.150 + EDirectGdiPanicGlyphCacheDataInconsistent = 46,
1.151 +
1.152 + /** Valid reference to image source not found.
1.153 + */
1.154 + EDirectGdiPanicImageSourceNotFound = 47,
1.155 +
1.156 + /** An invalid image handle was passed to the CImageSourceData constructor.
1.157 + */
1.158 + EDirectGdiPanicImageSourceDataConstructorError = 48,
1.159 +
1.160 + /** The reference count was not zero in the destructor of CImageSourceData.
1.161 + */
1.162 + EDirectGdiPanicImageSourceDataRefCountError = 49,
1.163 +
1.164 + /** The instance count was not zero in the destructor of CDirectGdiDriverProcessState.
1.165 + */
1.166 + EDirectGdiPanicProcessStateInstanceCountError = 50,
1.167 +
1.168 + /** The image count was not zero in the destructor of CDirectGdiDriverProcessState.
1.169 + */
1.170 + EDirectGdiPanicProcessStateImageCountError = 51,
1.171 +
1.172 + /** This panic only occurs when _DEBUG_DIRECTGDI is defined. One of the methods in
1.173 + CDirectGdiDriverProcessState was called without the image's mutex being held.
1.174 + */
1.175 + EDirectGdiPanicImageMutexError = 52,
1.176 +
1.177 + /** Attempt to activate a target in CSwDirectGdiEngine::Activate() with a NULL draw device.
1.178 + */
1.179 + EDirectGdiPanicActivateWithNullDrawDevice = 53,
1.180 +
1.181 + /** Attempt to deactive a NULL target in CDirectGdiDriverImpl.
1.182 + */
1.183 + EDirectGdiPanicNullTargetDeactivate = 55,
1.184 +
1.185 + /** This panic occurs when DrawGlyph is called on an unsupported glyph bitmap type.
1.186 + */
1.187 + EDirectGdiPanicInvalidGlyphBitmapType = 56,
1.188 +
1.189 + /** Attempt to create a new image source/drawable source using a handle that already has
1.190 + an image source/drawable source associated with it.
1.191 + */
1.192 + EDirectGdiPanicSourceHandleNotNull = 57,
1.193 +
1.194 + /** Attempt to create a new image target using a handle that is already has an image target associated with it.
1.195 + */
1.196 + EDirectGdiPanicTargetHandleNotNull = 58,
1.197 +
1.198 + /** An egl Api returned a failure. The actual egl error code is reported in the log.
1.199 + */
1.200 + EEglApiFailure = 59,
1.201 +
1.202 + /** In a call to DestroyEngine(), the engine could not be found in the internal list of engines.
1.203 + */
1.204 + EDirectGdiPanicEngineNotFound = 60,
1.205 +
1.206 + /** Glyph image storage was not created.
1.207 + */
1.208 + EDirectGdiPanicGlyphImageStorageNotCreated = 61,
1.209 +
1.210 + /** Pen end cap style expected to be rounded, but found not to be.
1.211 + */
1.212 + EDirectGdiPanicPenEndCapStyleNotRound = 62,
1.213 +
1.214 + /** eglWaitClient error.
1.215 + */
1.216 + EDirectGdiPanicFinish = 63,
1.217 +
1.218 + /** An error code from vgGetError which is caused by incorrect usage of OpenVG.
1.219 + */
1.220 + EDirectGdiPanicVgError = 64,
1.221 +
1.222 + /** Whilst performing a Clear() the clear-brush is not a recognised paint brush.
1.223 + */
1.224 + EDirectGdiPanicClearBrushInvalid = 65,
1.225 +
1.226 + /** Panic codes corresponding to the old BitGdi codes (+1000).
1.227 + Any more panic codes from BitGDI generic DirectGDI should be added in this section.
1.228 + */
1.229 + EDirectGdiPanicInvalidParameter = 1006,
1.230 + EDirectGdiPanicInvalidDisplayMode = 1009,
1.231 +
1.232 + /** Attempt to draw outside of clipping region.
1.233 + */
1.234 + EDirectGdiPanicOutOfBounds = 1013,
1.235 + EDirectGdiPanicPolygonFiller = 1015,
1.236 + EDirectGdiPanicZeroLength = 1016,
1.237 + EDirectGdiPanicInvalidPointer = 1018,
1.238 + EDirectGdiPanicInvalidArg = 1021,
1.239 + EDirectGdiPanicNegativeShift = 1022,
1.240 +
1.241 + /**
1.242 + This panic may occur if MOutlineAndShadowBlend interface is not implemented, or
1.243 + the MSgImage_Sw interface is not implemented on RSgImage.
1.244 + */
1.245 + EDirectGdiPanicInvalidInterfaceHandle = 1023,
1.246 + // End of panic codes corresponding to the old BitGDI codes.
1.247 + };
1.248 +
1.249 +/**
1.250 +Log current eglGetError() to the debug stream, along with line number and source file name.
1.251 +This must be #defined so that we retain the line and source file information at the
1.252 +point in which LogEglError() is invoked.
1.253 +*/
1.254 +#ifdef _DEBUG
1.255 +#define LogEglError() {TBuf16<256> message; message.Format(_L16("EGL Error: %x\n"), eglGetError()); GRAPHICS_LOGD_DEBUG(message);}
1.256 +#else
1.257 +#define LogEglError() {}
1.258 +#endif //_DEBUG
1.259 +
1.260 +#endif /*DIRECTGDIADAPTER_H*/
1.261 +
1.262 +