17 #ifndef UNITY_WINDOW_H 18 #define UNITY_WINDOW_H 20 #include <QLoggingCategory> 25 #include <unity/shell/application/Mir.h> 29 namespace application {
30 class MirSurfaceInterface;
36 Q_DECLARE_LOGGING_CATEGORY(UNITY_WINDOW)
53 Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
58 Q_PROPERTY(QPoint requestedPosition READ requestedPosition WRITE setRequestedPosition NOTIFY requestedPositionChanged)
63 Q_PROPERTY(Mir::State state READ state NOTIFY stateChanged)
70 Q_PROPERTY(
bool focused READ focused NOTIFY focusedChanged)
77 Q_PROPERTY(
bool confinesMousePointer READ confinesMousePointer NOTIFY confinesMousePointerChanged)
83 Q_PROPERTY(
int id READ
id CONSTANT)
91 Q_PROPERTY(
unity::shell::application::MirSurfaceInterface* surface READ surface NOTIFY surfaceChanged)
94 Window(
int id, QObject *parent =
nullptr);
96 QPoint position() const;
97 QPoint requestedPosition() const;
98 void setRequestedPosition(const QPoint &);
99 Mir::State state() const;
100 bool focused() const;
101 bool confinesMousePointer() const;
103 unity::shell::application::MirSurfaceInterface* surface() const;
105 void setSurface(
unity::shell::application::MirSurfaceInterface *surface);
106 void setFocused(
bool value);
108 QString toString() const;
114 void requestState(Mir::State state);
128 void closeRequested();
129 void emptyWindowActivated();
131 void positionChanged(QPoint position);
132 void requestedPositionChanged(QPoint position);
133 void stateChanged(Mir::State value);
134 void focusedChanged(
bool value);
135 void confinesMousePointerChanged(
bool value);
136 void surfaceChanged(
unity::shell::application::MirSurfaceInterface *surface);
141 void focusRequested();
144 void updatePosition();
146 void updateFocused();
149 QPoint m_requestedPosition;
150 bool m_positionRequested{
false};
151 bool m_focused{
false};
153 Mir::State m_state{Mir::RestoredState};
154 bool m_stateRequested{
false};
155 unity::shell::application::MirSurfaceInterface *m_surface{
nullptr};
158 QDebug operator<<(QDebug dbg,
const Window *window);
160 Q_DECLARE_METATYPE(
Window*)
161 #endif // UNITY_WINDOW_H A slightly higher concept than MirSurface.