From 16ba22e8f7d57af7cd71ba7c493a62ed750602d6 Mon Sep 17 00:00:00 2001 From: David Mikos Date: Thu, 13 Dec 2007 13:48:39 +1030 Subject: Testing 0.6.0 branch. --- snowglobe-internal.h | 4 +-- snowglobe.c | 79 ++++++++++++++++++++++++---------------------------- 2 files changed, 39 insertions(+), 44 deletions(-) diff --git a/snowglobe-internal.h b/snowglobe-internal.h index 13bcf92..290a578 100644 --- a/snowglobe-internal.h +++ b/snowglobe-internal.h @@ -27,12 +27,12 @@ extern int snowglobeDisplayPrivateIndex; extern int cubeDisplayPrivateIndex; #define GET_SNOWGLOBE_DISPLAY(d) \ - ((SnowglobeDisplay *) (d)->base.privates[snowglobeDisplayPrivateIndex].ptr) + ((SnowglobeDisplay *) (d)->privates[snowglobeDisplayPrivateIndex].ptr) #define SNOWGLOBE_DISPLAY(d) \ SnowglobeDisplay *ad = GET_SNOWGLOBE_DISPLAY(d); #define GET_SNOWGLOBE_SCREEN(s, ad) \ - ((SnowglobeScreen *) (s)->base.privates[(ad)->screenPrivateIndex].ptr) + ((SnowglobeScreen *) (s)->privates[(ad)->screenPrivateIndex].ptr) #define SNOWGLOBE_SCREEN(s) \ SnowglobeScreen *as = GET_SNOWGLOBE_SCREEN(s, GET_SNOWGLOBE_DISPLAY(s->display)) diff --git a/snowglobe.c b/snowglobe.c index e9931c1..5db4f38 100644 --- a/snowglobe.c +++ b/snowglobe.c @@ -386,13 +386,28 @@ snowglobeInitDisplay (CompPlugin *p, CompDisplay *d) { SnowglobeDisplay *ad; + + CompPlugin *cube = findActivePlugin ("cube"); + CompOption *option; + int nOption; - if (!checkPluginABI ("core", CORE_ABIVERSION) || - !checkPluginABI ("cube", CUBE_ABIVERSION)) - return FALSE; + if (!cube || !cube->vTable->getDisplayOptions) + return FALSE; + + option = (*cube->vTable->getDisplayOptions) (cube, d, &nOption); + + if (getIntOptionNamed (option, nOption, "abi", 0) != CUBE_ABIVERSION) + { + compLogMessage (d, "snowglobe", CompLogLevelError, + "cube ABI version mismatch"); + return FALSE; + } + + cubeDisplayPrivateIndex = getIntOptionNamed (option, nOption, "index", -1); + + if (cubeDisplayPrivateIndex < 0) + return FALSE; - if (!getPluginDisplayIndex (d, "cube", &cubeDisplayPrivateIndex)) - return FALSE; ad = malloc (sizeof (SnowglobeDisplay)); @@ -407,7 +422,7 @@ snowglobeInitDisplay (CompPlugin *p, return FALSE; } - d->base.privates[snowglobeDisplayPrivateIndex].ptr = ad; + d->privates[snowglobeDisplayPrivateIndex].ptr = ad; return TRUE; } @@ -440,7 +455,7 @@ snowglobeInitScreen (CompPlugin *p, if (!as) return FALSE; - s->base.privates[ad->screenPrivateIndex].ptr = as; + s->privates[ad->screenPrivateIndex].ptr = as; as->damage = FALSE; @@ -500,45 +515,25 @@ snowglobeFini (CompPlugin * p) freeDisplayPrivateIndex (snowglobeDisplayPrivateIndex); } -static CompBool -snowglobeInitObject (CompPlugin *p, - CompObject *o) -{ - static InitPluginObjectProc dispTab[] = { - (InitPluginObjectProc) 0, /* InitCore */ - (InitPluginObjectProc) snowglobeInitDisplay, - (InitPluginObjectProc) snowglobeInitScreen - }; - - RETURN_DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), TRUE, (p, o)); -} - -static void -snowglobeFiniObject (CompPlugin *p, - CompObject *o) -{ - static FiniPluginObjectProc dispTab[] = { - (FiniPluginObjectProc) 0, /* FiniCore */ - (FiniPluginObjectProc) snowglobeFiniDisplay, - (FiniPluginObjectProc) snowglobeFiniScreen - }; - - DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o)); -} - CompPluginVTable snowglobeVTable = { - "snowglobe", - 0, - snowglobeInit, - snowglobeFini, - snowglobeInitObject, - snowglobeFiniObject, - 0, - 0 + "snowglobe", + snowglobeGetVersion, + 0, + snowglobeInit, + snowglobeFini, + snowglobeInitDisplay, + snowglobeFiniDisplay, + snowglobeInitScreen, + snowglobeFiniScreen, + 0, + 0, + 0, + 0, + 0, + 0 }; - CompPluginVTable * getCompPluginInfo (void) { -- cgit v1.1 From e8adf09ac42b4fbb86915a22a2e855e381953d75 Mon Sep 17 00:00:00 2001 From: David Mikos Date: Thu, 13 Dec 2007 13:52:58 +1030 Subject: Dummy commmit. --- snowglobe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/snowglobe.c b/snowglobe.c index 5db4f38..86a75d9 100644 --- a/snowglobe.c +++ b/snowglobe.c @@ -70,7 +70,6 @@ #include - #include "snowglobe-internal.h" #include "snowglobe_options.h" -- cgit v1.1