summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKristopher Ives <kris@leetbook2.(none)>2009-10-28 22:52:59 -0700
committerKristopher Ives <kris@leetbook2.(none)>2009-10-28 22:52:59 -0700
commit9f97563380232285d1b8765b73f162576a2a430b (patch)
tree19a0e6ffbf7eafd0ced05cecd1ac1700e8b38f23 /include
parentfae3b156daeb3cd833ab9d7ff1e4b13b904be7c7 (diff)
downloadzcomp-9f97563380232285d1b8765b73f162576a2a430b.tar.gz
zcomp-9f97563380232285d1b8765b73f162576a2a430b.tar.bz2
Deleted auto backup files again.
Diffstat (limited to 'include')
-rw-r--r--include/core/option.h~228
-rw-r--r--include/core/output.h~61
-rw-r--r--include/core/plugin.h~323
-rw-r--r--include/core/rect.h~196
-rw-r--r--include/core/screen.h~433
-rw-r--r--include/core/size.h~65
-rw-r--r--include/core/window.h~521
7 files changed, 0 insertions, 1827 deletions
diff --git a/include/core/option.h~ b/include/core/option.h~
deleted file mode 100644
index ee91715..0000000
--- a/include/core/option.h~
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * 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~
deleted file mode 100644
index b925c90..0000000
--- a/include/core/output.h~
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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~
deleted file mode 100644
index b0f68c6..0000000
--- a/include/core/plugin.h~
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * 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/rect.h~ b/include/core/rect.h~
deleted file mode 100644
index df03fe6..0000000
--- a/include/core/rect.h~
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * 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/screen.h~ b/include/core/screen.h~
deleted file mode 100644
index 409757c..0000000
--- a/include/core/screen.h~
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * 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~
deleted file mode 100644
index 62d6dba..0000000
--- a/include/core/size.h~
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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~
deleted file mode 100644
index 5478302..0000000
--- a/include/core/window.h~
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- * 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