46
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Graphics Extension Library header file
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef GFX2DDEVICE_H
|
|
20 |
#define GFX2DDEVICE_H
|
|
21 |
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <fbs.h>
|
|
24 |
#include <bitdev.h>
|
|
25 |
|
|
26 |
#include "GfxFloatFixPt.h"
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
* This class provides the interface create a graphics device representation.
|
|
32 |
*
|
|
33 |
* @lib Gfx2D.lib
|
|
34 |
* @since 1.0
|
|
35 |
*/
|
|
36 |
class CGfx2dDevice : public CBase
|
|
37 |
{
|
|
38 |
public:
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Two-phase constructor.
|
|
42 |
*
|
|
43 |
* @since 1.0
|
|
44 |
* @param : aBitmap -- offscreen bitmap.
|
|
45 |
* @return
|
|
46 |
*/
|
|
47 |
static CGfx2dDevice* NewL( CFbsBitmap* aBitmap );
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Destructor
|
|
51 |
*/
|
|
52 |
virtual ~CGfx2dDevice();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Create a graphics context.
|
|
56 |
*
|
|
57 |
* @since 1.0
|
|
58 |
* @param : aGc -- reference to store the new context.
|
|
59 |
* @return error code if any
|
|
60 |
*/
|
|
61 |
TInt CreateContext( CGfx2dGc*& aGc, TFontSpec& aFontSpec );
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Get size of the of the graphics context.
|
|
65 |
*
|
|
66 |
* @since 1.0
|
|
67 |
* @param
|
|
68 |
* @return size of graphics context.
|
|
69 |
*/
|
|
70 |
TSize SizeInPixels();
|
|
71 |
|
|
72 |
|
|
73 |
protected:
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Two-phase constructor.
|
|
77 |
*
|
|
78 |
* @since 1.0
|
|
79 |
* @param : aBitmap -- offscreen bitmap.
|
|
80 |
* @return
|
|
81 |
*/
|
|
82 |
void ConstructL( CFbsBitmap* aBitmap );
|
|
83 |
|
|
84 |
private:
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Constructor.
|
|
88 |
*
|
|
89 |
* @since 1.0
|
|
90 |
* @param : aBitmap -- offscreen bitmap.
|
|
91 |
* @return
|
|
92 |
*/
|
|
93 |
CGfx2dDevice();
|
|
94 |
|
|
95 |
protected:
|
|
96 |
CFbsDevice* iGdiDevice;
|
|
97 |
CFbsBitmap* iBitmap;
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
private:
|
|
102 |
friend class CGfx2dGc;
|
|
103 |
friend class CGfxFont;
|
|
104 |
};
|
|
105 |
|
|
106 |
#endif // GFX2DDEVICE_H
|