1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.gui.glyphrun; 15 extern(C++): 16 17 import qt.config; 18 import qt.helpers; 19 version(QT_NO_RAWFONT){}else 20 { 21 import qt.core.flags; 22 import qt.core.global; 23 import qt.core.point; 24 import qt.core.rect; 25 import qt.core.shareddata; 26 import qt.core.vector; 27 import qt.gui.rawfont; 28 } 29 30 version(QT_NO_RAWFONT){}else 31 { 32 33 34 35 extern(C++, class) struct QGlyphRunPrivate; 36 extern(C++, class) struct /+ Q_GUI_EXPORT +/ QGlyphRun 37 { 38 public: 39 enum GlyphRunFlag { 40 Overline = 0x01, 41 Underline = 0x02, 42 StrikeOut = 0x04, 43 RightToLeft = 0x08, 44 SplitLigature = 0x10 45 } 46 /+ Q_DECLARE_FLAGS(GlyphRunFlags, GlyphRunFlag) +/ 47 alias GlyphRunFlags = QFlags!(GlyphRunFlag); 48 @disable this(); 49 pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this)))) 50 ref typeof(this) rawConstructor(); 51 static typeof(this) create() 52 { 53 typeof(this) r = typeof(this).init; 54 r.rawConstructor(); 55 return r; 56 } 57 58 @disable this(this); 59 this(ref const(QGlyphRun) other); 60 /+ QGlyphRun &operator=(QGlyphRun &&other) noexcept { swap(other); return *this; } +/ 61 /+ref QGlyphRun operator =(ref const(QGlyphRun) other);+/ 62 ~this(); 63 64 /+ void swap(QGlyphRun &other) noexcept { qSwap(d, other.d); } +/ 65 66 QRawFont rawFont() const; 67 void setRawFont(ref const(QRawFont) rawFont); 68 69 void setRawData(const(quint32)* glyphIndexArray, 70 const(QPointF)* glyphPositionArray, 71 int size); 72 73 QVector!(quint32) glyphIndexes() const; 74 void setGlyphIndexes(ref const(QVector!(quint32)) glyphIndexes); 75 76 QVector!(QPointF) positions() const; 77 void setPositions(ref const(QVector!(QPointF)) positions); 78 79 void clear(); 80 81 /+bool operator ==(ref const(QGlyphRun) other) const;+/ 82 /+pragma(inline, true) bool operator !=(ref const(QGlyphRun) other) const 83 { return !operator==(other); }+/ 84 85 void setOverline(bool overline); 86 bool overline() const; 87 88 void setUnderline(bool underline); 89 bool underline() const; 90 91 void setStrikeOut(bool strikeOut); 92 bool strikeOut() const; 93 94 void setRightToLeft(bool on); 95 bool isRightToLeft() const; 96 97 /+ void setFlag(GlyphRunFlag flag, bool enabled = true); +/ 98 void setFlags(GlyphRunFlags flags); 99 GlyphRunFlags flags() const; 100 101 void setBoundingRect(ref const(QRectF) boundingRect); 102 QRectF boundingRect() const; 103 104 bool isEmpty() const; 105 106 private: 107 /+ friend class QGlyphRunPrivate; +/ 108 /+ friend class QTextLine; +/ 109 110 /+QGlyphRun operator +(ref const(QGlyphRun) other) const;+/ 111 /+ref QGlyphRun operator +=(ref const(QGlyphRun) other);+/ 112 113 void detach(); 114 QExplicitlySharedDataPointer!(QGlyphRunPrivate) d; 115 } 116 117 /+ Q_DECLARE_SHARED(QGlyphRun) +/ 118 119 120 } 121 version(QT_NO_RAWFONT) 122 { 123 extern(C++, class) struct QGlyphRun; 124 } 125 126