summaryrefslogtreecommitdiff
path: root/include/core
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-03-14 10:18:02 -0500
committerErkin Bahceci <erkinbah@gmail.com>2009-03-14 10:18:02 -0500
commite3f9970accd581f5edc738bb06ac2fca7e8c131e (patch)
treebcf1df11cf3179186632b37fddb4fc22ea9aa418 /include/core
parent28e45c55c11e20206d3bc9056aea8fc7f1b7a0e7 (diff)
downloadmobileperf-e3f9970accd581f5edc738bb06ac2fca7e8c131e.tar.gz
mobileperf-e3f9970accd581f5edc738bb06ac2fca7e8c131e.tar.bz2
Rename Private* -> PluginClass* where appropriate.
To improve/correct the meaning of some class and file names, this commit renames: core/privatehandler.h -> core/pluginclasshandler.h core/privates.h -> core/pluginclasses.h CompPrivateStorage -> PluginClassStorage PrivateHandler -> PluginClassHandler *PrivateIndex -> *PluginClassIndex
Diffstat (limited to 'include/core')
-rw-r--r--include/core/CMakeLists.txt6
-rw-r--r--include/core/core.h2
-rw-r--r--include/core/plugin.h7
-rw-r--r--include/core/pluginclasses.h (renamed from include/core/privates.h)31
-rw-r--r--include/core/pluginclasshandler.h (renamed from include/core/privatehandler.h)72
-rw-r--r--include/core/screen.h8
-rw-r--r--include/core/window.h8
7 files changed, 67 insertions, 67 deletions
diff --git a/include/core/CMakeLists.txt b/include/core/CMakeLists.txt
index dc94393..565e1c2 100644
--- a/include/core/CMakeLists.txt
+++ b/include/core/CMakeLists.txt
@@ -9,8 +9,8 @@ set (_headers
output.h
plugin.h
point.h
- privatehandler.h
- privates.h
+ pluginclasshandler.h
+ pluginclasses.h
rect.h
region.h
screen.h
@@ -24,4 +24,4 @@ set (_headers
install (
FILES ${_headers}
DESTINATION ${includedir}/compiz/core
-) \ No newline at end of file
+)
diff --git a/include/core/core.h b/include/core/core.h
index 33d9645..2937a35 100644
--- a/include/core/core.h
+++ b/include/core/core.h
@@ -66,7 +66,7 @@ typedef XBool Bool;
# define BITMAP_BIT_ORDER LSBFirst
#endif
-#include <core/privates.h>
+#include <core/pluginclasses.h>
#include <core/screen.h>
#include <core/window.h>
#include <core/plugin.h>
diff --git a/include/core/plugin.h b/include/core/plugin.h
index 40aed47..02e35a1 100644
--- a/include/core/plugin.h
+++ b/include/core/plugin.h
@@ -84,6 +84,13 @@ extern LoadPluginProc loaderLoadPlugin;
extern UnloadPluginProc loaderUnloadPlugin;
extern ListPluginsProc loaderListPlugins;
+union CompPrivate {
+ void *ptr;
+ long val;
+ unsigned long uval;
+ void *(*fptr) (void);
+};
+
class CompPlugin {
public:
class VTable {
diff --git a/include/core/privates.h b/include/core/pluginclasses.h
index bd64798..0ba2502 100644
--- a/include/core/privates.h
+++ b/include/core/pluginclasses.h
@@ -25,32 +25,39 @@
* David Reveman <davidr@novell.com>
*/
-#ifndef _PRIVATES_H
-#define _PRIVATES_H
+#ifndef _PLUGINCLASSES_H
+#define _PLUGINCLASSES_H
#include <vector>
-union CompPrivate {
- void *ptr;
- long val;
- unsigned long uval;
- void *(*fptr) (void);
+class PluginClassIndex {
+ public:
+ PluginClassIndex () : index(-1), refCount (0),
+ initiated (false), failed (false),
+ pcFailed (false), pcIndex (0) {}
+
+ int index;
+ int refCount;
+ bool initiated;
+ bool failed;
+ bool pcFailed;
+ unsigned int pcIndex;
};
-class CompPrivateStorage {
+class PluginClassStorage {
public:
typedef std::vector<bool> Indices;
public:
- CompPrivateStorage (Indices& iList);
+ PluginClassStorage (Indices& iList);
public:
- std::vector<CompPrivate> privates;
+ std::vector<void *> pluginClasses;
protected:
- static int allocatePrivateIndex (Indices& iList);
- static void freePrivateIndex (Indices& iList, int idx);
+ static int allocatePluginClassIndex (Indices& iList);
+ static void freePluginClassIndex (Indices& iList, int idx);
};
#endif
diff --git a/include/core/privatehandler.h b/include/core/pluginclasshandler.h
index f7ee5db..a833e53 100644
--- a/include/core/privatehandler.h
+++ b/include/core/pluginclasshandler.h
@@ -23,37 +23,23 @@
* Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
*/
-#ifndef _COMPPRIVATEHANDLER_H
-#define _COMPPRIVATEHANDLER_H
+#ifndef _COMPPLUGINCLASSHANDLER_H
+#define _COMPPLUGINCLASSHANDLER_H
#include <typeinfo>
#include <boost/preprocessor/cat.hpp>
#include <compiz.h>
#include <core/screen.h>
-#include <core/privates.h>
+#include <core/pluginclasses.h>
-extern unsigned int privateHandlerIndex;
-
-class CompPrivateIndex {
- public:
- CompPrivateIndex () : index(-1), refCount (0),
- initiated (false), failed (false),
- privFailed (false), privIndex (0) {}
-
- int index;
- int refCount;
- bool initiated;
- bool failed;
- bool privFailed;
- unsigned int privIndex;
-};
+extern unsigned int pluginClassHandlerIndex;
template<class Tp, class Tb, int ABI = 0>
-class PrivateHandler {
+class PluginClassHandler {
public:
- PrivateHandler (Tb *);
- ~PrivateHandler ();
+ PluginClassHandler (Tb *);
+ ~PluginClassHandler ();
void setFailed () { mFailed = true; };
bool loadFailed () { return mFailed; };
@@ -71,18 +57,18 @@ class PrivateHandler {
bool mFailed;
Tb *mBase;
- static CompPrivateIndex mIndex;
+ static PluginClassIndex mIndex;
};
template<class Tp, class Tb, int ABI>
-CompPrivateIndex PrivateHandler<Tp,Tb,ABI>::mIndex;
+PluginClassIndex PluginClassHandler<Tp,Tb,ABI>::mIndex;
template<class Tp, class Tb, int ABI>
-PrivateHandler<Tp,Tb,ABI>::PrivateHandler (Tb *base) :
+PluginClassHandler<Tp,Tb,ABI>::PluginClassHandler (Tb *base) :
mFailed (false),
mBase (base)
{
- if (mIndex.privFailed)
+ if (mIndex.pcFailed)
{
mFailed = true;
}
@@ -90,12 +76,12 @@ PrivateHandler<Tp,Tb,ABI>::PrivateHandler (Tb *base) :
{
if (!mIndex.initiated)
{
- mIndex.index = Tb::allocPrivateIndex ();
+ mIndex.index = Tb::allocPluginClassIndex ();
if (mIndex.index >= 0)
{
mIndex.initiated = true;
mIndex.failed = false;
- mIndex.privIndex = privateHandlerIndex;
+ mIndex.pcIndex = pluginClassHandlerIndex;
CompPrivate p;
p.val = mIndex.index;
@@ -103,7 +89,7 @@ PrivateHandler<Tp,Tb,ABI>::PrivateHandler (Tb *base) :
if (!screen->hasValue (keyName ()))
{
screen->storeValue (keyName (), p);
- privateHandlerIndex++;
+ pluginClassHandlerIndex++;
}
else
{
@@ -116,8 +102,8 @@ PrivateHandler<Tp,Tb,ABI>::PrivateHandler (Tb *base) :
{
mIndex.failed = true;
mIndex.initiated = false;
- mIndex.privFailed = true;
- mIndex.privIndex = privateHandlerIndex;
+ mIndex.pcFailed = true;
+ mIndex.pcIndex = pluginClassHandlerIndex;
mFailed = true;
}
}
@@ -125,40 +111,40 @@ PrivateHandler<Tp,Tb,ABI>::PrivateHandler (Tb *base) :
if (!mIndex.failed)
{
mIndex.refCount++;
- mBase->privates[mIndex.index].ptr = static_cast<Tp *> (this);
+ mBase->pluginClasses[mIndex.index] = static_cast<Tp *> (this);
}
}
}
template<class Tp, class Tb, int ABI>
-PrivateHandler<Tp,Tb,ABI>::~PrivateHandler ()
+PluginClassHandler<Tp,Tb,ABI>::~PluginClassHandler ()
{
- if (!mIndex.privFailed)
+ if (!mIndex.pcFailed)
{
mIndex.refCount--;
if (mIndex.refCount == 0)
{
- Tb::freePrivateIndex (mIndex.index);
+ Tb::freePluginClassIndex (mIndex.index);
mIndex.initiated = false;
mIndex.failed = false;
- mIndex.privIndex = privateHandlerIndex;
+ mIndex.pcIndex = pluginClassHandlerIndex;
screen->eraseValue (keyName ());
- privateHandlerIndex++;
+ pluginClassHandlerIndex++;
}
}
}
template<class Tp, class Tb, int ABI>
Tp *
-PrivateHandler<Tp,Tb,ABI>::get (Tb *base)
+PluginClassHandler<Tp,Tb,ABI>::get (Tb *base)
{
- if (mIndex.initiated && privateHandlerIndex == mIndex.privIndex)
+ if (mIndex.initiated && pluginClassHandlerIndex == mIndex.pcIndex)
{
return static_cast<Tp *>
- (base->privates[mIndex.index].ptr);
+ (base->pluginClasses[mIndex.index]);
}
- if (mIndex.failed && privateHandlerIndex == mIndex.privIndex)
+ if (mIndex.failed && pluginClassHandlerIndex == mIndex.pcIndex)
return NULL;
if (screen->hasValue (keyName ()))
@@ -166,14 +152,14 @@ PrivateHandler<Tp,Tb,ABI>::get (Tb *base)
mIndex.index = screen->getValue (keyName ()).val;
mIndex.initiated = true;
mIndex.failed = false;
- mIndex.privIndex = privateHandlerIndex;
- return static_cast<Tp *> (base->privates[mIndex.index].ptr);
+ mIndex.pcIndex = pluginClassHandlerIndex;
+ return static_cast<Tp *> (base->pluginClasses[mIndex.index]);
}
else
{
mIndex.initiated = false;
mIndex.failed = true;
- mIndex.privIndex = privateHandlerIndex;
+ mIndex.pcIndex = pluginClassHandlerIndex;
return NULL;
}
}
diff --git a/include/core/screen.h b/include/core/screen.h
index f7b5e60..29467d2 100644
--- a/include/core/screen.h
+++ b/include/core/screen.h
@@ -34,7 +34,7 @@
#include <core/metadata.h>
#include <core/plugin.h>
#include <core/match.h>
-#include <core/privates.h>
+#include <core/pluginclasses.h>
#include <core/region.h>
class CompScreen;
@@ -127,7 +127,7 @@ class ScreenInterface : public WrapableInterface<CompScreen, ScreenInterface> {
class CompScreen :
public CompSize,
public WrapableHandler<ScreenInterface, 17>,
- public CompPrivateStorage
+ public PluginClassStorage
{
public:
@@ -316,8 +316,8 @@ class CompScreen :
bool updateDefaultIcon ();
- static int allocPrivateIndex ();
- static void freePrivateIndex (int index);
+ static int allocPluginClassIndex ();
+ static void freePluginClassIndex (int index);
WRAPABLE_HND (0, ScreenInterface, void, fileWatchAdded, CompFileWatch *)
WRAPABLE_HND (1, ScreenInterface, void, fileWatchRemoved, CompFileWatch *)
diff --git a/include/core/window.h b/include/core/window.h
index cf4e0bc..145d9a8 100644
--- a/include/core/window.h
+++ b/include/core/window.h
@@ -37,7 +37,7 @@
#include <X11/extensions/sync.h>
#include <core/action.h>
-#include <core/privates.h>
+#include <core/pluginclasses.h>
#include <core/size.h>
#include <core/point.h>
#include <core/region.h>
@@ -220,7 +220,7 @@ class WindowInterface : public WrapableInterface<CompWindow, WindowInterface> {
class CompWindow :
public WrapableHandler<WindowInterface, 13>,
- public CompPrivateStorage
+ public PluginClassStorage
{
public:
@@ -453,8 +453,8 @@ class CompWindow :
static unsigned int constrainWindowState (unsigned int state,
unsigned int actions);
- static int allocPrivateIndex ();
- static void freePrivateIndex (int index);
+ static int allocPluginClassIndex ();
+ static void freePluginClassIndex (int index);
WRAPABLE_HND (0, WindowInterface, void, getOutputExtents,
CompWindowExtents&);