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.event; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.coreevent; 17 import qt.core.file; 18 import qt.core.global; 19 import qt.core.iodevice; 20 import qt.core.list; 21 import qt.core.metamacros; 22 import qt.core.mimedata; 23 import qt.core.namespace; 24 import qt.core.object; 25 import qt.core.point; 26 import qt.core.rect; 27 import qt.core.size; 28 import qt.core.string; 29 import qt.core.url; 30 import qt.gui.action; 31 import qt.gui.eventpoint; 32 import qt.gui.inputdevice; 33 import qt.gui.keysequence; 34 import qt.gui.pointingdevice; 35 import qt.gui.region; 36 import qt.gui.screen; 37 import qt.gui.vector2d; 38 import qt.helpers; 39 version(QT_NO_INPUTMETHOD){}else 40 import qt.core.variant; 41 42 /+ #if QT_CONFIG(shortcut) 43 #endif 44 45 46 #if QT_CONFIG(gestures) +/ 47 version(QT_NO_GESTURES) 48 { 49 extern(C++, class) struct QGesture; 50 } 51 52 /+ #endif +/ 53 54 /// Binding for C++ class [QInputEvent](https://doc.qt.io/qt-6/qinputevent.html). 55 class /+ Q_GUI_EXPORT +/ QInputEvent : QEvent 56 { 57 /+ Q_EVENT_DISABLE_COPY(QInputEvent) +/protected:/+ ; +/ 58 this(const typeof(this) other) 59 { 60 super(other); 61 this.tupleof = (cast(typeof(this))other).tupleof; 62 } 63 public: 64 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 65 /+ explicit +/this(Type type, const(QInputDevice) m_dev, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier); 66 })); 67 ~this(); 68 override QInputEvent clone() const { 69 import core.stdcpp.new_; 70 return cpp_new!QInputEvent(this); 71 } 72 73 final const(QInputDevice) device() const { return m_dev; } 74 final QInputDevice.DeviceType deviceType() const { return m_dev ? m_dev.type() : QInputDevice.DeviceType.Unknown; } 75 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers() const { return m_modState; } 76 pragma(inline, true) final void setModifiers(/+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers) { m_modState = modifiers; } 77 pragma(inline, true) final quint64 timestamp() const { return m_timeStamp; } 78 /+ virtual +/ void setTimestamp(quint64 timestamp) { m_timeStamp = timestamp; } 79 80 protected: 81 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 82 this(Type type, PointerEventTag, const(QInputDevice) dev, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier); 83 })); 84 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 85 this(Type type, SinglePointEventTag, const(QInputDevice) dev, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier); 86 })); 87 88 const(QInputDevice) m_dev = null; 89 quint64 m_timeStamp = 0; 90 /+ Qt:: +/qt.core.namespace.KeyboardModifiers m_modState = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier; 91 // fill up to the closest 8-byte aligned size: 48 92 quint32 m_reserved = 0; 93 mixin(CREATE_CONVENIENCE_WRAPPERS); 94 } 95 96 /// Binding for C++ class [QPointerEvent](https://doc.qt.io/qt-6/qpointerevent.html). 97 class /+ Q_GUI_EXPORT +/ QPointerEvent : QInputEvent 98 { 99 /+ Q_EVENT_DISABLE_COPY(QPointerEvent) +/protected:/+ ; +/ 100 this(const typeof(this) other) 101 { 102 super(other); 103 this.tupleof = (cast(typeof(this))other).tupleof; 104 } 105 public: 106 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 107 /+ explicit +/this(Type type, const(QPointingDevice) dev, 108 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier, ref const(QList!(QEventPoint)) points = globalInitVar!(QList!(QEventPoint))); 109 })); 110 ~this(); 111 112 override QPointerEvent clone() const { 113 import core.stdcpp.new_; 114 return cpp_new!QPointerEvent(this); 115 } 116 117 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 118 final const(QPointingDevice) pointingDevice() const; 119 })); 120 final QPointingDevice.PointerType pointerType() const { 121 return pointingDevice() ? pointingDevice().pointerType() : QPointingDevice.PointerType.Unknown; 122 } 123 override void setTimestamp(quint64 timestamp); 124 final qsizetype pointCount() const { return m_points.count(); } 125 // final ref QEventPoint point(qsizetype i) { return m_points[i]; } 126 final ref const(QList!(QEventPoint)) points() const { return m_points; } 127 final QEventPoint* pointById(int id); 128 final bool allPointsGrabbed() const; 129 /+ virtual +/ bool isBeginEvent() const { return false; } 130 /+ virtual +/ bool isUpdateEvent() const { return false; } 131 /+ virtual +/ bool isEndEvent() const { return false; } 132 final bool allPointsAccepted() const; 133 /+ virtual +/ override void setAccepted(bool accepted); 134 final QObject exclusiveGrabber(ref const(QEventPoint) point) const; 135 final void setExclusiveGrabber(ref const(QEventPoint) point, QObject exclusiveGrabber); 136 //final QList!( QPointer!(QObject)) passiveGrabbers(ref const(QEventPoint) point) const; 137 final void clearPassiveGrabbers(ref const(QEventPoint) point); 138 final bool addPassiveGrabber(ref const(QEventPoint) point, QObject grabber); 139 final bool removePassiveGrabber(ref const(QEventPoint) point, QObject grabber); 140 141 protected: 142 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 143 this(Type type, SinglePointEventTag, const(QInputDevice) dev, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier); 144 })); 145 146 QList!(QEventPoint) m_points; 147 mixin(CREATE_CONVENIENCE_WRAPPERS); 148 } 149 150 /// Binding for C++ class [QSinglePointEvent](https://doc.qt.io/qt-6/qsinglepointevent.html). 151 class /+ Q_GUI_EXPORT +/ QSinglePointEvent : QPointerEvent 152 { 153 mixin(Q_GADGET); 154 /+ Q_PROPERTY(QObject *exclusivePointGrabber READ exclusivePointGrabber 155 WRITE setExclusivePointGrabber) 156 157 Q_EVENT_DISABLE_COPY(QSinglePointEvent) +/protected:/+ ; +/ 158 public this(const typeof(this) other) 159 { 160 super(other); 161 this.tupleof = (cast(typeof(this))other).tupleof; 162 } 163 public: 164 // Workaround for https://issues.dlang.org/show_bug.cgi?id=22811 165 // Destructor added to prevent DMD error "class `qt.gui.event.QEnterEvent` use of `qt.gui.event.QPointerEvent.~this()` is hidden by `QEnterEvent`" 166 ~this(){} 167 168 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButton button() const { return m_button; } 169 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons buttons() const { return m_mouseState; } 170 171 pragma(inline, true) final QPointF position() const 172 { (mixin(Q_ASSERT(q{!QPointerEvent.m_points.isEmpty()}))); return m_points.first().position(); } 173 pragma(inline, true) final QPointF scenePosition() const 174 { (mixin(Q_ASSERT(q{!QPointerEvent.m_points.isEmpty()}))); return m_points.first().scenePosition(); } 175 pragma(inline, true) final QPointF globalPosition() const 176 { (mixin(Q_ASSERT(q{!QPointerEvent.m_points.isEmpty()}))); return m_points.first().globalPosition(); } 177 178 override bool isBeginEvent() const; 179 override bool isUpdateEvent() const; 180 override bool isEndEvent() const; 181 182 final QObject exclusivePointGrabber() const 183 { return QPointerEvent.exclusiveGrabber(points().first()); } 184 final void setExclusivePointGrabber(QObject exclusiveGrabber) 185 { QPointerEvent.setExclusiveGrabber(points().first(), exclusiveGrabber); } 186 187 override QSinglePointEvent clone() const { 188 import core.stdcpp.new_; 189 return cpp_new!QSinglePointEvent(this); 190 } 191 192 protected: 193 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 194 this(Type type, const(QPointingDevice) dev, ref const(QEventPoint) point, 195 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons, 196 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.MouseEventSource source); 197 })); 198 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 199 this(Type type, const(QPointingDevice) dev, ref const(QPointF) localPos, 200 ref const(QPointF) scenePos, ref const(QPointF) globalPos, 201 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons, 202 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 203 /+ Qt:: +/qt.core.namespace.MouseEventSource source = /+ Qt:: +/qt.core.namespace.MouseEventSource.MouseEventNotSynthesized); 204 })); 205 206 /+ Qt:: +/qt.core.namespace.MouseButton m_button = /+ Qt:: +/qt.core.namespace.MouseButton.NoButton; 207 /+ Qt:: +/qt.core.namespace.MouseButtons m_mouseState = /+ Qt:: +/qt.core.namespace.MouseButton.NoButton; 208 /+ Qt:: +/qt.core.namespace.MouseEventSource m_source; 209 /* 210 Fill up to the next 8-byte aligned size: 88 211 We have 32bits left, use some for QSinglePointEvent subclasses so that 212 we don't end up with gaps. 213 */ 214 // split this in two quint16; with a quint32, MSVC would 32-bit align it 215 quint16 m_reserved; 216 /+ quint16 m_reserved2 : 11; +/ 217 ushort bitfieldData_m_reserved2; 218 quint16 m_reserved2() const 219 { 220 return (bitfieldData_m_reserved2 >> 0) & 0x7ff; 221 } 222 quint16 m_reserved2(quint16 value) 223 { 224 bitfieldData_m_reserved2 = (bitfieldData_m_reserved2 & ~0x7ff) | ((value & 0x7ff) << 0); 225 return value; 226 } 227 // for QMouseEvent 228 /+ quint16 m_doubleClick : 1; +/ 229 quint16 m_doubleClick() const 230 { 231 return (bitfieldData_m_reserved2 >> 11) & 0x1; 232 } 233 quint16 m_doubleClick(quint16 value) 234 { 235 bitfieldData_m_reserved2 = (bitfieldData_m_reserved2 & ~0x800) | ((value & 0x1) << 11); 236 return value; 237 } 238 // for QWheelEvent 239 /+ quint16 m_phase : 3; +/ 240 quint16 m_phase() const 241 { 242 return (bitfieldData_m_reserved2 >> 12) & 0x7; 243 } 244 quint16 m_phase(quint16 value) 245 { 246 bitfieldData_m_reserved2 = (bitfieldData_m_reserved2 & ~0x7000) | ((value & 0x7) << 12); 247 return value; 248 } 249 /+ quint16 m_invertedScrolling : 1; +/ 250 quint16 m_invertedScrolling() const 251 { 252 return (bitfieldData_m_reserved2 >> 15) & 0x1; 253 } 254 quint16 m_invertedScrolling(quint16 value) 255 { 256 bitfieldData_m_reserved2 = (bitfieldData_m_reserved2 & ~0x8000) | ((value & 0x1) << 15); 257 return value; 258 } 259 mixin(CREATE_CONVENIENCE_WRAPPERS); 260 } 261 262 /// Binding for C++ class [QEnterEvent](https://doc.qt.io/qt-6/qenterevent.html). 263 class /+ Q_GUI_EXPORT +/ QEnterEvent : QSinglePointEvent 264 { 265 /+ Q_EVENT_DISABLE_COPY(QEnterEvent) +/protected:/+ ; +/ 266 this(const typeof(this) other) 267 { 268 super(other); 269 this.tupleof = (cast(typeof(this))other).tupleof; 270 } 271 public: 272 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 273 this(ref const(QPointF) localPos, ref const(QPointF) scenePos, ref const(QPointF) globalPos, 274 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 275 })); 276 ~this(); 277 278 override QEnterEvent clone() const { 279 import core.stdcpp.new_; 280 return cpp_new!QEnterEvent(this); 281 } 282 283 /+ #if QT_DEPRECATED_SINCE(6, 0) 284 #ifndef QT_NO_INTEGER_EVENT_COORDINATES +/ 285 version(QT_NO_INTEGER_EVENT_COORDINATES){}else 286 { 287 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 288 pragma(inline, true) final QPoint pos() const { return position().toPoint(); } 289 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 290 pragma(inline, true) final QPoint globalPos() const { return globalPosition().toPoint(); } 291 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 292 pragma(inline, true) final int x() const { return qRound(position().x()); } 293 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 294 pragma(inline, true) final int y() const { return qRound(position().y()); } 295 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 296 pragma(inline, true) final int globalX() const { return qRound(globalPosition().x()); } 297 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 298 pragma(inline, true) final int globalY() const { return qRound(globalPosition().y()); } 299 } 300 /+ #endif +/ 301 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 302 final QPointF localPos() const { return position(); } 303 /+ QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") +/ 304 final QPointF windowPos() const { return scenePosition(); } 305 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 306 final QPointF screenPos() const { return globalPosition(); } 307 /+ #endif +/ // QT_DEPRECATED_SINCE(6, 0) 308 mixin(CREATE_CONVENIENCE_WRAPPERS); 309 } 310 311 /// Binding for C++ class [QMouseEvent](https://doc.qt.io/qt-6/qmouseevent.html). 312 class /+ Q_GUI_EXPORT +/ QMouseEvent : QSinglePointEvent 313 { 314 /+ Q_EVENT_DISABLE_COPY(QMouseEvent) +/protected:/+ ; +/ 315 this(const typeof(this) other) 316 { 317 super(other); 318 this.tupleof = (cast(typeof(this))other).tupleof; 319 } 320 public: 321 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 322 this(Type type, ref const(QPointF) localPos, /+ Qt:: +/qt.core.namespace.MouseButton button, 323 /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 324 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 325 })); 326 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 327 this(Type type, ref const(QPointF) localPos, ref const(QPointF) globalPos, 328 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons, 329 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 330 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 331 })); 332 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 333 this(Type type, ref const(QPointF) localPos, ref const(QPointF) scenePos, ref const(QPointF) globalPos, 334 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons, 335 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 336 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 337 })); 338 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 339 this(Type type, ref const(QPointF) localPos, ref const(QPointF) scenePos, ref const(QPointF) globalPos, 340 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons, 341 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.MouseEventSource source, 342 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 343 })); 344 ~this(); 345 346 override QMouseEvent clone() const { 347 import core.stdcpp.new_; 348 return cpp_new!QMouseEvent(this); 349 } 350 351 /+ #ifndef QT_NO_INTEGER_EVENT_COORDINATES +/ 352 version(QT_NO_INTEGER_EVENT_COORDINATES){}else 353 { 354 pragma(inline, true) final QPoint pos() const { return position().toPoint(); } 355 } 356 /+ #endif 357 #if QT_DEPRECATED_SINCE(6, 0) 358 #ifndef QT_NO_INTEGER_EVENT_COORDINATES +/ 359 version(QT_NO_INTEGER_EVENT_COORDINATES){}else 360 { 361 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 362 pragma(inline, true) final QPoint globalPos() const { return globalPosition().toPoint(); } 363 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 364 pragma(inline, true) final int x() const { return qRound(position().x()); } 365 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 366 pragma(inline, true) final int y() const { return qRound(position().y()); } 367 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 368 pragma(inline, true) final int globalX() const { return qRound(globalPosition().x()); } 369 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 370 pragma(inline, true) final int globalY() const { return qRound(globalPosition().y()); } 371 } 372 /+ #endif +/ // QT_NO_INTEGER_EVENT_COORDINATES 373 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 374 final QPointF localPos() const { return position(); } 375 /+ QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") +/ 376 final QPointF windowPos() const { return scenePosition(); } 377 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 378 final QPointF screenPos() const { return globalPosition(); } 379 final /+ Qt:: +/qt.core.namespace.MouseEventSource source() const; 380 /+ #endif +/ // QT_DEPRECATED_SINCE(6, 0) 381 final /+ Qt:: +/qt.core.namespace.MouseEventFlags flags() const; 382 mixin(CREATE_CONVENIENCE_WRAPPERS); 383 } 384 385 /// Binding for C++ class [QHoverEvent](https://doc.qt.io/qt-6/qhoverevent.html). 386 class /+ Q_GUI_EXPORT +/ QHoverEvent : QSinglePointEvent 387 { 388 /+ Q_EVENT_DISABLE_COPY(QHoverEvent) +/protected:/+ ; +/ 389 this(const typeof(this) other) 390 { 391 super(other); 392 this.tupleof = (cast(typeof(this))other).tupleof; 393 } 394 public: 395 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 396 this(Type type, ref const(QPointF) pos, ref const(QPointF) oldPos, 397 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier, 398 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 399 })); 400 ~this(); 401 402 override QHoverEvent clone() const { 403 import core.stdcpp.new_; 404 return cpp_new!QHoverEvent(this); 405 } 406 407 /+ #if QT_DEPRECATED_SINCE(6, 0) 408 #ifndef QT_NO_INTEGER_EVENT_COORDINATES +/ 409 version(QT_NO_INTEGER_EVENT_COORDINATES){}else 410 { 411 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 412 pragma(inline, true) final QPoint pos() const { return position().toPoint(); } 413 } 414 /+ #endif +/ 415 416 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 417 pragma(inline, true) final QPointF posF() const { return position(); } 418 /+ #endif +/ // QT_DEPRECATED_SINCE(6, 0) 419 420 override bool isUpdateEvent() const { return true; } 421 422 // TODO deprecate when we figure out an actual replacement (point history?) 423 pragma(inline, true) final QPoint oldPos() const { return m_oldPos.toPoint(); } 424 pragma(inline, true) final QPointF oldPosF() const { return m_oldPos; } 425 426 protected: 427 QPointF m_oldPos; // TODO remove? 428 mixin(CREATE_CONVENIENCE_WRAPPERS); 429 } 430 431 /+ #if QT_CONFIG(wheelevent) +/ 432 /// Binding for C++ class [QWheelEvent](https://doc.qt.io/qt-6/qwheelevent.html). 433 class /+ Q_GUI_EXPORT +/ QWheelEvent : QSinglePointEvent 434 { 435 mixin(Q_GADGET); 436 /+ Q_PROPERTY(const QPointingDevice *device READ pointingDevice) 437 Q_PROPERTY(QPoint pixelDelta READ pixelDelta) 438 Q_PROPERTY(QPoint angleDelta READ angleDelta) 439 Q_PROPERTY(Qt::ScrollPhase phase READ phase) 440 Q_PROPERTY(bool inverted READ inverted) 441 442 Q_EVENT_DISABLE_COPY(QWheelEvent) +/protected:/+ ; +/ 443 this(const typeof(this) other) 444 { 445 super(other); 446 this.tupleof = (cast(typeof(this))other).tupleof; 447 } 448 public: 449 enum { DefaultDeltasPerStep = 120 } 450 451 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 452 this(ref const(QPointF) pos, ref const(QPointF) globalPos, QPoint pixelDelta, QPoint angleDelta, 453 /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.ScrollPhase phase, 454 bool inverted, /+ Qt:: +/qt.core.namespace.MouseEventSource source = /+ Qt:: +/qt.core.namespace.MouseEventSource.MouseEventNotSynthesized, 455 const(QPointingDevice) device = QPointingDevice.primaryPointingDevice()); 456 })); 457 ~this(); 458 459 override QWheelEvent clone() const { 460 import core.stdcpp.new_; 461 return cpp_new!QWheelEvent(this); 462 } 463 464 pragma(inline, true) final QPoint pixelDelta() const { return m_pixelDelta; } 465 pragma(inline, true) final QPoint angleDelta() const { return m_angleDelta; } 466 467 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.ScrollPhase phase() const { return cast(/+ Qt:: +/qt.core.namespace.ScrollPhase)(m_phase); } 468 pragma(inline, true) final bool inverted() const { return (m_invertedScrolling) != 0; } 469 pragma(inline, true) final bool isInverted() const { return (m_invertedScrolling) != 0; } 470 pragma(inline, true) final bool hasPixelDelta() const { return !m_pixelDelta.isNull(); } 471 472 override bool isBeginEvent() const; 473 override bool isUpdateEvent() const; 474 override bool isEndEvent() const; 475 final /+ Qt:: +/qt.core.namespace.MouseEventSource source() const { return /+ Qt:: +/qt.core.namespace.MouseEventSource(m_source); } 476 477 protected: 478 QPoint m_pixelDelta; 479 QPoint m_angleDelta; 480 mixin(CREATE_CONVENIENCE_WRAPPERS); 481 } 482 /+ #endif 483 484 #if QT_CONFIG(tabletevent) +/ 485 /// Binding for C++ class [QTabletEvent](https://doc.qt.io/qt-6/qtabletevent.html). 486 class /+ Q_GUI_EXPORT +/ QTabletEvent : QSinglePointEvent 487 { 488 /+ Q_EVENT_DISABLE_COPY(QTabletEvent) +/protected:/+ ; +/ 489 this(const typeof(this) other) 490 { 491 super(other); 492 this.tupleof = (cast(typeof(this))other).tupleof; 493 } 494 public: 495 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 496 this(Type t, const(QPointingDevice) device, 497 ref const(QPointF) pos, ref const(QPointF) globalPos, 498 qreal pressure, float xTilt, float yTilt, 499 float tangentialPressure, qreal rotation, float z, 500 /+ Qt:: +/qt.core.namespace.KeyboardModifiers keyState, 501 /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons); 502 })); 503 ~this(); 504 505 override QTabletEvent clone() const { 506 import core.stdcpp.new_; 507 return cpp_new!QTabletEvent(this); 508 } 509 510 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 511 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 512 pragma(inline, true) final QPoint pos() const { return position().toPoint(); } 513 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 514 pragma(inline, true) final QPoint globalPos() const { return globalPosition().toPoint(); } 515 516 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 517 pragma(inline, true) final const(QPointF) posF() const { return position(); } 518 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 519 pragma(inline, true) final const(QPointF) globalPosF() const { return globalPosition(); } 520 /+ QT_DEPRECATED_VERSION_X_6_0("Use position().x()") +/ 521 pragma(inline, true) final int x() const { return qRound(position().x()); } 522 /+ QT_DEPRECATED_VERSION_X_6_0("Use position().y()") +/ 523 pragma(inline, true) final int y() const { return qRound(position().y()); } 524 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().x()") +/ 525 pragma(inline, true) final int globalX() const { return qRound(globalPosition().x()); } 526 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().y()") +/ 527 pragma(inline, true) final int globalY() const { return qRound(globalPosition().y()); } 528 /+ QT_DEPRECATED_VERSION_X_6_0("use globalPosition().x()") +/ 529 pragma(inline, true) final qreal hiResGlobalX() const { return globalPosition().x(); } 530 /+ QT_DEPRECATED_VERSION_X_6_0("use globalPosition().y()") +/ 531 pragma(inline, true) final qreal hiResGlobalY() const { return globalPosition().y(); } 532 /+ QT_DEPRECATED_VERSION_X_6_0("use pointingDevice().uniqueId()") +/ 533 pragma(inline, true) final qint64 uniqueId() const { return pointingDevice() ? pointingDevice().uniqueId().numericId() : -1; } 534 /+ #endif +/ 535 pragma(inline, true) final qreal pressure() const { (mixin(Q_ASSERT(q{!QPointerEvent.points().isEmpty()}))); return points().first().pressure(); } 536 pragma(inline, true) final qreal rotation() const { (mixin(Q_ASSERT(q{!QPointerEvent.points().isEmpty()}))); return points().first().rotation(); } 537 pragma(inline, true) final qreal z() const { return m_z; } 538 pragma(inline, true) final qreal tangentialPressure() const { return m_tangential; } 539 pragma(inline, true) final qreal xTilt() const { return m_xTilt; } 540 pragma(inline, true) final qreal yTilt() const { return m_yTilt; } 541 542 protected: 543 float m_tangential; 544 float m_xTilt; 545 float m_yTilt; 546 float m_z; 547 mixin(CREATE_CONVENIENCE_WRAPPERS); 548 } 549 /+ #endif // QT_CONFIG(tabletevent) 550 551 #if QT_CONFIG(gestures) +/ 552 /// Binding for C++ class [QNativeGestureEvent](https://doc.qt.io/qt-6/qnativegestureevent.html). 553 class /+ Q_GUI_EXPORT +/ QNativeGestureEvent : QSinglePointEvent 554 { 555 /+ Q_EVENT_DISABLE_COPY(QNativeGestureEvent) +/protected:/+ ; +/ 556 this(const typeof(this) other) 557 { 558 super(other); 559 this.tupleof = (cast(typeof(this))other).tupleof; 560 } 561 public: 562 /+ #if QT_DEPRECATED_SINCE(6, 2) +/ 563 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 564 /+ QT_DEPRECATED_VERSION_X_6_2("Use the other constructor") +/this(/+ Qt:: +/qt.core.namespace.NativeGestureType type, const(QPointingDevice) dev, ref const(QPointF) localPos, ref const(QPointF) scenePos, 565 ref const(QPointF) globalPos, qreal value, quint64 sequenceId, quint64 intArgument); 566 })); 567 /+ #endif +/ 568 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 569 this(/+ Qt:: +/qt.core.namespace.NativeGestureType type, const(QPointingDevice) dev, int fingerCount, 570 ref const(QPointF) localPos, ref const(QPointF) scenePos, ref const(QPointF) globalPos, 571 qreal value, ref const(QPointF) delta, quint64 sequenceId = ulong.max); 572 })); 573 ~this(); 574 575 override QNativeGestureEvent clone() const { 576 import core.stdcpp.new_; 577 return cpp_new!QNativeGestureEvent(this); 578 } 579 580 final /+ Qt:: +/qt.core.namespace.NativeGestureType gestureType() const { return m_gestureType; } 581 final int fingerCount() const { return m_fingerCount; } 582 final qreal value() const { return m_realValue; } 583 final QPointF delta() const { 584 /+ #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +/ 585 return m_delta.toPointF(); 586 /+ #else 587 return m_delta; 588 #endif +/ 589 } 590 591 /+ #if QT_DEPRECATED_SINCE(6, 0) 592 #ifndef QT_NO_INTEGER_EVENT_COORDINATES +/ 593 version(QT_NO_INTEGER_EVENT_COORDINATES){}else 594 { 595 /+ QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()") +/ 596 pragma(inline, true) final const(QPoint) pos() const { return position().toPoint(); } 597 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition().toPoint()") +/ 598 pragma(inline, true) final const(QPoint) globalPos() const { return globalPosition().toPoint(); } 599 } 600 /+ #endif +/ 601 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 602 final QPointF localPos() const { return position(); } 603 /+ QT_DEPRECATED_VERSION_X_6_0("Use scenePosition()") +/ 604 final QPointF windowPos() const { return scenePosition(); } 605 /+ QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") +/ 606 final QPointF screenPos() const { return globalPosition(); } 607 /+ #endif +/ 608 609 protected: 610 quint64 m_sequenceId; 611 /+ #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) +/ 612 QVector2D m_delta; 613 /+ #else 614 QPointF m_delta; 615 #endif +/ 616 qreal m_realValue; 617 /+ Qt:: +/qt.core.namespace.NativeGestureType m_gestureType; 618 /+ quint32 m_fingerCount : 4; +/ 619 uint bitfieldData_m_fingerCount; 620 quint32 m_fingerCount() const 621 { 622 return (bitfieldData_m_fingerCount >> 0) & 0xf; 623 } 624 quint32 m_fingerCount(quint32 value) 625 { 626 bitfieldData_m_fingerCount = (bitfieldData_m_fingerCount & ~0xf) | ((value & 0xf) << 0); 627 return value; 628 } 629 /+ quint32 m_reserved : 28; +/ 630 quint32 m_reserved() const 631 { 632 return (bitfieldData_m_fingerCount >> 4) & 0xfffffff; 633 } 634 quint32 m_reserved(quint32 value) 635 { 636 bitfieldData_m_fingerCount = (bitfieldData_m_fingerCount & ~0xfffffff0) | ((value & 0xfffffff) << 4); 637 return value; 638 } 639 mixin(CREATE_CONVENIENCE_WRAPPERS); 640 } 641 /+ #endif +/ // QT_CONFIG(gestures) 642 643 /// Binding for C++ class [QKeyEvent](https://doc.qt.io/qt-6/qkeyevent.html). 644 class /+ Q_GUI_EXPORT +/ QKeyEvent : QInputEvent 645 { 646 /+ Q_EVENT_DISABLE_COPY(QKeyEvent) +/protected:/+ ; +/ 647 this(const typeof(this) other) 648 { 649 super(other); 650 this.tupleof = (cast(typeof(this))other).tupleof; 651 } 652 public: 653 this(Type type, int key, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, ref const(QString) text = globalInitVar!QString, 654 bool autorep = false, quint16 count = 1); 655 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 656 this(Type type, int key, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 657 quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, 658 ref const(QString) text = globalInitVar!QString, bool autorep = false, quint16 count = 1, 659 const(QInputDevice) device = QInputDevice.primaryKeyboard()); 660 })); 661 ~this(); 662 663 override QKeyEvent clone() const { 664 import core.stdcpp.new_; 665 return cpp_new!QKeyEvent(this); 666 } 667 668 final int key() const { return m_key; } 669 /+ #if QT_CONFIG(shortcut) +/ 670 final bool matches(QKeySequence.StandardKey key) const; 671 /+ #endif +/ 672 //final /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers() const; 673 final QKeyCombination keyCombination() const 674 { 675 return QKeyCombination(modifiers(), cast(/+ Qt:: +/qt.core.namespace.Key)(m_key)); 676 } 677 pragma(inline, true) final QString text() /*const*/ { return m_text; } 678 pragma(inline, true) final bool isAutoRepeat() const { return (m_autoRepeat) != 0; } 679 pragma(inline, true) final int count() const { return int(m_count); } 680 681 pragma(inline, true) final quint32 nativeScanCode() const { return m_scanCode; } 682 pragma(inline, true) final quint32 nativeVirtualKey() const { return m_virtualKey; } 683 pragma(inline, true) final quint32 nativeModifiers() const { return m_nativeModifiers; } 684 685 /+ #if QT_CONFIG(shortcut) +/ 686 /+ friend inline bool operator==(QKeyEvent *e, QKeySequence::StandardKey key) 687 { return (e ? e->matches(key) : false); } +/ 688 /+ friend inline bool operator==(QKeySequence::StandardKey key, QKeyEvent *e) 689 { return (e ? e->matches(key) : false); } +/ 690 /+ #endif +/ // QT_CONFIG(shortcut) 691 692 protected: 693 QString m_text; 694 int m_key; 695 quint32 m_scanCode; 696 quint32 m_virtualKey; 697 quint32 m_nativeModifiers; 698 /+ quint16 m_count : 15; +/ 699 ushort bitfieldData_m_count; 700 quint16 m_count() const 701 { 702 return (bitfieldData_m_count >> 0) & 0x7fff; 703 } 704 quint16 m_count(quint16 value) 705 { 706 bitfieldData_m_count = (bitfieldData_m_count & ~0x7fff) | ((value & 0x7fff) << 0); 707 return value; 708 } 709 /+ quint16 m_autoRepeat : 1; +/ 710 quint16 m_autoRepeat() const 711 { 712 return (bitfieldData_m_count >> 15) & 0x1; 713 } 714 quint16 m_autoRepeat(quint16 value) 715 { 716 bitfieldData_m_count = (bitfieldData_m_count & ~0x8000) | ((value & 0x1) << 15); 717 return value; 718 } 719 mixin(CREATE_CONVENIENCE_WRAPPERS); 720 } 721 722 723 /// Binding for C++ class [QFocusEvent](https://doc.qt.io/qt-6/qfocusevent.html). 724 class /+ Q_GUI_EXPORT +/ QFocusEvent : QEvent 725 { 726 /+ Q_EVENT_DISABLE_COPY(QFocusEvent) +/protected:/+ ; +/ 727 this(const typeof(this) other) 728 { 729 super(other); 730 this.tupleof = (cast(typeof(this))other).tupleof; 731 } 732 public: 733 /+ explicit +/this(Type type, /+ Qt:: +/qt.core.namespace.FocusReason reason=/+ Qt:: +/qt.core.namespace.FocusReason.OtherFocusReason); 734 ~this(); 735 736 override QFocusEvent clone() const { 737 import core.stdcpp.new_; 738 return cpp_new!QFocusEvent(this); 739 } 740 741 pragma(inline, true) final bool gotFocus() const { return type() == Type.FocusIn; } 742 pragma(inline, true) final bool lostFocus() const { return type() == Type.FocusOut; } 743 744 final /+ Qt:: +/qt.core.namespace.FocusReason reason() const; 745 746 private: 747 /+ Qt:: +/qt.core.namespace.FocusReason m_reason; 748 mixin(CREATE_CONVENIENCE_WRAPPERS); 749 } 750 751 752 /// Binding for C++ class [QPaintEvent](https://doc.qt.io/qt-6/qpaintevent.html). 753 class /+ Q_GUI_EXPORT +/ QPaintEvent : QEvent 754 { 755 /+ Q_EVENT_DISABLE_COPY(QPaintEvent) +/protected:/+ ; +/ 756 this(const typeof(this) other) 757 { 758 super(other); 759 this.tupleof = (cast(typeof(this))other).tupleof; 760 } 761 public: 762 /+ explicit +/this(ref const(QRegion) paintRegion); 763 /+ explicit +/this(ref const(QRect) paintRect); 764 ~this(); 765 766 override QPaintEvent clone() const { 767 import core.stdcpp.new_; 768 return cpp_new!QPaintEvent(this); 769 } 770 771 pragma(inline, true) final ref const(QRect) rect() const { return m_rect; } 772 pragma(inline, true) final ref const(QRegion) region() const { return m_region; } 773 774 protected: 775 QRect m_rect; 776 QRegion m_region; 777 bool m_erased; 778 mixin(CREATE_CONVENIENCE_WRAPPERS); 779 } 780 781 /// Binding for C++ class [QMoveEvent](https://doc.qt.io/qt-6/qmoveevent.html). 782 class /+ Q_GUI_EXPORT +/ QMoveEvent : QEvent 783 { 784 /+ Q_EVENT_DISABLE_COPY(QMoveEvent) +/protected:/+ ; +/ 785 this(const typeof(this) other) 786 { 787 super(other); 788 this.tupleof = (cast(typeof(this))other).tupleof; 789 } 790 public: 791 this(ref const(QPoint) pos, ref const(QPoint) oldPos); 792 ~this(); 793 794 override QMoveEvent clone() const { 795 import core.stdcpp.new_; 796 return cpp_new!QMoveEvent(this); 797 } 798 799 pragma(inline, true) final ref const(QPoint) pos() const { return m_pos; } 800 pragma(inline, true) final ref const(QPoint) oldPos() const { return m_oldPos;} 801 protected: 802 QPoint m_pos; QPoint m_oldPos; 803 /+ friend class QApplication; +/ 804 mixin(CREATE_CONVENIENCE_WRAPPERS); 805 } 806 807 /// Binding for C++ class [QExposeEvent](https://doc.qt.io/qt-6/qexposeevent.html). 808 class /+ Q_GUI_EXPORT +/ QExposeEvent : QEvent 809 { 810 /+ Q_EVENT_DISABLE_COPY(QExposeEvent) +/protected:/+ ; +/ 811 this(const typeof(this) other) 812 { 813 super(other); 814 this.tupleof = (cast(typeof(this))other).tupleof; 815 } 816 public: 817 /+ explicit +/this(ref const(QRegion) m_region); 818 ~this(); 819 820 override QExposeEvent clone() const { 821 import core.stdcpp.new_; 822 return cpp_new!QExposeEvent(this); 823 } 824 825 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 826 /+ QT_DEPRECATED_VERSION_X_6_0("Handle QPaintEvent instead") +/ 827 pragma(inline, true) final ref const(QRegion) region() const { return m_region; } 828 /+ #endif +/ 829 830 protected: 831 QRegion m_region; 832 mixin(CREATE_CONVENIENCE_WRAPPERS); 833 } 834 835 /// Binding for C++ class [QPlatformSurfaceEvent](https://doc.qt.io/qt-6/qplatformsurfaceevent.html). 836 class /+ Q_GUI_EXPORT +/ QPlatformSurfaceEvent : QEvent 837 { 838 /+ Q_EVENT_DISABLE_COPY(QPlatformSurfaceEvent) +/protected:/+ ; +/ 839 this(const typeof(this) other) 840 { 841 super(other); 842 this.tupleof = (cast(typeof(this))other).tupleof; 843 } 844 public: 845 enum SurfaceEventType { 846 SurfaceCreated, 847 SurfaceAboutToBeDestroyed 848 } 849 850 /+ explicit +/this(SurfaceEventType surfaceEventType); 851 ~this(); 852 853 override QPlatformSurfaceEvent clone() const { 854 import core.stdcpp.new_; 855 return cpp_new!QPlatformSurfaceEvent(this); 856 } 857 858 pragma(inline, true) final SurfaceEventType surfaceEventType() const { return m_surfaceEventType; } 859 860 protected: 861 SurfaceEventType m_surfaceEventType; 862 mixin(CREATE_CONVENIENCE_WRAPPERS); 863 } 864 865 /// Binding for C++ class [QResizeEvent](https://doc.qt.io/qt-6/qresizeevent.html). 866 class /+ Q_GUI_EXPORT +/ QResizeEvent : QEvent 867 { 868 /+ Q_EVENT_DISABLE_COPY(QResizeEvent) +/protected:/+ ; +/ 869 this(const typeof(this) other) 870 { 871 super(other); 872 this.tupleof = (cast(typeof(this))other).tupleof; 873 } 874 public: 875 this(ref const(QSize) size, ref const(QSize) oldSize); 876 ~this(); 877 878 override QResizeEvent clone() const { 879 import core.stdcpp.new_; 880 return cpp_new!QResizeEvent(this); 881 } 882 883 pragma(inline, true) final ref const(QSize) size() const { return m_size; } 884 pragma(inline, true) final ref const(QSize) oldSize()const { return m_oldSize;} 885 protected: 886 QSize m_size; QSize m_oldSize; 887 /+ friend class QApplication; +/ 888 mixin(CREATE_CONVENIENCE_WRAPPERS); 889 } 890 891 892 /// Binding for C++ class [QCloseEvent](https://doc.qt.io/qt-6/qcloseevent.html). 893 class /+ Q_GUI_EXPORT +/ QCloseEvent : QEvent 894 { 895 /+ Q_EVENT_DISABLE_COPY(QCloseEvent) +/protected:/+ ; +/ 896 public: 897 this(); 898 ~this(); 899 mixin(CREATE_CONVENIENCE_WRAPPERS); 900 } 901 902 903 /// Binding for C++ class [QIconDragEvent](https://doc.qt.io/qt-6/qicondragevent.html). 904 class /+ Q_GUI_EXPORT +/ QIconDragEvent : QEvent 905 { 906 /+ Q_EVENT_DISABLE_COPY(QIconDragEvent) +/protected:/+ ; +/ 907 public: 908 this(); 909 ~this(); 910 mixin(CREATE_CONVENIENCE_WRAPPERS); 911 } 912 913 914 /// Binding for C++ class [QShowEvent](https://doc.qt.io/qt-6/qshowevent.html). 915 class /+ Q_GUI_EXPORT +/ QShowEvent : QEvent 916 { 917 /+ Q_EVENT_DISABLE_COPY(QShowEvent) +/protected:/+ ; +/ 918 public: 919 this(); 920 ~this(); 921 mixin(CREATE_CONVENIENCE_WRAPPERS); 922 } 923 924 925 /// Binding for C++ class [QHideEvent](https://doc.qt.io/qt-6/qhideevent.html). 926 class /+ Q_GUI_EXPORT +/ QHideEvent : QEvent 927 { 928 /+ Q_EVENT_DISABLE_COPY(QHideEvent) +/protected:/+ ; +/ 929 public: 930 this(); 931 ~this(); 932 mixin(CREATE_CONVENIENCE_WRAPPERS); 933 } 934 935 version(QT_NO_CONTEXTMENU){}else 936 { 937 /// Binding for C++ class [QContextMenuEvent](https://doc.qt.io/qt-6/qcontextmenuevent.html). 938 class /+ Q_GUI_EXPORT +/ QContextMenuEvent : QInputEvent 939 { 940 /+ Q_EVENT_DISABLE_COPY(QContextMenuEvent) +/protected:/+ ; +/ 941 this(const typeof(this) other) 942 { 943 super(other); 944 this.tupleof = (cast(typeof(this))other).tupleof; 945 } 946 public: 947 enum Reason { Mouse, Keyboard, Other } 948 949 this(Reason reason, ref const(QPoint) pos, ref const(QPoint) globalPos, 950 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier); 951 this(Reason reason, ref const(QPoint) pos); 952 ~this(); 953 954 override QContextMenuEvent clone() const { 955 import core.stdcpp.new_; 956 return cpp_new!QContextMenuEvent(this); 957 } 958 959 pragma(inline, true) final int x() const { return m_pos.x(); } 960 pragma(inline, true) final int y() const { return m_pos.y(); } 961 pragma(inline, true) final int globalX() const { return m_globalPos.x(); } 962 pragma(inline, true) final int globalY() const { return m_globalPos.y(); } 963 964 pragma(inline, true) final ref const(QPoint) pos() const { return m_pos; } 965 pragma(inline, true) final ref const(QPoint) globalPos() const { return m_globalPos; } 966 967 pragma(inline, true) final Reason reason() const { return cast(Reason)(m_reason); } 968 969 protected: 970 QPoint m_pos; 971 QPoint m_globalPos; 972 /+ uint m_reason : 8; +/ 973 ubyte bitfieldData_m_reason; 974 uint m_reason() const 975 { 976 return (bitfieldData_m_reason >> 0) & 0xff; 977 } 978 uint m_reason(uint value) 979 { 980 bitfieldData_m_reason = (bitfieldData_m_reason & ~0xff) | ((value & 0xff) << 0); 981 return value; 982 } 983 mixin(CREATE_CONVENIENCE_WRAPPERS); 984 } 985 } 986 987 version(QT_NO_INPUTMETHOD){}else 988 { 989 /// Binding for C++ class [QInputMethodEvent](https://doc.qt.io/qt-6/qinputmethodevent.html). 990 class /+ Q_GUI_EXPORT +/ QInputMethodEvent : QEvent 991 { 992 /+ Q_EVENT_DISABLE_COPY(QInputMethodEvent) +/protected:/+ ; +/ 993 this(const typeof(this) other) 994 { 995 super(other); 996 this.tupleof = (cast(typeof(this))other).tupleof; 997 } 998 public: 999 enum AttributeType { 1000 TextFormat, 1001 Cursor, 1002 Language, 1003 Ruby, 1004 Selection 1005 } 1006 extern(C++, class) struct Attribute { 1007 public: 1008 /+this(AttributeType typ, int s, int l, QVariant val) 1009 { 1010 this.type = typ; 1011 this.start = s; 1012 this.length = l; 1013 this.value = /+ std:: +/move(cast(_Tp && )(val)); 1014 } 1015 this(AttributeType typ, int s, int l) 1016 { 1017 this.type = typ; 1018 this.start = s; 1019 this.length = l; 1020 this.value = typeof(this.value)(); 1021 }+/ 1022 1023 AttributeType type; 1024 int start; 1025 int length; 1026 QVariant value; 1027 1028 this(ref Attribute other) 1029 { 1030 this.tupleof = (cast(typeof(this))other).tupleof; 1031 } 1032 } 1033 this(); 1034 // this(ref const(QString) preeditText, ref const(QList!(Attribute)) /+ QList<Attribute> +/ attributes); 1035 ~this(); 1036 1037 override QInputMethodEvent clone() const { 1038 import core.stdcpp.new_; 1039 return cpp_new!QInputMethodEvent(this); 1040 } 1041 1042 final void setCommitString(ref const(QString) commitString, int replaceFrom = 0, int replaceLength = 0); 1043 pragma(inline, true) final ref const(QList!(Attribute)) attributes() const { return m_attributes; } 1044 pragma(inline, true) final ref const(QString) preeditString() const { return m_preedit; } 1045 1046 pragma(inline, true) final ref const(QString) commitString() const { return m_commit; } 1047 pragma(inline, true) final int replacementStart() const { return m_replacementStart; } 1048 pragma(inline, true) final int replacementLength() const { return m_replacementLength; } 1049 1050 /+ inline friend bool operator==(const QInputMethodEvent::Attribute &lhs, 1051 const QInputMethodEvent::Attribute &rhs) 1052 { 1053 return lhs.type == rhs.type && lhs.start == rhs.start 1054 && lhs.length == rhs.length && lhs.value == rhs.value; 1055 } +/ 1056 1057 /+ inline friend bool operator!=(const QInputMethodEvent::Attribute &lhs, 1058 const QInputMethodEvent::Attribute &rhs) 1059 { 1060 return !(lhs == rhs); 1061 } +/ 1062 1063 private: 1064 QString m_preedit; 1065 QString m_commit; 1066 QList!(Attribute) m_attributes; 1067 int m_replacementStart; 1068 int m_replacementLength; 1069 mixin(CREATE_CONVENIENCE_WRAPPERS); 1070 } 1071 /+ Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_RELOCATABLE_TYPE); +/ 1072 1073 /// Binding for C++ class [QInputMethodQueryEvent](https://doc.qt.io/qt-6/qinputmethodqueryevent.html). 1074 class /+ Q_GUI_EXPORT +/ QInputMethodQueryEvent : QEvent 1075 { 1076 /+ Q_EVENT_DISABLE_COPY(QInputMethodQueryEvent) +/protected:/+ ; +/ 1077 this(const typeof(this) other) 1078 { 1079 super(other); 1080 this.tupleof = (cast(typeof(this))other).tupleof; 1081 } 1082 public: 1083 /+ explicit +/this(/+ Qt:: +/qt.core.namespace.InputMethodQueries queries); 1084 ~this(); 1085 1086 override QInputMethodQueryEvent clone() const { 1087 import core.stdcpp.new_; 1088 return cpp_new!QInputMethodQueryEvent(this); 1089 } 1090 1091 final /+ Qt:: +/qt.core.namespace.InputMethodQueries queries() const { return m_queries; } 1092 1093 final void setValue(/+ Qt:: +/qt.core.namespace.InputMethodQuery query, ref const(QVariant) value); 1094 final QVariant value(/+ Qt:: +/qt.core.namespace.InputMethodQuery query) const; 1095 private: 1096 /+ Qt:: +/qt.core.namespace.InputMethodQueries m_queries; 1097 struct QueryPair { 1098 /+ Qt:: +/qt.core.namespace.InputMethodQuery query; 1099 QVariant value; 1100 1101 this(ref QueryPair other) 1102 { 1103 this.tupleof = (cast(typeof(this))other).tupleof; 1104 } 1105 } 1106 /+ friend QTypeInfo<QueryPair>; +/ 1107 QList!(QueryPair) m_values; 1108 mixin(CREATE_CONVENIENCE_WRAPPERS); 1109 } 1110 /+ Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_RELOCATABLE_TYPE); +/ 1111 1112 } 1113 1114 /+ #if QT_CONFIG(draganddrop) +/ 1115 1116 1117 /// Binding for C++ class [QDropEvent](https://doc.qt.io/qt-6/qdropevent.html). 1118 class /+ Q_GUI_EXPORT +/ QDropEvent : QEvent 1119 { 1120 /+ Q_EVENT_DISABLE_COPY(QDropEvent) +/protected:/+ ; +/ 1121 this(const typeof(this) other) 1122 { 1123 super(other); 1124 this.tupleof = (cast(typeof(this))other).tupleof; 1125 } 1126 public: 1127 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 1128 this(ref const(QPointF) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data, 1129 /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, Type type = Type.Drop); 1130 })); 1131 ~this(); 1132 1133 override QDropEvent clone() const { 1134 import core.stdcpp.new_; 1135 return cpp_new!QDropEvent(this); 1136 } 1137 1138 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 1139 /+ QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()") +/ 1140 pragma(inline, true) final QPoint pos() const { return position().toPoint(); } 1141 /+ QT_DEPRECATED_VERSION_X_6_0("Use position()") +/ 1142 pragma(inline, true) final QPointF posF() const { return position(); } 1143 /+ QT_DEPRECATED_VERSION_X_6_0("Use buttons()") +/ 1144 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons mouseButtons() const { return buttons(); } 1145 /+ QT_DEPRECATED_VERSION_X_6_0("Use modifiers()") +/ 1146 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.KeyboardModifiers keyboardModifiers() const { return modifiers(); } 1147 /+ #endif +/ // QT_DEPRECATED_SINCE(6, 0) 1148 1149 final QPointF position() const { return m_pos; } 1150 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons buttons() const { return m_mouseState; } 1151 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers() const { return m_modState; } 1152 1153 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropActions possibleActions() const { return m_actions; } 1154 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropAction proposedAction() const { return m_defaultAction; } 1155 pragma(inline, true) final void acceptProposedAction() { m_dropAction = m_defaultAction; accept(); } 1156 1157 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropAction dropAction() const { return m_dropAction; } 1158 final void setDropAction(/+ Qt:: +/qt.core.namespace.DropAction action); 1159 1160 final QObject source() const; 1161 pragma(inline, true) final const(QMimeData) mimeData() const { return m_data; } 1162 1163 protected: 1164 /+ friend class QApplication; +/ 1165 QPointF m_pos; 1166 /+ Qt:: +/qt.core.namespace.MouseButtons m_mouseState; 1167 /+ Qt:: +/qt.core.namespace.KeyboardModifiers m_modState; 1168 /+ Qt:: +/qt.core.namespace.DropActions m_actions; 1169 /+ Qt:: +/qt.core.namespace.DropAction m_dropAction; 1170 /+ Qt:: +/qt.core.namespace.DropAction m_defaultAction; 1171 const(QMimeData) m_data; 1172 mixin(CREATE_CONVENIENCE_WRAPPERS); 1173 } 1174 1175 1176 /// Binding for C++ class [QDragMoveEvent](https://doc.qt.io/qt-6/qdragmoveevent.html). 1177 class /+ Q_GUI_EXPORT +/ QDragMoveEvent : QDropEvent 1178 { 1179 /+ Q_EVENT_DISABLE_COPY(QDragMoveEvent) +/protected:/+ ; +/ 1180 this(const typeof(this) other) 1181 { 1182 super(other); 1183 this.tupleof = (cast(typeof(this))other).tupleof; 1184 } 1185 public: 1186 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 1187 this(ref const(QPoint) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data, 1188 /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, Type type = Type.DragMove); 1189 })); 1190 ~this(); 1191 1192 override QDragMoveEvent clone() const { 1193 import core.stdcpp.new_; 1194 return cpp_new!QDragMoveEvent(this); 1195 } 1196 1197 pragma(inline, true) final QRect answerRect() const { return m_rect; } 1198 1199 // pragma(inline, true) final void accept() { QDropEvent.accept(); } 1200 // pragma(inline, true) final void ignore() { QDropEvent.ignore(); } 1201 1202 /+ pragma(inline, true) final void accept(ref const(QRect) r) { accept(); m_rect = r; } 1203 pragma(inline, true) final void ignore(ref const(QRect) r) { ignore(); m_rect = r; }+/ 1204 1205 protected: 1206 QRect m_rect; 1207 mixin(CREATE_CONVENIENCE_WRAPPERS); 1208 } 1209 1210 1211 /// Binding for C++ class [QDragEnterEvent](https://doc.qt.io/qt-6/qdragenterevent.html). 1212 class /+ Q_GUI_EXPORT +/ QDragEnterEvent : QDragMoveEvent 1213 { 1214 /+ Q_EVENT_DISABLE_COPY(QDragEnterEvent) +/protected:/+ ; +/ 1215 public: 1216 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 1217 this(ref const(QPoint) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data, 1218 /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers); 1219 })); 1220 ~this(); 1221 mixin(CREATE_CONVENIENCE_WRAPPERS); 1222 } 1223 1224 1225 /// Binding for C++ class [QDragLeaveEvent](https://doc.qt.io/qt-6/qdragleaveevent.html). 1226 class /+ Q_GUI_EXPORT +/ QDragLeaveEvent : QEvent 1227 { 1228 /+ Q_EVENT_DISABLE_COPY(QDragLeaveEvent) +/protected:/+ ; +/ 1229 public: 1230 this(); 1231 ~this(); 1232 mixin(CREATE_CONVENIENCE_WRAPPERS); 1233 } 1234 /+ #endif +/ // QT_CONFIG(draganddrop) 1235 1236 1237 /// Binding for C++ class [QHelpEvent](https://doc.qt.io/qt-6/qhelpevent.html). 1238 class /+ Q_GUI_EXPORT +/ QHelpEvent : QEvent 1239 { 1240 /+ Q_EVENT_DISABLE_COPY(QHelpEvent) +/protected:/+ ; +/ 1241 this(const typeof(this) other) 1242 { 1243 super(other); 1244 this.tupleof = (cast(typeof(this))other).tupleof; 1245 } 1246 public: 1247 this(Type type, ref const(QPoint) pos, ref const(QPoint) globalPos); 1248 ~this(); 1249 1250 override QHelpEvent clone() const { 1251 import core.stdcpp.new_; 1252 return cpp_new!QHelpEvent(this); 1253 } 1254 1255 pragma(inline, true) final int x() const { return m_pos.x(); } 1256 pragma(inline, true) final int y() const { return m_pos.y(); } 1257 pragma(inline, true) final int globalX() const { return m_globalPos.x(); } 1258 pragma(inline, true) final int globalY() const { return m_globalPos.y(); } 1259 1260 pragma(inline, true) final ref const(QPoint) pos() const { return m_pos; } 1261 pragma(inline, true) final ref const(QPoint) globalPos() const { return m_globalPos; } 1262 1263 private: 1264 QPoint m_pos; 1265 QPoint m_globalPos; 1266 mixin(CREATE_CONVENIENCE_WRAPPERS); 1267 } 1268 1269 version(QT_NO_STATUSTIP){}else 1270 { 1271 /// Binding for C++ class [QStatusTipEvent](https://doc.qt.io/qt-6/qstatustipevent.html). 1272 class /+ Q_GUI_EXPORT +/ QStatusTipEvent : QEvent 1273 { 1274 /+ Q_EVENT_DISABLE_COPY(QStatusTipEvent) +/protected:/+ ; +/ 1275 this(const typeof(this) other) 1276 { 1277 super(other); 1278 this.tupleof = (cast(typeof(this))other).tupleof; 1279 } 1280 public: 1281 /+ explicit +/this(ref const(QString) tip); 1282 ~this(); 1283 1284 override QStatusTipEvent clone() const { 1285 import core.stdcpp.new_; 1286 return cpp_new!QStatusTipEvent(this); 1287 } 1288 1289 pragma(inline, true) final QString tip() /*const*/ { return m_tip; } 1290 private: 1291 QString m_tip; 1292 mixin(CREATE_CONVENIENCE_WRAPPERS); 1293 } 1294 } 1295 1296 /+ #if QT_CONFIG(whatsthis) +/ 1297 /// Binding for C++ class [QWhatsThisClickedEvent](https://doc.qt.io/qt-6/qwhatsthisclickedevent.html). 1298 class /+ Q_GUI_EXPORT +/ QWhatsThisClickedEvent : QEvent 1299 { 1300 /+ Q_EVENT_DISABLE_COPY(QWhatsThisClickedEvent) +/protected:/+ ; +/ 1301 this(const typeof(this) other) 1302 { 1303 super(other); 1304 this.tupleof = (cast(typeof(this))other).tupleof; 1305 } 1306 public: 1307 /+ explicit +/this(ref const(QString) href); 1308 ~this(); 1309 1310 override QWhatsThisClickedEvent clone() const { 1311 import core.stdcpp.new_; 1312 return cpp_new!QWhatsThisClickedEvent(this); 1313 } 1314 1315 pragma(inline, true) final QString href() /*const*/ { return m_href; } 1316 private: 1317 QString m_href; 1318 mixin(CREATE_CONVENIENCE_WRAPPERS); 1319 } 1320 /+ #endif 1321 1322 #if QT_CONFIG(action) +/ 1323 /// Binding for C++ class [QActionEvent](https://doc.qt.io/qt-6/qactionevent.html). 1324 class /+ Q_GUI_EXPORT +/ QActionEvent : QEvent 1325 { 1326 /+ Q_EVENT_DISABLE_COPY(QActionEvent) +/protected:/+ ; +/ 1327 this(const typeof(this) other) 1328 { 1329 super(other); 1330 this.tupleof = (cast(typeof(this))other).tupleof; 1331 } 1332 public: 1333 this(int type, QAction action, QAction before = null); 1334 ~this(); 1335 1336 override QActionEvent clone() const { 1337 import core.stdcpp.new_; 1338 return cpp_new!QActionEvent(this); 1339 } 1340 1341 pragma(inline, true) final QAction action() /*const*/ { return m_action; } 1342 pragma(inline, true) final QAction before() /*const*/ { return m_before; } 1343 private: 1344 QAction m_action; 1345 QAction m_before; 1346 mixin(CREATE_CONVENIENCE_WRAPPERS); 1347 } 1348 /+ #endif +/ // QT_CONFIG(action) 1349 1350 /// Binding for C++ class [QFileOpenEvent](https://doc.qt.io/qt-6/qfileopenevent.html). 1351 class /+ Q_GUI_EXPORT +/ QFileOpenEvent : QEvent 1352 { 1353 /+ Q_EVENT_DISABLE_COPY(QFileOpenEvent) +/protected:/+ ; +/ 1354 this(const typeof(this) other) 1355 { 1356 super(other); 1357 this.tupleof = (cast(typeof(this))other).tupleof; 1358 } 1359 public: 1360 /+ explicit +/this(ref const(QString) file); 1361 /+ explicit +/this(ref const(QUrl) url); 1362 ~this(); 1363 1364 override QFileOpenEvent clone() const { 1365 import core.stdcpp.new_; 1366 return cpp_new!QFileOpenEvent(this); 1367 } 1368 1369 pragma(inline, true) final QString file() /*const*/ { return m_file; } 1370 final QUrl url() const { return m_url; } 1371 // final bool openFile(QFile &file, QIODevice.OpenMode flags) const; 1372 private: 1373 QString m_file; 1374 QUrl m_url; 1375 mixin(CREATE_CONVENIENCE_WRAPPERS); 1376 } 1377 1378 version(QT_NO_TOOLBAR){}else 1379 { 1380 class /+ Q_GUI_EXPORT +/ QToolBarChangeEvent : QEvent 1381 { 1382 /+ Q_EVENT_DISABLE_COPY(QToolBarChangeEvent) +/protected:/+ ; +/ 1383 this(const typeof(this) other) 1384 { 1385 super(other); 1386 this.tupleof = (cast(typeof(this))other).tupleof; 1387 } 1388 public: 1389 /+ explicit +/this(bool t); 1390 ~this(); 1391 1392 override QToolBarChangeEvent clone() const { 1393 import core.stdcpp.new_; 1394 return cpp_new!QToolBarChangeEvent(this); 1395 } 1396 1397 pragma(inline, true) final bool toggle() const { return m_toggle; } 1398 private: 1399 bool m_toggle; 1400 mixin(CREATE_CONVENIENCE_WRAPPERS); 1401 } 1402 } 1403 1404 /+ #if QT_CONFIG(shortcut) +/ 1405 /// Binding for C++ class [QShortcutEvent](https://doc.qt.io/qt-6/qshortcutevent.html). 1406 class /+ Q_GUI_EXPORT +/ QShortcutEvent : QEvent 1407 { 1408 /+ Q_EVENT_DISABLE_COPY(QShortcutEvent) +/protected:/+ ; +/ 1409 this(const typeof(this) other) 1410 { 1411 super(other); 1412 this.tupleof = (cast(typeof(this))other).tupleof; 1413 } 1414 public: 1415 this(ref const(QKeySequence) key, int id, bool ambiguous = false); 1416 ~this(); 1417 1418 override QShortcutEvent clone() const { 1419 import core.stdcpp.new_; 1420 return cpp_new!QShortcutEvent(this); 1421 } 1422 1423 pragma(inline, true) final ref const(QKeySequence) key() const { return m_sequence; } 1424 pragma(inline, true) final int shortcutId() const { return m_shortcutId; } 1425 pragma(inline, true) final bool isAmbiguous() const { return m_ambiguous; } 1426 protected: 1427 QKeySequence m_sequence; 1428 int m_shortcutId; 1429 bool m_ambiguous; 1430 mixin(CREATE_CONVENIENCE_WRAPPERS); 1431 } 1432 /+ #endif +/ 1433 1434 /// Binding for C++ class [QWindowStateChangeEvent](https://doc.qt.io/qt-6/qwindowstatechangeevent.html). 1435 class /+ Q_GUI_EXPORT +/ QWindowStateChangeEvent: QEvent 1436 { 1437 /+ Q_EVENT_DISABLE_COPY(QWindowStateChangeEvent) +/protected:/+ ; +/ 1438 this(const typeof(this) other) 1439 { 1440 super(other); 1441 this.tupleof = (cast(typeof(this))other).tupleof; 1442 } 1443 public: 1444 /+ explicit +/this(/+ Qt:: +/qt.core.namespace.WindowStates oldState, bool isOverride = false); 1445 ~this(); 1446 1447 override QWindowStateChangeEvent clone() const { 1448 import core.stdcpp.new_; 1449 return cpp_new!QWindowStateChangeEvent(this); 1450 } 1451 1452 pragma(inline, true) final /+ Qt:: +/qt.core.namespace.WindowStates oldState() const { return m_oldStates; } 1453 final bool isOverride() const; 1454 1455 private: 1456 /+ Qt:: +/qt.core.namespace.WindowStates m_oldStates; 1457 bool m_override; 1458 mixin(CREATE_CONVENIENCE_WRAPPERS); 1459 } 1460 1461 /+ #ifndef QT_NO_DEBUG_STREAM 1462 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *); 1463 #endif +/ 1464 1465 /// Binding for C++ class [QTouchEvent](https://doc.qt.io/qt-6/qtouchevent.html). 1466 class /+ Q_GUI_EXPORT +/ QTouchEvent : QPointerEvent 1467 { 1468 /+ Q_EVENT_DISABLE_COPY(QTouchEvent) +/protected:/+ ; +/ 1469 this(const typeof(this) other) 1470 { 1471 super(other); 1472 this.tupleof = (cast(typeof(this))other).tupleof; 1473 } 1474 public: 1475 alias TouchPoint = QEventPoint; // source compat 1476 1477 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 1478 /+ explicit +/this(QEvent.Type eventType, 1479 const(QPointingDevice) device = null, 1480 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier, 1481 ref const(QList!(QEventPoint)) touchPoints = globalInitVar!(QList!(QEventPoint))); 1482 })); 1483 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 1484 mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{ 1485 /+ QT_DEPRECATED_VERSION_X_6_0("Use another constructor") +/ 1486 /+ explicit +/this(QEvent.Type eventType, 1487 const(QPointingDevice) device, 1488 /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, 1489 QEventPoint.States touchPointStates, 1490 ref const(QList!(QEventPoint)) touchPoints = globalInitVar!(QList!(QEventPoint))); 1491 })); 1492 /+ #endif +/ 1493 ~this(); 1494 1495 override QTouchEvent clone() const { 1496 import core.stdcpp.new_; 1497 return cpp_new!QTouchEvent(this); 1498 } 1499 1500 pragma(inline, true) final QObject target() /*const*/ { return m_target; } 1501 pragma(inline, true) final QEventPoint.States touchPointStates() const { return m_touchPointStates; } 1502 /+ #if QT_DEPRECATED_SINCE(6, 0) +/ 1503 /+ QT_DEPRECATED_VERSION_X_6_0("Use points()") +/ 1504 final ref const(QList!(QEventPoint)) touchPoints() const { return points(); } 1505 /+ #endif +/ 1506 override bool isBeginEvent() const; 1507 override bool isUpdateEvent() const; 1508 override bool isEndEvent() const; 1509 1510 protected: 1511 QObject m_target = null; 1512 QEventPoint.States m_touchPointStates = QEventPoint.State.Unknown; 1513 /+ quint32 m_reserved : 24; +/ 1514 uint bitfieldData_m_reserved; 1515 quint32 m_reserved() const 1516 { 1517 return (bitfieldData_m_reserved >> 0) & 0xffffff; 1518 } 1519 quint32 m_reserved(quint32 value) 1520 { 1521 bitfieldData_m_reserved = (bitfieldData_m_reserved & ~0xffffff) | ((value & 0xffffff) << 0); 1522 return value; 1523 } 1524 mixin(CREATE_CONVENIENCE_WRAPPERS); 1525 } 1526 1527 /// Binding for C++ class [QScrollPrepareEvent](https://doc.qt.io/qt-6/qscrollprepareevent.html). 1528 class /+ Q_GUI_EXPORT +/ QScrollPrepareEvent : QEvent 1529 { 1530 /+ Q_EVENT_DISABLE_COPY(QScrollPrepareEvent) +/protected:/+ ; +/ 1531 this(const typeof(this) other) 1532 { 1533 super(other); 1534 this.tupleof = (cast(typeof(this))other).tupleof; 1535 } 1536 public: 1537 /+ explicit +/this(ref const(QPointF) startPos); 1538 ~this(); 1539 1540 override QScrollPrepareEvent clone() const { 1541 import core.stdcpp.new_; 1542 return cpp_new!QScrollPrepareEvent(this); 1543 } 1544 1545 final QPointF startPos() const { return m_startPos; } 1546 1547 final QSizeF viewportSize() const { return m_viewportSize; } 1548 final QRectF contentPosRange() const { return m_contentPosRange; } 1549 final QPointF contentPos() const { return m_contentPos; } 1550 1551 final void setViewportSize(ref const(QSizeF) size); 1552 final void setContentPosRange(ref const(QRectF) rect); 1553 final void setContentPos(ref const(QPointF) pos); 1554 1555 private: 1556 QRectF m_contentPosRange; 1557 QSizeF m_viewportSize; 1558 QPointF m_startPos; 1559 QPointF m_contentPos; 1560 mixin(CREATE_CONVENIENCE_WRAPPERS); 1561 } 1562 1563 1564 /// Binding for C++ class [QScrollEvent](https://doc.qt.io/qt-6/qscrollevent.html). 1565 class /+ Q_GUI_EXPORT +/ QScrollEvent : QEvent 1566 { 1567 /+ Q_EVENT_DISABLE_COPY(QScrollEvent) +/protected:/+ ; +/ 1568 this(const typeof(this) other) 1569 { 1570 super(other); 1571 this.tupleof = (cast(typeof(this))other).tupleof; 1572 } 1573 public: 1574 enum ScrollState 1575 { 1576 ScrollStarted, 1577 ScrollUpdated, 1578 ScrollFinished 1579 } 1580 1581 this(ref const(QPointF) contentPos, ref const(QPointF) overshoot, ScrollState scrollState); 1582 ~this(); 1583 1584 override QScrollEvent clone() const { 1585 import core.stdcpp.new_; 1586 return cpp_new!QScrollEvent(this); 1587 } 1588 1589 final QPointF contentPos() const { return m_contentPos; } 1590 final QPointF overshootDistance() const { return m_overshoot; } 1591 final ScrollState scrollState() const { return m_state; } 1592 1593 private: 1594 QPointF m_contentPos; 1595 QPointF m_overshoot; 1596 ScrollState m_state; 1597 mixin(CREATE_CONVENIENCE_WRAPPERS); 1598 } 1599 1600 class /+ Q_GUI_EXPORT +/ QScreenOrientationChangeEvent : QEvent 1601 { 1602 /+ Q_EVENT_DISABLE_COPY(QScreenOrientationChangeEvent) +/protected:/+ ; +/ 1603 this(const typeof(this) other) 1604 { 1605 super(other); 1606 this.tupleof = (cast(typeof(this))other).tupleof; 1607 } 1608 public: 1609 this(QScreen screen, /+ Qt:: +/qt.core.namespace.ScreenOrientation orientation); 1610 ~this(); 1611 1612 override QScreenOrientationChangeEvent clone() const { 1613 import core.stdcpp.new_; 1614 return cpp_new!QScreenOrientationChangeEvent(this); 1615 } 1616 1617 final QScreen screen() /*const*/ { return m_screen; } 1618 final /+ Qt:: +/qt.core.namespace.ScreenOrientation orientation() const { return m_orientation; } 1619 1620 private: 1621 QScreen m_screen; 1622 /+ Qt:: +/qt.core.namespace.ScreenOrientation m_orientation; 1623 mixin(CREATE_CONVENIENCE_WRAPPERS); 1624 } 1625 1626 class /+ Q_GUI_EXPORT +/ QApplicationStateChangeEvent : QEvent 1627 { 1628 /+ Q_EVENT_DISABLE_COPY(QApplicationStateChangeEvent) +/protected:/+ ; +/ 1629 this(const typeof(this) other) 1630 { 1631 super(other); 1632 this.tupleof = (cast(typeof(this))other).tupleof; 1633 } 1634 public: 1635 /+ explicit +/this(/+ Qt:: +/qt.core.namespace.ApplicationState state); 1636 1637 override QApplicationStateChangeEvent clone() const { 1638 import core.stdcpp.new_; 1639 return cpp_new!QApplicationStateChangeEvent(this); 1640 } 1641 1642 final /+ Qt:: +/qt.core.namespace.ApplicationState applicationState() const { return m_applicationState; } 1643 1644 private: 1645 /+ Qt:: +/qt.core.namespace.ApplicationState m_applicationState; 1646 mixin(CREATE_CONVENIENCE_WRAPPERS); 1647 } 1648 version(QT_NO_INPUTMETHOD) 1649 { 1650 extern(C++, class) struct QInputMethodQueryEvent; 1651 } 1652 1653 version(QT_NO_CONTEXTMENU) 1654 { 1655 class QContextMenuEvent; 1656 } 1657 1658 version(QT_NO_INPUTMETHOD) 1659 { 1660 class QInputMethodEvent; 1661 } 1662 1663