Qt 4.8
qrawfont_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QRAWFONTPRIVATE_P_H
43 #define QRAWFONTPRIVATE_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qrawfont.h"
57 
58 #include "qfontengine_p.h"
59 #include <QtCore/qthread.h>
60 #include <QtCore/qthreadstorage.h>
61 
62 #if !defined(QT_NO_RAWFONT)
63 
65 
66 namespace { class CustomFontFileLoader; }
68 {
69 public:
71  : fontEngine(0)
72  , hintingPreference(QFont::PreferDefaultHinting)
73  , thread(0)
74 #if defined(Q_WS_WIN)
75  , fontHandle(NULL)
76 #endif
77  {}
78 
80  : fontEngine(other.fontEngine)
81  , hintingPreference(other.hintingPreference)
82  , thread(other.thread)
83 #if defined(Q_WS_WIN)
84  , fontHandle(NULL)
85 #endif
86  {
87  if (fontEngine != 0)
88  fontEngine->ref.ref();
89  }
90 
92  {
93  Q_ASSERT(ref == 0);
94  cleanUp();
95  }
96 
97  inline bool isValid() const
98  {
100  return fontEngine != 0;
101  }
102 
103  void cleanUp();
104  void platformCleanUp();
105  void platformLoadFromData(const QByteArray &fontData,
107  QFont::HintingPreference hintingPreference);
108 
109  static QRawFontPrivate *get(const QRawFont &font) { return font.d.data(); }
110 
115 
116 #if defined(Q_WS_WIN)
118 #endif
119 };
120 
122 
123 #endif // QT_NO_RAWFONT
124 
125 #endif // QRAWFONTPRIVATE_P_H
QAtomicInt ref
HintingPreference
This enum describes the different levels of hinting that can be applied to glyphs to improve legibili...
Definition: qfont.h:96
double qreal
Definition: qglobal.h:1193
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QAtomicInt class provides platform-independent atomic operations on integers. ...
Definition: qatomic.h:55
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define Q_WS_WIN
Defined on Windows.
Definition: qglobal.h:921
QAtomicInt ref
Definition: qrawfont_p.h:114
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
Definition: qthread.cpp:419
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
HANDLE fontHandle
Definition: qrawfont_p.h:117
void * HANDLE
Definition: qnamespace.h:1671
The QRawFont class provides access to a single physical instance of a font.
Definition: qrawfont.h:63
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
bool isValid() const
Definition: qrawfont_p.h:97
QRawFontPrivate(const QRawFontPrivate &other)
Definition: qrawfont_p.h:79
QFont::HintingPreference hintingPreference
Definition: qrawfont_p.h:112
if(void) toggleToolbarShown
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
QFontEngine * fontEngine
Definition: qrawfont_p.h:111
QThread * thread
Definition: qrawfont_p.h:113
QThread * thread() const
Returns the thread in which the object lives.
Definition: qobject.cpp:1419
The QThread class provides a platform-independent way to manage threads.
Definition: qthread.h:59