summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-08-30 08:55:26 +0200
committerDanny Baumann <dannybaumann@web.de>2007-08-30 08:55:26 +0200
commit147177cb07ba72340f76babdb9fee664ce793199 (patch)
tree4f270fbf39601132dabd7c5660251ce31a1949c1
parent6a731df24ca17930aa96ae8c0ad84d9c7632dbe8 (diff)
downloadgears-147177cb07ba72340f76babdb9fee664ce793199.tar.gz
gears-147177cb07ba72340f76babdb9fee664ce793199.tar.bz2
Use core utility functions to retrieve ABI and display index.
-rw-r--r--gears.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/gears.c b/gears.c
index a86b65c..dd59224 100644
--- a/gears.c
+++ b/gears.c
@@ -408,29 +408,14 @@ gearsInitDisplay (CompPlugin *p,
CompDisplay *d)
{
GearsDisplay *gd;
- CompPlugin *cube = findActivePlugin ("cube");
- CompOption *option;
- int nOption;
-
- if (!cube || !cube->vTable->getDisplayOptions)
+ if (!checkPluginABI ("cube", CUBE_ABIVERSION))
return FALSE;
- option = (*cube->vTable->getDisplayOptions) (cube, d, &nOption);
-
- if (getIntOptionNamed (option, nOption, "abi", 0) != CUBE_ABIVERSION)
- {
- compLogMessage (d, "gears", CompLogLevelError,
- "cube ABI version mismatch");
- return FALSE;
- }
-
- cubeDisplayPrivateIndex = getIntOptionNamed (option, nOption, "index", -1);
-
- if (cubeDisplayPrivateIndex < 0)
+ if (!getPluginDisplayIndex (d, "cube", &cubeDisplayPrivateIndex))
return FALSE;
- gd = malloc (sizeof (GearsDisplay) );
+ gd = malloc (sizeof (GearsDisplay));
if (!gd)
return FALSE;