/*
* Copyright (C) 2015 Canonical, Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "MirSurface.h"
#include
MirSurface::MirSurface(const QString& name,
Mir::Type type,
Mir::State state,
const QUrl& screenshot,
const QUrl &qmlFilePath)
: unity::shell::application::MirSurfaceInterface(nullptr)
, m_name(name)
, m_type(type)
, m_state(state)
, m_orientationAngle(Mir::Angle0)
, m_screenshotUrl(screenshot)
, m_qmlFilePath(qmlFilePath)
, m_live(true)
, m_visible(true)
, m_activeFocus(false)
, m_width(-1)
, m_height(-1)
{
// qDebug() << "MirSurface::MirSurface() " << name;
}
MirSurface::~MirSurface()
{
// qDebug() << "MirSurface::~MirSurface() " << name();
}
QString MirSurface::name() const
{
return m_name;
}
Mir::Type MirSurface::type() const
{
return m_type;
}
Mir::State MirSurface::state() const
{
return m_state;
}
void MirSurface::setState(Mir::State state)
{
if (state == m_state)
return;
m_state = state;
Q_EMIT stateChanged(state);
}
bool MirSurface::live() const
{
return m_live;
}
bool MirSurface::visible() const
{
return m_visible;
}
void MirSurface::setLive(bool live)
{
// qDebug().nospace() << "MirSurface::setLive("<