summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-08-30 18:05:11 +0200
committerDanny Baumann <dannybaumann@web.de>2007-08-30 18:05:11 +0200
commit5f37a8d015d903042a9b86ae8b25418b04a8d6af (patch)
tree995501fcbd5c9273462b100e4ae8dee6543b6815
parent65408c6420fa55f0e3bb34c5edff5c883690b7e5 (diff)
downloadgroup-5f37a8d015d903042a9b86ae8b25418b04a8d6af.tar.gz
group-5f37a8d015d903042a9b86ae8b25418b04a8d6af.tar.bz2
Track core changes.
-rw-r--r--group-internal.h8
-rw-r--r--init.c47
2 files changed, 35 insertions, 20 deletions
diff --git a/group-internal.h b/group-internal.h
index 950e03f..e2233af 100644
--- a/group-internal.h
+++ b/group-internal.h
@@ -32,7 +32,7 @@
#include <time.h>
#include <X11/Xlib.h>
#include <cairo/cairo-xlib-xrender.h>
-#include <compiz.h>
+#include <compiz-core.h>
#include <text.h>
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
@@ -53,17 +53,17 @@
*
*/
#define GET_GROUP_DISPLAY(d) \
- ((GroupDisplay *) (d)->privates[groupDisplayPrivateIndex].ptr)
+ ((GroupDisplay *) (d)->object.privates[groupDisplayPrivateIndex].ptr)
#define GROUP_DISPLAY(d) \
GroupDisplay *gd = GET_GROUP_DISPLAY (d)
#define GET_GROUP_SCREEN(s, gd) \
- ((GroupScreen *) (s)->privates[ (gd)->screenPrivateIndex].ptr)
+ ((GroupScreen *) (s)->object.privates[(gd)->screenPrivateIndex].ptr)
#define GROUP_SCREEN(s) \
GroupScreen *gs = GET_GROUP_SCREEN (s, GET_GROUP_DISPLAY (s->display))
#define GET_GROUP_WINDOW(w, gs) \
- ((GroupWindow *) (w)->privates[ (gs)->windowPrivateIndex].ptr)
+ ((GroupWindow *) (w)->object.privates[(gs)->windowPrivateIndex].ptr)
#define GROUP_WINDOW(w) \
GroupWindow *gw = GET_GROUP_WINDOW (w, \
GET_GROUP_SCREEN (w->screen, \
diff --git a/init.c b/init.c
index 8030bc6..a6e9f72 100644
--- a/init.c
+++ b/init.c
@@ -194,6 +194,9 @@ groupInitDisplay (CompPlugin *p,
{
GroupDisplay *gd;
+ if (!checkPluginABI ("core", CORE_ABIVERSION))
+ return FALSE;
+
gd = malloc (sizeof (GroupDisplay));
if (!gd)
return FALSE;
@@ -232,7 +235,7 @@ groupInitDisplay (CompPlugin *p,
groupSetIgnoreKeyTerminate (d, groupUnsetIgnore);
groupSetChangeColorKeyInitiate (d, groupChangeColor);
- d->privates[groupDisplayPrivateIndex].ptr = gd;
+ d->object.privates[groupDisplayPrivateIndex].ptr = gd;
srand (time (NULL));
@@ -294,7 +297,7 @@ groupInitScreen (CompPlugin *p,
WRAP (gs, s, damageWindowRect, groupDamageWindowRect);
WRAP (gs, s, windowStateChangeNotify, groupWindowStateChangeNotify);
- s->privates[gd->screenPrivateIndex].ptr = gs;
+ s->object.privates[gd->screenPrivateIndex].ptr = gs;
groupSetTabHighlightColorNotify (s, groupScreenOptionChanged);
groupSetTabBaseColorNotify (s, groupScreenOptionChanged);
@@ -465,7 +468,7 @@ static Bool groupInitWindow(CompPlugin * p, CompWindow * w)
else
gw->windowState = WindowNormal;
- w->privates[gs->windowPrivateIndex].ptr = gw;
+ w->object.privates[gs->windowPrivateIndex].ptr = gw;
gw->glowQuads = NULL;
groupComputeGlowQuads (w, &gs->glowTexture.matrix);
@@ -519,11 +522,30 @@ groupFini (CompPlugin *p)
freeDisplayPrivateIndex (groupDisplayPrivateIndex);
}
-static int
-groupGetVersion (CompPlugin *plugin,
- int version)
+static CompBool
+groupInitObject (CompPlugin *p,
+ CompObject *o)
+{
+ static InitPluginObjectProc dispTab[] = {
+ (InitPluginObjectProc) groupInitDisplay,
+ (InitPluginObjectProc) groupInitScreen,
+ (InitPluginObjectProc) groupInitWindow
+ };
+
+ RETURN_DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), TRUE, (p, o));
+}
+
+static void
+groupFiniObject (CompPlugin *p,
+ CompObject *o)
{
- return ABIVERSION;
+ static FiniPluginObjectProc dispTab[] = {
+ (FiniPluginObjectProc) groupFiniDisplay,
+ (FiniPluginObjectProc) groupFiniScreen,
+ (FiniPluginObjectProc) groupFiniWindow
+ };
+
+ DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o));
}
/*
@@ -532,18 +554,11 @@ groupGetVersion (CompPlugin *plugin,
*/
CompPluginVTable groupVTable = {
"group",
- groupGetVersion,
0,
groupInit,
groupFini,
- groupInitDisplay,
- groupFiniDisplay,
- groupInitScreen,
- groupFiniScreen,
- groupInitWindow,
- groupFiniWindow,
- 0,
- 0,
+ groupInitObject,
+ groupFiniObject,
0,
0
};