Update contrib.
1 // Copyright (c) 1997-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 __BITPANIC_H__
17 #define __BITPANIC_H__
25 EBitgdiPanicNoDevicePresent=1,
26 EBitgdiPanicNoFBSConnection,
27 EBitgdiPanicNoFontSelected,
28 EBitgdiPanicNoSpriteSet,
29 EBitgdiPanicInvalidScreenDeviceLibrary,
30 EBitgdiPanicInvalidParameter,
31 EBitgdiPanicInvalidColor,
32 EBitgdiPanicInvalidDrawMode,
33 EBitgdiPanicInvalidDisplayMode,
34 EBitgdiPanicInvalidRegion,
35 EBitgdiPanicInvalidWindowHandle,
36 EBitgdiPanicInvalidFont,
37 EBitgdiPanicInvalidBitmap,
38 EBitgdiPanicOutOfBounds,
40 EBitgdiPanicPolygonFiller,
41 EBitgdiPanicZeroLength,
42 EBitgdiPanicNullPointer,
43 EBitgdiPanicInvalidPointer,
44 EBitgdiPanicCharacterTooBig,
45 EBitgdiPanicInvalidHalValue,
46 EBitgdiPanicInvalidArg,
47 EBitgdiPanicNegativeShift,
48 EBitgdiPanicInvalidInterfaceHandle, //This panic may occur if MOutlineAndShadowBlend interface is not implemented.
49 EBitgdiPanicInvalidBrushStyle,
55 void Panic(TBitgdiPanic aPanicCode);
56 void PanicWithInfo(TBitgdiPanic aPanic, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
57 void PanicWithCondAndInfo(TBitgdiPanic aPanic, const TDesC& aCondition, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine);
58 void InvariantWithCondAndInfo(const TDesC& aCondition, const TDesC& aFileName, TInt aLine);
61 #define BG_ASSERT_FILENAME(f) _LIT(KPanicFileName, f);
62 #define BG_ASSERT_PANICNAME(p) _LIT(KPanicEnum ## p, # p);
63 #define BG_ASSERT_CONDITION(c) _LIT(KPanicCondition, c);
65 /* Use these macros for BitGdi server Asserts & Panics with diagnostic logging:
66 BG_ASSERT_ALWAYS, BG_PANIC_ALWAYS, BG_ASSERT_DEBUG, BG_PANIC_DEBUG
67 BG_ASSERT_ALWAYS_INVARIANT and BG_ASSERT_DEBUG_INVARIANT
68 Note that the "do { ... } while (0)" construction forces the invocation to have a ';'
69 and makes the macro expansion safe in nested "if ... else ..." clauses that forget to use the
70 { braces } in the Coding Standard.
73 #define BG_ASSERT_ALWAYS(c, p) \
77 BG_ASSERT_FILENAME(__FILE__); \
78 BG_ASSERT_PANICNAME(p); \
79 BG_ASSERT_CONDITION(#c); \
80 PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
84 #define BG_PANIC_ALWAYS(p) \
86 BG_ASSERT_FILENAME(__FILE__); \
87 BG_ASSERT_PANICNAME(p); \
88 PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
91 #define BG_ASSERT_ALWAYS_INVARIANT(c) \
95 BG_ASSERT_FILENAME(__FILE__); \
96 BG_ASSERT_CONDITION(#c); \
97 InvariantWithCondAndInfo(KPanicCondition, KPanicFileName, __LINE__); \
102 #define BG_ASSERT_DEBUG(c, p) \
106 BG_ASSERT_FILENAME(__FILE__); \
107 BG_ASSERT_PANICNAME(p); \
108 BG_ASSERT_CONDITION(#c); \
109 PanicWithCondAndInfo(p, KPanicCondition, KPanicFileName, KPanicEnum ## p, __LINE__); \
113 #define BG_PANIC_DEBUG(p) \
115 BG_ASSERT_FILENAME(__FILE__); \
116 BG_ASSERT_PANICNAME(p); \
117 PanicWithInfo(p, KPanicFileName, KPanicEnum ## p, __LINE__); \
120 #define BG_ASSERT_DEBUG_INVARIANT(c) \
124 BG_ASSERT_FILENAME(__FILE__); \
125 BG_ASSERT_CONDITION(#c); \
126 InvariantWithCondAndInfo(KPanicCondition, KPanicFileName, __LINE__); \
131 #define BG_ASSERT_DEBUG(c, p)
132 #define BG_PANIC_DEBUG(p)
133 #define BG_ASSERT_DEBUG_INVARIANT(c)
137 Required to ensure BC between NGage and 7.0S platforms.
138 Functions are exported at ordinal corresponding to where NGage platform
139 has extended this library and must not be moved.
143 IMPORT_C void DummyReserved1();
144 IMPORT_C void DummyReserved2();
145 IMPORT_C void DummyReserved3();
146 IMPORT_C void DummyReserved4();
147 IMPORT_C void DummyReserved5();
148 IMPORT_C void DummyReserved6();
149 IMPORT_C void DummyReserved7();
150 IMPORT_C void DummyReserved8();
151 IMPORT_C void DummyReserved9();
152 IMPORT_C void DummyReserved10();