annotate qt/d1/qt/core/QSize.d @ 231:99e74c8a22f8

change ref to in in structs
author eldar
date Fri, 17 Jul 2009 21:16:44 +0000
parents 7dd099050621
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
1 module qt.core.QSize;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
2
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
3 public import qt.QGlobal;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
4 public import qt.core.Qt;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
5
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
6
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
7 public struct QSize
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
8 {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
9 /* ctors, reserved for D2
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
10 public this()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
11 { wd = ht = -1; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
12
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
13 public this(int w, int h)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
14 { wd = w; ht = h; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
15 */
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
16
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
17 public static QSize opCall() {
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
18 QSize sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
19 sz.wd = sz.ht = -1;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
20 return sz;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
21 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
22
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
23 public static QSize opCall(int w, int h) {
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
24 QSize sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
25 sz.wd = w;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
26 sz.ht = h;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
27 return sz;
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
28 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
29
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
30 final bool isNull()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
31 { return wd==0 && ht==0; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
32
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
33 final bool isEmpty()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
34 { return wd<1 || ht<1; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
35
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
36 final bool isValid()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
37 { return wd>=0 && ht>=0; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
38
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
39 final int width()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
40 { return wd; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
41
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
42 final int height()
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
43 { return ht; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
44
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
45 final void width(int w)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
46 { wd = w; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
47
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
48 final void height(int h)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
49 { ht = h; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
50
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
51 final void setWidth(int w) // for convenience
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
52 { wd = w; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
53
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
54 final void setHeight(int h) // for convenience
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
55 { ht = h; }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
56
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
57 void transpose() {
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
58 int tmp = wd;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
59 wd = ht;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
60 ht = tmp;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
61 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
62
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
63 void scale(int w, int h, Qt.AspectRatioMode mode) {
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
64 scale(QSize(w, h), mode);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
65 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
66
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
67 void scale(in QSize s, Qt.AspectRatioMode mode) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
68 __qtd_QSize_scale_QSize_AspectRatioMode(this, &s, mode);
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
69 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
70
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
71 QSize expandedTo(in QSize otherSize) {
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
72 return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
73 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
74
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
75 QSize boundedTo(in QSize otherSize) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
76 return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
77 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
78 /*
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
79 public final void writeTo(QDataStream arg__1) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
80 __qtd_QSize_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
81 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
82
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
83 public final void readFrom(QDataStream arg__1) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
84 __qtd_QSize_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
85 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
86 */
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
87 QSize opAddAssign(in QSize s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
88 { wd+=s.wd; ht+=s.ht; return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
89
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
90 QSize opSubAssign(in QSize s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
91 { wd-=s.wd; ht-=s.ht; return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
92
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
93 QSize opMulAssign(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
94 { wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
95
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
96 bool opEquals(in QSize s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
97 { return wd == s.wd && ht == s.ht; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
98
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
99 QSize opAdd(in QSize s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
100 { return QSize(this.wd+s.wd, this.ht+s.ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
101
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
102 QSize opSub(in QSize s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
103 { return QSize(this.wd-s.wd, this.ht-s.ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
104
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
105 QSize opMul(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
106 { return QSize(qRound(this.wd*c), qRound(this.ht*c)); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
107
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
108 QSize opDivAssign(qreal c) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
109 assert(!qFuzzyCompare(c + 1, 1.));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
110 wd = qRound(wd/c); ht = qRound(ht/c);
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
111 return *this;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
112 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
113
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
114 QSize opDiv(qreal c) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
115 assert(!qFuzzyCompare(c + 1, 1.));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
116 return QSize(qRound(this.wd/c), qRound(this.ht/c));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
117 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
118
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
119 private:
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
120 int wd;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
121 int ht;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
122 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
123
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
124
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
125 public struct QSizeF
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
126 {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
127 /* ctors, reserved for D2
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
128 this()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
129 { wd = ht = -1.; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
130
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
131 this(ref QSize sz)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
132 { wd = sz.width(); ht = sz.height(); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
133
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
134 this(qreal w, qreal h)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
135 { wd = w; ht = h; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
136 */
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
137 public static QSizeF opCall() {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
138 QSizeF sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
139 sz.wd = sz.ht = -1.;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
140 return sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
141 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
142
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
143 public static QSizeF opCall(in QSizeF s) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
144 QSizeF sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
145 sz.wd = s.width(); sz.ht = s.height();
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
146 return sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
147 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
148
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
149 public static QSizeF opCall(qreal w, qreal h) {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
150 QSizeF sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
151 sz.wd = w; sz.ht = h;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
152 return sz;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
153 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
154
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
155 bool isNull()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
156 { return qIsNull(wd) && qIsNull(ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
157
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
158 bool isEmpty()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
159 { return wd <= 0. || ht <= 0.; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
160
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
161 bool isValid()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
162 { return wd >= 0. && ht >= 0.; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
163
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
164 qreal width()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
165 { return wd; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
166
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
167 qreal height()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
168 { return ht; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
169
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
170 void width(qreal w)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
171 { wd = w; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
172
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
173 void height(qreal h)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
174 { ht = h; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
175
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
176 void setWidth(qreal w)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
177 { wd = w; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
178
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
179 void setHeight(qreal h)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
180 { ht = h; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
181
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
182 void scale(qreal w, qreal h, Qt.AspectRatioMode mode)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
183 { scale(QSizeF(w, h), mode); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
184
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
185 public final void scale(QSizeF s, Qt.AspectRatioMode mode)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
186 { __qtd_QSizeF_scale_QSizeF_AspectRatioMode(this, &s, mode); }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
187
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
188 void transpose() {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
189 qreal tmp = wd;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
190 wd = ht;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
191 ht = tmp;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
192 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
193
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
194 QSizeF expandedTo(in QSizeF otherSize)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
195 { return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht)); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
196
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
197 QSizeF boundedTo(in QSizeF otherSize)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
198 { return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht)); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
199
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
200 QSize toSize()
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
201 { return QSize(qRound(wd), qRound(ht)); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
202 /*
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
203 public final void writeTo(QDataStream arg__1) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
204 __qtd_QSizeF_writeTo_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
205 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
206
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
207 public final void readFrom(QDataStream arg__1) {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
208 __qtd_QSizeF_readFrom_QDataStream(this, arg__1 is null ? null : arg__1.nativeId);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
209 */
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
210 QSizeF opAddAssign(in QSizeF s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
211 { wd += s.wd; ht += s.ht; return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
212
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
213 QSizeF opSubAssign(in QSizeF s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
214 { wd -= s.wd; ht -= s.ht; return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
215
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
216 QSizeF opMulAssign(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
217 { wd *= c; ht *= c; return *this; }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
218
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
219 bool opEquals(in QSizeF s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
220 { return qFuzzyCompare(wd, s.wd) && qFuzzyCompare(ht, s.ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
221
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
222 QSizeF opAdd(in QSizeF s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
223 { return QSizeF(this.wd+s.wd, this.ht+s.ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
224
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
225 QSizeF opSub(in QSizeF s)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
226 { return QSizeF(this.wd-s.wd, this.ht-s.ht); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
227
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
228 QSizeF opMul(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
229 { return QSizeF(this.wd*c, this.ht*c); }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
230
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
231 QSizeF opDivAssign(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
232 {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
233 assert(!qFuzzyCompare(c + 1, 1.));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
234 wd = wd/c; ht = ht/c;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
235 return *this;
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
236 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
237
231
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
238 QSizeF opDiv(qreal c)
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
239 {
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
240 assert(!qFuzzyCompare(c + 1, 1.));
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
241 return QSizeF(this.wd/c, this.ht/c);
99e74c8a22f8 change ref to in in structs
eldar
parents: 188
diff changeset
242 }
188
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
243
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
244 private:
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
245 qreal wd;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
246 qreal ht;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
247 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
248
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
249 extern (C) void qtd_append_array_QSize(QSize[]* arr, QSize arg)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
250 {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
251 *arr ~= arg;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
252 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
253
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
254 extern (C) void qtd_append_array_QSizeF(QSizeF[]* arr, QSizeF arg)
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
255 {
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
256 *arr ~= arg;
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
257 }
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
258
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
259 // C wrappers
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
260 // QSize
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
261 private extern(C) void __qtd_QSize_scale_QSize_AspectRatioMode(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
262 void* s0,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
263 int mode1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
264 private extern(C) void __qtd_QSize_writeTo_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
265 void* arg__1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
266 private extern(C) void __qtd_QSize_readFrom_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
267 void* arg__1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
268
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
269 // QSizeF
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
270 private extern(C) void __qtd_QSizeF_writeTo_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
271 void* arg__1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
272 private extern(C) void __qtd_QSizeF_readFrom_QDataStream(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
273 void* arg__1);
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
274 private extern(C) void __qtd_QSizeF_scale_QSizeF_AspectRatioMode(void* __this_nativeId,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
275 void* s0,
7dd099050621 initial commit for D2 support
eldar
parents:
diff changeset
276 int mode1);