diff --git a/cogl/.gitignore b/cogl/.gitignore index 288080850..8449b17fd 100644 --- a/cogl/.gitignore +++ b/cogl/.gitignore @@ -40,6 +40,7 @@ cogl-path-enum-types.c cogl-path-enum-types.h cogl-config.h cogl-config.h.in +cogl-mutter-config.h config.log config.lt config.status diff --git a/cogl/cogl-mutter-config.h.in b/cogl/cogl-mutter-config.h.in new file mode 100644 index 000000000..bc7f146ce --- /dev/null +++ b/cogl/cogl-mutter-config.h.in @@ -0,0 +1,17 @@ +/* Have GL for rendering */ +#undef HAVE_COGL_GL + +/* Have GLES 1.1 for rendering */ +#undef HAVE_COGL_GLES + +/* Have GLES 2.0 for rendering */ +#undef HAVE_COGL_GLES2 + +/* Define to 1 if you have the `ffs' function. */ +#undef HAVE_FFS + +/* Define to 1 if you have the `memmem' function. */ +#undef HAVE_MEMMEM + +/* Whether _Static_assert can be used or not */ +#undef HAVE_STATIC_ASSERT diff --git a/cogl/cogl/cogl-egl-private.h b/cogl/cogl/cogl-egl-private.h index c4b0dfe1b..0af8518f1 100644 --- a/cogl/cogl/cogl-egl-private.h +++ b/cogl/cogl/cogl-egl-private.h @@ -33,7 +33,7 @@ #include "cogl-egl-defines.h" -#ifndef GL_OES_EGL_image +#if defined(GL_OES_EGL_image) && !defined(GLeglImageOES) #define GLeglImageOES void * #endif diff --git a/cogl/cogl/cogl-framebuffer.h b/cogl/cogl/cogl-framebuffer.h index 56ba4aa25..67931f879 100644 --- a/cogl/cogl/cogl-framebuffer.h +++ b/cogl/cogl/cogl-framebuffer.h @@ -37,7 +37,7 @@ /* We forward declare the CoglFramebuffer type here to avoid some circular * dependency issues with the following headers. */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-gl-header.h.in b/cogl/cogl/cogl-gl-header.h.in index 0696dcf72..a6659e92f 100644 --- a/cogl/cogl/cogl-gl-header.h.in +++ b/cogl/cogl/cogl-gl-header.h.in @@ -28,7 +28,7 @@ * */ -#if !defined(COGL_COMPILATION) +#if !defined(COGL_COMPILATION) && !defined(COGL_ENABLE_MUTTER_API) #error "cogl-gl-header.h should only be included when compiling Cogl" #endif diff --git a/cogl/cogl/cogl-meta-texture.h b/cogl/cogl/cogl-meta-texture.h index 69c8cb04a..e5e68933f 100644 --- a/cogl/cogl/cogl-meta-texture.h +++ b/cogl/cogl/cogl-meta-texture.h @@ -92,7 +92,7 @@ COGL_BEGIN_DECLS * meta-textures. */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-mutter.h b/cogl/cogl/cogl-mutter.h index 21ef0745d..672bede0f 100644 --- a/cogl/cogl/cogl-mutter.h +++ b/cogl/cogl/cogl-mutter.h @@ -31,10 +31,16 @@ #ifndef __COGL_MUTTER_H___ #define __COGL_MUTTER_H___ -#include -#include +#include "cogl-mutter-config.h" +#include "cogl-defines.h" -typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void); +#include +#include +#include +#include +#include +#include +#include void cogl_renderer_set_custom_winsys (CoglRenderer *renderer, CoglWinsysVtableGetter winsys_vtable_getter); diff --git a/cogl/cogl/cogl-texture.h b/cogl/cogl/cogl-texture.h index 27188309b..3757667d3 100644 --- a/cogl/cogl/cogl-texture.h +++ b/cogl/cogl/cogl-texture.h @@ -38,7 +38,7 @@ /* We forward declare the CoglTexture type here to avoid some circular * dependency issues with the following headers. */ -#ifdef __COGL_H_INSIDE__ +#if defined(__COGL_H_INSIDE__) && !defined(COGL_ENABLE_MUTTER_API) /* For the public C api we typedef interface types as void to avoid needing * lots of casting in code and instead we will rely on runtime type checking * for these objects. */ diff --git a/cogl/cogl/cogl-util.h b/cogl/cogl/cogl-util.h index 60be7db4d..c24419664 100644 --- a/cogl/cogl/cogl-util.h +++ b/cogl/cogl/cogl-util.h @@ -42,7 +42,9 @@ #endif /* Double check that config.h has been included */ -#if !defined (PACKAGE_NAME) && !defined (_COGL_IN_TEST_BITMASK) +#if (!defined (PACKAGE_NAME) && \ + !defined (_COGL_IN_TEST_BITMASK) && \ + !defined(COGL_ENABLE_MUTTER_API)) #error "cogl-config.h must be included before including cogl-util.h" #endif diff --git a/cogl/cogl/deprecated/cogl-type-casts.h b/cogl/cogl/deprecated/cogl-type-casts.h index ae716e7dd..61c6fafc4 100644 --- a/cogl/cogl/deprecated/cogl-type-casts.h +++ b/cogl/cogl/deprecated/cogl-type-casts.h @@ -44,10 +44,12 @@ * so these macros are only kept for compatibility... */ +#ifndef COGL_ENABLE_MUTTER_API #define COGL_FRAMEBUFFER(X) (X) #define COGL_BUFFER(X) (X) #define COGL_TEXTURE(X) (X) #define COGL_META_TEXTURE(X) (X) #define COGL_PRIMITIVE_TEXTURE(X) (X) +#endif #endif /* __COGL_TYPE_CASTS_H__ */ diff --git a/cogl/cogl/winsys/cogl-winsys-private.h b/cogl/cogl/winsys/cogl-winsys-private.h index 85a67c72a..a8e07a509 100644 --- a/cogl/cogl/winsys/cogl-winsys-private.h +++ b/cogl/cogl/winsys/cogl-winsys-private.h @@ -190,6 +190,8 @@ typedef struct _CoglWinsysVtable } CoglWinsysVtable; +typedef const CoglWinsysVtable *(*CoglWinsysVtableGetter) (void); + CoglBool _cogl_winsys_has_feature (CoglWinsysFeature feature); diff --git a/cogl/configure.ac b/cogl/configure.ac index c2674fb8a..586b6e167 100644 --- a/cogl/configure.ac +++ b/cogl/configure.ac @@ -80,6 +80,7 @@ AC_CONFIG_SRCDIR(cogl/cogl.h) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_MACRO_DIR([build/autotools]) AC_CONFIG_HEADERS(cogl-config.h) +AC_CONFIG_HEADERS(cogl-mutter-config.h) AC_GNU_SOURCE dnl ================================================================ diff --git a/src/Makefile.am b/src/Makefile.am index f2fae4cb8..7ab9caeeb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,8 @@ AM_CPPFLAGS = \ -I$(srcdir)/ui \ -I$(srcdir)/compositor \ -I$(top_srcdir)/cogl \ + -I$(top_srcdir)/cogl/cogl \ + -I$(top_srcdir)/cogl/cogl/winsys \ -I$(top_builddir)/cogl \ -I$(top_srcdir)/clutter \ -I$(top_builddir)/clutter \