on e174ec3 help sign in
unity8/plugins/WindowManager/ScreenAttached.h
55 lines 1.5 kB history raw
1/*
2 * Copyright (C) 2017 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef SCREENATTACHED_H
18#define SCREENATTACHED_H
20#include "Screen.h"
22#include <QQmlEngine>
24class QQuickWindow;
26class ScreenAttached : public ScreenInterface
28 Q_OBJECT
29public:
30 ScreenAttached(QObject* owner);
32 WorkspaceModel* workspaces() const override;
33 Workspace *currentWorkspace() const override;
34 void setCurrentWorkspace(Workspace* workspace) override;
36private Q_SLOTS:
37 void windowChanged(QQuickWindow*);
38 void screenChanged(QScreen*);
39 void screenChanged2(ScreenInterface* screen);
41private:
42 QPointer<ScreenInterface> m_screen;
43 QQuickWindow* m_window;
44};
46class WMScreen : public QObject
48 Q_OBJECT
49public:
50 static ScreenAttached *qmlAttachedProperties(QObject *owner);
51};
53QML_DECLARE_TYPEINFO(WMScreen, QML_HAS_ATTACHED_PROPERTIES)
55#endif // SCREENATTACHED_H