summaryrefslogtreecommitdiff
path: root/kde
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@compiz-fusion.org>2010-02-12 21:11:21 +0100
committerDennis kasprzyk <onestone@compiz-fusion.org>2010-02-12 21:11:21 +0100
commitef1a3e64d35d7a0f222de79006e17ff6609ce2c7 (patch)
tree159e7f9fa11bf32112e285bc10ad70bc81cabe55 /kde
parent8ba719106e44420a39940d12491c49d896f54213 (diff)
downloadzcomp-ef1a3e64d35d7a0f222de79006e17ff6609ce2c7.tar.gz
zcomp-ef1a3e64d35d7a0f222de79006e17ff6609ce2c7.tar.bz2
Kde 4.4 support.
Diffstat (limited to 'kde')
-rw-r--r--kde/window-decorator-kde4/window.cpp116
-rw-r--r--kde/window-decorator-kde4/window.h24
2 files changed, 130 insertions, 10 deletions
diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
index b0956c3..c2b6086 100644
--- a/kde/window-decorator-kde4/window.cpp
+++ b/kde/window-decorator-kde4/window.cpp
@@ -486,31 +486,39 @@ KWD::Window::showWindowMenu (const QRect &pos)
showWindowMenu (pos.bottomLeft ());
}
-void
-KWD::Window::processMousePressEvent (QMouseEvent *qme)
+KWD::Options::MouseCommand
+KWD::Window::buttonToCommand (Qt::MouseButtons button)
{
Options::MouseCommand com = Options::MouseNothing;
- bool active = isActive ();
+ bool active = isActive ();
if (!mSupportTakeFocus)
- active = TRUE;
+ active = true;
- switch (qme->button ()) {
+ switch (button) {
case Qt::LeftButton:
com = active ? Decorator::options ()->commandActiveTitlebar1 () :
- Decorator::options()->commandInactiveTitlebar1 ();
+ Decorator::options()->commandInactiveTitlebar1 ();
break;
case Qt::MidButton:
com = active ? Decorator::options ()->commandActiveTitlebar2 () :
- Decorator::options()->commandInactiveTitlebar2 ();
+ Decorator::options()->commandInactiveTitlebar2 ();
break;
case Qt::RightButton:
com = active ? Decorator::options ()->commandActiveTitlebar3 () :
- Decorator::options()->commandInactiveTitlebar3 ();
+ Decorator::options()->commandInactiveTitlebar3 ();
default:
break;
}
+ return com;
+}
+
+void
+KWD::Window::processMousePressEvent (QMouseEvent *qme)
+{
+ Options::MouseCommand com = buttonToCommand (qme->button ());
+
if (qme->button () == Qt::LeftButton)
{
// actions where it's not possible to get the matching release event
@@ -752,6 +760,96 @@ KWD::Window::compositingActive (void) const
return (mType != Normal2D);
}
+#if KDE_IS_VERSION(4,3,90)
+
+QRect
+KWD::Window::transparentRect () const
+{
+ return QRect ();
+}
+
+bool
+KWD::Window::isClientGroupActive ()
+{
+ return false;
+}
+
+QList<ClientGroupItem>
+KWD::Window::clientGroupItems () const
+{
+ QList<ClientGroupItem> items;
+
+ QIcon icon (mIcon);
+ icon.addPixmap (mMiniIcon);
+
+ items.append (ClientGroupItem (mName, icon));
+
+ return items;
+}
+
+long
+KWD::Window::itemId (int index)
+{
+ return (long) mClientId;
+}
+
+int
+KWD::Window::visibleClientGroupItem ()
+{
+ return 0;
+}
+
+void
+KWD::Window::setVisibleClientGroupItem (int index)
+{
+}
+
+void
+KWD::Window::moveItemInClientGroup (int index, int before)
+{
+}
+
+void
+KWD::Window::moveItemToClientGroup (long itemId, int before)
+{
+}
+
+void
+KWD::Window::removeFromClientGroup (int index, const QRect& newGeom)
+{
+}
+
+void
+KWD::Window::closeClientGroupItem (int index)
+{
+ closeWindow ();
+}
+
+void
+KWD::Window::closeAllInClientGroup ()
+{
+ closeWindow ();
+}
+
+void
+KWD::Window::displayClientMenu (int index, const QPoint& pos)
+{
+ showWindowMenu (pos);
+}
+
+KDecorationDefines::WindowOperation
+KWD::Window::buttonToWindowOperation(Qt::MouseButtons button)
+{
+ Options::MouseCommand com = buttonToCommand (button);
+
+ if (com == Options::MouseOperationsMenu)
+ return KDecorationDefines::OperationsOp;
+
+ return KDecorationDefines::NoOp;
+}
+
+#endif
+
void
KWD::Window::createDecoration (void)
{
@@ -1513,7 +1611,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
NET::Direction direction;
direction = positionToDirection (mDecor->mousePosition (qme->pos ()));
-
+
QPoint p (mGeometry.x () - mExtents.left, mGeometry.y () - mExtents.top);
p += qme->pos ();
diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
index 9a6dd4a..e7e4d01 100644
--- a/kde/window-decorator-kde4/window.h
+++ b/kde/window-decorator-kde4/window.h
@@ -26,6 +26,7 @@
#include <kdecorationbridge.h>
#include <KDE/KActionCollection>
+#include <kdeversion.h>
#include <qpixmap.h>
#include <qwidget.h>
@@ -113,6 +114,25 @@ class Window: public QObject, public KDecorationBridgeUnstable {
/* unstable API */
virtual bool compositingActive () const;
+#if KDE_IS_VERSION(4,3,90)
+ virtual QRect transparentRect () const;
+
+ virtual bool isClientGroupActive ();
+ virtual QList<ClientGroupItem> clientGroupItems () const;
+ virtual long itemId (int index);
+ virtual int visibleClientGroupItem ();
+ virtual void setVisibleClientGroupItem (int index);
+ virtual void moveItemInClientGroup (int index, int before);
+ virtual void moveItemToClientGroup (long itemId, int before);
+ virtual void removeFromClientGroup (int index, const QRect& newGeom);
+ virtual void closeClientGroupItem (int index);
+ virtual void closeAllInClientGroup ();
+ virtual void displayClientMenu (int index, const QPoint& pos);
+
+ virtual WindowOperation
+ buttonToWindowOperation(Qt::MouseButtons button);
+#endif
+
void handleActiveChange (void);
void updateFrame (WId frame);
void updateWindowGeometry (void);
@@ -188,8 +208,10 @@ class Window: public QObject, public KDecorationBridgeUnstable {
int rightOffset);
void updateProperty (void);
void getWindowProtocols (void);
+
+ Options::MouseCommand buttonToCommand (Qt::MouseButtons button);
void performMouseCommand (KWD::Options::MouseCommand command,
- QMouseEvent *qme);
+ QMouseEvent *qme);
NET::Direction positionToDirection (int pos);
Cursor positionToCursor (QPoint pos);