Changeset 561 for trunk/src/gui/text/qfontengine_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/text/qfontengine_p.h
r125 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 57 57 #include "QtCore/qatomic.h" 58 58 #include <QtCore/qvarlengtharray.h> 59 #include <QtCore/QLinkedList> 59 60 #include "private/qtextengine_p.h" 60 61 #include "private/qfont_p.h" … … 71 72 #endif 72 73 73 #include "qfontengineglyphcache_p.h"74 #include <private/qfontengineglyphcache_p.h> 74 75 75 76 struct glyph_metrics_t; … … 94 95 class Q_GUI_EXPORT QFontEngine : public QObject 95 96 { 96 Q_OBJECT97 97 public: 98 98 enum Type { … … 109 109 Mac, 110 110 111 // TrolltechQWS types111 // QWS types 112 112 Freetype, 113 113 QPF1, 114 114 QPF2, 115 115 Proxy, 116 117 // S60 types 118 S60FontEngine, // Cannot be simply called "S60". Reason is qt_s60Data.h 119 116 120 TestFontEngine = 0x1000 117 121 }; … … 165 169 virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const; 166 170 167 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_ PM) && !defined(Q_WS_MAC)171 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(Q_WS_PM) 168 172 virtual void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si) = 0; 169 173 #endif … … 179 183 * Returns an image indexed_8 with index values ranging from 0=fully transparant to 255=opaque 180 184 */ 181 virtual QImage alphaMapForGlyph(glyph_t) = 0;185 virtual QImage alphaMapForGlyph(glyph_t); 182 186 virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); 183 187 virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); … … 217 221 218 222 void setGlyphCache(void *key, QFontEngineGlyphCache *data); 219 void setGlyphCache(QFontEngineGlyphCache::Type key, QFontEngineGlyphCache *data); 220 QFontEngineGlyphCache *glyphCache(void *key, const QTransform &transform) const; 221 QFontEngineGlyphCache *glyphCache(QFontEngineGlyphCache::Type key, const QTransform &transform) const; 223 QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const; 222 224 223 225 static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize); … … 232 234 mutable HB_FontRec hbFont; 233 235 mutable HB_Face hbFace; 234 #if defined(Q_WS_WIN) || defined(Q_WS_ PM) || defined(Q_WS_X11) || defined(Q_WS_QWS)236 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN) || defined(Q_WS_PM) 235 237 struct KernPair { 236 238 uint left_right; … … 248 250 int glyphFormat; 249 251 252 protected: 253 static const QVector<QRgb> &grayPalette(); 254 250 255 private: 251 /// remove old entries from the glyph cache. Helper method for the setGlyphCache ones. 252 void expireGlyphCache(); 253 254 GlyphPointerHash m_glyphPointerHash; 255 GlyphIntHash m_glyphIntHash; 256 mutable QList<QFontEngineGlyphCache*> m_glyphCacheQueue; 256 struct GlyphCacheEntry { 257 void *context; 258 QFontEngineGlyphCache *cache; 259 bool operator==(const GlyphCacheEntry &other) { return context == other.context && cache == other.cache; } 260 }; 261 262 mutable QLinkedList<GlyphCacheEntry> m_glyphCaches; 257 263 }; 258 264 … … 323 329 virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const; 324 330 325 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_ PM) && !defined(Q_WS_MAC)331 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(Q_WS_PM) 326 332 void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si); 327 333 #endif … … 354 360 }; 355 361 356 class Q _GUI_EXPORT QFontEngineMulti : public QFontEngine362 class QFontEngineMulti : public QFontEngine 357 363 { 358 364 public: … … 390 396 { return "Multi"; } 391 397 392 QFontEngine *engine(int at) const; 398 QFontEngine *engine(int at) const 399 {Q_ASSERT(at < engines.size()); return engines.at(at); } 400 393 401 394 402 protected: … … 441 449 virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics); 442 450 virtual QImage alphaMapForGlyph(glyph_t); 451 virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); 443 452 virtual qreal minRightBearing() const; 444 453 virtual qreal minLeftBearing() const; 445 454 446 455 447 448 456 private: 457 QImage imageForGlyph(glyph_t glyph, int margin, bool colorful); 449 458 CTFontRef ctfont; 450 459 CGFontRef cgFont; … … 526 535 virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics); 527 536 virtual QImage alphaMapForGlyph(glyph_t); 537 virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); 528 538 529 539 private: 540 QImage imageForGlyph(glyph_t glyph, int margin, bool colorful); 541 530 542 ATSUFontID fontID; 531 543 QCFType<CGFontRef> cgFont; … … 615 627 #endif 616 628 629 #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_FREETYPE) 630 # include "private/qfontengine_ft_p.h" 631 #endif 632 617 633 #endif // QFONTENGINE_P_H
Note:
See TracChangeset
for help on using the changeset viewer.