2 * Copyright (C) 2014-2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef SURFACEMANAGER_H
18#define SURFACEMANAGER_H
22#include <unity/shell/application/SurfaceManagerInterface.h>
24#include "MirSurface.h"
25#include "VirtualKeyboard.h"
29class SurfaceManager : public unity::shell::application::SurfaceManagerInterface
32 Q_PROPERTY(int newSurfaceMinimumWidth READ newSurfaceMinimumWidth WRITE setNewSurfaceMinimumWidth NOTIFY newSurfaceMinimumWidthChanged)
33 Q_PROPERTY(int newSurfaceMaximumWidth READ newSurfaceMaximumWidth WRITE setNewSurfaceMaximumWidth NOTIFY newSurfaceMaximumWidthChanged)
34 Q_PROPERTY(int newSurfaceMinimumHeight READ newSurfaceMinimumHeight WRITE setNewSurfaceMinimumHeight NOTIFY newSurfaceMinimumHeightChanged)
35 Q_PROPERTY(int newSurfaceMaximumHeight READ newSurfaceMaximumHeight WRITE setNewSurfaceMaximumHeight NOTIFY newSurfaceMaximumHeightChanged)
36 Q_PROPERTY(int newSurfaceWidthIncrement READ newSurfaceWidthIncrement WRITE setNewSurfaceWidthIncrement NOTIFY newSurfaceWidthIncrementChanged)
37 Q_PROPERTY(int newSurfaceHeightIncrement READ newSurfaceHeightIncrement WRITE setNewSurfaceHeightIncrement NOTIFY newSurfaceHeightIncrementChanged)
40 explicit SurfaceManager(QObject *parent = 0);
41 virtual ~SurfaceManager();
43 static SurfaceManager *instance();
45 // SurfaceManagerInterface
46 void raise(unity::shell::application::MirSurfaceInterface *surface) override;
47 void activate(unity::shell::application::MirSurfaceInterface *surface) override;
49 Q_INVOKABLE MirSurface* createSurface(const QString& name,
52 MirSurface *parentSurface,
53 const QUrl &screenshot,
54 const QUrl &qmlFilePath = QUrl());
57 void notifySurfaceCreated(unity::shell::application::MirSurfaceInterface *);
59 int newSurfaceMinimumWidth() const { return m_newSurfaceMinimumWidth; }
60 void setNewSurfaceMinimumWidth(int value);
62 int newSurfaceMaximumWidth() const { return m_newSurfaceMaximumWidth; }
63 void setNewSurfaceMaximumWidth(int value);
65 int newSurfaceMinimumHeight() const { return m_newSurfaceMinimumHeight; }
66 void setNewSurfaceMinimumHeight(int value);
68 int newSurfaceMaximumHeight() const { return m_newSurfaceMaximumHeight; }
69 void setNewSurfaceMaximumHeight(int value);
71 int newSurfaceWidthIncrement() const { return m_newSurfaceWidthIncrement; }
72 void setNewSurfaceWidthIncrement(int);
74 int newSurfaceHeightIncrement() const { return m_newSurfaceHeightIncrement; }
75 void setNewSurfaceHeightIncrement(int);
78 void createInputMethodSurface();
81 void surfaceDestroyed(const QString& persistentSurfaceId);
83 void newSurfaceMinimumWidthChanged(int value);
84 void newSurfaceMaximumWidthChanged(int value);
85 void newSurfaceMinimumHeightChanged(int value);
86 void newSurfaceMaximumHeightChanged(int value);
87 void newSurfaceWidthIncrementChanged(int value);
88 void newSurfaceHeightIncrementChanged(int value);
91 void onStateRequested(MirSurface *surface, Mir::State state);
92 void onSurfaceDestroyed(MirSurface *surface, const QString& persistentId);
95 void doRaise(unity::shell::application::MirSurfaceInterface *surface);
96 void focusFirstAvailableSurface();
97 void registerSurface(MirSurface *surface);
99 static SurfaceManager *m_instance;
101 int m_newSurfaceMinimumWidth{0};
102 int m_newSurfaceMaximumWidth{0};
103 int m_newSurfaceMinimumHeight{0};
104 int m_newSurfaceMaximumHeight{0};
105 int m_newSurfaceWidthIncrement{1};
106 int m_newSurfaceHeightIncrement{1};
108 MirSurface *m_focusedSurface{nullptr};
109 bool m_underModification{false};
111 QList<MirSurface*> m_surfaces;
113 VirtualKeyboard *m_virtualKeyboard{nullptr};
116#endif // SURFACEMANAGER_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list