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 const QUrl& screenshot);
55 void notifySurfaceCreated(unity::shell::application::MirSurfaceInterface *);
57 int newSurfaceMinimumWidth() const { return m_newSurfaceMinimumWidth; }
58 void setNewSurfaceMinimumWidth(int value);
60 int newSurfaceMaximumWidth() const { return m_newSurfaceMaximumWidth; }
61 void setNewSurfaceMaximumWidth(int value);
63 int newSurfaceMinimumHeight() const { return m_newSurfaceMinimumHeight; }
64 void setNewSurfaceMinimumHeight(int value);
66 int newSurfaceMaximumHeight() const { return m_newSurfaceMaximumHeight; }
67 void setNewSurfaceMaximumHeight(int value);
69 int newSurfaceWidthIncrement() const { return m_newSurfaceWidthIncrement; }
70 void setNewSurfaceWidthIncrement(int);
72 int newSurfaceHeightIncrement() const { return m_newSurfaceHeightIncrement; }
73 void setNewSurfaceHeightIncrement(int);
76 void createInputMethodSurface();
79 void surfaceDestroyed(const QString& persistentSurfaceId);
81 void newSurfaceMinimumWidthChanged(int value);
82 void newSurfaceMaximumWidthChanged(int value);
83 void newSurfaceMinimumHeightChanged(int value);
84 void newSurfaceMaximumHeightChanged(int value);
85 void newSurfaceWidthIncrementChanged(int value);
86 void newSurfaceHeightIncrementChanged(int value);
89 void onStateRequested(MirSurface *surface, Mir::State state);
90 void onSurfaceDestroyed(MirSurface *surface, const QString& persistentId);
93 void doRaise(unity::shell::application::MirSurfaceInterface *surface);
94 void focusFirstAvailableSurface();
95 void registerSurface(MirSurface *surface);
97 static SurfaceManager *m_instance;
99 int m_newSurfaceMinimumWidth{0};
100 int m_newSurfaceMaximumWidth{0};
101 int m_newSurfaceMinimumHeight{0};
102 int m_newSurfaceMaximumHeight{0};
103 int m_newSurfaceWidthIncrement{1};
104 int m_newSurfaceHeightIncrement{1};
106 MirSurface *m_focusedSurface{nullptr};
107 bool m_underModification{false};
109 QList<MirSurface*> m_surfaces;
111 VirtualKeyboard *m_virtualKeyboard{nullptr};
114#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