summaryrefslogtreecommitdiff
path: root/unity-shared
diff options
authorNick Dedekind <nicholas.dedekind@gmail.com>2012-08-15 12:35:52 +0100
committerNick Dedekind <nicholas.dedekind@gmail.com>2012-08-15 12:35:52 +0100
commit04e6340970e236d90b72a37d7c91bd166958e023 (patch)
tree80cb88522fde786ee30587cded05d1b04c58278d /unity-shared
parent701288c91a6ff396cef7e1631e10e6c432ac0a84 (diff)
parent0ee698a4ee41f434b361f61c1b24ebd08c68c70d (diff)
Merged with trunk.
(bzr r2419.4.68)
Diffstat (limited to 'unity-shared')
-rw-r--r--unity-shared/IconRenderer.cpp4
-rw-r--r--unity-shared/PluginAdapter.h40
-rw-r--r--unity-shared/PluginAdapterCompiz.cpp44
-rw-r--r--unity-shared/PluginAdapterStandalone.cpp44
-rw-r--r--unity-shared/WindowManager.cpp40
-rw-r--r--unity-shared/WindowManager.h36
6 files changed, 115 insertions, 93 deletions
diff --git a/unity-shared/IconRenderer.cpp b/unity-shared/IconRenderer.cpp
index ed1fa65e6..2c37cc89c 100644
--- a/unity-shared/IconRenderer.cpp
+++ b/unity-shared/IconRenderer.cpp
@@ -757,8 +757,8 @@ void IconRenderer::RenderElement(nux::GraphicsEngine& GfxContext,
CHECKGL(glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0));
CHECKGL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
- int VertexLocation;
- int TextureCoord0Location;
+ int VertexLocation = -1;
+ int TextureCoord0Location = -1;
int FragmentColor = 0;
int ColorifyColor = 0;
int DesatFactor = 0;
diff --git a/unity-shared/PluginAdapter.h b/unity-shared/PluginAdapter.h
index 70d5e433c..8c9882bd1 100644
--- a/unity-shared/PluginAdapter.h
+++ b/unity-shared/PluginAdapter.h
@@ -92,11 +92,13 @@ public:
void OnLeaveDesktop ();
void TerminateScale();
- bool IsScaleActive();
- bool IsScaleActiveForGroup();
+ bool IsScaleActive() const;
+ bool IsScaleActiveForGroup() const;
void InitiateExpo();
- bool IsExpoActive();
+ bool IsExpoActive() const;
+
+ bool IsWallActive() const;
void ShowGrabHandles(CompWindow* window, bool use_timer);
void HideGrabHandles(CompWindow* window);
@@ -109,22 +111,22 @@ public:
void NotifyCompizEvent(const char* plugin, const char* event, CompOption::Vector& option);
void NotifyNewDecorationState(guint32 xid);
- guint32 GetActiveWindow();
+ guint32 GetActiveWindow() const;
void Decorate(guint32 xid);
void Undecorate(guint32 xid);
// WindowManager implementation
- bool IsWindowMaximized(guint xid);
+ bool IsWindowMaximized(guint xid) const;
bool IsWindowDecorated(guint xid);
- bool IsWindowOnCurrentDesktop(guint xid);
- bool IsWindowObscured(guint xid);
- bool IsWindowMapped(guint xid);
- bool IsWindowVisible(guint32 xid);
- bool IsWindowOnTop(guint32 xid);
- bool IsWindowClosable(guint32 xid);
- bool IsWindowMinimizable(guint32 xid);
- bool IsWindowMaximizable(guint32 xid);
+ bool IsWindowOnCurrentDesktop(guint xid) const;
+ bool IsWindowObscured(guint xid) const;
+ bool IsWindowMapped(guint xid) const;
+ bool IsWindowVisible(guint32 xid) const;
+ bool IsWindowOnTop(guint32 xid) const;
+ bool IsWindowClosable(guint32 xid) const;
+ bool IsWindowMinimizable(guint32 xid) const;
+ bool IsWindowMaximizable(guint32 xid) const;
void Restore(guint32 xid);
void RestoreAt(guint32 xid, int x, int y);
@@ -140,12 +142,12 @@ public:
void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true);
bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force);
- bool IsScreenGrabbed();
- bool IsViewPortSwitchStarted();
+ bool IsScreenGrabbed() const;
+ bool IsViewPortSwitchStarted() const;
- unsigned long long GetWindowActiveNumber (guint32 xid);
+ unsigned long long GetWindowActiveNumber (guint32 xid) const;
- bool MaximizeIfBigEnough(CompWindow* window);
+ bool MaximizeIfBigEnough(CompWindow* window) const;
int GetWindowMonitor(guint32 xid) const;
nux::Geometry GetWindowGeometry(guint32 xid) const;
@@ -155,7 +157,7 @@ public:
void CheckWindowIntersections(nux::Geometry const& region, bool &active, bool &any);
- int WorkspaceCount();
+ int WorkspaceCount() const;
void SetCoverageAreaBeforeAutomaximize(float area);
@@ -172,7 +174,7 @@ private:
std::string MatchStringForXids(std::vector<Window> *windows);
void InitiateScale(std::string const& match, int state = 0);
- bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window);
+ bool CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const;
void SetMwmWindowHints(Window xid, MotifWmHints* new_hints);
CompScreen* m_Screen;
diff --git a/unity-shared/PluginAdapterCompiz.cpp b/unity-shared/PluginAdapterCompiz.cpp
index 057ccea0c..92ad4cea3 100644
--- a/unity-shared/PluginAdapterCompiz.cpp
+++ b/unity-shared/PluginAdapterCompiz.cpp
@@ -298,7 +298,7 @@ MultiActionList::TerminateAll(CompOption::Vector& extraArgs)
}
unsigned long long
-PluginAdapter::GetWindowActiveNumber (guint32 xid)
+PluginAdapter::GetWindowActiveNumber (guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -368,23 +368,29 @@ PluginAdapter::TerminateScale()
}
bool
-PluginAdapter::IsScaleActive()
+PluginAdapter::IsScaleActive() const
{
return m_Screen->grabExist("scale");
}
bool
-PluginAdapter::IsScaleActiveForGroup()
+PluginAdapter::IsScaleActiveForGroup() const
{
return _spread_windows_state && m_Screen->grabExist("scale");
}
bool
-PluginAdapter::IsExpoActive()
+PluginAdapter::IsExpoActive() const
{
return m_Screen->grabExist("expo");
}
+bool
+PluginAdapter::IsWallActive() const
+{
+ return m_Screen->grabExist("wall");
+}
+
void
PluginAdapter::InitiateExpo()
{
@@ -395,13 +401,13 @@ PluginAdapter::InitiateExpo()
// WindowManager implementation
guint32
-PluginAdapter::GetActiveWindow()
+PluginAdapter::GetActiveWindow() const
{
return m_Screen->activeWindow();
}
bool
-PluginAdapter::IsWindowMaximized(guint xid)
+PluginAdapter::IsWindowMaximized(guint xid) const
{
Window win = xid;
CompWindow* window;
@@ -456,7 +462,7 @@ PluginAdapter::IsWindowDecorated(guint32 xid)
}
bool
-PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)
+PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -472,7 +478,7 @@ PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)
}
bool
-PluginAdapter::IsWindowObscured(guint32 xid)
+PluginAdapter::IsWindowObscured(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -505,7 +511,7 @@ PluginAdapter::IsWindowObscured(guint32 xid)
}
bool
-PluginAdapter::IsWindowMapped(guint32 xid)
+PluginAdapter::IsWindowMapped(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -517,7 +523,7 @@ PluginAdapter::IsWindowMapped(guint32 xid)
}
bool
-PluginAdapter::IsWindowVisible(guint32 xid)
+PluginAdapter::IsWindowVisible(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -530,7 +536,7 @@ PluginAdapter::IsWindowVisible(guint32 xid)
}
bool
-PluginAdapter::IsWindowOnTop(guint32 xid)
+PluginAdapter::IsWindowOnTop(guint32 xid) const
{
Window win = xid;
CompWindow* window = m_Screen->findWindow(win);
@@ -569,7 +575,7 @@ PluginAdapter::IsWindowOnTop(guint32 xid)
}
bool
-PluginAdapter::IsWindowClosable(guint32 xid)
+PluginAdapter::IsWindowClosable(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -582,7 +588,7 @@ PluginAdapter::IsWindowClosable(guint32 xid)
}
bool
-PluginAdapter::IsWindowMinimizable(guint32 xid)
+PluginAdapter::IsWindowMinimizable(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -595,7 +601,7 @@ PluginAdapter::IsWindowMinimizable(guint32 xid)
}
bool
-PluginAdapter::IsWindowMaximizable(guint32 xid)
+PluginAdapter::IsWindowMaximizable(guint32 xid) const
{
Window win = xid;
CompWindow* window;
@@ -965,7 +971,7 @@ PluginAdapter::GetWorkAreaGeometry(guint32 xid) const
}
bool
-PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window)
+PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const
{
int intersect_types = CompWindowTypeNormalMask | CompWindowTypeDialogMask |
CompWindowTypeModalDialogMask | CompWindowTypeUtilMask;
@@ -1022,7 +1028,7 @@ PluginAdapter::CheckWindowIntersections (nux::Geometry const& region, bool &acti
}
int
-PluginAdapter::WorkspaceCount()
+PluginAdapter::WorkspaceCount() const
{
return m_Screen->vpSize().width() * m_Screen->vpSize().height();
}
@@ -1105,19 +1111,19 @@ PluginAdapter::Undecorate(guint32 xid)
}
bool
-PluginAdapter::IsScreenGrabbed()
+PluginAdapter::IsScreenGrabbed() const
{
return m_Screen->grabbed();
}
bool
-PluginAdapter::IsViewPortSwitchStarted()
+PluginAdapter::IsViewPortSwitchStarted() const
{
return _vp_switch_started;
}
/* Returns true if the window was maximized */
-bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window)
+bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const
{
XClassHint classHint;
Status status;
diff --git a/unity-shared/PluginAdapterStandalone.cpp b/unity-shared/PluginAdapterStandalone.cpp
index 45d0d5723..9ba893021 100644
--- a/unity-shared/PluginAdapterStandalone.cpp
+++ b/unity-shared/PluginAdapterStandalone.cpp
@@ -125,7 +125,7 @@ MultiActionList::TerminateAll(CompOption::Vector& extraArgs)
}
unsigned long long
-PluginAdapter::GetWindowActiveNumber (guint32 xid)
+PluginAdapter::GetWindowActiveNumber (guint32 xid) const
{
return 0;
}
@@ -157,19 +157,19 @@ PluginAdapter::TerminateScale()
}
bool
-PluginAdapter::IsScaleActive()
+PluginAdapter::IsScaleActive() const
{
return false;
}
bool
-PluginAdapter::IsScaleActiveForGroup()
+PluginAdapter::IsScaleActiveForGroup() const
{
return false;
}
bool
-PluginAdapter::IsExpoActive()
+PluginAdapter::IsExpoActive() const
{
return false;
}
@@ -179,15 +179,21 @@ PluginAdapter::InitiateExpo()
{
}
+bool
+PluginAdapter::IsWallActive() const
+{
+ return false;
+}
+
// WindowManager implementation
guint32
-PluginAdapter::GetActiveWindow()
+PluginAdapter::GetActiveWindow() const
{
return 0;
}
bool
-PluginAdapter::IsWindowMaximized(guint xid)
+PluginAdapter::IsWindowMaximized(guint xid) const
{
return false;
}
@@ -199,49 +205,49 @@ PluginAdapter::IsWindowDecorated(guint32 xid)
}
bool
-PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid)
+PluginAdapter::IsWindowOnCurrentDesktop(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowObscured(guint32 xid)
+PluginAdapter::IsWindowObscured(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowMapped(guint32 xid)
+PluginAdapter::IsWindowMapped(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowVisible(guint32 xid)
+PluginAdapter::IsWindowVisible(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowOnTop(guint32 xid)
+PluginAdapter::IsWindowOnTop(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowClosable(guint32 xid)
+PluginAdapter::IsWindowClosable(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowMinimizable(guint32 xid)
+PluginAdapter::IsWindowMinimizable(guint32 xid) const
{
return false;
}
bool
-PluginAdapter::IsWindowMaximizable(guint32 xid)
+PluginAdapter::IsWindowMaximizable(guint32 xid) const
{
return false;
}
@@ -347,7 +353,7 @@ PluginAdapter::GetWorkAreaGeometry(guint32 xid) const
}
bool
-PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window)
+PluginAdapter::CheckWindowIntersection(nux::Geometry const& region, CompWindow* window) const
{
return false;
}
@@ -358,7 +364,7 @@ PluginAdapter::CheckWindowIntersections (nux::Geometry const& region, bool &acti
}
int
-PluginAdapter::WorkspaceCount()
+PluginAdapter::WorkspaceCount() const
{
return 4;
}
@@ -379,19 +385,19 @@ PluginAdapter::Undecorate(guint32 xid)
}
bool
-PluginAdapter::IsScreenGrabbed()
+PluginAdapter::IsScreenGrabbed() const
{
return false;
}
bool
-PluginAdapter::IsViewPortSwitchStarted()
+PluginAdapter::IsViewPortSwitchStarted() const
{
return false;
}
/* Returns true if the window was maximized */
-bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window)
+bool PluginAdapter::MaximizeIfBigEnough(CompWindow* window) const
{
return true;
}
diff --git a/unity-shared/WindowManager.cpp b/unity-shared/WindowManager.cpp
index 87d714477..5f5cd6519 100644
--- a/unity-shared/WindowManager.cpp
+++ b/unity-shared/WindowManager.cpp
@@ -23,22 +23,22 @@ static WindowManager* window_manager = NULL;
class WindowManagerDummy : public WindowManager
{
- guint32 GetActiveWindow()
+ guint32 GetActiveWindow() const
{
return 0;
}
- unsigned long long GetWindowActiveNumber (guint32 xid)
+ unsigned long long GetWindowActiveNumber (guint32 xid) const
{
return 0;
}
- bool IsScreenGrabbed()
+ bool IsScreenGrabbed() const
{
return false;
}
- bool IsViewPortSwitchStarted()
+ bool IsViewPortSwitchStarted() const
{
return false;
}
@@ -48,7 +48,7 @@ class WindowManagerDummy : public WindowManager
g_debug("%s", G_STRFUNC);
}
- bool IsWindowMaximized(guint32 xid)
+ bool IsWindowMaximized(guint32 xid) const
{
return false;
}
@@ -58,42 +58,42 @@ class WindowManagerDummy : public WindowManager
return true;
}
- bool IsWindowOnCurrentDesktop(guint32 xid)
+ bool IsWindowOnCurrentDesktop(guint32 xid) const
{
return true;
}
- bool IsWindowObscured(guint32 xid)
+ bool IsWindowObscured(guint32 xid) const
{
return false;
}
- bool IsWindowMapped(guint32 xid)
+ bool IsWindowMapped(guint32 xid) const
{
return true;
}
- bool IsWindowVisible(guint32 xid)
+ bool IsWindowVisible(guint32 xid) const
{
return true;
}
- bool IsWindowOnTop(guint32 xid)
+ bool IsWindowOnTop(guint32 xid) const
{
return false;
}
- bool IsWindowClosable(guint32 xid)
+ bool IsWindowClosable(guint32 xid) const
{
return true;
}
- bool IsWindowMinimizable(guint32 xid)
+ bool IsWindowMinimizable(guint32 xid) const
{
return true;
}
- bool IsWindowMaximizable(guint32 xid)
+ bool IsWindowMaximizable(guint32 xid) const
{
return true;
}
@@ -182,7 +182,7 @@ class WindowManagerDummy : public WindowManager
any = false;
}
- int WorkspaceCount ()
+ int WorkspaceCount () const
{
return 1;
}
@@ -192,13 +192,13 @@ class WindowManagerDummy : public WindowManager
g_debug("%s", G_STRFUNC);
}
- bool IsScaleActive()
+ bool IsScaleActive() const
{
g_debug("%s", G_STRFUNC);
return false;
}
- bool IsScaleActiveForGroup()
+ bool IsScaleActiveForGroup() const
{
g_debug("%s", G_STRFUNC);
return false;
@@ -209,7 +209,13 @@ class WindowManagerDummy : public WindowManager
g_debug("%s", G_STRFUNC);
}
- bool IsExpoActive()
+ bool IsExpoActive() const
+ {
+ g_debug("%s", G_STRFUNC);
+ return false;
+ }
+
+ bool IsWallActive() const
{
g_debug("%s", G_STRFUNC);
return false;
diff --git a/unity-shared/WindowManager.h b/unity-shared/WindowManager.h
index 1f828b45a..84ae82485 100644
--- a/unity-shared/WindowManager.h
+++ b/unity-shared/WindowManager.h
@@ -49,18 +49,18 @@ public:
static WindowManager* Default();
static void SetDefault(WindowManager* manager);
- virtual guint32 GetActiveWindow() = 0;
+ virtual guint32 GetActiveWindow() const = 0;
- virtual bool IsWindowMaximized(guint32 xid) = 0;
+ virtual bool IsWindowMaximized(guint32 xid) const = 0;
virtual bool IsWindowDecorated(guint32 xid) = 0;
- virtual bool IsWindowOnCurrentDesktop(guint32 xid) = 0;
- virtual bool IsWindowObscured(guint32 xid) = 0;
- virtual bool IsWindowMapped(guint32 xid) = 0;
- virtual bool IsWindowVisible(guint32 xid) = 0;
- virtual bool IsWindowOnTop(guint32 xid) = 0;
- virtual bool IsWindowClosable(guint32 xid) = 0;
- virtual bool IsWindowMinimizable(guint32 xid) = 0;
- virtual bool IsWindowMaximizable(guint32 xid) = 0;
+ virtual bool IsWindowOnCurrentDesktop(guint32 xid) const = 0;
+ virtual bool IsWindowObscured(guint32 xid) const = 0;
+ virtual bool IsWindowMapped(guint32 xid) const = 0;
+ virtual bool IsWindowVisible(guint32 xid) const = 0;
+ virtual bool IsWindowOnTop(guint32 xid) const = 0;
+ virtual bool IsWindowClosable(guint32 xid) const = 0;
+ virtual bool IsWindowMinimizable(guint32 xid) const = 0;
+ virtual bool IsWindowMaximizable(guint32 xid) const = 0;
virtual void ShowDesktop() = 0;
@@ -74,11 +74,13 @@ public:
virtual void Lower(guint32 xid) = 0;
virtual void TerminateScale() = 0;
- virtual bool IsScaleActive() = 0;
- virtual bool IsScaleActiveForGroup() = 0;
+ virtual bool IsScaleActive() const = 0;
+ virtual bool IsScaleActiveForGroup() const = 0;
virtual void InitiateExpo() = 0;
- virtual bool IsExpoActive() = 0;
+ virtual bool IsExpoActive() const = 0;
+
+ virtual bool IsWallActive() const = 0;
virtual void FocusWindowGroup(std::vector<Window> windows, FocusVisibility, int monitor = -1, bool only_top_win = true) = 0;
virtual bool ScaleWindowGroup(std::vector<Window> windows, int state, bool force) = 0;
@@ -86,8 +88,8 @@ public:
virtual void Decorate(guint32 xid) {};
virtual void Undecorate(guint32 xid) {};
- virtual bool IsScreenGrabbed() = 0;
- virtual bool IsViewPortSwitchStarted() = 0;
+ virtual bool IsScreenGrabbed() const = 0;
+ virtual bool IsViewPortSwitchStarted() const = 0;
virtual void MoveResizeWindow(guint32 xid, nux::Geometry geometry) = 0;
void StartMove(guint32 xid, int, int);
@@ -98,13 +100,13 @@ public:
virtual nux::Geometry GetScreenGeometry() const = 0;
virtual nux::Geometry GetWorkAreaGeometry(guint32 xid = 0) const = 0;
- virtual unsigned long long GetWindowActiveNumber(guint32 xid) = 0;
+ virtual unsigned long long GetWindowActiveNumber(guint32 xid) const = 0;
virtual void SetWindowIconGeometry(Window window, nux::Geometry const& geo) = 0;
virtual void CheckWindowIntersections (nux::Geometry const& region, bool &active, bool &any) = 0;
- virtual int WorkspaceCount() = 0;
+ virtual int WorkspaceCount() const = 0;
virtual bool saveInputFocus() = 0;
virtual bool restoreInputFocus() = 0;