diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/action.h | 2 | ||||
-rw-r--r-- | include/core/match.h | 2 | ||||
-rw-r--r-- | include/core/option.h | 2 | ||||
-rw-r--r-- | include/core/output.h | 2 | ||||
-rw-r--r-- | include/core/plugin.h | 16 | ||||
-rw-r--r-- | include/core/pluginclasses.h | 4 | ||||
-rw-r--r-- | include/core/pluginclasshandler.h | 2 | ||||
-rw-r--r-- | include/core/region.h | 6 | ||||
-rw-r--r-- | include/core/screen.h | 23 | ||||
-rw-r--r-- | include/core/window.h | 32 | ||||
-rw-r--r-- | include/core/wrapsystem.h | 81 |
11 files changed, 84 insertions, 88 deletions
diff --git a/include/core/action.h b/include/core/action.h index 9e16df1..e24a6d1 100644 --- a/include/core/action.h +++ b/include/core/action.h @@ -134,7 +134,7 @@ class CompAction { KeyBinding & key (); void setKey (const KeyBinding &key); - + ButtonBinding & button (); void setButton (const ButtonBinding &button); diff --git a/include/core/match.h b/include/core/match.h index 4afbec7..de26b5a 100644 --- a/include/core/match.h +++ b/include/core/match.h @@ -42,7 +42,7 @@ class CompMatch { virtual ~Expression () {}; virtual bool evaluate (CompWindow *window) = 0; }; - + public: CompMatch (); CompMatch (const CompString); diff --git a/include/core/option.h b/include/core/option.h index c9e26fe..2d9ba5f 100644 --- a/include/core/option.h +++ b/include/core/option.h @@ -159,7 +159,7 @@ class CompOption { ~CompOption (); void setName (CompString name, Type type); - + CompString name (); Type type (); diff --git a/include/core/output.h b/include/core/output.h index 0fba119..0d12d54 100644 --- a/include/core/output.h +++ b/include/core/output.h @@ -37,7 +37,7 @@ class CompOutput : public CompRect { CompOutput (); CompString name () const; - + unsigned int id () const; const CompRect& workArea () const; diff --git a/include/core/plugin.h b/include/core/plugin.h index cb15018..8c0581d 100644 --- a/include/core/plugin.h +++ b/include/core/plugin.h @@ -44,7 +44,7 @@ extern CompScreen *screen; if (!name##VTable) \ { \ name##VTable = new classname (); \ - name##VTable->initVTable (TOSTRING(name), &name##VTable); \ + name##VTable->initVTable (TOSTRING (name), &name##VTable);\ return name##VTable; \ } \ else \ @@ -82,7 +82,7 @@ class CompPlugin { void initVTable (CompString name, CompPlugin::VTable **self = NULL); - + const CompString name () const; virtual bool init () = 0; @@ -96,7 +96,7 @@ class CompPlugin { virtual bool initWindow (CompWindow *w); virtual void finiWindow (CompWindow *w); - + virtual CompOption::Vector & getOptions (); virtual bool setOption (const CompString &name, @@ -134,7 +134,7 @@ class CompPlugin { struct cmpStr { - bool operator() (const char *a, const char *b) const + bool operator () (const char *a, const char *b) const { return strcmp (a, b) < 0; } @@ -221,7 +221,7 @@ void CompPlugin::VTableForScreenAndWindow<T,T2>::finiWindow (CompWindow *w) template <typename T, typename T2> CompOption::Vector & CompPlugin::VTableForScreenAndWindow<T,T2>::getOptions () { - CompOption::Class *oc = dynamic_cast<CompOption::Class *>(T::get (screen)); + CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen)); if (!oc) return noOptions; return oc->getOptions (); @@ -231,7 +231,7 @@ 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)); + CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen)); if (!oc) return false; return oc->setOption (name, value); @@ -259,7 +259,7 @@ void CompPlugin::VTableForScreen<T>::finiScreen (CompScreen *s) template <typename T> CompOption::Vector & CompPlugin::VTableForScreen<T>::getOptions () { - CompOption::Class *oc = dynamic_cast<CompOption::Class *>(T::get (screen)); + CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen)); if (!oc) return noOptions; return oc->getOptions (); @@ -269,7 +269,7 @@ template <typename T> bool CompPlugin::VTableForScreen<T>::setOption (const CompString &name, CompOption::Value &value) { - CompOption::Class *oc = dynamic_cast<CompOption::Class *>(T::get (screen)); + CompOption::Class *oc = dynamic_cast<CompOption::Class *> (T::get (screen)); if (!oc) return false; return oc->setOption (name, value); diff --git a/include/core/pluginclasses.h b/include/core/pluginclasses.h index 0ba2502..351ac7c 100644 --- a/include/core/pluginclasses.h +++ b/include/core/pluginclasses.h @@ -32,10 +32,10 @@ class PluginClassIndex { public: - PluginClassIndex () : index(-1), refCount (0), + PluginClassIndex () : index (-1), refCount (0), initiated (false), failed (false), pcFailed (false), pcIndex (0) {} - + int index; int refCount; bool initiated; diff --git a/include/core/pluginclasshandler.h b/include/core/pluginclasshandler.h index a833e53..2b0e809 100644 --- a/include/core/pluginclasshandler.h +++ b/include/core/pluginclasshandler.h @@ -43,7 +43,7 @@ class PluginClassHandler { void setFailed () { mFailed = true; }; bool loadFailed () { return mFailed; }; - + Tb * get () { return mBase; }; static Tp * get (Tb *); diff --git a/include/core/region.h b/include/core/region.h index fe6df71..30654d8 100644 --- a/include/core/region.h +++ b/include/core/region.h @@ -75,7 +75,7 @@ class CompRegion { 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; @@ -91,12 +91,12 @@ class CompRegion { 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; }; diff --git a/include/core/screen.h b/include/core/screen.h index a076b42..1f4e064 100644 --- a/include/core/screen.h +++ b/include/core/screen.h @@ -137,7 +137,7 @@ class CompScreen : ~CompScreen (); bool init (const char *name); - + void eventLoop (); CompFileWatchHandle addFileWatch (const char *path, @@ -145,21 +145,21 @@ class CompScreen : 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(); + + Display * dpy (); CompOption::Vector & getOptions (); @@ -168,7 +168,7 @@ class CompScreen : bool XRandr (); int randrEvent (); - + bool XShape (); int shapeEvent (); @@ -176,9 +176,9 @@ class CompScreen : int syncEvent (); SnDisplay * snDisplay (); - + Window activeWindow (); - + Window autoRaiseWindow (); const char * displayString (); @@ -217,7 +217,6 @@ class CompScreen : Atom property, unsigned short value); - Window root (); int xkbEvent (); @@ -336,7 +335,7 @@ class CompScreen : 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) @@ -395,7 +394,7 @@ class CompScreen : static bool raiseWin (CompAction *action, CompAction::State state, CompOption::Vector &options); - + static bool lowerWin (CompAction *action, CompAction::State state, CompOption::Vector &options); diff --git a/include/core/window.h b/include/core/window.h index 689312b..211dbdf 100644 --- a/include/core/window.h +++ b/include/core/window.h @@ -190,7 +190,8 @@ struct CompStruts { XRectangle bottom; }; -class WindowInterface : public WrapableInterface<CompWindow, WindowInterface> { +class WindowInterface : public WrapableInterface<CompWindow, WindowInterface> +{ public: virtual void getOutputExtents (CompWindowExtents& output); @@ -208,7 +209,7 @@ class WindowInterface : public WrapableInterface<CompWindow, WindowInterface> { 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 (); @@ -222,11 +223,10 @@ class CompWindow : public WrapableHandler<WindowInterface, 13>, public PluginClassStorage { - public: - class Geometry : public CompRect { - + class Geometry : public CompRect + { public: Geometry (); Geometry (int, int, unsigned int, unsigned int, unsigned int); @@ -240,18 +240,14 @@ class CompWindow : unsigned 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 (); @@ -266,7 +262,7 @@ class CompWindow : unsigned int width () const; unsigned int height () const; CompSize size () const; - + Geometry & serverGeometry () const; int serverX () const; @@ -289,13 +285,13 @@ class CompWindow : void setWindowFrameExtents (CompWindowExtents *input); unsigned int & wmType (); - + unsigned int type (); - + unsigned int & state (); - + unsigned int actions (); - + unsigned int & protocols (); void close (Time serverTime); @@ -347,7 +343,7 @@ class CompWindow : void unmap (); bool resize (XWindowAttributes); - + bool resize (Geometry); bool resize (int x, int y, unsigned int width, unsigned int height, @@ -451,7 +447,7 @@ class CompWindow : int height, int *newWidth, int *newHeight); - + static unsigned int constrainWindowState (unsigned int state, unsigned int actions); @@ -485,7 +481,7 @@ class CompWindow : friend class PrivateWindow; friend class CompScreen; friend class PrivateScreen; - + private: PrivateWindow *priv; }; diff --git a/include/core/wrapsystem.h b/include/core/wrapsystem.h index 3c3b324..c71c599 100644 --- a/include/core/wrapsystem.h +++ b/include/core/wrapsystem.h @@ -29,14 +29,14 @@ #include <stdlib.h> #include <vector> -#define WRAPABLE_DEF(func, ...) \ -{ \ +#define WRAPABLE_DEF(func, ...) \ +{ \ mHandler-> func ## SetEnabled (this, false); \ - return mHandler-> func (__VA_ARGS__); \ + return mHandler-> func (__VA_ARGS__); \ } -#define WRAPABLE_HND(num,itype,rtype, func, ...) \ - rtype func (__VA_ARGS__); \ +#define WRAPABLE_HND(num,itype,rtype, func, ...) \ + rtype func (__VA_ARGS__); \ void func ## SetEnabled (itype *obj, bool enabled) \ { \ functionSetEnabled (obj, num, enabled); \ @@ -50,41 +50,41 @@ mCurrFunction[num] = index; \ } -#define WRAPABLE_HND_FUNC(num, func, ...) \ -{ \ - unsigned int curr = mCurrFunction[num]; \ - while (mCurrFunction[num] < mInterface.size() && \ - !mInterface[mCurrFunction[num]].enabled[num]) \ +#define WRAPABLE_HND_FUNC(num, func, ...) \ +{ \ + unsigned int curr = mCurrFunction[num]; \ + while (mCurrFunction[num] < mInterface.size () && \ + !mInterface[mCurrFunction[num]].enabled[num]) \ mCurrFunction[num]++; \ - if (mCurrFunction[num] < mInterface.size()) \ - { \ - mInterface[mCurrFunction[num]++].obj-> func (__VA_ARGS__); \ - mCurrFunction[num] = curr; \ - return; \ - } \ - mCurrFunction[num] = curr; \ + if (mCurrFunction[num] < mInterface.size ()) \ + { \ + mInterface[mCurrFunction[num]++].obj-> func (__VA_ARGS__); \ + mCurrFunction[num] = curr; \ + return; \ + } \ + mCurrFunction[num] = curr; \ } -#define WRAPABLE_HND_FUNC_RETURN(num, rtype, func, ...) \ -{ \ - unsigned int curr = mCurrFunction[num]; \ - rtype rv; \ - while (mCurrFunction[num] < mInterface.size() && \ - !mInterface[mCurrFunction[num]].enabled[num]) \ - mCurrFunction[num]++; \ - if (mCurrFunction[num] < mInterface.size()) \ - { \ +#define WRAPABLE_HND_FUNC_RETURN(num, rtype, func, ...) \ +{ \ + unsigned int curr = mCurrFunction[num]; \ + rtype rv; \ + while (mCurrFunction[num] < mInterface.size () && \ + !mInterface[mCurrFunction[num]].enabled[num]) \ + mCurrFunction[num]++; \ + if (mCurrFunction[num] < mInterface.size ()) \ + { \ rv = mInterface[mCurrFunction[num]++].obj-> func (__VA_ARGS__); \ - mCurrFunction[num] = curr; \ - return rv; \ - } \ - mCurrFunction[num] = curr; \ + mCurrFunction[num] = curr; \ + return rv; \ + } \ + mCurrFunction[num] = curr; \ } template <typename T, typename T2> class WrapableInterface { protected: - WrapableInterface () : mHandler(0) {}; + WrapableInterface () : mHandler (0) {}; virtual ~WrapableInterface () { if (mHandler) @@ -103,17 +103,18 @@ class WrapableInterface { }; template <typename T, unsigned int N> -class WrapableHandler : public T { - +class WrapableHandler : public T +{ public: void registerWrap (T *, bool); void unregisterWrap (T *); - unsigned int numWrapClients () { return mInterface.size (); }; - + unsigned int numWrapClients () { return mInterface.size (); }; + protected: - class Interface { + class Interface + { public: T *obj; bool *enabled; @@ -131,7 +132,7 @@ class WrapableHandler : public T { ~WrapableHandler () { typename std::vector<Interface>::iterator it; - for (it = mInterface.begin(); it != mInterface.end(); it++) + for (it = mInterface.begin (); it != mInterface.end (); it++) delete [] (*it).enabled; mInterface.clear (); delete [] mCurrFunction; @@ -153,14 +154,14 @@ void WrapableHandler<T,N>::registerWrap (T *obj, bool enabled) return; for (unsigned int i = 0; i < N; i++) in.enabled[i] = enabled; - mInterface.insert (mInterface.begin(), in); + mInterface.insert (mInterface.begin (), in); }; template <typename T, unsigned int N> void WrapableHandler<T,N>::unregisterWrap (T *obj) { typename std::vector<Interface>::iterator it; - for (it = mInterface.begin(); it != mInterface.end(); it++) + for (it = mInterface.begin (); it != mInterface.end (); it++) if ((*it).obj == obj) { delete [] (*it).enabled; @@ -173,7 +174,7 @@ template <typename T, unsigned int N> void WrapableHandler<T,N>::functionSetEnabled (T *obj, unsigned int num, bool enabled) { - for (unsigned int i = 0; i < mInterface.size(); i++) + for (unsigned int i = 0; i < mInterface.size (); i++) if (mInterface[i].obj == obj) { mInterface[i].enabled[num] = enabled; |