2 * Copyright (C) 2015 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#include "MirSurface.h"
21MirSurface::MirSurface(const QString& name,
24 const QUrl& screenshot,
25 const QString &qmlFilePath)
26 : unity::shell::application::MirSurfaceInterface(nullptr)
30 , m_orientationAngle(Mir::Angle0)
31 , m_screenshotUrl(screenshot)
32 , m_qmlFilePath(qmlFilePath)
35 , m_activeFocus(false)
39 qDebug() << "MirSurface::MirSurface() " << name;
42MirSurface::~MirSurface()
44 qDebug() << "MirSurface::~MirSurface() " << name();
47QString MirSurface::name() const
52Mir::Type MirSurface::type() const
57Mir::State MirSurface::state() const
62void MirSurface::setState(Mir::State state)
68 Q_EMIT stateChanged(state);
71bool MirSurface::live() const
76void MirSurface::setLive(bool live)
78 qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
83 Q_EMIT liveChanged(live);
85 if (!m_live && m_viewCount == 0) {
90QString MirSurface::qmlFilePath() const
95QUrl MirSurface::screenshotUrl() const
97 return m_screenshotUrl;
100void MirSurface::setScreenshotUrl(QUrl screenshotUrl)
102 if (screenshotUrl == m_screenshotUrl)
105 m_screenshotUrl = screenshotUrl;
106 Q_EMIT screenshotUrlChanged(screenshotUrl);
109Mir::OrientationAngle MirSurface::orientationAngle() const
111 return m_orientationAngle;
114void MirSurface::setOrientationAngle(Mir::OrientationAngle angle)
116 if (angle == m_orientationAngle)
119 m_orientationAngle = angle;
120 Q_EMIT orientationAngleChanged(angle);
123void MirSurface::incrementViewCount()
126 qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
129void MirSurface::decrementViewCount()
132 qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
134 Q_ASSERT(m_viewCount >= 0);
136 if (!m_live && m_viewCount == 0) {
141int MirSurface::viewCount() const
146bool MirSurface::activeFocus() const
148 return m_activeFocus;
151void MirSurface::setActiveFocus(bool value)
153 if (m_activeFocus == value)
156 m_activeFocus = value;
158 Q_EMIT activeFocusChanged(value);
161int MirSurface::width() const
166int MirSurface::height() const
171void MirSurface::resize(int width, int height)
173 if (width != m_width) {
175 Q_EMIT widthChanged();
178 if (m_height != height) {
180 Q_EMIT heightChanged();
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