abstractinterface was renamed to abstractwindowinterface and cleaned

AbstractWindowInterface will hide windows details.
pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago committed by Michail Vourlakos
parent 1e733ee828
commit 08bfa47709

@ -14,8 +14,9 @@ include(KDEPackageAppTemplates)
set(lattedock-app_SRCS
../liblattedock/dock.cpp
abstractinterface.cpp
abstractwindowinterface.cpp
xwindowinterface.cpp
windowinfowrap.cpp
visibilitymanager.cpp
nowdockconfigview.cpp
nowdockview.cpp

@ -1,42 +0,0 @@
#include "abstractinterface.h"
#include <QObject>
#include <QQuickWindow>
namespace NowDock {
AbstractInterface::AbstractInterface(QQuickWindow *dock) :
QObject(dock),
m_isDockWindowType(false),
m_dockNumber(0)
{
m_dockWindow = dock;
}
void AbstractInterface::setDockNumber(unsigned int no)
{
if (m_dockNumber == no) {
return;
}
m_dockNumber = no;
emit dockNumberChanged(m_dockNumber);
}
unsigned int AbstractInterface::dockNumber() const
{
return m_dockNumber;
}
void AbstractInterface::setMaskArea(QRect area)
{
if (m_maskArea == area) {
return;
}
m_maskArea = area;
}
}

@ -1,56 +0,0 @@
#ifndef ABSTRACTINTERFACE_H
#define ABSTRACTINTERFACE_H
#include <QObject>
#include <QQuickWindow>
namespace NowDock {
class AbstractInterface : public QObject {
Q_OBJECT
public:
explicit AbstractInterface(QQuickWindow *dock);
virtual bool activeIsDialog() const = 0;
virtual bool activeIsMaximized() const = 0;
virtual bool desktopIsActive() const = 0;
virtual bool dockIntersectsActiveWindow() const = 0;
virtual bool dockIsCovered(bool totally = false) const = 0;
virtual bool dockIsCovering() const = 0;
virtual bool dockIsOnTop() const = 0;
virtual bool dockInNormalState() const = 0;
virtual bool dockIsBelow() const = 0;
//FIXME: This may not be needed, it would be better to investigate in KWindowSystem
//its behavior when setting the window type to NET::Dock
virtual void setDockDefaultFlags(bool dock = false) = 0;
virtual void setDockToAllDesktops() = 0;
virtual void showDockAsNormal() = 0;
virtual void showDockOnBottom() = 0;
virtual void showDockOnTop() = 0;
void setDockNumber(unsigned int no);
unsigned int dockNumber() const;
void setMaskArea(QRect area);
Q_SIGNALS:
void activeWindowChanged();
void dockNumberChanged(unsigned int no);
void windowInAttention(bool);
//FIXME: there is a chance that this signal is not needed at all
void windowChanged();
protected:
bool m_isDockWindowType;
int m_dockNumber;
QRect m_maskArea;
QQuickWindow *m_dockWindow;
};
}
#endif

@ -0,0 +1,21 @@
#include "abstractwindowinterface.h"
#include <QObject>
#include <QQuickWindow>
namespace Latte {
AbstractWindowInterface::AbstractWindowInterface(QQuickWindow *const view, QObject *parent)
: QObject(parent), m_view(view)
{
}
AbstractWindowInterface::~AbstractWindowInterface()
{
}
}

@ -0,0 +1,44 @@
#ifndef ABSTRACTWINDOWINTERFACE_H
#define ABSTRACTWINDOWINTERFACE_H
#include "windowinfowrap.h"
#include "../liblattedock/dock.h"
#include <unordered_map>
#include <memory>
#include <list>
#include <QObject>
#include <QQuickWindow>
namespace Latte {
class AbstractWindowInterface : public QObject {
Q_OBJECT
public:
explicit AbstractWindowInterface(QQuickWindow *const view, QObject *parent = nullptr);
virtual ~AbstractWindowInterface();
virtual void setDockDefaultFlags() = 0;
virtual WId activeWindow() const = 0;
virtual WindowInfoWrap requestInfo(WId wid) = 0;
virtual WindowInfoWrap requestInfoActive() = 0;
virtual const std::list<WId> &windows() = 0;
signals:
void activeWindowChanged(WId wid);
void windowChanged(const WindowInfoWrap &winfo);
void windowAdded(WId wid);
void windowRemoved(WId wid);
void currentDesktopChanged(int desktop);
protected:
QQuickWindow *const m_view;
std::list<WId> m_windows;
};
}
#endif // ABSTRACTWINDOWINTERFACE_H
Loading…
Cancel
Save