wrapper for window information.

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago
parent d04296fd8b
commit 472db165c4

@ -0,0 +1,130 @@
#include "windowinfowrap.h"
using namespace Latte;
WindowInfoWrap::WindowInfoWrap()
: m_isValid(false)
, m_isActive(false)
, m_isMinimized(false)
, m_isMaximized(false)
, m_isFullscreen(false)
, m_isOnCurrentDesktop(false)
, m_wid(0)
{
}
WindowInfoWrap::WindowInfoWrap(const WindowInfoWrap &other)
{
*this = other;
}
WindowInfoWrap &WindowInfoWrap::operator=(const WindowInfoWrap &rhs)
{
m_isValid = rhs.m_isValid;
m_isActive = rhs.m_isActive;
m_isMinimized = rhs.m_isMinimized;
m_isMaximized = rhs.m_isMaximized;
m_isFullscreen = rhs.m_isFullscreen;
m_isOnCurrentDesktop = rhs.m_isOnCurrentDesktop;
m_geometry = rhs.m_geometry;
m_wid = rhs.m_wid;
return *this;
}
inline bool WindowInfoWrap::operator==(const WindowInfoWrap &rhs) const
{
return m_wid == rhs.m_wid;
}
inline bool WindowInfoWrap::operator<(const WindowInfoWrap &rhs) const
{
return m_wid < rhs.m_wid;
}
inline bool WindowInfoWrap::operator>(const WindowInfoWrap &rhs) const
{
return m_wid > rhs.m_wid;
}
inline bool WindowInfoWrap::isValid() const
{
return m_isValid;
}
inline void WindowInfoWrap::setIsValid(bool isValid)
{
m_isValid = isValid;
}
inline bool WindowInfoWrap::isActive() const
{
return m_isActive;
}
inline void WindowInfoWrap::setIsActive(bool isActive)
{
m_isActive = isActive;
}
inline bool WindowInfoWrap::isMinimized() const
{
return m_isMinimized;
}
inline void WindowInfoWrap::setIsMinimized(bool isMinimized)
{
m_isMinimized = isMinimized;
}
inline bool WindowInfoWrap::isMaximized() const
{
return m_isMaximized;
}
inline void WindowInfoWrap::setIsMaximized(bool isMaximized)
{
m_isMaximized = isMaximized;
}
inline bool WindowInfoWrap::isFullscreen() const
{
return m_isFullscreen;
}
inline void WindowInfoWrap::setIsFullscreen(bool isFullscreen)
{
m_isFullscreen = isFullscreen;
}
inline bool WindowInfoWrap::isOnCurrentDesktop() const
{
return m_isOnCurrentDesktop;
}
inline void WindowInfoWrap::setIsOnCurrentDesktop(bool isOnCurrentDesktop)
{
m_isOnCurrentDesktop = isOnCurrentDesktop;
}
inline QRect WindowInfoWrap::geometry() const
{
return m_geometry;
}
inline void WindowInfoWrap::setGeometry(const QRect &geometry)
{
m_geometry = geometry;
}
inline WId WindowInfoWrap::wid() const
{
return m_wid;
}
inline void WindowInfoWrap::setWid(WId wid)
{
m_wid = wid;
}

@ -0,0 +1,59 @@
#ifndef WINDOWINFO_H
#define WINDOWINFO_H
#include <QObject>
#include <QWidget>
#include <QRect>
namespace Latte {
class WindowInfoWrap {
public:
explicit WindowInfoWrap();
WindowInfoWrap(const WindowInfoWrap &other);
WindowInfoWrap &operator=(const WindowInfoWrap &rhs);
bool operator==(const WindowInfoWrap &rhs) const;
bool operator<(const WindowInfoWrap &rhs) const;
bool operator>(const WindowInfoWrap &rhs) const;
bool isValid() const;
void setIsValid(bool isValid);
bool isActive() const;
void setIsActive(bool isActive);
bool isMinimized() const;
void setIsMinimized(bool isMinimized);
bool isMaximized() const;
void setIsMaximized(bool isMaximized);
bool isFullscreen() const;
void setIsFullscreen(bool isFullscreen);
bool isOnCurrentDesktop() const;
void setIsOnCurrentDesktop(bool isOnCurrentDesktop);
QRect geometry() const;
void setGeometry(const QRect &geometry);
WId wid() const;
void setWid(WId wid);
private:
bool m_isValid : 1;
bool m_isActive : 1;
bool m_isMinimized : 1;
bool m_isMaximized : 1;
bool m_isFullscreen : 1;
bool m_isOnCurrentDesktop : 1;
QRect m_geometry;
WId m_wid;
};
}
#endif // WINDOWINFO_H
Loading…
Cancel
Save