os/graphics/graphicsdeviceinterface/directgdiadaptation/cmnsrc/directgdiadapter.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef DIRECTGDIADAPTER_H
sl@0
    17
#define DIRECTGDIADAPTER_H
sl@0
    18
sl@0
    19
/**
sl@0
    20
@file
sl@0
    21
@internalComponent
sl@0
    22
*/
sl@0
    23
sl@0
    24
#include <e32cmn.h>
sl@0
    25
sl@0
    26
_LIT(KComponentPanicCategory, "DGDIAdapter");
sl@0
    27
#define SYMBIAN_PANIC_CATEGORY KComponentPanicCategory
sl@0
    28
sl@0
    29
#include "directgditypes.h"
sl@0
    30
#include <graphics/directgdipanics.h>
sl@0
    31
sl@0
    32
sl@0
    33
/**
sl@0
    34
Enumeration of DirectGDI panic codes. These should be used in conjunction with
sl@0
    35
the ASSERT_ALWAYS and ASSERT_DEBUG macros defined below.
sl@0
    36
*/
sl@0
    37
enum TDirectGdiAdapterPanicCode
sl@0
    38
	{
sl@0
    39
	/** The requested functionality has not been implemented - do not use.
sl@0
    40
	*/ 
sl@0
    41
	EDirectGdiPanicNotImplemented = 1,
sl@0
    42
sl@0
    43
	/** An unexpected error has occured.
sl@0
    44
	*/ 
sl@0
    45
	EDirectGdiPanicUnexpectedError = 2,
sl@0
    46
		
sl@0
    47
	/**	Invalid reference count to DirectGDI driver.
sl@0
    48
	*/
sl@0
    49
	EDirectGdiPanicDriverInvalidRefCount = 6,
sl@0
    50
	
sl@0
    51
	/**	NULL bitmap specified.
sl@0
    52
	*/
sl@0
    53
	EDirectGdiPanicInvalidBitmap = 7,
sl@0
    54
sl@0
    55
	/** Invalid region passed into function.
sl@0
    56
	*/
sl@0
    57
	EDirectGdiPanicInvalidRegion = 8,
sl@0
    58
sl@0
    59
	/** An attempt has been made to use a patterned brush style when a patterned brush has not been set.
sl@0
    60
	 */
sl@0
    61
	EDirectGdiPanicPatternedBrushNotSet = 12,
sl@0
    62
	
sl@0
    63
	/** Unable to bind a rendering API.
sl@0
    64
	 */
sl@0
    65
	EDirectGdiPanicBindApi = 23,
sl@0
    66
	
sl@0
    67
	/** No drawing surface configurations are available.
sl@0
    68
	 */
sl@0
    69
	EDirectGdiPanicNoAvailableConfigs = 24,
sl@0
    70
	
sl@0
    71
	/** No available drawing surface configurations match specific attributes.
sl@0
    72
	 */
sl@0
    73
	EDirectGdiPanicNoMatchingConfig = 25,
sl@0
    74
	
sl@0
    75
	/** CVgEngine::DrawPolygon() was passed an invalid fill-rule.
sl@0
    76
	 */
sl@0
    77
	EDirectGdiPanicInvalidFillRule = 26,
sl@0
    78
	
sl@0
    79
	/** An array defining a polyline/polygon has too few points.
sl@0
    80
	 */
sl@0
    81
	EDirectGdiPanicInvalidPointArray = 27,
sl@0
    82
	
sl@0
    83
	/** RSgImage::GetPixelFormats() returns pixel count = 0.
sl@0
    84
	 */
sl@0
    85
	EDirectGdiPanicNoValidPixelFormats = 29,
sl@0
    86
	
sl@0
    87
	/** Open count error in CDirectGdiDrawableRef::Close().
sl@0
    88
	 */
sl@0
    89
	EDirectGdiPanicDrawableRefCountError = 30,
sl@0
    90
	
sl@0
    91
	/** Attempt to get a handle to a drawable resource using CDirectGdiDriverImpl::GetImageTargetFromHandle(),
sl@0
    92
	 * CDirectGdiDriverImpl::GetImageSourceFromHandle(), CDirectGdiDriverImpl::GetDrawableSourceFromHandle()
sl@0
    93
	 * or CSwDirectGdiDriverImpl::FindImageTargetImpl() failed.
sl@0
    94
	 */
sl@0
    95
	EDirectGdiPanicResourceHandleNotFound = 32,
sl@0
    96
	
sl@0
    97
	/** Driver Process State has not been initialised.
sl@0
    98
	 */
sl@0
    99
	EDirectGdiPanicProcessStateNotInitialized = 33,
sl@0
   100
	
sl@0
   101
	/** Attempt to activate a target in CVgEngine::Activate() or CSwDirectGdiEngine::Activate() with a NULL handle.
sl@0
   102
	 */
sl@0
   103
	EDirectGdiPanicActivateWithNullHandle = 34,
sl@0
   104
	
sl@0
   105
	/** Unable to initialise a display.
sl@0
   106
	 */
sl@0
   107
	EDirectGdiPanicInitializeDisplay = 35,
sl@0
   108
	
sl@0
   109
	/** No display to which graphics are drawn.
sl@0
   110
	 */
sl@0
   111
	EDirectGdiPanicNoDisplay = 36,
sl@0
   112
	
sl@0
   113
	/** Unable to close a drawable handle.
sl@0
   114
	 */
sl@0
   115
	EDirectGdiPanicCloseDrawableHandleFailure = 37,
sl@0
   116
	
sl@0
   117
	/** Attempt to destroy a NULL engine in CDirectGdiDriverImpl::DestroyEngine().
sl@0
   118
	 */
sl@0
   119
	EDirectGdiPanicDestroyNullEngine = 38,
sl@0
   120
	
sl@0
   121
	/** Attempt to activate a NULL target in CDirectGdiDriverImpl::Activate().
sl@0
   122
	 */
sl@0
   123
	EDirectGdiPanicNullTargetActivate = 39,
sl@0
   124
	
sl@0
   125
	/** Failed to find a config for a particular pixel type.
sl@0
   126
	 */
sl@0
   127
	EDirectGdiPanicNoConfigFound = 41,
sl@0
   128
	
sl@0
   129
	/** Failed to create a drawing surface.
sl@0
   130
	 */
sl@0
   131
	EDirectGdiPanicNoDrawingSurface = 42,
sl@0
   132
	
sl@0
   133
	/** Failed to create a drawing context.
sl@0
   134
	 */
sl@0
   135
	EDirectGdiPanicNoContext = 43,
sl@0
   136
	
sl@0
   137
	/** Attempt to delete a CDirectGdiDrawableRef object when its reference count is non-zero.
sl@0
   138
	 */
sl@0
   139
	EDirectGdiPanicDrawableRefDestructorError = 44,
sl@0
   140
	
sl@0
   141
	/** A driver was closed while some drawable items were still in the drawable array.
sl@0
   142
	 */
sl@0
   143
	EDirectGdiPanicItemsLeftInImageArray = 45,
sl@0
   144
sl@0
   145
	/** Inconsistency in internal data of glyph cache structure.
sl@0
   146
	*/
sl@0
   147
	EDirectGdiPanicGlyphCacheDataInconsistent = 46,
sl@0
   148
	
sl@0
   149
	/** Valid reference to image source not found.
sl@0
   150
	*/
sl@0
   151
	EDirectGdiPanicImageSourceNotFound = 47,
sl@0
   152
	
sl@0
   153
	/** An invalid image handle was passed to the CImageSourceData constructor.
sl@0
   154
	 */
sl@0
   155
	EDirectGdiPanicImageSourceDataConstructorError = 48,
sl@0
   156
	
sl@0
   157
	/** The reference count was not zero in the destructor of CImageSourceData.
sl@0
   158
	 */
sl@0
   159
	EDirectGdiPanicImageSourceDataRefCountError = 49,
sl@0
   160
	
sl@0
   161
	/** The instance count was not zero in the destructor of CDirectGdiDriverProcessState.
sl@0
   162
	 */
sl@0
   163
	EDirectGdiPanicProcessStateInstanceCountError = 50,
sl@0
   164
	
sl@0
   165
	/** The image count was not zero in the destructor of CDirectGdiDriverProcessState.
sl@0
   166
	 */
sl@0
   167
	EDirectGdiPanicProcessStateImageCountError = 51,
sl@0
   168
	
sl@0
   169
	/** This panic only occurs when _DEBUG_DIRECTGDI is defined. One of the methods in 
sl@0
   170
	CDirectGdiDriverProcessState was called without the image's mutex being held.
sl@0
   171
	 */
sl@0
   172
	EDirectGdiPanicImageMutexError = 52,
sl@0
   173
	
sl@0
   174
	/** Attempt to activate a target in CSwDirectGdiEngine::Activate() with a NULL draw device.
sl@0
   175
	 */
sl@0
   176
	EDirectGdiPanicActivateWithNullDrawDevice = 53,
sl@0
   177
	
sl@0
   178
	/** Attempt to deactive a NULL target in CDirectGdiDriverImpl.
sl@0
   179
	 */
sl@0
   180
	EDirectGdiPanicNullTargetDeactivate = 55,
sl@0
   181
sl@0
   182
	/** This panic occurs when DrawGlyph is called on an unsupported glyph bitmap type.
sl@0
   183
	 */
sl@0
   184
	EDirectGdiPanicInvalidGlyphBitmapType = 56,
sl@0
   185
	
sl@0
   186
	/** Attempt to create a new image source/drawable source using a handle that already has 
sl@0
   187
 	 an image source/drawable source associated with it.
sl@0
   188
	 */
sl@0
   189
	EDirectGdiPanicSourceHandleNotNull = 57,
sl@0
   190
	
sl@0
   191
	/** Attempt to create a new image target using a handle that is already has an image target associated with it.
sl@0
   192
	 */
sl@0
   193
	EDirectGdiPanicTargetHandleNotNull = 58,
sl@0
   194
	
sl@0
   195
	/** An egl Api returned a failure. The actual egl error code is reported in the log.
sl@0
   196
	 */
sl@0
   197
	EEglApiFailure = 59,
sl@0
   198
	
sl@0
   199
	/** In a call to DestroyEngine(), the engine could not be found in the internal list of engines. 
sl@0
   200
	 */
sl@0
   201
	EDirectGdiPanicEngineNotFound = 60,
sl@0
   202
	
sl@0
   203
	/** Glyph image storage was not created.
sl@0
   204
	 */
sl@0
   205
	EDirectGdiPanicGlyphImageStorageNotCreated = 61,
sl@0
   206
	
sl@0
   207
	/** Pen end cap style expected to be rounded, but found not to be.
sl@0
   208
	 */
sl@0
   209
	EDirectGdiPanicPenEndCapStyleNotRound = 62,
sl@0
   210
	
sl@0
   211
	/** eglWaitClient error.
sl@0
   212
	 */
sl@0
   213
	EDirectGdiPanicFinish = 63,
sl@0
   214
	
sl@0
   215
	/** An error code from vgGetError which is caused by incorrect usage of OpenVG.
sl@0
   216
	 */
sl@0
   217
	EDirectGdiPanicVgError = 64,
sl@0
   218
	
sl@0
   219
	/** Whilst performing a Clear() the clear-brush is not a recognised paint brush.  
sl@0
   220
	 */
sl@0
   221
	EDirectGdiPanicClearBrushInvalid = 65,
sl@0
   222
	
sl@0
   223
	/**  Panic codes corresponding to the old BitGdi codes (+1000).
sl@0
   224
	Any more panic codes from BitGDI generic DirectGDI should be added in this section.
sl@0
   225
	*/
sl@0
   226
	EDirectGdiPanicInvalidParameter = 1006,
sl@0
   227
	EDirectGdiPanicInvalidDisplayMode = 1009,
sl@0
   228
	
sl@0
   229
	/** Attempt to draw outside of clipping region.
sl@0
   230
	*/
sl@0
   231
	EDirectGdiPanicOutOfBounds = 1013,
sl@0
   232
	EDirectGdiPanicPolygonFiller = 1015,
sl@0
   233
	EDirectGdiPanicZeroLength = 1016,
sl@0
   234
	EDirectGdiPanicInvalidPointer = 1018,
sl@0
   235
	EDirectGdiPanicInvalidArg = 1021,
sl@0
   236
	EDirectGdiPanicNegativeShift = 1022,
sl@0
   237
sl@0
   238
	/**
sl@0
   239
	This panic may occur if MOutlineAndShadowBlend interface is not implemented, or
sl@0
   240
	the MSgImage_Sw interface is not implemented on RSgImage.	
sl@0
   241
	*/
sl@0
   242
	EDirectGdiPanicInvalidInterfaceHandle = 1023,
sl@0
   243
	// End of panic codes corresponding to the old BitGDI codes.
sl@0
   244
	};
sl@0
   245
sl@0
   246
/** 
sl@0
   247
Log current eglGetError() to the debug stream, along with line number and source file name.
sl@0
   248
This must be #defined so that we retain the line and source file information at the
sl@0
   249
point in which LogEglError() is invoked.
sl@0
   250
*/
sl@0
   251
#ifdef _DEBUG
sl@0
   252
#define LogEglError() {TBuf16<256> message; message.Format(_L16("EGL Error: %x\n"), eglGetError()); GRAPHICS_LOGD_DEBUG(message);}
sl@0
   253
#else
sl@0
   254
#define LogEglError() {}
sl@0
   255
#endif //_DEBUG
sl@0
   256
sl@0
   257
#endif /*DIRECTGDIADAPTER_H*/
sl@0
   258
sl@0
   259