2 * Copyright (C) 2013-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/>.
25#include <unity/shell/application/ApplicationInfoInterface.h>
26#include <unity/shell/application/Mir.h>
28#include "MirSurfaceListModel.h"
34using namespace unity::shell::application;
36class ApplicationInfo : public ApplicationInfoInterface {
40 // FIXME: Remove those
41 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
43 // Only exists in this fake implementation
45 // whether the test code will explicitly control the creation of the application surface
46 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
48 Q_PROPERTY(QString screenshot READ screenshot CONSTANT)
51 ApplicationInfo(QObject *parent = nullptr);
52 ApplicationInfo(const QString &appId, QObject *parent = nullptr);
55 Q_INVOKABLE void createPromptSurface();
57 RequestedState requestedState() const override;
58 void setRequestedState(RequestedState) override;
60 void setIconId(const QString &iconId);
61 void setScreenshotId(const QString &screenshotId);
62 void setQmlFilename(const QString &);
64 void setAppId(const QString &value) { m_appId = value; }
65 QString appId() const override { return m_appId; }
67 void setName(const QString &value);
68 QString name() const override { return m_name; }
70 QString comment() const override { return QString(); }
72 QUrl icon() const override { return m_icon; }
74 Q_INVOKABLE void setState(State value);
75 State state() const override { return m_state; }
77 bool focused() const override;
79 QString splashTitle() const override { return QString(); }
80 QUrl splashImage() const override { return QUrl(); }
81 bool splashShowHeader() const override { return false; }
82 QColor splashColor() const override { return QColor(0,0,0,0); }
83 QColor splashColorHeader() const override { return QColor(0,0,0,0); }
84 QColor splashColorFooter() const override { return QColor(0,0,0,0); }
86 QString screenshot() const { return m_screenshotFileName; }
88 void setFullscreen(bool value);
89 bool fullscreen() const;
91 Qt::ScreenOrientations supportedOrientations() const override;
92 void setSupportedOrientations(Qt::ScreenOrientations orientations);
94 bool rotatesWindowContents() const override;
95 void setRotatesWindowContents(bool value);
97 bool manualSurfaceCreation() const { return m_manualSurfaceCreation; }
98 void setManualSurfaceCreation(bool value);
100 bool isTouchApp() const override;
101 void setIsTouchApp(bool isTouchApp); // only in mock
103 bool exemptFromLifecycle() const override;
104 void setExemptFromLifecycle(bool) override;
106 QSize initialSurfaceSize() const override;
107 void setInitialSurfaceSize(const QSize &size) override;
109 Q_INVOKABLE void setShellChrome(Mir::ShellChrome shellChrome);
111 MirSurfaceListInterface* surfaceList() const override { return m_surfaceList; }
112 MirSurfaceListInterface* promptSurfaceList() const override { return m_promptSurfaceList; }
113 int surfaceCount() const override { return m_surfaceList->count(); }
116 // internal mock stuff
117 void close() override;
121 void fullscreenChanged(bool value);
122 void manualSurfaceCreationChanged(bool value);
126 Q_INVOKABLE void createSurface();
129 void onSurfaceCountChanged();
132 void setIcon(const QUrl &value);
134 QString m_screenshotFileName;
139 State m_state{Stopped};
140 bool m_fullscreen{false};
141 Qt::ScreenOrientations m_supportedOrientations{Qt::PortraitOrientation |
142 Qt::LandscapeOrientation |
143 Qt::InvertedPortraitOrientation |
144 Qt::InvertedLandscapeOrientation};
145 bool m_rotatesWindowContents{false};
146 RequestedState m_requestedState{RequestedRunning};
147 bool m_isTouchApp{true};
148 bool m_exemptFromLifecycle{false};
149 QSize m_initialSurfaceSize;
150 MirSurfaceListModel *m_surfaceList;
151 MirSurfaceListModel *m_promptSurfaceList;
152 int m_liveSurfaceCount{0};
153 QTimer m_surfaceCreationTimer;
154 QList<MirSurface*> m_closingSurfaces;
155 bool m_manualSurfaceCreation{false};
156 Mir::ShellChrome m_shellChrome{Mir::NormalChrome};
160Q_DECLARE_METATYPE(ApplicationInfo*)
162#endif // APPLICATION_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