summaryrefslogtreecommitdiff
path: root/cogl/cogl-xlib.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-10-09 13:31:12 +0100
committerRobert Bragg <robert@linux.intel.com>2013-11-27 19:33:44 +0000
commit6436cd073d256e54f82e7607874006862b2f0ad6 (patch)
treebb1217fdca60579ad36e8ac581d0bb6e08986b23 /cogl/cogl-xlib.h
parentd24f632d91d18909e2ca033e300b3679d927752f (diff)
downloadcogl-6436cd073d256e54f82e7607874006862b2f0ad6.tar.gz
Declare interface types as void and remove cast macros
This declares the interface types CoglFramebuffer, CoglBuffer, CoglTexture, CoglMetaTexture and CoglPrimitiveTexture as void when including the public cogl.h header so that users don't have to use lots of C type casts between instance types and interface types. This also removes all of the COGL_XYZ() type cast macros since they do nothing more than compile time type casting but it's less readable if you haven't seen that coding pattern before. Unlike with gobject based apis that use per-type macros for casting and performing runtime type checking we instead prefer to do our runtime type checking internally within the front-end public apis when objects are passed into Cogl. This greatly reduces the verbosity for users of the api and may help reduce the chance of excessive runtime type checking that can sometimes be a problem. (cherry picked from commit 248a76f5eac7e5ae4fb45208577f9a55360812a7) Since we can't break the 1.x api this version of the patch actually defines compatible NOP macros within deprecated/cogl-type-casts.h
Diffstat (limited to 'cogl/cogl-xlib.h')
-rw-r--r--cogl/cogl-xlib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cogl/cogl-xlib.h b/cogl/cogl-xlib.h
index c1371589..53f4b5f5 100644
--- a/cogl/cogl-xlib.h
+++ b/cogl/cogl-xlib.h
@@ -26,8 +26,16 @@
#include <X11/Xlib.h>
+/* NB: this is a top-level header that can be included directly but we
+ * want to be careful not to define __COGL_H_INSIDE__ when this is
+ * included internally while building Cogl itself since
+ * __COGL_H_INSIDE__ is used in headers to guard public vs private api
+ * definitions
+ */
+#ifndef COGL_COMPILATION
#define __COGL_XLIB_H_INSIDE__
#define __COGL_H_INSIDE__
+#endif
#include <cogl/cogl-types.h>
#include <cogl/deprecated/cogl-clutter-xlib.h>