author | Simon Howkins <simonh@symbian.org> |
Wed, 27 Oct 2010 16:22:14 +0100 | |
changeset 1284 | 0b4a09013baf |
parent 872 | 17498133d9ad |
permissions | -rw-r--r-- |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
2 |
// All rights reserved. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
3 |
// This component and the accompanying materials are made available |
872 | 4 |
// under the terms of the License "Eclipse Public License v1.0" |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
5 |
// which accompanies this distribution, and is available |
872 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
833
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
7 |
// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
8 |
// Initial Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
9 |
// Nokia Corporation - initial contribution. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
10 |
// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
11 |
// Contributors: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
12 |
// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
13 |
// Description: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
14 |
// Creates a dummy rasterizer and a dummy shaper for FontStore APIs testing. |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
15 |
// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
16 |
// |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
17 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
18 |
#ifndef __T_TESTOPENFONT_H__ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
19 |
#define __T_TESTOPENFONT_H__ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
20 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
21 |
#include <fntstore.h> |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
22 |
#include <openfont.h> |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
23 |
#include <e32base.h> |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
24 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
25 |
_LIT(KTestFont1, "dummy"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
26 |
_LIT(KTestFont2, "dummy_2"); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
27 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
28 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
29 |
class CTestRasterizer : public COpenFontRasterizer |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
30 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
31 |
public: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
32 |
static CTestRasterizer* NewL(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
33 |
COpenFontFile* NewFontFileL(TInt aUid, const TDesC& aFileName, RFs& aFileSession); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
34 |
}; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
35 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
36 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
37 |
class CTestFontFile: public COpenFontFile |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
38 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
39 |
public: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
40 |
static CTestFontFile* NewL(TInt aUid,const TDesC& aFileName); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
41 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
42 |
TBool GetNearestFontHelper(const TOpenFontSpec& aDesiredFontSpec, TInt aPixelWidth, TInt aPixelHeight, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
43 |
TInt& aFaceIndex, TOpenFontSpec& aActualFontSpec) const; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
44 |
void GetNearestFontInPixelsL(RHeap* aHeap, COpenFontSessionCacheList* aSessionCacheList, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
45 |
const TOpenFontSpec& aDesiredFontSpec, TInt aPixelWidth, TInt aPixelHeight, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
46 |
COpenFont*& aFont,TOpenFontSpec& aActualFontSpec); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
47 |
void GetNearestFontToDesignHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
48 |
const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
49 |
COpenFont*& aFont,TOpenFontSpec& aActualFontSpec); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
50 |
void GetNearestFontToMaxHeightInPixelsL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
51 |
const TOpenFontSpec& aDesiredFontSpec,TInt aPixelWidth,TInt aPixelHeight, |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
52 |
COpenFont*& aFont,TOpenFontSpec& aActualFontSpec, TInt aMaxHeight); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
53 |
virtual TBool HasUnicodeCharacterL(TInt aFaceIndex,TInt aCode) const; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
54 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
55 |
private: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
56 |
CTestFontFile(TInt aUid,const TDesC& aFileName); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
57 |
void ConstructL(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
58 |
}; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
59 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
60 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
61 |
class CTestFont: public COpenFont |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
62 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
63 |
public: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
64 |
static CTestFont* NewL(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CTestFontFile* aFontFile,TInt aSizeInPixels); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
65 |
private: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
66 |
CTestFont(RHeap* aHeap,COpenFontSessionCacheList* aSessionCacheList,CTestFontFile* aFontFile,TInt aSizeInPixels); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
67 |
virtual void RasterizeL(TInt aCode,TOpenFontGlyphData* aGlyphData); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
68 |
}; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
69 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
70 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
71 |
class CTestShaperFactory: public CShaperFactory |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
72 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
73 |
public: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
74 |
static CTestShaperFactory* NewL(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
75 |
virtual ~CTestShaperFactory(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
76 |
virtual CShaper* NewShaperL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
77 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
78 |
private: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
79 |
CTestShaperFactory(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
80 |
}; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
81 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
82 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
83 |
class CTestShaper : public CShaper |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
84 |
{ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
85 |
public: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
86 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
87 |
static CShaper* NewL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* aHeap); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
88 |
~CTestShaper(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
89 |
virtual TInt ShapeText(TShapeHeader*& aOutput, const TInput& aInput, RHeap* aHeapForOutput); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
90 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
91 |
private: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
92 |
CTestShaper(); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
93 |
TInt ConstructL(CBitmapFont* aBitmapfont, TInt aScript, TInt aLanguage, RHeap* iHeap); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
94 |
TInt TestShapeTextL(TShapeHeader*& aOutput, const TInput& aInput, RHeap* aHeapForOutput); |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
95 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
96 |
private: |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
97 |
RHeap* iClientHeap; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
98 |
RHeap* iHeap; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
99 |
TAny* iHeapMemory; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
100 |
TInt32* iGlyphs; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
101 |
TInt32* iIndices; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
102 |
TInt32* iPositions; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
103 |
}; |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
104 |
|
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
105 |
#endif // __T_TESTOPENFONT_H__ |
6ffc235847d0
Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff
changeset
|
106 |