on 3a0ec61 help sign in
71 lines 1.7 kB history raw
1#ifndef SCREEN_H
2#define SCREEN_H
4#include <qtmir/screen.h>
5#include <QScopedPointer>
6#include <QPointer>
8#include "WorkspaceModel.h"
10class ScreenProxy;
12class Screen : public qtmir::Screen
14 Q_OBJECT
15 Q_PROPERTY(WorkspaceModel* workspaces READ workspaces CONSTANT)
17public:
18 explicit Screen(qtmir::Screen*const wrapped);
20 qtmir::OutputId outputId() const override;
21 bool used() const override;
22 QString name() const override;
23 float scale() const override;
24 QSizeF physicalSize() const override;
25 qtmir::FormFactor formFactor() const override;
26 qtmir::OutputTypes outputType() const override;
27 MirPowerMode powerMode() const override;
28 Qt::ScreenOrientation orientation() const override;
29 QPoint position() const override;
30 QQmlListProperty<qtmir::ScreenMode> availableModes() override;
31 uint currentModeIndex() const override;
32 bool isActive() const override;
33 void setActive(bool active) override;
35 QScreen* qscreen() const override;
37 qtmir::ScreenConfiguration *beginConfiguration() const override;
38 bool applyConfiguration(qtmir::ScreenConfiguration *configuration) override;
40 qtmir::Screen* wrapped() const { return m_wrapped; }
42 WorkspaceModel* workspaces() const;
44 void sync(Screen* proxy);
46public Q_SLOTS:
47 void activate();
49protected:
50 Screen(Screen const& other);
52 qtmir::Screen*const m_wrapped;
53 const QScopedPointer<WorkspaceModel> m_workspaces;
54};
56class ScreenProxy : public Screen
58 Q_OBJECT
59public:
60 explicit ScreenProxy(Screen*const screen);
62 Screen* proxyObject() const { return m_original.data(); }
64public Q_SLOTS:
65 void addWorkspace();
67private:
68 const QPointer<Screen> m_original;
69};
71#endif // SCREEN_H