summaryrefslogtreecommitdiffstats
path: root/src/window-lib/inprocesswindow.h
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@luxoft.com>2018-06-13 11:56:34 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2018-06-20 12:45:25 +0000
commitdde2efadab501cecc62f37cb383c3181411a0a10 (patch)
tree45d33a7480af35eaf902d52b7d626d95d3808f6a /src/window-lib/inprocesswindow.h
parentc33232dd79431b4c0e7497e0135e49ed98bb63b5 (diff)
Refactor and improve single-process mode (QML inprocess)
* Remove duplicated code around window property getters and setters * Clarify ownership of InProcessSurfaceItem * Make the single-process API closer to the multi-process one - FakeApplicationManagerWindow now inherits from QObject instead of QQuickItem - It's now possible to animate the disappearance of a window in single-process mode (when client sets its visible property to false) Change-Id: Ic0ba80f20da66c5f3d674f83853ec59226c4fc0c Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/window-lib/inprocesswindow.h')
-rw-r--r--src/window-lib/inprocesswindow.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/window-lib/inprocesswindow.h b/src/window-lib/inprocesswindow.h
index 75991a82..09bd4f3f 100644
--- a/src/window-lib/inprocesswindow.h
+++ b/src/window-lib/inprocesswindow.h
@@ -46,6 +46,7 @@
#include <QScopedPointer>
#include <QtAppManWindow/window.h>
+#include <QtAppManManager/inprocesssurfaceitem.h>
QT_BEGIN_NAMESPACE_AM
@@ -54,8 +55,7 @@ class InProcessWindow : public Window
Q_OBJECT
public:
- InProcessWindow(AbstractApplication *app, QQuickItem *windowItem);
- ~InProcessWindow();
+ InProcessWindow(AbstractApplication *app, const QSharedPointer<InProcessSurfaceItem> &surfaceItem);
bool isInProcess() const override { return true; }
@@ -66,19 +66,19 @@ public:
ContentState contentState() const override { return m_contentState; }
QSize size() const override;
- QQuickItem *rootItem() const { return m_rootItem.data(); }
+ InProcessSurfaceItem *rootItem() const { return m_surfaceItem.data(); }
+ QSharedPointer<InProcessSurfaceItem> surfaceItem() { return m_surfaceItem; }
// The content state is wholly emulated as there's no actual surface behind this window
// So we let it be set at will (likely by WindowManager)
void setContentState(ContentState);
-protected:
- bool eventFilter(QObject *o, QEvent *e) override;
+private slots:
+ void onVisibleClientSideChanged();
private:
ContentState m_contentState = SurfaceWithContent;
- QSharedPointer<QObject> m_windowProperties;
- QPointer<QQuickItem> m_rootItem;
+ QSharedPointer<InProcessSurfaceItem> m_surfaceItem;
};
QT_END_NAMESPACE_AM