summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKristopher Ives <kris@leetbook2.(none)>2009-10-22 07:00:15 -0700
committerKristopher Ives <kris@leetbook2.(none)>2009-10-22 07:00:15 -0700
commit470aa6409063a7ad51901981e280a186a2464bd4 (patch)
tree3514730eb278271bc9d02344341abeeea5ac6ee4 /include
parentd8ae6fea739d918d3f07c61fd7673a3d3b34848e (diff)
downloadzcomp-470aa6409063a7ad51901981e280a186a2464bd4.tar.gz
zcomp-470aa6409063a7ad51901981e280a186a2464bd4.tar.bz2
Added Doxyfile.
Started documenting core.
Diffstat (limited to 'include')
-rw-r--r--include/core/icon.h8
-rw-r--r--include/core/icon.h~47
-rw-r--r--include/core/option.h12
-rw-r--r--include/core/option.h~228
-rw-r--r--include/core/output.h3
-rw-r--r--include/core/output.h~61
-rw-r--r--include/core/plugin.h63
-rw-r--r--include/core/plugin.h~323
-rw-r--r--include/core/point.h26
-rw-r--r--include/core/point.h~70
-rw-r--r--include/core/rect.h4
-rw-r--r--include/core/rect.h~196
-rw-r--r--include/core/region.h4
-rw-r--r--include/core/region.h~112
-rw-r--r--include/core/screen.h5
-rw-r--r--include/core/screen.h~433
-rw-r--r--include/core/size.h4
-rw-r--r--include/core/size.h~65
-rw-r--r--include/core/window.h4
-rw-r--r--include/core/window.h~521
20 files changed, 2174 insertions, 15 deletions
diff --git a/include/core/icon.h b/include/core/icon.h
index c0b9027..6f7a637 100644
--- a/include/core/icon.h
+++ b/include/core/icon.h
@@ -32,11 +32,17 @@
class CompScreen;
+///
+/// Wraps an application icon pixel map and it's meta information (such as dimensions)
+///
class CompIcon : public CompSize {
public:
CompIcon (CompScreen *screen, unsigned width, unsigned int height);
~CompIcon ();
-
+
+ ///
+ /// Gets a pointer to the pixel data for this icon.
+ ///
unsigned char* data ();
private:
diff --git a/include/core/icon.h~ b/include/core/icon.h~
new file mode 100644
index 0000000..c0b9027
--- /dev/null
+++ b/include/core/icon.h~
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ * David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPICON_H
+#define _COMPICON_H
+
+#include <core/size.h>
+
+class CompScreen;
+
+class CompIcon : public CompSize {
+ public:
+ CompIcon (CompScreen *screen, unsigned width, unsigned int height);
+ ~CompIcon ();
+
+ unsigned char* data ();
+
+ private:
+ CompSize mSize;
+ unsigned char *mData;
+};
+
+#endif
diff --git a/include/core/option.h b/include/core/option.h
index 2d9ba5f..0a70e41 100644
--- a/include/core/option.h
+++ b/include/core/option.h
@@ -39,7 +39,14 @@ class CompAction;
class CompMatch;
class CompScreen;
+///
+/// A configuration option with boolean, int, float, String, Color, Key, Button,
+/// Edge, Bell, or List.
+///
class CompOption {
+ ///
+ /// Option data types
+ ///
public:
typedef enum {
TypeBool,
@@ -57,7 +64,10 @@ class CompOption {
/* internal use only */
TypeUnset
} Type;
-
+
+ ///
+ /// A value of an Option
+ ///
class Value {
public:
typedef std::vector<Value> Vector;
diff --git a/include/core/option.h~ b/include/core/option.h~
new file mode 100644
index 0000000..ee91715
--- /dev/null
+++ b/include/core/option.h~
@@ -0,0 +1,228 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ * David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPOPTION_H
+#define _COMPOPTION_H
+
+#include <compiz.h>
+
+#include <vector>
+
+class PrivateOption;
+class PrivateValue;
+class PrivateRestriction;
+class CompAction;
+class CompMatch;
+class CompScreen;
+
+///
+/// A configuration option with boolean, int, float, String, Color, Key, Button,
+/// Edge, Bell, or List.
+///
+class CompOption {
+ public:
+ typedef enum {
+ TypeBool,
+ TypeInt,
+ TypeFloat,
+ TypeString,
+ TypeColor,
+ TypeAction,
+ TypeKey,
+ TypeButton,
+ TypeEdge,
+ TypeBell,
+ TypeMatch,
+ TypeList,
+ /* internal use only */
+ TypeUnset
+ } Type;
+
+ class Value {
+ public:
+ typedef std::vector<Value> Vector;
+
+ public:
+ Value ();
+ Value (const Value &);
+ Value (const bool b);
+ Value (const int i);
+ Value (const float f);
+ Value (const unsigned short *color);
+ Value (const CompString& s);
+ Value (const char *s);
+ Value (const CompMatch& m);
+ Value (const CompAction& a);
+ Value (Type type, const Vector& l);
+ ~Value ();
+
+ Type type () const;
+
+ void set (const bool b);
+ void set (const int i);
+ void set (const float f);
+ void set (const unsigned short *color);
+ void set (const CompString& s);
+ void set (const char *s);
+ void set (const CompMatch& m);
+ void set (const CompAction& a);
+ void set (Type type, const Vector& l);
+
+ bool b ();
+ int i ();
+ float f ();
+ unsigned short* c ();
+ CompString s ();
+ CompMatch & match ();
+ CompAction & action ();
+ Type listType ();
+ Vector & list ();
+
+ bool operator== (const Value& val);
+ bool operator!= (const Value& val);
+ Value & operator= (const Value &val);
+
+ operator bool ();
+ operator int ();
+ operator float ();
+ operator unsigned short * ();
+ operator CompString ();
+ operator CompMatch & ();
+ operator CompAction & ();
+ operator CompAction * ();
+ operator Type ();
+ operator Vector & ();
+
+ private:
+ PrivateValue *priv;
+ };
+
+ class Restriction {
+ public:
+ Restriction ();
+ Restriction (const Restriction &);
+ ~Restriction ();
+
+ int iMin ();
+ int iMax ();
+ float fMin ();
+ float fMax ();
+ float fPrecision ();
+
+ void set (int, int);
+ void set (float, float, float);
+
+ bool inRange (int);
+ bool inRange (float);
+
+ Restriction & operator= (const Restriction &rest);
+ private:
+ PrivateRestriction *priv;
+ };
+
+ typedef std::vector<CompOption> Vector;
+
+ class Class {
+ public:
+ virtual Vector & getOptions () = 0;
+
+ virtual CompOption * getOption (const CompString &name);
+
+ virtual bool setOption (const CompString &name,
+ Value &value) = 0;
+ };
+
+ public:
+ CompOption ();
+ CompOption (const CompOption &);
+ CompOption (CompString name, Type type);
+ ~CompOption ();
+
+ void setName (CompString name, Type type);
+
+ CompString name ();
+
+ Type type ();
+ Value & value ();
+ Restriction & rest ();
+
+ bool set (Value &val);
+ bool isAction ();
+
+ CompOption & operator= (const CompOption &option);
+
+ public:
+ static CompOption * findOption (Vector &options, CompString name,
+ unsigned int *index = NULL);
+
+ static bool
+ getBoolOptionNamed (const Vector& options,
+ const CompString& name,
+ bool defaultValue = false);
+
+ static int
+ getIntOptionNamed (const Vector& options,
+ const CompString& name,
+ int defaultValue = 0);
+
+ static float
+ getFloatOptionNamed (const Vector& options,
+ const CompString& name,
+ const float& defaultValue = 0.0);
+
+ static CompString
+ getStringOptionNamed (const Vector& options,
+ const CompString& name,
+ const CompString& defaultValue = "");
+
+ static unsigned short *
+ getColorOptionNamed (const Vector& options,
+ const CompString& name,
+ unsigned short *defaultValue);
+
+ static CompMatch
+ getMatchOptionNamed (const Vector& options,
+ const CompString& name,
+ const CompMatch& defaultValue);
+
+ static CompString typeToString (Type type);
+
+ static bool stringToColor (CompString color,
+ unsigned short *rgba);
+
+ static CompString colorToString (unsigned short *rgba);
+
+
+ static bool setOption (CompOption &o, Value &value);
+
+ private:
+ PrivateOption *priv;
+};
+
+extern CompOption::Vector noOptions;
+
+#endif
diff --git a/include/core/output.h b/include/core/output.h
index b925c90..093a822 100644
--- a/include/core/output.h
+++ b/include/core/output.h
@@ -31,6 +31,9 @@
#include <core/core.h>
#include <core/rect.h>
+///
+/// Output to a device from Compiz
+///
class CompOutput : public CompRect {
public:
diff --git a/include/core/output.h~ b/include/core/output.h~
new file mode 100644
index 0000000..b925c90
--- /dev/null
+++ b/include/core/output.h~
@@ -0,0 +1,61 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ * David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPOUTPUT_H
+#define _COMPOUTPUT_H
+
+#include <core/core.h>
+#include <core/rect.h>
+
+class CompOutput : public CompRect {
+
+ public:
+ CompOutput ();
+
+ CompString name () const;
+
+ unsigned int id () const;
+
+ const CompRect& workArea () const;
+
+ void setWorkArea (const CompRect&);
+ void setGeometry (int x, int y, int width, int height);
+ void setId (CompString, unsigned int);
+
+ typedef std::vector<CompOutput> vector;
+ typedef std::vector<CompOutput *> ptrVector;
+ typedef std::list<CompOutput *> ptrList;
+
+ private:
+
+ CompString mName;
+ unsigned int mId;
+
+ CompRect mWorkArea;
+};
+
+#endif
diff --git a/include/core/plugin.h b/include/core/plugin.h
index 8c0581d..04f404b 100644
--- a/include/core/plugin.h
+++ b/include/core/plugin.h
@@ -73,6 +73,11 @@ union CompPrivate {
void *(*fptr) (void);
};
+///
+/// Base plug-in interface for Compiz. All plugins must implement this
+/// interface, which provides basics for loading, unloading, options,
+/// and linking together the plugin and Screen(s).
+///
class CompPlugin {
public:
class VTable {
@@ -82,7 +87,10 @@ class CompPlugin {
void initVTable (CompString name,
CompPlugin::VTable **self = NULL);
-
+
+ ///
+ /// Gets the name of this compiz plugin
+ ///
const CompString name () const;
virtual bool init () = 0;
@@ -157,23 +165,58 @@ class CompPlugin {
static bool windowInitPlugins (CompWindow *w);
static void windowFiniPlugins (CompWindow *w);
-
+
+ ///
+ /// Finds a plugin by name. (TODO Does it have to be loaded?)
+ ///
static CompPlugin *find (const char *name);
-
+
+ ///
+ /// Load a compiz plugin. Loading a plugin that has
+ /// already been loaded will return the existing instance.
+ ///
static CompPlugin *load (const char *plugin);
-
+
+ ///
+ /// Unload a compiz plugin. Unloading a plugin multiple times has no
+ /// effect, and you can't unload a plugin that hasn't been loaded already
+ /// with CompPlugin::load()
+ ///
static void unload (CompPlugin *p);
-
+
+ ///
+ /// Adds a plugin onto the working set of active plugins. If the plugin fails to initPlugin
+ /// this will return false and the plugin will not be added to the working set.
+ ///
static bool push (CompPlugin *p);
-
+
+ ///
+ /// Removes the last activated plugin with CompPlugin::push() and returns
+ /// the removed plugin, or NULL if there was none.
+ ///
static CompPlugin *pop (void);
-
+
+ ///
+ /// Gets a list of the working set of plugins that have been CompPlugin::push() but not
+ /// CompPlugin::pop()'d.
+ ///
static List & getPlugins ();
-
+
+ ///
+ /// Gets a list of the names of all the known plugins, including plugins that may
+ /// have already been loaded.
+ ///
static std::list<CompString> availablePlugins ();
-
+
+ ///
+ /// Gets the Application Binary Interface (ABI) version of a (un)loaded plugin.
+ ///
static int getPluginABI (const char *name);
-
+
+ ///
+ /// Verifies a signature to ensure that the plugin conforms to the Application Binary
+ /// Interface (ABI)
+ ///
static bool checkPluginABI (const char *name,
int abi);
diff --git a/include/core/plugin.h~ b/include/core/plugin.h~
new file mode 100644
index 0000000..b0f68c6
--- /dev/null
+++ b/include/core/plugin.h~
@@ -0,0 +1,323 @@
+/*
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Novell, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Novell, Inc. makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPIZ_PLUGIN_H
+#define _COMPIZ_PLUGIN_H
+
+#include <compiz.h>
+#include <core/option.h>
+
+class CompScreen;
+extern CompScreen *screen;
+
+#include <map>
+
+#define HOME_PLUGINDIR ".compiz/plugins"
+
+#define COMPIZ_PLUGIN_20090315(name, classname) \
+ CompPlugin::VTable * name##VTable = NULL; \
+ extern "C" { \
+ CompPlugin::VTable * getCompPluginVTable20090315_##name () \
+ { \
+ if (!name##VTable) \
+ { \
+ name##VTable = new classname (); \
+ name##VTable->initVTable (TOSTRING (name), &name##VTable);\
+ return name##VTable; \
+ } \
+ else \
+ return name##VTable; \
+ } \
+ }
+
+class CompPlugin;
+
+typedef bool (*LoadPluginProc) (CompPlugin *p,
+ const char *path,
+ const char *name);
+
+typedef void (*UnloadPluginProc) (CompPlugin *p);
+
+typedef CompStringList (*ListPluginsProc) (const char *path);
+
+extern LoadPluginProc loaderLoadPlugin;
+extern UnloadPluginProc loaderUnloadPlugin;
+extern ListPluginsProc loaderListPlugins;
+
+union CompPrivate {
+ void *ptr;
+ long val;
+ unsigned long uval;
+ void *(*fptr) (void);
+};
+
+///
+/// Base plug-in interface for Compiz. All plugins must implement this
+/// interface, which provides basics for loading, unloading, options,
+/// and linking together the plugin and Screen(s).
+///
+class CompPlugin {
+ public:
+ class VTable {
+ public:
+ VTable ();
+ virtual ~VTable ();
+
+ void initVTable (CompString name,
+ CompPlugin::VTable **self = NULL);
+
+ ///
+ /// Gets the name of this compiz plugin
+ ///
+ const CompString name () const;
+
+ virtual bool init () = 0;
+
+ virtual void fini ();
+
+ virtual bool initScreen (CompScreen *s);
+
+ virtual void finiScreen (CompScreen *s);
+
+ virtual bool initWindow (CompWindow *w);
+
+ virtual void finiWindow (CompWindow *w);
+
+ virtual CompOption::Vector & getOptions ();
+
+ virtual bool setOption (const CompString &name,
+ CompOption::Value &value);
+ private:
+ CompString mName;
+ VTable **mSelf;
+ };
+
+ template <typename T, typename T2>
+ class VTableForScreenAndWindow : public VTable {
+ bool initScreen (CompScreen *s);
+
+ void finiScreen (CompScreen *s);
+
+ bool initWindow (CompWindow *w);
+
+ void finiWindow (CompWindow *w);
+
+ CompOption::Vector & getOptions ();
+
+ bool setOption (const CompString &name, CompOption::Value &value);
+ };
+
+ template <typename T>
+ class VTableForScreen : public VTable {
+ bool initScreen (CompScreen *s);
+
+ void finiScreen (CompScreen *s);
+
+ CompOption::Vector & getOptions ();
+
+ bool setOption (const CompString &name, CompOption::Value &value);
+ };
+
+ struct cmpStr
+ {
+ bool operator () (const char *a, const char *b) const
+ {
+ return strcmp (a, b) < 0;
+ }
+ };
+
+ typedef std::map<const char *, CompPlugin *, cmpStr> Map;
+ typedef std::list<CompPlugin *> List;
+
+ public:
+ CompPrivate devPrivate;
+ CompString devType;
+ VTable *vTable;
+
+ public:
+
+ static bool screenInitPlugins (CompScreen *s);
+
+ static void screenFiniPlugins (CompScreen *s);
+
+ static bool windowInitPlugins (CompWindow *w);
+
+ static void windowFiniPlugins (CompWindow *w);
+
+ ///
+ /// Finds a plugin by name. (Does it have to be loaded?)
+ ///
+ static CompPlugin *find (const char *name);
+
+ ///
+ /// Load a compiz plugin. Loading a plugin that has
+ /// already been loaded will return the existing instance.
+ ///
+ static CompPlugin *load (const char *plugin);
+
+ ///
+ /// Unload a compiz plugin. Unloading a plugin multiple times has no
+ /// effect, and you can't unload a plugin that hasn't been loaded already
+ /// with CompPlugin::load()
+ ///
+ static void unload (CompPlugin *p);
+
+ ///
+ /// Adds a plugin onto the working set of active plugins. If the plugin fails to initPlugin
+ /// this will return false and the plugin will not be added to the working set.
+ ///
+ static bool push (CompPlugin *p);
+
+ ///
+ /// Removes the last activated plugin with CompPlugin::push() and returns
+ /// the removed plugin, or NULL if there was none.
+ ///
+ static CompPlugin *pop (void);
+
+ ///
+ /// Gets a list of the working set of plugins that have been CompPlugin::push() but not
+ /// CompPlugin::pop()'d.
+ ///
+ static List & getPlugins ();
+
+ ///
+ /// Gets a list of the names of all the known plugins, including plugins that may
+ /// have already been loaded.
+ ///
+ static std::list<CompString> availablePlugins ();
+
+ ///
+ /// Gets the Application Binary Interface (ABI) version of a (un)loaded plugin.
+ ///
+ static int getPluginABI (const char *name);
+
+ ///
+ /// Verifies a signature to ensure that the plugin conforms to the Application Binary
+ /// Interface (ABI)
+ ///
+ static bool checkPluginABI (const char *name,
+ int abi);
+
+};
+
+
+template <typename T, typename T2>
+bool CompPlugin::VTableForScreenAndWindow<T,T2>::initScreen (CompScreen *s)
+{
+ T * ps = new T (s);
+ if (ps->loadFailed ())
+ {
+ delete ps;
+ return false;
+ }
+ return true;
+}
+
+template <typename T, typename T2>
+void CompPlugin::VTableForScreenAndWindow<T,T2>::finiScreen (CompScreen *s)
+{
+ T * ps = T::get (s);
+ delete ps;
+}
+
+template <typename T, typename T2>
+bool CompPlugin::VTableForScreenAndWindow<T,T2>::initWindow (CompWindow *w)
+{
+ T2 * pw = new T2 (w);
+ if (pw->loadFailed ())
+ {
+ delete pw;
+ return false;
+ }
+ return true;
+}
+
+template <typename T, typename T2>
+void CompPlugin::VTableForScreenAndWindow<T,T2>::finiWindow (CompWindow *w)
+{
+ T2 * pw = T2::get (w);
+ delete pw;
+}
+
+template <typename T, typename T2>
+CompOption::Vector & CompPlugin::VTableForScreenAndWindow<T,T2>::getOptions ()
+{
+ CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen));
+ if (!oc)
+ return noOptions;
+ return oc->getOptions ();
+}
+
+template <typename T, typename T2>
+bool CompPlugin::VTableForScreenAndWindow<T,T2>::setOption (const CompString &name,
+ CompOption::Value &value)
+{
+ CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen));
+ if (!oc)
+ return false;
+ return oc->setOption (name, value);
+}
+
+template <typename T>
+bool CompPlugin::VTableForScreen<T>::initScreen (CompScreen *s)
+{
+ T * ps = new T (s);
+ if (ps->loadFailed ())
+ {
+ delete ps;
+ return false;
+ }
+ return true;
+}
+
+template <typename T>
+void CompPlugin::VTableForScreen<T>::finiScreen (CompScreen *s)
+{
+ T * ps = T::get (s);
+ delete ps;
+}
+
+template <typename T>
+CompOption::Vector & CompPlugin::VTableForScreen<T>::getOptions ()
+{
+ CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen));
+ if (!oc)
+ return noOptions;
+ return oc->getOptions ();
+}
+
+template <typename T>
+bool CompPlugin::VTableForScreen<T>::setOption (const CompString &name,
+ CompOption::Value &value)
+{
+ CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen));
+ if (!oc)
+ return false;
+ return oc->setOption (name, value);
+}
+
+typedef CompPlugin::VTable *(*PluginGetInfoProc) (void);
+
+#endif
diff --git a/include/core/point.h b/include/core/point.h
index 5d1a3e8..9e4fd3e 100644
--- a/include/core/point.h
+++ b/include/core/point.h
@@ -29,17 +29,39 @@
#include <vector>
#include <list>
+///
+/// A 2D coordinate (likely in screen space) that can only be mutated
+/// through set() methods, since it's data members are private.
+///
class CompPoint {
public:
CompPoint ();
CompPoint (int, int);
-
+
+ ///
+ /// Get the x coordinate of this point
+ ///
int x () const;
+
+ ///
+ /// Get the y coordinate of this point
+ ///
int y () const;
-
+
+ ///
+ /// Set the x and y coordinate of this point
+ ///
void set (int, int);
+
+ ///
+ /// Set the x coordinate of this point
+ ///
void setX (int);
+
+ ///
+ /// Set the y coordinate of this point
+ ///
void setY (int);
bool operator== (const CompPoint &) const;
diff --git a/include/core/point.h~ b/include/core/point.h~
new file mode 100644
index 0000000..5d1a3e8
--- /dev/null
+++ b/include/core/point.h~
@@ -0,0 +1,70 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ */
+
+#ifndef _COMPPOINT_H
+#define _COMPPOINT_H
+
+#include <vector>
+#include <list>
+
+class CompPoint {
+
+ public:
+ CompPoint ();
+ CompPoint (int, int);
+
+ int x () const;
+ int y () const;
+
+ void set (int, int);
+ void setX (int);
+ void setY (int);
+
+ bool operator== (const CompPoint &) const;
+ bool operator!= (const CompPoint &) const;
+
+ typedef std::vector<CompPoint> vector;
+ typedef std::vector<CompPoint *> ptrVector;
+ typedef std::list<CompPoint> list;
+ typedef std::list<CompPoint *> ptrList;
+
+ private:
+ int mX, mY;
+};
+
+inline int
+CompPoint::x () const
+{
+ return mX;
+}
+
+inline int
+CompPoint::y () const
+{
+ return mY;
+}
+
+
+#endif
diff --git a/include/core/rect.h b/include/core/rect.h
index 4bca23c..df03fe6 100644
--- a/include/core/rect.h
+++ b/include/core/rect.h
@@ -26,6 +26,10 @@
#ifndef _COMPRECT_H
#define _COMPRECT_H
+///
+/// A 2D rectangle, which is likely in screen space. It's data is
+/// isolated and can only be mutated with set() methods.
+///
class CompRect {
public:
diff --git a/include/core/rect.h~ b/include/core/rect.h~
new file mode 100644
index 0000000..df03fe6
--- /dev/null
+++ b/include/core/rect.h~
@@ -0,0 +1,196 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ */
+
+#ifndef _COMPRECT_H
+#define _COMPRECT_H
+
+///
+/// A 2D rectangle, which is likely in screen space. It's data is
+/// isolated and can only be mutated with set() methods.
+///
+class CompRect {
+
+ public:
+ CompRect ();
+ CompRect (int x, int y, int width, int height);
+ CompRect (const CompRect&);
+ CompRect (const XRectangle);
+
+ int x () const;
+ int y () const;
+
+ int width () const;
+ int height () const;
+
+ int x1 () const;
+ int y1 () const;
+ int x2 () const;
+ int y2 () const;
+
+ int left () const;
+ int right () const;
+ int top () const;
+ int bottom () const;
+
+ int centerX () const;
+ int centerY () const;
+ CompPoint center () const;
+
+ int area () const;
+
+ const Region region () const;
+
+ void setGeometry (int x, int y,
+ int width, int height);
+
+ void setX (int);
+ void setY (int);
+ void setWidth (int);
+ void setHeight (int);
+
+ void setPos (const CompPoint&);
+ void setSize (const CompSize&);
+
+ /* Setting an edge past it's opposite edge will result in both edges
+ * being set to the new value
+ */
+ void setLeft (int);
+ void setTop (int);
+ void setRight (int);
+ void setBottom (int);
+
+ bool contains (const CompPoint &) const;
+ bool contains (const CompRect &) const;
+ bool intersects (const CompRect &) const;
+ bool isEmpty () const;
+
+ bool operator== (const CompRect &) const;
+ bool operator!= (const CompRect &) const;
+
+ CompRect operator& (const CompRect &) const;
+ CompRect& operator&= (const CompRect &);
+ CompRect& operator= (const CompRect &);
+
+ typedef std::vector<CompRect> vector;
+ typedef std::vector<CompRect *> ptrVector;
+ typedef std::list<CompRect *> ptrList;
+
+ private:
+ REGION mRegion;
+};
+
+
+inline int
+CompRect::x () const
+{
+ return mRegion.extents.x1;
+}
+
+inline int
+CompRect::y () const
+{
+ return mRegion.extents.y1;
+}
+
+inline int
+CompRect::width () const
+{
+ return mRegion.extents.x2 - mRegion.extents.x1;
+}
+
+inline int
+CompRect::height () const
+{
+ return mRegion.extents.y2 - mRegion.extents.y1;
+}
+
+inline int
+CompRect::x1 () const
+{
+ return mRegion.extents.x1;
+}
+
+inline int
+CompRect::y1 () const
+{
+ return mRegion.extents.y1;
+}
+
+inline int
+CompRect::x2 () const
+{
+ return mRegion.extents.x2;
+}
+
+inline int
+CompRect::y2 () const
+{
+ return mRegion.extents.y2;
+}
+
+inline int
+CompRect::left () const
+{
+ return mRegion.extents.x1;
+}
+
+inline int
+CompRect::right () const
+{
+ return mRegion.extents.x2;
+}
+
+inline int
+CompRect::top () const
+{
+ return mRegion.extents.y1;
+}
+
+
+inline int
+CompRect::bottom () const
+{
+ return mRegion.extents.y2;
+}
+
+inline int
+CompRect::centerX () const
+{
+ return x () + width () / 2;
+}
+
+inline int
+CompRect::centerY () const
+{
+ return y () + height () / 2;
+}
+
+inline CompPoint
+CompRect::center () const
+{
+ return CompPoint (centerX (), centerY ());
+}
+
+#endif
diff --git a/include/core/region.h b/include/core/region.h
index 30654d8..8edf1a5 100644
--- a/include/core/region.h
+++ b/include/core/region.h
@@ -34,6 +34,10 @@
class PrivateRegion;
+///
+/// A 2D region with an (x,y) position and (width, height) dimensions similar to an XRegion.
+/// It's data membmers are private and must be mutated with set() methods.
+///
class CompRegion {
public:
typedef std::vector<CompRegion> List;
diff --git a/include/core/region.h~ b/include/core/region.h~
new file mode 100644
index 0000000..8dea933
--- /dev/null
+++ b/include/core/region.h~
@@ -0,0 +1,112 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ */
+
+#ifndef _COMPREGION_H
+#define _COMPREGION_H
+
+#include <X11/Xutil.h>
+#include <X11/Xregion.h>
+
+#include <core/rect.h>
+#include <core/point.h>
+
+class PrivateRegion;
+
+///
+/// A 2D region in screen coordinates with an (x,y) position and
+/// (width, height) dimensions. It's data membmers are private and
+/// must be mutated with set() methods.
+///
+class CompRegion {
+ public:
+ typedef std::vector<CompRegion> List;
+ typedef std::vector<CompRegion *> PtrList;
+ typedef std::vector<CompRegion> Vector;
+ typedef std::vector<CompRegion *> PtrVector;
+
+ public:
+ CompRegion ();
+ CompRegion (const CompRegion &);
+ CompRegion (int x, int y, int w, int h);
+ CompRegion (const CompRect &);
+ ~CompRegion ();
+
+ CompRect boundingRect () const;
+
+ bool isEmpty () const;
+ int numRects () const;
+ CompRect::vector rects () const;
+ const Region handle () const;
+
+ bool contains (const CompPoint &) const;
+ bool contains (const CompRect &) const;
+
+ CompRegion intersected (const CompRegion &) const;
+ CompRegion intersected (const CompRect &) const;
+ bool intersects (const CompRegion &) const;
+ bool intersects (const CompRect &) const;
+ CompRegion subtracted (const CompRegion &) const;
+ CompRegion subtracted (const CompRect &) const;
+ void translate (int, int);
+ void translate (const CompPoint &);
+ CompRegion translated (int, int) const;
+ CompRegion translated (const CompPoint &) const;
+ void shrink (int, int);
+ void shrink (const CompPoint &);
+ CompRegion shrinked (int, int) const;
+ CompRegion shrinked (const CompPoint &) const;
+ CompRegion united (const CompRegion &) const;
+ CompRegion united (const CompRect &) const;
+ CompRegion xored (const CompRegion &) const;
+
+ bool operator== (const CompRegion &) const;
+ bool operator!= (const CompRegion &) const;
+ const CompRegion operator& (const CompRegion &) const;
+ const CompRegion operator& (const CompRect &) const;
+ CompRegion & operator&= (const CompRegion &);
+ CompRegion & operator&= (const CompRect &);
+ const CompRegion operator+ (const CompRegion &) const;
+ const CompRegion operator+ (const CompRect &) const;
+ CompRegion & operator+= (const CompRegion &);
+ CompRegion & operator+= (const CompRect &);
+ const CompRegion operator- (const CompRegion &) const;
+ const CompRegion operator- (const CompRect &) const;
+ CompRegion & operator-= (const CompRegion &);
+ CompRegion & operator-= (const CompRect &);
+ CompRegion & operator= (const CompRegion &);
+
+ const CompRegion operator^ (const CompRegion &) const;
+ CompRegion & operator^= (const CompRegion &);
+ const CompRegion operator| (const CompRegion &) const;
+ CompRegion & operator|= (const CompRegion &);
+
+ private:
+ PrivateRegion *priv;
+};
+
+extern const CompRegion infiniteRegion;
+extern const CompRegion emptyRegion;
+
+#endif
diff --git a/include/core/screen.h b/include/core/screen.h
index 409757c..fe182cb 100644
--- a/include/core/screen.h
+++ b/include/core/screen.h
@@ -124,7 +124,10 @@ class ScreenInterface : public WrapableInterface<CompScreen, ScreenInterface> {
virtual void outputChangeNotify ();
};
-
+///
+/// A wrapping of the X display screen. This takes care of communication to the
+/// X server.
+///
class CompScreen :
public CompSize,
public WrapableHandler<ScreenInterface, 17>,
diff --git a/include/core/screen.h~ b/include/core/screen.h~
new file mode 100644
index 0000000..409757c
--- /dev/null
+++ b/include/core/screen.h~
@@ -0,0 +1,433 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ * David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPSCREEN_H
+#define _COMPSCREEN_H
+
+#include <core/window.h>
+#include <core/output.h>
+#include <core/session.h>
+#include <core/plugin.h>
+#include <core/match.h>
+#include <core/pluginclasses.h>
+#include <core/region.h>
+#include <core/modifierhandler.h>
+
+class CompScreen;
+class PrivateScreen;
+typedef std::list<CompWindow *> CompWindowList;
+typedef std::vector<CompWindow *> CompWindowVector;
+
+extern char *backgroundImage;
+extern bool replaceCurrentWm;
+extern bool indirectRendering;
+extern bool noDetection;
+extern bool debugOutput;
+
+extern CompScreen *screen;
+extern ModifierHandler *modHandler;
+
+extern int lastPointerX;
+extern int lastPointerY;
+extern int pointerX;
+extern int pointerY;
+
+#define NOTIFY_CREATE_MASK (1 << 0)
+#define NOTIFY_DELETE_MASK (1 << 1)
+#define NOTIFY_MOVE_MASK (1 << 2)
+#define NOTIFY_MODIFY_MASK (1 << 3)
+
+typedef boost::function<void (short int)> FdWatchCallBack;
+typedef boost::function<void (const char *)> FileWatchCallBack;
+
+typedef int CompFileWatchHandle;
+typedef int CompWatchFdHandle;
+
+struct CompFileWatch {
+ CompString path;
+ int mask;
+ FileWatchCallBack callBack;
+ CompFileWatchHandle handle;
+};
+typedef std::list<CompFileWatch *> CompFileWatchList;
+
+#define ACTIVE_WINDOW_HISTORY_SIZE 64
+#define ACTIVE_WINDOW_HISTORY_NUM 32
+
+struct CompActiveWindowHistory {
+ Window id[ACTIVE_WINDOW_HISTORY_SIZE];
+ int x;
+ int y;
+ int activeNum;
+};
+
+class ScreenInterface : public WrapableInterface<CompScreen, ScreenInterface> {
+ public:
+ virtual void fileWatchAdded (CompFileWatch *fw);
+ virtual void fileWatchRemoved (CompFileWatch *fw);
+
+ virtual bool initPluginForScreen (CompPlugin *p);
+ virtual void finiPluginForScreen (CompPlugin *p);
+
+ virtual bool setOptionForPlugin (const char *plugin,
+ const char *name,
+ CompOption::Value &v);
+
+ virtual void sessionEvent (CompSession::Event event,
+ CompOption::Vector &options);
+
+ virtual void handleEvent (XEvent *event);
+ virtual void handleCompizEvent (const char * plugin, const char *event,
+ CompOption::Vector &options);
+
+ virtual bool fileToImage (CompString &path, CompSize &size,
+ int &stride, void *&data);
+ virtual bool imageToFile (CompString &path, CompString &format,
+ CompSize &size, int stride, void *data);
+
+ virtual CompMatch::Expression *matchInitExp (const CompString& value);
+
+ virtual void matchExpHandlerChanged ();
+ virtual void matchPropertyChanged (CompWindow *window);
+
+ virtual void logMessage (const char *componentName,
+ CompLogLevel level,
+ const char *message);
+
+ virtual void enterShowDesktopMode ();
+ virtual void leaveShowDesktopMode (CompWindow *window);
+
+ virtual void outputChangeNotify ();
+};
+
+
+class CompScreen :
+ public CompSize,
+ public WrapableHandler<ScreenInterface, 17>,
+ public PluginClassStorage,
+ public CompOption::Class
+{
+
+ public:
+ typedef void* GrabHandle;
+
+ public:
+ CompScreen ();
+ ~CompScreen ();
+
+ bool init (const char *name);
+
+ void eventLoop ();
+
+ CompFileWatchHandle addFileWatch (const char *path,
+ int mask,
+ FileWatchCallBack callBack);
+
+ void removeFileWatch (CompFileWatchHandle handle);
+
+ const CompFileWatchList& getFileWatches () const;
+
+ CompWatchFdHandle addWatchFd (int fd,
+ short int events,
+ FdWatchCallBack callBack);
+
+ void removeWatchFd (CompWatchFdHandle handle);
+
+ void storeValue (CompString key, CompPrivate value);
+ bool hasValue (CompString key);
+ CompPrivate getValue (CompString key);
+ void eraseValue (CompString key);
+
+ Display * dpy ();
+
+ CompOption::Vector & getOptions ();
+
+ bool setOption (const CompString &name, CompOption::Value &value);
+
+ bool XRandr ();
+
+ int randrEvent ();
+
+ bool XShape ();
+
+ int shapeEvent ();
+
+ int syncEvent ();
+
+ SnDisplay * snDisplay ();
+
+ Window activeWindow ();
+
+ Window autoRaiseWindow ();
+
+ const char * displayString ();
+
+
+ CompWindow * findWindow (Window id);
+
+ CompWindow * findTopLevelWindow (Window id,
+ bool override_redirect = false);
+
+ bool readImageFromFile (CompString &name,
+ CompSize &size,
+ void *&data);
+
+ bool writeImageToFile (CompString &path,
+ const char *format,
+ CompSize &size,
+ void *data);
+
+ unsigned int getWindowProp (Window id,
+ Atom property,
+ unsigned int defaultValue);
+
+
+ void setWindowProp (Window id,
+ Atom property,
+ unsigned int value);
+
+
+ unsigned short getWindowProp32 (Window id,
+ Atom property,
+ unsigned short defaultValue);
+
+
+ void setWindowProp32 (Window id,
+ Atom property,
+ unsigned short value);
+
+ Window root ();
+
+ int xkbEvent ();
+
+ XWindowAttributes attrib ();
+
+ int screenNum ();
+
+ CompWindowList & windows ();
+
+ void warpPointer (int dx, int dy);
+
+ Time getCurrentTime ();
+
+ Window selectionWindow ();
+
+ void forEachWindow (CompWindow::ForEach);
+
+ void focusDefaultWindow ();
+
+ void insertWindow (CompWindow *w, Window aboveId);
+
+ void unhookWindow (CompWindow *w);
+
+ Cursor normalCursor ();
+
+ Cursor invisibleCursor ();
+
+ GrabHandle pushGrab (Cursor cursor, const char *name);
+
+ void updateGrab (GrabHandle handle, Cursor cursor);
+
+ void removeGrab (GrabHandle handle, CompPoint *restorePointer);
+
+ bool otherGrabExist (const char *, ...);
+
+ bool grabExist (const char *);
+
+ const CompWindowVector & clientList (bool stackingOrder = true);
+
+ bool addAction (CompAction *action);
+
+ void removeAction (CompAction *action);
+
+ void toolkitAction (Atom toolkitAction,
+ Time eventTime,
+ Window window,
+ long data0,
+ long data1,
+ long data2);
+
+ void runCommand (CompString command);
+
+ void moveViewport (int tx, int ty, bool sync);
+
+ void sendWindowActivationRequest (Window id);
+
+ int outputDeviceForPoint (int x, int y);
+
+ CompRect getCurrentOutputExtents ();
+
+ const CompRect & getWorkareaForOutput (unsigned int outputNum) const;
+
+ void viewportForGeometry (const CompWindow::Geometry &gm,
+ CompPoint &viewport);
+
+ int outputDeviceForGeometry (const CompWindow::Geometry& gm);
+
+ CompPoint vp ();
+
+ CompSize vpSize ();
+
+ int desktopWindowCount ();
+ unsigned int activeNum () const;
+
+ CompOutput::vector & outputDevs ();
+ CompOutput & currentOutputDev () const;
+
+ const CompRect & workArea () const;
+
+ unsigned int currentDesktop ();
+
+ unsigned int nDesktop ();
+
+ CompActiveWindowHistory *currentHistory ();
+
+ const CompRegion & region () const;
+
+ bool hasOverlappingOutputs ();
+
+ CompOutput & fullscreenOutput ();
+
+ std::vector<XineramaScreenInfo> & screenInfo ();
+
+ CompIcon *defaultIcon () const;
+
+ bool updateDefaultIcon ();
+
+ static unsigned int allocPluginClassIndex ();
+ static void freePluginClassIndex (unsigned int index);
+
+ WRAPABLE_HND (0, ScreenInterface, void, fileWatchAdded, CompFileWatch *)
+ WRAPABLE_HND (1, ScreenInterface, void, fileWatchRemoved, CompFileWatch *)
+
+ WRAPABLE_HND (2, ScreenInterface, bool, initPluginForScreen,
+ CompPlugin *)
+ WRAPABLE_HND (3, ScreenInterface, void, finiPluginForScreen,
+ CompPlugin *)
+
+ WRAPABLE_HND (4, ScreenInterface, bool, setOptionForPlugin,
+ const char *, const char *, CompOption::Value &)
+
+ WRAPABLE_HND (5, ScreenInterface, void, sessionEvent, CompSession::Event,
+ CompOption::Vector &)
+ WRAPABLE_HND (6, ScreenInterface, void, handleEvent, XEvent *event)
+ WRAPABLE_HND (7, ScreenInterface, void, handleCompizEvent,
+ const char *, const char *, CompOption::Vector &)
+
+ WRAPABLE_HND (8, ScreenInterface, bool, fileToImage, CompString &,
+ CompSize &, int &, void *&);
+ WRAPABLE_HND (9, ScreenInterface, bool, imageToFile, CompString &,
+ CompString &, CompSize &, int, void *);
+
+ WRAPABLE_HND (10, ScreenInterface, CompMatch::Expression *,
+ matchInitExp, const CompString&);
+ WRAPABLE_HND (11, ScreenInterface, void, matchExpHandlerChanged)
+ WRAPABLE_HND (12, ScreenInterface, void, matchPropertyChanged,
+ CompWindow *)
+
+ WRAPABLE_HND (13, ScreenInterface, void, logMessage, const char *,
+ CompLogLevel, const char*)
+ WRAPABLE_HND (14, ScreenInterface, void, enterShowDesktopMode);
+ WRAPABLE_HND (15, ScreenInterface, void, leaveShowDesktopMode,
+ CompWindow *);
+
+ WRAPABLE_HND (16, ScreenInterface, void, outputChangeNotify);
+
+ friend class CompTimer;
+ friend class CompWindow;
+ friend class PrivateWindow;
+ friend class ModifierHandler;
+
+ private:
+ PrivateScreen *priv;
+
+ public :
+
+ static bool showDesktop (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool windowMenu (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool closeWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool unmaximizeWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool minimizeWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool maximizeWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool maximizeWinHorizontally (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool maximizeWinVertically (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool raiseWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool lowerWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool toggleWinMaximized (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool toggleWinMaximizedHorizontally (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool toggleWinMaximizedVertically (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static bool shadeWin (CompAction *action,
+ CompAction::State state,
+ CompOption::Vector &options);
+
+ static void
+ compScreenSnEvent (SnMonitorEvent *event,
+ void *userData);
+
+ static int checkForError (Display *dpy);
+};
+
+#endif
diff --git a/include/core/size.h b/include/core/size.h
index 62d6dba..5ed56fc 100644
--- a/include/core/size.h
+++ b/include/core/size.h
@@ -29,6 +29,10 @@
#include <vector>
#include <list>
+///
+/// A 2D size (likely in screen space) that can only be mutated with set() methods,
+/// since it'd data members are private.
+///
class CompSize {
public:
diff --git a/include/core/size.h~ b/include/core/size.h~
new file mode 100644
index 0000000..62d6dba
--- /dev/null
+++ b/include/core/size.h~
@@ -0,0 +1,65 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ */
+
+#ifndef _COMPSIZE_H
+#define _COMPSIZE_H
+
+#include <vector>
+#include <list>
+
+class CompSize {
+
+ public:
+ CompSize ();
+ CompSize (int, int);
+
+ int width () const;
+ int height () const;
+
+ void setWidth (int);
+ void setHeight (int);
+
+ typedef std::vector<CompSize> vector;
+ typedef std::vector<CompSize *> ptrVector;
+ typedef std::list<CompSize> list;
+ typedef std::list<CompSize *> ptrList;
+
+ private:
+ int mWidth, mHeight;
+};
+
+inline int
+CompSize::width () const
+{
+ return mWidth;
+}
+
+inline int
+CompSize::height () const
+{
+ return mHeight;
+}
+
+#endif
diff --git a/include/core/window.h b/include/core/window.h
index 7983c03..6628252 100644
--- a/include/core/window.h
+++ b/include/core/window.h
@@ -232,6 +232,10 @@ class WindowInterface : public WrapableInterface<CompWindow, WindowInterface>
virtual bool isFocussable ();
};
+///
+/// An Window object that wraps an X window. This handles snychronization of
+/// window state, geometry, etc. between Compiz and the X server.
+///
class CompWindow :
public WrapableHandler<WindowInterface, 15>,
public PluginClassStorage
diff --git a/include/core/window.h~ b/include/core/window.h~
new file mode 100644
index 0000000..5478302
--- /dev/null
+++ b/include/core/window.h~
@@ -0,0 +1,521 @@
+/*
+ * Copyright © 2008 Dennis Kasprzyk
+ * Copyright © 2007 Novell, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Dennis Kasprzyk not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Dennis Kasprzyk makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
+ * David Reveman <davidr@novell.com>
+ */
+
+#ifndef _COMPWINDOW_H
+#define _COMPWINDOW_H
+
+#include <boost/function.hpp>
+
+#include <X11/Xlib-xcb.h>
+#include <X11/Xutil.h>
+#include <X11/Xregion.h>
+#include <X11/extensions/Xdamage.h>
+#include <X11/extensions/sync.h>
+
+#include <core/action.h>
+#include <core/pluginclasses.h>
+#include <core/size.h>
+#include <core/point.h>
+#include <core/region.h>
+
+#include <core/wrapsystem.h>
+
+#include <map>
+
+class CompWindow;
+class CompIcon;
+class PrivateWindow;
+struct CompStartupSequence;
+
+#define ROOTPARENT(x) (((x)->frame ()) ? (x)->frame () : (x)->id ())
+
+#define CompWindowProtocolDeleteMask (1 << 0)
+#define CompWindowProtocolTakeFocusMask (1 << 1)
+#define CompWindowProtocolPingMask (1 << 2)
+#define CompWindowProtocolSyncRequestMask (1 << 3)
+
+#define CompWindowTypeDesktopMask (1 << 0)
+#define CompWindowTypeDockMask (1 << 1)
+#define CompWindowTypeToolbarMask (1 << 2)
+#define CompWindowTypeMenuMask (1 << 3)
+#define CompWindowTypeUtilMask (1 << 4)
+#define CompWindowTypeSplashMask (1 << 5)
+#define CompWindowTypeDialogMask (1 << 6)
+#define CompWindowTypeNormalMask (1 << 7)
+#define CompWindowTypeDropdownMenuMask (1 << 8)
+#define CompWindowTypePopupMenuMask (1 << 9)
+#define CompWindowTypeTooltipMask (1 << 10)
+#define CompWindowTypeNotificationMask (1 << 11)
+#define CompWindowTypeComboMask (1 << 12)
+#define CompWindowTypeDndMask (1 << 13)
+#define CompWindowTypeModalDialogMask (1 << 14)
+#define CompWindowTypeFullscreenMask (1 << 15)
+#define CompWindowTypeUnknownMask (1 << 16)
+
+#define NO_FOCUS_MASK (CompWindowTypeDesktopMask | \
+ CompWindowTypeDockMask | \
+ CompWindowTypeSplashMask)
+
+#define CompWindowStateModalMask (1 << 0)
+#define CompWindowStateStickyMask (1 << 1)
+#define CompWindowStateMaximizedVertMask (1 << 2)
+#define CompWindowStateMaximizedHorzMask (1 << 3)
+#define CompWindowStateShadedMask (1 << 4)
+#define CompWindowStateSkipTaskbarMask (1 << 5)
+#define CompWindowStateSkipPagerMask (1 << 6)
+#define CompWindowStateHiddenMask (1 << 7)
+#define CompWindowStateFullscreenMask (1 << 8)
+#define CompWindowStateAboveMask (1 << 9)
+#define CompWindowStateBelowMask (1 << 10)
+#define CompWindowStateDemandsAttentionMask (1 << 11)
+#define CompWindowStateDisplayModalMask (1 << 12)
+
+#define MAXIMIZE_STATE (CompWindowStateMaximizedHorzMask | \
+ CompWindowStateMaximizedVertMask)
+
+#define CompWindowActionMoveMask (1 << 0)
+#define CompWindowActionResizeMask (1 << 1)
+#define CompWindowActionStickMask (1 << 2)
+#define CompWindowActionMinimizeMask (1 << 3)
+#define CompWindowActionMaximizeHorzMask (1 << 4)
+#define CompWindowActionMaximizeVertMask (1 << 5)
+#define CompWindowActionFullscreenMask (1 << 6)
+#define CompWindowActionCloseMask (1 << 7)
+#define CompWindowActionShadeMask (1 << 8)
+#define CompWindowActionChangeDesktopMask (1 << 9)
+#define CompWindowActionAboveMask (1 << 10)
+#define CompWindowActionBelowMask (1 << 11)
+
+#define MwmFuncAll (1L << 0)
+#define MwmFuncResize (1L << 1)
+#define MwmFuncMove (1L << 2)
+#define MwmFuncIconify (1L << 3)
+#define MwmFuncMaximize (1L << 4)
+#define MwmFuncClose (1L << 5)
+
+#define MwmDecorHandle (1L << 2)
+#define MwmDecorTitle (1L << 3)
+#define MwmDecorMenu (1L << 4)
+#define MwmDecorMinimize (1L << 5)
+#define MwmDecorMaximize (1L << 6)
+
+#define MwmDecorAll (1L << 0)
+#define MwmDecorBorder (1L << 1)
+#define MwmDecorHandle (1L << 2)
+#define MwmDecorTitle (1L << 3)
+#define MwmDecorMenu (1L << 4)
+#define MwmDecorMinimize (1L << 5)
+#define MwmDecorMaximize (1L << 6)
+
+#define WmMoveResizeSizeTopLeft 0
+#define WmMoveResizeSizeTop 1
+#define WmMoveResizeSizeTopRight 2
+#define WmMoveResizeSizeRight 3
+#define WmMoveResizeSizeBottomRight 4
+#define WmMoveResizeSizeBottom 5
+#define WmMoveResizeSizeBottomLeft 6
+#define WmMoveResizeSizeLeft 7
+#define WmMoveResizeMove 8
+#define WmMoveResizeSizeKeyboard 9
+#define WmMoveResizeMoveKeyboard 10
+#define WmMoveResizeCancel 11
+
+/* EWMH source indication client types */
+#define ClientTypeUnknown 0
+#define ClientTypeApplication 1
+#define ClientTypePager 2
+
+#define CompWindowGrabKeyMask (1 << 0)
+#define CompWindowGrabButtonMask (1 << 1)
+#define CompWindowGrabMoveMask (1 << 2)
+#define CompWindowGrabResizeMask (1 << 3)
+
+
+enum CompStackingUpdateMode {
+ CompStackingUpdateModeNone = 0,
+ CompStackingUpdateModeNormal,
+ CompStackingUpdateModeAboveFullscreen,
+ CompStackingUpdateModeInitialMap,
+ CompStackingUpdateModeInitialMapDeniedFocus
+};
+
+enum CompWindowNotify {
+ CompWindowNotifyMap,
+ CompWindowNotifyUnmap,
+ CompWindowNotifyRestack,
+ CompWindowNotifyHide,
+ CompWindowNotifyShow,
+ CompWindowNotifyAliveChanged,
+ CompWindowNotifySyncAlarm,
+ CompWindowNotifyReparent,
+ CompWindowNotifyUnreparent,
+ CompWindowNotifyFrameUpdate,
+ CompWindowNotifyFocusChange,
+ CompWindowNotifyBeforeUnmap,
+ CompWindowNotifyBeforeDestroy,
+ CompWindowNotifyClose,
+ CompWindowNotifyMinimize,
+ CompWindowNotifyUnminimize,
+ CompWindowNotifyShade,
+ CompWindowNotifyUnshade,
+ CompWindowNotifyEnterShowDesktopMode,
+ CompWindowNotifyLeaveShowDesktopMode
+};
+
+struct CompWindowExtents {
+ int left;
+ int right;
+ int top;
+ int bottom;
+};
+
+struct CompStruts {
+ XRectangle left;
+ XRectangle right;
+ XRectangle top;
+ XRectangle bottom;
+};
+
+class WindowInterface : public WrapableInterface<CompWindow, WindowInterface>
+{
+ public:
+ virtual void getOutputExtents (CompWindowExtents& output);
+
+ virtual void getAllowedActions (unsigned int &setActions,
+ unsigned int &clearActions);
+
+ virtual bool focus ();
+ virtual void activate ();
+ virtual bool place (CompPoint &pos);
+
+ virtual void validateResizeRequest (unsigned int &mask,
+ XWindowChanges *xwc,
+ unsigned int source);
+
+ virtual void resizeNotify (int dx, int dy, int dwidth, int dheight);
+ virtual void moveNotify (int dx, int dy, bool immediate);
+ virtual void windowNotify (CompWindowNotify n);
+
+ virtual void grabNotify (int x, int y,
+ unsigned int state, unsigned int mask);
+ virtual void ungrabNotify ();
+
+ virtual void stateChangeNotify (unsigned int lastState);
+
+ virtual void updateFrameRegion (CompRegion &region);
+
+ virtual bool alpha ();
+ virtual bool isFocussable ();
+};
+
+///
+/// An Window object that wraps the X server functions. This handles snychronization of
+/// window state, geometry, etc. between Compiz and the X server.
+///
+class CompWindow :
+ public WrapableHandler<WindowInterface, 15>,
+ public PluginClassStorage
+{
+ public:
+
+ class Geometry : public CompRect
+ {
+ public:
+ Geometry ();
+ Geometry (int, int, int, int, int);
+
+ int border () const;
+
+ void set (int, int, int, int, int);
+ void setBorder (int);
+
+ private:
+ int mBorder;
+ };
+
+ typedef boost::function<void (CompWindow *)> ForEach;
+ typedef std::map<Window, CompWindow *> Map;
+
+ public:
+ CompWindow *next;
+ CompWindow *prev;
+
+ public:
+ CompWindow (Window id,
+ Window aboveId);
+ ~CompWindow ();
+
+ Geometry & geometry () const;
+
+ int x () const;
+ int y () const;
+ CompPoint pos () const;
+
+ /* With border */
+ int width () const;
+ int height () const;
+ CompSize size () const;
+
+ Geometry & serverGeometry () const;
+
+ int serverX () const;
+ int serverY () const;
+ CompPoint serverPos () const;
+
+ /* With border */
+ int serverWidth () const;
+ int serverHeight () const;
+ const CompSize serverSize () const;
+
+ /* includes decorations */
+ CompRect inputRect () const;
+ CompRect serverInputRect () const;
+
+ /* includes decorations and shadows */
+ CompRect outputRect () const;
+ CompRect serverOutputRect () const;
+
+ Window id ();
+ Window frame ();
+
+ const CompRegion & region () const;
+
+ const CompRegion & frameRegion () const;
+
+ void updateFrameRegion ();
+ void setWindowFrameExtents (CompWindowExtents *input);
+
+ unsigned int & wmType ();
+
+ unsigned int type ();
+
+ unsigned int & state ();
+
+ unsigned int actions ();
+
+ unsigned int & protocols ();
+
+ void close (Time serverTime);
+
+ bool inShowDesktopMode ();
+
+ void setShowDesktopMode (bool);
+
+ bool managed ();
+
+ bool grabbed ();
+
+ int pendingMaps ();
+
+ unsigned int activeNum ();
+
+ int mapNum () const;
+
+ CompStruts * struts ();
+
+ int & saveMask ();
+
+ XWindowChanges & saveWc ();
+
+ void moveToViewportPosition (int x, int y, bool sync);
+
+ char * startupId ();
+
+ unsigned int desktop ();
+
+ Window clientLeader ();
+
+ void changeState (unsigned int newState);
+
+ void recalcActions ();
+
+ void recalcType ();
+
+ void updateWindowOutputExtents ();
+
+ void destroy ();
+
+ void sendConfigureNotify ();
+
+ void sendSyncRequest ();
+
+ XSyncAlarm syncAlarm ();
+
+ void map ();
+
+ void unmap ();
+
+ void incrementUnmapReference ();
+
+ void incrementDestroyReference ();
+
+ bool hasUnmapReference ();
+
+ bool resize (XWindowAttributes);
+
+ bool resize (Geometry);
+
+ bool resize (int x, int y, int width, int height,
+ int border = 0);
+
+ void move (int dx, int dy, bool immediate = true);
+
+ void syncPosition ();
+
+ void moveInputFocusTo ();
+
+ void moveInputFocusToOtherWindow ();
+
+ void configureXWindow (unsigned int valueMask,
+ XWindowChanges *xwc);
+
+ void moveResize (XWindowChanges *xwc,
+ unsigned int xwcm,
+ int gravity,
+ unsigned int source);
+
+ void raise ();
+
+ void lower ();
+
+ void restackAbove (CompWindow *sibling);
+
+ void restackBelow (CompWindow *sibling);
+
+ void updateAttributes (CompStackingUpdateMode stackingMode);
+
+ void hide ();
+
+ void show ();
+
+ void minimize ();
+
+ void unminimize ();
+
+ void maximize (unsigned int state = 0);
+
+ CompPoint defaultViewport ();
+
+ CompPoint & initialViewport () const;
+
+ CompIcon * getIcon (int width, int height);
+
+ const CompRect & iconGeometry () const;
+
+ int outputDevice ();
+
+ void setDesktop (unsigned int desktop);
+
+ bool onCurrentDesktop ();
+
+ bool onAllViewports ();
+
+ CompPoint getMovementForOffset (CompPoint offset);
+
+ Window transientFor ();
+
+ int pendingUnmaps ();
+
+ bool minimized ();
+
+ bool placed ();
+
+ bool shaded ();
+
+ CompWindowExtents & input () const;
+
+ CompWindowExtents & output () const;
+
+ XSizeHints & sizeHints () const;
+
+ bool destroyed ();
+
+ bool invisible ();
+
+ bool syncWait ();
+
+ bool alive ();
+
+ bool overrideRedirect ();
+
+ bool isMapped () const;
+ bool isViewable () const;
+
+ int windowClass ();
+
+ unsigned int depth ();
+
+ unsigned int mwmDecor ();
+ unsigned int mwmFunc ();
+
+ bool constrainNewWindowSize (int width,
+ int height,
+ int *newWidth,
+ int *newHeight);
+
+ static unsigned int constrainWindowState (unsigned int state,
+ unsigned int actions);
+
+ static unsigned int allocPluginClassIndex ();
+ static void freePluginClassIndex (unsigned int index);
+
+ WRAPABLE_HND (0, WindowInterface, void, getOutputExtents,
+ CompWindowExtents&);
+ WRAPABLE_HND (1, WindowInterface, void, getAllowedActions,
+ unsigned int &, unsigned int &);
+
+ WRAPABLE_HND (2, WindowInterface, bool, focus);
+ WRAPABLE_HND (3, WindowInterface, void, activate);
+ WRAPABLE_HND (4, WindowInterface, bool, place, CompPoint &);
+ WRAPABLE_HND (5, WindowInterface, void, validateResizeRequest,
+ unsigned int &, XWindowChanges *, unsigned int);
+
+ WRAPABLE_HND (6, WindowInterface, void, resizeNotify,
+ int, int, int, int);
+ WRAPABLE_HND (7, WindowInterface, void, moveNotify, int, int, bool);
+ WRAPABLE_HND (8, WindowInterface, void, windowNotify, CompWindowNotify);
+ WRAPABLE_HND (9, WindowInterface, void, grabNotify, int, int,
+ unsigned int, unsigned int);
+ WRAPABLE_HND (10, WindowInterface, void, ungrabNotify);
+ WRAPABLE_HND (11, WindowInterface, void, stateChangeNotify,
+ unsigned int);
+
+ WRAPABLE_HND (12, WindowInterface, void, updateFrameRegion,
+ CompRegion &);
+
+ WRAPABLE_HND (13, WindowInterface, bool, alpha);
+ WRAPABLE_HND (14, WindowInterface, bool, isFocussable);
+
+ friend class PrivateWindow;
+ friend class CompScreen;
+ friend class PrivateScreen;
+
+ private:
+ PrivateWindow *priv;
+};
+
+#endif