2 * Copyright (C) 2013 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/>.
21#include <QQmlComponent>
27#include <unity/shell/application/ApplicationInfoInterface.h>
29// A pretty dumb file. Just a container for properties.
30// Implemented in C++ instead of QML just because of the enumerations
33using namespace unity::shell::application;
35class ApplicationInfo : public ApplicationInfoInterface {
38 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
39 Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged)
41 // Only exists in this fake implementation
43 // QML component used to represent its image/screenhot
44 Q_PROPERTY(QString imageQml READ imageQml WRITE setImageQml NOTIFY imageQmlChanged)
46 // QML component used to represent the application window
47 Q_PROPERTY(QString windowQml READ windowQml WRITE setWindowQml NOTIFY windowQmlChanged)
50 ApplicationInfo(QObject *parent = NULL);
51 ApplicationInfo(const QString &appId, QObject *parent = NULL);
53 #define IMPLEMENT_PROPERTY(name, Name, type) \
55 type name() const { return m_##name; } \
56 void set##Name(const type& value) \
58 if (m_##name != value) { \
60 qDebug() << "emitting changed" << this << Q_FUNC_INFO; \
61 Q_EMIT name##Changed(); \
65 void name##Changed(); \
69 IMPLEMENT_PROPERTY(appId, AppId, QString)
70 IMPLEMENT_PROPERTY(name, Name, QString)
71 IMPLEMENT_PROPERTY(comment, Comment, QString)
72 IMPLEMENT_PROPERTY(icon, Icon, QUrl)
73 IMPLEMENT_PROPERTY(stage, Stage, Stage)
74 IMPLEMENT_PROPERTY(state, State, State)
75 IMPLEMENT_PROPERTY(focused, Focused, bool)
76 IMPLEMENT_PROPERTY(fullscreen, Fullscreen, bool)
77 IMPLEMENT_PROPERTY(imageQml, ImageQml, QString)
78 IMPLEMENT_PROPERTY(windowQml, WindowQml, QString)
79 IMPLEMENT_PROPERTY(screenshot, Screenshot, QUrl)
81 #undef IMPLEMENT_PROPERTY
84 void showWindow(QQuickItem *parent);
88 void onWindowComponentStatusChanged(QQmlComponent::Status status);
91 void createWindowItem();
92 void doCreateWindowItem();
93 void createWindowComponent();
94 QQuickItem *m_windowItem;
95 QQmlComponent *m_windowComponent;
96 QQuickItem *m_parentItem;
99Q_DECLARE_METATYPE(ApplicationInfo*)
101#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