Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.h
Show All 18 Lines | |||||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_ABSTRACT_CLIENT_H | 20 | #ifndef KWIN_ABSTRACT_CLIENT_H | ||
21 | #define KWIN_ABSTRACT_CLIENT_H | 21 | #define KWIN_ABSTRACT_CLIENT_H | ||
22 | 22 | | |||
23 | #include "toplevel.h" | 23 | #include "toplevel.h" | ||
24 | #include "options.h" | 24 | #include "options.h" | ||
25 | #include "rules.h" | 25 | #include "rules.h" | ||
26 | #include "tabgroup.h" | 26 | #include "tabgroup.h" | ||
27 | #include "cursor.h" | ||||
27 | 28 | | |||
28 | #include <memory> | 29 | #include <memory> | ||
29 | 30 | | |||
30 | #include <QElapsedTimer> | 31 | #include <QElapsedTimer> | ||
31 | #include <QPointer> | 32 | #include <QPointer> | ||
32 | 33 | | |||
33 | namespace KWayland | 34 | namespace KWayland | ||
34 | { | 35 | { | ||
▲ Show 20 Lines • Show All 562 Lines • ▼ Show 20 Line(s) | 597 | bool isMove() const { | |||
597 | return isMoveResize() && moveResizePointerMode() == PositionCenter; | 598 | return isMoveResize() && moveResizePointerMode() == PositionCenter; | ||
598 | } | 599 | } | ||
599 | bool isResize() const { | 600 | bool isResize() const { | ||
600 | return isMoveResize() && moveResizePointerMode() != PositionCenter; | 601 | return isMoveResize() && moveResizePointerMode() != PositionCenter; | ||
601 | } | 602 | } | ||
602 | /** | 603 | /** | ||
603 | * Cursor shape for move/resize mode. | 604 | * Cursor shape for move/resize mode. | ||
604 | **/ | 605 | **/ | ||
605 | Qt::CursorShape cursor() const { | 606 | CursorShape cursor() const { | ||
606 | return m_moveResize.cursor; | 607 | return m_moveResize.cursor; | ||
607 | } | 608 | } | ||
608 | 609 | | |||
609 | virtual bool hasStrut() const; | 610 | virtual bool hasStrut() const; | ||
610 | 611 | | |||
611 | void setModal(bool modal); | 612 | void setModal(bool modal); | ||
612 | bool isModal() const; | 613 | bool isModal() const; | ||
613 | 614 | | |||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 724 | Q_SIGNALS: | |||
742 | void paletteChanged(const QPalette &p); | 743 | void paletteChanged(const QPalette &p); | ||
743 | void captionChanged(); | 744 | void captionChanged(); | ||
744 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | 745 | void clientMaximizedStateChanged(KWin::AbstractClient*, MaximizeMode); | ||
745 | void clientMaximizedStateChanged(KWin::AbstractClient* c, bool h, bool v); | 746 | void clientMaximizedStateChanged(KWin::AbstractClient* c, bool h, bool v); | ||
746 | void transientChanged(); | 747 | void transientChanged(); | ||
747 | void modalChanged(); | 748 | void modalChanged(); | ||
748 | void quickTileModeChanged(); | 749 | void quickTileModeChanged(); | ||
749 | void moveResizedChanged(); | 750 | void moveResizedChanged(); | ||
750 | void moveResizeCursorChanged(Qt::CursorShape); | 751 | void moveResizeCursorChanged(CursorShape); | ||
751 | void clientStartUserMovedResized(KWin::AbstractClient*); | 752 | void clientStartUserMovedResized(KWin::AbstractClient*); | ||
752 | void clientStepUserMovedResized(KWin::AbstractClient *, const QRect&); | 753 | void clientStepUserMovedResized(KWin::AbstractClient *, const QRect&); | ||
753 | void clientFinishUserMovedResized(KWin::AbstractClient*); | 754 | void clientFinishUserMovedResized(KWin::AbstractClient*); | ||
754 | void closeableChanged(bool); | 755 | void closeableChanged(bool); | ||
755 | void minimizeableChanged(bool); | 756 | void minimizeableChanged(bool); | ||
756 | void shadeableChanged(bool); | 757 | void shadeableChanged(bool); | ||
757 | void maximizeableChanged(bool); | 758 | void maximizeableChanged(bool); | ||
758 | void desktopFileNameChanged(); | 759 | void desktopFileNameChanged(); | ||
▲ Show 20 Lines • Show All 358 Lines • ▼ Show 20 Line(s) | 1117 | struct { | |||
1117 | bool enabled = false; | 1118 | bool enabled = false; | ||
1118 | bool unrestricted = false; | 1119 | bool unrestricted = false; | ||
1119 | QPoint offset; | 1120 | QPoint offset; | ||
1120 | QPoint invertedOffset; | 1121 | QPoint invertedOffset; | ||
1121 | QRect initialGeometry; | 1122 | QRect initialGeometry; | ||
1122 | QRect geometry; | 1123 | QRect geometry; | ||
1123 | Position pointer = PositionCenter; | 1124 | Position pointer = PositionCenter; | ||
1124 | bool buttonDown = false; | 1125 | bool buttonDown = false; | ||
1125 | Qt::CursorShape cursor = Qt::ArrowCursor; | 1126 | CursorShape cursor = Qt::ArrowCursor; | ||
romangg: Left is a class, right is an enum. How does this work? Uses an implicitly declared move… | |||||
graesslin: It's just implicit conversion. A neat implementation. | |||||
1126 | int startScreen = 0; | 1127 | int startScreen = 0; | ||
1127 | QTimer *delayedTimer = nullptr; | 1128 | QTimer *delayedTimer = nullptr; | ||
1128 | } m_moveResize; | 1129 | } m_moveResize; | ||
1129 | 1130 | | |||
1130 | struct { | 1131 | struct { | ||
1131 | KDecoration2::Decoration *decoration = nullptr; | 1132 | KDecoration2::Decoration *decoration = nullptr; | ||
1132 | QPointer<Decoration::DecoratedClientImpl> client; | 1133 | QPointer<Decoration::DecoratedClientImpl> client; | ||
1133 | QElapsedTimer doubleClickTimer; | 1134 | QElapsedTimer doubleClickTimer; | ||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |
Left is a class, right is an enum. How does this work? Uses an implicitly declared move operator? Does this then really do what you want it to do (i.e. write Qt::ArrowCursor to CursorShape::m_shape.