summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_p.h
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-07-09 16:50:32 +0300
committerQt by Nokia <qt-info@nokia.com>2012-07-10 03:23:41 +0200
commit1db99a6250f96892362f57180b3cccfd09bf7ff4 (patch)
tree69deac3a0fe79053548513c0941d63edb08b72dc /src/gui/text/qfontengine_p.h
parent84792b5ad5d49013fe31d9cf258e978250d4ed7f (diff)
Move ShaperFlags enum from QTextEngine to QFontEngine
These flags are specific to font engine(s) and has nothing to do with the text engine or the text layout. Change-Id: I4bb793c3c634b3cf0ae0a8a8c23b946fad5874b6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui/text/qfontengine_p.h')
-rw-r--r--src/gui/text/qfontengine_p.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 0d635c4323..78f15496ca 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -72,7 +72,6 @@ QT_BEGIN_NAMESPACE
class QChar;
class QPainterPath;
-class QTextEngine;
struct QGlyphLayout;
#define MAKE_TAG(ch1, ch2, ch3, ch4) (\
@@ -116,6 +115,13 @@ public:
Format_A32
};
+ enum ShaperFlag {
+ RightToLeft = 0x0001,
+ DesignMetrics = 0x0002,
+ GlyphIndicesOnly = 0x0004
+ };
+ Q_DECLARE_FLAGS(ShaperFlags, ShaperFlag)
+
QFontEngine();
virtual ~QFontEngine();
@@ -158,14 +164,14 @@ public:
virtual QFixed emSquareSize() const { return ascent(); }
/* returns 0 as glyph index for non existent glyphs */
- virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const = 0;
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const = 0;
/**
* This is a callback from harfbuzz. The font engine uses the font-system in use to find out the
* advances of each glyph and set it on the layout.
*/
- virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const {}
- virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const {}
+ virtual void doKerning(QGlyphLayout *, ShaperFlags) const;
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
QPainterPath *path, QTextItem::RenderFlags flags);
@@ -301,6 +307,8 @@ private:
mutable QLinkedList<GlyphCacheEntry> m_glyphCaches;
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QFontEngine::ShaperFlags)
+
inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
{
return (f1.index == f2.index) && (f1.encoding == f2.encoding) && (f1.filename == f2.filename);
@@ -322,8 +330,8 @@ public:
QFontEngineBox(int size);
~QFontEngineBox();
- virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
- virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const;
+ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const;
void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
@@ -359,14 +367,13 @@ public:
explicit QFontEngineMulti(int engineCount);
~QFontEngineMulti();
- virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
- QTextEngine::ShaperFlags flags) const;
+ virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const;
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
virtual glyph_metrics_t boundingBox(glyph_t glyph);
- virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
- virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const;
+ virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const;
+ virtual void doKerning(QGlyphLayout *, ShaperFlags) const;
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);