[cogl] cogl.h: Exclude 1.x headers if 2.0 api requested
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl] cogl.h: Exclude 1.x headers if 2.0 api requested
- Date: Tue, 21 Feb 2012 17:30:26 +0000 (UTC)
commit 336c330d11015402a7d53bea5274f8d1ad9a7dce
Author: Robert Bragg <robert linux intel com>
Date: Sat Feb 18 01:41:20 2012 +0000
cogl.h: Exclude 1.x headers if 2.0 api requested
Now if COGL_ENABLE_EXPERIMENTAL_2_0_API has been defined when including
cogl.h then headers that correspond to 1.x only apis that we plan to
drop won't be included any more.
If COGL_ENABLE_EXPERIMENTAL_API is defined then you can still mix and
match 2.0 api with 1.x api in a single compilation unit.
Note: it's still possible that some 1.x symbols will still be available
when COGL_ENABLE_EXPERIMENTAL_2_0_API is defined since this patch
doesn't go through the shared headers adding guards around deprecated
functions.
This only affects people playing with the experimental api.
Reviewed-by: Neil Roberts <neil linux intel com>
cogl/cogl.h | 44 +++++++++++++++++++++++++++++++-------------
1 files changed, 31 insertions(+), 13 deletions(-)
---
diff --git a/cogl/cogl.h b/cogl/cogl.h
index efe948f..e8b1eeb 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -41,33 +41,38 @@
*/
#define _COGL_SUPPORTS_GTYPE_INTEGRATION
+/*
+ * API common to the 1.x and 2.0 api...
+ */
+
#include <cogl/cogl-defines.h>
#include <cogl/cogl-object.h>
#include <cogl/cogl1-context.h>
#include <cogl/cogl-bitmap.h>
#include <cogl/cogl-color.h>
-#include <cogl/cogl-fixed.h>
-#include <cogl/cogl-material-compat.h>
#include <cogl/cogl-matrix.h>
#include <cogl/cogl-offscreen.h>
#include <cogl/cogl-primitives.h>
-#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
-#include <cogl/cogl2-path.h>
-#include <cogl/cogl2-clip-state.h>
-#else
-#include <cogl/cogl-path.h>
-#include <cogl/cogl-clip-state.h>
-#endif
-#include <cogl/cogl-shader.h>
#include <cogl/cogl-texture.h>
#include <cogl/cogl-types.h>
-#include <cogl/cogl-vertex-buffer.h>
+/*
+ * 1.x only api...
+ */
+#ifndef COGL_ENABLE_EXPERIMENTAL_2_0_API
+#include <cogl/cogl-path.h>
+#include <cogl/cogl-clip-state.h>
+#include <cogl/cogl-vertex-buffer.h>
#include <cogl/cogl-enum-types.h>
+#include <cogl/cogl-fixed.h>
+#include <cogl/cogl-material-compat.h>
+#include <cogl/cogl-shader.h>
+#endif
-#include <cogl/cogl-deprecated.h>
-
+/*
+ * 2.0 api that's compatible with the 1.x api...
+ */
#if defined (COGL_ENABLE_EXPERIMENTAL_API)
#include <cogl/cogl-swap-chain.h>
#include <cogl/cogl-renderer.h>
@@ -114,6 +119,19 @@
#include <cogl/cogl-clutter.h>
#endif
+/*
+ * 2.0 only api...
+ */
+#ifdef COGL_ENABLE_EXPERIMENTAL_2_0_API
+#include <cogl/cogl2-path.h>
+#include <cogl/cogl2-clip-state.h>
+#endif
+
+/*
+ * API deprecations
+ */
+#include <cogl/cogl-deprecated.h>
+
/**
* SECTION:cogl
* @short_description: General purpose API
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]