summaryrefslogtreecommitdiff
path: root/src/decorator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/decorator.h')
-rw-r--r--src/decorator.h249
1 files changed, 139 insertions, 110 deletions
diff --git a/src/decorator.h b/src/decorator.h
index a3a3c76..646c773 100644
--- a/src/decorator.h
+++ b/src/decorator.h
@@ -3,10 +3,9 @@
*
* Copyright (c) 2006 Dennis Kasprzyk <onestone@beryl-project.org>
* Copyright (c) 2006 Volker Krause <vkrause@kde.org>
+ * Copyright (c) 2006 David Reveman <davidr@novell.com>
*
* Uses code of:
- * Emerald window decorator (www.beryl-project.org)
- * gtk-window-decorator (www.freedesktop.org/wiki/Software/Compiz)
* KWin window manager (www.kde.org)
*
* This program is free software; you can redistribute it and/or modify
@@ -25,12 +24,8 @@
*
*/
-#ifndef AQUAMARINE_DECORATOR_H
-#define AQUAMARINE_DECORATOR_H
-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#ifndef _DECORATOR_H
+#define _DECORATOR_H
#include <kapplication.h>
@@ -38,132 +33,166 @@
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
+#include <qtimer.h>
+
#include <fixx11h.h>
#include <kconfig.h>
#include <kdecoration_plugins_p.h>
#include <kdecoration_p.h>
+#include <netwm.h>
+
+//#include <beryl-decoration.h>
+#include "libdeco.h"
#include "window.h"
-#include "defaultDeco.h"
-#include "defaultShadow.h"
#include "KWinInterface.h"
-#define C(name) { 0, XC_ ## name }
+#define ROOT_OFF_X 8192
+#define ROOT_OFF_Y 8192
-#define DECOR_INTERFACE_VERSION 20061011
+#define C(name) { 0, XC_ ## name }
-struct _cursor
-{
- Cursor cursor;
+struct _cursor {
+ Cursor cursor;
unsigned int shape;
};
+extern struct _cursor cursors[3][3];
+
class KConfig;
class KWinModule;
-
-
-static const long defaultMask = StructureNotifyMask | PropertyChangeMask;
-
namespace Aquamarine
{
-
class Options;
- class Switcher;
-
- class PluginManager:public KDecorationPlugins
- {
- public:
- PluginManager (KConfig * config);
- virtual bool provides (Requirement)
- {
- return false;
- }
- };
-
-
- class Decorator:public KApplication, public KWinInterface
- {
- Q_OBJECT public:
- Decorator (Display * dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap =
- 0);
- ~Decorator ();
-
- bool isReady ()
- {
- return ready;
- }
- bool x11EventFilter (XEvent *);
-
- static PluginManager *pluginManager ()
- {
- return m_plugins;
- }
- static Aquamarine::Options * options ()
- {
- return m_options;
- }
- static void sendClientMessage (WId w, Atom a, Atom protocol,
- long data1 = 0, long data2 =
- 0, long data3 = 0);
-
- static int onViewport (QPoint pos);
- static QSize viewports ();
- static void moveToViewport (WId id, int vp);
-
- bool restart () const
- {
- return m_restart;
- }
-
- public slots:
- void reconfigure ();
-
- signals:
- void desktopGeometryChanged();
-
- private:
- WId fetchFrame (WId window);
- void updateDesktopGeometry ();
-
- private slots:
- void slotWindowAdded (WId id);
- void slotWindowRemoved (WId id);
- void slotActiveWindowChanged (WId id);
- void slotWindowChanged (WId id, const unsigned long *properties);
- void slotSettingsChanged (int category);
-
- private:
-
- bool ready;
-
- Aquamarine::DefaultDecoration * m_defDeco;
- Aquamarine::DefaultDecoration * m_defDecoActive;
- Aquamarine::DefaultShadow * m_defShadow;
-
- QMap < WId, Aquamarine::Window * >m_windows;
- QMap < WId, Aquamarine::Window * >m_frames;
- Aquamarine::Window * m_activeWindow;
-
- KConfig *m_config;
-
- static PluginManager *m_plugins;
- static Aquamarine::Options * m_options;
-
- KWinModule *m_kwinmodule;
-
- Switcher *m_switcher;
+ class PluginManager: public KDecorationPlugins
+ {
+ public:
+ PluginManager (KConfig *config);
+ virtual bool provides (Requirement)
+ {
+ return false;
+ }
+ };
- static QSize m_desktop;
- static QPoint m_viewport;
- static QSize m_rootSize;
- WId m_activeWM;
- bool m_restart;
+ class Decorator: public KApplication, public KWinInterface
+ {
+ Q_OBJECT public:
+
+ Decorator (void);
+ ~Decorator (void);
+
+ static NETRootInfo *rootInfo (void)
+ {
+ return mRootInfo;
+ }
+ static PluginManager *pluginManager (void)
+ {
+ return mPlugins;
+ }
+ static Aquamarine::Options *options (void)
+ {
+ return mOptions;
+ }
+ static WId activeId (void)
+ {
+ return mActiveId;
+ }
+ static decor_shadow_options_t *shadowOptions (void)
+ {
+ return &mShadowOptions;
+ }
+ static decor_shadow_t *defaultWindowShadow (decor_context_t *context)
+ {
+ if (!mDefaultShadow)
+ return NULL;
+
+ *context = mDefaultContext;
+ return mDefaultShadow;
+ }
+ static void sendClientMessage (WId eventWid,
+ WId wid,
+ Atom atom,
+ Atom value,
+ long data1 = 0,
+ long data2 = 0,
+ long data3 = 0);
+ static void updateDefaultShadow (Aquamarine::Window *w);
+
+ bool enableDecorations (Time timestamp, int damageEvent);
+ bool x11EventFilter (XEvent *xevent);
+
+ static int onViewport (QPoint pos);
+ static QSize viewports ();
+ static void moveToViewport (WId id, int vp);
+
+ bool isReady ()
+ {
+ return mReady;
+ }
+
+ bool restart () const
+ {
+ return mRestart;
+ }
+
+ public slots:
+
+ void reconfigure (void);
+
+ signals:
+ void desktopGeometryChanged();
+
+ private:
+
+ WId fetchFrame (WId window);
+ void updateShadow (void);
+ void updateAllShadowOptions (void);
+ void updateDesktopGeometry ();
+
+ private slots:
+
+ void handleWindowAdded (WId id);
+ void handleWindowRemoved (WId id);
+ void handleActiveWindowChanged (WId id);
+ void handleWindowChanged (WId id,
+ const unsigned long *properties);
+ void processDamage (void);
+
+ private:
+
+ static PluginManager *mPlugins;
+ static Aquamarine::Options *mOptions;
+ static decor_context_t mDefaultContext;
+ static decor_shadow_t *mDefaultShadow;
+ static decor_shadow_t *mNoBorderShadow;
+ static decor_shadow_options_t mShadowOptions;
+ static NETRootInfo *mRootInfo;
+ static WId mActiveId;
+
+ Aquamarine::Window *mDecorNormal;
+ Aquamarine::Window *mDecorActive;
+ QMap <WId, Aquamarine::Window *>mClients;
+ QMap <WId, Aquamarine::Window *>mFrames;
+ QMap <WId, Aquamarine::Window *>mWindows;
+ KConfig *mConfig;
+ Time mDmSnTimestamp;
+ int mDamageEvent;
+ QTimer mIdleTimer;
+ KWinModule *mKWinModule;
+ QWidget *mCompositeWindow;
+
+ static QSize mDesktop;
+ static QPoint mViewport;
+ static QSize mRootSize;
+
+ WId mActiveWM;
+ bool mRestart;
+ bool mReady;
};
-
}
#endif