1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.gui.glyphrun; 13 extern(C++): 14 15 import qt.config; 16 import qt.helpers; 17 version(QT_NO_RAWFONT){}else 18 { 19 import qt.core.flags; 20 import qt.core.global; 21 import qt.core.list; 22 import qt.core.point; 23 import qt.core.rect; 24 import qt.core.shareddata; 25 import qt.core.typeinfo; 26 import qt.gui.rawfont; 27 } 28 29 version(QT_NO_RAWFONT){}else 30 { 31 32 33 34 extern(C++, class) struct QGlyphRunPrivate; 35 /// Binding for C++ class [QGlyphRun](https://doc.qt.io/qt-6/qglyphrun.html). 36 @Q_RELOCATABLE_TYPE 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 /+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGlyphRun) +/ 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 QList!(quint32) glyphIndexes() const; 74 void setGlyphIndexes(ref const(QList!(quint32)) glyphIndexes); 75 76 QList!(QPointF) positions() const; 77 void setPositions(ref const(QList!(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 mixin(CREATE_CONVENIENCE_WRAPPERS); 116 } 117 118 /+ Q_DECLARE_SHARED(QGlyphRun) +/ 119 120 121 } 122 version(QT_NO_RAWFONT) 123 { 124 extern(C++, class) struct QGlyphRun; 125 } 126 127