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)
34 , m_visibility(Mir::Exposed)
36 , m_activeFocus(false)
40 qDebug() << "MirSurface::MirSurface() " << name;
43MirSurface::~MirSurface()
45 qDebug() << "MirSurface::~MirSurface() " << name();
48QString MirSurface::name() const
53Mir::Type MirSurface::type() const
58Mir::State MirSurface::state() const
63void MirSurface::setState(Mir::State state)
69 Q_EMIT stateChanged(state);
72bool MirSurface::live() const
77Mir::Visibility MirSurface::visibility() const
82void MirSurface::setLive(bool live)
84 qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
89 Q_EMIT liveChanged(live);
91 if (!m_live && m_viewCount == 0) {
96QString MirSurface::qmlFilePath() const
101QUrl MirSurface::screenshotUrl() const
103 return m_screenshotUrl;
106void MirSurface::setScreenshotUrl(QUrl screenshotUrl)
108 if (screenshotUrl == m_screenshotUrl)
111 m_screenshotUrl = screenshotUrl;
112 Q_EMIT screenshotUrlChanged(screenshotUrl);
115Mir::OrientationAngle MirSurface::orientationAngle() const
117 return m_orientationAngle;
120void MirSurface::setOrientationAngle(Mir::OrientationAngle angle)
122 if (angle == m_orientationAngle)
125 m_orientationAngle = angle;
126 Q_EMIT orientationAngleChanged(angle);
129void MirSurface::incrementViewCount()
132 qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
135void MirSurface::decrementViewCount()
138 qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
140 Q_ASSERT(m_viewCount >= 0);
142 if (!m_live && m_viewCount == 0) {
147int MirSurface::viewCount() const
152bool MirSurface::activeFocus() const
154 return m_activeFocus;
157void MirSurface::setActiveFocus(bool value)
159 if (m_activeFocus == value)
162 m_activeFocus = value;
164 Q_EMIT activeFocusChanged(value);
167void MirSurface::setVisibility(Mir::Visibility visibility)
169 qDebug() << "MirSurface::setVisibility(visibility=" << visibility << ")";
171 if (m_visibility == visibility)
174 m_visibility = visibility;
176 Q_EMIT visibilityChanged(m_visibility);
179int MirSurface::width() const
184int MirSurface::height() const
189void MirSurface::resize(int width, int height)
191 if (width != m_width) {
193 Q_EMIT widthChanged();
196 if (m_height != height) {
198 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