summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-03-19 14:56:07 +0100
committerDennis kasprzyk <onestone@opencompositing.org>2008-03-19 15:21:11 +0100
commit9399068ea6acb6e5e6d78f6dc51b590acdcc999b (patch)
treeda22d2e893e5aa304d114b91ec1d683c5c578b92
parent7966c5f6396049c708795db57ceb900c58c5eeb3 (diff)
downloadbcop-9399068ea6acb6e5e6d78f6dc51b590acdcc999b.tar.gz
bcop-9399068ea6acb6e5e6d78f6dc51b590acdcc999b.tar.bz2
Generate generic plugin privates defines.
-rw-r--r--src/bcop.xslt35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/bcop.xslt b/src/bcop.xslt
index d5b134d..8a747df 100644
--- a/src/bcop.xslt
+++ b/src/bcop.xslt
@@ -1413,7 +1413,40 @@ CompPluginVTable * getCompPluginInfo (void);
<xsl:call-template name="printOptionEnums"/>
<xsl:call-template name="printOptionMasks"/>
<xsl:call-template name="printFunctionDefinitions"/>
- <xsl:text>COMPIZ_END_DECLS
+ <xsl:text>#ifndef GENERIC_PRIVATE_DEFINES
+#define GENERIC_PRIVATE_DEFINES
+
+#define GET_PLUGIN_CORE(object, plugin) \
+ ((plugin##Core *) (object)->base.privates[plugin##CorePrivateIndex].ptr)
+#define PLUGIN_CORE(object, plugin, prefix) \
+ plugin##Core * prefix##c = GET_PLUGIN_CORE (object, plugin)
+
+#define GET_PLUGIN_DISPLAY(object, plugin) \
+ ((plugin##Display *) \
+ (object)->base.privates[plugin##DisplayPrivateIndex].ptr)
+#define PLUGIN_DISPLAY(object, plugin, prefix) \
+ plugin##Display * prefix##d = GET_PLUGIN_DISPLAY (object, plugin)
+
+#define GET_PLUGIN_SCREEN(object, parent, plugin) \
+ ((plugin##Screen *) \
+ (object)->base.privates[(parent)->screenPrivateIndex].ptr)
+#define PLUGIN_SCREEN(object, plugin, prefix) \
+ plugin##Screen * prefix##s = \
+ GET_PLUGIN_SCREEN (object, \
+ GET_PLUGIN_DISPLAY (s->display, plugin), plugin)
+
+#define GET_PLUGIN_WINDOW(object, parent, plugin) \
+ ((plugin##Window *) \
+ (object)->base.privates[(parent)->windowPrivateIndex].ptr)
+#define PLUGIN_WINDOW(object, plugin, prefix) \
+ plugin##Window * prefix##w = \
+ GET_PLUGIN_WINDOW (object, \
+ GET_PLUGIN_SCREEN (w->screen, \
+ GET_PLUGIN_DISPLAY (w->screen->display, plugin), plugin), plugin)
+
+#endif
+
+COMPIZ_END_DECLS
#endif
</xsl:text>