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.bitmap;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.global;
19 import qt.core.metatype;
20 import qt.core.namespace;
21 import qt.core.shareddata;
22 import qt.core.size;
23 import qt.core.string;
24 import qt.core.typeinfo;
25 import qt.core.variant;
26 import qt.gui.color;
27 import qt.gui.image;
28 import qt.gui.matrix;
29 import qt.gui.pixmap;
30 import qt.gui.transform;
31 import qt.helpers;
32 
33 /+ class QVariant; +/
34 
35 @(QMetaType.Type.QBitmap) @Q_MOVABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QBitmap
36 {
37     public QPixmap base0;
38     alias base0 this;
39 public:
40     @disable this();
41     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
42     ref typeof(this) rawConstructor();
43     static typeof(this) create()
44     {
45         typeof(this) r = typeof(this).init;
46         r.rawConstructor();
47         return r;
48     }
49 
50     this(ref const(QPixmap) );
51     this(int w, int h);
52     /+ explicit +/this(ref const(QSize) );
53     /+ explicit +/this(ref const(QString) fileName, const(char)* format = null);
54     // ### Qt 6: don't inherit QPixmap
55 /+ #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +/
56     @disable this(this);
57     this(ref const(QBitmap) other)
58     {
59         this.base0 = QPixmap(other.base0);
60     }
61     // QBitmap(QBitmap &&other) : QPixmap(std::move(other)) {} // QPixmap doesn't, yet, have a move ctor
62     /+ref QBitmap operator =(ref const(QBitmap) other) { QPixmap.operator=(other); return this; }+/
63     /+ QBitmap &operator=(QBitmap &&other) noexcept { QPixmap::operator=(std::move(other)); return *this; } +/
64     extern(D) ~this()
65     {
66         // TODO
67     }
68 /+ #endif +/
69 
70     /+ref QBitmap operator =(ref const(QPixmap) );+/
71     /+ inline void swap(QBitmap &other) { QPixmap::swap(other); } +/ // prevent QBitmap<->QPixmap swaps
72     /+auto opCast(T : QVariant)() const;+/
73 
74     pragma(inline, true) void clear() { auto tmp = QColor(qt.core.namespace.GlobalColor.color0); fill(tmp); }
75 
76     static QBitmap fromImage(ref const(QImage) image, /+ Qt:: +/qt.core.namespace.ImageConversionFlags flags = /+ Qt:: +/qt.core.namespace.ImageConversionFlag.AutoColor);
77     /+ static QBitmap fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor); +/
78     static QBitmap fromData(ref const(QSize) size, const(uchar)* bits,
79                                 QImage.Format monoFormat = QImage.Format.Format_MonoLSB);
80 
81 /+ #if QT_DEPRECATED_SINCE(5, 13) +/
82     /+ QT_DEPRECATED_X("Use QBitmap::transformed(QTransform) instead") +/
83         QBitmap transformed(ref const(QMatrix) ) const;
84 /+ #endif +/
85     QBitmap transformed(ref const(QTransform) matrix) const;
86 
87     alias DataPtr = QExplicitlySharedDataPointer!(QPlatformPixmap);
88 }
89 /+ Q_DECLARE_SHARED(QBitmap) +/
90