[cogl/wip/rib/cogl-1.12: 50/142] Switch use of primitive glib types to c99 equivalents



commit 83bfd71b1bf3c2ce07b3ee18eb2ce9c792920084
Author: Robert Bragg <robert linux intel com>
Date:   Mon Apr 16 21:56:40 2012 +0100

    Switch use of primitive glib types to c99 equivalents
    
    The coding style has for a long time said to avoid using redundant glib
    data types such as gint or gchar etc because we feel that they make the
    code look unnecessarily foreign to developers coming from outside of the
    Gnome developer community.
    
    Note: When we tried to find the historical rationale for the types we
    just found that they were apparently only added for consistent syntax
    highlighting which didn't seem that compelling.
    
    Up until now we have been continuing to use some of the platform
    specific type such as gint{8,16,32,64} and gsize but this patch switches
    us over to using the standard c99 equivalents instead so we can further
    ensure that our code looks familiar to the widest range of C developers
    who might potentially contribute to Cogl.
    
    So instead of using the gint{8,16,32,64} and guint{8,16,32,64} types this
    switches all Cogl code to instead use the int{8,16,32,64}_t and
    uint{8,16,32,64}_t c99 types instead.
    
    Instead of gsize we now use size_t
    
    For now we are not going to use the c99 _Bool type and instead we have
    introduced a new CoglBool type to use instead of gboolean.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    
    (cherry picked from commit 5967dad2400d32ca6319cef6cb572e81bf2c15f0)

 cogl-pango/cogl-pango-display-list.c          |    6 +-
 cogl-pango/cogl-pango-fontmap.c               |    4 +-
 cogl-pango/cogl-pango-glyph-cache.c           |   29 +-
 cogl-pango/cogl-pango-glyph-cache.h           |    6 +-
 cogl-pango/cogl-pango-pipeline-cache.c        |    8 +-
 cogl-pango/cogl-pango-pipeline-cache.h        |    2 +-
 cogl-pango/cogl-pango-private.h               |    4 +-
 cogl-pango/cogl-pango-render.c                |   10 +-
 cogl-pango/cogl-pango.h                       |    4 +-
 cogl/cogl-atlas-texture-private.h             |    2 +-
 cogl/cogl-atlas-texture.c                     |   16 +-
 cogl/cogl-atlas.c                             |    6 +-
 cogl/cogl-atlas.h                             |    4 +-
 cogl/cogl-attribute-buffer.c                  |    4 +-
 cogl/cogl-attribute-buffer.h                  |    4 +-
 cogl/cogl-attribute-private.h                 |    8 +-
 cogl/cogl-attribute.c                         |   38 ++--
 cogl/cogl-attribute.h                         |   10 +-
 cogl/cogl-bitmap-conversion.c                 |  144 +++++-----
 cogl/cogl-bitmap-packing.h                    |   94 ++++----
 cogl/cogl-bitmap-pixbuf.c                     |   14 +-
 cogl/cogl-bitmap-private.h                    |   16 +-
 cogl/cogl-bitmap.c                            |   52 ++--
 cogl/cogl-bitmap.h                            |    6 +-
 cogl/cogl-bitmask.c                           |    6 +-
 cogl/cogl-bitmask.h                           |   14 +-
 cogl/cogl-blend-string.c                      |   28 +-
 cogl/cogl-blend-string.h                      |   16 +-
 cogl/cogl-blit.c                              |    8 +-
 cogl/cogl-blit.h                              |    2 +-
 cogl/cogl-boxed-value.c                       |   10 +-
 cogl/cogl-boxed-value.h                       |    6 +-
 cogl/cogl-buffer-private.h                    |   33 ++--
 cogl/cogl-buffer.c                            |   22 +-
 cogl/cogl-buffer.h                            |   12 +-
 cogl/cogl-clip-stack.c                        |   20 +-
 cogl/cogl-clip-stack.h                        |    2 +-
 cogl/cogl-clutter.c                           |    4 +-
 cogl/cogl-clutter.h                           |    4 +-
 cogl/cogl-color-private.h                     |    2 +-
 cogl/cogl-color.c                             |   58 ++--
 cogl/cogl-color.h                             |   27 +-
 cogl/cogl-config.c                            |    2 +-
 cogl/cogl-context-private.h                   |   26 +-
 cogl/cogl-context.c                           |    2 +-
 cogl/cogl-context.h                           |    6 +-
 cogl/cogl-debug.c                             |   30 +-
 cogl/cogl-debug.h                             |    4 +-
 cogl/cogl-depth-state.c                       |    8 +-
 cogl/cogl-depth-state.h                       |   34 ++--
 cogl/cogl-display-private.h                   |    2 +-
 cogl/cogl-display.c                           |    2 +-
 cogl/cogl-display.h                           |    4 +-
 cogl/cogl-driver.h                            |    4 +-
 cogl/cogl-euler.c                             |    4 +-
 cogl/cogl-euler.h                             |    4 +-
 cogl/cogl-feature-private.c                   |    6 +-
 cogl/cogl-feature-private.h                   |    2 +-
 cogl/cogl-fixed.c                             |   20 +-
 cogl/cogl-fixed.h                             |    2 +-
 cogl/cogl-framebuffer-private.h               |   12 +-
 cogl/cogl-framebuffer.c                       |   68 +++---
 cogl/cogl-framebuffer.h                       |   14 +-
 cogl/cogl-glib-source.c                       |   12 +-
 cogl/cogl-glx-display-private.h               |   10 +-
 cogl/cogl-glx-renderer-private.h              |    2 +-
 cogl/cogl-gpu-info.c                          |   18 +-
 cogl/cogl-gtype-private.h                     |    2 +-
 cogl/cogl-index-buffer.c                      |    6 +-
 cogl/cogl-index-buffer.h                      |    4 +-
 cogl/cogl-indices.c                           |   18 +-
 cogl/cogl-indices.h                           |    8 +-
 cogl/cogl-internal.h                          |    2 +-
 cogl/cogl-journal-private.h                   |    8 +-
 cogl/cogl-journal.c                           |  110 ++++----
 cogl/cogl-material-compat.c                   |   22 +-
 cogl/cogl-material-compat.h                   |   24 +-
 cogl/cogl-matrix-stack.c                      |   26 +-
 cogl/cogl-matrix-stack.h                      |   20 +-
 cogl/cogl-matrix.c                            |   56 ++--
 cogl/cogl-matrix.h                            |   16 +-
 cogl/cogl-meta-texture.c                      |    8 +-
 cogl/cogl-node-private.h                      |    6 +-
 cogl/cogl-node.c                              |    2 +-
 cogl/cogl-object-private.h                    |    4 +-
 cogl/cogl-offscreen.h                         |    2 +-
 cogl/cogl-onscreen-private.h                  |    4 +-
 cogl/cogl-onscreen-template.c                 |    2 +-
 cogl/cogl-onscreen-template.h                 |    4 +-
 cogl/cogl-onscreen.c                          |   12 +-
 cogl/cogl-onscreen.h                          |   14 +-
 cogl/cogl-path-functions.h                    |    2 +-
 cogl/cogl-path-private.h                      |    8 +-
 cogl/cogl-pipeline-cache.c                    |   12 +-
 cogl/cogl-pipeline-debug.c                    |   12 +-
 cogl/cogl-pipeline-fragend-arbfp.c            |   18 +-
 cogl/cogl-pipeline-fragend-fixed.c            |   10 +-
 cogl/cogl-pipeline-fragend-glsl.c             |   10 +-
 cogl/cogl-pipeline-layer-private.h            |   12 +-
 cogl/cogl-pipeline-layer-state-private.h      |   18 +-
 cogl/cogl-pipeline-layer-state.c              |   32 ++--
 cogl/cogl-pipeline-layer-state.h              |    8 +-
 cogl/cogl-pipeline-layer.c                    |    8 +-
 cogl/cogl-pipeline-opengl-private.h           |   10 +-
 cogl/cogl-pipeline-opengl.c                   |   30 +-
 cogl/cogl-pipeline-private.h                  |   50 ++--
 cogl/cogl-pipeline-progend-glsl.c             |   24 +-
 cogl/cogl-pipeline-snippet-private.h          |    4 +-
 cogl/cogl-pipeline-snippet.c                  |    3 +-
 cogl/cogl-pipeline-state-private.h            |   36 ++--
 cogl/cogl-pipeline-state.c                    |   74 +++---
 cogl/cogl-pipeline-state.h                    |   14 +-
 cogl/cogl-pipeline-vertend-fixed.c            |    6 +-
 cogl/cogl-pipeline-vertend-glsl.c             |    6 +-
 cogl/cogl-pipeline.c                          |   82 +++---
 cogl/cogl-pipeline.h                          |    4 +-
 cogl/cogl-pixel-buffer.c                      |    4 +-
 cogl/cogl-pixel-buffer.h                      |    8 +-
 cogl/cogl-point-in-poly.c                     |    8 +-
 cogl/cogl-poll.c                              |    2 +-
 cogl/cogl-poll.h                              |    2 +-
 cogl/cogl-primitive-texture.c                 |    4 +-
 cogl/cogl-primitive-texture.h                 |    6 +-
 cogl/cogl-primitive.c                         |    2 +-
 cogl/cogl-primitive.h                         |   12 +-
 cogl/cogl-primitives-private.h                |    2 +-
 cogl/cogl-primitives.c                        |   50 ++--
 cogl/cogl-primitives.h                        |    2 +-
 cogl/cogl-private.h                           |    8 +-
 cogl/cogl-profile.c                           |    4 +-
 cogl/cogl-program-private.h                   |    6 +-
 cogl/cogl-program.c                           |   12 +-
 cogl/cogl-quaternion.c                        |    4 +-
 cogl/cogl-quaternion.h                        |    4 +-
 cogl/cogl-rectangle-map.c                     |    6 +-
 cogl/cogl-rectangle-map.h                     |    4 +-
 cogl/cogl-renderer-private.h                  |    8 +-
 cogl/cogl-renderer.c                          |   10 +-
 cogl/cogl-renderer.h                          |    6 +-
 cogl/cogl-sampler-cache.c                     |    6 +-
 cogl/cogl-sdl.c                               |    6 +-
 cogl/cogl-sdl.h                               |    6 +-
 cogl/cogl-shader.c                            |    2 +-
 cogl/cogl-shader.h                            |   10 +-
 cogl/cogl-snippet-private.h                   |    2 +-
 cogl/cogl-snippet.c                           |    3 +-
 cogl/cogl-snippet.h                           |    2 +-
 cogl/cogl-spans.c                             |    2 +-
 cogl/cogl-spans.h                             |    6 +-
 cogl/cogl-sub-texture.c                       |    8 +-
 cogl/cogl-sub-texture.h                       |    2 +-
 cogl/cogl-swap-chain-private.h                |    2 +-
 cogl/cogl-swap-chain.c                        |    2 +-
 cogl/cogl-swap-chain.h                        |    4 +-
 cogl/cogl-texture-2d-private.h                |    6 +-
 cogl/cogl-texture-2d-sliced.c                 |   62 +++---
 cogl/cogl-texture-2d-sliced.h                 |    2 +-
 cogl/cogl-texture-2d.c                        |   48 ++--
 cogl/cogl-texture-2d.h                        |    4 +-
 cogl/cogl-texture-3d-private.h                |    4 +-
 cogl/cogl-texture-3d.c                        |   46 ++--
 cogl/cogl-texture-3d.h                        |    4 +-
 cogl/cogl-texture-driver.h                    |   16 +-
 cogl/cogl-texture-private.h                   |   30 +-
 cogl/cogl-texture-rectangle-private.h         |    2 +-
 cogl/cogl-texture-rectangle.c                 |   28 +-
 cogl/cogl-texture-rectangle.h                 |    2 +-
 cogl/cogl-texture.c                           |  128 +++++-----
 cogl/cogl-texture.h                           |   38 ++--
 cogl/cogl-types.h                             |   56 ++++-
 cogl/cogl-util.c                              |    6 +-
 cogl/cogl-util.h                              |   10 +-
 cogl/cogl-vector.c                            |   10 +-
 cogl/cogl-vector.h                            |    6 +-
 cogl/cogl-vertex-buffer-private.h             |   10 +-
 cogl/cogl-vertex-buffer.c                     |   32 ++--
 cogl/cogl-vertex-buffer.h                     |   10 +-
 cogl/cogl-xlib-renderer-private.h             |    4 +-
 cogl/cogl-xlib-renderer.c                     |    4 +-
 cogl/cogl-xlib-renderer.h                     |    2 +-
 cogl/cogl.c                                   |   44 ++--
 cogl/cogl1-context.h                          |   24 +-
 cogl/cogl2-compatibility.c                    |    8 +-
 cogl/cogl2-path.c                             |   32 ++--
 cogl/cogl2-path.h                             |    2 +-
 cogl/driver/gl/cogl-gl.c                      |    8 +-
 cogl/driver/gl/cogl-texture-driver-gl.c       |   22 +-
 cogl/driver/gles/cogl-gles.c                  |    4 +-
 cogl/driver/gles/cogl-texture-driver-gles.c   |   22 +-
 cogl/stb_image.c                              |  342 +++++++++++++------------
 cogl/winsys/cogl-texture-pixmap-x11-private.h |    4 +-
 cogl/winsys/cogl-texture-pixmap-x11.c         |   34 ++--
 cogl/winsys/cogl-texture-pixmap-x11.h         |   10 +-
 cogl/winsys/cogl-winsys-egl-android.c         |   12 +-
 cogl/winsys/cogl-winsys-egl-gdl.c             |   18 +-
 cogl/winsys/cogl-winsys-egl-kms.c             |   30 +-
 cogl/winsys/cogl-winsys-egl-null.c            |   12 +-
 cogl/winsys/cogl-winsys-egl-private.h         |   14 +-
 cogl/winsys/cogl-winsys-egl-wayland.c         |   14 +-
 cogl/winsys/cogl-winsys-egl-x11.c             |   28 +-
 cogl/winsys/cogl-winsys-egl.c                 |   20 +-
 cogl/winsys/cogl-winsys-glx.c                 |   82 +++---
 cogl/winsys/cogl-winsys-private.h             |   22 +-
 cogl/winsys/cogl-winsys-sdl.c                 |   14 +-
 cogl/winsys/cogl-winsys-stub.c                |   12 +-
 cogl/winsys/cogl-winsys-wgl.c                 |   24 +-
 cogl/winsys/cogl-winsys.c                     |    2 +-
 doc/CODING_STYLE                              |   25 +-
 examples/cogl-crate.c                         |    6 +-
 examples/cogl-hello.c                         |    2 +-
 examples/cogl-msaa.c                          |    2 +-
 examples/cogl-sdl-hello.c                     |    6 +-
 examples/cogl-x11-foreign.c                   |    8 +-
 examples/cogl-x11-tfp.c                       |    6 +-
 examples/cogland.c                            |   56 ++--
 tests/conform/test-atlas-migration.c          |    4 +-
 tests/conform/test-backface-culling.c         |    6 +-
 tests/conform/test-bitmask.c                  |    2 +-
 tests/conform/test-blend-strings.c            |   62 +++---
 tests/conform/test-color-mask.c               |    2 +-
 tests/conform/test-custom-attributes.c        |    8 +-
 tests/conform/test-depth-test.c               |   24 +-
 tests/conform/test-just-vertex-shader.c       |    2 +-
 tests/conform/test-materials.c                |   12 +-
 tests/conform/test-multitexture.c             |   18 +-
 tests/conform/test-npot-texture.c             |    8 +-
 tests/conform/test-offscreen.c                |    4 +-
 tests/conform/test-path.c                     |    6 +-
 tests/conform/test-pipeline-uniforms.c        |    2 +-
 tests/conform/test-pipeline-user-matrix.c     |    8 +-
 tests/conform/test-pixel-buffer.c             |    8 +-
 tests/conform/test-point-size.c               |    4 +-
 tests/conform/test-point-sprite.c             |    4 +-
 tests/conform/test-premult.c                  |   16 +-
 tests/conform/test-primitive.c                |   26 +-
 tests/conform/test-read-texture-formats.c     |   30 +-
 tests/conform/test-readpixels.c               |    8 +-
 tests/conform/test-snippets.c                 |    2 +-
 tests/conform/test-sub-texture.c              |   22 +-
 tests/conform/test-texture-3d.c               |    6 +-
 tests/conform/test-texture-get-set-data.c     |    2 +-
 tests/conform/test-texture-mipmaps.c          |    6 +-
 tests/conform/test-texture-pixmap-x11.c       |   12 +-
 tests/conform/test-texture-rectangle.c        |   12 +-
 tests/conform/test-utils.c                    |   24 +-
 tests/conform/test-utils.h                    |   10 +-
 tests/conform/test-vertex-buffer-contiguous.c |    2 +-
 tests/conform/test-vertex-buffer-interleved.c |    2 +-
 tests/conform/test-vertex-buffer-mutability.c |    2 +-
 tests/conform/test-viewport.c                 |   22 +-
 tests/conform/test-wrap-modes.c               |    6 +-
 tests/conform/test-write-texture-formats.c    |   30 +-
 252 files changed, 2090 insertions(+), 2048 deletions(-)
---
diff --git a/cogl-pango/cogl-pango-display-list.c b/cogl-pango/cogl-pango-display-list.c
index 335ea12..f4f130f 100644
--- a/cogl-pango/cogl-pango-display-list.c
+++ b/cogl-pango/cogl-pango-display-list.c
@@ -44,7 +44,7 @@ typedef struct _CoglPangoDisplayListRectangle CoglPangoDisplayListRectangle;
 
 struct _CoglPangoDisplayList
 {
-  gboolean                color_override;
+  CoglBool                color_override;
   CoglColor               color;
   GSList                 *nodes;
   GSList                 *last_node;
@@ -62,7 +62,7 @@ struct _CoglPangoDisplayListNode
 {
   CoglPangoDisplayListNodeType type;
 
-  gboolean color_override;
+  CoglBool color_override;
   CoglColor color;
 
   CoglPipeline *pipeline;
@@ -261,7 +261,7 @@ emit_vertex_buffer_geometry (CoglPangoDisplayListNode *node)
       CoglAttributeBuffer *buffer;
       CoglVertexP2T2 *verts, *v;
       int n_verts;
-      gboolean allocated = FALSE;
+      CoglBool allocated = FALSE;
       CoglAttribute *attributes[2];
       CoglPrimitive *prim;
       int i;
diff --git a/cogl-pango/cogl-pango-fontmap.c b/cogl-pango/cogl-pango-fontmap.c
index 860f237..f272f80 100644
--- a/cogl-pango/cogl-pango-fontmap.c
+++ b/cogl-pango/cogl-pango-fontmap.c
@@ -167,7 +167,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm)
  */
 void
 cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
-                                        gboolean          value)
+                                        CoglBool          value)
 {
   CoglPangoRenderer *renderer;
 
@@ -187,7 +187,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm)
 {
   CoglPangoRenderer *renderer;
diff --git a/cogl-pango/cogl-pango-glyph-cache.c b/cogl-pango/cogl-pango-glyph-cache.c
index b7fb5b0..a46bfd9 100644
--- a/cogl-pango/cogl-pango-glyph-cache.c
+++ b/cogl-pango/cogl-pango-glyph-cache.c
@@ -49,16 +49,16 @@ struct _CoglPangoGlyphCache
   /* TRUE if we've ever stored a texture in the global atlas. This is
      used to make sure we only register one callback to listen for
      global atlas reorganizations */
-  gboolean          using_global_atlas;
+  CoglBool          using_global_atlas;
 
   /* True if some of the glyphs are dirty. This is used as an
      optimization in _cogl_pango_glyph_cache_set_dirty_glyphs to avoid
      iterating the hash table if we know none of them are dirty */
-  gboolean          has_dirty_glyphs;
+  CoglBool          has_dirty_glyphs;
 
   /* Whether mipmapping is being used for this cache. This only
      affects whether we decide to put the glyph in the global atlas */
-  gboolean          use_mipmapping;
+  CoglBool          use_mipmapping;
 };
 
 struct _CoglPangoGlyphCacheKey
@@ -82,8 +82,8 @@ cogl_pango_glyph_cache_key_free (CoglPangoGlyphCacheKey *key)
   g_slice_free (CoglPangoGlyphCacheKey, key);
 }
 
-static guint
-cogl_pango_glyph_cache_hash_func (gconstpointer key)
+static unsigned int
+cogl_pango_glyph_cache_hash_func (const void *key)
 {
   const CoglPangoGlyphCacheKey *cache_key
     = (const CoglPangoGlyphCacheKey *) key;
@@ -95,9 +95,8 @@ cogl_pango_glyph_cache_hash_func (gconstpointer key)
   return GPOINTER_TO_UINT (cache_key->font) ^ cache_key->glyph;
 }
 
-static gboolean
-cogl_pango_glyph_cache_equal_func (gconstpointer a,
-				      gconstpointer b)
+static CoglBool
+cogl_pango_glyph_cache_equal_func (const void *a, const void *b)
 {
   const CoglPangoGlyphCacheKey *key_a
     = (const CoglPangoGlyphCacheKey *) a;
@@ -112,7 +111,7 @@ cogl_pango_glyph_cache_equal_func (gconstpointer a,
 }
 
 CoglPangoGlyphCache *
-cogl_pango_glyph_cache_new (gboolean use_mipmapping)
+cogl_pango_glyph_cache_new (CoglBool use_mipmapping)
 {
   CoglPangoGlyphCache *cache;
 
@@ -198,7 +197,7 @@ cogl_pango_glyph_cache_update_position_cb (void *user_data,
   value->dirty = TRUE;
 }
 
-static gboolean
+static CoglBool
 cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
                                             PangoFont *font,
                                             PangoGlyph glyph,
@@ -244,7 +243,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
                                            PangoFont *font,
                                            PangoGlyph glyph,
@@ -294,7 +293,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
 
 CoglPangoGlyphCacheValue *
 cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
-                               gboolean             create,
+                               CoglBool             create,
                                PangoFont           *font,
                                PangoGlyph           glyph)
 {
@@ -358,9 +357,9 @@ cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
 }
 
 static void
-_cogl_pango_glyph_cache_set_dirty_glyphs_cb (gpointer key_ptr,
-                                             gpointer value_ptr,
-                                             gpointer user_data)
+_cogl_pango_glyph_cache_set_dirty_glyphs_cb (void *key_ptr,
+                                             void *value_ptr,
+                                             void *user_data)
 {
   CoglPangoGlyphCacheKey *key = key_ptr;
   CoglPangoGlyphCacheValue *value = value_ptr;
diff --git a/cogl-pango/cogl-pango-glyph-cache.h b/cogl-pango/cogl-pango-glyph-cache.h
index df6b632..ba0f0de 100644
--- a/cogl-pango/cogl-pango-glyph-cache.h
+++ b/cogl-pango/cogl-pango-glyph-cache.h
@@ -52,7 +52,7 @@ struct _CoglPangoGlyphCacheValue
 
   /* This will be set to TRUE when the glyph atlas is reorganized
      which means the glyph will need to be redrawn */
-  gboolean   dirty;
+  CoglBool   dirty;
 };
 
 typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
@@ -60,14 +60,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
                                                CoglPangoGlyphCacheValue *value);
 
 CoglPangoGlyphCache *
-cogl_pango_glyph_cache_new (gboolean use_mipmapping);
+cogl_pango_glyph_cache_new (CoglBool use_mipmapping);
 
 void
 cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
 
 CoglPangoGlyphCacheValue *
 cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
-                               gboolean             create,
+                               CoglBool             create,
                                PangoFont           *font,
                                PangoGlyph           glyph);
 
diff --git a/cogl-pango/cogl-pango-pipeline-cache.c b/cogl-pango/cogl-pango-pipeline-cache.c
index e07d646..13f1e2a 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.c
+++ b/cogl-pango/cogl-pango-pipeline-cache.c
@@ -44,7 +44,7 @@ struct _CoglPangoPipelineCache
   CoglPipeline *base_texture_alpha_pipeline;
   CoglPipeline *base_texture_rgba_pipeline;
 
-  gboolean use_mipmapping;
+  CoglBool use_mipmapping;
 };
 
 struct _CoglPangoPipelineCacheEntry
@@ -58,14 +58,14 @@ struct _CoglPangoPipelineCacheEntry
 };
 
 static void
-_cogl_pango_pipeline_cache_key_destroy (gpointer data)
+_cogl_pango_pipeline_cache_key_destroy (void *data)
 {
   if (data)
     cogl_object_unref (data);
 }
 
 static void
-_cogl_pango_pipeline_cache_value_destroy (gpointer data)
+_cogl_pango_pipeline_cache_value_destroy (void *data)
 {
   CoglPangoPipelineCacheEntry *cache_entry = data;
 
@@ -79,7 +79,7 @@ _cogl_pango_pipeline_cache_value_destroy (gpointer data)
 }
 
 CoglPangoPipelineCache *
-_cogl_pango_pipeline_cache_new (gboolean use_mipmapping)
+_cogl_pango_pipeline_cache_new (CoglBool use_mipmapping)
 {
   CoglPangoPipelineCache *cache = g_new (CoglPangoPipelineCache, 1);
 
diff --git a/cogl-pango/cogl-pango-pipeline-cache.h b/cogl-pango/cogl-pango-pipeline-cache.h
index 1ebfb67..23a7771 100644
--- a/cogl-pango/cogl-pango-pipeline-cache.h
+++ b/cogl-pango/cogl-pango-pipeline-cache.h
@@ -36,7 +36,7 @@ G_BEGIN_DECLS
 typedef struct _CoglPangoPipelineCache CoglPangoPipelineCache;
 
 CoglPangoPipelineCache *
-_cogl_pango_pipeline_cache_new (gboolean use_mipmapping);
+_cogl_pango_pipeline_cache_new (CoglBool use_mipmapping);
 
 /* Returns a pipeline that can be used to render glyphs in the given
    texture. The pipeline has a new reference so it is up to the caller
diff --git a/cogl-pango/cogl-pango-private.h b/cogl-pango/cogl-pango-private.h
index 447e853..0c20129 100644
--- a/cogl-pango/cogl-pango-private.h
+++ b/cogl-pango/cogl-pango-private.h
@@ -30,8 +30,8 @@ G_BEGIN_DECLS
 
 void           _cogl_pango_renderer_clear_glyph_cache  (CoglPangoRenderer *renderer);
 void           _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
-                                                        gboolean           value);
-gboolean       _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
+                                                        CoglBool           value);
+CoglBool       _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);
 
 G_END_DECLS
 
diff --git a/cogl-pango/cogl-pango-render.c b/cogl-pango/cogl-pango-render.c
index dccaa15..b1f1f6e 100644
--- a/cogl-pango/cogl-pango-render.c
+++ b/cogl-pango/cogl-pango-render.c
@@ -56,7 +56,7 @@ struct _CoglPangoRenderer
   CoglPangoRendererCaches no_mipmap_caches;
   CoglPangoRendererCaches mipmap_caches;
 
-  gboolean use_mipmapping;
+  CoglBool use_mipmapping;
 
   /* The current display list that is being built */
   CoglPangoDisplayList *display_list;
@@ -82,7 +82,7 @@ struct _CoglPangoRendererQdata
   /* Whether mipmapping was previously used to render this layout. We
      need to regenerate the display list if the mipmapping value is
      changed because it will be using a different set of textures */
-  gboolean mipmapping_used;
+  CoglBool mipmapping_used;
 };
 
 static void
@@ -446,12 +446,12 @@ _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer)
 
 void
 _cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
-                                         gboolean value)
+                                         CoglBool value)
 {
   renderer->use_mipmapping = value;
 }
 
-gboolean
+CoglBool
 _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
 {
   return renderer->use_mipmapping;
@@ -459,7 +459,7 @@ _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
 
 static CoglPangoGlyphCacheValue *
 cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
-                                      gboolean       create,
+                                      CoglBool       create,
                                       PangoFont     *font,
                                       PangoGlyph     glyph)
 {
diff --git a/cogl-pango/cogl-pango.h b/cogl-pango/cogl-pango.h
index 8e7165d..d237eb7 100644
--- a/cogl-pango/cogl-pango.h
+++ b/cogl-pango/cogl-pango.h
@@ -48,8 +48,8 @@ void           cogl_pango_font_map_set_resolution       (CoglPangoFontMap *font_
 void           cogl_pango_font_map_clear_glyph_cache    (CoglPangoFontMap *fm);
 void           cogl_pango_ensure_glyph_cache_for_layout (PangoLayout      *layout);
 void           cogl_pango_font_map_set_use_mipmapping   (CoglPangoFontMap *fm,
-                                                         gboolean          value);
-gboolean       cogl_pango_font_map_get_use_mipmapping   (CoglPangoFontMap *fm);
+                                                         CoglBool          value);
+CoglBool       cogl_pango_font_map_get_use_mipmapping   (CoglPangoFontMap *fm);
 PangoRenderer *cogl_pango_font_map_get_renderer         (CoglPangoFontMap *fm);
 
 #define COGL_PANGO_TYPE_RENDERER                (cogl_pango_renderer_get_type ())
diff --git a/cogl/cogl-atlas-texture-private.h b/cogl/cogl-atlas-texture-private.h
index 43bc2fb..451bd83 100644
--- a/cogl/cogl-atlas-texture-private.h
+++ b/cogl/cogl-atlas-texture-private.h
@@ -76,7 +76,7 @@ void
 _cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
                                                 void *user_data);
 
-gboolean
+CoglBool
 _cogl_is_atlas_texture (void *object);
 
 #endif /* __COGL_ATLAS_TEXTURE_H */
diff --git a/cogl/cogl-atlas-texture.c b/cogl/cogl-atlas-texture.c
index fa27e68..f485893 100644
--- a/cogl/cogl-atlas-texture.c
+++ b/cogl/cogl-atlas-texture.c
@@ -69,7 +69,7 @@ _cogl_atlas_texture_create_sub_texture (CoglTexture *full_texture,
 }
 
 static void
-_cogl_atlas_texture_update_position_cb (gpointer user_data,
+_cogl_atlas_texture_update_position_cb (void *user_data,
                                         CoglTexture *new_texture,
                                         const CoglRectangleMapEntry *rectangle)
 {
@@ -294,7 +294,7 @@ _cogl_atlas_texture_get_max_waste (CoglTexture *tex)
   return cogl_texture_get_max_waste (atlas_tex->sub_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_is_sliced (CoglTexture *tex)
 {
   CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -303,7 +303,7 @@ _cogl_atlas_texture_is_sliced (CoglTexture *tex)
   return cogl_texture_is_sliced (atlas_tex->sub_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_can_hardware_repeat (CoglTexture *tex)
 {
   CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -334,7 +334,7 @@ _cogl_atlas_texture_transform_quad_coords_to_gl (CoglTexture *tex,
                                                     coords);
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_get_gl_texture (CoglTexture *tex,
                                     GLuint *out_gl_handle,
                                     GLenum *out_gl_target)
@@ -430,7 +430,7 @@ _cogl_atlas_texture_ensure_non_quad_rendering (CoglTexture *tex)
   _cogl_texture_ensure_non_quad_rendering (atlas_tex->sub_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex,
                                             int             src_x,
                                             int             src_y,
@@ -540,7 +540,7 @@ _cogl_atlas_texture_prepare_for_upload (CoglAtlasTexture *atlas_tex,
   return override_bmp;
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_set_region (CoglTexture    *tex,
                                 int             src_x,
                                 int             src_y,
@@ -556,7 +556,7 @@ _cogl_atlas_texture_set_region (CoglTexture    *tex,
      pixels to the border */
   if (atlas_tex->atlas)
     {
-      gboolean ret;
+      CoglBool ret;
 
       bmp = _cogl_atlas_texture_prepare_for_upload (atlas_tex,
                                                     bmp);
@@ -619,7 +619,7 @@ _cogl_atlas_texture_get_height (CoglTexture *tex)
   return cogl_texture_get_height (atlas_tex->sub_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_atlas_texture_can_use_format (CoglPixelFormat format)
 {
   /* We don't care about the ordering or the premult status and we can
diff --git a/cogl/cogl-atlas.c b/cogl/cogl-atlas.c
index 03eee30..f892a9d 100644
--- a/cogl/cogl-atlas.c
+++ b/cogl/cogl-atlas.c
@@ -280,7 +280,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
 
   if ((atlas->flags & COGL_ATLAS_CLEAR_TEXTURE))
     {
-      guint8 *clear_data;
+      uint8_t *clear_data;
       CoglBitmap *clear_bmp;
       int bpp = _cogl_pixel_format_get_bytes_per_pixel (atlas->texture_format);
 
@@ -337,7 +337,7 @@ _cogl_atlas_notify_post_reorganize (CoglAtlas *atlas)
   g_hook_list_invoke (&atlas->post_reorganize_callbacks, FALSE);
 }
 
-gboolean
+CoglBool
 _cogl_atlas_reserve_space (CoglAtlas             *atlas,
                            unsigned int           width,
                            unsigned int           height,
@@ -347,7 +347,7 @@ _cogl_atlas_reserve_space (CoglAtlas             *atlas,
   CoglRectangleMap *new_map;
   CoglTexture2D *new_tex;
   unsigned int map_width, map_height;
-  gboolean ret;
+  CoglBool ret;
   CoglRectangleMapEntry new_position;
 
   /* Check if we can fit the rectangle into the existing map */
diff --git a/cogl/cogl-atlas.h b/cogl/cogl-atlas.h
index 2b7bb8e..02fac4a 100644
--- a/cogl/cogl-atlas.h
+++ b/cogl/cogl-atlas.h
@@ -64,7 +64,7 @@ _cogl_atlas_new (CoglPixelFormat texture_format,
                  CoglAtlasFlags flags,
                  CoglAtlasUpdatePositionCallback update_position_cb);
 
-gboolean
+CoglBool
 _cogl_atlas_reserve_space (CoglAtlas             *atlas,
                            unsigned int           width,
                            unsigned int           height,
@@ -95,7 +95,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas            *atlas,
                                         GHookFunc             post_callback,
                                         void                 *user_data);
 
-gboolean
+CoglBool
 _cogl_is_atlas (void *object);
 
 #endif /* __COGL_ATLAS_H */
diff --git a/cogl/cogl-attribute-buffer.c b/cogl/cogl-attribute-buffer.c
index 95adfe0..f9eeeac 100644
--- a/cogl/cogl-attribute-buffer.c
+++ b/cogl/cogl-attribute-buffer.c
@@ -40,11 +40,11 @@ COGL_BUFFER_DEFINE (AttributeBuffer, attribute_buffer);
 
 CoglAttributeBuffer *
 cogl_attribute_buffer_new (CoglContext *context,
-                           gsize bytes,
+                           size_t bytes,
                            const void *data)
 {
   CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
-  gboolean use_malloc;
+  CoglBool use_malloc;
 
   if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
     use_malloc = TRUE;
diff --git a/cogl/cogl-attribute-buffer.h b/cogl/cogl-attribute-buffer.h
index 707cee1..717be0c 100644
--- a/cogl/cogl-attribute-buffer.h
+++ b/cogl/cogl-attribute-buffer.h
@@ -68,7 +68,7 @@ G_BEGIN_DECLS
  */
 CoglAttributeBuffer *
 cogl_attribute_buffer_new (CoglContext *context,
-                           gsize bytes,
+                           size_t bytes,
                            const void *data);
 
 /**
@@ -83,7 +83,7 @@ cogl_attribute_buffer_new (CoglContext *context,
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_attribute_buffer (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-attribute-private.h b/cogl/cogl-attribute-private.h
index aa62120..82a15f2 100644
--- a/cogl/cogl-attribute-private.h
+++ b/cogl/cogl-attribute-private.h
@@ -46,7 +46,7 @@ typedef struct _CoglAttributeNameState
   char *name;
   CoglAttributeNameID name_id;
   int name_index;
-  gboolean normalized_default;
+  CoglBool normalized_default;
   int texture_unit;
 } CoglAttributeNameState;
 
@@ -56,11 +56,11 @@ struct _CoglAttribute
 
   CoglAttributeBuffer *attribute_buffer;
   const CoglAttributeNameState *name_state;
-  gsize stride;
-  gsize offset;
+  size_t stride;
+  size_t offset;
   int n_components;
   CoglAttributeType type;
-  gboolean normalized;
+  CoglBool normalized;
 
   int immutable_ref;
 };
diff --git a/cogl/cogl-attribute.c b/cogl/cogl-attribute.c
index 3f1ae71..2b1a986 100644
--- a/cogl/cogl-attribute.c
+++ b/cogl/cogl-attribute.c
@@ -59,11 +59,11 @@ static void _cogl_attribute_free (CoglAttribute *attribute);
 
 COGL_OBJECT_DEFINE (Attribute, attribute);
 
-static gboolean
+static CoglBool
 validate_cogl_attribute_name (const char *name,
                               char **real_attribute_name,
                               CoglAttributeNameID *name_id,
-                              gboolean *normalized,
+                              CoglBool *normalized,
                               int *texture_unit)
 {
   name = name + 5; /* skip "cogl_" */
@@ -161,8 +161,8 @@ error:
 CoglAttribute *
 cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
                     const char *name,
-                    gsize stride,
-                    gsize offset,
+                    size_t stride,
+                    size_t offset,
                     int n_components,
                     CoglAttributeType type)
 {
@@ -236,7 +236,7 @@ error:
   return NULL;
 }
 
-gboolean
+CoglBool
 cogl_attribute_get_normalized (CoglAttribute *attribute)
 {
   _COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE);
@@ -247,7 +247,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute)
 static void
 warn_about_midscene_changes (void)
 {
-  static gboolean seen = FALSE;
+  static CoglBool seen = FALSE;
   if (!seen)
     {
       g_warning ("Mid-scene modification of attributes has "
@@ -258,7 +258,7 @@ warn_about_midscene_changes (void)
 
 void
 cogl_attribute_set_normalized (CoglAttribute *attribute,
-                                      gboolean normalized)
+                                      CoglBool normalized)
 {
   _COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
 
@@ -323,10 +323,10 @@ typedef struct
 {
   int unit;
   CoglPipelineFlushOptions options;
-  guint32 fallback_layers;
+  uint32_t fallback_layers;
 } ValidateLayerState;
 
-static gboolean
+static CoglBool
 validate_layer_cb (CoglPipeline *pipeline,
                    int layer_index,
                    void *user_data)
@@ -334,7 +334,7 @@ validate_layer_cb (CoglPipeline *pipeline,
   CoglTexture *texture =
     cogl_pipeline_get_layer_texture (pipeline, layer_index);
   ValidateLayerState *state = user_data;
-  gboolean status = TRUE;
+  CoglBool status = TRUE;
 
   /* invalid textures will be handled correctly in
    * _cogl_pipeline_flush_layers_gl_state */
@@ -389,7 +389,7 @@ typedef struct _ForeachChangedBitState
   CoglPipeline *pipeline;
 } ForeachChangedBitState;
 
-static gboolean
+static CoglBool
 toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
 {
   ForeachChangedBitState *state = user_data;
@@ -401,7 +401,7 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
 
 #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
   {
-    gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num);
+    CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
     GLenum cap;
 
     switch (bit_num)
@@ -426,7 +426,7 @@ toggle_builtin_attribute_enabled_cb (int bit_num, void *user_data)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
 {
   ForeachChangedBitState *state = user_data;
@@ -438,7 +438,7 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
 
 #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
   {
-    gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num);
+    CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
 
     GE( context, glClientActiveTexture (GL_TEXTURE0 + bit_num) );
 
@@ -452,11 +452,11 @@ toggle_texcood_attribute_enabled_cb (int bit_num, void *user_data)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 toggle_custom_attribute_enabled_cb (int bit_num, void *user_data)
 {
   ForeachChangedBitState *state = user_data;
-  gboolean enabled = _cogl_bitmask_get (state->new_bits, bit_num);
+  CoglBool enabled = _cogl_bitmask_get (state->new_bits, bit_num);
   CoglContext *context = state->context;
 
   if (enabled)
@@ -496,7 +496,7 @@ static void
 setup_generic_attribute (CoglContext *context,
                          CoglPipeline *pipeline,
                          CoglAttribute *attribute,
-                         guint8 *base)
+                         uint8_t *base)
 {
   int name_index = attribute->name_state->name_index;
   int attrib_location =
@@ -555,7 +555,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
                               int n_attributes)
 {
   int i;
-  gboolean skip_gl_color = FALSE;
+  CoglBool skip_gl_color = FALSE;
   CoglPipeline *copy = NULL;
   int n_tex_coord_attribs = 0;
   ValidateLayerState layers_state;
@@ -689,7 +689,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
       CoglAttribute *attribute = attributes[i];
       CoglAttributeBuffer *attribute_buffer;
       CoglBuffer *buffer;
-      guint8 *base;
+      uint8_t *base;
 
       attribute_buffer = cogl_attribute_get_buffer (attribute);
       buffer = COGL_BUFFER (attribute_buffer);
diff --git a/cogl/cogl-attribute.h b/cogl/cogl-attribute.h
index a85b2de..f9316a6 100644
--- a/cogl/cogl-attribute.h
+++ b/cogl/cogl-attribute.h
@@ -137,8 +137,8 @@ G_BEGIN_DECLS
 CoglAttribute *
 cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
                     const char *name,
-                    gsize stride,
-                    gsize offset,
+                    size_t stride,
+                    size_t offset,
                     int components,
                     CoglAttributeType type);
 
@@ -162,7 +162,7 @@ cogl_attribute_new (CoglAttributeBuffer *attribute_buffer,
  */
 void
 cogl_attribute_set_normalized (CoglAttribute *attribute,
-                               gboolean normalized);
+                               CoglBool normalized);
 
 /**
  * cogl_attribute_get_normalized:
@@ -174,7 +174,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
  * Stability: unstable
  * Since: 1.10
  */
-gboolean
+CoglBool
 cogl_attribute_get_normalized (CoglAttribute *attribute);
 
 /**
@@ -213,7 +213,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
  * Return value: %TRUE if the @object references a #CoglAttribute,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_attribute (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-bitmap-conversion.c b/cogl/cogl-bitmap-conversion.c
index 6a57dbf..17b26e6 100644
--- a/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl-bitmap-conversion.c
@@ -31,7 +31,7 @@
 
 #include <string.h>
 
-#define component_type guint8
+#define component_type uint8_t
 /* We want to specially optimise the packing when we are converting
    to/from an 8-bit type so that it won't do anything. That way for
    example if we are just doing a swizzle conversion then the inner
@@ -43,7 +43,7 @@
 #undef UNPACK_BYTE
 #undef component_type
 
-#define component_type guint16
+#define component_type uint16_t
 #define UNPACK_BYTE(b) (((b) * 65535 + 127) / 255)
 #define PACK_BYTE(b) (((b) * 255 + 32767) / 65535)
 #include "cogl-bitmap-packing.h"
@@ -54,7 +54,7 @@
 /* (Un)Premultiplication */
 
 inline static void
-_cogl_unpremult_alpha_0 (guint8 *dst)
+_cogl_unpremult_alpha_0 (uint8_t *dst)
 {
   dst[0] = 0;
   dst[1] = 0;
@@ -63,9 +63,9 @@ _cogl_unpremult_alpha_0 (guint8 *dst)
 }
 
 inline static void
-_cogl_unpremult_alpha_last (guint8 *dst)
+_cogl_unpremult_alpha_last (uint8_t *dst)
 {
-  guint8 alpha = dst[3];
+  uint8_t alpha = dst[3];
 
   dst[0] = (dst[0] * 255) / alpha;
   dst[1] = (dst[1] * 255) / alpha;
@@ -73,9 +73,9 @@ _cogl_unpremult_alpha_last (guint8 *dst)
 }
 
 inline static void
-_cogl_unpremult_alpha_first (guint8 *dst)
+_cogl_unpremult_alpha_first (uint8_t *dst)
 {
-  guint8 alpha = dst[0];
+  uint8_t alpha = dst[0];
 
   dst[1] = (dst[1] * 255) / alpha;
   dst[2] = (dst[2] * 255) / alpha;
@@ -93,9 +93,9 @@ _cogl_unpremult_alpha_first (guint8 *dst)
   } G_STMT_END
 
 inline static void
-_cogl_premult_alpha_last (guint8 *dst)
+_cogl_premult_alpha_last (uint8_t *dst)
 {
-  guint8 alpha = dst[3];
+  uint8_t alpha = dst[3];
   /* Using a separate temporary per component has given slightly better
    * code generation with GCC in the past; it shouldn't do any worse in
    * any case.
@@ -107,9 +107,9 @@ _cogl_premult_alpha_last (guint8 *dst)
 }
 
 inline static void
-_cogl_premult_alpha_first (guint8 *dst)
+_cogl_premult_alpha_first (uint8_t *dst)
 {
-  guint8 alpha = dst[0];
+  uint8_t alpha = dst[0];
   unsigned int t1, t2, t3;
 
   MULT(dst[1], alpha, t1);
@@ -130,13 +130,13 @@ _cogl_premult_alpha_first (guint8 *dst)
 #ifdef COGL_USE_PREMULT_SSE2
 
 inline static void
-_cogl_premult_alpha_last_four_pixels_sse2 (guint8 *p)
+_cogl_premult_alpha_last_four_pixels_sse2 (uint8_t *p)
 {
   /* 8 copies of 128 used below */
-  static const gint16 eight_halves[8] __attribute__ ((aligned (16))) =
+  static const int16_t eight_halves[8] __attribute__ ((aligned (16))) =
     { 128, 128, 128, 128, 128, 128, 128, 128 };
   /* Mask of the rgb components of the four pixels */
-  static const gint8 just_rgb[16] __attribute__ ((aligned (16))) =
+  static const int8_t just_rgb[16] __attribute__ ((aligned (16))) =
     { 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00,
       0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0x00 };
   /* Each SSE register only holds two pixels because we need to work
@@ -205,7 +205,7 @@ _cogl_premult_alpha_last_four_pixels_sse2 (guint8 *p)
 #endif /* COGL_USE_PREMULT_SSE2 */
 
 static void
-_cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data,
+_cogl_bitmap_premult_unpacked_span_uint8_t (uint8_t *data,
                                            int width)
 {
 #ifdef COGL_USE_PREMULT_SSE2
@@ -231,7 +231,7 @@ _cogl_bitmap_premult_unpacked_span_guint8 (guint8 *data,
 }
 
 static void
-_cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data,
+_cogl_bitmap_unpremult_unpacked_span_uint8_t (uint8_t *data,
                                              int width)
 {
   int x;
@@ -247,15 +247,15 @@ _cogl_bitmap_unpremult_unpacked_span_guint8 (guint8 *data,
 }
 
 static void
-_cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data,
+_cogl_bitmap_unpremult_unpacked_span_uint16_t (uint16_t *data,
                                               int width)
 {
   while (width-- > 0)
     {
-      guint16 alpha = data[3];
+      uint16_t alpha = data[3];
 
       if (alpha == 0)
-        memset (data, 0, sizeof (guint16) * 3);
+        memset (data, 0, sizeof (uint16_t) * 3);
       else
         {
           data[0] = (data[0] * 65535) / alpha;
@@ -266,12 +266,12 @@ _cogl_bitmap_unpremult_unpacked_span_guint16 (guint16 *data,
 }
 
 static void
-_cogl_bitmap_premult_unpacked_span_guint16 (guint16 *data,
+_cogl_bitmap_premult_unpacked_span_uint16_t (uint16_t *data,
                                             int width)
 {
   while (width-- > 0)
     {
-      guint16 alpha = data[3];
+      uint16_t alpha = data[3];
 
       data[0] = (data[0] * alpha) / 65535;
       data[1] = (data[1] * alpha) / 65535;
@@ -279,7 +279,7 @@ _cogl_bitmap_premult_unpacked_span_guint16 (guint16 *data,
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_bitmap_can_fast_premult (CoglPixelFormat format)
 {
   switch (format & ~COGL_PREMULT_BIT)
@@ -295,7 +295,7 @@ _cogl_bitmap_can_fast_premult (CoglPixelFormat format)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
 {
   /* If the format is using more than 8 bits per component then we'll
@@ -343,23 +343,23 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
   g_assert_not_reached ();
 }
 
-gboolean
+CoglBool
 _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
                                   CoglBitmap *dst_bmp)
 {
-  guint8          *src_data;
-  guint8          *dst_data;
-  guint8          *src;
-  guint8          *dst;
-  void            *tmp_row;
-  int              src_rowstride;
-  int              dst_rowstride;
-  int              y;
-  int              width, height;
-  CoglPixelFormat  src_format;
-  CoglPixelFormat  dst_format;
-  gboolean         use_16;
-  gboolean         need_premult;
+  uint8_t *src_data;
+  uint8_t *dst_data;
+  uint8_t *src;
+  uint8_t *dst;
+  void *tmp_row;
+  int src_rowstride;
+  int dst_rowstride;
+  int y;
+  int width, height;
+  CoglPixelFormat src_format;
+  CoglPixelFormat dst_format;
+  CoglBool use_16;
+  CoglBool need_premult;
 
   src_format = cogl_bitmap_get_format (src_bmp);
   src_rowstride = cogl_bitmap_get_rowstride (src_bmp);
@@ -421,7 +421,7 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
 
   /* Allocate a buffer to hold a temporary RGBA row */
   tmp_row = g_malloc (width *
-                      (use_16 ? sizeof (guint16) : sizeof (guint8)) * 4);
+                      (use_16 ? sizeof (uint16_t) : sizeof (uint8_t)) * 4);
 
   /* FIXME: Optimize */
   for (y = 0; y < height; y++)
@@ -430,9 +430,9 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
       dst = dst_data + y * dst_rowstride;
 
       if (use_16)
-        _cogl_unpack_guint16 (src_format, src, tmp_row, width);
+        _cogl_unpack_uint16_t (src_format, src, tmp_row, width);
       else
-        _cogl_unpack_guint8 (src_format, src, tmp_row, width);
+        _cogl_unpack_uint8_t (src_format, src, tmp_row, width);
 
       /* Handle premultiplication */
       if (need_premult)
@@ -440,23 +440,23 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
           if (dst_format & COGL_PREMULT_BIT)
             {
               if (use_16)
-                _cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width);
+                _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
               else
-                _cogl_bitmap_premult_unpacked_span_guint8 (tmp_row, width);
+                _cogl_bitmap_premult_unpacked_span_uint8_t (tmp_row, width);
             }
           else
             {
               if (use_16)
-                _cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width);
+                _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
               else
-                _cogl_bitmap_unpremult_unpacked_span_guint8 (tmp_row, width);
+                _cogl_bitmap_unpremult_unpacked_span_uint8_t (tmp_row, width);
             }
         }
 
       if (use_16)
-        _cogl_pack_guint16 (dst_format, tmp_row, dst, width);
+        _cogl_pack_uint16_t (dst_format, tmp_row, dst, width);
       else
-        _cogl_pack_guint8 (dst_format, tmp_row, dst, width);
+        _cogl_pack_uint8_t (dst_format, tmp_row, dst, width);
     }
 
   _cogl_bitmap_unmap (src_bmp);
@@ -492,15 +492,15 @@ _cogl_bitmap_convert (CoglBitmap *src_bmp,
   return dst_bmp;
 }
 
-gboolean
+CoglBool
 _cogl_bitmap_unpremult (CoglBitmap *bmp)
 {
-  guint8          *p, *data;
-  guint16         *tmp_row;
-  int              x,y;
-  CoglPixelFormat  format;
-  int              width, height;
-  int              rowstride;
+  uint8_t *p, *data;
+  uint16_t *tmp_row;
+  int x,y;
+  CoglPixelFormat format;
+  int width, height;
+  int rowstride;
 
   format = cogl_bitmap_get_format (bmp);
   width = cogl_bitmap_get_width (bmp);
@@ -519,17 +519,17 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
   if (_cogl_bitmap_can_fast_premult (format))
     tmp_row = NULL;
   else
-    tmp_row = g_malloc (sizeof (guint16) * 4 * width);
+    tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
 
   for (y = 0; y < height; y++)
     {
-      p = (guint8*) data + y * rowstride;
+      p = (uint8_t*) data + y * rowstride;
 
       if (tmp_row)
         {
-          _cogl_unpack_guint16 (format, p, tmp_row, width);
-          _cogl_bitmap_unpremult_unpacked_span_guint16 (tmp_row, width);
-          _cogl_pack_guint16 (format, tmp_row, p, width);
+          _cogl_unpack_uint16_t (format, p, tmp_row, width);
+          _cogl_bitmap_unpremult_unpacked_span_uint16_t (tmp_row, width);
+          _cogl_pack_uint16_t (format, tmp_row, p, width);
         }
       else
         {
@@ -545,7 +545,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
                 }
             }
           else
-            _cogl_bitmap_unpremult_unpacked_span_guint8 (p, width);
+            _cogl_bitmap_unpremult_unpacked_span_uint8_t (p, width);
         }
     }
 
@@ -558,15 +558,15 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp)
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_bitmap_premult (CoglBitmap *bmp)
 {
-  guint8          *p, *data;
-  guint16         *tmp_row;
-  int              x,y;
-  CoglPixelFormat  format;
-  int              width, height;
-  int              rowstride;
+  uint8_t *p, *data;
+  uint16_t *tmp_row;
+  int x,y;
+  CoglPixelFormat format;
+  int width, height;
+  int rowstride;
 
   format = cogl_bitmap_get_format (bmp);
   width = cogl_bitmap_get_width (bmp);
@@ -584,17 +584,17 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
   if (_cogl_bitmap_can_fast_premult (format))
     tmp_row = NULL;
   else
-    tmp_row = g_malloc (sizeof (guint16) * 4 * width);
+    tmp_row = g_malloc (sizeof (uint16_t) * 4 * width);
 
   for (y = 0; y < height; y++)
     {
-      p = (guint8*) data + y * rowstride;
+      p = (uint8_t*) data + y * rowstride;
 
       if (tmp_row)
         {
-          _cogl_unpack_guint16 (format, p, tmp_row, width);
-          _cogl_bitmap_premult_unpacked_span_guint16 (tmp_row, width);
-          _cogl_pack_guint16 (format, tmp_row, p, width);
+          _cogl_unpack_uint16_t (format, p, tmp_row, width);
+          _cogl_bitmap_premult_unpacked_span_uint16_t (tmp_row, width);
+          _cogl_pack_uint16_t (format, tmp_row, p, width);
         }
       else
         {
@@ -607,7 +607,7 @@ _cogl_bitmap_premult (CoglBitmap *bmp)
                 }
             }
           else
-            _cogl_bitmap_premult_unpacked_span_guint8 (p, width);
+            _cogl_bitmap_premult_unpacked_span_uint8_t (p, width);
         }
     }
 
diff --git a/cogl/cogl-bitmap-packing.h b/cogl/cogl-bitmap-packing.h
index 6c0a985..f84af02 100644
--- a/cogl/cogl-bitmap-packing.h
+++ b/cogl/cogl-bitmap-packing.h
@@ -22,7 +22,7 @@
  */
 
 /* This file is included multiple times with different definitions for
-   the component_type type (either guint8 or guint16). The code ends
+   the component_type type (either uint8_t or uint16_t). The code ends
    up exactly the same for both but we only want to end up hitting the
    16-bit path when one of the types in the conversion is > 8 bits per
    component. */
@@ -42,7 +42,7 @@
                        511) / 1023)
 
 inline static void
-G_PASTE (_cogl_unpack_a_8_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_a_8_, component_type) (const uint8_t *src,
                                              component_type *dst,
                                              int width)
 {
@@ -58,7 +58,7 @@ G_PASTE (_cogl_unpack_a_8_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_g_8_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_g_8_, component_type) (const uint8_t *src,
                                              component_type *dst,
                                              int width)
 {
@@ -79,7 +79,7 @@ G_PASTE (_cogl_unpack_g_8_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgb_888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgb_888_, component_type) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
@@ -95,7 +95,7 @@ G_PASTE (_cogl_unpack_rgb_888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgr_888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_bgr_888_, component_type) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
@@ -111,7 +111,7 @@ G_PASTE (_cogl_unpack_bgr_888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -127,7 +127,7 @@ G_PASTE (_cogl_unpack_bgra_8888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_argb_8888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_argb_8888_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -143,7 +143,7 @@ G_PASTE (_cogl_unpack_argb_8888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -159,7 +159,7 @@ G_PASTE (_cogl_unpack_abgr_8888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
@@ -175,13 +175,13 @@ G_PASTE (_cogl_unpack_rgba_8888_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgb_565_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgb_565_, component_type) (const uint8_t *src,
                                                  component_type *dst,
                                                  int width)
 {
   while (width-- > 0)
     {
-      guint16 v = *(const guint16 *) src;
+      uint16_t v = *(const uint16_t *) src;
 
       dst[0] = UNPACK_5 (v >> 11);
       dst[1] = UNPACK_6 ((v >> 5) & 63);
@@ -193,13 +193,13 @@ G_PASTE (_cogl_unpack_rgb_565_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
   while (width-- > 0)
     {
-      guint16 v = *(const guint16 *) src;
+      uint16_t v = *(const uint16_t *) src;
 
       dst[0] = UNPACK_4 (v >> 12);
       dst[1] = UNPACK_4 ((v >> 8) & 15);
@@ -211,13 +211,13 @@ G_PASTE (_cogl_unpack_rgba_4444_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const uint8_t *src,
                                                    component_type *dst,
                                                    int width)
 {
   while (width-- > 0)
     {
-      guint16 v = *(const guint16 *) src;
+      uint16_t v = *(const uint16_t *) src;
 
       dst[0] = UNPACK_5 (v >> 11);
       dst[1] = UNPACK_5 ((v >> 6) & 31);
@@ -229,13 +229,13 @@ G_PASTE (_cogl_unpack_rgba_5551_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
   while (width-- > 0)
     {
-      guint32 v = *(const guint32 *) src;
+      uint32_t v = *(const uint32_t *) src;
 
       dst[0] = UNPACK_10 (v >> 22);
       dst[1] = UNPACK_10 ((v >> 12) & 1023);
@@ -247,13 +247,13 @@ G_PASTE (_cogl_unpack_rgba_1010102_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
   while (width-- > 0)
     {
-      guint32 v = *(const guint32 *) src;
+      uint32_t v = *(const uint32_t *) src;
 
       dst[2] = UNPACK_10 (v >> 22);
       dst[1] = UNPACK_10 ((v >> 12) & 1023);
@@ -265,13 +265,13 @@ G_PASTE (_cogl_unpack_bgra_1010102_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
   while (width-- > 0)
     {
-      guint32 v = *(const guint32 *) src;
+      uint32_t v = *(const uint32_t *) src;
 
       dst[3] = UNPACK_2 (v >> 30);
       dst[0] = UNPACK_10 ((v >> 20) & 1023);
@@ -283,13 +283,13 @@ G_PASTE (_cogl_unpack_argb_2101010_, component_type) (const guint8 *src,
 }
 
 inline static void
-G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const guint8 *src,
+G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const uint8_t *src,
                                                       component_type *dst,
                                                       int width)
 {
   while (width-- > 0)
     {
-      guint32 v = *(const guint32 *) src;
+      uint32_t v = *(const uint32_t *) src;
 
       dst[3] = UNPACK_2 (v >> 30);
       dst[2] = UNPACK_10 ((v >> 20) & 1023);
@@ -309,7 +309,7 @@ G_PASTE (_cogl_unpack_abgr_2101010_, component_type) (const guint8 *src,
 
 inline static void
 G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
-                                         const guint8 *src,
+                                         const uint8_t *src,
                                          component_type *dst,
                                          int width)
 {
@@ -392,7 +392,7 @@ G_PASTE (_cogl_unpack_, component_type) (CoglPixelFormat format,
 
 inline static void
 G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
-                                           guint8 *dst,
+                                           uint8_t *dst,
                                            int width)
 {
   while (width-- > 0)
@@ -405,7 +405,7 @@ G_PASTE (_cogl_pack_a_8_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
-                                           guint8 *dst,
+                                           uint8_t *dst,
                                            int width)
 {
   /* FIXME: I'm not sure if this is right. It looks like Nvidia and
@@ -423,7 +423,7 @@ G_PASTE (_cogl_pack_g_8_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
-                                               guint8 *dst,
+                                               uint8_t *dst,
                                                int width)
 {
   while (width-- > 0)
@@ -438,7 +438,7 @@ G_PASTE (_cogl_pack_rgb_888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
-                                               guint8 *dst,
+                                               uint8_t *dst,
                                                int width)
 {
   while (width-- > 0)
@@ -453,7 +453,7 @@ G_PASTE (_cogl_pack_bgr_888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
@@ -469,7 +469,7 @@ G_PASTE (_cogl_pack_bgra_8888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
@@ -485,7 +485,7 @@ G_PASTE (_cogl_pack_argb_8888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
@@ -501,7 +501,7 @@ G_PASTE (_cogl_pack_abgr_8888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
@@ -517,12 +517,12 @@ G_PASTE (_cogl_pack_rgba_8888_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
-                                               guint8 *dst,
+                                               uint8_t *dst,
                                                int width)
 {
   while (width-- > 0)
     {
-      guint16 *v = (guint16 *) dst;
+      uint16_t *v = (uint16_t *) dst;
 
       *v = ((PACK_5 (src[0]) << 11) |
             (PACK_6 (src[1]) << 5) |
@@ -534,12 +534,12 @@ G_PASTE (_cogl_pack_rgb_565_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
     {
-      guint16 *v = (guint16 *) dst;
+      uint16_t *v = (uint16_t *) dst;
 
       *v = ((PACK_4 (src[0]) << 12) |
             (PACK_4 (src[1]) << 8) |
@@ -552,12 +552,12 @@ G_PASTE (_cogl_pack_rgba_4444_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
-                                                 guint8 *dst,
+                                                 uint8_t *dst,
                                                  int width)
 {
   while (width-- > 0)
     {
-      guint16 *v = (guint16 *) dst;
+      uint16_t *v = (uint16_t *) dst;
 
       *v = ((PACK_5 (src[0]) << 11) |
             (PACK_5 (src[1]) << 6) |
@@ -570,12 +570,12 @@ G_PASTE (_cogl_pack_rgba_5551_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
-                                                    guint8 *dst,
+                                                    uint8_t *dst,
                                                     int width)
 {
   while (width-- > 0)
     {
-      guint32 *v = (guint32 *) dst;
+      uint32_t *v = (uint32_t *) dst;
 
       *v = ((PACK_10 (src[0]) << 22) |
             (PACK_10 (src[1]) << 12) |
@@ -588,12 +588,12 @@ G_PASTE (_cogl_pack_rgba_1010102_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
-                                                    guint8 *dst,
+                                                    uint8_t *dst,
                                                     int width)
 {
   while (width-- > 0)
     {
-      guint32 *v = (guint32 *) dst;
+      uint32_t *v = (uint32_t *) dst;
 
       *v = ((PACK_10 (src[2]) << 22) |
             (PACK_10 (src[1]) << 12) |
@@ -606,12 +606,12 @@ G_PASTE (_cogl_pack_bgra_1010102_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
-                                                    guint8 *dst,
+                                                    uint8_t *dst,
                                                     int width)
 {
   while (width-- > 0)
     {
-      guint32 *v = (guint32 *) dst;
+      uint32_t *v = (uint32_t *) dst;
 
       *v = ((PACK_2 (src[3]) << 30) |
             (PACK_10 (src[0]) << 20) |
@@ -624,12 +624,12 @@ G_PASTE (_cogl_pack_argb_2101010_, component_type) (const component_type *src,
 
 inline static void
 G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
-                                                    guint8 *dst,
+                                                    uint8_t *dst,
                                                     int width)
 {
   while (width-- > 0)
     {
-      guint32 *v = (guint32 *) dst;
+      uint32_t *v = (uint32_t *) dst;
 
       *v = ((PACK_2 (src[3]) << 30) |
             (PACK_10 (src[2]) << 20) |
@@ -651,7 +651,7 @@ G_PASTE (_cogl_pack_abgr_2101010_, component_type) (const component_type *src,
 inline static void
 G_PASTE (_cogl_pack_, component_type) (CoglPixelFormat format,
                                        const component_type *src,
-                                       guint8 *dst,
+                                       uint8_t *dst,
                                        int width)
 {
   switch (format)
diff --git a/cogl/cogl-bitmap-pixbuf.c b/cogl/cogl-bitmap-pixbuf.c
index 3fa8b50..abbf0cd 100644
--- a/cogl/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl-bitmap-pixbuf.c
@@ -40,7 +40,7 @@
 
 #ifdef USE_QUARTZ
 
-gboolean
+CoglBool
 _cogl_bitmap_get_size_from_file (const char *filename,
                                  int        *width,
                                  int        *height)
@@ -64,8 +64,8 @@ _cogl_bitmap_from_file (const char  *filename,
   CGImageRef image;
   int save_errno;
   CFStringRef type;
-  gsize width, height, rowstride;
-  guint8 *out_data;
+  size_t width, height, rowstride;
+  uint8_t *out_data;
   CGColorSpaceRef color_space;
   CGContextRef bitmap_context;
   CoglBitmap *bmp;
@@ -159,7 +159,7 @@ _cogl_bitmap_from_file (const char  *filename,
 
 #elif defined(USE_GDKPIXBUF)
 
-gboolean
+CoglBool
 _cogl_bitmap_get_size_from_file (const char *filename,
                                  int        *width,
                                  int        *height)
@@ -178,7 +178,7 @@ _cogl_bitmap_from_file (const char   *filename,
 {
   static CoglUserDataKey pixbuf_key;
   GdkPixbuf        *pixbuf;
-  gboolean          has_alpha;
+  CoglBool          has_alpha;
   GdkColorspace     color_space;
   CoglPixelFormat   pixel_format;
   int               width;
@@ -255,7 +255,7 @@ _cogl_bitmap_from_file (const char   *filename,
 
 #include "stb_image.c"
 
-gboolean
+CoglBool
 _cogl_bitmap_get_size_from_file (const char *filename,
                                  int        *width,
                                  int        *height)
@@ -278,7 +278,7 @@ _cogl_bitmap_from_file (const char  *filename,
   int      stb_pixel_format;
   int      width;
   int      height;
-  guint8  *pixels;
+  uint8_t  *pixels;
 
   _COGL_GET_CONTEXT (ctx, NULL);
 
diff --git a/cogl/cogl-bitmap-private.h b/cogl/cogl-bitmap-private.h
index b67c4f2..c6b3cfc 100644
--- a/cogl/cogl-bitmap-private.h
+++ b/cogl/cogl-bitmap-private.h
@@ -71,7 +71,7 @@ CoglBitmap *
 _cogl_bitmap_convert (CoglBitmap *bmp,
 		      CoglPixelFormat   dst_format);
 
-gboolean
+CoglBool
 _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
                                   CoglBitmap *dst_bmp);
 
@@ -79,17 +79,17 @@ CoglBitmap *
 _cogl_bitmap_from_file (const char *filename,
 			GError     **error);
 
-gboolean
+CoglBool
 _cogl_bitmap_unpremult (CoglBitmap *dst_bmp);
 
-gboolean
+CoglBool
 _cogl_bitmap_premult (CoglBitmap *dst_bmp);
 
-gboolean
+CoglBool
 _cogl_bitmap_convert_premult_status (CoglBitmap      *bmp,
                                      CoglPixelFormat  dst_format);
 
-gboolean
+CoglBool
 _cogl_bitmap_copy_subregion (CoglBitmap *src,
 			     CoglBitmap *dst,
 			     int         src_x,
@@ -103,7 +103,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
 CoglBitmap *
 _cogl_bitmap_copy (CoglBitmap *src_bmp);
 
-gboolean
+CoglBool
 _cogl_bitmap_get_size_from_file (const char *filename,
                                  int        *width,
                                  int        *height);
@@ -120,7 +120,7 @@ _cogl_bitmap_set_format (CoglBitmap *bitmap,
    uploads data using gdk_pixbuf_new_subpixbuf with a sub region
    containing the last row of the pixbuf because in that case the
    rowstride can be much larger than the width of the image */
-guint8 *
+uint8_t *
 _cogl_bitmap_map (CoglBitmap *bitmap,
                   CoglBufferAccess access,
                   CoglBufferMapHint hints);
@@ -134,7 +134,7 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap);
    was created with new_from_buffer but it will however be good to
    pass to glTexImage2D for example. The access should be READ for
    unpacking and WRITE for packing. It can not be both */
-guint8 *
+uint8_t *
 _cogl_bitmap_bind (CoglBitmap *bitmap,
                    CoglBufferAccess access,
                    CoglBufferMapHint hints);
diff --git a/cogl/cogl-bitmap.c b/cogl/cogl-bitmap.c
index 8952608..1f0a673 100644
--- a/cogl/cogl-bitmap.c
+++ b/cogl/cogl-bitmap.c
@@ -37,28 +37,28 @@
 
 struct _CoglBitmap
 {
-  CoglObject               _parent;
+  CoglObject _parent;
 
   /* Pointer back to the context that this bitmap was created with */
-  CoglContext             *context;
+  CoglContext *context;
 
-  CoglPixelFormat          format;
-  int                      width;
-  int                      height;
-  int                      rowstride;
+  CoglPixelFormat format;
+  int width;
+  int height;
+  int rowstride;
 
-  guint8                  *data;
+  uint8_t *data;
 
-  gboolean                 mapped;
-  gboolean                 bound;
+  CoglBool mapped;
+  CoglBool bound;
 
   /* If this is non-null then 'data' is ignored and instead it is
      fetched from this shared bitmap. */
-  CoglBitmap              *shared_bmp;
+  CoglBitmap *shared_bmp;
 
   /* If this is non-null then 'data' is treated as an offset into the
      buffer and map will divert to mapping the buffer */
-  CoglBuffer              *buffer;
+  CoglBuffer *buffer;
 };
 
 static void _cogl_bitmap_free (CoglBitmap *bmp);
@@ -83,7 +83,7 @@ _cogl_bitmap_free (CoglBitmap *bmp)
   g_slice_free (CoglBitmap, bmp);
 }
 
-gboolean
+CoglBool
 _cogl_bitmap_convert_premult_status (CoglBitmap      *bmp,
                                      CoglPixelFormat  dst_format)
 {
@@ -125,7 +125,7 @@ _cogl_bitmap_copy (CoglBitmap *src_bmp)
   return dst_bmp;
 }
 
-gboolean
+CoglBool
 _cogl_bitmap_copy_subregion (CoglBitmap *src,
 			     CoglBitmap *dst,
 			     int         src_x,
@@ -135,11 +135,11 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
 			     int         width,
 			     int         height)
 {
-  guint8 *srcdata;
-  guint8 *dstdata;
-  int    bpp;
-  int    line;
-  gboolean succeeded = FALSE;
+  uint8_t *srcdata;
+  uint8_t *dstdata;
+  int bpp;
+  int line;
+  CoglBool succeeded = FALSE;
 
   /* Intended only for fast copies when format is equal! */
   g_assert ((src->format & ~COGL_PREMULT_BIT) ==
@@ -172,7 +172,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
   return succeeded;
 }
 
-gboolean
+CoglBool
 cogl_bitmap_get_size_from_file (const char *filename,
                                 int        *width,
                                 int        *height)
@@ -186,7 +186,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
                           int height,
                           CoglPixelFormat format,
                           int rowstride,
-                          guint8 *data)
+                          uint8_t *data)
 {
   CoglBitmap *bmp;
 
@@ -216,7 +216,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
   static CoglUserDataKey bitmap_free_key;
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
   int rowstride = ((width * bpp) + 3) & ~3;
-  guint8 *data = g_malloc (rowstride * height);
+  uint8_t *data = g_malloc (rowstride * height);
   CoglBitmap *bitmap;
 
   bitmap = cogl_bitmap_new_for_data (context,
@@ -365,7 +365,7 @@ cogl_bitmap_error_quark (void)
   return g_quark_from_static_string ("cogl-bitmap-error-quark");
 }
 
-guint8 *
+uint8_t *
 _cogl_bitmap_map (CoglBitmap *bitmap,
                   CoglBufferAccess access,
                   CoglBufferMapHint hints)
@@ -378,7 +378,7 @@ _cogl_bitmap_map (CoglBitmap *bitmap,
 
   if (bitmap->buffer)
     {
-      guint8 *data = cogl_buffer_map (bitmap->buffer,
+      uint8_t *data = cogl_buffer_map (bitmap->buffer,
                                       access,
                                       hints);
 
@@ -420,12 +420,12 @@ _cogl_bitmap_unmap (CoglBitmap *bitmap)
     cogl_buffer_unmap (bitmap->buffer);
 }
 
-guint8 *
+uint8_t *
 _cogl_bitmap_bind (CoglBitmap *bitmap,
                    CoglBufferAccess access,
                    CoglBufferMapHint hints)
 {
-  guint8 *ptr;
+  uint8_t *ptr;
 
   /* Divert to another bitmap if this data is shared */
   if (bitmap->shared_bmp)
@@ -437,7 +437,7 @@ _cogl_bitmap_bind (CoglBitmap *bitmap,
      implementation of bind is the same as map */
   if (bitmap->buffer == NULL)
     {
-      guint8 *data = _cogl_bitmap_map (bitmap, access, hints);
+      uint8_t *data = _cogl_bitmap_map (bitmap, access, hints);
       if (data)
         bitmap->bound = TRUE;
       return data;
diff --git a/cogl/cogl-bitmap.h b/cogl/cogl-bitmap.h
index e13d2c8..7900306 100644
--- a/cogl/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
@@ -155,7 +155,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
                           int height,
                           CoglPixelFormat format,
                           int rowstride,
-                          guint8 *data);
+                          uint8_t *data);
 
 /**
  * cogl_bitmap_get_format:
@@ -232,7 +232,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_bitmap_get_size_from_file (const char *filename,
                                 int *width,
                                 int *height);
@@ -248,7 +248,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_is_bitmap (void *object);
 
 /**
diff --git a/cogl/cogl-bitmask.c b/cogl/cogl-bitmask.c
index 73c9d7c..43970b6 100644
--- a/cogl/cogl-bitmask.c
+++ b/cogl/cogl-bitmask.c
@@ -49,7 +49,7 @@ _COGL_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *),
 #define BIT_MASK(bit_num) \
   (1UL << BIT_INDEX (bit_num))
 
-gboolean
+CoglBool
 _cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
                               unsigned int bit_num)
 {
@@ -83,7 +83,7 @@ _cogl_bitmask_convert_to_array (CoglBitmask *bitmask)
 void
 _cogl_bitmask_set_in_array (CoglBitmask *bitmask,
                             unsigned int bit_num,
-                            gboolean value)
+                            CoglBool value)
 {
   GArray *array;
   unsigned int array_index;
@@ -147,7 +147,7 @@ _cogl_bitmask_set_bits (CoglBitmask *dst,
 void
 _cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
                                   unsigned int n_bits,
-                                  gboolean value)
+                                  CoglBool value)
 {
   GArray *array;
   unsigned int array_index, bit_index;
diff --git a/cogl/cogl-bitmask.h b/cogl/cogl-bitmask.h
index 7c15e1b..dd238e7 100644
--- a/cogl/cogl-bitmask.h
+++ b/cogl/cogl-bitmask.h
@@ -85,19 +85,19 @@ typedef struct _CoglBitmaskImaginaryType *CoglBitmask;
 #define _cogl_bitmask_init(bitmask) \
   G_STMT_START { *(bitmask) = _cogl_bitmask_from_bits (0); } G_STMT_END
 
-gboolean
+CoglBool
 _cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
                               unsigned int bit_num);
 
 void
 _cogl_bitmask_set_in_array (CoglBitmask *bitmask,
                             unsigned int bit_num,
-                            gboolean value);
+                            CoglBool value);
 
 void
 _cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
                                   unsigned int n_bits,
-                                  gboolean value);
+                                  CoglBool value);
 
 void
 _cogl_bitmask_clear_all_in_array (CoglBitmask *bitmask);
@@ -138,7 +138,7 @@ _cogl_bitmask_xor_bits (CoglBitmask *dst,
                         const CoglBitmask *src);
 
 /* The foreach function can return FALSE to stop iteration */
-typedef gboolean (* CoglBitmaskForeachFunc) (int bit_num, void *user_data);
+typedef CoglBool (* CoglBitmaskForeachFunc) (int bit_num, void *user_data);
 
 /*
  * cogl_bitmask_foreach:
@@ -160,7 +160,7 @@ _cogl_bitmask_foreach (const CoglBitmask *bitmask,
  *
  * Return value: whether bit number @bit_num is set in @bitmask
  */
-static inline gboolean
+static inline CoglBool
 _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
 {
   if (_cogl_bitmask_has_array (bitmask))
@@ -180,7 +180,7 @@ _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
  * Sets or resets a bit number @bit_num in @bitmask according to @value.
  */
 static inline void
-_cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, gboolean value)
+_cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, CoglBool value)
 {
   if (_cogl_bitmask_has_array (bitmask) ||
       bit_num >= COGL_BITMASK_MAX_DIRECT_BITS)
@@ -204,7 +204,7 @@ _cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, gboolean value)
 static inline void
 _cogl_bitmask_set_range (CoglBitmask *bitmask,
                          unsigned int n_bits,
-                         gboolean value)
+                         CoglBool value)
 {
   if (_cogl_bitmask_has_array (bitmask) ||
       n_bits > COGL_BITMASK_MAX_DIRECT_BITS)
diff --git a/cogl/cogl-blend-string.c b/cogl/cogl-blend-string.c
index 50d32f2..5823a1d 100644
--- a/cogl/cogl-blend-string.c
+++ b/cogl/cogl-blend-string.c
@@ -158,7 +158,7 @@ _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,
     }
 }
 
-static gboolean
+static CoglBool
 validate_tex_combine_statements (CoglBlendStringStatement *statements,
                                  int n_statements,
                                  GError **error)
@@ -204,7 +204,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 validate_blend_statements (CoglBlendStringStatement *statements,
                            int n_statements,
                            GError **error)
@@ -283,7 +283,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 validate_statements_for_context (CoglBlendStringStatement *statements,
                                  int n_statements,
                                  CoglBlendStringContext context,
@@ -392,9 +392,9 @@ get_function_info (const char *mark,
                    const char *p,
                    CoglBlendStringContext context)
 {
-  gsize len = p - mark;
+  size_t len = p - mark;
   CoglBlendStringFunctionInfo *functions;
-  gsize array_len;
+  size_t array_len;
   int i;
 
   if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@@ -422,9 +422,9 @@ get_color_src_info (const char *mark,
                     const char *p,
                     CoglBlendStringContext context)
 {
-  gsize len = p - mark;
+  size_t len = p - mark;
   CoglBlendStringColorSourceInfo *sources;
-  gsize array_len;
+  size_t array_len;
   int i;
 
   if (context == COGL_BLEND_STRING_CONTEXT_BLENDING)
@@ -455,19 +455,19 @@ get_color_src_info (const char *mark,
   return NULL;
 }
 
-static gboolean
+static CoglBool
 is_symbol_char (const char c)
 {
   return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE;
 }
 
-static gboolean
+static CoglBool
 is_alphanum_char (const char c)
 {
   return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE;
 }
 
-static gboolean
+static CoglBool
 parse_argument (const char *string, /* original user string */
                 const char **ret_p, /* start of argument IN:OUT */
                 const CoglBlendStringStatement *statement,
@@ -480,8 +480,8 @@ parse_argument (const char *string, /* original user string */
   const char *mark = NULL;
   const char *error_string = NULL;
   ParserArgState state = PARSER_ARG_STATE_START;
-  gboolean parsing_factor = FALSE;
-  gboolean implicit_factor_brace;
+  CoglBool parsing_factor = FALSE;
+  CoglBool implicit_factor_brace;
 
   arg->source.is_zero = FALSE;
   arg->source.info = NULL;
@@ -597,7 +597,7 @@ parse_argument (const char *string, /* original user string */
         case PARSER_ARG_STATE_SCRAPING_MASK:
           if (*p == ']')
             {
-              gsize len = p - mark;
+              size_t len = p - mark;
               CoglBlendStringColorSource *source =
                 parsing_factor ? &arg->factor.source : &arg->source;
 
@@ -668,7 +668,7 @@ parse_argument (const char *string, /* original user string */
         case PARSER_ARG_STATE_MAYBE_SRC_ALPHA_SATURATE:
           if (!is_symbol_char (*p))
             {
-              gsize len = p - mark;
+              size_t len = p - mark;
               if (len >= strlen ("SRC_ALPHA_SATURATE") &&
                   strncmp (mark, "SRC_ALPHA_SATURATE", len) == 0)
                 {
diff --git a/cogl/cogl-blend-string.h b/cogl/cogl-blend-string.h
index 99fe407..75d2f95 100644
--- a/cogl/cogl-blend-string.h
+++ b/cogl/cogl-blend-string.h
@@ -65,23 +65,23 @@ typedef struct _CoglBlendStringColorSourceInfo
 {
   CoglBlendStringColorSourceType type;
   const char *name;
-  gsize name_len;
+  size_t name_len;
 } CoglBlendStringColorSourceInfo;
 
 typedef struct _CoglBlendStringColorSource
 {
-  gboolean is_zero;
+  CoglBool is_zero;
   const CoglBlendStringColorSourceInfo *info;
   int texture; /* for the TEXTURE_N color source */
-  gboolean one_minus;
+  CoglBool one_minus;
   CoglBlendStringChannelMask mask;
 } CoglBlendStringColorSource;
 
 typedef struct _CoglBlendStringFactor
 {
-  gboolean is_one;
-  gboolean is_src_alpha_saturate;
-  gboolean is_color;
+  CoglBool is_one;
+  CoglBool is_src_alpha_saturate;
+  CoglBool is_color;
   CoglBlendStringColorSource source;
 } CoglBlendStringFactor;
 
@@ -110,7 +110,7 @@ typedef struct _CoglBlendStringFunctionInfo
 {
   enum _CoglBlendStringFunctionType type;
   const char *name;
-  gsize name_len;
+  size_t name_len;
   int argc;
 } CoglBlendStringFunctionInfo;
 
@@ -122,7 +122,7 @@ typedef struct _CoglBlendStringStatement
 } CoglBlendStringStatement;
 
 
-gboolean
+CoglBool
 _cogl_blend_string_compile (const char *string,
                             CoglBlendStringContext context,
                             CoglBlendStringStatement *statements,
diff --git a/cogl/cogl-blit.c b/cogl/cogl-blit.c
index 493fc75..247317f 100644
--- a/cogl/cogl-blit.c
+++ b/cogl/cogl-blit.c
@@ -40,7 +40,7 @@
 
 static const CoglBlitMode *_cogl_blit_default_mode = NULL;
 
-static gboolean
+static CoglBool
 _cogl_blit_texture_render_begin (CoglBlitData *data)
 {
   CoglOffscreen *offscreen;
@@ -142,7 +142,7 @@ _cogl_blit_texture_render_end (CoglBlitData *data)
                                    data->dst_tex);
 }
 
-static gboolean
+static CoglBool
 _cogl_blit_framebuffer_begin (CoglBlitData *data)
 {
   CoglOffscreen *dst_offscreen = NULL, *src_offscreen = NULL;
@@ -212,7 +212,7 @@ _cogl_blit_framebuffer_end (CoglBlitData *data)
   cogl_pop_framebuffer ();
 }
 
-static gboolean
+static CoglBool
 _cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
 {
   CoglOffscreen *offscreen;
@@ -264,7 +264,7 @@ _cogl_blit_copy_tex_sub_image_end (CoglBlitData *data)
   cogl_pop_framebuffer ();
 }
 
-static gboolean
+static CoglBool
 _cogl_blit_get_tex_data_begin (CoglBlitData *data)
 {
   data->format = cogl_texture_get_format (data->src_tex);
diff --git a/cogl/cogl-blit.h b/cogl/cogl-blit.h
index 738b82f..d56137a 100644
--- a/cogl/cogl-blit.h
+++ b/cogl/cogl-blit.h
@@ -35,7 +35,7 @@
 
 typedef struct _CoglBlitData CoglBlitData;
 
-typedef gboolean (* CoglBlitBeginFunc) (CoglBlitData *data);
+typedef CoglBool (* CoglBlitBeginFunc) (CoglBlitData *data);
 typedef void (* CoglBlitEndFunc) (CoglBlitData *data);
 
 typedef void (* CoglBlitFunc) (CoglBlitData *data,
diff --git a/cogl/cogl-boxed-value.c b/cogl/cogl-boxed-value.c
index b2cb3f3..bc2b8a3 100644
--- a/cogl/cogl-boxed-value.c
+++ b/cogl/cogl-boxed-value.c
@@ -30,7 +30,7 @@
 #include "cogl-boxed-value.h"
 #include "cogl-context-private.h"
 
-gboolean
+CoglBool
 _cogl_boxed_value_equal (const CoglBoxedValue *bva,
                          const CoglBoxedValue *bvb)
 {
@@ -109,9 +109,9 @@ _cogl_boxed_value_set_x (CoglBoxedValue *bv,
                          int size,
                          int count,
                          CoglBoxedType type,
-                         gsize value_size,
-                         gconstpointer value,
-                         gboolean transpose)
+                         size_t value_size,
+                         const void *value,
+                         CoglBool transpose)
 {
   if (count == 1)
     {
@@ -190,7 +190,7 @@ void
 _cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
                               int dimensions,
                               int count,
-                              gboolean transpose,
+                              CoglBool transpose,
                               const float *value)
 {
   _cogl_boxed_value_set_x (bv,
diff --git a/cogl/cogl-boxed-value.h b/cogl/cogl-boxed-value.h
index d9dd45a..67b9aae 100644
--- a/cogl/cogl-boxed-value.h
+++ b/cogl/cogl-boxed-value.h
@@ -39,7 +39,7 @@ typedef struct _CoglBoxedValue
 {
   CoglBoxedType type;
   int size, count;
-  gboolean transpose;
+  CoglBool transpose;
 
   union {
     float float_value[4];
@@ -58,7 +58,7 @@ typedef struct _CoglBoxedValue
     _bv->count = 1;                             \
   } G_STMT_END
 
-gboolean
+CoglBool
 _cogl_boxed_value_equal (const CoglBoxedValue *bva,
                          const CoglBoxedValue *bvb);
 
@@ -86,7 +86,7 @@ void
 _cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
                               int dimensions,
                               int count,
-                              gboolean transpose,
+                              CoglBool transpose,
                               const float *value);
 
 /*
diff --git a/cogl/cogl-buffer-private.h b/cogl/cogl-buffer-private.h
index 0457af0..52bffaf 100644
--- a/cogl/cogl-buffer-private.h
+++ b/cogl/cogl-buffer-private.h
@@ -47,7 +47,7 @@ struct _CoglBufferVtable
 
   void (* unmap) (CoglBuffer *buffer);
 
-  gboolean (* set_data) (CoglBuffer   *buffer,
+  CoglBool (* set_data) (CoglBuffer   *buffer,
                          unsigned int  offset,
                          const void   *data,
                          unsigned int  size);
@@ -78,29 +78,28 @@ typedef enum {
 
 struct _CoglBuffer
 {
-  CoglObject              _parent;
+  CoglObject _parent;
 
-  CoglContext            *context;
+  CoglContext *context;
 
-  CoglBufferVtable        vtable;
+  CoglBufferVtable vtable;
 
-  CoglBufferBindTarget    last_target;
+  CoglBufferBindTarget last_target;
 
-  CoglBufferFlags         flags;
+  CoglBufferFlags flags;
 
-  GLuint                  gl_handle;  /* OpenGL handle */
-  unsigned int            size;       /* size of the buffer, in bytes */
-  CoglBufferUsageHint     usage_hint;
-  CoglBufferUpdateHint    update_hint;
+  GLuint gl_handle; /* OpenGL handle */
+  unsigned int size; /* size of the buffer, in bytes */
+  CoglBufferUsageHint usage_hint;
+  CoglBufferUpdateHint update_hint;
 
-  guint8                 *data;      /* points to the mapped memory when
-                                      * the CoglBuffer is a VBO, PBO, ... or
-                                      * points to allocated memory in the
-                                      * fallback paths */
+  /* points to the mapped memory when the CoglBuffer is a VBO, PBO,
+   * ... or points to allocated memory in the fallback paths */
+  uint8_t *data;
 
-  int                     immutable_ref;
+  int immutable_ref;
 
-  guint                   store_created:1;
+  unsigned int store_created:1;
 };
 
 /* This is used to register a type to the list of handle types that
@@ -117,7 +116,7 @@ void
 _cogl_buffer_initialize (CoglBuffer          *buffer,
                          CoglContext         *context,
                          unsigned int         size,
-                         gboolean             use_malloc,
+                         CoglBool             use_malloc,
                          CoglBufferBindTarget default_target,
                          CoglBufferUsageHint  usage_hint,
                          CoglBufferUpdateHint update_hint);
diff --git a/cogl/cogl-buffer.c b/cogl/cogl-buffer.c
index 8dd4f6d..3cfe0dc 100644
--- a/cogl/cogl-buffer.c
+++ b/cogl/cogl-buffer.c
@@ -84,7 +84,7 @@ _cogl_buffer_register_buffer_type (const CoglObjectClass *klass)
   _cogl_buffer_types = g_slist_prepend (_cogl_buffer_types, (void *) klass);
 }
 
-gboolean
+CoglBool
 cogl_is_buffer (void *object)
 {
   const CoglObject *obj = object;
@@ -188,7 +188,7 @@ bo_map (CoglBuffer       *buffer,
         CoglBufferAccess  access,
         CoglBufferMapHint hints)
 {
-  guint8 *data;
+  uint8_t *data;
   CoglBufferBindTarget target;
   GLenum gl_target;
   CoglContext *ctx = buffer->context;
@@ -235,7 +235,7 @@ bo_unmap (CoglBuffer *buffer)
   _cogl_buffer_unbind (buffer);
 }
 
-static gboolean
+static CoglBool
 bo_set_data (CoglBuffer   *buffer,
              unsigned int  offset,
              const void   *data,
@@ -276,7 +276,7 @@ malloc_unmap (CoglBuffer *buffer)
   buffer->flags &= ~COGL_BUFFER_FLAG_MAPPED;
 }
 
-static gboolean
+static CoglBool
 malloc_set_data (CoglBuffer   *buffer,
                  unsigned int  offset,
                  const void   *data,
@@ -290,7 +290,7 @@ void
 _cogl_buffer_initialize (CoglBuffer           *buffer,
                          CoglContext          *context,
                          unsigned int          size,
-                         gboolean              use_malloc,
+                         CoglBool              use_malloc,
                          CoglBufferBindTarget  default_target,
                          CoglBufferUsageHint   usage_hint,
                          CoglBufferUpdateHint  update_hint)
@@ -419,7 +419,7 @@ cogl_buffer_get_update_hint (CoglBuffer *buffer)
 static void
 warn_about_midscene_changes (void)
 {
-  static gboolean seen = FALSE;
+  static CoglBool seen = FALSE;
   if (!seen)
     {
       g_warning ("Mid-scene modification of buffers has "
@@ -507,11 +507,11 @@ _cogl_buffer_unmap_for_fill_or_fallback (CoglBuffer *buffer)
     cogl_buffer_unmap (buffer);
 }
 
-gboolean
-cogl_buffer_set_data (CoglBuffer   *buffer,
-                      gsize         offset,
-                      const void   *data,
-                      gsize         size)
+CoglBool
+cogl_buffer_set_data (CoglBuffer *buffer,
+                      size_t offset,
+                      const void *data,
+                      size_t size)
 {
   _COGL_RETURN_VAL_IF_FAIL (cogl_is_buffer (buffer), FALSE);
   _COGL_RETURN_VAL_IF_FAIL ((offset + size) <= buffer->size, FALSE);
diff --git a/cogl/cogl-buffer.h b/cogl/cogl-buffer.h
index ffd8968..4f073b1 100644
--- a/cogl/cogl-buffer.h
+++ b/cogl/cogl-buffer.h
@@ -74,7 +74,7 @@ typedef struct _CoglBuffer CoglBuffer;
  * Since: 1.2
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_buffer (void *object);
 
 /**
@@ -231,11 +231,11 @@ cogl_buffer_unmap (CoglBuffer *buffer);
  * Since: 1.2
  * Stability: unstable
  */
-gboolean
-cogl_buffer_set_data (CoglBuffer  *buffer,
-                      gsize        offset,
-                      const void  *data,
-                      gsize        size);
+CoglBool
+cogl_buffer_set_data (CoglBuffer *buffer,
+                      size_t offset,
+                      const void *data,
+                      size_t size);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index ef64893..1bab67d 100644
--- a/cogl/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
@@ -211,7 +211,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer,
                             float y_1,
                             float x_2,
                             float y_2,
-                            gboolean first)
+                            CoglBool first)
 {
   CoglMatrixStack *modelview_stack =
     _cogl_framebuffer_get_modelview_stack (framebuffer);
@@ -287,8 +287,8 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer,
                              float bounds_y1,
                              float bounds_x2,
                              float bounds_y2,
-                             gboolean merge,
-                             gboolean need_clear,
+                             CoglBool merge,
+                             CoglBool need_clear,
                              void *user_data)
 {
   CoglMatrixStack *modelview_stack =
@@ -395,8 +395,8 @@ paint_path_silhouette (void *user_data)
 static void
 add_stencil_clip_path (CoglFramebuffer *framebuffer,
                        CoglPath *path,
-                       gboolean merge,
-                       gboolean need_clear)
+                       CoglBool merge,
+                       CoglBool need_clear)
 {
   CoglPathData *data = path->data;
   add_stencil_clip_silhouette (framebuffer,
@@ -429,8 +429,8 @@ add_stencil_clip_primitive (CoglFramebuffer *framebuffer,
                             float bounds_y1,
                             float bounds_x2,
                             float bounds_y2,
-                            gboolean merge,
-                            gboolean need_clear)
+                            CoglBool merge,
+                            CoglBool need_clear)
 {
   add_stencil_clip_silhouette (framebuffer,
                                paint_primitive_silhouette,
@@ -473,7 +473,7 @@ disable_clip_planes (void)
   GE( ctx, glDisable (GL_CLIP_PLANE0) );
 }
 
-static gpointer
+static void *
 _cogl_clip_stack_push_entry (CoglClipStack *clip_stack,
                              size_t size,
                              CoglClipStackType type)
@@ -797,8 +797,8 @@ _cogl_clip_stack_flush (CoglClipStack *stack,
                         CoglFramebuffer *framebuffer)
 {
   int has_clip_planes;
-  gboolean using_clip_planes = FALSE;
-  gboolean using_stencil_buffer = FALSE;
+  CoglBool using_clip_planes = FALSE;
+  CoglBool using_stencil_buffer = FALSE;
   int scissor_x0;
   int scissor_y0;
   int scissor_x1;
diff --git a/cogl/cogl-clip-stack.h b/cogl/cogl-clip-stack.h
index c263caa..a9673d9 100644
--- a/cogl/cogl-clip-stack.h
+++ b/cogl/cogl-clip-stack.h
@@ -128,7 +128,7 @@ struct _CoglClipStackRect
      modelview matrix is that same as when a rectangle is added to the
      journal. In that case we can use the original clip coordinates
      and modify the rectangle instead. */
-  gboolean               can_be_scissor;
+  CoglBool               can_be_scissor;
 
   /* The matrix that was current when the clip was set */
   CoglMatrix             matrix;
diff --git a/cogl/cogl-clutter.c b/cogl/cogl-clutter.c
index 63bcc1b..fddff09 100644
--- a/cogl/cogl-clutter.c
+++ b/cogl/cogl-clutter.c
@@ -43,13 +43,13 @@
 #endif
 #include "cogl-clutter.h"
 
-gboolean
+CoglBool
 cogl_clutter_check_extension (const char *name, const char *ext)
 {
   return _cogl_check_extension (name, ext);
 }
 
-gboolean
+CoglBool
 cogl_clutter_winsys_has_feature (CoglWinsysFeature feature)
 {
   return _cogl_winsys_has_feature (feature);
diff --git a/cogl/cogl-clutter.h b/cogl/cogl-clutter.h
index 3125db8..bd8e3c4 100644
--- a/cogl/cogl-clutter.h
+++ b/cogl/cogl-clutter.h
@@ -31,11 +31,11 @@
 G_BEGIN_DECLS
 
 #define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
-gboolean
+CoglBool
 cogl_clutter_check_extension (const char *name, const char *ext);
 
 #define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER
-gboolean
+CoglBool
 cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
 
 #define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER
diff --git a/cogl/cogl-color-private.h b/cogl/cogl-color-private.h
index 78bfcf9..591ff73 100644
--- a/cogl/cogl-color-private.h
+++ b/cogl/cogl-color-private.h
@@ -39,7 +39,7 @@
 
 void
 _cogl_color_get_rgba_4ubv (const CoglColor *color,
-                           guint8 *dest);
+                           uint8_t *dest);
 
 #endif /* __COGL_COLOR_PRIVATE_PRIVATE_H */
 
diff --git a/cogl/cogl-color.c b/cogl/cogl-color.c
index 9359f44..b23ef4a 100644
--- a/cogl/cogl-color.c
+++ b/cogl/cogl-color.c
@@ -56,10 +56,10 @@ cogl_color_free (CoglColor *color)
 
 void
 cogl_color_init_from_4ub (CoglColor *color,
-                          guint8     red,
-                          guint8     green,
-                          guint8     blue,
-                          guint8     alpha)
+                          uint8_t red,
+                          uint8_t green,
+                          uint8_t blue,
+                          uint8_t alpha)
 {
   _COGL_RETURN_IF_FAIL (color != NULL);
 
@@ -72,20 +72,20 @@ cogl_color_init_from_4ub (CoglColor *color,
 /* XXX: deprecated, use cogl_color_init_from_4ub */
 void
 cogl_color_set_from_4ub (CoglColor *dest,
-                         guint8     red,
-                         guint8     green,
-                         guint8     blue,
-                         guint8     alpha)
+                         uint8_t red,
+                         uint8_t green,
+                         uint8_t blue,
+                         uint8_t alpha)
 {
   cogl_color_init_from_4ub (dest, red, green, blue, alpha);
 }
 
 void
 cogl_color_init_from_4f (CoglColor *color,
-                         float      red,
-                         float      green,
-                         float      blue,
-                         float      alpha)
+                         float red,
+                         float green,
+                         float blue,
+                         float alpha)
 {
   _COGL_RETURN_IF_FAIL (color != NULL);
 
@@ -98,10 +98,10 @@ cogl_color_init_from_4f (CoglColor *color,
 /* XXX: deprecated, use cogl_color_init_from_4f */
 void
 cogl_color_set_from_4f (CoglColor *color,
-                        float      red,
-                        float      green,
-                        float      blue,
-                        float      alpha)
+                        float red,
+                        float green,
+                        float blue,
+                        float alpha)
 {
   cogl_color_init_from_4f (color, red, green, blue, alpha);
 }
@@ -220,41 +220,41 @@ cogl_color_set_green_byte (CoglColor     *color,
 
 void
 cogl_color_set_green_float (CoglColor *color,
-                            float      green)
+                            float green)
 {
   color->green = green * 255.0;
 }
 
 void
 cogl_color_set_green (CoglColor *color,
-                      float      green)
+                      float green)
 {
   color->green = green * 255.0;
 }
 
 void
-cogl_color_set_blue_byte (CoglColor     *color,
-                          unsigned char  blue)
+cogl_color_set_blue_byte (CoglColor *color,
+                          unsigned char blue)
 {
   color->blue = blue;
 }
 
 void
 cogl_color_set_blue_float (CoglColor *color,
-                           float      blue)
+                           float blue)
 {
   color->blue = blue * 255.0;
 }
 
 void
 cogl_color_set_blue (CoglColor *color,
-                     float      blue)
+                     float blue)
 {
   color->blue = blue * 255.0;
 }
 
 void
-cogl_color_set_alpha_byte (CoglColor     *color,
+cogl_color_set_alpha_byte (CoglColor *color,
                            unsigned char  alpha)
 {
   color->alpha = alpha;
@@ -262,14 +262,14 @@ cogl_color_set_alpha_byte (CoglColor     *color,
 
 void
 cogl_color_set_alpha_float (CoglColor *color,
-                            float      alpha)
+                            float alpha)
 {
   color->alpha = alpha * 255.0;
 }
 
 void
 cogl_color_set_alpha (CoglColor *color,
-                      float      alpha)
+                      float alpha)
 {
   color->alpha = alpha * 255.0;
 }
@@ -293,10 +293,10 @@ cogl_color_unpremultiply (CoglColor *color)
     }
 }
 
-gboolean
-cogl_color_equal (gconstpointer v1, gconstpointer v2)
+CoglBool
+cogl_color_equal (const void *v1, const void *v2)
 {
-  const guint32 *c1 = v1, *c2 = v2;
+  const uint32_t *c1 = v1, *c2 = v2;
 
   _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
   _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
@@ -307,7 +307,7 @@ cogl_color_equal (gconstpointer v1, gconstpointer v2)
 
 void
 _cogl_color_get_rgba_4ubv (const CoglColor *color,
-                           guint8 *dest)
+                           uint8_t *dest)
 {
   memcpy (dest, color, 4);
 }
diff --git a/cogl/cogl-color.h b/cogl/cogl-color.h
index 7ca7cb6..fe2dce1 100644
--- a/cogl/cogl-color.h
+++ b/cogl/cogl-color.h
@@ -94,10 +94,10 @@ cogl_color_free (CoglColor *color);
  */
 void
 cogl_color_init_from_4ub (CoglColor *color,
-                          guint8 red,
-                          guint8 green,
-                          guint8 blue,
-                          guint8 alpha);
+                          uint8_t red,
+                          uint8_t green,
+                          uint8_t blue,
+                          uint8_t alpha);
 
 /**
  * cogl_color_set_from_4ub:
@@ -114,10 +114,10 @@ cogl_color_init_from_4ub (CoglColor *color,
  */
 void
 cogl_color_set_from_4ub (CoglColor *color,
-                         guint8 red,
-                         guint8 green,
-                         guint8 blue,
-                         guint8 alpha);
+                         uint8_t red,
+                         uint8_t green,
+                         uint8_t blue,
+                         uint8_t alpha);
 
 /**
  * cogl_color_init_from_4f:
@@ -467,7 +467,7 @@ cogl_color_set_red (CoglColor *color,
  */
 void
 cogl_color_set_green (CoglColor *color,
-                      float      green);
+                      float green);
 
 /**
  * cogl_color_set_blue:
@@ -480,7 +480,7 @@ cogl_color_set_green (CoglColor *color,
  */
 void
 cogl_color_set_blue (CoglColor *color,
-                     float      blue);
+                     float blue);
 
 /**
  * cogl_color_set_alpha:
@@ -493,7 +493,7 @@ cogl_color_set_blue (CoglColor *color,
  */
 void
 cogl_color_set_alpha (CoglColor *color,
-                      float      alpha);
+                      float alpha);
 
 /**
  * cogl_color_premultiply:
@@ -535,9 +535,8 @@ cogl_color_unpremultiply (CoglColor *color);
  *
  * Since: 1.0
  */
-gboolean
-cogl_color_equal (gconstpointer v1,
-                  gconstpointer v2);
+CoglBool
+cogl_color_equal (const void *v1, const void *v2);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-config.c b/cogl/cogl-config.c
index 4678ce4..81cfaa6 100644
--- a/cogl/cogl-config.c
+++ b/cogl/cogl-config.c
@@ -84,7 +84,7 @@ _cogl_config_read (void)
   GKeyFile *key_file = g_key_file_new ();
   const char * const *system_dirs = g_get_system_config_dirs ();
   char *filename;
-  gboolean status = FALSE;
+  CoglBool status = FALSE;
   int i;
 
   for (i = 0; system_dirs[i]; i++)
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h
index b4a2490..35ee090 100644
--- a/cogl/cogl-context-private.h
+++ b/cogl/cogl-context-private.h
@@ -100,7 +100,7 @@ struct _CoglContext
   CoglBitmask       enable_custom_attributes_tmp;
   CoglBitmask       changed_bits_tmp;
 
-  gboolean          legacy_backface_culling_enabled;
+  CoglBool          legacy_backface_culling_enabled;
 
   /* A few handy matrix constants */
   CoglMatrix        identity_matrix;
@@ -154,18 +154,18 @@ struct _CoglContext
   /* Some simple caching, to minimize state changes... */
   CoglPipeline     *current_pipeline;
   unsigned long     current_pipeline_changes_since_flush;
-  gboolean          current_pipeline_skip_gl_color;
+  CoglBool          current_pipeline_skip_gl_color;
   unsigned long     current_pipeline_age;
 
-  gboolean          gl_blend_enable_cache;
+  CoglBool          gl_blend_enable_cache;
 
-  gboolean              depth_test_enabled_cache;
+  CoglBool              depth_test_enabled_cache;
   CoglDepthTestFunction depth_test_function_cache;
-  gboolean              depth_writing_enabled_cache;
+  CoglBool              depth_writing_enabled_cache;
   float                 depth_range_near_cache;
   float                 depth_range_far_cache;
 
-  gboolean              legacy_depth_test_enabled;
+  CoglBool              legacy_depth_test_enabled;
 
   CoglBuffer       *current_buffer[COGL_BUFFER_BIND_TARGET_COUNT];
 
@@ -191,7 +191,7 @@ struct _CoglContext
   CoglIndices      *rectangle_short_indices;
   int               rectangle_short_indices_len;
 
-  gboolean          in_begin_gl_block;
+  CoglBool          in_begin_gl_block;
 
   CoglPipeline     *texture_download_pipeline;
   CoglPipeline     *blit_texture_pipeline;
@@ -203,7 +203,7 @@ struct _CoglContext
      displaying the quad batches. It needs to be global so that it can
      be reset by cogl_clear. It needs to be reset to increase the
      chances of getting the same colour during an animation */
-  guint8            journal_rectangles_color;
+  uint8_t            journal_rectangles_color;
 
   /* Cached values for GL_MAX_TEXTURE_[IMAGE_]UNITS to avoid calling
      glGetInteger too often */
@@ -218,7 +218,7 @@ struct _CoglContext
   CoglPipelineProgramType current_vertex_program_type;
   GLuint                  current_gl_program;
 
-  gboolean current_gl_dither_enabled;
+  CoglBool current_gl_dither_enabled;
   CoglColorMask current_gl_color_mask;
 
   /* List of types that will be considered a subclass of CoglTexture in
@@ -237,7 +237,7 @@ struct _CoglContext
      doesn't need to be a valid pointer. We can't just use NULL in
      current_clip_stack to mark a dirty state because NULL is a valid
      stack (meaning no clipping) */
-  gboolean          current_clip_stack_valid;
+  CoglBool          current_clip_stack_valid;
   /* The clip state that was flushed. This isn't intended to be used
      as a stack to push and pop new entries. Instead the current stack
      that the user wants is part of the framebuffer state. This is
@@ -249,13 +249,13 @@ struct _CoglContext
      state. If TRUE then any further use of the stencil buffer (such
      as for drawing paths) would need to be merged with the existing
      stencil buffer */
-  gboolean          current_clip_stack_uses_stencil;
+  CoglBool          current_clip_stack_uses_stencil;
 
   /* This is used as a temporary buffer to fill a CoglBuffer when
      cogl_buffer_map fails and we only want to map to fill it with new
      data */
   GByteArray       *buffer_map_fallback_array;
-  gboolean          buffer_map_fallback_in_use;
+  CoglBool          buffer_map_fallback_in_use;
 
   CoglWinsysRectangleState rectangle_state;
 
@@ -324,7 +324,7 @@ _cogl_context_get_winsys (CoglContext *context);
  * to know when to re-query the GL extensions. The backend should also
  * check whether the GL context is supported by Cogl. If not it should
  * return FALSE and set @error */
-gboolean
+CoglBool
 _cogl_context_update_features (CoglContext *context,
                                GError **error);
 
diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
index e59ca9e..3d386bc 100644
--- a/cogl/cogl-context.c
+++ b/cogl/cogl-context.c
@@ -589,7 +589,7 @@ cogl_egl_context_get_egl_display (CoglContext *context)
 }
 #endif
 
-gboolean
+CoglBool
 _cogl_context_update_features (CoglContext *context,
                                GError **error)
 {
diff --git a/cogl/cogl-context.h b/cogl/cogl-context.h
index ed5bcf1..21ea636 100644
--- a/cogl/cogl-context.h
+++ b/cogl/cogl-context.h
@@ -153,7 +153,7 @@ cogl_android_set_native_window (ANativeWindow *window);
  * Since: 1.10
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_context (void *object);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_2_0_API */
@@ -256,7 +256,7 @@ typedef enum _CoglFeatureID
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_has_feature (CoglContext *context, CoglFeatureID feature);
 
 /**
@@ -276,7 +276,7 @@ cogl_has_feature (CoglContext *context, CoglFeatureID feature);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_has_features (CoglContext *context, ...);
 
 /**
diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c
index 7f0143d..f3cb46f 100644
--- a/cogl/cogl-debug.c
+++ b/cogl/cogl-debug.c
@@ -89,16 +89,16 @@ GHashTable *_cogl_debug_instances;
 
 static void
 _cogl_parse_debug_string_for_keys (const char *value,
-                                   gboolean enable,
+                                   CoglBool enable,
                                    const GDebugKey *keys,
                                    unsigned int nkeys)
 {
   int long_num, key_num;
 
   /* g_parse_debug_string expects the value field in GDebugKey to be a
-     mask in a guint but the flags is stored in an array of multiple
-     longs so we need to build a separate array for each possible
-     guint */
+     mask in an unsigned int but the flags are stored in an array of
+     multiple longs so we need to build a separate array for each
+     possible unsigned int */
 
   for (long_num = 0; long_num < COGL_DEBUG_N_LONGS; long_num++)
     {
@@ -147,8 +147,8 @@ _cogl_parse_debug_string_for_keys (const char *value,
 
 void
 _cogl_parse_debug_string (const char *value,
-                          gboolean enable,
-                          gboolean ignore_help)
+                          CoglBool enable,
+                          CoglBool ignore_help)
 {
   if (ignore_help && strcmp (value, "help") == 0)
     return;
@@ -197,10 +197,10 @@ _cogl_parse_debug_string (const char *value,
 }
 
 #ifdef COGL_ENABLE_DEBUG
-static gboolean
+static CoglBool
 cogl_arg_debug_cb (const char *key,
                    const char *value,
-                   gpointer    user_data)
+                   void *user_data)
 {
   _cogl_parse_debug_string (value,
                             TRUE /* enable the flags */,
@@ -208,10 +208,10 @@ cogl_arg_debug_cb (const char *key,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 cogl_arg_no_debug_cb (const char *key,
                       const char *value,
-                      gpointer    user_data)
+                      void *user_data)
 {
   _cogl_parse_debug_string (value,
                             FALSE, /* disable the flags */
@@ -254,11 +254,11 @@ _cogl_debug_check_environment (void)
     }
 }
 
-static gboolean
-pre_parse_hook (GOptionContext  *context,
-                GOptionGroup    *group,
-                gpointer         data,
-                GError         **error)
+static CoglBool
+pre_parse_hook (GOptionContext *context,
+                GOptionGroup *group,
+                void *data,
+                GError **error)
 {
   _cogl_init ();
 
diff --git a/cogl/cogl-debug.h b/cogl/cogl-debug.h
index bf8fa58..aa34ea8 100644
--- a/cogl/cogl-debug.h
+++ b/cogl/cogl-debug.h
@@ -126,8 +126,8 @@ _cogl_debug_check_environment (void);
 
 void
 _cogl_parse_debug_string (const char *value,
-                          gboolean enable,
-                          gboolean ignore_help);
+                          CoglBool enable,
+                          CoglBool ignore_help);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-depth-state.c b/cogl/cogl-depth-state.c
index 2e5c86f..55b3f50 100644
--- a/cogl/cogl-depth-state.c
+++ b/cogl/cogl-depth-state.c
@@ -46,13 +46,13 @@ cogl_depth_state_init (CoglDepthState *state)
 
 void
 cogl_depth_state_set_test_enabled (CoglDepthState *state,
-                                   gboolean enabled)
+                                   CoglBool enabled)
 {
   _COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
   state->test_enabled = enabled;
 }
 
-gboolean
+CoglBool
 cogl_depth_state_get_test_enabled (CoglDepthState *state)
 {
   _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
@@ -61,13 +61,13 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state)
 
 void
 cogl_depth_state_set_write_enabled (CoglDepthState *state,
-                                    gboolean enabled)
+                                    CoglBool enabled)
 {
   _COGL_RETURN_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC);
   state->write_enabled = enabled;
 }
 
-gboolean
+CoglBool
 cogl_depth_state_get_write_enabled (CoglDepthState *state)
 {
   _COGL_RETURN_VAL_IF_FAIL (state->magic == COGL_DEPTH_STATE_MAGIC, FALSE);
diff --git a/cogl/cogl-depth-state.h b/cogl/cogl-depth-state.h
index 0fff9a0..71535bb 100644
--- a/cogl/cogl-depth-state.h
+++ b/cogl/cogl-depth-state.h
@@ -41,24 +41,24 @@ G_BEGIN_DECLS
 
 typedef struct
 {
-  guint32 COGL_PRIVATE (magic);
+  uint32_t COGL_PRIVATE (magic);
 
-  gboolean COGL_PRIVATE (test_enabled);
+  CoglBool COGL_PRIVATE (test_enabled);
   CoglDepthTestFunction COGL_PRIVATE (test_function);
-  gboolean COGL_PRIVATE (write_enabled);
+  CoglBool COGL_PRIVATE (write_enabled);
   float COGL_PRIVATE (range_near);
   float COGL_PRIVATE (range_far);
 
-  guint32 COGL_PRIVATE (padding0);
-  guint32 COGL_PRIVATE (padding1);
-  guint32 COGL_PRIVATE (padding2);
-  guint32 COGL_PRIVATE (padding3);
-  guint32 COGL_PRIVATE (padding4);
-  guint32 COGL_PRIVATE (padding5);
-  guint32 COGL_PRIVATE (padding6);
-  guint32 COGL_PRIVATE (padding7);
-  guint32 COGL_PRIVATE (padding8);
-  guint32 COGL_PRIVATE (padding9);
+  uint32_t COGL_PRIVATE (padding0);
+  uint32_t COGL_PRIVATE (padding1);
+  uint32_t COGL_PRIVATE (padding2);
+  uint32_t COGL_PRIVATE (padding3);
+  uint32_t COGL_PRIVATE (padding4);
+  uint32_t COGL_PRIVATE (padding5);
+  uint32_t COGL_PRIVATE (padding6);
+  uint32_t COGL_PRIVATE (padding7);
+  uint32_t COGL_PRIVATE (padding8);
+  uint32_t COGL_PRIVATE (padding9);
 
 } CoglDepthState;
 
@@ -104,7 +104,7 @@ cogl_depth_state_init (CoglDepthState *state);
  */
 void
 cogl_depth_state_set_test_enabled (CoglDepthState *state,
-                                   gboolean enable);
+                                   CoglBool enable);
 
 /**
  * cogl_depth_state_get_test_enabled:
@@ -117,7 +117,7 @@ cogl_depth_state_set_test_enabled (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_depth_state_get_test_enabled (CoglDepthState *state);
 
 /**
@@ -142,7 +142,7 @@ cogl_depth_state_get_test_enabled (CoglDepthState *state);
  */
 void
 cogl_depth_state_set_write_enabled (CoglDepthState *state,
-                                    gboolean enable);
+                                    CoglBool enable);
 
 /**
  * cogl_depth_state_get_write_enabled:
@@ -155,7 +155,7 @@ cogl_depth_state_set_write_enabled (CoglDepthState *state,
  * Since: 2.0
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_depth_state_get_write_enabled (CoglDepthState *state);
 
 /**
diff --git a/cogl/cogl-display-private.h b/cogl/cogl-display-private.h
index 179aa41..fe844e1 100644
--- a/cogl/cogl-display-private.h
+++ b/cogl/cogl-display-private.h
@@ -38,7 +38,7 @@ struct _CoglDisplay
 {
   CoglObject _parent;
 
-  gboolean setup;
+  CoglBool setup;
   CoglRenderer *renderer;
   CoglOnscreenTemplate *onscreen_template;
 
diff --git a/cogl/cogl-display.c b/cogl/cogl-display.c
index 9ac1b68..2a63289 100644
--- a/cogl/cogl-display.c
+++ b/cogl/cogl-display.c
@@ -114,7 +114,7 @@ cogl_display_get_renderer (CoglDisplay *display)
   return display->renderer;
 }
 
-gboolean
+CoglBool
 cogl_display_setup (CoglDisplay *display,
                     GError **error)
 {
diff --git a/cogl/cogl-display.h b/cogl/cogl-display.h
index d4d4735..7e5e427 100644
--- a/cogl/cogl-display.h
+++ b/cogl/cogl-display.h
@@ -152,7 +152,7 @@ cogl_display_get_renderer (CoglDisplay *display);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_display_setup (CoglDisplay *display,
                     GError **error);
 
@@ -200,7 +200,7 @@ cogl_wayland_display_set_compositor_display (CoglDisplay *display,
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_display (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-driver.h b/cogl/cogl-driver.h
index b68e37a..e22439a 100644
--- a/cogl/cogl-driver.h
+++ b/cogl/cogl-driver.h
@@ -30,7 +30,7 @@ typedef struct _CoglDriverVtable CoglDriverVtable;
 
 struct _CoglDriverVtable
 {
-  gboolean
+  CoglBool
   (* pixel_format_from_gl_internal) (CoglContext *context,
                                      GLenum gl_int_format,
                                      CoglPixelFormat *out_format);
@@ -42,7 +42,7 @@ struct _CoglDriverVtable
                           GLenum *out_glformat,
                           GLenum *out_gltype);
 
-  gboolean
+  CoglBool
   (* update_features) (CoglContext *context,
                        GError **error);
 };
diff --git a/cogl/cogl-euler.c b/cogl/cogl-euler.c
index 3ebd264..5931f89 100644
--- a/cogl/cogl-euler.c
+++ b/cogl/cogl-euler.c
@@ -150,8 +150,8 @@ cogl_euler_init_from_matrix (CoglEuler *euler,
   euler->roll = R;
 }
 
-gboolean
-cogl_euler_equal (gconstpointer v1, gconstpointer v2)
+CoglBool
+cogl_euler_equal (const void *v1, const void *v2)
 {
   const CoglEuler *a = v1;
   const CoglEuler *b = v2;
diff --git a/cogl/cogl-euler.h b/cogl/cogl-euler.h
index e82eab1..0d1ec02 100644
--- a/cogl/cogl-euler.h
+++ b/cogl/cogl-euler.h
@@ -218,8 +218,8 @@ cogl_euler_init_from_quaternion (CoglEuler *euler,
  * Returns: %TRUE if @v1 and @v2 are equal else %FALSE.
  * Since: 2.0
  */
-gboolean
-cogl_euler_equal (gconstpointer v1, gconstpointer v2);
+CoglBool
+cogl_euler_equal (const void *v1, const void *v2);
 
 /**
  * cogl_euler_copy:
diff --git a/cogl/cogl-feature-private.c b/cogl/cogl-feature-private.c
index 9714e8d..e6f0bd3 100644
--- a/cogl/cogl-feature-private.c
+++ b/cogl/cogl-feature-private.c
@@ -32,7 +32,7 @@
 #include "cogl-feature-private.h"
 #include "cogl-renderer-private.h"
 
-gboolean
+CoglBool
 _cogl_feature_check (CoglRenderer *renderer,
                      const char *driver_prefix,
                      const CoglFeatureData *data,
@@ -129,7 +129,7 @@ _cogl_feature_check (CoglRenderer *renderer,
         goto error;
 
       /* Set the function pointer in the context */
-      *(void **) ((guint8 *) function_table +
+      *(void **) ((uint8_t *) function_table +
                   data->functions[func_num].pointer_offset) = func;
     }
 
@@ -140,7 +140,7 @@ _cogl_feature_check (CoglRenderer *renderer,
    * do feature testing by just looking at the function pointers */
 error:
   for (func_num = 0; data->functions[func_num].name; func_num++)
-    *(void **) ((guint8 *) function_table +
+    *(void **) ((uint8_t *) function_table +
                 data->functions[func_num].pointer_offset) = NULL;
 
   return FALSE;
diff --git a/cogl/cogl-feature-private.h b/cogl/cogl-feature-private.h
index c2cec7c..ad210a5 100644
--- a/cogl/cogl-feature-private.h
+++ b/cogl/cogl-feature-private.h
@@ -80,7 +80,7 @@ struct _CoglFeatureData
   const CoglFeatureFunction *functions;
 };
 
-gboolean
+CoglBool
 _cogl_feature_check (CoglRenderer *renderer,
                      const char *driver_prefix,
                      const CoglFeatureData *data,
diff --git a/cogl/cogl-fixed.c b/cogl/cogl-fixed.c
index 7a00cb6..e347605 100644
--- a/cogl/cogl-fixed.c
+++ b/cogl/cogl-fixed.c
@@ -188,7 +188,7 @@ static const CoglFixed tan_tbl[] =
  * The angles are radians in CoglFixed truncated to 16-bit (they're
  * all less than one)
  */
-static const guint16 atan_tbl[] =
+static const uint16_t atan_tbl[] =
 {
   0x0000, 0x00FF, 0x01FF, 0x02FF, 0x03FF, 0x04FF, 0x05FF, 0x06FF,
   0x07FF, 0x08FF, 0x09FE, 0x0AFE, 0x0BFD, 0x0CFD, 0x0DFC, 0x0EFB,
@@ -557,7 +557,7 @@ cogl_angle_tan (CoglAngle angle)
 CoglFixed
 cogl_fixed_atan (CoglFixed x)
 {
-  gboolean negative = FALSE;
+  CoglBool negative = FALSE;
   CoglFixed angle;
 
   if (x < 0)
@@ -744,13 +744,13 @@ cogl_sqrti (int number)
      * elsewhere in clutter is not good enough, and 10.22 is used instead.
      */
     CoglFixed x;
-    guint32 y_1;        /* 10.22 fixed point */
-    guint32 f = 0x600000; /* '1.5' as 10.22 fixed */
+    uint32_t y_1;        /* 10.22 fixed point */
+    uint32_t f = 0x600000; /* '1.5' as 10.22 fixed */
 
     union
     {
 	float f;
-	guint32 i;
+	uint32_t i;
     } flt, flt2;
 
     flt.f = number;
@@ -824,7 +824,7 @@ cogl_fixed_mul (CoglFixed a,
 
   return (CoglFixed) res_low;
 #else
-  gint64 r = (gint64) a * (gint64) b;
+  int64_t r = (int64_t) a * (int64_t) b;
 
   return (CoglFixed) (r >> COGL_FIXED_Q);
 #endif
@@ -834,7 +834,7 @@ CoglFixed
 cogl_fixed_div (CoglFixed a,
                 CoglFixed b)
 {
-  return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b);
+  return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
 }
 
 CoglFixed
@@ -902,8 +902,8 @@ cogl_fixed_pow2 (CoglFixed x)
 
   union
   {
-    float        f;
-    guint32      i;
+    float f;
+    uint32_t i;
   } flt;
 
   CoglFixed magic = 0x56f7;
@@ -999,7 +999,7 @@ cogl_value_lcopy_fixed (const GValue *value,
                         GTypeCValue  *collect_values,
                         unsigned int  collect_flags)
 {
-  gint32 *fixed_p = collect_values[0].v_pointer;
+  int32_t *fixed_p = collect_values[0].v_pointer;
 
   if (!fixed_p)
     return g_strdup_printf ("value location for '%s' passed as NULL",
diff --git a/cogl/cogl-fixed.h b/cogl/cogl-fixed.h
index 5d7e567..0d71823 100644
--- a/cogl/cogl-fixed.h
+++ b/cogl/cogl-fixed.h
@@ -773,7 +773,7 @@ G_INLINE_FUNC CoglFixed
 cogl_fixed_div (CoglFixed a,
                 CoglFixed b)
 {
-  return (CoglFixed) ((((gint64) a) << COGL_FIXED_Q) / b);
+  return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
 }
 #endif
 
diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h
index 4c759cf..856f909 100644
--- a/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl-framebuffer-private.h
@@ -49,9 +49,9 @@ typedef enum _CoglFramebufferType {
 typedef struct
 {
   CoglSwapChain *swap_chain;
-  gboolean need_stencil;
+  CoglBool need_stencil;
   int samples_per_pixel;
-  gboolean swap_throttled;
+  CoglBool swap_throttled;
 } CoglFramebufferConfig;
 
 /* Flags to pass to _cogl_offscreen_new_to_texture_full */
@@ -117,7 +117,7 @@ struct _CoglFramebuffer
   /* Format of the pixels in the framebuffer (including the expected
      premult state) */
   CoglPixelFormat     format;
-  gboolean            allocated;
+  CoglBool            allocated;
 
   CoglMatrixStack    *modelview_stack;
   CoglMatrixStack    *projection_stack;
@@ -128,13 +128,13 @@ struct _CoglFramebuffer
 
   CoglClipState       clip_state;
 
-  gboolean            dirty_bitmasks;
+  CoglBool            dirty_bitmasks;
   int                 red_bits;
   int                 blue_bits;
   int                 green_bits;
   int                 alpha_bits;
 
-  gboolean            dither_enabled;
+  CoglBool            dither_enabled;
   CoglColorMask       color_mask;
 
   int                 samples_per_pixel;
@@ -162,7 +162,7 @@ struct _CoglFramebuffer
   int                 clear_clip_y0;
   int                 clear_clip_x1;
   int                 clear_clip_y1;
-  gboolean            clear_clip_dirty;
+  CoglBool            clear_clip_dirty;
 };
 
 struct _CoglOffscreen
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 60ca097..af6ecff 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -146,7 +146,7 @@ cogl_framebuffer_error_quark (void)
   return g_quark_from_static_string ("cogl-framebuffer-error-quark");
 }
 
-gboolean
+CoglBool
 cogl_is_framebuffer (void *object)
 {
   CoglObject *obj = object;
@@ -302,7 +302,7 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
 
   if (!gl_buffers)
     {
-      static gboolean shown = FALSE;
+      static CoglBool shown = FALSE;
 
       if (!shown)
         {
@@ -817,7 +817,7 @@ _cogl_offscreen_free (CoglOffscreen *offscreen)
   g_free (offscreen);
 }
 
-static gboolean
+static CoglBool
 try_creating_fbo (CoglOffscreen *offscreen,
                   TryFBOFlags flags)
 {
@@ -993,15 +993,15 @@ try_creating_fbo (CoglOffscreen *offscreen,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_offscreen_allocate (CoglOffscreen *offscreen,
                           GError **error)
 {
   CoglFramebuffer *fb = COGL_FRAMEBUFFER (offscreen);
   CoglContext *ctx = fb->context;
   static TryFBOFlags flags;
-  static gboolean have_working_flags = FALSE;
-  gboolean fbo_created;
+  static CoglBool have_working_flags = FALSE;
+  CoglBool fbo_created;
 
   /* XXX: The framebuffer_object spec isn't clear in defining whether attaching
    * a texture as a renderbuffer with mipmap filtering enabled while the
@@ -1052,7 +1052,7 @@ _cogl_offscreen_allocate (CoglOffscreen *offscreen,
   return TRUE;
 }
 
-gboolean
+CoglBool
 cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
                            GError **error)
 {
@@ -1769,7 +1769,7 @@ cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer,
       COGL_FRAMEBUFFER_STATE_COLOR_MASK;
 }
 
-gboolean
+CoglBool
 cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
 {
   return framebuffer->dither_enabled;
@@ -1777,7 +1777,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer)
 
 void
 cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
-                                     gboolean dither_enabled)
+                                     CoglBool dither_enabled)
 {
   if (framebuffer->dither_enabled == dither_enabled)
     return;
@@ -1868,14 +1868,14 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer)
   return framebuffer->context;
 }
 
-static gboolean
+static CoglBool
 _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
                                        int x,
                                        int y,
                                        CoglReadPixelsFlags source,
                                        CoglBitmap *bitmap)
 {
-  gboolean found_intersection;
+  CoglBool found_intersection;
   CoglPixelFormat format;
 
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_FAST_READ_PIXEL)))
@@ -1916,7 +1916,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
       y >= framebuffer->clear_clip_y0 &&
       y < framebuffer->clear_clip_y1)
     {
-      guint8 *pixel;
+      uint8_t *pixel;
 
       /* we currently only care about cases where the premultiplied or
        * unpremultipled colors are equivalent... */
@@ -1942,7 +1942,7 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
                                                int x,
                                                int y,
@@ -1954,7 +1954,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
   CoglBitmap *pbo;
   int width;
   int height;
-  gboolean res;
+  CoglBool res;
 
   _COGL_RETURN_VAL_IF_FAIL (source & COGL_READ_PIXELS_COLOR_BUFFER, FALSE);
   _COGL_RETURN_VAL_IF_FAIL (cogl_is_framebuffer (framebuffer), FALSE);
@@ -1980,7 +1980,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
 
   if (res)
     {
-      guint8 *dst;
+      uint8_t *dst;
 
       /* Copy the pixels back into application's buffer */
       dst = _cogl_bitmap_map (bitmap,
@@ -1991,7 +1991,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
         res = FALSE;
       else
         {
-          const guint8 *src;
+          const uint8_t *src;
 
           src = _cogl_bitmap_map (pbo,
                                   COGL_BUFFER_ACCESS_READ,
@@ -2033,7 +2033,7 @@ _cogl_framebuffer_slow_read_pixels_workaround (CoglFramebuffer *framebuffer,
   return res;
 }
 
-gboolean
+CoglBool
 cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
                                           int x,
                                           int y,
@@ -2047,7 +2047,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
   GLenum gl_intformat;
   GLenum gl_format;
   GLenum gl_type;
-  gboolean pack_invert_set;
+  CoglBool pack_invert_set;
   int width;
   int height;
 
@@ -2160,7 +2160,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
       CoglBitmap *tmp_bmp;
       CoglPixelFormat read_format;
       int bpp, rowstride;
-      guint8 *tmp_data;
+      uint8_t *tmp_data;
       int succeeded;
 
       if (ctx->driver == COGL_DRIVER_GL)
@@ -2209,8 +2209,8 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
       CoglBitmap *shared_bmp;
       CoglPixelFormat bmp_format;
       int bpp, rowstride;
-      gboolean succeeded = FALSE;
-      guint8 *pixels;
+      CoglBool succeeded = FALSE;
+      uint8_t *pixels;
 
       rowstride = cogl_bitmap_get_rowstride (bitmap);
 
@@ -2273,9 +2273,9 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
       (source & COGL_READ_PIXELS_NO_FLIP) == 0 &&
       !pack_invert_set)
     {
-      guint8 *temprow;
+      uint8_t *temprow;
       int rowstride;
-      guint8 *pixels;
+      uint8_t *pixels;
 
       rowstride = cogl_bitmap_get_rowstride (bitmap);
       pixels = _cogl_bitmap_map (bitmap,
@@ -2286,7 +2286,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
       if (pixels == NULL)
         return FALSE;
 
-      temprow = g_alloca (rowstride * sizeof (guint8));
+      temprow = g_alloca (rowstride * sizeof (uint8_t));
 
       /* vertically flip the buffer in-place */
       for (y = 0; y < height / 2; y++)
@@ -2309,18 +2309,18 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
   return TRUE;
 }
 
-gboolean
+CoglBool
 cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
                               int x,
                               int y,
                               int width,
                               int height,
                               CoglPixelFormat format,
-                              guint8 *pixels)
+                              uint8_t *pixels)
 {
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
   CoglBitmap *bitmap;
-  gboolean ret;
+  CoglBool ret;
 
   bitmap = cogl_bitmap_new_for_data (framebuffer->context,
                                      width, height,
@@ -2855,18 +2855,18 @@ get_index (void *indices,
   switch (type)
     {
     case COGL_INDICES_TYPE_UNSIGNED_BYTE:
-      return ((guint8 *)indices)[_index];
+      return ((uint8_t *)indices)[_index];
     case COGL_INDICES_TYPE_UNSIGNED_SHORT:
-      return ((guint16 *)indices)[_index];
+      return ((uint16_t *)indices)[_index];
     case COGL_INDICES_TYPE_UNSIGNED_INT:
-      return ((guint32 *)indices)[_index];
+      return ((uint32_t *)indices)[_index];
     }
 
   g_return_val_if_reached (0);
 }
 
 static void
-add_line (guint32 *line_indices,
+add_line (uint32_t *line_indices,
           int base,
           void *user_indices,
           CoglIndicesType user_indices_type,
@@ -2920,7 +2920,7 @@ get_wire_line_indices (CoglContext *ctx,
                        int *n_indices)
 {
   int n_lines;
-  guint32 *line_indices;
+  uint32_t *line_indices;
   CoglIndexBuffer *index_buffer;
   void *indices;
   CoglIndicesType indices_type;
@@ -3020,7 +3020,7 @@ get_wire_line_indices (CoglContext *ctx,
   return ret;
 }
 
-static gboolean
+static CoglBool
 remove_layer_cb (CoglPipeline *pipeline,
                  int layer_index,
                  void *user_data)
@@ -3247,7 +3247,7 @@ _cogl_framebuffer_draw_indexed_attributes (CoglFramebuffer *framebuffer,
 #endif
     {
       CoglBuffer *buffer;
-      guint8 *base;
+      uint8_t *base;
       size_t buffer_offset;
       size_t index_size;
       GLenum indices_gl_type = 0;
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index 07886db..3750ca1 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -110,7 +110,7 @@ typedef struct _CoglFramebuffer CoglFramebuffer;
  * Since: 1.8
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
                            GError **error);
 
@@ -697,7 +697,7 @@ cogl_framebuffer_get_alpha_bits (CoglFramebuffer *framebuffer);
  * Since: 1.8
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
 
 /**
@@ -724,7 +724,7 @@ cogl_framebuffer_get_dither_enabled (CoglFramebuffer *framebuffer);
  */
 void
 cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer,
-                                     gboolean dither_enabled);
+                                     CoglBool dither_enabled);
 
 /**
  * cogl_framebuffer_get_color_mask:
@@ -1570,7 +1570,7 @@ cogl_framebuffer_finish (CoglFramebuffer *framebuffer);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
                                           int x,
                                           int y,
@@ -1616,14 +1616,14 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
                               int x,
                               int y,
                               int width,
                               int height,
                               CoglPixelFormat format,
-                              guint8 *pixels);
+                              uint8_t *pixels);
 
 /**
  * cogl_get_draw_framebuffer:
@@ -1668,7 +1668,7 @@ typedef enum { /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_framebuffer (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-glib-source.c b/cogl/cogl-glib-source.c
index 1cff8e5..1c042ee 100644
--- a/cogl/cogl-glib-source.c
+++ b/cogl/cogl-glib-source.c
@@ -36,10 +36,10 @@ typedef struct _CoglGLibSource
 
   GArray *poll_fds;
 
-  gint64 expiration_time;
+  int64_t expiration_time;
 } CoglGLibSource;
 
-static gboolean
+static CoglBool
 cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
                                    const CoglPollFD *poll_fds,
                                    int n_poll_fds)
@@ -57,13 +57,13 @@ cogl_glib_source_poll_fds_changed (CoglGLibSource *cogl_source,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 cogl_glib_source_prepare (GSource *source, int *timeout)
 {
   CoglGLibSource *cogl_source = (CoglGLibSource *) source;
   CoglPollFD *poll_fds;
   int n_poll_fds;
-  gint64 cogl_timeout;
+  int64_t cogl_timeout;
   int i;
 
   cogl_poll_get_info (cogl_source->context,
@@ -118,7 +118,7 @@ cogl_glib_source_prepare (GSource *source, int *timeout)
   return *timeout == 0;
 }
 
-static gboolean
+static CoglBool
 cogl_glib_source_check (GSource *source)
 {
   CoglGLibSource *cogl_source = (CoglGLibSource *) source;
@@ -138,7 +138,7 @@ cogl_glib_source_check (GSource *source)
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 cogl_glib_source_dispatch (GSource *source,
                            GSourceFunc callback,
                            void *user_data)
diff --git a/cogl/cogl-glx-display-private.h b/cogl/cogl-glx-display-private.h
index 32ff87b..f5d4e05 100644
--- a/cogl/cogl-glx-display-private.h
+++ b/cogl/cogl-glx-display-private.h
@@ -31,9 +31,9 @@ typedef struct _CoglGLXCachedConfig
 {
   /* This will be -1 if there is no cached config in this slot */
   int depth;
-  gboolean found;
+  CoglBool found;
   GLXFBConfig fb_config;
-  gboolean can_mipmap;
+  CoglBool can_mipmap;
 } CoglGLXCachedConfig;
 
 #define COGL_GLX_N_CACHED_CONFIGS 3
@@ -42,15 +42,15 @@ typedef struct _CoglGLXDisplay
 {
   CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS];
 
-  gboolean found_fbconfig;
-  gboolean fbconfig_has_rgba_visual;
+  CoglBool found_fbconfig;
+  CoglBool fbconfig_has_rgba_visual;
   GLXFBConfig fbconfig;
 
   /* Single context for all wins */
   GLXContext glx_context;
   GLXWindow dummy_glxwin;
   Window dummy_xwin;
-  gboolean pending_swap_notify;
+  CoglBool pending_swap_notify;
 } CoglGLXDisplay;
 
 #endif /* __COGL_DISPLAY_GLX_PRIVATE_H */
diff --git a/cogl/cogl-glx-renderer-private.h b/cogl/cogl-glx-renderer-private.h
index d76ef62..4415ea5 100644
--- a/cogl/cogl-glx-renderer-private.h
+++ b/cogl/cogl-glx-renderer-private.h
@@ -37,7 +37,7 @@ typedef struct _CoglGLXRenderer
   int glx_error_base;
   int glx_event_base;
 
-  gboolean is_direct;
+  CoglBool is_direct;
 
   /* Vblank stuff */
   int dri_fd;
diff --git a/cogl/cogl-gpu-info.c b/cogl/cogl-gpu-info.c
index e64fdbd..993c590 100644
--- a/cogl/cogl-gpu-info.c
+++ b/cogl/cogl-gpu-info.c
@@ -43,25 +43,25 @@ typedef struct
 {
   CoglGpuInfoVendor vendor;
   const char *name;
-  gboolean (* check_function) (const CoglGpuInfoStrings *strings);
+  CoglBool (* check_function) (const CoglGpuInfoStrings *strings);
 } CoglGpuInfoVendorDescription;
 
 typedef struct
 {
   CoglGpuInfoDriverPackage driver_package;
   const char *name;
-  gboolean (* check_function) (const CoglGpuInfoStrings *strings,
+  CoglBool (* check_function) (const CoglGpuInfoStrings *strings,
                                int *version_out);
 } CoglGpuInfoDriverPackageDescription;
 
-static gboolean
+static CoglBool
 _cogl_gpu_info_parse_version_string (const char *version_string,
                                      int n_components,
                                      const char **tail,
                                      int *version_ret)
 {
   int version = 0;
-  guint64 part;
+  uint64_t part;
   int i;
 
   for (i = 0; ; i++)
@@ -93,7 +93,7 @@ _cogl_gpu_info_parse_version_string (const char *version_string,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 check_intel_vendor (const CoglGpuInfoStrings *strings)
 {
   const char *intel_part = strstr (strings->renderer_string, "Intel(R)");
@@ -110,7 +110,7 @@ check_intel_vendor (const CoglGpuInfoStrings *strings)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 check_unknown_vendor (const CoglGpuInfoStrings *strings)
 {
   /* This is a last resort so it always matches */
@@ -133,11 +133,11 @@ _cogl_gpu_info_vendors[] =
     }
   };
 
-static gboolean
+static CoglBool
 check_mesa_driver_package (const CoglGpuInfoStrings *strings,
                            int *version_ret)
 {
-  guint64 micro_part;
+  uint64_t micro_part;
   const char *v;
 
   /* The version string should always begin a two-part GL version
@@ -184,7 +184,7 @@ check_mesa_driver_package (const CoglGpuInfoStrings *strings,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 check_unknown_driver_package (const CoglGpuInfoStrings *strings,
                               int *version_out)
 {
diff --git a/cogl/cogl-gtype-private.h b/cogl/cogl-gtype-private.h
index 1d12330..5715d01 100644
--- a/cogl/cogl-gtype-private.h
+++ b/cogl/cogl-gtype-private.h
@@ -32,7 +32,7 @@
 GType \
 cogl_gtype_ ## underscore_name ## _get_type (void) \
 { \
-   static volatile gsize type_volatile = 0; \
+   static volatile size_t type_volatile = 0; \
    if (g_once_init_enter (&type_volatile)) \
      { \
        GType type = \
diff --git a/cogl/cogl-index-buffer.c b/cogl/cogl-index-buffer.c
index 557d770..547cae3 100644
--- a/cogl/cogl-index-buffer.c
+++ b/cogl/cogl-index-buffer.c
@@ -42,10 +42,10 @@ COGL_BUFFER_DEFINE (IndexBuffer, index_buffer);
  * indices buffer should be able to contain multiple ranges of indices
  * which the wiki design doesn't currently consider. */
 CoglIndexBuffer *
-cogl_index_buffer_new (CoglContext *context, gsize bytes)
+cogl_index_buffer_new (CoglContext *context, size_t bytes)
 {
   CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
-  gboolean use_malloc;
+  CoglBool use_malloc;
 
   if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
     use_malloc = TRUE;
@@ -95,7 +95,7 @@ void
 cogl_index_buffer_set_data (CoglIndexBuffer *indices,
                             CoglIndicesType type,
                             int max_index_value,
-                            gsize write_offset,
+                            size_t write_offset,
                             void *user_indices,
                             int n_indices)
 {
diff --git a/cogl/cogl-index-buffer.h b/cogl/cogl-index-buffer.h
index 0c0f477..11481f2 100644
--- a/cogl/cogl-index-buffer.h
+++ b/cogl/cogl-index-buffer.h
@@ -62,7 +62,7 @@ typedef struct _CoglIndexBuffer	      CoglIndexBuffer;
  */
 CoglIndexBuffer *
 cogl_index_buffer_new (CoglContext *context,
-                       gsize bytes);
+                       size_t bytes);
 
 /**
  * cogl_is_index_buffer:
@@ -76,7 +76,7 @@ cogl_index_buffer_new (CoglContext *context,
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_index_buffer (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-indices.c b/cogl/cogl-indices.c
index c99985c..a018559 100644
--- a/cogl/cogl-indices.c
+++ b/cogl/cogl-indices.c
@@ -61,7 +61,7 @@ sizeof_indices_type (CoglIndicesType type)
 CoglIndices *
 cogl_indices_new_for_buffer (CoglIndicesType type,
                              CoglIndexBuffer *buffer,
-                             gsize offset)
+                             size_t offset)
 {
   CoglIndices *indices = g_slice_new (CoglIndices);
 
@@ -111,7 +111,7 @@ cogl_indices_get_type (CoglIndices *indices)
   return indices->type;
 }
 
-gsize
+size_t
 cogl_indices_get_offset (CoglIndices *indices)
 {
   _COGL_RETURN_VAL_IF_FAIL (cogl_is_indices (indices), 0);
@@ -122,7 +122,7 @@ cogl_indices_get_offset (CoglIndices *indices)
 static void
 warn_about_midscene_changes (void)
 {
-  static gboolean seen = FALSE;
+  static CoglBool seen = FALSE;
   if (!seen)
     {
       g_warning ("Mid-scene modification of indices has "
@@ -133,7 +133,7 @@ warn_about_midscene_changes (void)
 
 void
 cogl_indices_set_offset (CoglIndices *indices,
-                         gsize offset)
+                         size_t offset)
 {
   _COGL_RETURN_IF_FAIL (cogl_is_indices (indices));
 
@@ -181,8 +181,8 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
       /* Generate the byte array if we haven't already */
       if (ctx->rectangle_byte_indices == NULL)
         {
-          guint8 *byte_array = g_malloc (256 / 4 * 6 * sizeof (guint8));
-          guint8 *p = byte_array;
+          uint8_t *byte_array = g_malloc (256 / 4 * 6 * sizeof (uint8_t));
+          uint8_t *p = byte_array;
           int i, vert_num = 0;
 
           for (i = 0; i < 256 / 4; i++)
@@ -211,8 +211,8 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
     {
       if (ctx->rectangle_short_indices_len < n_indices)
         {
-          guint16 *short_array;
-          guint16 *p;
+          uint16_t *short_array;
+          uint16_t *p;
           int i, vert_num = 0;
 
           if (ctx->rectangle_short_indices != NULL)
@@ -226,7 +226,7 @@ cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
           /* Over-allocate to generate a whole number of quads */
           p = short_array = g_malloc ((ctx->rectangle_short_indices_len
                                        + 5) / 6 * 6
-                                      * sizeof (guint16));
+                                      * sizeof (uint16_t));
 
           /* Fill in the complete quads */
           for (i = 0; i < ctx->rectangle_short_indices_len; i += 6)
diff --git a/cogl/cogl-indices.h b/cogl/cogl-indices.h
index 23cc911..62eca03 100644
--- a/cogl/cogl-indices.h
+++ b/cogl/cogl-indices.h
@@ -108,7 +108,7 @@ cogl_indices_new (CoglContext *context,
 CoglIndices *
 cogl_indices_new_for_buffer (CoglIndicesType type,
                              CoglIndexBuffer *buffer,
-                             gsize offset);
+                             size_t offset);
 
 CoglIndexBuffer *
 cogl_indices_get_buffer (CoglIndices *indices);
@@ -116,12 +116,12 @@ cogl_indices_get_buffer (CoglIndices *indices);
 CoglIndicesType
 cogl_indices_get_type (CoglIndices *indices);
 
-gsize
+size_t
 cogl_indices_get_offset (CoglIndices *indices);
 
 void
 cogl_indices_set_offset (CoglIndices *indices,
-                         gsize offset);
+                         size_t offset);
 
 CoglIndices *
 cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
@@ -137,7 +137,7 @@ cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_indices (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h
index 710a0ee..5881315 100644
--- a/cogl/cogl-internal.h
+++ b/cogl/cogl-internal.h
@@ -115,7 +115,7 @@ typedef enum _CoglPipelineEvalFlags
   COGL_PIPELINE_EVAL_FLAG_NONE = 0
 } CoglPipelineEvalFlags;
 
-gboolean
+CoglBool
 _cogl_check_extension (const char *name, const char *ext);
 
 GQuark
diff --git a/cogl/cogl-journal-private.h b/cogl/cogl-journal-private.h
index 650f093..e6e2015 100644
--- a/cogl/cogl-journal-private.h
+++ b/cogl/cogl-journal-private.h
@@ -94,21 +94,21 @@ _cogl_journal_flush (CoglJournal *journal);
 void
 _cogl_journal_discard (CoglJournal *journal);
 
-gboolean
+CoglBool
 _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
                                          float clip_x0,
                                          float clip_y0,
                                          float clip_x1,
                                          float clip_y1);
 
-gboolean
+CoglBool
 _cogl_journal_try_read_pixel (CoglJournal *journal,
                               int x,
                               int y,
                               CoglBitmap *bitmap,
-                              gboolean *found_intersection);
+                              CoglBool *found_intersection);
 
-gboolean
+CoglBool
 _cogl_is_journal (void *object);
 
 #endif /* __COGL_JOURNAL_PRIVATE_H */
diff --git a/cogl/cogl-journal.c b/cogl/cogl-journal.c
index 30c3c79..4ae1eb0 100644
--- a/cogl/cogl-journal.c
+++ b/cogl/cogl-journal.c
@@ -94,29 +94,29 @@
 
 typedef struct _CoglJournalFlushState
 {
-  CoglJournal         *journal;
+  CoglJournal *journal;
 
   CoglAttributeBuffer *attribute_buffer;
-  GArray              *attributes;
-  int                  current_attribute;
+  GArray *attributes;
+  int current_attribute;
 
-  gsize                stride;
-  size_t               array_offset;
-  GLuint               current_vertex;
+  size_t stride;
+  size_t array_offset;
+  GLuint current_vertex;
 
-  CoglIndices         *indices;
-  gsize                indices_type_size;
+  CoglIndices *indices;
+  size_t indices_type_size;
 
-  CoglMatrixStack     *modelview_stack;
-  CoglMatrixStack     *projection_stack;
+  CoglMatrixStack *modelview_stack;
+  CoglMatrixStack *projection_stack;
 
-  CoglPipeline        *pipeline;
+  CoglPipeline *pipeline;
 } CoglJournalFlushState;
 
 typedef void (*CoglJournalBatchCallback) (CoglJournalEntry *start,
                                           int n_entries,
                                           void *data);
-typedef gboolean (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
+typedef CoglBool (*CoglJournalBatchTest) (CoglJournalEntry *entry0,
                                           CoglJournalEntry *entry1);
 
 static void _cogl_journal_free (CoglJournal *journal);
@@ -160,9 +160,9 @@ _cogl_journal_new (CoglFramebuffer *framebuffer)
 }
 
 static void
-_cogl_journal_dump_logged_quad (guint8 *data, int n_layers)
+_cogl_journal_dump_logged_quad (uint8_t *data, int n_layers)
 {
-  gsize stride = GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (n_layers);
+  size_t stride = GET_JOURNAL_ARRAY_STRIDE_FOR_N_LAYERS (n_layers);
   int i;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -189,9 +189,9 @@ _cogl_journal_dump_logged_quad (guint8 *data, int n_layers)
 }
 
 static void
-_cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
+_cogl_journal_dump_quad_vertices (uint8_t *data, int n_layers)
 {
-  gsize stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers);
+  size_t stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers);
   int i;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -204,7 +204,7 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
   for (i = 0; i < 4; i++)
     {
       float *v = (float *)data + (i * stride);
-      guint8 *c = data + (POS_STRIDE * 4) + (i * stride * 4);
+      uint8_t *c = data + (POS_STRIDE * 4) + (i * stride * 4);
       int j;
 
       if (G_UNLIKELY (COGL_DEBUG_ENABLED
@@ -224,9 +224,9 @@ _cogl_journal_dump_quad_vertices (guint8 *data, int n_layers)
 }
 
 static void
-_cogl_journal_dump_quad_batch (guint8 *data, int n_layers, int n_quads)
+_cogl_journal_dump_quad_batch (uint8_t *data, int n_layers, int n_quads)
 {
-  gsize byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4;
+  size_t byte_stride = GET_JOURNAL_VB_STRIDE_FOR_N_LAYERS (n_layers) * 4;
   int i;
 
   g_print ("_cogl_journal_dump_quad_batch: n_layers = %d, n_quads = %d\n",
@@ -358,7 +358,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_RECTANGLES)))
     {
       static CoglPipeline *outline = NULL;
-      guint8 color_intensity;
+      uint8_t color_intensity;
       int i;
       CoglAttribute *loop_attributes[1];
 
@@ -408,7 +408,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
   COGL_TIMER_STOP (_cogl_uprof_context, time_flush_modelview_and_entries);
 }
 
-static gboolean
+static CoglBool
 compare_entry_modelviews (CoglJournalEntry *entry0,
                           CoglJournalEntry *entry1)
 {
@@ -469,7 +469,7 @@ _cogl_journal_flush_pipeline_and_entries (CoglJournalEntry *batch_start,
   COGL_TIMER_STOP (_cogl_uprof_context, time_flush_pipeline_entries);
 }
 
-static gboolean
+static CoglBool
 compare_entry_pipelines (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
 {
   /* batch rectangles using compatible pipelines */
@@ -566,7 +566,7 @@ _cogl_journal_flush_texcoord_vbo_offsets_and_entries (
   COGL_TIMER_STOP (_cogl_uprof_context, time_flush_texcoord_pipeline_entries);
 }
 
-static gboolean
+static CoglBool
 compare_entry_n_layers (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
 {
   if (entry0->n_layers == entry1->n_layers)
@@ -582,11 +582,11 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
                                              int               batch_len,
                                              void             *data)
 {
-  CoglJournalFlushState   *state = data;
-  CoglContext             *ctx = state->journal->framebuffer->context;
-  gsize                    stride;
-  int                      i;
-  CoglAttribute          **attribute_entry;
+  CoglJournalFlushState *state = data;
+  CoglContext *ctx = state->journal->framebuffer->context;
+  size_t stride;
+  int i;
+  CoglAttribute **attribute_entry;
   COGL_STATIC_TIMER (time_flush_vbo_texcoord_pipeline_entries,
                      "flush: clip+vbo+texcoords+pipeline+entries", /* parent */
                      "flush: vbo+texcoords+pipeline+entries",
@@ -648,12 +648,12 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
 
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_JOURNAL)))
     {
-      guint8 *verts;
+      uint8_t *verts;
 
       /* Mapping a buffer for read is probably a really bad thing to
          do but this will only happen during debugging so it probably
          doesn't matter */
-      verts = ((guint8 *)cogl_buffer_map (COGL_BUFFER (state->attribute_buffer),
+      verts = ((uint8_t *)cogl_buffer_map (COGL_BUFFER (state->attribute_buffer),
                                           COGL_BUFFER_ACCESS_READ, 0) +
                state->array_offset);
 
@@ -679,7 +679,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
                    time_flush_vbo_texcoord_pipeline_entries);
 }
 
-static gboolean
+static CoglBool
 compare_entry_strides (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
 {
   /* Currently the only thing that affects the stride for our vertex arrays
@@ -755,7 +755,7 @@ _cogl_journal_flush_clip_stacks_and_entries (CoglJournalEntry *batch_start,
                    time_flush_clip_stack_pipeline_entries);
 }
 
-static gboolean
+static CoglBool
 calculate_translation (const CoglMatrix *a,
                        const CoglMatrix *b,
                        float *tx_p,
@@ -846,7 +846,7 @@ typedef struct
   float x_2, y_2;
 } ClipBounds;
 
-static gboolean
+static CoglBool
 can_software_clip_entry (CoglJournalEntry *journal_entry,
                          CoglJournalEntry *prev_journal_entry,
                          CoglClipStack *clip_stack,
@@ -1119,7 +1119,7 @@ _cogl_journal_maybe_software_clip_entries (CoglJournalEntry *batch_start,
                    time_check_software_clip);
 }
 
-static gboolean
+static CoglBool
 compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
 {
   return entry0->clip_stack == entry1->clip_stack;
@@ -1129,7 +1129,7 @@ compare_entry_clip_stacks (CoglJournalEntry *entry0, CoglJournalEntry *entry1)
    array so it can be treated as if it was just newly allocated */
 static CoglAttributeBuffer *
 create_attribute_buffer (CoglJournal *journal,
-                         gsize n_bytes)
+                         size_t n_bytes)
 {
   CoglAttributeBuffer *vbo;
 
@@ -1163,11 +1163,11 @@ create_attribute_buffer (CoglJournal *journal,
 }
 
 static CoglAttributeBuffer *
-upload_vertices (CoglJournal            *journal,
+upload_vertices (CoglJournal *journal,
                  const CoglJournalEntry *entries,
-                 int                     n_entries,
-                 size_t                  needed_vbo_len,
-                 GArray                 *vertices)
+                 int n_entries,
+                 size_t needed_vbo_len,
+                 GArray *vertices)
 {
   CoglAttributeBuffer *attribute_buffer;
   CoglBuffer *buffer;
@@ -1284,7 +1284,7 @@ _cogl_journal_discard (CoglJournal *journal)
 
 /* Note: A return value of FALSE doesn't mean 'no' it means
  * 'unknown' */
-gboolean
+CoglBool
 _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
                                          float clip_x0,
                                          float clip_y0,
@@ -1329,7 +1329,7 @@ _cogl_journal_all_entries_within_bounds (CoglJournal *journal,
    */
   for (i = 1; i < journal->entries->len; i++)
     {
-      gboolean found_reference = FALSE;
+      CoglBool found_reference = FALSE;
       entry = &g_array_index (journal->entries, CoglJournalEntry, i);
 
       for (clip_entry = entry->clip_stack;
@@ -1466,7 +1466,7 @@ _cogl_journal_flush (CoglJournal *journal)
   COGL_TIMER_STOP (_cogl_uprof_context, flush_timer);
 }
 
-static gboolean
+static CoglBool
 add_framebuffer_deps_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglFramebuffer *framebuffer = user_data;
@@ -1492,12 +1492,12 @@ _cogl_journal_log_quad (CoglJournal  *journal,
                         unsigned int  tex_coords_len)
 {
   CoglFramebuffer *framebuffer = journal->framebuffer;
-  gsize stride;
+  size_t stride;
   int next_vert;
   float *v;
   int i;
   int next_entry;
-  guint32 disable_layers;
+  uint32_t disable_layers;
   CoglJournalEntry *entry;
   CoglPipeline *final_pipeline;
   CoglClipStack *clip_stack;
@@ -1539,7 +1539,7 @@ _cogl_journal_log_quad (CoglJournal  *journal,
 
   /* FIXME: This is a hacky optimization, since it will break if we
    * change the definition of CoglColor: */
-  _cogl_pipeline_get_colorubv (pipeline, (guint8 *) v);
+  _cogl_pipeline_get_colorubv (pipeline, (uint8_t *) v);
   v++;
 
   memcpy (v, position, sizeof (float) * 2);
@@ -1559,7 +1559,7 @@ _cogl_journal_log_quad (CoglJournal  *journal,
     {
       g_print ("Logged new quad:\n");
       v = &g_array_index (journal->vertices, float, next_vert);
-      _cogl_journal_dump_logged_quad ((guint8 *)v, n_layers);
+      _cogl_journal_dump_logged_quad ((uint8_t *)v, n_layers);
     }
 
   next_entry = journal->entries->len;
@@ -1704,16 +1704,16 @@ entry_to_screen_polygon (CoglFramebuffer *framebuffer,
 #undef VIEWPORT_TRANSFORM_Y
 }
 
-static gboolean
+static CoglBool
 try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
                                               CoglJournalEntry *entry,
                                               float *vertices,
                                               float x,
                                               float y,
-                                              gboolean *hit)
+                                              CoglBool *hit)
 {
-  gboolean can_software_clip = TRUE;
-  gboolean needs_software_clip = FALSE;
+  CoglBool can_software_clip = TRUE;
+  CoglBool needs_software_clip = FALSE;
   CoglClipStack *clip_entry;
 
   *hit = TRUE;
@@ -1777,12 +1777,12 @@ try_checking_point_hits_entry_after_clipping (CoglFramebuffer *framebuffer,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_journal_try_read_pixel (CoglJournal *journal,
                               int x,
                               int y,
                               CoglBitmap *bitmap,
-                              gboolean *found_intersection)
+                              CoglBool *found_intersection)
 {
   CoglPixelFormat format;
   int i;
@@ -1819,12 +1819,12 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
     {
       CoglJournalEntry *entry =
         &g_array_index (journal->entries, CoglJournalEntry, i);
-      guint8 *color = (guint8 *)&g_array_index (journal->vertices, float,
+      uint8_t *color = (uint8_t *)&g_array_index (journal->vertices, float,
                                                 entry->array_offset);
       float *vertices = (float *)color + 1;
       float poly[16];
       CoglFramebuffer *framebuffer = journal->framebuffer;
-      guint8 *pixel;
+      uint8_t *pixel;
 
       entry_to_screen_polygon (framebuffer, entry, vertices, poly);
 
@@ -1833,7 +1833,7 @@ _cogl_journal_try_read_pixel (CoglJournal *journal,
 
       if (entry->clip_stack)
         {
-          gboolean hit;
+          CoglBool hit;
 
           if (!try_checking_point_hits_entry_after_clipping (framebuffer,
                                                              entry,
diff --git a/cogl/cogl-material-compat.c b/cogl/cogl-material-compat.c
index 2e71928..c7519d9 100644
--- a/cogl/cogl-material-compat.c
+++ b/cogl/cogl-material-compat.c
@@ -58,7 +58,7 @@ cogl_material_unref (CoglHandle handle)
   cogl_object_unref (handle);
 }
 
-gboolean
+CoglBool
 cogl_is_material (CoglHandle handle)
 {
   return cogl_is_pipeline (handle);
@@ -73,10 +73,10 @@ cogl_material_set_color (CoglMaterial    *material,
 
 void
 cogl_material_set_color4ub (CoglMaterial *material,
-			    guint8        red,
-                            guint8        green,
-                            guint8        blue,
-                            guint8        alpha)
+			    uint8_t red,
+                            uint8_t green,
+                            uint8_t blue,
+                            uint8_t alpha)
 {
   cogl_pipeline_set_color4ub (COGL_PIPELINE (material),
                               red, green, blue, alpha);
@@ -189,7 +189,7 @@ cogl_material_set_alpha_test_function (CoglMaterial         *material,
                                          alpha_reference);
 }
 
-gboolean
+CoglBool
 cogl_material_set_blend (CoglMaterial *material,
                          const char   *blend_string,
                          GError      **error)
@@ -248,7 +248,7 @@ cogl_material_remove_layer (CoglMaterial *material,
   cogl_pipeline_remove_layer (COGL_PIPELINE (material), layer_index);
 }
 
-gboolean
+CoglBool
 cogl_material_set_layer_combine (CoglMaterial *material,
 				 int           layer_index,
 				 const char   *blend_string,
@@ -327,10 +327,10 @@ cogl_material_set_layer_filters (CoglMaterial      *material,
                                    mag_filter);
 }
 
-gboolean
+CoglBool
 cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
                                                      int           layer_index,
-                                                     gboolean      enable,
+                                                     CoglBool      enable,
                                                      GError      **error)
 {
   CoglPipeline *pipeline = COGL_PIPELINE (material);
@@ -340,7 +340,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
                                                               error);
 }
 
-gboolean
+CoglBool
 cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
                                                      int           layer_index)
 {
@@ -436,7 +436,7 @@ cogl_material_foreach_layer (CoglMaterial *material,
                                (CoglPipelineLayerCallback)callback, user_data);
 }
 
-gboolean
+CoglBool
 cogl_material_set_depth_state (CoglMaterial *material,
                                const CoglDepthState *state,
                                GError **error)
diff --git a/cogl/cogl-material-compat.h b/cogl/cogl-material-compat.h
index f07bb69..7b012fd 100644
--- a/cogl/cogl-material-compat.h
+++ b/cogl/cogl-material-compat.h
@@ -198,7 +198,7 @@ cogl_material_unref (CoglHandle material) G_GNUC_DEPRECATED;
  * Return value: %TRUE if the handle references a #CoglMaterial,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_material (CoglHandle handle);
 
 /**
@@ -237,10 +237,10 @@ cogl_material_set_color (CoglMaterial    *material,
  */
 void
 cogl_material_set_color4ub (CoglMaterial *material,
-			    guint8        red,
-                            guint8        green,
-                            guint8        blue,
-                            guint8        alpha);
+			    uint8_t red,
+                            uint8_t green,
+                            uint8_t blue,
+                            uint8_t alpha);
 
 /**
  * cogl_material_set_color4f:
@@ -587,7 +587,7 @@ cogl_material_set_alpha_test_function (CoglMaterial         *material,
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_material_set_blend (CoglMaterial *material,
                          const char   *blend_string,
                          GError      **error);
@@ -832,7 +832,7 @@ cogl_material_remove_layer (CoglMaterial *material,
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_material_set_layer_combine (CoglMaterial *material,
 				 int           layer_index,
 				 const char   *blend_string,
@@ -1013,10 +1013,10 @@ cogl_material_set_layer_filters (CoglMaterial      *material,
  * Return value: %TRUE if the function succeeds, %FALSE otherwise.
  * Since: 1.4
  */
-gboolean
+CoglBool
 cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
                                                      int           layer_index,
-                                                     gboolean      enable,
+                                                     CoglBool      enable,
                                                      GError      **error);
 
 /**
@@ -1032,7 +1032,7 @@ cogl_material_set_layer_point_sprite_coords_enabled (CoglMaterial *material,
  *
  * Since: 1.4
  */
-gboolean
+CoglBool
 cogl_material_get_layer_point_sprite_coords_enabled (CoglMaterial *material,
                                                      int           layer_index);
 
@@ -1215,7 +1215,7 @@ cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
  * Since: 1.8
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_material_set_depth_state (CoglMaterial *material,
                                const CoglDepthState *state,
                                GError **error);
@@ -1247,7 +1247,7 @@ cogl_material_get_depth_state (CoglMaterial *material,
  * Since: 1.4
  * Stability: Unstable
  */
-typedef gboolean (*CoglMaterialLayerCallback) (CoglMaterial *material,
+typedef CoglBool (*CoglMaterialLayerCallback) (CoglMaterial *material,
                                                int layer_index,
                                                void *user_data);
 
diff --git a/cogl/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c
index 5933bcf..64ff803 100644
--- a/cogl/cogl-matrix-stack.c
+++ b/cogl/cogl-matrix-stack.c
@@ -38,7 +38,7 @@
 
 typedef struct {
   CoglMatrix matrix;
-  gboolean is_identity;
+  CoglBool is_identity;
   /* count of pushes with no changes; when a change is
    * requested, we create a new state and decrement this
    */
@@ -93,7 +93,7 @@ _cogl_matrix_stack_top (CoglMatrixStack *stack)
  */
 static CoglMatrixState *
 _cogl_matrix_stack_top_mutable (CoglMatrixStack *stack,
-                                gboolean initialize)
+                                CoglBool initialize)
 {
   CoglMatrixState *state;
   CoglMatrixState *new_top;
@@ -321,7 +321,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
   stack->age++;
 }
 
-gboolean
+CoglBool
 _cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
                                 CoglMatrix      *inverse)
 {
@@ -367,7 +367,7 @@ _cogl_matrix_stack_set (CoglMatrixStack  *stack,
 
 static void
 _cogl_matrix_stack_flush_matrix_to_gl_builtin (CoglContext *ctx,
-                                               gboolean is_identity,
+                                               CoglBool is_identity,
                                                CoglMatrix *matrix,
                                                CoglMatrixMode mode)
 {
@@ -409,14 +409,14 @@ void
 _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
                                          CoglMatrixStack *stack,
                                          CoglMatrixMode mode,
-                                         gboolean disable_flip)
+                                         CoglBool disable_flip)
 {
   g_assert (ctx->driver == COGL_DRIVER_GL ||
             ctx->driver == COGL_DRIVER_GLES1);
 
 #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES)
   {
-    gboolean needs_flip;
+    CoglBool needs_flip;
     CoglMatrixState *state;
     CoglMatrixStackCache *cache;
 
@@ -451,7 +451,7 @@ _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
     if (!cache ||
         _cogl_matrix_stack_check_and_update_cache (stack, cache, needs_flip))
       {
-        gboolean is_identity = state->is_identity && !needs_flip;
+        CoglBool is_identity = state->is_identity && !needs_flip;
 
         if (needs_flip)
           {
@@ -485,13 +485,13 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack)
   return stack->age;
 }
 
-gboolean
+CoglBool
 _cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack)
 {
   return _cogl_matrix_stack_top (stack)->is_identity;
 }
 
-gboolean
+CoglBool
 _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
                           CoglMatrixStack *stack1)
 {
@@ -507,14 +507,14 @@ _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
     return cogl_matrix_equal (&state0->matrix, &state1->matrix);
 }
 
-gboolean
+CoglBool
 _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
                                            CoglMatrixStackCache *cache,
-                                           gboolean flip)
+                                           CoglBool flip)
 {
-  gboolean is_identity =
+  CoglBool is_identity =
     _cogl_matrix_stack_has_identity_flag (stack) && !flip;
-  gboolean is_dirty;
+  CoglBool is_dirty;
 
   if (is_identity && cache->flushed_identity)
     is_dirty = FALSE;
diff --git a/cogl/cogl-matrix-stack.h b/cogl/cogl-matrix-stack.h
index 7a1417e..49cd03e 100644
--- a/cogl/cogl-matrix-stack.h
+++ b/cogl/cogl-matrix-stack.h
@@ -38,8 +38,8 @@ typedef struct
 {
   CoglMatrixStack *stack;
   unsigned int age;
-  gboolean flushed_identity;
-  gboolean flipped;
+  CoglBool flushed_identity;
+  CoglBool flipped;
 } CoglMatrixStackCache;
 
 typedef enum {
@@ -49,7 +49,7 @@ typedef enum {
 } CoglMatrixMode;
 
 typedef void (* CoglMatrixStackFlushFunc) (CoglContext *context,
-                                           gboolean is_identity,
+                                           CoglBool is_identity,
                                            const CoglMatrix *matrix,
                                            void *user_data);
 
@@ -106,7 +106,7 @@ _cogl_matrix_stack_ortho (CoglMatrixStack *stack,
                           float top,
                           float z_near,
                           float z_far);
-gboolean
+CoglBool
 _cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
                                 CoglMatrix *inverse);
 void
@@ -120,7 +120,7 @@ void
 _cogl_matrix_stack_flush_to_gl_builtins (CoglContext *ctx,
                                          CoglMatrixStack *stack,
                                          CoglMatrixMode mode,
-                                         gboolean disable_flip);
+                                         CoglBool disable_flip);
 
 unsigned int
 _cogl_matrix_stack_get_age (CoglMatrixStack *stack);
@@ -129,25 +129,25 @@ _cogl_matrix_stack_get_age (CoglMatrixStack *stack);
    identity matrix. If it returns FALSE it may or may not be the
    identity matrix but no expensive comparison is performed to verify
    it. */
-gboolean
+CoglBool
 _cogl_matrix_stack_has_identity_flag (CoglMatrixStack *stack);
 
-gboolean
+CoglBool
 _cogl_matrix_stack_equal (CoglMatrixStack *stack0,
                           CoglMatrixStack *stack1);
 
 void
 _cogl_matrix_stack_init_cache (CoglMatrixStackCache *cache);
 
-gboolean
+CoglBool
 _cogl_matrix_stack_check_and_update_cache (CoglMatrixStack *stack,
                                            CoglMatrixStackCache *cache,
-                                           gboolean flip);
+                                           CoglBool flip);
 
 void
 _cogl_matrix_stack_destroy_cache (CoglMatrixStackCache *cache);
 
-gboolean
+CoglBool
 _cogl_is_matrix_stack (void *object);
 
 #endif /* __COGL_MATRIX_STACK_H */
diff --git a/cogl/cogl-matrix.c b/cogl/cogl-matrix.c
index a346a5c..d22293e 100644
--- a/cogl/cogl-matrix.c
+++ b/cogl/cogl-matrix.c
@@ -431,7 +431,7 @@ _cogl_matrix_print (const CoglMatrix *matrix)
  * with partial pivoting followed by back/substitution with the loops manually
  * unrolled.
  */
-static gboolean
+static CoglBool
 invert_matrix_general (CoglMatrix *matrix)
 {
   const float *m = (float *)matrix;
@@ -570,7 +570,7 @@ invert_matrix_general (CoglMatrix *matrix)
  * element. Finally deals with the translation part by transforming the
  * original translation vector using by the calculated submatrix inverse.
  */
-static gboolean
+static CoglBool
 invert_matrix_3d_general (CoglMatrix *matrix)
 {
   const float *in = (float *)matrix;
@@ -652,7 +652,7 @@ invert_matrix_3d_general (CoglMatrix *matrix)
  * the inverse matrix analyzing and inverting each of the scaling, rotation and
  * translation parts.
  */
-static gboolean
+static CoglBool
 invert_matrix_3d (CoglMatrix *matrix)
 {
   const float *in = (float *)matrix;
@@ -735,7 +735,7 @@ invert_matrix_3d (CoglMatrix *matrix)
  *
  * Simply copies identity into CoglMatrix::inv.
  */
-static gboolean
+static CoglBool
 invert_matrix_identity (CoglMatrix *matrix)
 {
   memcpy (matrix->inv, identity, 16 * sizeof (float));
@@ -752,7 +752,7 @@ invert_matrix_identity (CoglMatrix *matrix)
  *
  * Calculates the
  */
-static gboolean
+static CoglBool
 invert_matrix_3d_no_rotation (CoglMatrix *matrix)
 {
   const float *in = (float *)matrix;
@@ -787,7 +787,7 @@ invert_matrix_3d_no_rotation (CoglMatrix *matrix)
  * Calculates the inverse matrix by applying the inverse scaling and
  * translation to the identity matrix.
  */
-static gboolean
+static CoglBool
 invert_matrix_2d_no_rotation (CoglMatrix *matrix)
 {
   const float *in = (float *)matrix;
@@ -811,7 +811,7 @@ invert_matrix_2d_no_rotation (CoglMatrix *matrix)
 
 #if 0
 /* broken */
-static gboolean
+static CoglBool
 invert_matrix_perspective (CoglMatrix *matrix)
 {
   const float *in = matrix;
@@ -841,7 +841,7 @@ invert_matrix_perspective (CoglMatrix *matrix)
 /*
  * Matrix inversion function pointer type.
  */
-typedef gboolean (*inv_mat_func)(CoglMatrix *matrix);
+typedef CoglBool (*inv_mat_func)(CoglMatrix *matrix);
 
 /*
  * Table of the matrix inversion functions according to the matrix type.
@@ -1099,7 +1099,7 @@ _cogl_matrix_update_type_and_flags (CoglMatrix *matrix)
  * given matrix type.  In case of failure, updates the MAT_FLAG_SINGULAR flag,
  * and copies the identity matrix into CoglMatrix::inv.
  */
-static gboolean
+static CoglBool
 _cogl_matrix_update_inverse (CoglMatrix *matrix)
 {
   if (matrix->flags & MAT_DIRTY_FLAGS ||
@@ -1124,7 +1124,7 @@ _cogl_matrix_update_inverse (CoglMatrix *matrix)
     return TRUE;
 }
 
-gboolean
+CoglBool
 cogl_matrix_get_inverse (const CoglMatrix *matrix, CoglMatrix *inverse)
 {
   if (_cogl_matrix_update_inverse ((CoglMatrix *)matrix))
@@ -1156,7 +1156,7 @@ _cogl_matrix_rotate (CoglMatrix *matrix,
 {
   float xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c, s, c;
   float m[16];
-  gboolean optimized;
+  CoglBool optimized;
 
   s = sinf (angle * DEG2RAD);
   c = cosf (angle * DEG2RAD);
@@ -1600,7 +1600,7 @@ cogl_matrix_init_identity (CoglMatrix *matrix)
 /*
  * Test if the given matrix preserves vector lengths.
  */
-static gboolean
+static CoglBool
 _cogl_matrix_is_length_preserving (const CoglMatrix *m)
 {
   return TEST_MAT_FLAGS (m, MAT_FLAGS_LENGTH_PRESERVING);
@@ -1610,7 +1610,7 @@ _cogl_matrix_is_length_preserving (const CoglMatrix *m)
  * Test if the given matrix does any rotation.
  * (or perhaps if the upper-left 3x3 is non-identity)
  */
-static gboolean
+static CoglBool
 _cogl_matrix_has_rotation (const CoglMatrix *matrix)
 {
   if (matrix->flags & (MAT_FLAG_GENERAL |
@@ -1622,13 +1622,13 @@ _cogl_matrix_has_rotation (const CoglMatrix *matrix)
     return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_matrix_is_general_scale (const CoglMatrix *matrix)
 {
   return (matrix->flags & MAT_FLAG_GENERAL_SCALE) ? TRUE : FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_matrix_is_dirty (const CoglMatrix *matrix)
 {
   return (matrix->flags & MAT_DIRTY_ALL) ? TRUE : FALSE;
@@ -1782,8 +1782,8 @@ cogl_matrix_view_2d_in_perspective (CoglMatrix *matrix,
                                   height_2d);
 }
 
-gboolean
-cogl_matrix_equal (gconstpointer v1, gconstpointer v2)
+CoglBool
+cogl_matrix_equal (const void *v1, const void *v2)
 {
   const CoglMatrix *a = v1;
   const CoglMatrix *b = v2;
@@ -1896,8 +1896,8 @@ _cogl_matrix_transform_points_f2 (const CoglMatrix *matrix,
 
   for (i = 0; i < n_points; i++)
     {
-      Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in);
-      Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out);
+      Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
+      Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
 
       o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
       o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw;
@@ -1917,8 +1917,8 @@ _cogl_matrix_project_points_f2 (const CoglMatrix *matrix,
 
   for (i = 0; i < n_points; i++)
     {
-      Point2f p = *(Point2f *)((guint8 *)points_in + i * stride_in);
-      Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
+      Point2f p = *(Point2f *)((uint8_t *)points_in + i * stride_in);
+      Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
 
       o->x = matrix->xx * p.x + matrix->xy * p.y + matrix->xw;
       o->y = matrix->yx * p.x + matrix->yy * p.y + matrix->yw;
@@ -1939,8 +1939,8 @@ _cogl_matrix_transform_points_f3 (const CoglMatrix *matrix,
 
   for (i = 0; i < n_points; i++)
     {
-      Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in);
-      Point3f *o = (Point3f *)((guint8 *)points_out + i * stride_out);
+      Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
+      Point3f *o = (Point3f *)((uint8_t *)points_out + i * stride_out);
 
       o->x = matrix->xx * p.x + matrix->xy * p.y +
              matrix->xz * p.z + matrix->xw;
@@ -1963,8 +1963,8 @@ _cogl_matrix_project_points_f3 (const CoglMatrix *matrix,
 
   for (i = 0; i < n_points; i++)
     {
-      Point3f p = *(Point3f *)((guint8 *)points_in + i * stride_in);
-      Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
+      Point3f p = *(Point3f *)((uint8_t *)points_in + i * stride_in);
+      Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
 
       o->x = matrix->xx * p.x + matrix->xy * p.y +
              matrix->xz * p.z + matrix->xw;
@@ -1989,8 +1989,8 @@ _cogl_matrix_project_points_f4 (const CoglMatrix *matrix,
 
   for (i = 0; i < n_points; i++)
     {
-      Point4f p = *(Point4f *)((guint8 *)points_in + i * stride_in);
-      Point4f *o = (Point4f *)((guint8 *)points_out + i * stride_out);
+      Point4f p = *(Point4f *)((uint8_t *)points_in + i * stride_in);
+      Point4f *o = (Point4f *)((uint8_t *)points_out + i * stride_out);
 
       o->x = matrix->xx * p.x + matrix->xy * p.y +
              matrix->xz * p.z + matrix->xw * p.w;
@@ -2061,7 +2061,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
     }
 }
 
-gboolean
+CoglBool
 cogl_matrix_is_identity (const CoglMatrix *matrix)
 {
   if (!(matrix->flags & MAT_DIRTY_TYPE) &&
diff --git a/cogl/cogl-matrix.h b/cogl/cogl-matrix.h
index cca1823..b5b5fc3 100644
--- a/cogl/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
@@ -483,8 +483,8 @@ cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
  *
  * Since: 1.4
  */
-gboolean
-cogl_matrix_equal (gconstpointer v1, gconstpointer v2);
+CoglBool
+cogl_matrix_equal (const void *v1, const void *v2);
 
 /**
  * cogl_matrix_copy:
@@ -533,7 +533,7 @@ cogl_matrix_free (CoglMatrix *matrix);
  *
  * Since: 1.2
  */
-gboolean
+CoglBool
 cogl_matrix_get_inverse (const CoglMatrix *matrix,
                          CoglMatrix *inverse);
 
@@ -584,11 +584,11 @@ cogl_matrix_transform_point (const CoglMatrix *matrix,
  * |[
  * typedef struct {
  *   float x,y;
- *   guint8 r,g,b,a;
+ *   uint8_t r,g,b,a;
  *   float s,t,p;
  * } MyInVertex;
  * typedef struct {
- *   guint8 r,g,b,a;
+ *   uint8_t r,g,b,a;
  *   float x,y,z;
  * } MyOutVertex;
  * MyInVertex vertices[N_VERTICES];
@@ -639,11 +639,11 @@ cogl_matrix_transform_points (const CoglMatrix *matrix,
  * |[
  * typedef struct {
  *   float x,y;
- *   guint8 r,g,b,a;
+ *   uint8_t r,g,b,a;
  *   float s,t,p;
  * } MyInVertex;
  * typedef struct {
- *   guint8 r,g,b,a;
+ *   uint8_t r,g,b,a;
  *   float x,y,z;
  * } MyOutVertex;
  * MyInVertex vertices[N_VERTICES];
@@ -684,7 +684,7 @@ cogl_matrix_project_points (const CoglMatrix *matrix,
  * Returns: %TRUE if @matrix is an identity matrix else %FALSE
  * Since: 1.8
  */
-gboolean
+CoglBool
 cogl_matrix_is_identity (const CoglMatrix *matrix);
 
 /**
diff --git a/cogl/cogl-meta-texture.c b/cogl/cogl-meta-texture.c
index f77a6c6..e192a0a 100644
--- a/cogl/cogl-meta-texture.c
+++ b/cogl/cogl-meta-texture.c
@@ -223,8 +223,8 @@ typedef struct _ClampData
 {
   float start;
   float end;
-  gboolean s_flipped;
-  gboolean t_flipped;
+  CoglBool s_flipped;
+  CoglBool t_flipped;
   CoglMetaTextureCallback callback;
   void *user_data;
 } ClampData;
@@ -273,7 +273,7 @@ clamp_t_cb (CoglTexture *sub_texture,
                         clamp_data->user_data);
 }
 
-static gboolean
+static CoglBool
 foreach_clamped_region (CoglMetaTexture *meta_texture,
                         float *tx_1,
                         float *ty_1,
@@ -513,7 +513,7 @@ cogl_meta_texture_foreach_in_region (CoglMetaTexture *meta_texture,
   if (wrap_s == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE ||
       wrap_t == COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE)
     {
-      gboolean finished = foreach_clamped_region (meta_texture,
+      CoglBool finished = foreach_clamped_region (meta_texture,
                                                   &tx_1, &ty_1, &tx_2, &ty_2,
                                                   wrap_s, wrap_t,
                                                   callback,
diff --git a/cogl/cogl-node-private.h b/cogl/cogl-node-private.h
index 71f1806..f1b505c 100644
--- a/cogl/cogl-node-private.h
+++ b/cogl/cogl-node-private.h
@@ -56,7 +56,7 @@ struct _CoglNode
 
   /* TRUE if the node took a strong reference on its parent. Weak
    * pipelines for instance don't take a reference on their parent. */
-  gboolean has_parent_reference;
+  CoglBool has_parent_reference;
 };
 
 #define COGL_NODE(X) ((CoglNode *)(X))
@@ -70,12 +70,12 @@ void
 _cogl_pipeline_node_set_parent_real (CoglNode *node,
                                      CoglNode *parent,
                                      CoglNodeUnparentVFunc unparent,
-                                     gboolean take_strong_reference);
+                                     CoglBool take_strong_reference);
 
 void
 _cogl_pipeline_node_unparent_real (CoglNode *node);
 
-typedef gboolean (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
+typedef CoglBool (*CoglNodeChildCallback) (CoglNode *child, void *user_data);
 
 void
 _cogl_pipeline_node_foreach_child (CoglNode *node,
diff --git a/cogl/cogl-node.c b/cogl/cogl-node.c
index 3d7909e..ab32e28 100644
--- a/cogl/cogl-node.c
+++ b/cogl/cogl-node.c
@@ -43,7 +43,7 @@ void
 _cogl_pipeline_node_set_parent_real (CoglNode *node,
                                      CoglNode *parent,
                                      CoglNodeUnparentVFunc unparent,
-                                     gboolean take_strong_reference)
+                                     CoglBool take_strong_reference)
 {
   /* NB: the old parent may indirectly be keeping the new parent alive
    * so we have to ref the new parent before unrefing the old.
diff --git a/cogl/cogl-object-private.h b/cogl/cogl-object-private.h
index 1d593d5..82fc06c 100644
--- a/cogl/cogl-object-private.h
+++ b/cogl/cogl-object-private.h
@@ -182,7 +182,7 @@ _cogl_##type_name##_object_new (Cogl##TypeName *new_obj)                \
                                                                         \
 COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code)          \
                                                                         \
-gboolean                                                                \
+CoglBool                                                                \
 cogl_is_##type_name (void *object)                                      \
 {                                                                       \
   CoglObject *obj = object;                                             \
@@ -197,7 +197,7 @@ cogl_is_##type_name (void *object)                                      \
                                                                         \
 COGL_OBJECT_COMMON_DEFINE_WITH_CODE(TypeName, type_name, code)          \
                                                                         \
-gboolean                                                                \
+CoglBool                                                                \
 _cogl_is_##type_name (void *object)                                     \
 {                                                                       \
   CoglObject *obj = object;                                             \
diff --git a/cogl/cogl-offscreen.h b/cogl/cogl-offscreen.h
index 47298bd..afb920b 100644
--- a/cogl/cogl-offscreen.h
+++ b/cogl/cogl-offscreen.h
@@ -79,7 +79,7 @@ cogl_offscreen_new_to_texture (CoglTexture *texture);
  * Returns: %TRUE if @object is a #CoglOffscreen framebuffer,
  *          %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_offscreen (void *object);
 
 #ifndef COGL_DISABLE_DEPRECATED
diff --git a/cogl/cogl-onscreen-private.h b/cogl/cogl-onscreen-private.h
index a1322fd..08774db 100644
--- a/cogl/cogl-onscreen-private.h
+++ b/cogl/cogl-onscreen-private.h
@@ -51,7 +51,7 @@ struct _CoglOnscreen
   CoglFramebuffer  _parent;
 
 #ifdef COGL_HAS_X11_SUPPORT
-  guint32 foreign_xid;
+  uint32_t foreign_xid;
   CoglOnscreenX11MaskCallback foreign_update_mask_callback;
   void *foreign_update_mask_data;
 #endif
@@ -60,7 +60,7 @@ struct _CoglOnscreen
   HWND foreign_hwnd;
 #endif
 
-  gboolean swap_throttled;
+  CoglBool swap_throttled;
 
   CoglSwapBuffersNotifyList swap_callbacks;
 
diff --git a/cogl/cogl-onscreen-template.c b/cogl/cogl-onscreen-template.c
index 6aa1d10..1ce8b97 100644
--- a/cogl/cogl-onscreen-template.c
+++ b/cogl/cogl-onscreen-template.c
@@ -83,7 +83,7 @@ cogl_onscreen_template_set_samples_per_pixel (
 void
 cogl_onscreen_template_set_swap_throttled (
                                           CoglOnscreenTemplate *onscreen_template,
-                                          gboolean throttled)
+                                          CoglBool throttled)
 {
   onscreen_template->config.swap_throttled = throttled;
 }
diff --git a/cogl/cogl-onscreen-template.h b/cogl/cogl-onscreen-template.h
index 64d9b74..948eaa1 100644
--- a/cogl/cogl-onscreen-template.h
+++ b/cogl/cogl-onscreen-template.h
@@ -86,7 +86,7 @@ cogl_onscreen_template_set_samples_per_pixel (
 void
 cogl_onscreen_template_set_swap_throttled (
                                           CoglOnscreenTemplate *onscreen_template,
-                                          gboolean throttled);
+                                          CoglBool throttled);
 
 /**
  * cogl_is_onscreen_template:
@@ -99,7 +99,7 @@ cogl_onscreen_template_set_swap_throttled (
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_onscreen_template (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-onscreen.c b/cogl/cogl-onscreen.c
index 142639a..242754c 100644
--- a/cogl/cogl-onscreen.c
+++ b/cogl/cogl-onscreen.c
@@ -176,7 +176,7 @@ cogl_onscreen_swap_region (CoglOnscreen *onscreen,
 #ifdef COGL_HAS_X11_SUPPORT
 void
 cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
-                                          guint32 xid,
+                                          uint32_t xid,
                                           CoglOnscreenX11MaskCallback update,
                                           void *user_data)
 {
@@ -189,7 +189,7 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
   onscreen->foreign_update_mask_data = user_data;
 }
 
-guint32
+uint32_t
 cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
@@ -207,19 +207,19 @@ cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen)
     }
 }
 
-guint32
+uint32_t
 cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen)
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   const CoglWinsysVtable *winsys = _cogl_framebuffer_get_winsys (framebuffer);
   XVisualInfo *visinfo;
-  guint32 id;
+  uint32_t id;
 
   /* This should only be called for xlib based onscreens */
   _COGL_RETURN_VAL_IF_FAIL (winsys->xlib_get_visual_info != NULL, 0);
 
   visinfo = winsys->xlib_get_visual_info ();
-  id = (guint32)visinfo->visualid;
+  id = (uint32_t)visinfo->visualid;
 
   XFree (visinfo);
   return id;
@@ -291,7 +291,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
 
 void
 cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
-                                  gboolean throttled)
+                                  CoglBool throttled)
 {
   CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
   framebuffer->config.swap_throttled = throttled;
diff --git a/cogl/cogl-onscreen.h b/cogl/cogl-onscreen.h
index 9d150b2..339bdf3 100644
--- a/cogl/cogl-onscreen.h
+++ b/cogl/cogl-onscreen.h
@@ -60,7 +60,7 @@ cogl_onscreen_new (CoglContext *context, int width, int height);
 
 #ifdef COGL_HAS_X11
 typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
-                                             guint32 event_mask,
+                                             uint32_t event_mask,
                                              void *user_data);
 
 /**
@@ -88,7 +88,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
  * [{
  * static void
  * my_update_cogl_x11_event_mask (CoglOnscreen *onscreen,
- *                                guint32 event_mask,
+ *                                uint32_t event_mask,
  *                                void *user_data)
  * {
  *   XSetWindowAttributes attrs;
@@ -115,7 +115,7 @@ typedef void (*CoglOnscreenX11MaskCallback) (CoglOnscreen *onscreen,
  */
 void
 cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
-                                          guint32 xid,
+                                          uint32_t xid,
                                           CoglOnscreenX11MaskCallback update,
                                           void *user_data);
 
@@ -136,12 +136,12 @@ cogl_x11_onscreen_set_foreign_window_xid (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-guint32
+uint32_t
 cogl_x11_onscreen_get_window_xid (CoglOnscreen *onscreen);
 
 /* XXX: we should maybe remove this, since nothing currently uses
  * it and the current implementation looks dubious. */
-guint32
+uint32_t
 cogl_x11_onscreen_get_visual_xid (CoglOnscreen *onscreen);
 #endif /* COGL_HAS_X11 */
 
@@ -237,7 +237,7 @@ cogl_wayland_onscreen_resize (CoglOnscreen *onscreen,
  */
 void
 cogl_onscreen_set_swap_throttled (CoglOnscreen *onscreen,
-                                  gboolean throttled);
+                                  CoglBool throttled);
 
 /**
  * cogl_onscreen_show:
@@ -391,7 +391,7 @@ cogl_onscreen_remove_swap_buffers_callback (CoglOnscreen *onscreen,
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_onscreen (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-path-functions.h b/cogl/cogl-path-functions.h
index 2566fe1..a443745 100644
--- a/cogl/cogl-path-functions.h
+++ b/cogl/cogl-path-functions.h
@@ -45,7 +45,7 @@ G_BEGIN_DECLS
  * Return value: %TRUE if the handle references a #CoglPath,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_path (CoglHandle handle);
 
 /**
diff --git a/cogl/cogl-path-private.h b/cogl/cogl-path-private.h
index c64aa4b..c7e94a8 100644
--- a/cogl/cogl-path-private.h
+++ b/cogl/cogl-path-private.h
@@ -97,13 +97,13 @@ struct _CoglPathData
      case and divert to the journal or a rectangle clip. If it is TRUE
      then the entire path can be described by calling
      _cogl_path_get_bounds */
-  gboolean             is_rectangle;
+  CoglBool             is_rectangle;
 };
 
 void
 _cogl_add_path_to_stencil_buffer (CoglPath  *path,
-                                  gboolean   merge,
-                                  gboolean   need_clear);
+                                  CoglBool   merge,
+                                  CoglBool   need_clear);
 
 void
 _cogl_path_get_bounds (CoglPath *path,
@@ -112,7 +112,7 @@ _cogl_path_get_bounds (CoglPath *path,
                        float *max_x,
                        float *max_y);
 
-gboolean
+CoglBool
 _cogl_path_is_rectangle (CoglPath *path);
 
 void
diff --git a/cogl/cogl-pipeline-cache.c b/cogl/cogl-pipeline-cache.c
index 5df18ce..eb2fe45 100644
--- a/cogl/cogl-pipeline-cache.c
+++ b/cogl/cogl-pipeline-cache.c
@@ -58,7 +58,7 @@ pipeline_fragment_hash (const void *data)
                               0);
 }
 
-static gboolean
+static CoglBool
 pipeline_fragment_equal (const void *a, const void *b)
 {
   unsigned int fragment_state;
@@ -89,7 +89,7 @@ pipeline_vertex_hash (const void *data)
                               0);
 }
 
-static gboolean
+static CoglBool
 pipeline_vertex_equal (const void *a, const void *b)
 {
   unsigned long vertex_state =
@@ -122,7 +122,7 @@ pipeline_combined_hash (const void *data)
                               0);
 }
 
-static gboolean
+static CoglBool
 pipeline_combined_equal (const void *a, const void *b)
 {
   unsigned int combined_state;
@@ -211,7 +211,7 @@ _cogl_pipeline_cache_get_fragment_template (CoglPipelineCache *cache,
 
       if (G_UNLIKELY (g_hash_table_size (cache->fragment_hash) > 50))
         {
-          static gboolean seen = FALSE;
+          static CoglBool seen = FALSE;
           if (!seen)
             g_warning ("Over 50 separate fragment shaders have been "
                        "generated which is very unusual, so something "
@@ -240,7 +240,7 @@ _cogl_pipeline_cache_get_vertex_template (CoglPipelineCache *cache,
 
       if (G_UNLIKELY (g_hash_table_size (cache->vertex_hash) > 50))
         {
-          static gboolean seen = FALSE;
+          static CoglBool seen = FALSE;
           if (!seen)
             g_warning ("Over 50 separate vertex shaders have been "
                        "generated which is very unusual, so something "
@@ -269,7 +269,7 @@ _cogl_pipeline_cache_get_combined_template (CoglPipelineCache *cache,
 
       if (G_UNLIKELY (g_hash_table_size (cache->combined_hash) > 50))
         {
-          static gboolean seen = FALSE;
+          static CoglBool seen = FALSE;
           if (!seen)
             g_warning ("Over 50 separate programs have been "
                        "generated which is very unusual, so something "
diff --git a/cogl/cogl-pipeline-debug.c b/cogl/cogl-pipeline-debug.c
index 00d03c6..cd31111 100644
--- a/cogl/cogl-pipeline-debug.c
+++ b/cogl/cogl-pipeline-debug.c
@@ -44,7 +44,7 @@ typedef struct
   int indent;
 } PrintDebugState;
 
-static gboolean
+static CoglBool
 dump_layer_cb (CoglNode *node, void *user_data)
 {
   CoglPipelineLayer *layer = COGL_PIPELINE_LAYER (node);
@@ -52,7 +52,7 @@ dump_layer_cb (CoglNode *node, void *user_data)
   int layer_id = *state->node_id_ptr;
   PrintDebugState state_out;
   GString *changes_label;
-  gboolean changes = FALSE;
+  CoglBool changes = FALSE;
 
   if (state->parent_id >= 0)
     g_string_append_printf (state->graph, "%*slayer%p -> layer%p;\n",
@@ -117,7 +117,7 @@ dump_layer_cb (CoglNode *node, void *user_data)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
 {
   PrintDebugState *state = data;
@@ -132,7 +132,7 @@ dump_layer_ref_cb (CoglPipelineLayer *layer, void *data)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 dump_pipeline_cb (CoglNode *node, void *user_data)
 {
   CoglPipeline *pipeline = COGL_PIPELINE (node);
@@ -140,8 +140,8 @@ dump_pipeline_cb (CoglNode *node, void *user_data)
   int pipeline_id = *state->node_id_ptr;
   PrintDebugState state_out;
   GString *changes_label;
-  gboolean changes = FALSE;
-  gboolean layers = FALSE;
+  CoglBool changes = FALSE;
+  CoglBool layers = FALSE;
 
   if (state->parent_id >= 0)
     g_string_append_printf (state->graph, "%*spipeline%d -> pipeline%d;\n",
diff --git a/cogl/cogl-pipeline-fragend-arbfp.c b/cogl/cogl-pipeline-fragend-arbfp.c
index e8b01e0..7b27a01 100644
--- a/cogl/cogl-pipeline-fragend-arbfp.c
+++ b/cogl/cogl-pipeline-fragend-arbfp.c
@@ -155,7 +155,7 @@ dirty_shader_state (CoglPipeline *pipeline)
                              NULL);
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_arbfp_start (CoglPipeline *pipeline,
                                     int n_layers,
                                     unsigned long pipelines_difference,
@@ -441,7 +441,7 @@ setup_arg (CoglPipeline *pipeline,
 
         if (other_layer == NULL)
           {
-            static gboolean warning_seen = FALSE;
+            static CoglBool warning_seen = FALSE;
             if (!warning_seen)
               {
                 g_warning ("The application is trying to use a texture "
@@ -510,7 +510,7 @@ setup_arg (CoglPipeline *pipeline,
     }
 }
 
-static gboolean
+static CoglBool
 fragend_arbfp_args_equal (CoglPipelineFragendARBfpArg *arg0,
                           CoglPipelineFragendARBfpArg *arg1)
 {
@@ -708,7 +708,7 @@ append_masked_combine (CoglPipeline *arbfp_authority,
                    n_args);
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
                                         unsigned long layers_difference)
@@ -792,7 +792,7 @@ _cogl_pipeline_fragend_arbfp_add_layer (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
 {
   CoglPipelineShaderState *shader_state = get_shader_state (pipeline);
@@ -808,11 +808,11 @@ _cogl_pipeline_fragend_arbfp_passthrough (CoglPipeline *pipeline)
 typedef struct _UpdateConstantsState
 {
   int unit;
-  gboolean update_all;
+  CoglBool update_all;
   CoglPipelineShaderState *shader_state;
 } UpdateConstantsState;
 
-static gboolean
+static CoglBool
 update_constants_cb (CoglPipeline *pipeline,
                      int layer_index,
                      void *user_data)
@@ -838,7 +838,7 @@ update_constants_cb (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
                                   unsigned long pipelines_difference)
 {
@@ -917,7 +917,7 @@ _cogl_pipeline_fragend_arbfp_end (CoglPipeline *pipeline,
   else
     {
       CoglProgram *program = shader_state->user_program;
-      gboolean program_changed;
+      CoglBool program_changed;
 
       /* If the shader has changed since it was last flushed then we
          need to update all uniforms */
diff --git a/cogl/cogl-pipeline-fragend-fixed.c b/cogl/cogl-pipeline-fragend-fixed.c
index d4a0fb6..bc2a4b4 100644
--- a/cogl/cogl-pipeline-fragend-fixed.c
+++ b/cogl/cogl-pipeline-fragend-fixed.c
@@ -89,7 +89,7 @@ get_max_texture_units (void)
   return ctx->max_texture_units;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_fixed_start (CoglPipeline *pipeline,
                                     int n_layers,
                                     unsigned long pipelines_difference,
@@ -161,7 +161,7 @@ translate_sources (CoglPipeline *pipeline,
 
           if (layer == NULL)
             {
-              static gboolean warning_seen = FALSE;
+              static CoglBool warning_seen = FALSE;
               if (!warning_seen)
                 {
                   g_warning ("The application is trying to use a texture "
@@ -177,7 +177,7 @@ translate_sources (CoglPipeline *pipeline,
       }
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
                                         unsigned long layers_difference)
@@ -357,7 +357,7 @@ _cogl_pipeline_fragend_fixed_add_layer (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 get_highest_unit_index_cb (CoglPipelineLayer *layer,
                            void *user_data)
 {
@@ -369,7 +369,7 @@ get_highest_unit_index_cb (CoglPipelineLayer *layer,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_fixed_end (CoglPipeline *pipeline,
                                   unsigned long pipelines_difference)
 {
diff --git a/cogl/cogl-pipeline-fragend-glsl.c b/cogl/cogl-pipeline-fragend-glsl.c
index 5692bda..6264f9b 100644
--- a/cogl/cogl-pipeline-fragend-glsl.c
+++ b/cogl/cogl-pipeline-fragend-glsl.c
@@ -200,7 +200,7 @@ get_layer_fragment_snippets (CoglPipelineLayer *layer)
   return &layer->big_state->fragment_snippets;
 }
 
-static gboolean
+static CoglBool
 has_replace_hook (CoglPipelineLayer *layer,
                   CoglSnippetHook hook)
 {
@@ -213,7 +213,7 @@ has_replace_hook (CoglPipelineLayer *layer,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_glsl_start (CoglPipeline *pipeline,
                                    int n_layers,
                                    unsigned long pipelines_difference,
@@ -581,7 +581,7 @@ add_arg (CoglPipelineShaderState *shader_state,
 
         if (other_layer == NULL)
           {
-            static gboolean warning_seen = FALSE;
+            static CoglBool warning_seen = FALSE;
             if (!warning_seen)
               {
                 g_warning ("The application is trying to use a texture "
@@ -905,7 +905,7 @@ ensure_layer_generated (CoglPipeline *pipeline,
   g_slice_free (LayerData, layer_data);
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_glsl_add_layer (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
                                         unsigned long layers_difference)
@@ -998,7 +998,7 @@ add_alpha_test_snippet (CoglPipeline *pipeline,
 
 #endif /*  HAVE_COGL_GLES2 */
 
-static gboolean
+static CoglBool
 _cogl_pipeline_fragend_glsl_end (CoglPipeline *pipeline,
                                  unsigned long pipelines_difference)
 {
diff --git a/cogl/cogl-pipeline-layer-private.h b/cogl/cogl-pipeline-layer-private.h
index 6925b40..b672473 100644
--- a/cogl/cogl-pipeline-layer-private.h
+++ b/cogl/cogl-pipeline-layer-private.h
@@ -187,7 +187,7 @@ typedef struct
   /* The texture matrix dscribes how to transform texture coordinates */
   CoglMatrix matrix;
 
-  gboolean point_sprite_coords;
+  CoglBool point_sprite_coords;
 
   CoglPipelineSnippetList vertex_snippets;
   CoglPipelineSnippetList fragment_snippets;
@@ -262,7 +262,7 @@ struct _CoglPipelineLayer
 
 };
 
-typedef gboolean
+typedef CoglBool
 (*CoglPipelineLayerStateComparitor) (CoglPipelineLayer *authority0,
                                      CoglPipelineLayer *authority1);
 
@@ -286,7 +286,7 @@ _cogl_pipeline_layer_resolve_authorities (CoglPipelineLayer *layer,
                                           unsigned long differences,
                                           CoglPipelineLayer **authorities);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_equal (CoglPipelineLayer *layer0,
                             CoglPipelineLayer *layer1,
                             unsigned long differences_mask,
@@ -300,10 +300,10 @@ _cogl_pipeline_layer_pre_change_notify (CoglPipeline *required_owner,
 void
 _cogl_pipeline_layer_prune_redundant_ancestry (CoglPipelineLayer *layer);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_has_user_matrix (CoglPipeline *pipeline,
                                       int layer_index);
 
@@ -380,7 +380,7 @@ _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer);
 int
 _cogl_pipeline_layer_get_unit_index (CoglPipelineLayer *layer);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_needs_combine_separate
                                        (CoglPipelineLayer *combine_authority);
 
diff --git a/cogl/cogl-pipeline-layer-state-private.h b/cogl/cogl-pipeline-layer-state-private.h
index 32fced8..db3ae81 100644
--- a/cogl/cogl-pipeline-layer-state-private.h
+++ b/cogl/cogl-pipeline-layer-state-private.h
@@ -44,41 +44,41 @@ CoglPipelineFilter
 _cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
                                      int layer_index);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0,
                                          CoglPipelineLayer *authority1,
                                          CoglPipelineEvalFlags flags);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0,
                                          CoglPipelineLayer *authority1,
                                          CoglPipelineEvalFlags flags);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0,
                                           CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0,
                                              CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0,
                                     CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0,
                                         CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0,
                                                 CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0,
                                             CoglPipelineLayer *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_fragment_snippets_equal (CoglPipelineLayer *authority0,
                                               CoglPipelineLayer *authority1);
 
diff --git a/cogl/cogl-pipeline-layer-state.c b/cogl/cogl-pipeline-layer-state.c
index 60cf006..19bece5 100644
--- a/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl-pipeline-layer-state.c
@@ -730,10 +730,10 @@ _cogl_pipeline_layer_get_wrap_modes (CoglPipelineLayer *layer,
   *wrap_mode_p = authority->sampler_cache_entry->wrap_mode_p;
 }
 
-gboolean
+CoglBool
 cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int layer_index,
-                                                     gboolean enable,
+                                                     CoglBool enable,
                                                      GError **error)
 {
   CoglPipelineLayerState       change =
@@ -758,7 +758,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
         }
       else
         {
-          static gboolean warning_seen = FALSE;
+          static CoglBool warning_seen = FALSE;
           if (!warning_seen)
             g_warning ("Point sprite texture coordinates are enabled "
                        "for a layer but the GL driver does not support it.");
@@ -827,7 +827,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
   return TRUE;
 }
 
-gboolean
+CoglBool
 cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int layer_index)
 {
@@ -943,7 +943,7 @@ cogl_pipeline_add_layer_snippet (CoglPipeline *pipeline,
                                                snippet);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0,
                                          CoglPipelineLayer *authority1,
                                          CoglPipelineEvalFlags flags)
@@ -951,7 +951,7 @@ _cogl_pipeline_layer_texture_type_equal (CoglPipelineLayer *authority0,
   return authority0->texture_type == authority1->texture_type;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0,
                                          CoglPipelineLayer *authority1,
                                          CoglPipelineEvalFlags flags)
@@ -977,7 +977,7 @@ _cogl_pipeline_layer_texture_data_equal (CoglPipelineLayer *authority0,
     }
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0,
                                           CoglPipelineLayer *authority1)
 {
@@ -1019,7 +1019,7 @@ _cogl_pipeline_layer_combine_state_equal (CoglPipelineLayer *authority0,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0,
                                              CoglPipelineLayer *authority1)
 {
@@ -1028,7 +1028,7 @@ _cogl_pipeline_layer_combine_constant_equal (CoglPipelineLayer *authority0,
                  sizeof (float) * 4) == 0 ? TRUE : FALSE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0,
                                     CoglPipelineLayer *authority1)
 {
@@ -1039,7 +1039,7 @@ _cogl_pipeline_layer_sampler_equal (CoglPipelineLayer *authority0,
           authority1->sampler_cache_entry->sampler_object);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0,
                                         CoglPipelineLayer *authority1)
 {
@@ -1052,7 +1052,7 @@ _cogl_pipeline_layer_user_matrix_equal (CoglPipelineLayer *authority0,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0,
                                                 CoglPipelineLayer *authority1)
 {
@@ -1062,7 +1062,7 @@ _cogl_pipeline_layer_point_sprite_coords_equal (CoglPipelineLayer *authority0,
   return big_state0->point_sprite_coords == big_state1->point_sprite_coords;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0,
                                             CoglPipelineLayer *authority1)
 {
@@ -1072,7 +1072,7 @@ _cogl_pipeline_layer_vertex_snippets_equal (CoglPipelineLayer *authority0,
                                             vertex_snippets);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_fragment_snippets_equal (CoglPipelineLayer *authority0,
                                               CoglPipelineLayer *authority1)
 {
@@ -1164,7 +1164,7 @@ setup_texture_combine_state (CoglBlendStringStatement *statement,
     }
 }
 
-gboolean
+CoglBool
 cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
 				 int layer_index,
 				 const char *combine_description,
@@ -1485,7 +1485,7 @@ _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer)
   return _cogl_pipeline_layer_get_texture_real (layer);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_has_user_matrix (CoglPipeline *pipeline,
                                       int layer_index)
 {
@@ -1729,7 +1729,7 @@ _cogl_pipeline_layer_hash_combine_constant_state (CoglPipelineLayer *authority,
                                                   CoglPipelineHashState *state)
 {
   CoglPipelineLayerBigState *b = authority->big_state;
-  gboolean need_hash = FALSE;
+  CoglBool need_hash = FALSE;
   int n_args;
   int i;
 
diff --git a/cogl/cogl-pipeline-layer-state.h b/cogl/cogl-pipeline-layer-state.h
index c143fa1..b808fa3 100644
--- a/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl-pipeline-layer-state.h
@@ -295,7 +295,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_pipeline_set_layer_combine (CoglPipeline *pipeline,
 				 int           layer_index,
 				 const char   *blend_string,
@@ -433,10 +433,10 @@ cogl_pipeline_get_layer_mag_filter (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int           layer_index,
-                                                     gboolean      enable,
+                                                     CoglBool      enable,
                                                      GError      **error);
 
 /**
@@ -453,7 +453,7 @@ cogl_pipeline_set_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_pipeline_get_layer_point_sprite_coords_enabled (CoglPipeline *pipeline,
                                                      int           layer_index);
 
diff --git a/cogl/cogl-pipeline-layer.c b/cogl/cogl-pipeline-layer.c
index 9093a04..18f46f9 100644
--- a/cogl/cogl-pipeline-layer.c
+++ b/cogl/cogl-pipeline-layer.c
@@ -70,7 +70,7 @@ _cogl_pipeline_layer_get_unit_index (CoglPipelineLayer *layer)
   return authority->unit_index;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_has_alpha (CoglPipelineLayer *layer)
 {
   CoglPipelineLayer *combine_authority =
@@ -466,7 +466,7 @@ _cogl_pipeline_layer_compare_differences (CoglPipelineLayer *layer0,
   return layers_difference;
 }
 
-static gboolean
+static CoglBool
 layer_state_equal (CoglPipelineLayerStateIndex state_index,
                    CoglPipelineLayer **authorities0,
                    CoglPipelineLayer **authorities1,
@@ -510,7 +510,7 @@ _cogl_pipeline_layer_resolve_authorities (CoglPipelineLayer *layer,
   g_assert (remaining == 0);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_layer_equal (CoglPipelineLayer *layer0,
                             CoglPipelineLayer *layer1,
                             unsigned long differences_mask,
@@ -741,7 +741,7 @@ _cogl_pipeline_layer_pre_paint (CoglPipelineLayer *layer)
  * separately or is the same function used for both channel masks and
  * with the same arguments...
  */
-gboolean
+CoglBool
 _cogl_pipeline_layer_needs_combine_separate
                                        (CoglPipelineLayer *combine_authority)
 {
diff --git a/cogl/cogl-pipeline-opengl-private.h b/cogl/cogl-pipeline-opengl-private.h
index 882d4fb..5742b4a 100644
--- a/cogl/cogl-pipeline-opengl-private.h
+++ b/cogl/cogl-pipeline-opengl-private.h
@@ -70,7 +70,7 @@ typedef struct _CoglTextureUnit
    * asked to glBindTexture we can't try and optimize a redundant state
    * change because we don't know if the original texture name was deleted
    * and now we are being asked to bind a recycled name. */
-  gboolean           is_foreign;
+  CoglBool           is_foreign;
 
   /* We have many components in Cogl that need to temporarily bind arbitrary
    * textures e.g. to query texture object parameters and since we don't
@@ -83,7 +83,7 @@ typedef struct _CoglTextureUnit
    * of always using texture unit 1 for these transient bindings so we
    * can assume this is only ever TRUE for unit 1.
    */
-  gboolean           dirty_gl_texture;
+  CoglBool           dirty_gl_texture;
 
   /* A matrix stack giving us the means to associate a texture
    * transform matrix with the texture unit. */
@@ -120,7 +120,7 @@ typedef struct _CoglTextureUnit
    * too. When we later come to flush some pipeline state then we will
    * always check this to potentially force an update of the texture
    * state even if the pipeline hasn't changed. */
-  gboolean           texture_storage_changed;
+  CoglBool           texture_storage_changed;
 
 } CoglTextureUnit;
 
@@ -136,14 +136,14 @@ _cogl_set_active_texture_unit (int unit_index);
 void
 _cogl_bind_gl_texture_transient (GLenum gl_target,
                                  GLuint gl_texture,
-                                 gboolean is_foreign);
+                                 CoglBool is_foreign);
 
 void
 _cogl_delete_gl_texture (GLuint gl_texture);
 
 void
 _cogl_pipeline_flush_gl_state (CoglPipeline *pipeline,
-                               gboolean skip_gl_state,
+                               CoglBool skip_gl_state,
                                int n_tex_coord_attribs);
 
 #endif /* __COGL_PIPELINE_OPENGL_PRIVATE_H */
diff --git a/cogl/cogl-pipeline-opengl.c b/cogl/cogl-pipeline-opengl.c
index d7e7434..d947a53 100644
--- a/cogl/cogl-pipeline-opengl.c
+++ b/cogl/cogl-pipeline-opengl.c
@@ -158,7 +158,7 @@ _cogl_set_active_texture_unit (int unit_index)
 void
 _cogl_bind_gl_texture_transient (GLenum gl_target,
                                  GLuint gl_texture,
-                                 gboolean is_foreign)
+                                 CoglBool is_foreign)
 {
   CoglTextureUnit *unit;
 
@@ -389,7 +389,7 @@ _cogl_use_vertex_program (GLuint gl_program, CoglPipelineProgramType type)
 
 #if defined(HAVE_COGL_GLES2) || defined(HAVE_COGL_GL)
 
-static gboolean
+static CoglBool
 blend_factor_uses_constant (GLenum blend_factor)
 {
   return (blend_factor == GL_CONSTANT_COLOR ||
@@ -438,7 +438,7 @@ static void
 _cogl_pipeline_flush_color_blend_alpha_depth_state (
                                             CoglPipeline *pipeline,
                                             unsigned long pipelines_difference,
-                                            gboolean      skip_gl_color)
+                                            CoglBool      skip_gl_color)
 {
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -615,7 +615,7 @@ _cogl_pipeline_flush_color_blend_alpha_depth_state (
         GE( ctx, glDisable (GL_CULL_FACE) );
       else
         {
-          gboolean invert_winding;
+          CoglBool invert_winding;
 
           GE( ctx, glEnable (GL_CULL_FACE) );
 
@@ -747,7 +747,7 @@ typedef struct
   unsigned long *layer_differences;
 } CoglPipelineFlushLayerState;
 
-static gboolean
+static CoglBool
 flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglPipelineFlushLayerState *flush_state = user_data;
@@ -763,7 +763,7 @@ flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
    */
   if (G_UNLIKELY (unit_index >= get_max_activateable_texture_units ()))
     {
-      static gboolean shown_warning = FALSE;
+      static CoglBool shown_warning = FALSE;
 
       if (!shown_warning)
         {
@@ -888,7 +888,7 @@ static void
 _cogl_pipeline_flush_common_gl_state (CoglPipeline  *pipeline,
                                       unsigned long  pipelines_difference,
                                       unsigned long *layer_differences,
-                                      gboolean       skip_gl_color)
+                                      CoglBool       skip_gl_color)
 {
   CoglPipelineFlushLayerState state;
 
@@ -1003,7 +1003,7 @@ typedef struct
   unsigned long *layer_differences;
 } CoglPipelineCompareLayersState;
 
-static gboolean
+static CoglBool
 compare_layer_differences_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglPipelineCompareLayersState *state = user_data;
@@ -1042,12 +1042,12 @@ typedef struct
   const CoglPipelineFragend *fragend;
   CoglPipeline *pipeline;
   unsigned long *layer_differences;
-  gboolean error_adding_layer;
-  gboolean added_layer;
+  CoglBool error_adding_layer;
+  CoglBool added_layer;
 } CoglPipelineFragendAddLayerState;
 
 
-static gboolean
+static CoglBool
 fragend_add_layer_cb (CoglPipelineLayer *layer,
                       void *user_data)
 {
@@ -1078,12 +1078,12 @@ typedef struct
   const CoglPipelineVertend *vertend;
   CoglPipeline *pipeline;
   unsigned long *layer_differences;
-  gboolean error_adding_layer;
-  gboolean added_layer;
+  CoglBool error_adding_layer;
+  CoglBool added_layer;
 } CoglPipelineVertendAddLayerState;
 
 
-static gboolean
+static CoglBool
 vertend_add_layer_cb (CoglPipelineLayer *layer,
                       void *user_data)
 {
@@ -1161,7 +1161,7 @@ vertend_add_layer_cb (CoglPipelineLayer *layer,
  */
 void
 _cogl_pipeline_flush_gl_state (CoglPipeline *pipeline,
-                               gboolean skip_gl_color,
+                               CoglBool skip_gl_color,
                                int n_tex_coord_attribs)
 {
   unsigned long    pipelines_difference;
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h
index b88e401..a7f677d 100644
--- a/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl-pipeline-private.h
@@ -348,7 +348,7 @@ typedef struct
 
 typedef struct
 {
-  gboolean        enabled;
+  CoglBool        enabled;
   CoglColor       color;
   CoglFogMode     mode;
   float           density;
@@ -555,15 +555,15 @@ struct _CoglPipeline
 
 typedef struct _CoglPipelineFragend
 {
-  gboolean (*start) (CoglPipeline *pipeline,
+  CoglBool (*start) (CoglPipeline *pipeline,
                      int n_layers,
                      unsigned long pipelines_difference,
                      int n_tex_coord_attribs);
-  gboolean (*add_layer) (CoglPipeline *pipeline,
+  CoglBool (*add_layer) (CoglPipeline *pipeline,
                          CoglPipelineLayer *layer,
                          unsigned long layers_difference);
-  gboolean (*passthrough) (CoglPipeline *pipeline);
-  gboolean (*end) (CoglPipeline *pipeline,
+  CoglBool (*passthrough) (CoglPipeline *pipeline);
+  CoglBool (*end) (CoglPipeline *pipeline,
                    unsigned long pipelines_difference);
 
   void (*pipeline_pre_change_notify) (CoglPipeline *pipeline,
@@ -577,14 +577,14 @@ typedef struct _CoglPipelineFragend
 
 typedef struct _CoglPipelineVertend
 {
-  gboolean (*start) (CoglPipeline *pipeline,
+  CoglBool (*start) (CoglPipeline *pipeline,
                      int n_layers,
                      unsigned long pipelines_difference,
                      int n_tex_coord_attribs);
-  gboolean (*add_layer) (CoglPipeline *pipeline,
+  CoglBool (*add_layer) (CoglPipeline *pipeline,
                          CoglPipelineLayer *layer,
                          unsigned long layers_difference);
-  gboolean (*end) (CoglPipeline *pipeline,
+  CoglBool (*end) (CoglPipeline *pipeline,
                    unsigned long pipelines_difference);
 
   void (*pipeline_pre_change_notify) (CoglPipeline *pipeline,
@@ -646,7 +646,7 @@ _cogl_pipeline_get_authority (CoglPipeline *pipeline,
   return authority;
 }
 
-typedef gboolean (*CoglPipelineStateComparitor) (CoglPipeline *authority0,
+typedef CoglBool (*CoglPipelineStateComparitor) (CoglPipeline *authority0,
                                                  CoglPipeline *authority1);
 
 void
@@ -659,7 +659,7 @@ void
 _cogl_pipeline_pre_change_notify (CoglPipeline     *pipeline,
                                   CoglPipelineState change,
                                   const CoglColor  *new_color,
-                                  gboolean          from_layer_change);
+                                  CoglBool          from_layer_change);
 
 void
 _cogl_pipeline_prune_redundant_ancestry (CoglPipeline *pipeline);
@@ -680,7 +680,7 @@ _cogl_pipeline_get_layer_with_flags (CoglPipeline *pipeline,
 #define _cogl_pipeline_get_layer(p, l) \
   _cogl_pipeline_get_layer_with_flags (p, l, 0)
 
-gboolean
+CoglBool
 _cogl_is_pipeline_layer (void *object);
 
 void
@@ -698,7 +698,7 @@ _cogl_pipeline_prune_empty_layer_difference (CoglPipeline *layers_authority,
  * able to fill your geometry according to a given Cogl pipeline.
  */
 
-gboolean
+CoglBool
 _cogl_pipeline_get_real_blend_enabled (CoglPipeline *pipeline);
 
 /*
@@ -713,11 +713,11 @@ _cogl_pipeline_pre_paint_for_layer (CoglPipeline *pipeline,
 /*
  * CoglPipelineFlushFlag:
  * @COGL_PIPELINE_FLUSH_FALLBACK_MASK: The fallback_layers member is set to
- *      a guint32 mask of the layers that can't be supported with the user
+ *      a uint32_t mask of the layers that can't be supported with the user
  *      supplied texture and need to be replaced with fallback textures. (1 =
  *      fallback, and the least significant bit = layer 0)
  * @COGL_PIPELINE_FLUSH_DISABLE_MASK: The disable_layers member is set to
- *      a guint32 mask of the layers that you want to completly disable
+ *      a uint32_t mask of the layers that you want to completly disable
  *      texturing for (1 = fallback, and the least significant bit = layer 0)
  * @COGL_PIPELINE_FLUSH_LAYER0_OVERRIDE: The layer0_override_texture member is
  *      set to a GLuint OpenGL texture name to override the texture used for
@@ -742,11 +742,11 @@ typedef enum _CoglPipelineFlushFlag
  */
 typedef struct _CoglPipelineFlushOptions
 {
-  CoglPipelineFlushFlag         flags;
+  CoglPipelineFlushFlag flags;
 
-  guint32                       fallback_layers;
-  guint32                       disable_layers;
-  CoglTexture                  *layer0_override_texture;
+  uint32_t fallback_layers;
+  uint32_t disable_layers;
+  CoglTexture *layer0_override_texture;
 } CoglPipelineFlushOptions;
 
 void
@@ -892,7 +892,7 @@ _cogl_pipeline_get_parent (CoglPipeline *pipeline);
 
 void
 _cogl_pipeline_get_colorubv (CoglPipeline *pipeline,
-                             guint8       *color);
+                             uint8_t       *color);
 
 /* XXX: At some point it could be good for this to accept a mask of
  * the state groups we are interested in comparing since we can
@@ -902,7 +902,7 @@ unsigned long
 _cogl_pipeline_compare_differences (CoglPipeline *pipeline0,
                                     CoglPipeline *pipeline1);
 
-gboolean
+CoglBool
 _cogl_pipeline_equal (CoglPipeline *pipeline0,
                       CoglPipeline *pipeline1,
                       unsigned long differences,
@@ -942,7 +942,7 @@ void
 _cogl_pipeline_set_blend_enabled (CoglPipeline *pipeline,
                                   CoglPipelineBlendEnable enable);
 
-gboolean
+CoglBool
 _cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline);
 
 void
@@ -959,12 +959,12 @@ _cogl_pipeline_get_authority (CoglPipeline *pipeline,
 void
 _cogl_pipeline_add_layer_difference (CoglPipeline *pipeline,
                                      CoglPipelineLayer *layer,
-                                     gboolean inc_n_layers);
+                                     CoglBool inc_n_layers);
 
 void
 _cogl_pipeline_remove_layer_difference (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
-                                        gboolean dec_n_layers);
+                                        CoglBool dec_n_layers);
 
 CoglPipeline *
 _cogl_pipeline_find_equivalent_parent (CoglPipeline *pipeline,
@@ -987,7 +987,7 @@ _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n);
 const GList *
 _cogl_pipeline_get_layers (CoglPipeline *pipeline);
 
-typedef gboolean (*CoglPipelineInternalLayerCallback) (CoglPipelineLayer *layer,
+typedef CoglBool (*CoglPipelineInternalLayerCallback) (CoglPipelineLayer *layer,
                                                        void *user_data);
 
 void
@@ -995,7 +995,7 @@ _cogl_pipeline_foreach_layer_internal (CoglPipeline *pipeline,
                                        CoglPipelineInternalLayerCallback callback,
                                        void *user_data);
 
-gboolean
+CoglBool
 _cogl_pipeline_need_texture_combine_separate
                                     (CoglPipelineLayer *combine_authority);
 
diff --git a/cogl/cogl-pipeline-progend-glsl.c b/cogl/cogl-pipeline-progend-glsl.c
index d7561d9..f89e494 100644
--- a/cogl/cogl-pipeline-progend-glsl.c
+++ b/cogl/cogl-pipeline-progend-glsl.c
@@ -352,11 +352,11 @@ typedef struct
 {
   int unit;
   GLuint gl_program;
-  gboolean update_all;
+  CoglBool update_all;
   CoglPipelineProgramState *program_state;
 } UpdateUniformsState;
 
-static gboolean
+static CoglBool
 get_uniform_cb (CoglPipeline *pipeline,
                 int layer_index,
                 void *user_data)
@@ -415,7 +415,7 @@ get_uniform_cb (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 update_constants_cb (CoglPipeline *pipeline,
                      int layer_index,
                      void *user_data)
@@ -494,7 +494,7 @@ typedef struct
   int value_index;
 } FlushUniformsClosure;
 
-static gboolean
+static CoglBool
 flush_uniform_cb (int uniform_num, void *user_data)
 {
   FlushUniformsClosure *data = user_data;
@@ -557,7 +557,7 @@ _cogl_pipeline_progend_glsl_flush_uniforms (CoglPipeline *pipeline,
                                             CoglPipelineProgramState *
                                                                   program_state,
                                             GLuint gl_program,
-                                            gboolean program_changed)
+                                            CoglBool program_changed)
 {
   CoglPipelineUniformsState *uniforms_state;
   FlushUniformsClosure data;
@@ -652,7 +652,7 @@ _cogl_pipeline_progend_glsl_end (CoglPipeline *pipeline,
 {
   CoglPipelineProgramState *program_state;
   GLuint gl_program;
-  gboolean program_changed = FALSE;
+  CoglBool program_changed = FALSE;
   UpdateUniformsState state;
   CoglProgram *user_program;
   CoglPipeline *template_pipeline = NULL;
@@ -931,7 +931,7 @@ _cogl_pipeline_progend_glsl_layer_pre_change_notify (
 static void
 _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline)
 {
-  gboolean needs_flip;
+  CoglBool needs_flip;
   CoglMatrixStack *projection_stack;
   CoglMatrixStack *modelview_stack;
   CoglPipelineProgramState *program_state;
@@ -957,10 +957,10 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline)
 #ifdef HAVE_COGL_GLES2
   if (ctx->driver == COGL_DRIVER_GLES2)
     {
-      gboolean modelview_changed;
-      gboolean projection_changed;
-      gboolean need_modelview;
-      gboolean need_projection;
+      CoglBool modelview_changed;
+      CoglBool projection_changed;
+      CoglBool need_modelview;
+      CoglBool need_projection;
       CoglMatrix modelview, projection;
 
       projection_changed =
@@ -1050,7 +1050,7 @@ _cogl_pipeline_progend_glsl_pre_paint (CoglPipeline *pipeline)
   else
 #endif
     {
-      gboolean disable_flip;
+      CoglBool disable_flip;
 
       /* If there are vertex snippets, then we'll disable flipping the
          geometry via the matrix and use the flip vertex instead */
diff --git a/cogl/cogl-pipeline-snippet-private.h b/cogl/cogl-pipeline-snippet-private.h
index 823193e..bfc9d5d 100644
--- a/cogl/cogl-pipeline-snippet-private.h
+++ b/cogl/cogl-pipeline-snippet-private.h
@@ -72,7 +72,7 @@ typedef struct
      the return value. Instead it is expected that the snippet will
      modify one of the argument variables directly and that will be
      returned */
-  gboolean return_variable_is_argument;
+  CoglBool return_variable_is_argument;
 
   /* The argument names or NULL if there are none */
   const char *arguments;
@@ -102,7 +102,7 @@ void
 _cogl_pipeline_snippet_list_hash (CoglPipelineSnippetList *list,
                                   unsigned int *hash);
 
-gboolean
+CoglBool
 _cogl_pipeline_snippet_list_equal (CoglPipelineSnippetList *list0,
                                    CoglPipelineSnippetList *list1);
 
diff --git a/cogl/cogl-pipeline-snippet.c b/cogl/cogl-pipeline-snippet.c
index 2e37741..2d5e4c2 100644
--- a/cogl/cogl-pipeline-snippet.c
+++ b/cogl/cogl-pipeline-snippet.c
@@ -31,6 +31,7 @@
 
 #include <string.h>
 
+#include "cogl-types.h"
 #include "cogl-pipeline-snippet-private.h"
 #include "cogl-snippet-private.h"
 #include "cogl-util.h"
@@ -260,7 +261,7 @@ _cogl_pipeline_snippet_list_hash (CoglPipelineSnippetList *list,
     }
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_snippet_list_equal (CoglPipelineSnippetList *list0,
                                    CoglPipelineSnippetList *list1)
 {
diff --git a/cogl/cogl-pipeline-state-private.h b/cogl/cogl-pipeline-state-private.h
index 2bc162d..8068ce0 100644
--- a/cogl/cogl-pipeline-state-private.h
+++ b/cogl/cogl-pipeline-state-private.h
@@ -31,75 +31,75 @@
 CoglPipeline *
 _cogl_pipeline_get_user_program (CoglPipeline *pipeline);
 
-gboolean
+CoglBool
 _cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline);
 
-gboolean
+CoglBool
 _cogl_pipeline_has_fragment_snippets (CoglPipeline *pipeline);
 
-gboolean
+CoglBool
 _cogl_pipeline_has_non_layer_vertex_snippets (CoglPipeline *pipeline);
 
-gboolean
+CoglBool
 _cogl_pipeline_has_non_layer_fragment_snippets (CoglPipeline *pipeline);
 
 void
 _cogl_pipeline_set_fog_state (CoglPipeline *pipeline,
                               const CoglPipelineFogState *fog_state);
 
-gboolean
+CoglBool
 _cogl_pipeline_color_equal (CoglPipeline *authority0,
                             CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_lighting_state_equal (CoglPipeline *authority0,
                                      CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_alpha_func_state_equal (CoglPipeline *authority0,
                                        CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_alpha_func_reference_state_equal (CoglPipeline *authority0,
                                                  CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_blend_state_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_depth_state_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_fog_state_equal (CoglPipeline *authority0,
                                 CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_point_size_equal (CoglPipeline *authority0,
                                  CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_logic_ops_state_equal (CoglPipeline *authority0,
                                       CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_user_shader_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_cull_face_state_equal (CoglPipeline *authority0,
                                       CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_uniforms_state_equal (CoglPipeline *authority0,
                                      CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_vertex_snippets_state_equal (CoglPipeline *authority0,
                                             CoglPipeline *authority1);
 
-gboolean
+CoglBool
 _cogl_pipeline_fragment_snippets_state_equal (CoglPipeline *authority0,
                                               CoglPipeline *authority1);
 
diff --git a/cogl/cogl-pipeline-state.c b/cogl/cogl-pipeline-state.c
index 4b18d23..6b14f37 100644
--- a/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl-pipeline-state.c
@@ -56,14 +56,14 @@ _cogl_pipeline_get_user_program (CoglPipeline *pipeline)
   return authority->big_state->user_program;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_color_equal (CoglPipeline *authority0,
                             CoglPipeline *authority1)
 {
   return cogl_color_equal (&authority0->color, &authority1->color);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_lighting_state_equal (CoglPipeline *authority0,
                                      CoglPipeline *authority1)
 {
@@ -84,7 +84,7 @@ _cogl_pipeline_lighting_state_equal (CoglPipeline *authority0,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_alpha_func_state_equal (CoglPipeline *authority0,
                                        CoglPipeline *authority1)
 {
@@ -96,7 +96,7 @@ _cogl_pipeline_alpha_func_state_equal (CoglPipeline *authority0,
   return alpha_state0->alpha_func == alpha_state1->alpha_func;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_alpha_func_reference_state_equal (CoglPipeline *authority0,
                                                  CoglPipeline *authority1)
 {
@@ -109,7 +109,7 @@ _cogl_pipeline_alpha_func_reference_state_equal (CoglPipeline *authority0,
           alpha_state1->alpha_func_reference);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_blend_state_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1)
 {
@@ -156,7 +156,7 @@ _cogl_pipeline_blend_state_equal (CoglPipeline *authority0,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_depth_state_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1)
 {
@@ -175,7 +175,7 @@ _cogl_pipeline_depth_state_equal (CoglPipeline *authority0,
     }
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_fog_state_equal (CoglPipeline *authority0,
                                 CoglPipeline *authority1)
 {
@@ -193,14 +193,14 @@ _cogl_pipeline_fog_state_equal (CoglPipeline *authority0,
     return FALSE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_point_size_equal (CoglPipeline *authority0,
                                  CoglPipeline *authority1)
 {
   return authority0->big_state->point_size == authority1->big_state->point_size;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_logic_ops_state_equal (CoglPipeline *authority0,
                                       CoglPipeline *authority1)
 {
@@ -210,7 +210,7 @@ _cogl_pipeline_logic_ops_state_equal (CoglPipeline *authority0,
   return logic_ops_state0->color_mask == logic_ops_state1->color_mask;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_cull_face_state_equal (CoglPipeline *authority0,
                                       CoglPipeline *authority1)
 {
@@ -231,7 +231,7 @@ _cogl_pipeline_cull_face_state_equal (CoglPipeline *authority0,
           cull_face_state0->front_winding == cull_face_state1->front_winding);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_user_shader_equal (CoglPipeline *authority0,
                                   CoglPipeline *authority1)
 {
@@ -246,7 +246,7 @@ typedef struct
   int override_count;
 } GetUniformsClosure;
 
-static gboolean
+static CoglBool
 get_uniforms_cb (int uniform_num, void *user_data)
 {
   GetUniformsClosure *data = user_data;
@@ -291,7 +291,7 @@ _cogl_pipeline_get_all_uniform_values (CoglPipeline *pipeline,
   while (pipeline);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_uniforms_state_equal (CoglPipeline *authority0,
                                      CoglPipeline *authority1)
 {
@@ -341,7 +341,7 @@ _cogl_pipeline_uniforms_state_equal (CoglPipeline *authority0,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_vertex_snippets_state_equal (CoglPipeline *authority0,
                                             CoglPipeline *authority1)
 {
@@ -351,7 +351,7 @@ _cogl_pipeline_vertex_snippets_state_equal (CoglPipeline *authority0,
                                             vertex_snippets);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_fragment_snippets_state_equal (CoglPipeline *authority0,
                                               CoglPipeline *authority1)
 {
@@ -378,7 +378,7 @@ cogl_pipeline_get_color (CoglPipeline *pipeline,
 /* This is used heavily by the cogl journal when logging quads */
 void
 _cogl_pipeline_get_colorubv (CoglPipeline *pipeline,
-                             guint8       *color)
+                             uint8_t *color)
 {
   CoglPipeline *authority =
     _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_COLOR);
@@ -417,10 +417,10 @@ cogl_pipeline_set_color (CoglPipeline    *pipeline,
 
 void
 cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
-			    guint8 red,
-                            guint8 green,
-                            guint8 blue,
-                            guint8 alpha)
+			    uint8_t red,
+                            uint8_t green,
+                            uint8_t blue,
+                            uint8_t alpha)
 {
   CoglColor color;
   cogl_color_init_from_4ub (&color, red, green, blue, alpha);
@@ -451,7 +451,7 @@ _cogl_pipeline_get_blend_enabled (CoglPipeline *pipeline)
   return authority->blend_enable;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_blend_enable_equal (CoglPipeline *authority0,
                                    CoglPipeline *authority1)
 {
@@ -935,7 +935,7 @@ setup_blend_state (CoglBlendStringStatement *statement,
   *blend_dst_factor = arg_to_gl_blend_factor (&statement->args[1]);
 }
 
-gboolean
+CoglBool
 cogl_pipeline_set_blend (CoglPipeline *pipeline,
                          const char *blend_description,
                          GError **error)
@@ -1158,7 +1158,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
   _cogl_pipeline_update_blend_enable (pipeline, state);
 }
 
-gboolean
+CoglBool
 cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
                                const CoglDepthState *depth_state,
                                GError **error)
@@ -1556,7 +1556,7 @@ cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
                                   int uniform_location,
                                   int dimensions,
                                   int count,
-                                  gboolean transpose,
+                                  CoglBool transpose,
                                   const float *value)
 {
   CoglBoxedValue *boxed_value;
@@ -1618,7 +1618,7 @@ cogl_pipeline_add_snippet (CoglPipeline *pipeline,
     _cogl_pipeline_add_fragment_snippet (pipeline, snippet);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_has_non_layer_vertex_snippets (CoglPipeline *pipeline)
 {
   CoglPipeline *authority =
@@ -1628,14 +1628,14 @@ _cogl_pipeline_has_non_layer_vertex_snippets (CoglPipeline *pipeline)
   return !COGL_LIST_EMPTY (&authority->big_state->vertex_snippets);
 }
 
-static gboolean
+static CoglBool
 check_layer_has_vertex_snippet (CoglPipelineLayer *layer,
                                 void *user_data)
 {
   unsigned long state = COGL_PIPELINE_LAYER_STATE_VERTEX_SNIPPETS;
   CoglPipelineLayer *authority =
     _cogl_pipeline_layer_get_authority (layer, state);
-  gboolean *found_vertex_snippet = user_data;
+  CoglBool *found_vertex_snippet = user_data;
 
   if (!COGL_LIST_EMPTY (&authority->big_state->vertex_snippets))
     {
@@ -1646,10 +1646,10 @@ check_layer_has_vertex_snippet (CoglPipelineLayer *layer,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline)
 {
-  gboolean found_vertex_snippet = FALSE;
+  CoglBool found_vertex_snippet = FALSE;
 
   if (_cogl_pipeline_has_non_layer_vertex_snippets (pipeline))
     return TRUE;
@@ -1661,7 +1661,7 @@ _cogl_pipeline_has_vertex_snippets (CoglPipeline *pipeline)
   return found_vertex_snippet;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_has_non_layer_fragment_snippets (CoglPipeline *pipeline)
 {
   CoglPipeline *authority =
@@ -1671,14 +1671,14 @@ _cogl_pipeline_has_non_layer_fragment_snippets (CoglPipeline *pipeline)
   return !COGL_LIST_EMPTY (&authority->big_state->fragment_snippets);
 }
 
-static gboolean
+static CoglBool
 check_layer_has_fragment_snippet (CoglPipelineLayer *layer,
                                   void *user_data)
 {
   unsigned long state = COGL_PIPELINE_LAYER_STATE_FRAGMENT_SNIPPETS;
   CoglPipelineLayer *authority =
     _cogl_pipeline_layer_get_authority (layer, state);
-  gboolean *found_fragment_snippet = user_data;
+  CoglBool *found_fragment_snippet = user_data;
 
   if (!COGL_LIST_EMPTY (&authority->big_state->fragment_snippets))
     {
@@ -1689,10 +1689,10 @@ check_layer_has_fragment_snippet (CoglPipelineLayer *layer,
   return TRUE;
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_has_fragment_snippets (CoglPipeline *pipeline)
 {
-  gboolean found_fragment_snippet = FALSE;
+  CoglBool found_fragment_snippet = FALSE;
 
   if (_cogl_pipeline_has_non_layer_fragment_snippets (pipeline))
     return TRUE;
@@ -1716,7 +1716,7 @@ void
 _cogl_pipeline_hash_blend_enable_state (CoglPipeline *authority,
                                         CoglPipelineHashState *state)
 {
-  guint8 blend_enable = authority->blend_enable;
+  uint8_t blend_enable = authority->blend_enable;
   state->hash = _cogl_util_one_at_a_time_hash (state->hash, &blend_enable, 1);
 }
 
@@ -1821,7 +1821,7 @@ _cogl_pipeline_hash_depth_state (CoglPipeline *authority,
 
   if (depth_state->test_enabled)
     {
-      guint8 enabled = depth_state->test_enabled;
+      uint8_t enabled = depth_state->test_enabled;
       CoglDepthTestFunction function = depth_state->test_function;
       hash = _cogl_util_one_at_a_time_hash (hash, &enabled, sizeof (enabled));
       hash = _cogl_util_one_at_a_time_hash (hash, &function, sizeof (function));
@@ -1829,7 +1829,7 @@ _cogl_pipeline_hash_depth_state (CoglPipeline *authority,
 
   if (depth_state->write_enabled)
     {
-      guint8 enabled = depth_state->write_enabled;
+      uint8_t enabled = depth_state->write_enabled;
       float near_val = depth_state->range_near;
       float far_val = depth_state->range_far;
       hash = _cogl_util_one_at_a_time_hash (hash, &enabled, sizeof (enabled));
diff --git a/cogl/cogl-pipeline-state.h b/cogl/cogl-pipeline-state.h
index 8686629..cfaec22 100644
--- a/cogl/cogl-pipeline-state.h
+++ b/cogl/cogl-pipeline-state.h
@@ -75,10 +75,10 @@ cogl_pipeline_set_color (CoglPipeline    *pipeline,
  */
 void
 cogl_pipeline_set_color4ub (CoglPipeline *pipeline,
-			    guint8        red,
-                            guint8        green,
-                            guint8        blue,
-                            guint8        alpha);
+			    uint8_t red,
+                            uint8_t green,
+                            uint8_t blue,
+                            uint8_t alpha);
 
 /**
  * cogl_pipeline_set_color4f:
@@ -462,7 +462,7 @@ cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline);
  * Since: 2.0
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_pipeline_set_blend (CoglPipeline *pipeline,
                          const char   *blend_string,
                          GError      **error);
@@ -635,7 +635,7 @@ cogl_pipeline_set_user_program (CoglPipeline *pipeline,
  * Since: 2.0
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_pipeline_set_depth_state (CoglPipeline *pipeline,
                                const CoglDepthState *state,
                                GError **error);
@@ -893,7 +893,7 @@ cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline,
                                   int uniform_location,
                                   int dimensions,
                                   int count,
-                                  gboolean transpose,
+                                  CoglBool transpose,
                                   const float *value);
 
 /**
diff --git a/cogl/cogl-pipeline-vertend-fixed.c b/cogl/cogl-pipeline-vertend-fixed.c
index 2cb12a2..f87f462 100644
--- a/cogl/cogl-pipeline-vertend-fixed.c
+++ b/cogl/cogl-pipeline-vertend-fixed.c
@@ -43,7 +43,7 @@
 
 const CoglPipelineVertend _cogl_pipeline_fixed_vertend;
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_fixed_start (CoglPipeline *pipeline,
                                     int n_layers,
                                     unsigned long pipelines_difference,
@@ -77,7 +77,7 @@ _cogl_pipeline_vertend_fixed_start (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_fixed_add_layer (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
                                         unsigned long layers_difference)
@@ -106,7 +106,7 @@ _cogl_pipeline_vertend_fixed_add_layer (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_fixed_end (CoglPipeline *pipeline,
                                   unsigned long pipelines_difference)
 {
diff --git a/cogl/cogl-pipeline-vertend-glsl.c b/cogl/cogl-pipeline-vertend-glsl.c
index c8e6b0d..757cc7e 100644
--- a/cogl/cogl-pipeline-vertend-glsl.c
+++ b/cogl/cogl-pipeline-vertend-glsl.c
@@ -149,7 +149,7 @@ get_layer_vertex_snippets (CoglPipelineLayer *layer)
   return &layer->big_state->vertex_snippets;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_glsl_start (CoglPipeline *pipeline,
                                    int n_layers,
                                    unsigned long pipelines_difference,
@@ -284,7 +284,7 @@ _cogl_pipeline_vertend_glsl_start (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_glsl_add_layer (CoglPipeline *pipeline,
                                        CoglPipelineLayer *layer,
                                        unsigned long layers_difference)
@@ -382,7 +382,7 @@ _cogl_pipeline_vertend_glsl_add_layer (CoglPipeline *pipeline,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_vertend_glsl_end (CoglPipeline *pipeline,
                                  unsigned long pipelines_difference)
 {
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 9f138e7..f7c2815 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -53,7 +53,7 @@
 
 static void _cogl_pipeline_free (CoglPipeline *tex);
 static void recursively_free_layer_caches (CoglPipeline *pipeline);
-static gboolean _cogl_pipeline_is_weak (CoglPipeline *pipeline);
+static CoglBool _cogl_pipeline_is_weak (CoglPipeline *pipeline);
 
 const CoglPipelineFragend *_cogl_pipeline_fragends[COGL_PIPELINE_N_FRAGENDS];
 const CoglPipelineVertend *_cogl_pipeline_vertends[COGL_PIPELINE_N_VERTENDS];
@@ -232,7 +232,7 @@ _cogl_pipeline_unparent (CoglNode *pipeline)
   _cogl_pipeline_node_unparent_real (pipeline);
 }
 
-static gboolean
+static CoglBool
 recursively_free_layer_caches_cb (CoglNode *node,
                                   void *user_data)
 {
@@ -267,7 +267,7 @@ recursively_free_layer_caches (CoglPipeline *pipeline)
 static void
 _cogl_pipeline_set_parent (CoglPipeline *pipeline,
                            CoglPipeline *parent,
-                           gboolean take_strong_reference)
+                           CoglBool take_strong_reference)
 {
   /* Chain up */
   _cogl_pipeline_node_set_parent_real (COGL_NODE (pipeline),
@@ -339,7 +339,7 @@ _cogl_pipeline_revert_weak_ancestors (CoglPipeline *strong)
 /* XXX: Always have an eye out for opportunities to lower the cost of
  * cogl_pipeline_copy. */
 static CoglPipeline *
-_cogl_pipeline_copy (CoglPipeline *src, gboolean is_weak)
+_cogl_pipeline_copy (CoglPipeline *src, CoglBool is_weak)
 {
   CoglPipeline *pipeline = g_slice_new (CoglPipeline);
 
@@ -419,7 +419,7 @@ cogl_pipeline_new (CoglContext *context)
   return new;
 }
 
-static gboolean
+static CoglBool
 destroy_weak_children_cb (CoglNode *node,
                           void *user_data)
 {
@@ -495,7 +495,7 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
   g_slice_free (CoglPipeline, pipeline);
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_get_real_blend_enabled (CoglPipeline *pipeline)
 {
   _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), FALSE);
@@ -593,7 +593,7 @@ _cogl_pipeline_foreach_layer_internal (CoglPipeline *pipeline,
     _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LAYERS);
   int n_layers;
   int i;
-  gboolean cont;
+  CoglBool cont;
 
   n_layers = authority->n_layers;
   if (n_layers == 0)
@@ -614,7 +614,7 @@ typedef struct
   int *indices;
 } AppendLayerIndexState;
 
-static gboolean
+static CoglBool
 append_layer_index_cb (CoglPipelineLayer *layer,
                        void *user_data)
 {
@@ -631,7 +631,7 @@ cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
   CoglPipeline *authority =
     _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_LAYERS);
   AppendLayerIndexState state;
-  gboolean cont;
+  CoglBool cont;
   int i;
 
   /* XXX: We don't know what the user is going to want to do to the layers
@@ -651,10 +651,10 @@ cogl_pipeline_foreach_layer (CoglPipeline *pipeline,
     cont = callback (pipeline, state.indices[i], user_data);
 }
 
-static gboolean
+static CoglBool
 layer_has_alpha_cb (CoglPipelineLayer *layer, void *data)
 {
-  gboolean *has_alpha = data;
+  CoglBool *has_alpha = data;
   *has_alpha = _cogl_pipeline_layer_has_alpha (layer);
 
   /* return FALSE to stop iterating layers if we find any layer
@@ -668,7 +668,7 @@ layer_has_alpha_cb (CoglPipelineLayer *layer, void *data)
   return !(*has_alpha);
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_needs_blending_enabled (CoglPipeline    *pipeline,
                                        unsigned long    changes,
                                        const CoglColor *override_color)
@@ -798,7 +798,7 @@ _cogl_pipeline_needs_blending_enabled (CoglPipeline    *pipeline,
       /* has_alpha tracks the alpha status of the GL_PREVIOUS layer.
        * To start with that's defined by the pipeline color which
        * must be fully opaque if we got this far. */
-      gboolean has_alpha = FALSE;
+      CoglBool has_alpha = FALSE;
       _cogl_pipeline_foreach_layer_internal (pipeline,
                                              layer_has_alpha_cb,
                                              &has_alpha);
@@ -1099,11 +1099,11 @@ _cogl_pipeline_init_multi_property_sparse_state (CoglPipeline *pipeline,
     }
 }
 
-static gboolean
+static CoglBool
 check_if_strong_cb (CoglNode *node, void *user_data)
 {
   CoglPipeline *pipeline = COGL_PIPELINE (node);
-  gboolean *has_strong_child = user_data;
+  CoglBool *has_strong_child = user_data;
 
   if (!_cogl_pipeline_is_weak (pipeline))
     {
@@ -1114,17 +1114,17 @@ check_if_strong_cb (CoglNode *node, void *user_data)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 has_strong_children (CoglPipeline *pipeline)
 {
-  gboolean has_strong_child = FALSE;
+  CoglBool has_strong_child = FALSE;
   _cogl_pipeline_node_foreach_child (COGL_NODE (pipeline),
                                      check_if_strong_cb,
                                      &has_strong_child);
   return has_strong_child;
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_is_weak (CoglPipeline *pipeline)
 {
   if (pipeline->is_weak && !has_strong_children (pipeline))
@@ -1133,7 +1133,7 @@ _cogl_pipeline_is_weak (CoglPipeline *pipeline)
     return FALSE;
 }
 
-static gboolean
+static CoglBool
 reparent_children_cb (CoglNode *node,
                       void *user_data)
 {
@@ -1149,7 +1149,7 @@ void
 _cogl_pipeline_pre_change_notify (CoglPipeline     *pipeline,
                                   CoglPipelineState change,
                                   const CoglColor  *new_color,
-                                  gboolean          from_layer_change)
+                                  CoglBool          from_layer_change)
 {
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -1158,7 +1158,7 @@ _cogl_pipeline_pre_change_notify (CoglPipeline     *pipeline,
    * before we can modify it... */
   if (pipeline->journal_ref_count)
     {
-      gboolean skip_journal_flush = FALSE;
+      CoglBool skip_journal_flush = FALSE;
 
       /* XXX: We don't usually need to flush the journal just due to
        * color changes since pipeline colors are logged in the
@@ -1166,11 +1166,11 @@ _cogl_pipeline_pre_change_notify (CoglPipeline     *pipeline,
        * color enables or disables the need for blending. */
       if (change == COGL_PIPELINE_STATE_COLOR)
         {
-          gboolean will_need_blending =
+          CoglBool will_need_blending =
             _cogl_pipeline_needs_blending_enabled (pipeline,
                                                    change,
                                                    new_color);
-          gboolean blend_enable = pipeline->real_blend_enable ? TRUE : FALSE;
+          CoglBool blend_enable = pipeline->real_blend_enable ? TRUE : FALSE;
 
           if (will_need_blending == blend_enable)
             skip_journal_flush = TRUE;
@@ -1368,7 +1368,7 @@ _cogl_pipeline_pre_change_notify (CoglPipeline     *pipeline,
 void
 _cogl_pipeline_add_layer_difference (CoglPipeline *pipeline,
                                      CoglPipelineLayer *layer,
-                                     gboolean inc_n_layers)
+                                     CoglBool inc_n_layers)
 {
   _COGL_RETURN_IF_FAIL (layer->owner == NULL);
 
@@ -1402,7 +1402,7 @@ _cogl_pipeline_add_layer_difference (CoglPipeline *pipeline,
 void
 _cogl_pipeline_remove_layer_difference (CoglPipeline *pipeline,
                                         CoglPipelineLayer *layer,
-                                        gboolean dec_n_layers)
+                                        CoglBool dec_n_layers)
 {
   _COGL_RETURN_IF_FAIL (layer->owner == pipeline);
 
@@ -1460,7 +1460,7 @@ void
 _cogl_pipeline_update_blend_enable (CoglPipeline *pipeline,
                                     CoglPipelineState change)
 {
-  gboolean blend_enable =
+  CoglBool blend_enable =
     _cogl_pipeline_needs_blending_enabled (pipeline, change, NULL);
 
   if (blend_enable != pipeline->real_blend_enable)
@@ -1487,7 +1487,7 @@ typedef struct
   int first_index_to_prune;
 } CoglPipelinePruneLayersInfo;
 
-static gboolean
+static CoglBool
 update_prune_layers_info_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglPipelinePruneLayersInfo *state = user_data;
@@ -1615,12 +1615,12 @@ typedef struct
   /* When adding a layer we don't need a complete list of
    * layers_to_shift if we find a layer already corresponding to the
    * layer_index.  */
-  gboolean                    ignore_shift_layers_if_found;
+  CoglBool                    ignore_shift_layers_if_found;
 
 } CoglPipelineLayerInfo;
 
 /* Returns TRUE once we know there is nothing more to update */
-static gboolean
+static CoglBool
 update_layer_info (CoglPipelineLayer *layer,
                    CoglPipelineLayerInfo *layer_info)
 {
@@ -1643,7 +1643,7 @@ update_layer_info (CoglPipelineLayer *layer,
 }
 
 /* Returns FALSE to break out of a _foreach_layer () iteration */
-static gboolean
+static CoglBool
 update_layer_info_cb (CoglPipelineLayer *layer,
                       void *user_data)
 {
@@ -1852,7 +1852,7 @@ typedef struct
   unsigned long fallback_layers;
 } CoglPipelineFallbackState;
 
-static gboolean
+static CoglBool
 fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglPipelineFallbackState *state = user_data;
@@ -1909,7 +1909,7 @@ typedef struct
   CoglTexture *texture;
 } CoglPipelineOverrideLayerState;
 
-static gboolean
+static CoglBool
 override_layer_texture_cb (CoglPipelineLayer *layer, void *user_data)
 {
   CoglPipelineOverrideLayerState *state = user_data;
@@ -1976,7 +1976,7 @@ _cogl_pipeline_apply_overrides (CoglPipeline *pipeline,
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_layers_equal (CoglPipeline *authority0,
                              CoglPipeline *authority1,
                              unsigned long differences,
@@ -2137,7 +2137,7 @@ _cogl_pipeline_resolve_authorities (CoglPipeline *pipeline,
  * COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE because once they get to the
  * journal stage they act exactly the same.
  */
-gboolean
+CoglBool
 _cogl_pipeline_equal (CoglPipeline *pipeline0,
                       CoglPipeline *pipeline1,
                       unsigned long differences,
@@ -2148,7 +2148,7 @@ _cogl_pipeline_equal (CoglPipeline *pipeline0,
   CoglPipeline *authorities0[COGL_PIPELINE_STATE_SPARSE_COUNT];
   CoglPipeline *authorities1[COGL_PIPELINE_STATE_SPARSE_COUNT];
   int bit;
-  gboolean ret;
+  CoglBool ret;
 
   COGL_STATIC_TIMER (pipeline_equal_timer,
                      "Mainloop", /* parent */
@@ -2330,7 +2330,7 @@ _cogl_pipeline_prune_redundant_ancestry (CoglPipeline *pipeline)
 
   if (new_parent != _cogl_pipeline_get_parent (pipeline))
     {
-      gboolean is_weak = _cogl_pipeline_is_weak (pipeline);
+      CoglBool is_weak = _cogl_pipeline_is_weak (pipeline);
       _cogl_pipeline_set_parent (pipeline, new_parent, is_weak ? FALSE : TRUE);
     }
 }
@@ -2364,7 +2364,7 @@ _cogl_pipeline_update_authority (CoglPipeline *pipeline,
     }
 }
 
-gboolean
+CoglBool
 _cogl_pipeline_get_fog_enabled (CoglPipeline *pipeline)
 {
   CoglPipeline *authority;
@@ -2436,7 +2436,7 @@ cogl_pipeline_remove_layer (CoglPipeline *pipeline, int layer_index)
   _cogl_pipeline_update_blend_enable (pipeline, COGL_PIPELINE_STATE_LAYERS);
 }
 
-static gboolean
+static CoglBool
 prepend_layer_to_list_cb (CoglPipelineLayer *layer,
                           void *user_data)
 {
@@ -2599,7 +2599,7 @@ _cogl_pipeline_init_layer_state_hash_functions (void)
   }
 }
 
-static gboolean
+static CoglBool
 _cogl_pipeline_hash_layer_cb (CoglPipelineLayer *layer,
                               void *user_data)
 {
@@ -2731,7 +2731,7 @@ _cogl_pipeline_hash (CoglPipeline *pipeline,
 
   if (differences & COGL_PIPELINE_STATE_REAL_BLEND_ENABLE)
     {
-      gboolean enable = pipeline->real_blend_enable;
+      CoglBool enable = pipeline->real_blend_enable;
       state.hash =
         _cogl_util_one_at_a_time_hash (state.hash, &enable, sizeof (enable));
     }
@@ -2770,7 +2770,7 @@ typedef struct
   CoglPipelineLayer **layers;
 } AddLayersToArrayState;
 
-static gboolean
+static CoglBool
 add_layer_to_array_cb (CoglPipelineLayer *layer,
                        void *user_data)
 {
diff --git a/cogl/cogl-pipeline.h b/cogl/cogl-pipeline.h
index 20f54fa..aa55f24 100644
--- a/cogl/cogl-pipeline.h
+++ b/cogl/cogl-pipeline.h
@@ -105,7 +105,7 @@ cogl_pipeline_copy (CoglPipeline *source);
  * Since: 2.0
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_pipeline (void *object);
 
 /**
@@ -120,7 +120,7 @@ cogl_is_pipeline (void *object);
  * Since: 2.0
  * Stability: Unstable
  */
-typedef gboolean (*CoglPipelineLayerCallback) (CoglPipeline *pipeline,
+typedef CoglBool (*CoglPipelineLayerCallback) (CoglPipeline *pipeline,
                                                int layer_index,
                                                void *user_data);
 
diff --git a/cogl/cogl-pixel-buffer.c b/cogl/cogl-pixel-buffer.c
index 4fd5fa5..7b505d9 100644
--- a/cogl/cogl-pixel-buffer.c
+++ b/cogl/cogl-pixel-buffer.c
@@ -68,12 +68,12 @@ COGL_BUFFER_DEFINE (PixelBuffer, pixel_buffer)
 
 CoglPixelBuffer *
 cogl_pixel_buffer_new (CoglContext *context,
-                       gsize size,
+                       size_t size,
                        const void *data)
 {
   CoglPixelBuffer *pixel_buffer = g_slice_new0 (CoglPixelBuffer);
   CoglBuffer *buffer = COGL_BUFFER (pixel_buffer);
-  gboolean use_malloc;
+  CoglBool use_malloc;
 
   if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_PBOS))
     use_malloc = TRUE;
diff --git a/cogl/cogl-pixel-buffer.h b/cogl/cogl-pixel-buffer.h
index 7c22d16..14e6f0f 100644
--- a/cogl/cogl-pixel-buffer.h
+++ b/cogl/cogl-pixel-buffer.h
@@ -74,7 +74,7 @@ typedef struct _CoglPixelBuffer CoglPixelBuffer;
  */
 CoglPixelBuffer *
 cogl_pixel_buffer_new (CoglContext *context,
-                       gsize size,
+                       size_t size,
                        const void *data);
 
 /**
@@ -89,7 +89,7 @@ cogl_pixel_buffer_new (CoglContext *context,
  * Since: 1.2
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_pixel_buffer (void *object);
 
 #if 0
@@ -113,9 +113,9 @@ cogl_is_pixel_buffer (void *object);
  * Since: 1.2
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_pixel_buffer_set_region (CoglPixelBuffer *buffer,
-                              guint8 *data,
+                              uint8_t *data,
                               unsigned int src_width,
                               unsigned int src_height,
                               unsigned int src_rowstride,
diff --git a/cogl/cogl-point-in-poly.c b/cogl/cogl-point-in-poly.c
index 71c6882..cf87b93 100644
--- a/cogl/cogl-point-in-poly.c
+++ b/cogl/cogl-point-in-poly.c
@@ -78,11 +78,11 @@ _cogl_util_point_in_screen_poly (float point_x,
 
   for (i = 0, j = n_vertices - 1; i < n_vertices; j = i++)
     {
-      float vert_xi = *(float *)((guint8 *)vertices + i * stride);
-      float vert_xj = *(float *)((guint8 *)vertices + j * stride);
-      float vert_yi = *(float *)((guint8 *)vertices + i * stride +
+      float vert_xi = *(float *)((uint8_t *)vertices + i * stride);
+      float vert_xj = *(float *)((uint8_t *)vertices + j * stride);
+      float vert_yi = *(float *)((uint8_t *)vertices + i * stride +
                                  sizeof (float));
-      float vert_yj = *(float *)((guint8 *)vertices + j * stride +
+      float vert_yj = *(float *)((uint8_t *)vertices + j * stride +
                                  sizeof (float));
 
       vert_xi = COGL_UTIL_NEARBYINT (vert_xi);
diff --git a/cogl/cogl-poll.c b/cogl/cogl-poll.c
index 4501f47..86be2cf 100644
--- a/cogl/cogl-poll.c
+++ b/cogl/cogl-poll.c
@@ -35,7 +35,7 @@ void
 cogl_poll_get_info (CoglContext *context,
                     CoglPollFD **poll_fds,
                     int *n_poll_fds,
-                    gint64 *timeout)
+                    int64_t *timeout)
 {
   const CoglWinsysVtable *winsys;
 
diff --git a/cogl/cogl-poll.h b/cogl/cogl-poll.h
index 9c520b6..a764759 100644
--- a/cogl/cogl-poll.h
+++ b/cogl/cogl-poll.h
@@ -138,7 +138,7 @@ void
 cogl_poll_get_info (CoglContext *context,
                     CoglPollFD **poll_fds,
                     int *n_poll_fds,
-                    gint64 *timeout);
+                    int64_t *timeout);
 
 /**
  * cogl_poll_dispatch:
diff --git a/cogl/cogl-primitive-texture.c b/cogl/cogl-primitive-texture.c
index b748a87..75ac1db 100644
--- a/cogl/cogl-primitive-texture.c
+++ b/cogl/cogl-primitive-texture.c
@@ -31,7 +31,7 @@
 #include "cogl-primitive-texture.h"
 #include "cogl-texture-private.h"
 
-gboolean
+CoglBool
 cogl_is_primitive_texture (void *object)
 {
   return (cogl_is_texture (object) &&
@@ -40,7 +40,7 @@ cogl_is_primitive_texture (void *object)
 
 void
 cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
-                                        gboolean value)
+                                        CoglBool value)
 {
   CoglTexture *texture;
 
diff --git a/cogl/cogl-primitive-texture.h b/cogl/cogl-primitive-texture.h
index f35918b..db8cff4 100644
--- a/cogl/cogl-primitive-texture.h
+++ b/cogl/cogl-primitive-texture.h
@@ -29,7 +29,7 @@
 #ifndef __COGL_PRIMITIVE_TEXTURE_H__
 #define __COGL_PRIMITIVE_TEXTURE_H__
 
-#include <glib.h>
+#include "cogl-types.h"
 
 G_BEGIN_DECLS
 
@@ -71,7 +71,7 @@ typedef struct _CoglPrimitiveTexture CoglPrimitiveTexture;
  * Since: 2.0
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_primitive_texture (void *object);
 
 /**
@@ -91,7 +91,7 @@ cogl_is_primitive_texture (void *object);
  */
 void
 cogl_primitive_texture_set_auto_mipmap (CoglPrimitiveTexture *primitive_texture,
-                                        gboolean value);
+                                        CoglBool value);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-primitive.c b/cogl/cogl-primitive.c
index c7f7a4e..db80ca2 100644
--- a/cogl/cogl-primitive.c
+++ b/cogl/cogl-primitive.c
@@ -388,7 +388,7 @@ _cogl_primitive_free (CoglPrimitive *primitive)
 static void
 warn_about_midscene_changes (void)
 {
-  static gboolean seen = FALSE;
+  static CoglBool seen = FALSE;
   if (!seen)
     {
       g_warning ("Mid-scene modification of primitives has "
diff --git a/cogl/cogl-primitive.h b/cogl/cogl-primitive.h
index 72bb3d4..2a33e02 100644
--- a/cogl/cogl-primitive.h
+++ b/cogl/cogl-primitive.h
@@ -100,7 +100,7 @@ typedef struct
 typedef struct
 {
    float x, y;
-   guint8 r, g, b, a;
+   uint8_t r, g, b, a;
 } CoglVertexP2C4;
 
 /**
@@ -122,7 +122,7 @@ typedef struct
 typedef struct
 {
    float x, y, z;
-   guint8 r, g, b, a;
+   uint8_t r, g, b, a;
 } CoglVertexP3C4;
 
 /**
@@ -186,7 +186,7 @@ typedef struct
 {
    float x, y;
    float s, t;
-   guint8 r, g, b, a;
+   uint8_t r, g, b, a;
 } CoglVertexP2T2C4;
 
 /**
@@ -211,7 +211,7 @@ typedef struct
 {
    float x, y, z;
    float s, t;
-   guint8 r, g, b, a;
+   uint8_t r, g, b, a;
 } CoglVertexP3T2C4;
 
 /**
@@ -833,7 +833,7 @@ cogl_primitive_copy (CoglPrimitive *primitive);
  * Since: 1.6
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_primitive (void *object);
 
 /**
@@ -851,7 +851,7 @@ cogl_is_primitive (void *object);
  * Since: 1.10
  * Stability: Unstable
  */
-typedef gboolean (* CoglPrimitiveAttributeCallback) (CoglPrimitive *primitive,
+typedef CoglBool (* CoglPrimitiveAttributeCallback) (CoglPrimitive *primitive,
                                                      CoglAttribute *attribute,
                                                      void *user_data);
 
diff --git a/cogl/cogl-primitives-private.h b/cogl/cogl-primitives-private.h
index 859bcae..91b457f 100644
--- a/cogl/cogl-primitives-private.h
+++ b/cogl/cogl-primitives-private.h
@@ -53,7 +53,7 @@ _cogl_framebuffer_draw_multitextured_rectangles (
                                         CoglPipeline *pipeline,
                                         CoglMultiTexturedRect *rects,
                                         int n_rects,
-                                        gboolean disable_legacy_state);
+                                        CoglBool disable_legacy_state);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index 7323498..a7bc6ad 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -59,8 +59,8 @@ typedef struct _TextureSlicedQuadState
   float v_to_q_scale_y;
   float quad_len_x;
   float quad_len_y;
-  gboolean flipped_x;
-  gboolean flipped_y;
+  CoglBool flipped_x;
+  CoglBool flipped_y;
 } TextureSlicedQuadState;
 
 typedef struct _TextureSlicedPolygonState
@@ -135,7 +135,7 @@ typedef struct _ValidateFirstLayerState
   CoglPipeline *override_pipeline;
 } ValidateFirstLayerState;
 
-static gboolean
+static CoglBool
 validate_first_layer_cb (CoglPipeline *pipeline,
                          int layer_index,
                          void *user_data)
@@ -201,10 +201,10 @@ _cogl_texture_quad_multiple_primitives (CoglFramebuffer *framebuffer,
                                         float ty_2)
 {
   TextureSlicedQuadState state;
-  gboolean tex_virtual_flipped_x;
-  gboolean tex_virtual_flipped_y;
-  gboolean quad_flipped_x;
-  gboolean quad_flipped_y;
+  CoglBool tex_virtual_flipped_x;
+  CoglBool tex_virtual_flipped_y;
+  CoglBool quad_flipped_x;
+  CoglBool quad_flipped_y;
   ValidateFirstLayerState validate_first_layer_state;
   CoglPipelineWrapMode wrap_s, wrap_t;
 
@@ -291,13 +291,13 @@ typedef struct _ValidateTexCoordsState
   int user_tex_coords_len;
   float *final_tex_coords;
   CoglPipeline *override_pipeline;
-  gboolean needs_multiple_primitives;
+  CoglBool needs_multiple_primitives;
 } ValidateTexCoordsState;
 
 /*
  * Validate the texture coordinates for this rectangle.
  */
-static gboolean
+static CoglBool
 validate_tex_coords_cb (CoglPipeline *pipeline,
                         int layer_index,
                         void *user_data)
@@ -351,7 +351,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
         {
           if (state->n_layers > 1)
             {
-              static gboolean warning_seen = FALSE;
+              static CoglBool warning_seen = FALSE;
               if (!warning_seen)
                 g_warning ("Skipping layers 1..n of your material since "
                            "the first layer doesn't support hardware "
@@ -370,7 +370,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
         }
       else
         {
-          static gboolean warning_seen = FALSE;
+          static CoglBool warning_seen = FALSE;
           if (!warning_seen)
             g_warning ("Skipping layer %d of your material "
                        "since you have supplied texture coords "
@@ -431,7 +431,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
  * - CoglTexturePixmap: assuming the users given texture coordinates don't
  *   require repeating.
  */
-static gboolean
+static CoglBool
 _cogl_multitexture_quad_single_primitive (CoglFramebuffer *framebuffer,
                                           CoglPipeline *pipeline,
                                           const float  *position,
@@ -480,10 +480,10 @@ typedef struct _ValidateLayerState
   int i;
   int first_layer;
   CoglPipeline *override_source;
-  gboolean all_use_sliced_quad_fallback;
+  CoglBool all_use_sliced_quad_fallback;
 } ValidateLayerState;
 
-static gboolean
+static CoglBool
 _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
                                     int layer_index,
                                     void *user_data)
@@ -560,7 +560,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
         {
           if (cogl_pipeline_get_n_layers (pipeline) > 1)
             {
-              static gboolean warning_seen = FALSE;
+              static CoglBool warning_seen = FALSE;
 
               if (!state->override_source)
                 state->override_source = cogl_pipeline_copy (pipeline);
@@ -581,7 +581,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
         }
       else
         {
-          static gboolean warning_seen = FALSE;
+          static CoglBool warning_seen = FALSE;
           CoglTexture2D *tex_2d;
 
           if (!warning_seen)
@@ -612,7 +612,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
   if (!_cogl_texture_can_hardware_repeat (texture) &&
       _cogl_pipeline_layer_has_user_matrix (pipeline, layer_index))
     {
-      static gboolean warning_seen = FALSE;
+      static CoglBool warning_seen = FALSE;
       if (!warning_seen)
         g_warning ("layer %d of your pipeline uses a custom "
                    "texture matrix but because the texture doesn't "
@@ -632,7 +632,7 @@ _cogl_framebuffer_draw_multitextured_rectangles (
                                         CoglPipeline *pipeline,
                                         CoglMultiTexturedRect *rects,
                                         int n_rects,
-                                        gboolean disable_legacy_state)
+                                        CoglBool disable_legacy_state)
 {
   CoglContext *ctx = framebuffer->context;
   CoglPipeline *original_pipeline;
@@ -680,7 +680,7 @@ _cogl_framebuffer_draw_multitextured_rectangles (
 
       if (!state.all_use_sliced_quad_fallback)
         {
-          gboolean success =
+          CoglBool success =
             _cogl_multitexture_quad_single_primitive (framebuffer,
                                                       pipeline,
                                                       rects[i].position,
@@ -909,7 +909,7 @@ typedef struct _AppendTexCoordsState
   float *vertices_out;
 } AppendTexCoordsState;
 
-static gboolean
+static CoglBool
 append_tex_coord_attributes_cb (CoglPipeline *pipeline,
                                 int layer_index,
                                 void *user_data)
@@ -945,7 +945,7 @@ typedef struct _ValidateState
   CoglPipeline *pipeline;
 } ValidateState;
 
-static gboolean
+static CoglBool
 _cogl_polygon_validate_layer_cb (CoglPipeline *pipeline,
                                  int layer_index,
                                  void *user_data)
@@ -983,7 +983,7 @@ _cogl_polygon_validate_layer_cb (CoglPipeline *pipeline,
 void
 cogl_polygon (const CoglTextureVertex *vertices,
               unsigned int n_vertices,
-	      gboolean use_color)
+	      CoglBool use_color)
 {
   CoglPipeline *pipeline;
   ValidateState validate_state;
@@ -992,7 +992,7 @@ cogl_polygon (const CoglTextureVertex *vertices,
   CoglAttribute **attributes;
   int i;
   unsigned int stride;
-  gsize stride_bytes;
+  size_t stride_bytes;
   CoglAttributeBuffer *attribute_buffer;
   float *v;
 
@@ -1080,7 +1080,7 @@ cogl_polygon (const CoglTextureVertex *vertices,
   for (i = 0; i < n_vertices; i++)
     {
       AppendTexCoordsState append_tex_coords_state;
-      guint8 *c;
+      uint8_t *c;
 
       /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */
       v[0] = vertices[i].x;
@@ -1098,7 +1098,7 @@ cogl_polygon (const CoglTextureVertex *vertices,
       if (use_color)
         {
           /* NB: [X,Y,Z,TX,TY...,R,G,B,A,...] */
-          c = (guint8 *) (v + 3 + 2 * n_layers);
+          c = (uint8_t *) (v + 3 + 2 * n_layers);
           c[0] = cogl_color_get_red_byte (&vertices[i].color);
           c[1] = cogl_color_get_green_byte (&vertices[i].color);
           c[2] = cogl_color_get_blue_byte (&vertices[i].color);
diff --git a/cogl/cogl-primitives.h b/cogl/cogl-primitives.h
index f638056..e1f3617 100644
--- a/cogl/cogl-primitives.h
+++ b/cogl/cogl-primitives.h
@@ -183,7 +183,7 @@ cogl_rectangles (const float *verts,
 void
 cogl_polygon (const CoglTextureVertex  *vertices,
               unsigned int              n_vertices,
-              gboolean                  use_color);
+              CoglBool                  use_color);
 
 G_END_DECLS
 
diff --git a/cogl/cogl-private.h b/cogl/cogl-private.h
index 0985ec8..d167cb3 100644
--- a/cogl/cogl-private.h
+++ b/cogl/cogl-private.h
@@ -30,7 +30,7 @@
 
 G_BEGIN_DECLS
 
-gboolean
+CoglBool
 _cogl_check_extension (const char *name, const char *ext);
 
 void
@@ -40,9 +40,9 @@ void
 _cogl_init (void);
 
 void
-_cogl_push_source (CoglPipeline *pipeline, gboolean enable_legacy);
+_cogl_push_source (CoglPipeline *pipeline, CoglBool enable_legacy);
 
-gboolean
+CoglBool
 _cogl_get_enable_legacy_state (void);
 
 /*
@@ -81,7 +81,7 @@ _cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format);
  *               endianness when dealing with the given @format
  *               else %FALSE.
  */
-gboolean
+CoglBool
 _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
 
 /*
diff --git a/cogl/cogl-profile.c b/cogl/cogl-profile.c
index c06d8a5..f552b63 100644
--- a/cogl/cogl-profile.c
+++ b/cogl/cogl-profile.c
@@ -12,7 +12,7 @@
 
 UProfContext *_cogl_uprof_context;
 
-static gboolean
+static CoglBool
 debug_option_getter (void *user_data)
 {
   unsigned int shift = GPOINTER_TO_UINT (user_data);
@@ -20,7 +20,7 @@ debug_option_getter (void *user_data)
 }
 
 static void
-debug_option_setter (gboolean value, void *user_data)
+debug_option_setter (CoglBool value, void *user_data)
 {
   unsigned int shift = GPOINTER_TO_UINT (user_data);
 
diff --git a/cogl/cogl-program-private.h b/cogl/cogl-program-private.h
index 3558862..369db6d 100644
--- a/cogl/cogl-program-private.h
+++ b/cogl/cogl-program-private.h
@@ -68,15 +68,15 @@ struct _CoglProgramUniform
 void
 _cogl_program_flush_uniforms (CoglProgram *program,
                               GLuint gl_program,
-                              gboolean gl_program_changed);
+                              CoglBool gl_program_changed);
 
 CoglShaderLanguage
 _cogl_program_get_language (CoglHandle handle);
 
-gboolean
+CoglBool
 _cogl_program_has_fragment_shader (CoglHandle handle);
 
-gboolean
+CoglBool
 _cogl_program_has_vertex_shader (CoglHandle handle);
 
 #endif /* __COGL_PROGRAM_H */
diff --git a/cogl/cogl-program.c b/cogl/cogl-program.c
index 94e0de0..5f70c0a 100644
--- a/cogl/cogl-program.c
+++ b/cogl/cogl-program.c
@@ -311,7 +311,7 @@ cogl_program_set_uniform_matrix (CoglHandle handle,
                                  int uniform_location,
                                  int dimensions,
                                  int count,
-                                 gboolean transpose,
+                                 CoglBool transpose,
                                  const float *value)
 {
   CoglProgramUniform *uniform;
@@ -328,7 +328,7 @@ void
 cogl_program_uniform_matrix (int uniform_no,
                              int size,
                              int count,
-                             gboolean transpose,
+                             CoglBool transpose,
                              const float *value)
 {
   CoglProgramUniform *uniform;
@@ -395,7 +395,7 @@ _cogl_program_flush_uniform_arbfp (GLint location,
 void
 _cogl_program_flush_uniforms (CoglProgram *program,
                               GLuint gl_program,
-                              gboolean gl_program_changed)
+                              CoglBool gl_program_changed)
 {
   CoglProgramUniform *uniform;
   int i;
@@ -466,7 +466,7 @@ _cogl_program_get_language (CoglHandle handle)
     return COGL_SHADER_LANGUAGE_GLSL;
 }
 
-static gboolean
+static CoglBool
 _cogl_program_has_shader_type (CoglProgram *program,
                                CoglShaderType type)
 {
@@ -483,13 +483,13 @@ _cogl_program_has_shader_type (CoglProgram *program,
   return FALSE;
 }
 
-gboolean
+CoglBool
 _cogl_program_has_fragment_shader (CoglHandle handle)
 {
   return _cogl_program_has_shader_type (handle, COGL_SHADER_TYPE_FRAGMENT);
 }
 
-gboolean
+CoglBool
 _cogl_program_has_vertex_shader (CoglHandle handle)
 {
   return _cogl_program_has_shader_type (handle, COGL_SHADER_TYPE_VERTEX);
diff --git a/cogl/cogl-quaternion.c b/cogl/cogl-quaternion.c
index cfb8031..a6a275a 100644
--- a/cogl/cogl-quaternion.c
+++ b/cogl/cogl-quaternion.c
@@ -316,8 +316,8 @@ cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
     }
 }
 
-gboolean
-cogl_quaternion_equal (gconstpointer v1, gconstpointer v2)
+CoglBool
+cogl_quaternion_equal (const void *v1, const void *v2)
 {
   const CoglQuaternion *a = v1;
   const CoglQuaternion *b = v2;
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index eb60bcd..0b4176b 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -285,8 +285,8 @@ cogl_quaternion_init_from_matrix (CoglQuaternion *quaternion,
  *
  * Since: 2.0
  */
-gboolean
-cogl_quaternion_equal (gconstpointer v1, gconstpointer v2);
+CoglBool
+cogl_quaternion_equal (const void *v1, const void *v2);
 
 /**
  * cogl_quaternion_copy:
diff --git a/cogl/cogl-rectangle-map.c b/cogl/cogl-rectangle-map.c
index a483a56..bea954c 100644
--- a/cogl/cogl-rectangle-map.c
+++ b/cogl/cogl-rectangle-map.c
@@ -110,7 +110,7 @@ struct _CoglRectangleMapStackEntry
   CoglRectangleMapNode *node;
   /* Index of next branch of this node to explore. Basically either 0
      to go left or 1 to go right */
-  gboolean next_index;
+  CoglBool next_index;
 };
 
 static CoglRectangleMapNode *
@@ -154,7 +154,7 @@ _cogl_rectangle_map_new (unsigned int width,
 static void
 _cogl_rectangle_map_stack_push (GArray *stack,
                                 CoglRectangleMapNode *node,
-                                gboolean next_index)
+                                CoglBool next_index)
 {
   CoglRectangleMapStackEntry *new_entry;
 
@@ -341,7 +341,7 @@ _cogl_rectangle_map_verify (CoglRectangleMap *map)
 
 #endif /* COGL_ENABLE_DEBUG */
 
-gboolean
+CoglBool
 _cogl_rectangle_map_add (CoglRectangleMap *map,
                          unsigned int width,
                          unsigned int height,
diff --git a/cogl/cogl-rectangle-map.h b/cogl/cogl-rectangle-map.h
index 51b9260..0b724fc 100644
--- a/cogl/cogl-rectangle-map.h
+++ b/cogl/cogl-rectangle-map.h
@@ -24,7 +24,7 @@
 #ifndef __COGL_RECTANGLE_MAP_H
 #define __COGL_RECTANGLE_MAP_H
 
-#include <glib.h>
+#include "cogl-types.h"
 
 typedef struct _CoglRectangleMap      CoglRectangleMap;
 typedef struct _CoglRectangleMapEntry CoglRectangleMapEntry;
@@ -44,7 +44,7 @@ _cogl_rectangle_map_new (unsigned int width,
                          unsigned int height,
                          GDestroyNotify value_destroy_func);
 
-gboolean
+CoglBool
 _cogl_rectangle_map_add (CoglRectangleMap *map,
                          unsigned int width,
                          unsigned int height,
diff --git a/cogl/cogl-renderer-private.h b/cogl/cogl-renderer-private.h
index 0d119cb..808102c 100644
--- a/cogl/cogl-renderer-private.h
+++ b/cogl/cogl-renderer-private.h
@@ -41,7 +41,7 @@
 struct _CoglRenderer
 {
   CoglObject _parent;
-  gboolean connected;
+  CoglBool connected;
   CoglDriver driver_override;
   const CoglWinsysVtable *winsys_vtable;
   CoglWinsysID winsys_id_override;
@@ -49,7 +49,7 @@ struct _CoglRenderer
 
 #ifdef COGL_HAS_XLIB_SUPPORT
   Display *foreign_xdpy;
-  gboolean xlib_enable_event_retrieval;
+  CoglBool xlib_enable_event_retrieval;
 #endif
 
   CoglDriver driver;
@@ -64,8 +64,8 @@ struct _CoglRenderer
 #endif
 
 #ifdef COGL_HAS_SDL_SUPPORT
-  gboolean sdl_event_type_set;
-  guint8 sdl_event_type;
+  CoglBool sdl_event_type_set;
+  uint8_t sdl_event_type;
 #endif
 
   /* List of callback functions that will be given every native event */
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index fea5833..74fc35d 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -203,7 +203,7 @@ cogl_xlib_renderer_get_foreign_display (CoglRenderer *renderer)
 
 void
 cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
-                                                gboolean enable)
+                                                CoglBool enable)
 {
   _COGL_RETURN_IF_FAIL (cogl_is_renderer (renderer));
   /* NB: Renderers are considered immutable once connected */
@@ -213,7 +213,7 @@ cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
 }
 #endif /* COGL_HAS_XLIB_SUPPORT */
 
-gboolean
+CoglBool
 cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
                                        CoglOnscreenTemplate *onscreen_template,
                                        GError **error)
@@ -235,7 +235,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_renderer_choose_driver (CoglRenderer *renderer,
                               GError **error)
 {
@@ -307,7 +307,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
 
 /* Final connection API */
 
-gboolean
+CoglBool
 cogl_renderer_connect (CoglRenderer *renderer, GError **error)
 {
   int i;
@@ -328,7 +328,7 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error)
       const CoglWinsysVtable *winsys = _cogl_winsys_vtable_getters[i]();
       GError *tmp_error = NULL;
       GList *l;
-      gboolean constraints_failed = FALSE;
+      CoglBool constraints_failed = FALSE;
 
       if (renderer->winsys_id_override != COGL_WINSYS_ID_ANY)
         {
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index 6332327..d67704f 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -90,7 +90,7 @@ typedef struct _CoglRenderer CoglRenderer;
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_renderer (void *object);
 
 /**
@@ -230,7 +230,7 @@ cogl_renderer_get_n_fragment_texture_units (CoglRenderer *renderer);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
                                        CoglOnscreenTemplate *onscreen_template,
                                        GError **error);
@@ -252,7 +252,7 @@ cogl_renderer_check_onscreen_template (CoglRenderer *renderer,
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_renderer_connect (CoglRenderer *renderer, GError **error);
 
 /**
diff --git a/cogl/cogl-sampler-cache.c b/cogl/cogl-sampler-cache.c
index aa0d4a4..b7bb4da 100644
--- a/cogl/cogl-sampler-cache.c
+++ b/cogl/cogl-sampler-cache.c
@@ -71,7 +71,7 @@ canonicalize_key (CoglSamplerCacheEntry *key)
   key->wrap_mode_p = get_real_wrap_mode (key->wrap_mode_p);
 }
 
-static gboolean
+static CoglBool
 wrap_mode_equal_gl (CoglSamplerCacheWrapMode wrap_mode0,
                     CoglSamplerCacheWrapMode wrap_mode1)
 {
@@ -81,7 +81,7 @@ wrap_mode_equal_gl (CoglSamplerCacheWrapMode wrap_mode0,
   return get_real_wrap_mode (wrap_mode0) == get_real_wrap_mode (wrap_mode1);
 }
 
-static gboolean
+static CoglBool
 sampler_state_equal_gl (const void *value0,
                         const void *value1)
 {
@@ -126,7 +126,7 @@ hash_sampler_state_gl (const void *key)
   return _cogl_util_one_at_a_time_mix (hash);
 }
 
-static gboolean
+static CoglBool
 sampler_state_equal_cogl (const void *value0,
                           const void *value1)
 {
diff --git a/cogl/cogl-sdl.c b/cogl/cogl-sdl.c
index 9779593..76932c3 100644
--- a/cogl/cogl-sdl.c
+++ b/cogl/cogl-sdl.c
@@ -31,13 +31,13 @@
 #include "cogl-renderer-private.h"
 
 void
-cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, guint8 type)
+cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, uint8_t type)
 {
   renderer->sdl_event_type_set = TRUE;
   renderer->sdl_event_type = type;
 }
 
-guint8
+uint8_t
 cogl_sdl_renderer_get_event_type (CoglRenderer *renderer)
 {
   _COGL_RETURN_VAL_IF_FAIL (renderer->sdl_event_type_set, SDL_USEREVENT);
@@ -46,7 +46,7 @@ cogl_sdl_renderer_get_event_type (CoglRenderer *renderer)
 }
 
 CoglContext *
-cogl_sdl_context_new (guint8 type, GError **error)
+cogl_sdl_context_new (uint8_t type, GError **error)
 {
   CoglRenderer *renderer = cogl_renderer_new ();
   CoglDisplay *display;
diff --git a/cogl/cogl-sdl.h b/cogl/cogl-sdl.h
index 6f33be6..bf2eafa 100644
--- a/cogl/cogl-sdl.h
+++ b/cogl/cogl-sdl.h
@@ -123,7 +123,7 @@ G_BEGIN_DECLS
  * Stability: unstable
  */
 CoglContext *
-cogl_sdl_context_new (guint8 type, GError **error);
+cogl_sdl_context_new (uint8_t type, GError **error);
 
 /**
  * cogl_sdl_renderer_set_event_type:
@@ -147,7 +147,7 @@ cogl_sdl_context_new (guint8 type, GError **error);
  * Stability: unstable
  */
 void
-cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, guint8 type);
+cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, uint8_t type);
 
 /**
  * cogl_sdl_renderer_get_event_type:
@@ -161,7 +161,7 @@ cogl_sdl_renderer_set_event_type (CoglRenderer *renderer, guint8 type);
  * Since: 2.0
  * Stability: unstable
  */
-guint8
+uint8_t
 cogl_sdl_renderer_get_event_type (CoglRenderer *renderer);
 
 /**
diff --git a/cogl/cogl-shader.c b/cogl/cogl-shader.c
index fe26d1c..d82c773 100644
--- a/cogl/cogl-shader.c
+++ b/cogl/cogl-shader.c
@@ -455,7 +455,7 @@ cogl_shader_get_type (CoglHandle  handle)
   return shader->type;
 }
 
-gboolean
+CoglBool
 cogl_shader_is_compiled (CoglHandle handle)
 {
 #if defined (HAVE_COGL_GL) || defined (HAVE_COGL_GLES2)
diff --git a/cogl/cogl-shader.h b/cogl/cogl-shader.h
index c9aad74..00c1acd 100644
--- a/cogl/cogl-shader.h
+++ b/cogl/cogl-shader.h
@@ -281,7 +281,7 @@ cogl_shader_unref (CoglHandle handle) G_GNUC_DEPRECATED;
  * Returns: %TRUE if the handle references a shader,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_shader (CoglHandle handle);
 
 /**
@@ -346,7 +346,7 @@ cogl_shader_get_type (CoglHandle handle);
  *
  * Return value: %TRUE if the shader object has sucessfully be compiled
  */
-gboolean
+CoglBool
 cogl_shader_is_compiled (CoglHandle handle);
 
 /**
@@ -398,7 +398,7 @@ cogl_program_unref (CoglHandle handle) G_GNUC_DEPRECATED;
  * Returns: %TRUE if the handle references a program,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_program (CoglHandle handle);
 
 /**
@@ -561,7 +561,7 @@ cogl_program_set_uniform_matrix (CoglHandle program,
                                  int uniform_location,
                                  int dimensions,
                                  int count,
-                                 gboolean transpose,
+                                 CoglBool transpose,
                                  const float *value);
 
 #ifndef COGL_DISABLE_DEPRECATED
@@ -644,7 +644,7 @@ void
 cogl_program_uniform_matrix (int          uniform_no,
                              int          size,
                              int          count,
-                             gboolean     transpose,
+                             CoglBool     transpose,
                              const float *value) G_GNUC_DEPRECATED;
 
 #endif /* COGL_DISABLE_DEPRECATED */
diff --git a/cogl/cogl-snippet-private.h b/cogl/cogl-snippet-private.h
index 519738b..596e4dd 100644
--- a/cogl/cogl-snippet-private.h
+++ b/cogl/cogl-snippet-private.h
@@ -56,7 +56,7 @@ struct _CoglSnippet
   /* This is set to TRUE the first time the snippet is attached to the
      pipeline. After that any attempts to modify the snippet will be
      ignored. */
-  gboolean immutable;
+  CoglBool immutable;
 
   char *declarations;
   char *pre;
diff --git a/cogl/cogl-snippet.c b/cogl/cogl-snippet.c
index 0af6473..25c1a0a 100644
--- a/cogl/cogl-snippet.c
+++ b/cogl/cogl-snippet.c
@@ -29,6 +29,7 @@
 #include "config.h"
 #endif
 
+#include "cogl-types.h"
 #include "cogl-snippet-private.h"
 #include "cogl-util.h"
 
@@ -62,7 +63,7 @@ cogl_snippet_get_hook (CoglSnippet *snippet)
   return snippet->hook;
 }
 
-static gboolean
+static CoglBool
 _cogl_snippet_modify (CoglSnippet *snippet)
 {
   if (snippet->immutable)
diff --git a/cogl/cogl-snippet.h b/cogl/cogl-snippet.h
index 60eccc6..2191117 100644
--- a/cogl/cogl-snippet.h
+++ b/cogl/cogl-snippet.h
@@ -611,7 +611,7 @@ cogl_snippet_get_hook (CoglSnippet *snippet);
  * Since: 1.10
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_snippet (void *object);
 
 /**
diff --git a/cogl/cogl-spans.c b/cogl/cogl-spans.c
index d1fcff9..d2c5129 100644
--- a/cogl/cogl-spans.c
+++ b/cogl/cogl-spans.c
@@ -167,7 +167,7 @@ _cogl_span_iter_next (CoglSpanIter *iter)
   _cogl_span_iter_update (iter);
 }
 
-gboolean
+CoglBool
 _cogl_span_iter_end (CoglSpanIter *iter)
 {
   /* End reached when whole area covered */
diff --git a/cogl/cogl-spans.h b/cogl/cogl-spans.h
index b0b6c1d..178bd5e 100644
--- a/cogl/cogl-spans.h
+++ b/cogl/cogl-spans.h
@@ -47,8 +47,8 @@ typedef struct _CoglSpanIter
   float cover_end;
   float intersect_start;
   float intersect_end;
-  gboolean intersects;
-  gboolean flipped;
+  CoglBool intersects;
+  CoglBool flipped;
   CoglPipelineWrapMode wrap_mode;
   int mirror_direction;
 } CoglSpanIter;
@@ -68,7 +68,7 @@ _cogl_span_iter_begin (CoglSpanIter *iter,
 void
 _cogl_span_iter_next (CoglSpanIter *iter);
 
-gboolean
+CoglBool
 _cogl_span_iter_end (CoglSpanIter *iter);
 
 #endif /* __COGL_SPANS_PRIVATE_H */
diff --git a/cogl/cogl-sub-texture.c b/cogl/cogl-sub-texture.c
index 38aac15..97a5aad 100644
--- a/cogl/cogl-sub-texture.c
+++ b/cogl/cogl-sub-texture.c
@@ -270,7 +270,7 @@ _cogl_sub_texture_get_max_waste (CoglTexture *tex)
   return cogl_texture_get_max_waste (sub_tex->full_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_sub_texture_is_sliced (CoglTexture *tex)
 {
   CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
@@ -278,7 +278,7 @@ _cogl_sub_texture_is_sliced (CoglTexture *tex)
   return cogl_texture_is_sliced (sub_tex->full_texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_sub_texture_can_hardware_repeat (CoglTexture *tex)
 {
   CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
@@ -328,7 +328,7 @@ _cogl_sub_texture_transform_quad_coords_to_gl (CoglTexture *tex,
                                                     coords);
 }
 
-static gboolean
+static CoglBool
 _cogl_sub_texture_get_gl_texture (CoglTexture *tex,
                                   GLuint *out_gl_handle,
                                   GLenum *out_gl_target)
@@ -364,7 +364,7 @@ _cogl_sub_texture_ensure_non_quad_rendering (CoglTexture *tex)
 {
 }
 
-static gboolean
+static CoglBool
 _cogl_sub_texture_set_region (CoglTexture    *tex,
                               int             src_x,
                               int             src_y,
diff --git a/cogl/cogl-sub-texture.h b/cogl/cogl-sub-texture.h
index 6dae9ae..05f924c 100644
--- a/cogl/cogl-sub-texture.h
+++ b/cogl/cogl-sub-texture.h
@@ -118,7 +118,7 @@ cogl_sub_texture_get_parent (CoglSubTexture *sub_texture);
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_sub_texture (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-swap-chain-private.h b/cogl/cogl-swap-chain-private.h
index 2f63109..ac27358 100644
--- a/cogl/cogl-swap-chain-private.h
+++ b/cogl/cogl-swap-chain-private.h
@@ -30,7 +30,7 @@ struct _CoglSwapChain
 {
   CoglObject _parent;
 
-  gboolean has_alpha;
+  CoglBool has_alpha;
 
   int length;
 };
diff --git a/cogl/cogl-swap-chain.c b/cogl/cogl-swap-chain.c
index 51609fe..7a5b342 100644
--- a/cogl/cogl-swap-chain.c
+++ b/cogl/cogl-swap-chain.c
@@ -55,7 +55,7 @@ cogl_swap_chain_new (void)
 
 void
 cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
-                               gboolean has_alpha)
+                               CoglBool has_alpha)
 {
   swap_chain->has_alpha = has_alpha;
 }
diff --git a/cogl/cogl-swap-chain.h b/cogl/cogl-swap-chain.h
index 0420935..df383f5 100644
--- a/cogl/cogl-swap-chain.h
+++ b/cogl/cogl-swap-chain.h
@@ -39,14 +39,14 @@ cogl_swap_chain_new (void);
 #define cogl_swap_chain_set_has_alpha cogl_swap_chain_set_has_alpha_EXP
 void
 cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
-                               gboolean has_alpha);
+                               CoglBool has_alpha);
 
 #define cogl_swap_chain_set_length cogl_swap_chain_set_length_EXP
 void
 cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
                             int length);
 
-gboolean
+CoglBool
 cogl_is_swap_chain (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-texture-2d-private.h b/cogl/cogl-texture-2d-private.h
index 855b2fb..96b59d6 100644
--- a/cogl/cogl-texture-2d-private.h
+++ b/cogl/cogl-texture-2d-private.h
@@ -46,9 +46,9 @@ struct _CoglTexture2D
   GLenum          mag_filter;
   GLint           wrap_mode_s;
   GLint           wrap_mode_t;
-  gboolean        auto_mipmap;
-  gboolean        mipmaps_dirty;
-  gboolean        is_foreign;
+  CoglBool        auto_mipmap;
+  CoglBool        mipmaps_dirty;
+  CoglBool        is_foreign;
 
   CoglTexturePixel first_pixel;
 };
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index f2872ad..11e6adf 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -130,13 +130,13 @@ _cogl_texture_2d_sliced_foreach_sub_texture_in_region (
                                          &data);
 }
 
-static guint8 *
+static uint8_t *
 _cogl_texture_2d_sliced_allocate_waste_buffer (CoglTexture2DSliced *tex_2ds,
                                                CoglPixelFormat format)
 {
   CoglSpan *last_x_span;
   CoglSpan *last_y_span;
-  guint8   *waste_buf = NULL;
+  uint8_t *waste_buf = NULL;
 
   /* If the texture has any waste then allocate a buffer big enough to
      fill the gaps */
@@ -164,7 +164,7 @@ static void
 _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
                                    CoglBitmap *source_bmp,
                                    CoglTexture2D *slice_tex,
-                                   guint8 *waste_buf,
+                                   uint8_t *waste_buf,
                                    CoglSpan *x_span,
                                    CoglSpan *y_span,
                                    CoglSpanIter *x_iter,
@@ -174,7 +174,7 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
                                    int dst_x,
                                    int dst_y)
 {
-  gboolean need_x, need_y;
+  CoglBool need_x, need_y;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -193,9 +193,9 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
       int bmp_rowstride = cogl_bitmap_get_rowstride (source_bmp);
       CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
       int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
-      guint8 *bmp_data;
-      const guint8 *src;
-      guint8 *dst;
+      uint8_t *bmp_data;
+      const uint8_t *src;
+      uint8_t *dst;
       unsigned int wy, wx;
       CoglBitmap *waste_bmp;
 
@@ -306,16 +306,16 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
                                       CoglBitmap          *bmp)
 {
-  CoglSpan        *x_span;
-  CoglSpan        *y_span;
-  CoglTexture2D   *slice_tex;
-  int              x, y;
-  guint8          *waste_buf;
-  CoglPixelFormat  bmp_format;
+  CoglSpan *x_span;
+  CoglSpan *y_span;
+  CoglTexture2D *slice_tex;
+  int x, y;
+  uint8_t *waste_buf;
+  CoglPixelFormat bmp_format;
 
   bmp_format = cogl_bitmap_get_format (bmp);
 
@@ -382,7 +382,7 @@ _cogl_texture_2d_sliced_upload_to_gl (CoglTexture2DSliced *tex_2ds,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
                                                 int          src_x,
                                                 int          src_y,
@@ -396,14 +396,14 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
 {
   CoglSpan *x_span;
   CoglSpan *y_span;
-  CoglSpanIter      x_iter;
-  CoglSpanIter      y_iter;
-  CoglTexture2D    *slice_tex;
-  int               source_x = 0, source_y = 0;
-  int               inter_w = 0, inter_h = 0;
-  int               local_x = 0, local_y = 0;
-  guint8           *waste_buf;
-  CoglPixelFormat   source_format;
+  CoglSpanIter x_iter;
+  CoglSpanIter y_iter;
+  CoglTexture2D *slice_tex;
+  int source_x = 0, source_y = 0;
+  int inter_w = 0, inter_h = 0;
+  int local_x = 0, local_y = 0;
+  uint8_t *waste_buf;
+  CoglPixelFormat source_format;
 
   source_format = cogl_bitmap_get_format (source_bmp);
 
@@ -606,7 +606,7 @@ _cogl_texture_2d_sliced_set_wrap_mode_parameters (CoglTexture *tex,
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_slices_create (CoglContext *ctx,
                                        CoglTexture2DSliced *tex_2ds,
                                        int width, int height,
@@ -806,7 +806,7 @@ _cogl_texture_2d_sliced_free (CoglTexture2DSliced *tex_2ds)
   _cogl_texture_free (COGL_TEXTURE (tex_2ds));
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_init_base (CoglContext *ctx,
                                    CoglTexture2DSliced *tex_2ds,
                                    int width,
@@ -1033,7 +1033,7 @@ _cogl_texture_2d_sliced_new_from_foreign (GLuint           gl_handle,
   return _cogl_texture_2d_sliced_object_new (tex_2ds);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_is_foreign (CoglTexture *tex)
 {
   CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
@@ -1056,7 +1056,7 @@ _cogl_texture_2d_sliced_get_max_waste (CoglTexture *tex)
   return tex_2ds->max_waste;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_is_sliced (CoglTexture *tex)
 {
   CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
@@ -1070,7 +1070,7 @@ _cogl_texture_2d_sliced_is_sliced (CoglTexture *tex)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_can_hardware_repeat (CoglTexture *tex)
 {
   CoglTexture2DSliced *tex_2ds = COGL_TEXTURE_2D_SLICED (tex);
@@ -1121,7 +1121,7 @@ static CoglTransformResult
 _cogl_texture_2d_sliced_transform_quad_coords_to_gl (CoglTexture *tex,
                                                      float *coords)
 {
-  gboolean need_repeat = FALSE;
+  CoglBool need_repeat = FALSE;
   int i;
 
   /* This is a bit lazy - in the case where the quad lies entirely
@@ -1146,7 +1146,7 @@ _cogl_texture_2d_sliced_transform_quad_coords_to_gl (CoglTexture *tex,
           ? COGL_TRANSFORM_HARDWARE_REPEAT : COGL_TRANSFORM_NO_REPEAT);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_get_gl_texture (CoglTexture *tex,
                                         GLuint *out_gl_handle,
                                         GLenum *out_gl_target)
@@ -1229,7 +1229,7 @@ _cogl_texture_2d_sliced_ensure_non_quad_rendering (CoglTexture *tex)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_sliced_set_region (CoglTexture    *tex,
                                     int             src_x,
                                     int             src_y,
diff --git a/cogl/cogl-texture-2d-sliced.h b/cogl/cogl-texture-2d-sliced.h
index b64d0be..7ec2fed 100644
--- a/cogl/cogl-texture-2d-sliced.h
+++ b/cogl/cogl-texture-2d-sliced.h
@@ -110,7 +110,7 @@ cogl_texture_2d_sliced_new_with_size (CoglContext *ctx,
  * Since: 1.10
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_is_texture_2d_sliced (void *object);
 
 #endif /* __COGL_TEXURE_2D_SLICED_H */
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index beaf965..4905dbf 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -103,7 +103,7 @@ _cogl_texture_2d_free (CoglTexture2D *tex_2d)
   _cogl_texture_free (COGL_TEXTURE (tex_2d));
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_can_create (unsigned int width,
                              unsigned int height,
                              CoglPixelFormat internal_format)
@@ -140,7 +140,7 @@ _cogl_texture_2d_can_create (unsigned int width,
 
 static void
 _cogl_texture_2d_set_auto_mipmap (CoglTexture *tex,
-                                  gboolean value)
+                                  CoglBool value)
 {
   CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
 
@@ -227,12 +227,12 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp,
                                  GError **error)
 {
   CoglTexture2D *tex_2d;
-  CoglBitmap    *dst_bmp;
-  GLenum         gl_intformat;
-  GLenum         gl_format;
-  GLenum         gl_type;
-  guint8        *data;
-  CoglContext   *ctx;
+  CoglBitmap *dst_bmp;
+  GLenum gl_intformat;
+  GLenum gl_format;
+  GLenum gl_type;
+  uint8_t *data;
+  CoglContext *ctx;
 
   _COGL_RETURN_VAL_IF_FAIL (bmp != NULL, NULL);
 
@@ -310,7 +310,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
                                CoglPixelFormat format,
                                CoglPixelFormat internal_format,
                                int rowstride,
-                               const guint8 *data,
+                               const uint8_t *data,
                                GError **error)
 {
   CoglBitmap *bmp;
@@ -328,7 +328,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
                                   width, height,
                                   format,
                                   rowstride,
-                                  (guint8 *) data);
+                                  (uint8_t *) data);
 
   tex_2d = cogl_texture_2d_new_from_bitmap (bmp,
                                             internal_format,
@@ -622,13 +622,13 @@ _cogl_texture_2d_get_max_waste (CoglTexture *tex)
   return -1;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_is_sliced (CoglTexture *tex)
 {
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_can_hardware_repeat (CoglTexture *tex)
 {
   return TRUE;
@@ -650,7 +650,7 @@ _cogl_texture_2d_transform_quad_coords_to_gl (CoglTexture *tex,
   /* The texture coordinates map directly so we don't need to do
      anything other than check for repeats */
 
-  gboolean need_repeat = FALSE;
+  CoglBool need_repeat = FALSE;
   int i;
 
   for (i = 0; i < 4; i++)
@@ -661,7 +661,7 @@ _cogl_texture_2d_transform_quad_coords_to_gl (CoglTexture *tex,
           : COGL_TRANSFORM_NO_REPEAT);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_get_gl_texture (CoglTexture *tex,
                                  GLuint *out_gl_handle,
                                  GLenum *out_gl_target)
@@ -748,7 +748,7 @@ _cogl_texture_2d_ensure_non_quad_rendering (CoglTexture *tex)
   /* Nothing needs to be done */
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_set_region (CoglTexture    *tex,
                              int             src_x,
                              int             src_y,
@@ -759,9 +759,9 @@ _cogl_texture_2d_set_region (CoglTexture    *tex,
                              CoglBitmap     *bmp)
 {
   CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
-  GLenum         gl_format;
-  GLenum         gl_type;
-  guint8        *data;
+  GLenum gl_format;
+  GLenum gl_type;
+  uint8_t *data;
 
   _COGL_GET_CONTEXT (ctx, FALSE);
 
@@ -807,11 +807,11 @@ _cogl_texture_2d_set_region (CoglTexture    *tex,
   return TRUE;
 }
 
-static gboolean
-_cogl_texture_2d_get_data (CoglTexture     *tex,
-                           CoglPixelFormat  format,
-                           unsigned int     rowstride,
-                           guint8          *data)
+static CoglBool
+_cogl_texture_2d_get_data (CoglTexture *tex,
+                           CoglPixelFormat format,
+                           unsigned int rowstride,
+                           uint8_t *data)
 {
   CoglTexture2D   *tex_2d = COGL_TEXTURE_2D (tex);
   int              bpp;
@@ -867,7 +867,7 @@ _cogl_texture_2d_get_height (CoglTexture *tex)
   return COGL_TEXTURE_2D (tex)->height;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_2d_is_foreign (CoglTexture *tex)
 {
   return COGL_TEXTURE_2D (tex)->is_foreign;
diff --git a/cogl/cogl-texture-2d.h b/cogl/cogl-texture-2d.h
index f130b7f..191b4e9 100644
--- a/cogl/cogl-texture-2d.h
+++ b/cogl/cogl-texture-2d.h
@@ -67,7 +67,7 @@ typedef struct _CoglTexture2D CoglTexture2D;
  * Return value: %TRUE if the object references a #CoglTexture2D,
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_texture_2d (void *object);
 
 #define cogl_texture_2d_new_with_size cogl_texture_2d_new_with_size_EXP
@@ -149,7 +149,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
                                CoglPixelFormat format,
                                CoglPixelFormat internal_format,
                                int rowstride,
-                               const guint8 *data,
+                               const uint8_t *data,
                                GError **error);
 
 /**
diff --git a/cogl/cogl-texture-3d-private.h b/cogl/cogl-texture-3d-private.h
index dec6390..d7fda50 100644
--- a/cogl/cogl-texture-3d-private.h
+++ b/cogl/cogl-texture-3d-private.h
@@ -49,8 +49,8 @@ struct _CoglTexture3D
   GLint           wrap_mode_s;
   GLint           wrap_mode_t;
   GLint           wrap_mode_p;
-  gboolean        auto_mipmap;
-  gboolean        mipmaps_dirty;
+  CoglBool        auto_mipmap;
+  CoglBool        mipmaps_dirty;
 
   CoglTexturePixel first_pixel;
 };
diff --git a/cogl/cogl-texture-3d.c b/cogl/cogl-texture-3d.c
index 290b89b..f6a3fd7 100644
--- a/cogl/cogl-texture-3d.c
+++ b/cogl/cogl-texture-3d.c
@@ -101,7 +101,7 @@ _cogl_texture_3d_free (CoglTexture3D *tex_3d)
 
 static void
 _cogl_texture_3d_set_auto_mipmap (CoglTexture *tex,
-                                  gboolean value)
+                                  CoglBool value)
 {
   CoglTexture3D *tex_3d = COGL_TEXTURE_3D (tex);
 
@@ -140,7 +140,7 @@ _cogl_texture_3d_create_base (CoglContext *ctx,
   return tex_3d;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_3d_can_create (CoglContext *ctx,
                              int width,
                              int height,
@@ -251,15 +251,15 @@ cogl_texture_3d_new_from_bitmap (CoglBitmap *bmp,
                                  CoglPixelFormat internal_format,
                                  GError **error)
 {
-  CoglTexture3D   *tex_3d;
-  CoglBitmap      *dst_bmp;
-  CoglPixelFormat  bmp_format;
-  unsigned int     bmp_width;
-  GLenum           gl_intformat;
-  GLenum           gl_format;
-  GLenum           gl_type;
-  guint8          *data;
-  CoglContext     *ctx;
+  CoglTexture3D *tex_3d;
+  CoglBitmap *dst_bmp;
+  CoglPixelFormat bmp_format;
+  unsigned int bmp_width;
+  GLenum gl_intformat;
+  GLenum gl_format;
+  GLenum gl_type;
+  uint8_t *data;
+  CoglContext *ctx;
 
   ctx = _cogl_bitmap_get_context (bmp);
 
@@ -337,7 +337,7 @@ cogl_texture_3d_new_from_data (CoglContext *context,
                                CoglPixelFormat internal_format,
                                int rowstride,
                                int image_stride,
-                               const guint8 *data,
+                               const uint8_t *data,
                                GError **error)
 {
   CoglBitmap *bitmap;
@@ -368,7 +368,7 @@ cogl_texture_3d_new_from_data (CoglContext *context,
      recommends avoiding this situation. */
   if (image_stride % rowstride != 0)
     {
-      guint8 *bmp_data;
+      uint8_t *bmp_data;
       int bmp_rowstride;
       int z, y;
 
@@ -405,7 +405,7 @@ cogl_texture_3d_new_from_data (CoglContext *context,
                                        image_stride / rowstride * depth,
                                        format,
                                        rowstride,
-                                       (guint8 *) data);
+                                       (uint8_t *) data);
 
   ret = cogl_texture_3d_new_from_bitmap (bitmap,
                                          height,
@@ -424,13 +424,13 @@ _cogl_texture_3d_get_max_waste (CoglTexture *tex)
   return -1;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_3d_is_sliced (CoglTexture *tex)
 {
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_3d_can_hardware_repeat (CoglTexture *tex)
 {
   return TRUE;
@@ -452,7 +452,7 @@ _cogl_texture_3d_transform_quad_coords_to_gl (CoglTexture *tex,
   /* The texture coordinates map directly so we don't need to do
      anything other than check for repeats */
 
-  gboolean need_repeat = FALSE;
+  CoglBool need_repeat = FALSE;
   int i;
 
   for (i = 0; i < 4; i++)
@@ -463,7 +463,7 @@ _cogl_texture_3d_transform_quad_coords_to_gl (CoglTexture *tex,
           : COGL_TRANSFORM_NO_REPEAT);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_3d_get_gl_texture (CoglTexture *tex,
                                  GLuint *out_gl_handle,
                                  GLenum *out_gl_target)
@@ -556,7 +556,7 @@ _cogl_texture_3d_ensure_non_quad_rendering (CoglTexture *tex)
   /* Nothing needs to be done */
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_3d_set_region (CoglTexture    *tex,
                              int             src_x,
                              int             src_y,
@@ -572,10 +572,10 @@ _cogl_texture_3d_set_region (CoglTexture    *tex,
 }
 
 static int
-_cogl_texture_3d_get_data (CoglTexture     *tex,
-                           CoglPixelFormat  format,
-                           unsigned int     rowstride,
-                           guint8          *data)
+_cogl_texture_3d_get_data (CoglTexture *tex,
+                           CoglPixelFormat format,
+                           unsigned int rowstride,
+                           uint8_t *data)
 {
   /* FIXME: we could probably implement this by assuming the data is
      big enough to hold all of the images and that there is no stride
diff --git a/cogl/cogl-texture-3d.h b/cogl/cogl-texture-3d.h
index c3f763d..fe9f42f 100644
--- a/cogl/cogl-texture-3d.h
+++ b/cogl/cogl-texture-3d.h
@@ -128,7 +128,7 @@ cogl_texture_3d_new_from_data (CoglContext *context,
                                CoglPixelFormat internal_format,
                                int rowstride,
                                int image_stride,
-                               const guint8 *data,
+                               const uint8_t *data,
                                GError **error);
 
 /**
@@ -177,7 +177,7 @@ cogl_texture_3d_new_from_bitmap (CoglBitmap *bitmap,
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_texture_3d (void *object);
 
 G_END_DECLS
diff --git a/cogl/cogl-texture-driver.h b/cogl/cogl-texture-driver.h
index 56ec805..1513381 100644
--- a/cogl/cogl-texture-driver.h
+++ b/cogl/cogl-texture-driver.h
@@ -68,7 +68,7 @@ struct _CoglTextureDriver
   (* upload_subregion_to_gl) (CoglContext *ctx,
                               GLenum gl_target,
                               GLuint gl_handle,
-                              gboolean is_foreign,
+                              CoglBool is_foreign,
                               int src_x,
                               int src_y,
                               int dst_x,
@@ -89,7 +89,7 @@ struct _CoglTextureDriver
   (* upload_to_gl) (CoglContext *ctx,
                     GLenum gl_target,
                     GLuint gl_handle,
-                    gboolean is_foreign,
+                    CoglBool is_foreign,
                     CoglBitmap *source_bmp,
                     GLint internal_gl_format,
                     GLuint source_gl_format,
@@ -106,7 +106,7 @@ struct _CoglTextureDriver
   (* upload_to_gl_3d) (CoglContext *ctx,
                        GLenum gl_target,
                        GLuint gl_handle,
-                       gboolean is_foreign,
+                       CoglBool is_foreign,
                        GLint height,
                        GLint depth,
                        CoglBitmap *source_bmp,
@@ -134,17 +134,17 @@ struct _CoglTextureDriver
    * renders the texture and reads it back from the framebuffer. (See
    * _cogl_texture_draw_and_read () )
    */
-  gboolean
+  CoglBool
   (* gl_get_tex_image) (CoglContext *ctx,
                         GLenum gl_target,
                         GLenum dest_gl_format,
                         GLenum dest_gl_type,
-                        guint8 *dest);
+                        uint8_t *dest);
 
   /*
    * It may depend on the driver as to what texture sizes are supported...
    */
-  gboolean
+  CoglBool
   (* size_supported) (CoglContext *ctx,
                       GLenum gl_target,
                       GLenum gl_format,
@@ -152,7 +152,7 @@ struct _CoglTextureDriver
                       int width,
                       int height);
 
-  gboolean
+  CoglBool
   (* size_supported_3d) (CoglContext *ctx,
                          GLenum gl_target,
                          GLenum gl_format,
@@ -175,7 +175,7 @@ struct _CoglTextureDriver
    * creating a foreign texture. E.g. OpenGL supports ARB_texture_rectangle
    * but GLES doesn't
    */
-  gboolean
+  CoglBool
   (* allows_foreign_gl_target) (CoglContext *ctx,
                                 GLenum gl_target);
 
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h
index 3f7b0d5..1eeb9fd 100644
--- a/cogl/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
@@ -58,14 +58,14 @@ struct _CoglTextureVtable
   /* Virtual functions that must be implemented for a texture
      backend */
 
-  gboolean is_primitive;
+  CoglBool is_primitive;
 
   /* This should update the specified sub region of the texture with a
      sub region of the given bitmap. The bitmap is not converted
      before being passed so the implementation is expected to call
      _cogl_texture_prepare_for_upload with a suitable destination
      format before uploading */
-  gboolean (* set_region) (CoglTexture    *tex,
+  CoglBool (* set_region) (CoglTexture    *tex,
                            int             src_x,
                            int             src_y,
                            int             dst_x,
@@ -79,10 +79,10 @@ struct _CoglTextureVtable
      ctx->texture_driver->find_best_gl_get_data_format so it should
      always be a format that is valid for GL (ie, no conversion should
      be necessary). */
-  gboolean (* get_data) (CoglTexture     *tex,
-                         CoglPixelFormat  format,
-                         unsigned int     rowstride,
-                         guint8          *data);
+  CoglBool (* get_data) (CoglTexture *tex,
+                         CoglPixelFormat format,
+                         unsigned int rowstride,
+                         uint8_t *data);
 
   void (* foreach_sub_texture_in_region) (CoglTexture *tex,
                                           float virtual_tx_1,
@@ -94,9 +94,9 @@ struct _CoglTextureVtable
 
   int (* get_max_waste) (CoglTexture *tex);
 
-  gboolean (* is_sliced) (CoglTexture *tex);
+  CoglBool (* is_sliced) (CoglTexture *tex);
 
-  gboolean (* can_hardware_repeat) (CoglTexture *tex);
+  CoglBool (* can_hardware_repeat) (CoglTexture *tex);
 
   void (* transform_coords_to_gl) (CoglTexture *tex,
                                    float *s,
@@ -104,7 +104,7 @@ struct _CoglTextureVtable
   CoglTransformResult (* transform_quad_coords_to_gl) (CoglTexture *tex,
 						       float *coords);
 
-  gboolean (* get_gl_texture) (CoglTexture *tex,
+  CoglBool (* get_gl_texture) (CoglTexture *tex,
                                GLuint *out_gl_handle,
                                GLenum *out_gl_target);
 
@@ -127,11 +127,11 @@ struct _CoglTextureVtable
 
   CoglTextureType (* get_type) (CoglTexture *tex);
 
-  gboolean (* is_foreign) (CoglTexture *tex);
+  CoglBool (* is_foreign) (CoglTexture *tex);
 
   /* Only needs to be implemented if is_primitive == TRUE */
   void (* set_auto_mipmap) (CoglTexture *texture,
-                            gboolean value);
+                            CoglBool value);
 };
 
 struct _CoglTexture
@@ -165,7 +165,7 @@ struct _CoglTexturePixel
      each slice if a subregion is updated with a different format */
   GLenum gl_format;
   GLenum gl_type;
-  guint8 data[4];
+  uint8_t data[4];
 };
 
 void
@@ -190,7 +190,7 @@ _cogl_texture_register_texture_type (const CoglObjectClass *klass);
   (TypeName, type_name,                                                 \
    _cogl_texture_register_texture_type (&_cogl_##type_name##_class))
 
-gboolean
+CoglBool
 _cogl_texture_can_hardware_repeat (CoglTexture *texture);
 
 void
@@ -253,13 +253,13 @@ _cogl_texture_prep_gl_alignment_for_pixels_download (int bpp,
 /* Utility function to use as a fallback for getting the data of any
    texture via the framebuffer */
 
-gboolean
+CoglBool
 _cogl_texture_draw_and_read (CoglTexture *texture,
                              CoglBitmap  *target_bmp,
                              GLuint       target_gl_format,
                              GLuint       target_gl_type);
 
-gboolean
+CoglBool
 _cogl_texture_is_foreign (CoglTexture *texture);
 
 void
diff --git a/cogl/cogl-texture-rectangle-private.h b/cogl/cogl-texture-rectangle-private.h
index cfc7dc7..b00f0d2 100644
--- a/cogl/cogl-texture-rectangle-private.h
+++ b/cogl/cogl-texture-rectangle-private.h
@@ -45,7 +45,7 @@ struct _CoglTextureRectangle
   GLenum          mag_filter;
   GLint           wrap_mode_s;
   GLint           wrap_mode_t;
-  gboolean        is_foreign;
+  CoglBool        is_foreign;
 };
 
 CoglTextureRectangle *
diff --git a/cogl/cogl-texture-rectangle.c b/cogl/cogl-texture-rectangle.c
index e50c699..53d5a80 100644
--- a/cogl/cogl-texture-rectangle.c
+++ b/cogl/cogl-texture-rectangle.c
@@ -58,7 +58,7 @@ COGL_TEXTURE_DEFINE (TextureRectangle, texture_rectangle);
 
 static const CoglTextureVtable cogl_texture_rectangle_vtable;
 
-static gboolean
+static CoglBool
 can_use_wrap_mode (GLenum wrap_mode)
 {
   return (wrap_mode == GL_CLAMP ||
@@ -108,7 +108,7 @@ _cogl_texture_rectangle_free (CoglTextureRectangle *tex_rect)
   _cogl_texture_free (COGL_TEXTURE (tex_rect));
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_can_create (unsigned int width,
                                     unsigned int height,
                                     CoglPixelFormat internal_format,
@@ -154,7 +154,7 @@ _cogl_texture_rectangle_can_create (unsigned int width,
 
 static void
 _cogl_texture_rectangle_set_auto_mipmap (CoglTexture *tex,
-                                         gboolean value)
+                                         CoglBool value)
 {
   /* Rectangle textures currently never support mipmapping so there's
      no point in doing anything here */
@@ -396,13 +396,13 @@ _cogl_texture_rectangle_get_max_waste (CoglTexture *tex)
   return -1;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_is_sliced (CoglTexture *tex)
 {
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_can_hardware_repeat (CoglTexture *tex)
 {
   return FALSE;
@@ -424,7 +424,7 @@ _cogl_texture_rectangle_transform_quad_coords_to_gl (CoglTexture *tex,
                                                      float *coords)
 {
   CoglTextureRectangle *tex_rect = COGL_TEXTURE_RECTANGLE (tex);
-  gboolean need_repeat = FALSE;
+  CoglBool need_repeat = FALSE;
   int i;
 
   for (i = 0; i < 4; i++)
@@ -438,7 +438,7 @@ _cogl_texture_rectangle_transform_quad_coords_to_gl (CoglTexture *tex,
           : COGL_TRANSFORM_NO_REPEAT);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_get_gl_texture (CoglTexture *tex,
                                         GLuint *out_gl_handle,
                                         GLenum *out_gl_target)
@@ -500,7 +500,7 @@ _cogl_texture_rectangle_ensure_non_quad_rendering (CoglTexture *tex)
   /* Nothing needs to be done */
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_set_region (CoglTexture    *tex,
                                     int             src_x,
                                     int             src_y,
@@ -540,11 +540,11 @@ _cogl_texture_rectangle_set_region (CoglTexture    *tex,
   return TRUE;
 }
 
-static gboolean
-_cogl_texture_rectangle_get_data (CoglTexture     *tex,
-                                  CoglPixelFormat  format,
-                                  unsigned int     rowstride,
-                                  guint8          *data)
+static CoglBool
+_cogl_texture_rectangle_get_data (CoglTexture *tex,
+                                  CoglPixelFormat format,
+                                  unsigned int rowstride,
+                                  uint8_t *data)
 {
   CoglTextureRectangle *tex_rect = COGL_TEXTURE_RECTANGLE (tex);
   int                   bpp;
@@ -600,7 +600,7 @@ _cogl_texture_rectangle_get_height (CoglTexture *tex)
   return COGL_TEXTURE_RECTANGLE (tex)->height;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_rectangle_is_foreign (CoglTexture *tex)
 {
   return COGL_TEXTURE_RECTANGLE (tex)->is_foreign;
diff --git a/cogl/cogl-texture-rectangle.h b/cogl/cogl-texture-rectangle.h
index b538e47..a40c184 100644
--- a/cogl/cogl-texture-rectangle.h
+++ b/cogl/cogl-texture-rectangle.h
@@ -74,7 +74,7 @@ typedef struct _CoglTextureRectangle CoglTextureRectangle;
  * Return value: %TRUE if the object references a
  *               #CoglTextureRectangle, %FALSE otherwise.
  */
-gboolean
+CoglBool
 cogl_is_texture_rectangle (void *object);
 
 #define cogl_texture_rectangle_new_with_size \
diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c
index 900ae9e..d805604 100644
--- a/cogl/cogl-texture.c
+++ b/cogl/cogl-texture.c
@@ -79,7 +79,7 @@ _cogl_texture_register_texture_type (const CoglObjectClass *klass)
   ctxt->texture_types = g_slist_prepend (ctxt->texture_types, (void *) klass);
 }
 
-gboolean
+CoglBool
 cogl_is_texture (void *object)
 {
   CoglObject *obj = (CoglObject *)object;
@@ -140,7 +140,7 @@ _cogl_texture_free (CoglTexture *texture)
   g_free (texture);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_needs_premult_conversion (CoglPixelFormat src_format,
                                         CoglPixelFormat dst_format)
 {
@@ -330,7 +330,7 @@ cogl_texture_new_with_size (unsigned int     width,
 
   if (tex)
     {
-      gboolean auto_mipmap = !(flags & COGL_TEXTURE_NO_AUTO_MIPMAP);
+      CoglBool auto_mipmap = !(flags & COGL_TEXTURE_NO_AUTO_MIPMAP);
       cogl_primitive_texture_set_auto_mipmap (COGL_PRIMITIVE_TEXTURE (tex),
                                               auto_mipmap);
     }
@@ -350,13 +350,13 @@ cogl_texture_new_with_size (unsigned int     width,
 }
 
 CoglTexture *
-cogl_texture_new_from_data (unsigned int      width,
-			    unsigned int      height,
-                            CoglTextureFlags  flags,
-			    CoglPixelFormat   format,
-			    CoglPixelFormat   internal_format,
-			    unsigned int      rowstride,
-			    const guint8     *data)
+cogl_texture_new_from_data (unsigned int width,
+			    unsigned int height,
+                            CoglTextureFlags flags,
+			    CoglPixelFormat format,
+			    CoglPixelFormat internal_format,
+			    unsigned int rowstride,
+			    const uint8_t *data)
 {
   CoglBitmap *bmp;
   CoglTexture *tex;
@@ -378,7 +378,7 @@ cogl_texture_new_from_data (unsigned int      width,
                                   width, height,
                                   format,
                                   rowstride,
-                                  (guint8 *) data);
+                                  (uint8_t *) data);
 
   tex = cogl_texture_new_from_bitmap (bmp, flags, internal_format);
 
@@ -513,7 +513,7 @@ cogl_texture_new_from_foreign (GLuint           gl_handle,
     }
 }
 
-gboolean
+CoglBool
 _cogl_texture_is_foreign (CoglTexture *texture)
 {
   if (texture->vtable->is_foreign)
@@ -572,7 +572,7 @@ cogl_texture_get_max_waste (CoglTexture *texture)
   return texture->vtable->get_max_waste (texture);
 }
 
-gboolean
+CoglBool
 cogl_texture_is_sliced (CoglTexture *texture)
 {
   return texture->vtable->is_sliced (texture);
@@ -582,7 +582,7 @@ cogl_texture_is_sliced (CoglTexture *texture)
  * will be needed to iterate over multiple sub textures for regions whos
  * texture coordinates extend out of the range [0,1]
  */
-gboolean
+CoglBool
 _cogl_texture_can_hardware_repeat (CoglTexture *texture)
 {
   return texture->vtable->can_hardware_repeat (texture);
@@ -612,7 +612,7 @@ _cogl_texture_get_gl_format (CoglTexture *texture)
   return texture->vtable->get_gl_format (texture);
 }
 
-gboolean
+CoglBool
 cogl_texture_get_gl_texture (CoglTexture *texture,
 			     GLuint *out_gl_handle,
 			     GLenum *out_gl_target)
@@ -647,7 +647,7 @@ _cogl_texture_ensure_non_quad_rendering (CoglTexture *texture)
   texture->vtable->ensure_non_quad_rendering (texture);
 }
 
-gboolean
+CoglBool
 cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      int src_x,
                                      int src_y,
@@ -657,7 +657,7 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      unsigned int dst_height,
                                      CoglBitmap *bmp)
 {
-  gboolean ret;
+  CoglBool ret;
 
   _COGL_RETURN_VAL_IF_FAIL ((cogl_bitmap_get_width (bmp) - src_x)
                             >= dst_width, FALSE);
@@ -684,22 +684,22 @@ cogl_texture_set_region_from_bitmap (CoglTexture *texture,
   return ret;
 }
 
-gboolean
-cogl_texture_set_region (CoglTexture     *texture,
-			 int              src_x,
-			 int              src_y,
-			 int              dst_x,
-			 int              dst_y,
-			 unsigned int     dst_width,
-			 unsigned int     dst_height,
-			 int              width,
-			 int              height,
-			 CoglPixelFormat  format,
-			 unsigned int     rowstride,
-			 const guint8    *data)
+CoglBool
+cogl_texture_set_region (CoglTexture *texture,
+			 int src_x,
+			 int src_y,
+			 int dst_x,
+			 int dst_y,
+			 unsigned int dst_width,
+			 unsigned int dst_height,
+			 int width,
+			 int height,
+			 CoglPixelFormat format,
+			 unsigned int rowstride,
+			 const uint8_t *data)
 {
   CoglBitmap *source_bmp;
-  gboolean    ret;
+  CoglBool    ret;
 
   _COGL_GET_CONTEXT (ctx, FALSE);
 
@@ -719,7 +719,7 @@ cogl_texture_set_region (CoglTexture     *texture,
                                          width, height,
                                          format,
                                          rowstride,
-                                         (guint8 *) data);
+                                         (uint8_t *) data);
 
   ret = cogl_texture_set_region_from_bitmap (texture,
                                              src_x, src_y,
@@ -836,7 +836,7 @@ do_texture_draw_and_read (CoglTexture *texture,
  * NB: Normally this approach isn't normally used since we can just use
  * glGetTexImage, but may be used as a fallback in some circumstances.
  */
-gboolean
+CoglBool
 _cogl_texture_draw_and_read (CoglTexture *texture,
                              CoglBitmap  *target_bmp,
                              GLuint       target_gl_format,
@@ -915,12 +915,12 @@ _cogl_texture_draw_and_read (CoglTexture *texture,
   printf ("A bits: %d\n", a_bits); */
   if ((cogl_texture_get_format (texture) & COGL_A_BIT)/* && a_bits == 0*/)
     {
-      guint8 *srcdata;
-      guint8 *dstdata;
-      guint8 *srcpixel;
-      guint8 *dstpixel;
-      int     x,y;
-      int     alpha_rowstride = bpp * target_width;
+      uint8_t *srcdata;
+      uint8_t *dstdata;
+      uint8_t *srcpixel;
+      uint8_t *dstpixel;
+      int x,y;
+      int alpha_rowstride = bpp * target_width;
 
       if ((dstdata = _cogl_bitmap_map (target_bmp,
                                        COGL_BUFFER_ACCESS_WRITE,
@@ -977,20 +977,20 @@ _cogl_texture_draw_and_read (CoglTexture *texture,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 get_texture_bits_via_offscreen (CoglTexture    *texture,
                                 int             x,
                                 int             y,
                                 int             width,
                                 int             height,
-                                guint8         *dst_bits,
+                                uint8_t         *dst_bits,
                                 unsigned int    dst_rowstride,
                                 CoglPixelFormat dst_format)
 {
   CoglOffscreen *offscreen;
   CoglFramebuffer *framebuffer;
   CoglBitmap *bitmap;
-  gboolean ret;
+  CoglBool ret;
 
   _COGL_GET_CONTEXT (ctx, FALSE);
 
@@ -1023,19 +1023,19 @@ get_texture_bits_via_offscreen (CoglTexture    *texture,
   return ret;
 }
 
-static gboolean
-get_texture_bits_via_copy (CoglTexture    *texture,
-                           int             x,
-                           int             y,
-                           int             width,
-                           int             height,
-                           guint8         *dst_bits,
-                           unsigned int    dst_rowstride,
+static CoglBool
+get_texture_bits_via_copy (CoglTexture *texture,
+                           int x,
+                           int y,
+                           int width,
+                           int height,
+                           uint8_t *dst_bits,
+                           unsigned int dst_rowstride,
                            CoglPixelFormat dst_format)
 {
   unsigned int full_rowstride;
-  guint8 *full_bits;
-  gboolean ret = TRUE;
+  uint8_t *full_bits;
+  CoglBool ret = TRUE;
   int bpp;
   int full_tex_width, full_tex_height;
 
@@ -1052,8 +1052,8 @@ get_texture_bits_via_copy (CoglTexture    *texture,
                                  full_rowstride,
                                  full_bits))
     {
-      guint8 *dst = dst_bits;
-      guint8 *src = full_bits + x * bpp + y * full_rowstride;
+      uint8_t *dst = dst_bits;
+      uint8_t *src = full_bits + x * bpp + y * full_rowstride;
       int i;
 
       for (i = 0; i < height; i++)
@@ -1073,11 +1073,11 @@ get_texture_bits_via_copy (CoglTexture    *texture,
 
 typedef struct
 {
-  int         orig_width;
-  int         orig_height;
+  int orig_width;
+  int orig_height;
   CoglBitmap *target_bmp;
-  guint8     *target_bits;
-  gboolean    success;
+  uint8_t *target_bits;
+  CoglBool success;
 } CoglTextureGetData;
 
 static void
@@ -1102,7 +1102,7 @@ texture_get_cb (CoglTexture *texture,
   int x_in_bitmap = (int) (0.5 + tg_data->orig_width * virtual_coords[0]);
   int y_in_bitmap = (int) (0.5 + tg_data->orig_height * virtual_coords[1]);
 
-  guint8 *dst_bits;
+  uint8_t *dst_bits;
 
   if (!tg_data->success)
     return;
@@ -1147,10 +1147,10 @@ texture_get_cb (CoglTexture *texture,
 }
 
 int
-cogl_texture_get_data (CoglTexture     *texture,
-		       CoglPixelFormat  format,
-		       unsigned int     rowstride,
-		       guint8          *data)
+cogl_texture_get_data (CoglTexture *texture,
+		       CoglPixelFormat format,
+		       unsigned int rowstride,
+		       uint8_t *data)
 {
   int              bpp;
   int              byte_size;
@@ -1254,7 +1254,7 @@ cogl_texture_get_data (CoglTexture     *texture,
   if (closest_format != format)
     {
       CoglBitmap *new_bmp;
-      gboolean result;
+      CoglBool result;
 
       /* Convert to requested format directly into the user's buffer */
       new_bmp = cogl_bitmap_new_for_data (ctx,
diff --git a/cogl/cogl-texture.h b/cogl/cogl-texture.h
index 825e83d..d2d4252 100644
--- a/cogl/cogl-texture.h
+++ b/cogl/cogl-texture.h
@@ -179,7 +179,7 @@ cogl_texture_new_from_data (unsigned int      width,
                             CoglPixelFormat   format,
                             CoglPixelFormat   internal_format,
                             unsigned int      rowstride,
-                            const guint8     *data);
+                            const uint8_t     *data);
 
 /**
  * cogl_texture_new_from_foreign:
@@ -242,7 +242,7 @@ cogl_texture_new_from_bitmap (CoglBitmap *bitmap,
  * Return value: %TRUE if the @object references a texture, and
  *   %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_is_texture (void *object);
 
 /**
@@ -332,7 +332,7 @@ cogl_texture_get_max_waste (CoglTexture *texture);
  * Return value: %TRUE if the texture is sliced, %FALSE if the texture
  *   is stored as a single GPU texture
  */
-gboolean
+CoglBool
 cogl_texture_is_sliced (CoglTexture *texture);
 
 /**
@@ -351,7 +351,7 @@ cogl_texture_is_sliced (CoglTexture *texture);
  * Return value: %TRUE if the handle was successfully retrieved, %FALSE
  *   if the handle was invalid
  */
-gboolean
+CoglBool
 cogl_texture_get_gl_texture (CoglTexture *texture,
                              unsigned int *out_gl_handle,
                              unsigned int *out_gl_target);
@@ -379,7 +379,7 @@ int
 cogl_texture_get_data (CoglTexture *texture,
                        CoglPixelFormat format,
                        unsigned int rowstride,
-                       guint8 *data);
+                       uint8_t *data);
 
 /**
  * cogl_texture_set_region:
@@ -407,19 +407,19 @@ cogl_texture_get_data (CoglTexture *texture,
  * Return value: %TRUE if the subregion upload was successful, and
  *   %FALSE otherwise
  */
-gboolean
-cogl_texture_set_region (CoglTexture     *texture,
-                         int              src_x,
-                         int              src_y,
-                         int              dst_x,
-                         int              dst_y,
-                         unsigned int     dst_width,
-                         unsigned int     dst_height,
-                         int              width,
-                         int              height,
-                         CoglPixelFormat  format,
-                         unsigned int     rowstride,
-                         const guint8    *data);
+CoglBool
+cogl_texture_set_region (CoglTexture *texture,
+                         int src_x,
+                         int src_y,
+                         int dst_x,
+                         int dst_y,
+                         unsigned int dst_width,
+                         unsigned int dst_height,
+                         int width,
+                         int height,
+                         CoglPixelFormat format,
+                         unsigned int rowstride,
+                         const uint8_t *data);
 
 #if defined (COGL_ENABLE_EXPERIMENTAL_API)
 
@@ -450,7 +450,7 @@ cogl_texture_set_region (CoglTexture     *texture,
  * Since: 1.8
  * Stability: unstable
  */
-gboolean
+CoglBool
 cogl_texture_set_region_from_bitmap (CoglTexture *texture,
                                      int src_x,
                                      int src_y,
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index db5631a..adc2d6c 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -34,6 +34,44 @@
 
 G_BEGIN_DECLS
 
+/**
+ * CoglBool:
+ *
+ * A boolean data type used throughout the Cogl C api. This should be
+ * used in conjunction with the %TRUE and %FALSE macro defines for
+ * setting and testing boolean values.
+ *
+ * Since: 2.0
+ * Stability: stable
+ */
+typedef int CoglBool;
+
+/**
+ * TRUE:
+ *
+ * A constant to be used with #CoglBool types to indicate a boolean in
+ * the "true" state.
+ *
+ * Since: 2.0
+ * Stability: stable
+ */
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+/**
+ * TRUE:
+ *
+ * A constant to be used with #CoglBool types to indicate a boolean in
+ * the "false" state.
+ *
+ * Since: 2.0
+ * Stability: stable
+ */
+#ifndef FALSE
+#define FALSE 0
+#endif
+
 /* Some structures are meant to be opaque but they have public
    definitions because we want the size to be public so they can be
    allocated on the stack. This macro is used to ensure that users
@@ -142,7 +180,7 @@ typedef struct _CoglEuler CoglEuler;
  *
  * Fixed point number using a (16.16) notation.
  */
-typedef gint32 CoglFixed;
+typedef int32_t CoglFixed;
 
 #define COGL_TYPE_FIXED         (cogl_fixed_get_type ())
 GType
@@ -156,7 +194,7 @@ cogl_fixed_get_type (void) G_GNUC_CONST;
  *
  * Since: 1.0
  */
-typedef gint32 CoglAngle;
+typedef int32_t CoglAngle;
 
 typedef struct _CoglColor               CoglColor;
 typedef struct _CoglTextureVertex       CoglTextureVertex;
@@ -420,17 +458,17 @@ typedef enum
 struct _CoglColor
 {
   /*< private >*/
-  guint8 COGL_PRIVATE (red);
-  guint8 COGL_PRIVATE (green);
-  guint8 COGL_PRIVATE (blue);
+  uint8_t COGL_PRIVATE (red);
+  uint8_t COGL_PRIVATE (green);
+  uint8_t COGL_PRIVATE (blue);
 
-  guint8 COGL_PRIVATE (alpha);
+  uint8_t COGL_PRIVATE (alpha);
 
   /* padding in case we want to change to floats at
    * some point */
-  guint32 COGL_PRIVATE (padding0);
-  guint32 COGL_PRIVATE (padding1);
-  guint32 COGL_PRIVATE (padding2);
+  uint32_t COGL_PRIVATE (padding0);
+  uint32_t COGL_PRIVATE (padding1);
+  uint32_t COGL_PRIVATE (padding2);
 };
 COGL_STRUCT_SIZE_ASSERT (CoglColor, 16);
 
diff --git a/cogl/cogl-util.c b/cogl/cogl-util.c
index 0b1b4b7..e8ffb04 100644
--- a/cogl/cogl-util.c
+++ b/cogl/cogl-util.c
@@ -151,8 +151,8 @@ _cogl_util_pixel_format_from_masks_real (unsigned long r_mask,
                                          unsigned long g_mask,
                                          unsigned long b_mask,
                                          int depth, int bpp,
-                                         gboolean check_bgr,
-                                         gboolean check_afirst,
+                                         CoglBool check_bgr,
+                                         CoglBool check_afirst,
                                          int recursion_depth)
 {
   CoglPixelFormat image_format;
@@ -220,7 +220,7 @@ _cogl_util_pixel_format_from_masks (unsigned long r_mask,
                                     unsigned long g_mask,
                                     unsigned long b_mask,
                                     int depth, int bpp,
-                                    gboolean byte_order_is_lsb_first)
+                                    CoglBool byte_order_is_lsb_first)
 {
   CoglPixelFormat image_format =
     _cogl_util_pixel_format_from_masks_real (r_mask, g_mask, b_mask,
diff --git a/cogl/cogl-util.h b/cogl/cogl-util.h
index 5cd6897..698391a 100644
--- a/cogl/cogl-util.h
+++ b/cogl/cogl-util.h
@@ -87,12 +87,12 @@ _cogl_util_next_p2 (int a);
    It xors the integer reinterpretations of -1.0f and 1.0f. In theory
    they should only differ by the signbit so that gives a mask for the
    sign which we can just test against the value */
-static inline gboolean
+static inline CoglBool
 cogl_util_float_signbit (float x)
 {
-  static const union { float f; guint32 i; } negative_one = { -1.0f };
-  static const union { float f; guint32 i; } positive_one = { +1.0f };
-  union { float f; guint32 i; } value = { x };
+  static const union { float f; uint32_t i; } negative_one = { -1.0f };
+  static const union { float f; uint32_t i; } positive_one = { +1.0f };
+  union { float f; uint32_t i; } value = { x };
 
   return !!((negative_one.i ^ positive_one.i) & value.i);
 }
@@ -107,7 +107,7 @@ cogl_util_float_signbit (float x)
 #define COGL_UTIL_NEARBYINT(x) ((int) ((x) < 0.0f ? (x) - 0.5f : (x) + 0.5f))
 
 /* Returns whether the given integer is a power of two */
-static inline gboolean
+static inline CoglBool
 _cogl_util_is_pot (unsigned int num)
 {
   /* Make sure there is only one bit set */
diff --git a/cogl/cogl-vector.c b/cogl/cogl-vector.c
index 818d6a5..7984db4 100644
--- a/cogl/cogl-vector.c
+++ b/cogl/cogl-vector.c
@@ -54,8 +54,8 @@ cogl_vector3_init_zero (float *vector)
   memset (vector, 0, sizeof (float) * 3);
 }
 
-gboolean
-cogl_vector3_equal (gconstpointer v1, gconstpointer v2)
+CoglBool
+cogl_vector3_equal (const void *v1, const void *v2)
 {
   float *vector0 = (float *)v1;
   float *vector1 = (float *)v2;
@@ -72,7 +72,7 @@ cogl_vector3_equal (gconstpointer v1, gconstpointer v2)
     vector0[Z] == vector1[Z];
 }
 
-gboolean
+CoglBool
 cogl_vector3_equal_with_epsilon (const float *vector0,
                                  const float *vector1,
                                  float epsilon)
@@ -227,8 +227,8 @@ cogl_vector4_init_from_vector4 (float *vector, float *src)
   *vector4 = *src;
 }
 
-gboolean
-cogl_vector4_equal (gconstpointer *v0, gconstpointer *v1)
+CoglBool
+cogl_vector4_equal (const void *v0, const void *v1)
 {
   _COGL_RETURN_VAL_IF_FAIL (v1 != NULL, FALSE);
   _COGL_RETURN_VAL_IF_FAIL (v2 != NULL, FALSE);
diff --git a/cogl/cogl-vector.h b/cogl/cogl-vector.h
index c6824d6..01c6006 100644
--- a/cogl/cogl-vector.h
+++ b/cogl/cogl-vector.h
@@ -93,8 +93,8 @@ cogl_vector3_init_zero (float *vector);
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
-cogl_vector3_equal (gconstpointer v1, gconstpointer v2);
+CoglBool
+cogl_vector3_equal (const void *v1, const void *v2);
 
 /**
  * cogl_vector3_equal_with_epsilon:
@@ -117,7 +117,7 @@ cogl_vector3_equal (gconstpointer v1, gconstpointer v2);
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_vector3_equal_with_epsilon (const float *vector0,
                                  const float *vector1,
                                  float epsilon);
diff --git a/cogl/cogl-vertex-buffer-private.h b/cogl/cogl-vertex-buffer-private.h
index e16950c..7c800a9 100644
--- a/cogl/cogl-vertex-buffer-private.h
+++ b/cogl/cogl-vertex-buffer-private.h
@@ -85,7 +85,7 @@ typedef struct _CoglVertexBufferAttrib
   /* TODO: look at breaking up the flags into seperate
    * bitfields and seperate enums */
   CoglVertexBufferAttribFlags   flags:24;
-  guint8		   id;
+  uint8_t	           id;
   GQuark		   name;
   char                    *name_without_detail;
   union _u
@@ -95,9 +95,9 @@ typedef struct _CoglVertexBufferAttrib
   } u;
   CoglAttributeType        type;
   size_t		   span_bytes;
-  guint16		   stride;
-  guint8		   n_components;
-  guint8		   texture_unit;
+  uint16_t                 stride;
+  uint8_t                  n_components;
+  uint8_t                  texture_unit;
 
   int                      attribute_first;
   CoglAttribute           *attribute;
@@ -148,7 +148,7 @@ typedef struct _CoglVertexBuffer
    * modifying a buffer. */
   GList  *new_attributes; /*!< attributes pending submission */
 
-  gboolean dirty_attributes;
+  CoglBool dirty_attributes;
 
   CoglPrimitive *primitive;
 
diff --git a/cogl/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c
index 7628c05..6b7630d 100644
--- a/cogl/cogl-vertex-buffer.c
+++ b/cogl/cogl-vertex-buffer.c
@@ -156,8 +156,8 @@ cogl_vertex_buffer_get_n_vertices (CoglHandle handle)
  */
 static CoglVertexBufferAttribFlags
 validate_gl_attribute (const char *gl_attribute,
-		       guint8 n_components,
-		       guint8 *texture_unit)
+		       uint8_t n_components,
+		       uint8_t *texture_unit)
 {
   CoglVertexBufferAttribFlags type;
   char *detail_seperator = NULL;
@@ -225,8 +225,8 @@ validate_gl_attribute (const char *gl_attribute,
  */
 static CoglVertexBufferAttribFlags
 validate_cogl_attribute (const char *cogl_attribute,
-		         guint8 n_components,
-		         guint8 *texture_unit)
+		         uint8_t n_components,
+		         uint8_t *texture_unit)
 {
   CoglVertexBufferAttribFlags type;
   char *detail_seperator = NULL;
@@ -298,7 +298,7 @@ validate_cogl_attribute (const char *cogl_attribute,
  *
  * maybe I should hang a compiled regex somewhere to handle this
  */
-static gboolean
+static CoglBool
 validate_custom_attribute_name (const char *attribute_name)
 {
   char *detail_seperator = NULL;
@@ -432,19 +432,19 @@ canonize_attribute_name (const char *attribute_name)
 void
 cogl_vertex_buffer_add (CoglHandle         handle,
 		        const char        *attribute_name,
-			guint8             n_components,
+			uint8_t            n_components,
 			CoglAttributeType  type,
-			gboolean           normalized,
-			guint16            stride,
+			CoglBool           normalized,
+			uint16_t           stride,
 			const void        *pointer)
 {
   CoglVertexBuffer *buffer;
   char *cogl_attribute_name;
   GQuark name_quark;
-  gboolean modifying_an_attrib = FALSE;
+  CoglBool modifying_an_attrib = FALSE;
   CoglVertexBufferAttrib *attribute;
   CoglVertexBufferAttribFlags flags = 0;
-  guint8 texture_unit = 0;
+  uint8_t texture_unit = 0;
   GList *tmp;
   char *detail;
 
@@ -606,7 +606,7 @@ cogl_vertex_buffer_delete (CoglHandle handle,
 static void
 set_attribute_enable (CoglHandle handle,
 		      const char *attribute_name,
-		      gboolean state)
+		      CoglBool state)
 {
   CoglVertexBuffer *buffer;
   char *cogl_attribute_name = canonize_attribute_name (attribute_name);
@@ -979,12 +979,12 @@ prep_strided_vbo_for_upload (CoglVertexBufferVBO *cogl_vbo)
   return lowest_pointer;
 }
 
-static gboolean
+static CoglBool
 upload_multipack_vbo_via_map_buffer (CoglVertexBufferVBO *cogl_vbo)
 {
   GList *tmp;
   unsigned int offset = 0;
-  guint8 *buf;
+  uint8_t *buf;
 
   _COGL_GET_CONTEXT (ctx, FALSE);
 
@@ -1087,7 +1087,7 @@ cogl_vertex_buffer_vbo_resolve (CoglVertexBuffer *buffer,
   GList *conflicts;
   GList *tmp;
   GList *next;
-  gboolean found_target_vbo = FALSE;
+  CoglBool found_target_vbo = FALSE;
 
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -1507,7 +1507,7 @@ weak_override_source_destroyed_cb (CoglPipeline *pipeline,
   unref_pipeline_priv (pipeline_priv);
 }
 
-static gboolean
+static CoglBool
 validate_layer_cb (CoglPipeline *pipeline,
                    int layer_index,
                    void *user_data)
@@ -1521,7 +1521,7 @@ validate_layer_cb (CoglPipeline *pipeline,
       CoglPipelineWrapMode wrap_s;
       CoglPipelineWrapMode wrap_t;
       CoglPipelineWrapMode wrap_p;
-      gboolean need_override_source = FALSE;
+      CoglBool need_override_source = FALSE;
 
       /* By default COGL_PIPELINE_WRAP_MODE_AUTOMATIC becomes
        * GL_CLAMP_TO_EDGE but we want GL_REPEAT to maintain
diff --git a/cogl/cogl-vertex-buffer.h b/cogl/cogl-vertex-buffer.h
index 631ba09..5b95fb3 100644
--- a/cogl/cogl-vertex-buffer.h
+++ b/cogl/cogl-vertex-buffer.h
@@ -163,10 +163,10 @@ cogl_vertex_buffer_get_n_vertices (CoglHandle handle);
 void
 cogl_vertex_buffer_add (CoglHandle         handle,
 		        const char        *attribute_name,
-			guint8             n_components,
+			uint8_t            n_components,
 			CoglAttributeType  type,
-			gboolean           normalized,
-			guint16            stride,
+			CoglBool           normalized,
+			uint16_t           stride,
 			const void        *pointer);
 
 /**
@@ -386,7 +386,7 @@ cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices);
  *
  * Since: 1.0
  */
-gboolean
+CoglBool
 cogl_is_vertex_buffer (CoglHandle handle);
 
 /**
@@ -401,7 +401,7 @@ cogl_is_vertex_buffer (CoglHandle handle);
  *
  * Since: 1.4
  */
-gboolean
+CoglBool
 cogl_is_vertex_buffer_indices (CoglHandle handle);
 
 G_END_DECLS
diff --git a/cogl/cogl-xlib-renderer-private.h b/cogl/cogl-xlib-renderer-private.h
index d0715c1..0c73b5c 100644
--- a/cogl/cogl-xlib-renderer-private.h
+++ b/cogl/cogl-xlib-renderer-private.h
@@ -43,7 +43,7 @@ typedef struct _CoglXlibRenderer
   CoglPollFD poll_fd;
 } CoglXlibRenderer;
 
-gboolean
+CoglBool
 _cogl_xlib_renderer_connect (CoglRenderer *renderer, GError **error);
 
 void
@@ -85,7 +85,7 @@ void
 _cogl_xlib_renderer_poll_get_info (CoglRenderer *renderer,
                                    CoglPollFD **poll_fds,
                                    int *n_poll_fds,
-                                   gint64 *timeout);
+                                   int64_t *timeout);
 
 void
 _cogl_xlib_renderer_poll_dispatch (CoglRenderer *renderer,
diff --git a/cogl/cogl-xlib-renderer.c b/cogl/cogl-xlib-renderer.c
index 1bbbe14..9ae7765 100644
--- a/cogl/cogl-xlib-renderer.c
+++ b/cogl/cogl-xlib-renderer.c
@@ -190,7 +190,7 @@ assert_xlib_display (CoglRenderer *renderer, GError **error)
   return xdpy;
 }
 
-gboolean
+CoglBool
 _cogl_xlib_renderer_connect (CoglRenderer *renderer, GError **error)
 {
   CoglXlibRenderer *xlib_renderer =
@@ -274,7 +274,7 @@ void
 _cogl_xlib_renderer_poll_get_info (CoglRenderer *renderer,
                                    CoglPollFD **poll_fds,
                                    int *n_poll_fds,
-                                   gint64 *timeout)
+                                   int64_t *timeout)
 {
   CoglXlibRenderer *xlib_renderer = _cogl_xlib_renderer_get_data (renderer);
 
diff --git a/cogl/cogl-xlib-renderer.h b/cogl/cogl-xlib-renderer.h
index c22d2e5..a636170 100644
--- a/cogl/cogl-xlib-renderer.h
+++ b/cogl/cogl-xlib-renderer.h
@@ -144,7 +144,7 @@ cogl_xlib_renderer_set_foreign_display (CoglRenderer *renderer,
  */
 void
 cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
-                                                gboolean enable);
+                                                CoglBool enable);
 
 #define cogl_xlib_renderer_get_display cogl_xlib_renderer_get_display_EXP
 Display *
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 95d8d5f..7608f53 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -97,7 +97,7 @@ cogl_get_proc_address (const char* name)
   return _cogl_renderer_get_proc_address (ctx->display->renderer, name);
 }
 
-gboolean
+CoglBool
 _cogl_check_extension (const char *name, const gchar *ext)
 {
   char *end;
@@ -123,7 +123,7 @@ _cogl_check_extension (const char *name, const gchar *ext)
 }
 
 /* XXX: This has been deprecated as public API */
-gboolean
+CoglBool
 cogl_check_extension (const char *name, const char *ext)
 {
   return _cogl_check_extension (name, ext);
@@ -139,7 +139,7 @@ cogl_clear (const CoglColor *color, unsigned long buffers)
 
 /* XXX: This API has been deprecated */
 void
-cogl_set_depth_test_enabled (gboolean setting)
+cogl_set_depth_test_enabled (CoglBool setting)
 {
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -154,7 +154,7 @@ cogl_set_depth_test_enabled (gboolean setting)
 }
 
 /* XXX: This API has been deprecated */
-gboolean
+CoglBool
 cogl_get_depth_test_enabled (void)
 {
   _COGL_GET_CONTEXT (ctx, FALSE);
@@ -162,7 +162,7 @@ cogl_get_depth_test_enabled (void)
 }
 
 void
-cogl_set_backface_culling_enabled (gboolean setting)
+cogl_set_backface_culling_enabled (CoglBool setting)
 {
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
@@ -177,7 +177,7 @@ cogl_set_backface_culling_enabled (gboolean setting)
     ctx->legacy_state_set--;
 }
 
-gboolean
+CoglBool
 cogl_get_backface_culling_enabled (void)
 {
   _COGL_GET_CONTEXT (ctx, FALSE);
@@ -244,7 +244,7 @@ cogl_get_features (void)
   return ctx->feature_flags;
 }
 
-gboolean
+CoglBool
 cogl_features_available (CoglFeatureFlags features)
 {
   _COGL_GET_CONTEXT (ctx, 0);
@@ -252,13 +252,13 @@ cogl_features_available (CoglFeatureFlags features)
   return (ctx->feature_flags & features) == features;
 }
 
-gboolean
+CoglBool
 cogl_has_feature (CoglContext *ctx, CoglFeatureID feature)
 {
   return COGL_FLAGS_GET (ctx->features, feature);
 }
 
-gboolean
+CoglBool
 cogl_has_features (CoglContext *ctx, ...)
 {
   va_list args;
@@ -371,7 +371,7 @@ cogl_read_pixels (int x,
                   int height,
                   CoglReadPixelsFlags source,
                   CoglPixelFormat format,
-                  guint8 *pixels)
+                  uint8_t *pixels)
 {
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (format);
   CoglBitmap *bitmap;
@@ -399,7 +399,7 @@ cogl_begin_gl (void)
 
   if (ctx->in_begin_gl_block)
     {
-      static gboolean shown = FALSE;
+      static CoglBool shown = FALSE;
       if (!shown)
         g_warning ("You should not nest cogl_begin_gl/cogl_end_gl blocks");
       shown = TRUE;
@@ -455,7 +455,7 @@ cogl_end_gl (void)
 
   if (!ctx->in_begin_gl_block)
     {
-      static gboolean shown = FALSE;
+      static CoglBool shown = FALSE;
       if (!shown)
         g_warning ("cogl_end_gl is being called before cogl_begin_gl");
       shown = TRUE;
@@ -573,11 +573,11 @@ typedef struct _CoglSourceState
      necessary because some internal Cogl code expects to be able to
      push a temporary pipeline to put GL into a known state. For that
      to work it also needs to prevent applying the legacy state */
-  gboolean enable_legacy;
+  CoglBool enable_legacy;
 } CoglSourceState;
 
 static void
-_push_source_real (CoglPipeline *pipeline, gboolean enable_legacy)
+_push_source_real (CoglPipeline *pipeline, CoglBool enable_legacy)
 {
   CoglSourceState *top = g_slice_new (CoglSourceState);
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@@ -606,7 +606,7 @@ cogl_push_source (void *material_or_pipeline)
    never applies the legacy state. Some parts of Cogl use this
    internally to set a temporary pipeline with a known state */
 void
-_cogl_push_source (CoglPipeline *pipeline, gboolean enable_legacy)
+_cogl_push_source (CoglPipeline *pipeline, CoglBool enable_legacy)
 {
   CoglSourceState *top;
 
@@ -664,7 +664,7 @@ cogl_get_source (void)
   return top->pipeline;
 }
 
-gboolean
+CoglBool
 _cogl_get_enable_legacy_state (void)
 {
   CoglSourceState *top;
@@ -720,10 +720,10 @@ cogl_set_source_texture (CoglTexture *texture)
 }
 
 void
-cogl_set_source_color4ub (guint8 red,
-                          guint8 green,
-                          guint8 blue,
-                          guint8 alpha)
+cogl_set_source_color4ub (uint8_t red,
+                          uint8_t green,
+                          uint8_t blue,
+                          uint8_t alpha)
 {
   CoglColor c = { 0, };
 
@@ -792,7 +792,7 @@ _cogl_error_quark (void)
 void
 _cogl_init (void)
 {
-  static gsize init_status = 0;
+  static size_t init_status = 0;
 
   if (g_once_init_enter (&init_status))
     {
@@ -840,7 +840,7 @@ _cogl_pixel_format_get_bytes_per_pixel (CoglPixelFormat format)
 
 /* Note: this also refers to the mapping defined above for
  * _cogl_pixel_format_get_bytes_per_pixel() */
-gboolean
+CoglBool
 _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format)
 {
   int aligned_lut[] = { -1, 1,  1,  1,
diff --git a/cogl/cogl1-context.h b/cogl/cogl1-context.h
index c59bd69..401b055 100644
--- a/cogl/cogl1-context.h
+++ b/cogl/cogl1-context.h
@@ -77,7 +77,7 @@ cogl_get_features (void);
  *
  * Return value: %TRUE if the features are available, %FALSE otherwise.
  */
-gboolean
+CoglBool
 cogl_features_available (CoglFeatureFlags features);
 
 /**
@@ -109,10 +109,10 @@ cogl_get_proc_address (const char *name);
  *   not appropriate to expose OpenGL extensions through the Cogl API. This
  *   function can be replaced by the following equivalent code:
  * |[
- *   gboolean retval = (strstr (ext, name) != NULL) ? TRUE : FALSE;
+ *   CoglBool retval = (strstr (ext, name) != NULL) ? TRUE : FALSE;
  * ]|
  */
-gboolean
+CoglBool
 cogl_check_extension (const char *name,
                       const char *ext) G_GNUC_DEPRECATED;
 
@@ -393,7 +393,7 @@ cogl_get_viewport (float v[4]);
  * instead.
  */
 void
-cogl_set_depth_test_enabled (gboolean setting);
+cogl_set_depth_test_enabled (CoglBool setting);
 
 /**
  * cogl_get_depth_test_enabled:
@@ -405,7 +405,7 @@ cogl_set_depth_test_enabled (gboolean setting);
  * Deprecated: 1.4: Use cogl_material_get_depth_test_enabled()
  * instead.
  */
-gboolean
+CoglBool
 cogl_get_depth_test_enabled (void);
 
 /**
@@ -419,7 +419,7 @@ cogl_get_depth_test_enabled (void);
  * cogl_vertex_buffer_draw*. Backface culling is disabled by default.
  */
 void
-cogl_set_backface_culling_enabled (gboolean setting);
+cogl_set_backface_culling_enabled (CoglBool setting);
 
 /**
  * cogl_get_backface_culling_enabled:
@@ -429,7 +429,7 @@ cogl_set_backface_culling_enabled (gboolean setting);
  *
  * Return value: %TRUE if backface culling is enabled, and %FALSE otherwise
  */
-gboolean
+CoglBool
 cogl_get_backface_culling_enabled (void);
 
 /**
@@ -581,10 +581,10 @@ cogl_set_source_color (const CoglColor *color);
  * Since: 1.0
  */
 void
-cogl_set_source_color4ub (guint8 red,
-                          guint8 green,
-                          guint8 blue,
-                          guint8 alpha);
+cogl_set_source_color4ub (uint8_t red,
+                          uint8_t green,
+                          uint8_t blue,
+                          uint8_t alpha);
 
 /**
  * cogl_set_source_color4f:
@@ -1044,7 +1044,7 @@ cogl_read_pixels (int x,
                   int height,
                   CoglReadPixelsFlags source,
                   CoglPixelFormat format,
-                  guint8 *pixels);
+                  uint8_t *pixels);
 
 /**
  * cogl_flush:
diff --git a/cogl/cogl2-compatibility.c b/cogl/cogl2-compatibility.c
index bae88c2..a474c89 100644
--- a/cogl/cogl2-compatibility.c
+++ b/cogl/cogl2-compatibility.c
@@ -55,11 +55,11 @@ cogl_swap_chain_error_quark (void);
 GQuark
 cogl_texture_3d_error_quark (void);
 
-gboolean
+CoglBool
 cogl_index_buffer_allocate (CoglIndexBuffer *indices,
                             GError *error);
 
-gboolean
+CoglBool
 cogl_is_journal (void *object);
 
 void
@@ -95,14 +95,14 @@ cogl_texture_3d_error_quark (void)
   return g_quark_from_static_string ("cogl-texture-3d-error-quark");
 }
 
-gboolean
+CoglBool
 cogl_index_buffer_allocate (CoglIndexBuffer *indices,
                             GError *error)
 {
   return TRUE;
 }
 
-gboolean
+CoglBool
 cogl_is_journal (void *object)
 {
   /* There's no way to get a pointer to a journal so this will never
diff --git a/cogl/cogl2-path.c b/cogl/cogl2-path.c
index c2b8bbc..3934015 100644
--- a/cogl/cogl2-path.c
+++ b/cogl/cogl2-path.c
@@ -157,7 +157,7 @@ cogl2_path_get_fill_rule (CoglPath *path)
 
 static void
 _cogl_path_add_node (CoglPath *path,
-                     gboolean new_sub_path,
+                     CoglBool new_sub_path,
 		     float x,
 		     float y)
 {
@@ -280,7 +280,7 @@ _cogl_path_fill_nodes_with_clipped_rectangle (CoglPath *path)
   if (!(path->data->context->private_feature_flags &
         COGL_PRIVATE_FEATURE_STENCIL_BUFFER))
     {
-      static gboolean seen_warning = FALSE;
+      static CoglBool seen_warning = FALSE;
 
       if (!seen_warning)
         {
@@ -300,10 +300,10 @@ _cogl_path_fill_nodes_with_clipped_rectangle (CoglPath *path)
   cogl_framebuffer_pop_clip (fb);
 }
 
-static gboolean
+static CoglBool
 validate_layer_cb (CoglPipelineLayer *layer, void *user_data)
 {
-  gboolean *needs_fallback = user_data;
+  CoglBool *needs_fallback = user_data;
   CoglTexture *texture = _cogl_pipeline_layer_get_texture (layer);
 
   /* If any of the layers of the current pipeline contain sliced
@@ -502,7 +502,7 @@ cogl2_path_rectangle (CoglPath *path,
                       float x_2,
                       float y_2)
 {
-  gboolean is_rectangle;
+  CoglBool is_rectangle;
 
   /* If the path was previously empty and the rectangle isn't mirrored
      then we'll record that this is a simple rectangle path so that we
@@ -520,7 +520,7 @@ cogl2_path_rectangle (CoglPath *path,
   path->data->is_rectangle = is_rectangle;
 }
 
-gboolean
+CoglBool
 _cogl_path_is_rectangle (CoglPath *path)
 {
   return path->data->is_rectangle;
@@ -1040,7 +1040,7 @@ struct _CoglPathTesselator
      combine callback is called */
   GArray *vertices;
   /* Array of integers for the indices into the vertices array. Each
-     element will either be guint8, guint16 or guint32 depending on
+     element will either be uint8_t, uint16_t or uint32_t depending on
      the number of vertices */
   GArray *indices;
   CoglIndicesType indices_type;
@@ -1082,15 +1082,15 @@ _cogl_path_tesselator_allocate_indices_array (CoglPathTesselator *tess)
   switch (tess->indices_type)
     {
     case COGL_INDICES_TYPE_UNSIGNED_BYTE:
-      tess->indices = g_array_new (FALSE, FALSE, sizeof (guint8));
+      tess->indices = g_array_new (FALSE, FALSE, sizeof (uint8_t));
       break;
 
     case COGL_INDICES_TYPE_UNSIGNED_SHORT:
-      tess->indices = g_array_new (FALSE, FALSE, sizeof (guint16));
+      tess->indices = g_array_new (FALSE, FALSE, sizeof (uint16_t));
       break;
 
     case COGL_INDICES_TYPE_UNSIGNED_INT:
-      tess->indices = g_array_new (FALSE, FALSE, sizeof (guint32));
+      tess->indices = g_array_new (FALSE, FALSE, sizeof (uint32_t));
       break;
     }
 }
@@ -1102,21 +1102,21 @@ _cogl_path_tesselator_add_index (CoglPathTesselator *tess, int vertex_index)
     {
     case COGL_INDICES_TYPE_UNSIGNED_BYTE:
       {
-        guint8 val = vertex_index;
+        uint8_t val = vertex_index;
         g_array_append_val (tess->indices, val);
       }
       break;
 
     case COGL_INDICES_TYPE_UNSIGNED_SHORT:
       {
-        guint16 val = vertex_index;
+        uint16_t val = vertex_index;
         g_array_append_val (tess->indices, val);
       }
       break;
 
     case COGL_INDICES_TYPE_UNSIGNED_INT:
       {
-        guint32 val = vertex_index;
+        uint32_t val = vertex_index;
         g_array_append_val (tess->indices, val);
       }
       break;
@@ -1240,21 +1240,21 @@ _cogl_path_tesselator_combine (double coords[3],
           for (i = 0; i < old_vertices->len; i++)
             _cogl_path_tesselator_add_index (tess,
                                              g_array_index (old_vertices,
-                                                            guint8, i));
+                                                            uint8_t, i));
           break;
 
         case COGL_INDICES_TYPE_UNSIGNED_SHORT:
           for (i = 0; i < old_vertices->len; i++)
             _cogl_path_tesselator_add_index (tess,
                                              g_array_index (old_vertices,
-                                                            guint16, i));
+                                                            uint16_t, i));
           break;
 
         case COGL_INDICES_TYPE_UNSIGNED_INT:
           for (i = 0; i < old_vertices->len; i++)
             _cogl_path_tesselator_add_index (tess,
                                              g_array_index (old_vertices,
-                                                            guint32, i));
+                                                            uint32_t, i));
           break;
         }
 
diff --git a/cogl/cogl2-path.h b/cogl/cogl2-path.h
index f702c4a..88d88eb 100644
--- a/cogl/cogl2-path.h
+++ b/cogl/cogl2-path.h
@@ -99,7 +99,7 @@ cogl_path_copy (CoglPath *path);
  *
  * Since: 2.0
  */
-gboolean
+CoglBool
 cogl_is_path (void *object);
 
 #define cogl_path_move_to cogl2_path_move_to
diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c
index e2674c4..1ff3f2c 100644
--- a/cogl/driver/gl/cogl-gl.c
+++ b/cogl/driver/gl/cogl-gl.c
@@ -33,7 +33,7 @@
 #include "cogl-feature-private.h"
 #include "cogl-renderer-private.h"
 
-static gboolean
+static CoglBool
 _cogl_driver_pixel_format_from_gl_internal (CoglContext *context,
                                             GLenum gl_int_format,
                                             CoglPixelFormat *out_format)
@@ -219,7 +219,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
   return required_format;
 }
 
-static gboolean
+static CoglBool
 _cogl_get_gl_version (CoglContext *ctx,
                       int *major_out,
                       int *minor_out)
@@ -256,7 +256,7 @@ _cogl_get_gl_version (CoglContext *ctx,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 check_gl_version (CoglContext *ctx,
                   GError **error)
 {
@@ -305,7 +305,7 @@ check_gl_version (CoglContext *ctx,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_driver_update_features (CoglContext *ctx,
                               GError **error)
 {
diff --git a/cogl/driver/gl/cogl-texture-driver-gl.c b/cogl/driver/gl/cogl-texture-driver-gl.c
index 4f8b8f5..6d0a908 100644
--- a/cogl/driver/gl/cogl-texture-driver-gl.c
+++ b/cogl/driver/gl/cogl-texture-driver-gl.c
@@ -154,7 +154,7 @@ static void
 _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
                                              GLenum       gl_target,
                                              GLuint       gl_handle,
-                                             gboolean     is_foreign,
+                                             CoglBool     is_foreign,
                                              int          src_x,
                                              int          src_y,
                                              int          dst_x,
@@ -165,7 +165,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
 				             GLuint       source_gl_format,
 				             GLuint       source_gl_type)
 {
-  guint8 *data;
+  uint8_t *data;
   CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
 
@@ -195,13 +195,13 @@ static void
 _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
                                    GLenum       gl_target,
                                    GLuint       gl_handle,
-                                   gboolean     is_foreign,
+                                   CoglBool     is_foreign,
                                    CoglBitmap  *source_bmp,
                                    GLint        internal_gl_format,
                                    GLuint       source_gl_format,
                                    GLuint       source_gl_type)
 {
-  guint8 *data;
+  uint8_t *data;
   CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
 
@@ -230,7 +230,7 @@ static void
 _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
                                       GLenum       gl_target,
                                       GLuint       gl_handle,
-                                      gboolean     is_foreign,
+                                      CoglBool     is_foreign,
                                       GLint        height,
                                       GLint        depth,
                                       CoglBitmap  *source_bmp,
@@ -238,7 +238,7 @@ _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
                                       GLuint       source_gl_format,
                                       GLuint       source_gl_type)
 {
-  guint8 *data;
+  uint8_t *data;
   CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
 
@@ -267,12 +267,12 @@ _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
   _cogl_bitmap_unbind (source_bmp);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_gl_get_tex_image (CoglContext *ctx,
                                        GLenum gl_target,
                                        GLenum dest_gl_format,
                                        GLenum dest_gl_type,
-                                       guint8 *dest)
+                                       uint8_t *dest)
 {
   GE (ctx, glGetTexImage (gl_target,
                           0, /* level */
@@ -282,7 +282,7 @@ _cogl_texture_driver_gl_get_tex_image (CoglContext *ctx,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_size_supported_3d (CoglContext *ctx,
                                         GLenum gl_target,
                                         GLenum gl_format,
@@ -311,7 +311,7 @@ _cogl_texture_driver_size_supported_3d (CoglContext *ctx,
   return new_width != 0;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_size_supported (CoglContext *ctx,
                                      GLenum gl_target,
                                      GLenum gl_format,
@@ -356,7 +356,7 @@ _cogl_texture_driver_try_setting_gl_border_color
                              transparent_color) );
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_allows_foreign_gl_target (CoglContext *ctx,
                                                GLenum gl_target)
 {
diff --git a/cogl/driver/gles/cogl-gles.c b/cogl/driver/gles/cogl-gles.c
index d7503b7..1e07f20 100644
--- a/cogl/driver/gles/cogl-gles.c
+++ b/cogl/driver/gles/cogl-gles.c
@@ -33,7 +33,7 @@
 #include "cogl-renderer-private.h"
 #include "cogl-private.h"
 
-static gboolean
+static CoglBool
 _cogl_driver_pixel_format_from_gl_internal (CoglContext *context,
                                             GLenum gl_int_format,
                                             CoglPixelFormat *out_format)
@@ -157,7 +157,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
   return required_format;
 }
 
-static gboolean
+static CoglBool
 _cogl_driver_update_features (CoglContext *context,
                               GError **error)
 {
diff --git a/cogl/driver/gles/cogl-texture-driver-gles.c b/cogl/driver/gles/cogl-texture-driver-gles.c
index 0cbb986..50f8e30 100644
--- a/cogl/driver/gles/cogl-texture-driver-gles.c
+++ b/cogl/driver/gles/cogl-texture-driver-gles.c
@@ -172,7 +172,7 @@ static void
 _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
                                              GLenum       gl_target,
                                              GLuint       gl_handle,
-                                             gboolean     is_foreign,
+                                             CoglBool     is_foreign,
                                              int          src_x,
                                              int          src_y,
                                              int          dst_x,
@@ -183,7 +183,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
 				             GLuint       source_gl_format,
 				             GLuint       source_gl_type)
 {
-  guint8 *data;
+  uint8_t *data;
   CoglPixelFormat source_format = cogl_bitmap_get_format (source_bmp);
   int bpp = _cogl_pixel_format_get_bytes_per_pixel (source_format);
   CoglBitmap *slice_bmp;
@@ -235,7 +235,7 @@ static void
 _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
                                    GLenum       gl_target,
                                    GLuint       gl_handle,
-                                   gboolean     is_foreign,
+                                   CoglBool     is_foreign,
                                    CoglBitmap  *source_bmp,
                                    GLint        internal_gl_format,
                                    GLuint       source_gl_format,
@@ -247,7 +247,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
   int bmp_width = cogl_bitmap_get_width (source_bmp);
   int bmp_height = cogl_bitmap_get_height (source_bmp);
   CoglBitmap *bmp;
-  guint8 *data;
+  uint8_t *data;
 
   bmp = prepare_bitmap_alignment_for_upload (ctx, source_bmp);
   rowstride = cogl_bitmap_get_rowstride (bmp);
@@ -276,7 +276,7 @@ static void
 _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
                                       GLenum       gl_target,
                                       GLuint       gl_handle,
-                                      gboolean     is_foreign,
+                                      CoglBool     is_foreign,
                                       GLint        height,
                                       GLint        depth,
                                       CoglBitmap  *source_bmp,
@@ -289,7 +289,7 @@ _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
   int rowstride = cogl_bitmap_get_rowstride (source_bmp);
   int bmp_width = cogl_bitmap_get_width (source_bmp);
   int bmp_height = cogl_bitmap_get_height (source_bmp);
-  guint8 *data;
+  uint8_t *data;
 
   _cogl_bind_gl_texture_transient (gl_target, gl_handle, is_foreign);
 
@@ -378,17 +378,17 @@ _cogl_texture_driver_upload_to_gl_3d (CoglContext *ctx,
 /* NB: GLES doesn't support glGetTexImage2D, so cogl-texture will instead
  * fallback to a generic render + readpixels approach to downloading
  * texture data. (See _cogl_texture_draw_and_read() ) */
-static gboolean
+static CoglBool
 _cogl_texture_driver_gl_get_tex_image (CoglContext *ctx,
                                        GLenum gl_target,
                                        GLenum dest_gl_format,
                                        GLenum dest_gl_type,
-                                       guint8 *dest)
+                                       uint8_t *dest)
 {
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_size_supported_3d (CoglContext *ctx,
                                         GLenum gl_target,
                                         GLenum gl_format,
@@ -407,7 +407,7 @@ _cogl_texture_driver_size_supported_3d (CoglContext *ctx,
   return width <= max_size && height <= max_size && depth <= max_size;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_size_supported (CoglContext *ctx,
                                      GLenum gl_target,
                                      GLenum gl_format,
@@ -433,7 +433,7 @@ _cogl_texture_driver_try_setting_gl_border_color
   /* FAIL! */
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_driver_allows_foreign_gl_target (CoglContext *ctx,
                                                GLenum gl_target)
 {
diff --git a/cogl/stb_image.c b/cogl/stb_image.c
index 1aaef60..ed88485 100644
--- a/cogl/stb_image.c
+++ b/cogl/stb_image.c
@@ -14,10 +14,10 @@
       writes BMP,TGA (define STBI_NO_WRITE to remove code)
       decoded from memory or through stdio FILE (define STBI_NO_STDIO to remove code)
       supports installable dequantizing-IDCT, YCbCr-to-RGB conversion (define STBI_SIMD)
-        
+
    TODO:
       stbi_info_*
-  
+
    history:
       1.18   fix a threading bug (local mutable static)
       1.17   support interlaced PNG
@@ -82,7 +82,7 @@
 // Basic usage (see HDR discussion below):
 //    int x,y,n;
 //    unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
-//    // ... process data if not NULL ... 
+//    // ... process data if not NULL ...
 //    // ... x = width, y = height, n = # 8-bit components per pixel ...
 //    // ... replace '0' with '1'..'4' to force that many components per pixel
 //    stbi_image_free(data)
@@ -143,7 +143,7 @@
 // (linear) floats to preserve the full dynamic range:
 //
 //    float *data = stbi_loadf(filename, &x, &y, &n, 0);
-// 
+//
 // If you load LDR images through this interface, those images will
 // be promoted to floating point values, run through the inverse of
 // constants corresponding to the above:
@@ -218,7 +218,7 @@ extern void   stbi_ldr_to_hdr_scale(float scale);
 
 // get a VERY brief reason for failure
 // NOT THREADSAFE
-extern char    *stbi_failure_reason  (void); 
+extern char    *stbi_failure_reason  (void);
 
 // free the loaded image -- this is just free()
 extern void     stbi_image_free      (void *retval_from_stbi_load);
@@ -328,12 +328,12 @@ extern int stbi_register_loader(stbi_loader *loader);
 
 // define faster low-level operations (typically SIMD support)
 #if STBI_SIMD
-typedef void (*stbi_idct_8x8)(guint8 *out, int out_stride, short data[64], unsigned short *dequantize);
+typedef void (*stbi_idct_8x8)(uint8_t *out, int out_stride, short data[64], unsigned short *dequantize);
 // compute an integer IDCT on "input"
 //     input[x] = data[x] * dequantize[x]
 //     write results to 'out': 64 samples, each run of 8 spaced by 'out_stride'
 //                             CLAMP results to 0..255
-typedef void (*stbi_YCbCr_to_RGB_run)(guint8 *output, guint8 const *y, guint8 const *cb, guint8 const *cr, int count, int step);
+typedef void (*stbi_YCbCr_to_RGB_run)(uint8_t *output, uint8_t const *y, uint8_t const *cb, uint8_t const *cr, int count, int step);
 // compute a conversion from YCbCr to RGB
 //     'count' pixels
 //     write pixels to 'output'; each pixel is 'step' bytes (either 3 or 4; if 4, write '255' as 4th), order R,G,B
@@ -379,7 +379,7 @@ extern void stbi_install_YCbCr_to_RGB(stbi_YCbCr_to_RGB_run func);
 
 
 // should produce compiler error if size is wrong
-typedef unsigned char validate_guint32[sizeof(guint32)==4];
+typedef unsigned char validate_uint32_t[sizeof(uint32_t)==4];
 
 #if defined(STBI_NO_STDIO) && !defined(STBI_NO_WRITE)
 #define STBI_NO_WRITE
@@ -621,13 +621,13 @@ enum
 
 typedef struct
 {
-   guint32 img_x, img_y;
+   uint32_t img_x, img_y;
    int img_n, img_out_n;
 
    #ifndef STBI_NO_STDIO
    FILE  *img_file;
    #endif
-   guint8 *img_buffer, *img_buffer_end;
+   uint8_t *img_buffer, *img_buffer_end;
 } stbi;
 
 #ifndef STBI_NO_STDIO
@@ -637,13 +637,13 @@ static void start_file(stbi *s, FILE *f)
 }
 #endif
 
-static void start_mem(stbi *s, guint8 const *buffer, int len)
+static void start_mem(stbi *s, uint8_t const *buffer, int len)
 {
 #ifndef STBI_NO_STDIO
    s->img_file = NULL;
 #endif
-   s->img_buffer = (guint8 *) buffer;
-   s->img_buffer_end = (guint8 *) buffer+len;
+   s->img_buffer = (uint8_t *) buffer;
+   s->img_buffer_end = (uint8_t *) buffer+len;
 }
 
 __forceinline static int get8(stbi *s)
@@ -665,12 +665,12 @@ __forceinline static int at_eof(stbi *s)
    if (s->img_file)
       return feof(s->img_file);
 #endif
-   return s->img_buffer >= s->img_buffer_end;   
+   return s->img_buffer >= s->img_buffer_end;
 }
 
-__forceinline static guint8 get8u(stbi *s)
+__forceinline static uint8_t get8u(stbi *s)
 {
-   return (guint8) get8(s);
+   return (uint8_t) get8(s);
 }
 
 static void skip(stbi *s, int n)
@@ -689,9 +689,9 @@ static int get16(stbi *s)
    return (z << 8) + get8(s);
 }
 
-static guint32 get32(stbi *s)
+static uint32_t get32(stbi *s)
 {
-   guint32 z = get16(s);
+   uint32_t z = get16(s);
    return (z << 16) + get16(s);
 }
 
@@ -701,9 +701,9 @@ static int get16le(stbi *s)
    return z + (get8(s) << 8);
 }
 
-static guint32 get32le(stbi *s)
+static uint32_t get32le(stbi *s)
 {
-   guint32 z = get16le(s);
+   uint32_t z = get16le(s);
    return z + (get16le(s) << 16);
 }
 
@@ -730,12 +730,16 @@ static void getn(stbi *s, stbi_uc *buffer, int n)
 //  assume data buffer is malloced, so malloc a new one and free that one
 //  only failure mode is malloc failing
 
-static guint8 compute_y(int r, int g, int b)
+static uint8_t compute_y(int r, int g, int b)
 {
-   return (guint8) (((r*77) + (g*150) +  (29*b)) >> 8);
+   return (uint8_t) (((r*77) + (g*150) +  (29*b)) >> 8);
 }
 
-static unsigned char *convert_format(unsigned char *data, int img_n, int req_comp, guint x, guint y)
+static unsigned char *convert_format(unsigned char *data,
+                                     int img_n,
+                                     int req_comp,
+                                     unsigned int x,
+                                     unsigned int y)
 {
    int i,j;
    unsigned char *good;
@@ -856,13 +860,13 @@ static stbi_uc *hdr_to_ldr(float   *data, int x, int y, int comp)
 
 typedef struct
 {
-   guint8  fast[1 << FAST_BITS];
+   uint8_t fast[1 << FAST_BITS];
    // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
-   guint16 code[256];
-   guint8  values[256];
-   guint8  size[257];
+   uint16_t code[256];
+   uint8_t values[256];
+   uint8_t size[257];
    unsigned int maxcode[18];
-   int    delta[17];   // old 'firstsymbol' - old 'firstcode'
+   int delta[17];   // old 'firstsymbol' - old 'firstcode'
 } huffman;
 
 typedef struct
@@ -873,7 +877,7 @@ typedef struct
    stbi s;
    huffman huff_dc[4];
    huffman huff_ac[4];
-   guint8 dequant[4][64];
+   uint8_t dequant[4][64];
 
 // sizes for components, interleaved MCUs
    int img_h_max, img_v_max;
@@ -890,12 +894,12 @@ typedef struct
       int dc_pred;
 
       int x,y,w2,h2;
-      guint8 *data;
+      uint8_t *data;
       void *raw_data;
-      guint8 *linebuf;
+      uint8_t *linebuf;
    } img_comp[4];
 
-   guint32         code_buffer; // jpeg entropy-coded buffer
+   uint32_t         code_buffer; // jpeg entropy-coded buffer
    int            code_bits;   // number of valid bits
    unsigned char  marker;      // marker seen while filling entropy buffer
    int            nomore;      // flag if we saw a marker so must stop
@@ -910,7 +914,7 @@ static int build_huffman(huffman *h, int *count)
    // build size list for each symbol (from JPEG spec)
    for (i=0; i < 16; ++i)
       for (j=0; j < count[i]; ++j)
-         h->size[k++] = (guint8) (i+1);
+         h->size[k++] = (uint8_t) (i+1);
    h->size[k] = 0;
 
    // compute actual symbols (from jpeg spec)
@@ -921,7 +925,7 @@ static int build_huffman(huffman *h, int *count)
       h->delta[j] = k - code;
       if (h->size[k] == j) {
          while (h->size[k] == j)
-            h->code[k++] = (guint16) (code++);
+            h->code[k++] = (uint16_t) (code++);
          if (code-1 >= (1 << j)) return e("bad code lengths","Corrupt JPEG");
       }
       // compute largest code + 1 for this size, preshifted as needed later
@@ -938,7 +942,7 @@ static int build_huffman(huffman *h, int *count)
          int c = h->code[i] << (FAST_BITS-s);
          int m = 1 << (FAST_BITS-s);
          for (j=0; j < m; ++j) {
-            h->fast[c+j] = (guint8) i;
+            h->fast[c+j] = (uint8_t) i;
          }
       }
    }
@@ -963,7 +967,7 @@ static void grow_buffer_unsafe(jpeg *j)
 }
 
 // (1 << n) - 1
-static guint32 bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
+static uint32_t bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
 
 // decode a jpeg huffman value from the bitstream
 __forceinline static int decode(jpeg *j, huffman *h)
@@ -1035,7 +1039,7 @@ __forceinline static int extend_receive(jpeg *j, int n)
 
 // given a value that's at position X in the zigzag stream,
 // where does it appear in the 8x8 matrix coded as row-major?
-static guint8 dezigzag[64+15] =
+static uint8_t dezigzag[64+15] =
 {
     0,  1,  8, 16,  9,  2,  3, 10,
    17, 24, 32, 25, 18, 11,  4,  5,
@@ -1086,7 +1090,7 @@ static int decode_block(jpeg *j, short data[64], huffman *hdc, huffman *hac, int
 }
 
 // take a -128..127 value and clamp it and convert to 0..255
-__forceinline static guint8 clamp(int x)
+__forceinline static uint8_t clamp(int x)
 {
    x += 128;
    // trick to use a single test to catch both cases
@@ -1094,7 +1098,7 @@ __forceinline static guint8 clamp(int x)
       if (x < 0) return 0;
       if (x > 255) return 255;
    }
-   return (guint8) x;
+   return (uint8_t) x;
 }
 
 #define f2f(x)  (int) (((x) * 4096 + 0.5))
@@ -1140,10 +1144,10 @@ __forceinline static guint8 clamp(int x)
 
 #if !STBI_SIMD
 // .344 seconds on 3*anemones.jpg
-static void idct_block(guint8 *out, int out_stride, short data[64], guint8 *dequantize)
+static void idct_block(uint8_t *out, int out_stride, short data[64], uint8_t *dequantize)
 {
    int i,val[64],*v=val;
-   guint8 *o,*dq = dequantize;
+   uint8_t *o,*dq = dequantize;
    short *d = data;
 
    // columns
@@ -1192,10 +1196,10 @@ static void idct_block(guint8 *out, int out_stride, short data[64], guint8 *dequ
    }
 }
 #else
-static void idct_block(guint8 *out, int out_stride, short data[64], unsigned short *dequantize)
+static void idct_block(uint8_t *out, int out_stride, short data[64], unsigned short *dequantize)
 {
    int i,val[64],*v=val;
-   guint8 *o;
+   uint8_t *o;
    unsigned short *dq = dequantize;
    short *d = data;
 
@@ -1256,9 +1260,9 @@ extern void stbi_install_idct(stbi_idct_8x8 func)
 // if there's a pending marker from the entropy stream, return that
 // otherwise, fetch from the stream and get a marker. if there's no
 // marker, return 0xff, which is never a valid marker value
-static guint8 get_marker(jpeg *j)
+static uint8_t get_marker(jpeg *j)
 {
-   guint8 x;
+   uint8_t x;
    if (j->marker != MARKER_none) { x = j->marker; j->marker = MARKER_none; return x; }
    x = get8u(&j->s);
    if (x != 0xff) return MARKER_none;
@@ -1393,7 +1397,7 @@ static int process_marker(jpeg *z, int m)
       case 0xC4: // DHT - define huffman table
          L = get16(&z->s)-2;
          while (L > 0) {
-            guint8 *v;
+            uint8_t *v;
             int sizes[16],i,m=0;
             int q = get8(&z->s);
             int tc = q >> 4;
@@ -1516,7 +1520,7 @@ static int process_frame_header(jpeg *z, int scan)
          return e("outofmem", "Out of memory");
       }
       // align blocks for installable-idct using mmx/sse
-      z->img_comp[i].data = (guint8*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
+      z->img_comp[i].data = (uint8_t*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
       z->img_comp[i].linebuf = NULL;
    }
 
@@ -1571,17 +1575,17 @@ static int decode_jpeg_image(jpeg *j)
 
 // static jfif-centered resampling (across block boundaries)
 
-typedef guint8 *(*resample_row_func)(guint8 *out, guint8 *in0, guint8 *in1,
-                                    int w, int hs);
+typedef uint8_t *(*resample_row_func)(uint8_t *out, uint8_t *in0, uint8_t *in1,
+                                      int w, int hs);
 
-#define div4(x) ((guint8) ((x) >> 2))
+#define div4(x) ((uint8_t) ((x) >> 2))
 
-static guint8 *resample_row_1(guint8 *out, guint8 *in_near, guint8 *in_far, int w, int hs)
+static uint8_t *resample_row_1(uint8_t *out, uint8_t *in_near, uint8_t *in_far, int w, int hs)
 {
    return in_near;
 }
 
-static guint8* resample_row_v_2(guint8 *out, guint8 *in_near, guint8 *in_far, int w, int hs)
+static uint8_t* resample_row_v_2(uint8_t *out, uint8_t *in_near, uint8_t *in_far, int w, int hs)
 {
    // need to generate two samples vertically for every one in input
    int i;
@@ -1590,11 +1594,11 @@ static guint8* resample_row_v_2(guint8 *out, guint8 *in_near, guint8 *in_far, in
    return out;
 }
 
-static guint8*  resample_row_h_2(guint8 *out, guint8 *in_near, guint8 *in_far, int w, int hs)
+static uint8_t*  resample_row_h_2(uint8_t *out, uint8_t *in_near, uint8_t *in_far, int w, int hs)
 {
    // need to generate two samples horizontally for every one in input
    int i;
-   guint8 *input = in_near;
+   uint8_t *input = in_near;
    if (w == 1) {
       // if only one sample, can't do any interpolation
       out[0] = out[1] = input[0];
@@ -1613,9 +1617,9 @@ static guint8*  resample_row_h_2(guint8 *out, guint8 *in_near, guint8 *in_far, i
    return out;
 }
 
-#define div16(x) ((guint8) ((x) >> 4))
+#define div16(x) ((uint8_t) ((x) >> 4))
 
-static guint8 *resample_row_hv_2(guint8 *out, guint8 *in_near, guint8 *in_far, int w, int hs)
+static uint8_t *resample_row_hv_2(uint8_t *out, uint8_t *in_near, uint8_t *in_far, int w, int hs)
 {
    // need to generate 2x2 samples for every one in input
    int i,t0,t1;
@@ -1636,7 +1640,7 @@ static guint8 *resample_row_hv_2(guint8 *out, guint8 *in_near, guint8 *in_far, i
    return out;
 }
 
-static guint8 *resample_row_generic(guint8 *out, guint8 *in_near, guint8 *in_far, int w, int hs)
+static uint8_t *resample_row_generic(uint8_t *out, uint8_t *in_near, uint8_t *in_far, int w, int hs)
 {
    // resample with nearest-neighbor
    int i,j;
@@ -1650,7 +1654,7 @@ static guint8 *resample_row_generic(guint8 *out, guint8 *in_near, guint8 *in_far
 
 // 0.38 seconds on 3*anemones.jpg   (0.25 with processor = Pro)
 // VC6 without processor=Pro is generating multiple LEAs per multiply!
-static void YCbCr_to_RGB_row(guint8 *out, const guint8 *y, const guint8 *pcb, const guint8 *pcr, int count, int step)
+static void YCbCr_to_RGB_row(uint8_t *out, const uint8_t *y, const uint8_t *pcb, const uint8_t *pcr, int count, int step)
 {
    int i;
    for (i=0; i < count; ++i) {
@@ -1667,9 +1671,9 @@ static void YCbCr_to_RGB_row(guint8 *out, const guint8 *y, const guint8 *pcb, co
       if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
       if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
       if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
-      out[0] = (guint8)r;
-      out[1] = (guint8)g;
-      out[2] = (guint8)b;
+      out[0] = (uint8_t)r;
+      out[1] = (uint8_t)g;
+      out[2] = (uint8_t)b;
       out[3] = 255;
       out += step;
    }
@@ -1704,14 +1708,14 @@ static void cleanup_jpeg(jpeg *j)
 typedef struct
 {
    resample_row_func resample;
-   guint8 *line0,*line1;
+   uint8_t *line0,*line1;
    int hs,vs;   // expansion factor in each axis
-   int w_lores; // horizontal pixels pre-expansion 
+   int w_lores; // horizontal pixels pre-expansion
    int ystep;   // how far through vertical expansion we are
    int ypos;    // which pre-expansion row we're on
 } stbi_resample;
 
-static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
+static uint8_t *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
 {
    int n, decode_n;
    // validate req_comp
@@ -1732,9 +1736,9 @@ static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int r
    // resample and color-convert
    {
       int k;
-      guint i,j;
-      guint8 *output;
-      guint8 *coutput[4];
+      unsigned int i,j;
+      uint8_t *output;
+      uint8_t *coutput[4];
 
       stbi_resample res_comp[4];
 
@@ -1743,7 +1747,7 @@ static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int r
 
          // allocate line buffer big enough for upsampling off the edges
          // with upsample factor of 4
-         z->img_comp[k].linebuf = (guint8 *) malloc(z->s.img_x + 3);
+         z->img_comp[k].linebuf = (uint8_t *) malloc(z->s.img_x + 3);
          if (!z->img_comp[k].linebuf) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
 
          r->hs      = z->img_h_max / z->img_comp[k].h;
@@ -1761,12 +1765,12 @@ static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int r
       }
 
       // can't error after this so, this is safe
-      output = (guint8 *) malloc(n * z->s.img_x * z->s.img_y + 1);
+      output = (uint8_t *) malloc(n * z->s.img_x * z->s.img_y + 1);
       if (!output) { cleanup_jpeg(z); return epuc("outofmem", "Out of memory"); }
 
       // now go ahead and resample
       for (j=0; j < z->s.img_y; ++j) {
-         guint8 *out = output + n * z->s.img_x * j;
+         uint8_t *out = output + n * z->s.img_x * j;
          for (k=0; k < decode_n; ++k) {
             stbi_resample *r = &res_comp[k];
             int y_bot = r->ystep >= (r->vs >> 1);
@@ -1782,7 +1786,7 @@ static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int r
             }
          }
          if (n >= 3) {
-            guint8 *y = coutput[0];
+            uint8_t *y = coutput[0];
             if (z->s.img_n == 3) {
                #if STBI_SIMD
                stbi_YCbCr_installed(out, y, coutput[1], coutput[2], z->s.img_x, n);
@@ -1796,7 +1800,7 @@ static guint8 *load_jpeg_image(jpeg *z, int *out_x, int *out_y, int *comp, int r
                   out += n;
                }
          } else {
-            guint8 *y = coutput[0];
+            uint8_t *y = coutput[0];
             if (n == 1)
                for (i=0; i < z->s.img_x; ++i) out[i] = y[i];
             else
@@ -1879,12 +1883,12 @@ extern int      stbi_jpeg_info_from_memory(stbi_uc const *buffer, int len, int *
 // (jpegs packs from left, zlib from right, so can't share code)
 typedef struct
 {
-   guint16 fast[1 << ZFAST_BITS];
-   guint16 firstcode[16];
+   uint16_t fast[1 << ZFAST_BITS];
+   uint16_t firstcode[16];
    int maxcode[17];
-   guint16 firstsymbol[16];
-   guint8  size[288];
-   guint16 value[288]; 
+   uint16_t firstsymbol[16];
+   uint8_t size[288];
+   uint16_t value[288];
 } zhuffman;
 
 __forceinline static int bitreverse16(int n)
@@ -1904,7 +1908,7 @@ __forceinline static int bit_reverse(int v, int bits)
    return bitreverse16(v) >> (16-bits);
 }
 
-static int zbuild_huffman(zhuffman *z, guint8 *sizelist, int num)
+static int zbuild_huffman(zhuffman *z, uint8_t *sizelist, int num)
 {
    int i,k=0;
    int code, next_code[16], sizes[17];
@@ -1912,7 +1916,7 @@ static int zbuild_huffman(zhuffman *z, guint8 *sizelist, int num)
    // DEFLATE spec for generating codes
    memset(sizes, 0, sizeof(sizes));
    memset(z->fast, 255, sizeof(z->fast));
-   for (i=0; i < num; ++i) 
+   for (i=0; i < num; ++i)
       ++sizes[sizelist[i]];
    sizes[0] = 0;
    for (i=1; i < 16; ++i)
@@ -1920,8 +1924,8 @@ static int zbuild_huffman(zhuffman *z, guint8 *sizelist, int num)
    code = 0;
    for (i=1; i < 16; ++i) {
       next_code[i] = code;
-      z->firstcode[i] = (guint16) code;
-      z->firstsymbol[i] = (guint16) k;
+      z->firstcode[i] = (uint16_t) code;
+      z->firstsymbol[i] = (uint16_t) k;
       code = (code + sizes[i]);
       if (sizes[i])
          if (code-1 >= (1 << i)) return e("bad codelengths","Corrupt JPEG");
@@ -1934,12 +1938,12 @@ static int zbuild_huffman(zhuffman *z, guint8 *sizelist, int num)
       int s = sizelist[i];
       if (s) {
          int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
-         z->size[c] = (guint8)s;
-         z->value[c] = (guint16)i;
+         z->size[c] = (uint8_t)s;
+         z->value[c] = (uint16_t)i;
          if (s <= ZFAST_BITS) {
             int k = bit_reverse(next_code[s],s);
             while (k < (1 << ZFAST_BITS)) {
-               z->fast[k] = (guint16) c;
+               z->fast[k] = (uint16_t) c;
                k += (1 << s);
             }
          }
@@ -1957,9 +1961,9 @@ static int zbuild_huffman(zhuffman *z, guint8 *sizelist, int num)
 
 typedef struct
 {
-   guint8 *zbuffer, *zbuffer_end;
+   uint8_t *zbuffer, *zbuffer_end;
    int num_bits;
-   guint32 code_buffer;
+   uint32_t code_buffer;
 
    char *zout;
    char *zout_start;
@@ -1991,7 +1995,7 @@ __forceinline static unsigned int zreceive(zbuf *z, int n)
    k = z->code_buffer & ((1 << n) - 1);
    z->code_buffer >>= n;
    z->num_bits -= n;
-   return k;   
+   return k;
 }
 
 __forceinline static int zhuffman_decode(zbuf *a, zhuffman *z)
@@ -2043,7 +2047,7 @@ static int length_base[31] = {
    15,17,19,23,27,31,35,43,51,59,
    67,83,99,115,131,163,195,227,258,0,0 };
 
-static int length_extra[31]= 
+static int length_extra[31]=
 { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
 
 static int dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
@@ -2061,7 +2065,7 @@ static int parse_huffman_block(zbuf *a)
          if (a->zout >= a->zout_end) if (!expand(a, 1)) return 0;
          *a->zout++ = (char) z;
       } else {
-         guint8 *p;
+         uint8_t *p;
          int len,dist;
          if (z == 256) return 1;
          z -= 257;
@@ -2073,7 +2077,7 @@ static int parse_huffman_block(zbuf *a)
          if (dist_extra[z]) dist += zreceive(a, dist_extra[z]);
          if (a->zout - a->zout_start < dist) return e("bad dist","Corrupt PNG");
          if (a->zout + len > a->zout_end) if (!expand(a, len)) return 0;
-         p = (guint8 *) (a->zout - dist);
+         p = (uint8_t *) (a->zout - dist);
          while (len--)
             *a->zout++ = *p++;
       }
@@ -2082,10 +2086,10 @@ static int parse_huffman_block(zbuf *a)
 
 static int compute_huffman_codes(zbuf *a)
 {
-   static guint8 length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
+   static uint8_t length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
    zhuffman z_codelength;
-   guint8 lencodes[286+32+137];//padding for maximum single op
-   guint8 codelength_sizes[19];
+   uint8_t lencodes[286+32+137];//padding for maximum single op
+   uint8_t codelength_sizes[19];
    int i,n;
 
    int hlit  = zreceive(a,5) + 257;
@@ -2095,7 +2099,7 @@ static int compute_huffman_codes(zbuf *a)
    memset(codelength_sizes, 0, sizeof(codelength_sizes));
    for (i=0; i < hclen; ++i) {
       int s = zreceive(a,3);
-      codelength_sizes[length_dezigzag[i]] = (guint8) s;
+      codelength_sizes[length_dezigzag[i]] = (uint8_t) s;
    }
    if (!zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
 
@@ -2104,7 +2108,7 @@ static int compute_huffman_codes(zbuf *a)
       int c = zhuffman_decode(a, &z_codelength);
       assert(c >= 0 && c < 19);
       if (c < 16)
-         lencodes[n++] = (guint8) c;
+         lencodes[n++] = (uint8_t) c;
       else if (c == 16) {
          c = zreceive(a,2)+3;
          memset(lencodes+n, lencodes[n-1], c);
@@ -2128,21 +2132,21 @@ static int compute_huffman_codes(zbuf *a)
 
 static int parse_uncompressed_block(zbuf *a)
 {
-   guint8 header[4];
+   uint8_t header[4];
    int len,nlen,k;
    if (a->num_bits & 7)
       zreceive(a, a->num_bits & 7); // discard
    // drain the bit-packed data into header
    k = 0;
    while (a->num_bits > 0) {
-      header[k++] = (guint8) (a->code_buffer & 255); // wtf this warns?
+      header[k++] = (uint8_t) (a->code_buffer & 255); // wtf this warns?
       a->code_buffer >>= 8;
       a->num_bits -= 8;
    }
    assert(a->num_bits == 0);
    // now fill header the normal way
    while (k < 4)
-      header[k++] = (guint8) zget8(a);
+      header[k++] = (uint8_t) zget8(a);
    len  = header[1] * 256 + header[0];
    nlen = header[3] * 256 + header[2];
    if (nlen != (len ^ 0xffff)) return e("zlib corrupt","Corrupt PNG");
@@ -2169,7 +2173,7 @@ static int parse_zlib_header(zbuf *a)
 }
 
 // @TODO: should statically initialize these for optimal thread safety
-static guint8 default_length[288], default_distance[32];
+static uint8_t default_length[288], default_distance[32];
 static void init_defaults(void)
 {
    int i;   // use <= to match clearly with spec
@@ -2228,8 +2232,8 @@ char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial
    zbuf a;
    char *p = (char *) malloc(initial_size);
    if (p == NULL) return NULL;
-   a.zbuffer = (guint8 *) buffer;
-   a.zbuffer_end = (guint8 *) buffer + len;
+   a.zbuffer = (uint8_t *) buffer;
+   a.zbuffer_end = (uint8_t *) buffer + len;
    if (do_zlib(&a, p, initial_size, 1, 1)) {
       if (outlen) *outlen = (int) (a.zout - a.zout_start);
       return a.zout_start;
@@ -2247,8 +2251,8 @@ char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
 int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
 {
    zbuf a;
-   a.zbuffer = (guint8 *) ibuffer;
-   a.zbuffer_end = (guint8 *) ibuffer + ilen;
+   a.zbuffer = (uint8_t *) ibuffer;
+   a.zbuffer_end = (uint8_t *) ibuffer + ilen;
    if (do_zlib(&a, obuffer, olen, 0, 1))
       return (int) (a.zout - a.zout_start);
    else
@@ -2260,8 +2264,8 @@ char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
    zbuf a;
    char *p = (char *) malloc(16384);
    if (p == NULL) return NULL;
-   a.zbuffer = (guint8 *) buffer;
-   a.zbuffer_end = (guint8 *) buffer+len;
+   a.zbuffer = (uint8_t *) buffer;
+   a.zbuffer_end = (uint8_t *) buffer+len;
    if (do_zlib(&a, p, 16384, 1, 0)) {
       if (outlen) *outlen = (int) (a.zout - a.zout_start);
       return a.zout_start;
@@ -2274,8 +2278,8 @@ char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
 int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
 {
    zbuf a;
-   a.zbuffer = (guint8 *) ibuffer;
-   a.zbuffer_end = (guint8 *) ibuffer + ilen;
+   a.zbuffer = (uint8_t *) ibuffer;
+   a.zbuffer_end = (uint8_t *) ibuffer + ilen;
    if (do_zlib(&a, obuffer, olen, 0, 0))
       return (int) (a.zout - a.zout_start);
    else
@@ -2295,8 +2299,8 @@ int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffe
 
 typedef struct
 {
-   guint32 length;
-   guint32 type;
+   uint32_t length;
+   uint32_t type;
 } chunk;
 
 #define PNG_TYPE(a,b,c,d)  (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
@@ -2311,7 +2315,7 @@ static chunk get_chunk_header(stbi *s)
 
 static int check_png_header(stbi *s)
 {
-   static guint8 png_sig[8] = { 137,80,78,71,13,10,26,10 };
+   static uint8_t png_sig[8] = { 137,80,78,71,13,10,26,10 };
    int i;
    for (i=0; i < 8; ++i)
       if (get8(s) != png_sig[i]) return e("bad png sig","Not a PNG");
@@ -2321,7 +2325,7 @@ static int check_png_header(stbi *s)
 typedef struct
 {
    stbi s;
-   guint8 *idata, *expanded, *out;
+   uint8_t *idata, *expanded, *out;
 } png;
 
 
@@ -2330,7 +2334,7 @@ enum {
    F_avg_first, F_paeth_first,
 };
 
-static guint8 first_row_filter[5] =
+static uint8_t first_row_filter[5] =
 {
    F_none, F_sub, F_none, F_avg_first, F_paeth_first
 };
@@ -2347,15 +2351,15 @@ static int paeth(int a, int b, int c)
 }
 
 // create the png data from post-deflated data
-static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n, guint32 x, guint32 y)
+static int create_png_image_raw(png *a, uint8_t *raw, uint32_t raw_len, int out_n, uint32_t x, uint32_t y)
 {
    stbi *s = &a->s;
-   guint32 i,j,stride = x*out_n;
+   uint32_t i,j,stride = x*out_n;
    int k;
    int img_n = s->img_n; // copy it into a local for later
    assert(out_n == s->img_n || out_n == s->img_n+1);
    if (stbi_png_partial) y = 1;
-   a->out = (guint8 *) malloc(x * y * out_n);
+   a->out = (uint8_t *) malloc(x * y * out_n);
    if (!a->out) return e("outofmem", "Out of memory");
    if (!stbi_png_partial) {
       if (s->img_x == x && s->img_y == y)
@@ -2364,8 +2368,8 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
          if (raw_len < (img_n * x + 1) * y) return e("not enough pixels","Corrupt PNG");
    }
    for (j=0; j < y; ++j) {
-      guint8 *cur = a->out + stride*j;
-      guint8 *prior = cur - stride;
+      uint8_t *cur = a->out + stride*j;
+      uint8_t *prior = cur - stride;
       int filter = *raw++;
       if (filter > 4) return e("invalid filter","Corrupt PNG");
       // if first row, use special filter that doesn't sample previous row
@@ -2377,7 +2381,7 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
             case F_sub        : cur[k] = raw[k]; break;
             case F_up         : cur[k] = raw[k] + prior[k]; break;
             case F_avg        : cur[k] = raw[k] + (prior[k]>>1); break;
-            case F_paeth      : cur[k] = (guint8) (raw[k] + paeth(0,prior[k],0)); break;
+            case F_paeth      : cur[k] = (uint8_t) (raw[k] + paeth(0,prior[k],0)); break;
             case F_avg_first  : cur[k] = raw[k]; break;
             case F_paeth_first: cur[k] = raw[k]; break;
          }
@@ -2397,9 +2401,9 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
             CASE(F_sub)   cur[k] = raw[k] + cur[k-img_n]; break;
             CASE(F_up)    cur[k] = raw[k] + prior[k]; break;
             CASE(F_avg)   cur[k] = raw[k] + ((prior[k] + cur[k-img_n])>>1); break;
-            CASE(F_paeth)  cur[k] = (guint8) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
+            CASE(F_paeth)  cur[k] = (uint8_t) (raw[k] + paeth(cur[k-img_n],prior[k],prior[k-img_n])); break;
             CASE(F_avg_first)    cur[k] = raw[k] + (cur[k-img_n] >> 1); break;
-            CASE(F_paeth_first)  cur[k] = (guint8) (raw[k] + paeth(cur[k-img_n],0,0)); break;
+            CASE(F_paeth_first)  cur[k] = (uint8_t) (raw[k] + paeth(cur[k-img_n],0,0)); break;
          }
          #undef CASE
       } else {
@@ -2413,9 +2417,9 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
             CASE(F_sub)   cur[k] = raw[k] + cur[k-out_n]; break;
             CASE(F_up)    cur[k] = raw[k] + prior[k]; break;
             CASE(F_avg)   cur[k] = raw[k] + ((prior[k] + cur[k-out_n])>>1); break;
-            CASE(F_paeth)  cur[k] = (guint8) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
+            CASE(F_paeth)  cur[k] = (uint8_t) (raw[k] + paeth(cur[k-out_n],prior[k],prior[k-out_n])); break;
             CASE(F_avg_first)    cur[k] = raw[k] + (cur[k-out_n] >> 1); break;
-            CASE(F_paeth_first)  cur[k] = (guint8) (raw[k] + paeth(cur[k-out_n],0,0)); break;
+            CASE(F_paeth_first)  cur[k] = (uint8_t) (raw[k] + paeth(cur[k-out_n],0,0)); break;
          }
          #undef CASE
       }
@@ -2423,9 +2427,9 @@ static int create_png_image_raw(png *a, guint8 *raw, guint32 raw_len, int out_n,
    return 1;
 }
 
-static int create_png_image(png *a, guint8 *raw, guint32 raw_len, int out_n, int interlaced)
+static int create_png_image(png *a, uint8_t *raw, uint32_t raw_len, int out_n, int interlaced)
 {
-   guint8 *final;
+   uint8_t *final;
    int p;
    int save;
    if (!interlaced)
@@ -2434,7 +2438,7 @@ static int create_png_image(png *a, guint8 *raw, guint32 raw_len, int out_n, int
    stbi_png_partial = 0;
 
    // de-interlacing
-   final = (guint8 *) malloc(a->s.img_x * a->s.img_y * out_n);
+   final = (uint8_t *) malloc(a->s.img_x * a->s.img_y * out_n);
    for (p=0; p < 7; ++p) {
       int xorig[] = { 0,4,0,2,0,1,0 };
       int yorig[] = { 0,0,4,0,2,0,1 };
@@ -2464,11 +2468,11 @@ static int create_png_image(png *a, guint8 *raw, guint32 raw_len, int out_n, int
    return 1;
 }
 
-static int compute_transparency(png *z, guint8 tc[3], int out_n)
+static int compute_transparency(png *z, uint8_t tc[3], int out_n)
 {
    stbi *s = &z->s;
-   guint32 i, pixel_count = s->img_x * s->img_y;
-   guint8 *p = z->out;
+   uint32_t i, pixel_count = s->img_x * s->img_y;
+   uint8_t *p = z->out;
 
    // compute color-based transparency, assuming we've
    // already got 255 as the alpha value in the output
@@ -2489,12 +2493,12 @@ static int compute_transparency(png *z, guint8 tc[3], int out_n)
    return 1;
 }
 
-static int expand_palette(png *a, guint8 *palette, int len, int pal_img_n)
+static int expand_palette(png *a, uint8_t *palette, int len, int pal_img_n)
 {
-   guint32 i, pixel_count = a->s.img_x * a->s.img_y;
-   guint8 *p, *temp_out, *orig = a->out;
+   uint32_t i, pixel_count = a->s.img_x * a->s.img_y;
+   uint8_t *p, *temp_out, *orig = a->out;
 
-   p = (guint8 *) malloc(pixel_count * pal_img_n);
+   p = (uint8_t *) malloc(pixel_count * pal_img_n);
    if (p == NULL) return e("outofmem", "Out of memory");
 
    // between here and free(out) below, exitting would leak
@@ -2525,9 +2529,9 @@ static int expand_palette(png *a, guint8 *palette, int len, int pal_img_n)
 
 static int parse_png_file(png *z, int scan, int req_comp)
 {
-   guint8 palette[1024], pal_img_n=0;
-   guint8 has_trans=0, tc[3];
-   guint32 ioff=0, idata_limit=0, i, pal_len=0;
+   uint8_t palette[1024], pal_img_n=0;
+   uint8_t has_trans=0, tc[3];
+   uint32_t ioff=0, idata_limit=0, i, pal_len=0;
    int first=1,k,interlace=0;
    stbi *s = &z->s;
 
@@ -2591,10 +2595,10 @@ static int parse_png_file(png *z, int scan, int req_comp)
                   palette[i*4+3] = get8u(s);
             } else {
                if (!(s->img_n & 1)) return e("tRNS with alpha","Corrupt PNG");
-               if (c.length != (guint32) s->img_n*2) return e("bad tRNS len","Corrupt PNG");
+               if (c.length != (uint32_t) s->img_n*2) return e("bad tRNS len","Corrupt PNG");
                has_trans = 1;
                for (k=0; k < s->img_n; ++k)
-                  tc[k] = (guint8) get16(s); // non 8-bit images will be larger
+                  tc[k] = (uint8_t) get16(s); // non 8-bit images will be larger
             }
             break;
          }
@@ -2603,11 +2607,11 @@ static int parse_png_file(png *z, int scan, int req_comp)
             if (pal_img_n && !pal_len) return e("no PLTE","Corrupt PNG");
             if (scan == SCAN_header) { s->img_n = pal_img_n; return 1; }
             if (ioff + c.length > idata_limit) {
-               guint8 *p;
+               uint8_t *p;
                if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
                while (ioff + c.length > idata_limit)
                   idata_limit *= 2;
-               p = (guint8 *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory");
+               p = (uint8_t *) realloc(z->idata, idata_limit); if (p == NULL) return e("outofmem", "Out of memory");
                z->idata = p;
             }
             #ifndef STBI_NO_STDIO
@@ -2626,10 +2630,10 @@ static int parse_png_file(png *z, int scan, int req_comp)
          }
 
          case PNG_TYPE('I','E','N','D'): {
-            guint32 raw_len;
+            uint32_t raw_len;
             if (scan != SCAN_load) return 1;
             if (z->idata == NULL) return e("no IDAT","Corrupt PNG");
-            z->expanded = (guint8 *) stbi_zlib_decode_malloc((char *) z->idata, ioff, (int *) &raw_len);
+            z->expanded = (uint8_t *) stbi_zlib_decode_malloc((char *) z->idata, ioff, (int *) &raw_len);
             if (z->expanded == NULL) return 0; // zlib should set error
             free(z->idata); z->idata = NULL;
             if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
@@ -2657,10 +2661,10 @@ static int parse_png_file(png *z, int scan, int req_comp)
                #ifndef STBI_NO_FAILURE_STRINGS
                // not threadsafe
                static char invalid_chunk[] = "XXXX chunk not known";
-               invalid_chunk[0] = (guint8) (c.type >> 24);
-               invalid_chunk[1] = (guint8) (c.type >> 16);
-               invalid_chunk[2] = (guint8) (c.type >>  8);
-               invalid_chunk[3] = (guint8) (c.type >>  0);
+               invalid_chunk[0] = (uint8_t) (c.type >> 24);
+               invalid_chunk[1] = (uint8_t) (c.type >> 16);
+               invalid_chunk[2] = (uint8_t) (c.type >>  8);
+               invalid_chunk[3] = (uint8_t) (c.type >>  0);
                #endif
                return e(invalid_chunk, "PNG not supported: unknown chunk type");
             }
@@ -2844,7 +2848,7 @@ static int shiftsigned(int v, int shift, int bits)
 
 static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 {
-   guint8 *out;
+   uint8_t *out;
    unsigned int mr=0,mg=0,mb=0,ma=0, fake_a=0;
    stbi_uc pal[256][4];
    int psize=0,i,j,compress=0,width;
@@ -3004,13 +3008,13 @@ static stbi_uc *bmp_load(stbi *s, int *x, int *y, int *comp, int req_comp)
             }
          } else {
             for (i=0; i < (int) s->img_x; ++i) {
-               guint32 v = (bpp == 16 ? get16le(s) : get32le(s));
+               uint32_t v = (bpp == 16 ? get16le(s) : get32le(s));
                int a;
                out[z++] = shiftsigned(v & mr, rshift, rcount);
                out[z++] = shiftsigned(v & mg, gshift, gcount);
                out[z++] = shiftsigned(v & mb, bshift, bcount);
                a = (ma ? shiftsigned(v & ma, ashift, acount) : 255);
-               if (target == 4) out[z++] = a; 
+               if (target == 4) out[z++] = a;
             }
          }
          skip(s, pad);
@@ -3385,7 +3389,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 	int channelCount, compression;
 	int channel, i, count, len;
    int w,h;
-   guint8 *out;
+   uint8_t *out;
 
 	// Check identifier
 	if (get32(s) != 0x38425053)	// "8BPS"
@@ -3406,7 +3410,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 	// Read the rows and columns of the image.
    h = get32(s);
    w = get32(s);
-	
+
 	// Make sure the depth is 8 bits.
 	if (get16(s) != 8)
 		return epuc("unsupported bit depth", "PSD bit depth is not 8 bit");
@@ -3448,7 +3452,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 
 	// Initialize the data to zero.
 	//memset( out, 0, pixelCount * 4 );
-	
+
 	// Finally, the image data.
 	if (compression) {
 		// RLE as used by .PSD and .TIFF
@@ -3465,8 +3469,8 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 
 		// Read the RLE data by channel.
 		for (channel = 0; channel < 4; channel++) {
-			guint8 *p;
-			
+			uint8_t *p;
+
          p = out+channel;
 			if (channel >= channelCount) {
 				// Fill this channel with default data.
@@ -3488,7 +3492,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 							len--;
 						}
 					} else if (len > 128) {
-						guint32	val;
+						uint32_t	val;
 						// Next -len+1 bytes in the dest are replicated from next source byte.
 						// (Interpret len as a negative 8-bit int.)
 						len ^= 0x0FF;
@@ -3504,15 +3508,15 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 				}
 			}
 		}
-		
+
 	} else {
 		// We're at the raw image data.  It's each channel in order (Red, Green, Blue, Alpha, ...)
 		// where each channel consists of an 8-bit value for each pixel in the image.
-		
+
 		// Read the data by channel.
 		for (channel = 0; channel < 4; channel++) {
-			guint8 *p;
-			
+			uint8_t *p;
+
          p = out + channel;
 			if (channel > channelCount) {
 				// Fill this channel with default data.
@@ -3534,7 +3538,7 @@ static stbi_uc *psd_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 	if (comp) *comp = channelCount;
 	*y = h;
 	*x = w;
-	
+
 	return out;
 }
 
@@ -3665,7 +3669,7 @@ static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
 	// Check identifier
 	if (strcmp(hdr_gettoken(s,buffer), "#?RADIANCE") != 0)
 		return epf("not HDR", "Corrupt HDR image");
-	
+
 	// Parse header
 	while(1) {
 		token = hdr_gettoken(s,buffer);
@@ -3729,7 +3733,7 @@ static float *hdr_load(stbi *s, int *x, int *y, int *comp, int req_comp)
          len |= get8(s);
          if (len != width) { free(hdr_data); free(scanline); return epf("invalid decoded scanline length", "corrupt HDR"); }
          if (scanline == NULL) scanline = (stbi_uc *) malloc(width * 4);
-				
+
 			for (k = 0; k < 4; ++k) {
 				i = 0;
 				while (i < width) {
@@ -3778,16 +3782,16 @@ float *stbi_hdr_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y,
 
 #ifndef STBI_NO_WRITE
 
-static void write8(FILE *f, int x) { guint8 z = (guint8) x; fwrite(&z,1,1,f); }
+static void write8(FILE *f, int x) { uint8_t z = (uint8_t) x; fwrite(&z,1,1,f); }
 
 static void writefv(FILE *f, char *fmt, va_list v)
 {
    while (*fmt) {
       switch (*fmt++) {
          case ' ': break;
-         case '1': { guint8 x = va_arg(v, int); write8(f,x); break; }
-         case '2': { gint16 x = va_arg(v, int); write8(f,x); write8(f,x>>8); break; }
-         case '4': { gint32 x = va_arg(v, int); write8(f,x); write8(f,x>>8); write8(f,x>>16); write8(f,x>>24); break; }
+         case '1': { uint8_t x = va_arg(v, int); write8(f,x); break; }
+         case '2': { int16_t x = va_arg(v, int); write8(f,x); write8(f,x>>8); break; }
+         case '4': { int32_t x = va_arg(v, int); write8(f,x); write8(f,x>>8); write8(f,x>>16); write8(f,x>>24); break; }
          default:
             assert(0);
             va_end(v);
@@ -3806,18 +3810,18 @@ static void writef(FILE *f, char *fmt, ...)
 
 static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad)
 {
-   guint8 bg[3] = { 255, 0, 255}, px[3];
-   guint32 zero = 0;
+   uint8_t bg[3] = { 255, 0, 255}, px[3];
+   uint32_t zero = 0;
    int i,j,k, j_end;
 
-   if (vdir < 0) 
+   if (vdir < 0)
       j_end = -1, j = y-1;
    else
       j_end =  y, j = 0;
 
    for (; j != j_end; j += vdir) {
       for (i=0; i < x; ++i) {
-         guint8 *d = (guint8 *) data + (j*x+i)*comp;
+         uint8_t *d = (uint8_t *) data + (j*x+i)*comp;
          if (write_alpha < 0)
             fwrite(&d[comp-1], 1, 1, f);
          switch (comp) {
diff --git a/cogl/winsys/cogl-texture-pixmap-x11-private.h b/cogl/winsys/cogl-texture-pixmap-x11-private.h
index 515aa05..1c21ea0 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11-private.h
+++ b/cogl/winsys/cogl-texture-pixmap-x11-private.h
@@ -66,7 +66,7 @@ struct _CoglTexturePixmapX11
 
   Damage damage;
   CoglTexturePixmapX11ReportLevel damage_report_level;
-  gboolean damage_owned;
+  CoglBool damage_owned;
   CoglDamageRectangle damage_rect;
 
   void *winsys;
@@ -74,7 +74,7 @@ struct _CoglTexturePixmapX11
   /* During the pre_paint method, this will be set to TRUE if we
      should use the winsys texture, otherwise we will use the regular
      texture */
-  gboolean use_winsys_texture;
+  CoglBool use_winsys_texture;
 };
 
 #endif /* __COGL_TEXTURE_PIXMAP_X11_PRIVATE_H */
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.c b/cogl/winsys/cogl-texture-pixmap-x11.c
index 92e8c21..ec855b3 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.c
+++ b/cogl/winsys/cogl-texture-pixmap-x11.c
@@ -100,7 +100,7 @@ cogl_damage_rectangle_union (CoglDamageRectangle *damage_rect,
     }
 }
 
-static gboolean
+static CoglBool
 cogl_damage_rectangle_is_whole (const CoglDamageRectangle *damage_rect,
                                 unsigned int width,
                                 unsigned int height)
@@ -271,8 +271,8 @@ set_damage_object_internal (CoglContext *ctx,
 
 CoglTexturePixmapX11 *
 cogl_texture_pixmap_x11_new (CoglContext *ctxt,
-                             guint32 pixmap,
-                             gboolean automatic_updates,
+                             uint32_t pixmap,
+                             CoglBool automatic_updates,
                              GError **error)
 {
   CoglTexturePixmapX11 *tex_pixmap = g_new (CoglTexturePixmapX11, 1);
@@ -449,7 +449,7 @@ cogl_texture_pixmap_x11_update_area (CoglTexturePixmapX11 *tex_pixmap,
                                x, y, width, height);
 }
 
-gboolean
+CoglBool
 cogl_texture_pixmap_x11_is_using_tfp_extension (CoglTexturePixmapX11 *tex_pixmap)
 {
   return !!tex_pixmap->winsys;
@@ -457,7 +457,7 @@ cogl_texture_pixmap_x11_is_using_tfp_extension (CoglTexturePixmapX11 *tex_pixmap
 
 void
 cogl_texture_pixmap_x11_set_damage_object (CoglTexturePixmapX11 *tex_pixmap,
-                                           guint32 damage,
+                                           uint32_t damage,
                                            CoglTexturePixmapX11ReportLevel
                                                                   report_level)
 {
@@ -590,7 +590,7 @@ _cogl_texture_pixmap_x11_update_image_texture (CoglTexturePixmapX11 *tex_pixmap)
                            image->height,
                            image_format,
                            image->bytes_per_line,
-                           (const guint8 *) image->data);
+                           (const uint8_t *) image->data);
 
   /* If we have a shared memory segment then the XImage would be a
      temporary one with no data allocated so we can just XFree it */
@@ -602,7 +602,7 @@ _cogl_texture_pixmap_x11_update_image_texture (CoglTexturePixmapX11 *tex_pixmap)
 
 static void
 _cogl_texture_pixmap_x11_set_use_winsys_texture (CoglTexturePixmapX11 *tex_pixmap,
-                                                 gboolean new_value)
+                                                 CoglBool new_value)
 {
   if (tex_pixmap->use_winsys_texture != new_value)
     {
@@ -617,7 +617,7 @@ _cogl_texture_pixmap_x11_set_use_winsys_texture (CoglTexturePixmapX11 *tex_pixma
 
 static void
 _cogl_texture_pixmap_x11_update (CoglTexturePixmapX11 *tex_pixmap,
-                                 gboolean needs_mipmap)
+                                 CoglBool needs_mipmap)
 {
   if (tex_pixmap->winsys)
     {
@@ -675,7 +675,7 @@ _cogl_texture_pixmap_x11_get_texture (CoglTexturePixmapX11 *tex_pixmap)
   return NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_pixmap_x11_set_region (CoglTexture     *tex,
                                      int              src_x,
                                      int              src_y,
@@ -690,11 +690,11 @@ _cogl_texture_pixmap_x11_set_region (CoglTexture     *tex,
   return FALSE;
 }
 
-static gboolean
-_cogl_texture_pixmap_x11_get_data (CoglTexture     *tex,
-                                   CoglPixelFormat  format,
-                                   unsigned int     rowstride,
-                                   guint8          *data)
+static CoglBool
+_cogl_texture_pixmap_x11_get_data (CoglTexture *tex,
+                                   CoglPixelFormat format,
+                                   unsigned int rowstride,
+                                   uint8_t *data)
 {
   CoglTexturePixmapX11 *tex_pixmap = COGL_TEXTURE_PIXMAP_X11 (tex);
   CoglTexture *child_tex = _cogl_texture_pixmap_x11_get_texture (tex_pixmap);
@@ -796,7 +796,7 @@ _cogl_texture_pixmap_x11_get_max_waste (CoglTexture *tex)
   return cogl_texture_get_max_waste (child_tex);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_pixmap_x11_is_sliced (CoglTexture *tex)
 {
   CoglTexturePixmapX11 *tex_pixmap = COGL_TEXTURE_PIXMAP_X11 (tex);
@@ -805,7 +805,7 @@ _cogl_texture_pixmap_x11_is_sliced (CoglTexture *tex)
   return cogl_texture_is_sliced (child_tex);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_pixmap_x11_can_hardware_repeat (CoglTexture *tex)
 {
   CoglTexturePixmapX11 *tex_pixmap = COGL_TEXTURE_PIXMAP_X11 (tex);
@@ -837,7 +837,7 @@ _cogl_texture_pixmap_x11_transform_quad_coords_to_gl (CoglTexture *tex,
   return _cogl_texture_transform_quad_coords_to_gl (child_tex, coords);
 }
 
-static gboolean
+static CoglBool
 _cogl_texture_pixmap_x11_get_gl_texture (CoglTexture *tex,
                                          GLuint      *out_gl_handle,
                                          GLenum      *out_gl_target)
diff --git a/cogl/winsys/cogl-texture-pixmap-x11.h b/cogl/winsys/cogl-texture-pixmap-x11.h
index 604011c..c517762 100644
--- a/cogl/winsys/cogl-texture-pixmap-x11.h
+++ b/cogl/winsys/cogl-texture-pixmap-x11.h
@@ -100,8 +100,8 @@ GQuark cogl_texture_pixmap_x11_error_quark (void);
  */
 CoglTexturePixmapX11 *
 cogl_texture_pixmap_x11_new (CoglContext *context,
-                             guint32 pixmap,
-                             gboolean automatic_updates,
+                             uint32_t pixmap,
+                             CoglBool automatic_updates,
                              GError **error);
 
 /**
@@ -142,7 +142,7 @@ cogl_texture_pixmap_x11_update_area (CoglTexturePixmapX11 *texture,
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_texture_pixmap_x11_is_using_tfp_extension (CoglTexturePixmapX11 *texture);
 
 /**
@@ -166,7 +166,7 @@ cogl_texture_pixmap_x11_is_using_tfp_extension (CoglTexturePixmapX11 *texture);
  */
 void
 cogl_texture_pixmap_x11_set_damage_object (CoglTexturePixmapX11 *texture,
-                                           guint32 damage,
+                                           uint32_t damage,
                                            CoglTexturePixmapX11ReportLevel
                                                                   report_level);
 
@@ -182,7 +182,7 @@ cogl_texture_pixmap_x11_set_damage_object (CoglTexturePixmapX11 *texture,
  * Since: 1.4
  * Stability: Unstable
  */
-gboolean
+CoglBool
 cogl_is_texture_pixmap_x11 (void *object);
 
 #endif /* COGL_ENABLE_EXPERIMENTAL_API */
diff --git a/cogl/winsys/cogl-winsys-egl-android.c b/cogl/winsys/cogl-winsys-egl-android.c
index 2efa6b2..dd96ccf 100644
--- a/cogl/winsys/cogl-winsys-egl-android.c
+++ b/cogl/winsys/cogl-winsys-egl-android.c
@@ -44,7 +44,7 @@ typedef struct _CoglDisplayAndroid
 {
   int egl_surface_width;
   int egl_surface_height;
-  gboolean have_onscreen;
+  CoglBool have_onscreen;
 } CoglDisplayAndroid;
 
 static ANativeWindow *android_native_window;
@@ -67,7 +67,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -90,7 +90,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -160,7 +160,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -181,7 +181,7 @@ _cogl_winsys_egl_display_destroy (CoglDisplay *display)
   g_slice_free (CoglDisplayAndroid, egl_display->platform);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
                                 EGLConfig egl_config,
                                 GError **error)
@@ -224,7 +224,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_android_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl-gdl.c b/cogl/winsys/cogl-winsys-egl-gdl.c
index 1f7a2c3..fbaad74 100644
--- a/cogl/winsys/cogl-winsys-egl-gdl.c
+++ b/cogl/winsys/cogl-winsys-egl-gdl.c
@@ -41,14 +41,14 @@ static const CoglWinsysEGLVtable _cogl_winsys_egl_vtable;
 
 typedef struct _CoglRendererGDL
 {
-  gboolean gdl_initialized;
+  CoglBool gdl_initialized;
 } CoglRendererGDL;
 
 typedef struct _CoglDisplayGDL
 {
   int egl_surface_width;
   int egl_surface_height;
-  gboolean have_onscreen;
+  CoglBool have_onscreen;
 } CoglDisplayGDL;
 
 static void
@@ -65,7 +65,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -118,7 +118,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -168,10 +168,10 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 gdl_plane_init (CoglDisplay *display, GError **error)
 {
-  gboolean ret = TRUE;
+  CoglBool ret = TRUE;
   gdl_color_space_t colorSpace = GDL_COLOR_SPACE_RGB;
   gdl_pixel_format_t pixfmt = GDL_PF_ARGB_32;
   gdl_rectangle_t dstRect;
@@ -253,7 +253,7 @@ gdl_plane_init (CoglDisplay *display, GError **error)
   return ret;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -291,7 +291,7 @@ _cogl_winsys_egl_cleanup_context (CoglDisplay *display)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
                                 EGLConfig egl_config,
                                 GError **error)
@@ -351,7 +351,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_gdl_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
index f5d1e28..c2ad357 100644
--- a/cogl/winsys/cogl-winsys-egl-kms.c
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -77,8 +77,8 @@ typedef struct _CoglDisplayKMS
 {
   GList *outputs;
   int width, height;
-  gboolean pending_set_crtc;
-  gboolean pending_swap_notify;
+  CoglBool pending_set_crtc;
+  CoglBool pending_swap_notify;
 } CoglDisplayKMS;
 
 typedef struct _CoglFlipKMS
@@ -94,7 +94,7 @@ typedef struct _CoglOnscreenKMS
   uint32_t next_fb_id;
   struct gbm_bo *current_bo;
   struct gbm_bo *next_bo;
-  gboolean pending_swap_notify;
+  CoglBool pending_swap_notify;
 } CoglOnscreenKMS;
 
 static const char device_name[] = "/dev/dri/card0";
@@ -111,7 +111,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -173,7 +173,7 @@ close_fd:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 is_connector_excluded (int id,
                        int *excluded_connectors,
                        int n_excluded_connectors)
@@ -210,7 +210,7 @@ find_connector (int fd,
   return NULL;
 }
 
-static gboolean
+static CoglBool
 find_mirror_modes (drmModeModeInfo *modes0,
                    int n_modes0,
                    drmModeModeInfo *modes1,
@@ -249,7 +249,7 @@ static drmModeModeInfo builtin_1024x768 =
 	"1024x768"
 };
 
-static gboolean
+static CoglBool
 is_panel (int type)
 {
   return (type == DRM_MODE_CONNECTOR_LVDS ||
@@ -324,7 +324,7 @@ find_output (int _index,
     {
       const char *name = getenv (mode_env_name);
       int i;
-      gboolean found = FALSE;
+      CoglBool found = FALSE;
       drmModeModeInfo mode;
 
       for (i = 0; i < n_modes; i++)
@@ -380,7 +380,7 @@ setup_crtc_modes (CoglDisplay *display, int fb_id)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -392,7 +392,7 @@ _cogl_winsys_egl_display_setup (CoglDisplay *display,
   const char *surfaceless_feature_name = "";
   drmModeRes *resources;
   CoglOutputKMS *output0, *output1;
-  gboolean mirror;
+  CoglBool mirror;
 
   kms_display = g_slice_new0 (CoglDisplayKMS);
   egl_display->platform = kms_display;
@@ -533,7 +533,7 @@ _cogl_winsys_egl_display_destroy (CoglDisplay *display)
   g_slice_free (CoglDisplayKMS, egl_display->platform);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -726,7 +726,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_init (CoglContext *context,
                                GError **error)
 {
@@ -739,7 +739,7 @@ _cogl_winsys_egl_context_init (CoglContext *context,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -841,7 +841,7 @@ static void
 _cogl_winsys_poll_get_info (CoglContext *context,
                             CoglPollFD **poll_fds,
                             int *n_poll_fds,
-                            gint64 *timeout)
+                            int64_t *timeout)
 {
   CoglDisplay *display = context->display;
   CoglDisplayEGL *egl_display = display->winsys;
@@ -922,7 +922,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_kms_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl-null.c b/cogl/winsys/cogl-winsys-egl-null.c
index f0b9200..20f209f 100644
--- a/cogl/winsys/cogl-winsys-egl-null.c
+++ b/cogl/winsys/cogl-winsys-egl-null.c
@@ -41,7 +41,7 @@ typedef struct _CoglDisplayNull
 {
   int egl_surface_width;
   int egl_surface_height;
-  gboolean have_onscreen;
+  CoglBool have_onscreen;
 } CoglDisplayNull;
 
 static void
@@ -54,7 +54,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -77,7 +77,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -126,7 +126,7 @@ _cogl_winsys_egl_context_created (CoglDisplay *display,
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -161,7 +161,7 @@ _cogl_winsys_egl_cleanup_context (CoglDisplay *display)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
                                 EGLConfig egl_config,
                                 GError **error)
@@ -217,7 +217,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_null_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl-private.h b/cogl/winsys/cogl-winsys-egl-private.h
index 9f501ee..000fe51 100644
--- a/cogl/winsys/cogl-winsys-egl-private.h
+++ b/cogl/winsys/cogl-winsys-egl-private.h
@@ -32,26 +32,26 @@
 
 typedef struct _CoglWinsysEGLVtable
 {
-  gboolean
+  CoglBool
   (* display_setup) (CoglDisplay *display,
                      GError **error);
   void
   (* display_destroy) (CoglDisplay *display);
 
-  gboolean
+  CoglBool
   (* context_created) (CoglDisplay *display,
                        GError **error);
 
   void
   (* cleanup_context) (CoglDisplay *display);
 
-  gboolean
+  CoglBool
   (* context_init) (CoglContext *context, GError **error);
 
   void
   (* context_deinit) (CoglContext *context);
 
-  gboolean
+  CoglBool
   (* onscreen_init) (CoglOnscreen *onscreen,
                      EGLConfig config,
                      GError **error);
@@ -110,8 +110,8 @@ typedef struct _CoglDisplayEGL
   EGLSurface egl_surface;
 
   EGLConfig egl_config;
-  gboolean found_egl_config;
-  gboolean stencil_disabled;
+  CoglBool found_egl_config;
+  CoglBool stencil_disabled;
 
   /* Platform specific display data */
   void *platform;
@@ -145,7 +145,7 @@ _cogl_egl_destroy_image (CoglContext *ctx,
                          EGLImageKHR image);
 #endif
 
-gboolean
+CoglBool
 _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
                                           GError **error);
 
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
index a9d2129..cabe632 100644
--- a/cogl/winsys/cogl-winsys-egl-wayland.c
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -69,7 +69,7 @@ typedef struct _CoglOnscreenWayland
   int pending_height;
   int pending_dx;
   int pending_dy;
-  gboolean has_pending;
+  CoglBool has_pending;
 } CoglOnscreenWayland;
 
 static void
@@ -101,7 +101,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -173,7 +173,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -194,7 +194,7 @@ _cogl_winsys_egl_display_destroy (CoglDisplay *display)
   g_slice_free (CoglDisplayWayland, egl_display->platform);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -280,7 +280,7 @@ _cogl_winsys_egl_cleanup_context (CoglDisplay *display)
     }
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_init (CoglContext *context,
                                GError **error)
 {
@@ -294,7 +294,7 @@ _cogl_winsys_egl_context_init (CoglContext *context,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
                                 EGLConfig egl_config,
                                 GError **error)
@@ -572,7 +572,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_wayland_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/winsys/cogl-winsys-egl-x11.c
index 61b1b6d..8b4551c 100644
--- a/cogl/winsys/cogl-winsys-egl-x11.c
+++ b/cogl/winsys/cogl-winsys-egl-x11.c
@@ -55,7 +55,7 @@ typedef struct _CoglDisplayXlib
 typedef struct _CoglOnscreenXlib
 {
   Window xwin;
-  gboolean is_foreign_xwin;
+  CoglBool is_foreign_xwin;
 } CoglOnscreenXlib;
 
 #ifdef EGL_KHR_image_pixmap
@@ -67,7 +67,7 @@ typedef struct _CoglTexturePixmapEGL
 #endif
 
 static CoglOnscreen *
-find_onscreen_for_xid (CoglContext *context, guint32 xid)
+find_onscreen_for_xid (CoglContext *context, uint32_t xid)
 {
   GList *l;
 
@@ -173,7 +173,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererEGL, egl_renderer);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -202,7 +202,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_display_setup (CoglDisplay *display,
                                 GError **error)
 {
@@ -223,7 +223,7 @@ _cogl_winsys_egl_display_destroy (CoglDisplay *display)
   g_slice_free (CoglDisplayXlib, egl_display->platform);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_init (CoglContext *context,
                                GError **error)
 {
@@ -249,7 +249,7 @@ _cogl_winsys_egl_context_deinit (CoglContext *context)
                                     context);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_onscreen_init (CoglOnscreen *onscreen,
                                 EGLConfig egl_config,
                                 GError **error)
@@ -426,7 +426,7 @@ _cogl_winsys_egl_onscreen_deinit (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
-                                      gboolean visibility)
+                                      CoglBool visibility)
 {
   CoglContext *context = COGL_FRAMEBUFFER (onscreen)->context;
   CoglRenderer *renderer = context->display->renderer;
@@ -441,7 +441,7 @@ _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
     XUnmapWindow (xlib_renderer->xdpy, xlib_onscreen->xwin);
 }
 
-static guint32
+static uint32_t
 _cogl_winsys_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
 {
   CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
@@ -450,7 +450,7 @@ _cogl_winsys_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
   return xlib_onscreen->xwin;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_egl_context_created (CoglDisplay *display,
                                   GError **error)
 {
@@ -568,7 +568,7 @@ static void
 _cogl_winsys_poll_get_info (CoglContext *context,
                             CoglPollFD **poll_fds,
                             int *n_poll_fds,
-                            gint64 *timeout)
+                            int64_t *timeout)
 {
   _cogl_xlib_renderer_poll_get_info (context->display->renderer,
                                      poll_fds,
@@ -588,7 +588,7 @@ _cogl_winsys_poll_dispatch (CoglContext *context,
 
 #ifdef EGL_KHR_image_pixmap
 
-static gboolean
+static CoglBool
 _cogl_winsys_texture_pixmap_x11_create (CoglTexturePixmapX11 *tex_pixmap)
 {
   CoglTexturePixmapEGL *egl_tex_pixmap;
@@ -665,9 +665,9 @@ _cogl_winsys_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap)
   g_free (egl_tex_pixmap);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_texture_pixmap_x11_update (CoglTexturePixmapX11 *tex_pixmap,
-                                        gboolean needs_mipmap)
+                                        CoglBool needs_mipmap)
 {
   if (needs_mipmap)
     return FALSE;
@@ -706,7 +706,7 @@ _cogl_winsys_egl_vtable =
 const CoglWinsysVtable *
 _cogl_winsys_egl_xlib_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   if (!vtable_inited)
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index a05412f..e0e8bb5 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -130,7 +130,7 @@ check_egl_extensions (CoglRenderer *renderer)
       }
 }
 
-gboolean
+CoglBool
 _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
                                           GError **error)
 {
@@ -151,7 +151,7 @@ _cogl_winsys_egl_renderer_connect_common (CoglRenderer *renderer,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -162,7 +162,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
 static void
 egl_attributes_from_framebuffer_config (CoglDisplay *display,
                                         CoglFramebufferConfig *config,
-                                        gboolean needs_stencil_override,
+                                        CoglBool needs_stencil_override,
                                         EGLint *attributes)
 {
   CoglRenderer *renderer = display->renderer;
@@ -217,9 +217,9 @@ egl_attributes_from_framebuffer_config (CoglDisplay *display,
   g_assert (i < MAX_EGL_CONFIG_ATTRIBS);
 }
 
-static gboolean
+static CoglBool
 try_create_context (CoglDisplay *display,
-                    gboolean with_stencil_buffer,
+                    CoglBool with_stencil_buffer,
                     GError **error)
 {
   CoglRenderer *renderer = display->renderer;
@@ -308,7 +308,7 @@ cleanup_context (CoglDisplay *display)
     egl_renderer->platform_vtable->cleanup_context (display);
 }
 
-static gboolean
+static CoglBool
 create_context (CoglDisplay *display, GError **error)
 {
   CoglDisplayEGL *egl_display = display->winsys;
@@ -350,7 +350,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
   display->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_display_setup (CoglDisplay *display,
                             GError **error)
 {
@@ -390,7 +390,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_context_init (CoglContext *context, GError **error)
 {
   CoglRenderer *renderer = context->display->renderer;
@@ -435,7 +435,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
   g_free (context->winsys);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -449,7 +449,7 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
   EGLConfig egl_config;
   EGLint config_count = 0;
   EGLBoolean status;
-  gboolean need_stencil =
+  CoglBool need_stencil =
     egl_display->stencil_disabled ? FALSE : framebuffer->config.need_stencil;
 
   _COGL_RETURN_VAL_IF_FAIL (egl_display->egl_context, FALSE);
diff --git a/cogl/winsys/cogl-winsys-glx.c b/cogl/winsys/cogl-winsys-glx.c
index 4e0abfa..4e2249c 100644
--- a/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/winsys/cogl-winsys-glx.c
@@ -71,27 +71,27 @@ typedef struct _CoglContextGLX
 typedef struct _CoglOnscreenXlib
 {
   Window xwin;
-  gboolean is_foreign_xwin;
+  CoglBool is_foreign_xwin;
 } CoglOnscreenXlib;
 
 typedef struct _CoglOnscreenGLX
 {
   CoglOnscreenXlib _parent;
   GLXDrawable glxwin;
-  guint32 last_swap_vsync_counter;
-  gboolean pending_swap_notify;
+  uint32_t last_swap_vsync_counter;
+  CoglBool pending_swap_notify;
 } CoglOnscreenGLX;
 
 typedef struct _CoglTexturePixmapGLX
 {
   GLXPixmap glx_pixmap;
-  gboolean has_mipmap_space;
-  gboolean can_mipmap;
+  CoglBool has_mipmap_space;
+  CoglBool can_mipmap;
 
   CoglTexture *glx_tex;
 
-  gboolean bind_tex_image_queued;
-  gboolean pixmap_bound;
+  CoglBool bind_tex_image_queued;
+  CoglBool pixmap_bound;
 } CoglTexturePixmapGLX;
 
 /* Define a set of arrays containing the functions required from GL
@@ -137,7 +137,7 @@ _cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
 }
 
 static CoglOnscreen *
-find_onscreen_for_xid (CoglContext *context, guint32 xid)
+find_onscreen_for_xid (CoglContext *context, uint32_t xid)
 {
   GList *l;
 
@@ -161,7 +161,7 @@ find_onscreen_for_xid (CoglContext *context, guint32 xid)
 static void
 notify_swap_buffers (CoglContext *context, GLXDrawable drawable)
 {
-  CoglOnscreen *onscreen = find_onscreen_for_xid (context, (guint32)drawable);
+  CoglOnscreen *onscreen = find_onscreen_for_xid (context, (uint32_t)drawable);
   CoglDisplay *display = context->display;
   CoglGLXDisplay *glx_display = display->winsys;
   CoglOnscreenGLX *glx_onscreen;
@@ -234,7 +234,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglGLXRenderer, renderer->winsys);
 }
 
-static gboolean
+static CoglBool
 resolve_core_glx_functions (CoglRenderer *renderer,
                             GError **error)
 {
@@ -290,7 +290,7 @@ resolve_core_glx_functions (CoglRenderer *renderer,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -360,7 +360,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 update_winsys_features (CoglContext *context, GError **error)
 {
   CoglGLXDisplay *glx_display = context->display->winsys;
@@ -486,7 +486,7 @@ glx_attributes_from_framebuffer_config (CoglDisplay *display,
 /* It seems the GLX spec never defined an invalid GLXFBConfig that
  * we could overload as an indication of error, so we have to return
  * an explicit boolean status. */
-static gboolean
+static CoglBool
 find_fbconfig (CoglDisplay *display,
                CoglFramebufferConfig *config,
                GLXFBConfig *config_ret,
@@ -498,7 +498,7 @@ find_fbconfig (CoglDisplay *display,
   GLXFBConfig *configs = NULL;
   int n_configs;
   static int attributes[MAX_GLX_CONFIG_ATTRIBS];
-  gboolean ret = TRUE;
+  CoglBool ret = TRUE;
   int xscreen_num = DefaultScreen (xlib_renderer->xdpy);
 
   glx_attributes_from_framebuffer_config (display, config, attributes);
@@ -556,14 +556,14 @@ done:
   return ret;
 }
 
-static gboolean
+static CoglBool
 create_context (CoglDisplay *display, GError **error)
 {
   CoglGLXDisplay *glx_display = display->winsys;
   CoglXlibRenderer *xlib_renderer =
     _cogl_xlib_renderer_get_data (display->renderer);
   CoglGLXRenderer *glx_renderer = display->renderer->winsys;
-  gboolean support_transparent_windows =
+  CoglBool support_transparent_windows =
     display->onscreen_template->config.swap_chain->has_alpha;
   GLXFBConfig config;
   GError *fbconfig_error = NULL;
@@ -722,7 +722,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
   display->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_display_setup (CoglDisplay *display,
                             GError **error)
 {
@@ -747,7 +747,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_context_init (CoglContext *context, GError **error)
 {
   context->winsys = g_new0 (CoglContextGLX, 1);
@@ -767,7 +767,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
   g_free (context->winsys);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -1087,7 +1087,7 @@ _cogl_winsys_wait_for_vblank (void)
 
   if (glx_renderer->pf_glXGetVideoSync)
     {
-      guint32 current_count;
+      uint32_t current_count;
 
       glx_renderer->pf_glXGetVideoSync (&current_count);
       glx_renderer->pf_glXWaitVideoSync (2,
@@ -1096,10 +1096,10 @@ _cogl_winsys_wait_for_vblank (void)
     }
 }
 
-static guint32
+static uint32_t
 _cogl_winsys_get_vsync_counter (void)
 {
-  guint32 video_sync_count;
+  uint32_t video_sync_count;
   CoglGLXRenderer *glx_renderer;
 
   _COGL_GET_CONTEXT (ctx, 0);
@@ -1125,9 +1125,9 @@ _cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen,
   CoglOnscreenGLX *glx_onscreen = onscreen->winsys;
   GLXDrawable drawable =
     glx_onscreen->glxwin ? glx_onscreen->glxwin : xlib_onscreen->xwin;
-  guint32 end_frame_vsync_counter = 0;
-  gboolean have_counter;
-  gboolean can_wait;
+  uint32_t end_frame_vsync_counter = 0;
+  CoglBool have_counter;
+  CoglBool can_wait;
 
   /*
    * We assume that glXCopySubBuffer is synchronized which means it won't prevent multiple
@@ -1135,7 +1135,7 @@ _cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen,
    * case then we still want to use the vblank sync menchanism but
    * we only need it to throttle redraws.
    */
-  gboolean blit_sub_buffer_is_synchronized =
+  CoglBool blit_sub_buffer_is_synchronized =
      _cogl_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_REGION_SYNCHRONIZED);
 
   int framebuffer_height =  cogl_framebuffer_get_height (framebuffer);
@@ -1278,7 +1278,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
   CoglGLXRenderer *glx_renderer = context->display->renderer->winsys;
   CoglOnscreenXlib *xlib_onscreen = onscreen->winsys;
   CoglOnscreenGLX *glx_onscreen = onscreen->winsys;
-  gboolean have_counter;
+  CoglBool have_counter;
   GLXDrawable drawable;
 
   /* XXX: theoretically this shouldn't be necessary but at least with
@@ -1293,7 +1293,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
 
   if (framebuffer->config.swap_throttled)
     {
-      guint32 end_frame_vsync_counter = 0;
+      uint32_t end_frame_vsync_counter = 0;
 
       have_counter =
         _cogl_winsys_has_feature (COGL_WINSYS_FEATURE_VBLANK_COUNTER);
@@ -1306,7 +1306,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
 
       if (!glx_renderer->pf_glXSwapInterval)
         {
-          gboolean can_wait =
+          CoglBool can_wait =
             _cogl_winsys_has_feature (COGL_WINSYS_FEATURE_VBLANK_WAIT);
 
           /* If we are going to wait for VBLANK manually, we not only
@@ -1346,7 +1346,7 @@ _cogl_winsys_onscreen_swap_buffers (CoglOnscreen *onscreen)
     glx_onscreen->last_swap_vsync_counter = _cogl_winsys_get_vsync_counter ();
 }
 
-static guint32
+static uint32_t
 _cogl_winsys_onscreen_x11_get_window_xid (CoglOnscreen *onscreen)
 {
   CoglOnscreenXlib *xlib_onscreen = onscreen->winsys;
@@ -1372,7 +1372,7 @@ _cogl_winsys_onscreen_update_swap_throttled (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
-                                      gboolean visibility)
+                                      CoglBool visibility)
 {
   CoglContext *context = COGL_FRAMEBUFFER (onscreen)->context;
   CoglXlibRenderer *xlib_renderer =
@@ -1408,11 +1408,11 @@ _cogl_winsys_xlib_get_visual_info (void)
                                                  glx_display->fbconfig);
 }
 
-static gboolean
+static CoglBool
 get_fbconfig_for_depth (CoglContext *context,
                         unsigned int depth,
                         GLXFBConfig *fbconfig_ret,
-                        gboolean *can_mipmap_ret)
+                        CoglBool *can_mipmap_ret)
 {
   CoglXlibRenderer *xlib_renderer;
   CoglGLXRenderer *glx_renderer;
@@ -1422,7 +1422,7 @@ get_fbconfig_for_depth (CoglContext *context,
   int n_elements, i;
   int db, stencil, alpha, mipmap, rgba, value;
   int spare_cache_slot = 0;
-  gboolean found = FALSE;
+  CoglBool found = FALSE;
 
   xlib_renderer = _cogl_xlib_renderer_get_data (context->display->renderer);
   glx_renderer = context->display->renderer->winsys;
@@ -1548,7 +1548,7 @@ get_fbconfig_for_depth (CoglContext *context,
   return found;
 }
 
-static gboolean
+static CoglBool
 should_use_rectangle (CoglContext *context)
 {
 
@@ -1596,10 +1596,10 @@ should_use_rectangle (CoglContext *context)
   return context->rectangle_state == COGL_WINSYS_RECTANGLE_STATE_ENABLE;
 }
 
-static gboolean
+static CoglBool
 try_create_glx_pixmap (CoglContext *context,
                        CoglTexturePixmapX11 *tex_pixmap,
-                       gboolean mipmap)
+                       CoglBool mipmap)
 {
   CoglTexturePixmapGLX *glx_tex_pixmap = tex_pixmap->winsys;
   CoglRenderer *renderer;
@@ -1694,7 +1694,7 @@ try_create_glx_pixmap (CoglContext *context,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_texture_pixmap_x11_create (CoglTexturePixmapX11 *tex_pixmap)
 {
   CoglTexturePixmapGLX *glx_tex_pixmap;
@@ -1799,9 +1799,9 @@ _cogl_winsys_texture_pixmap_x11_free (CoglTexturePixmapX11 *tex_pixmap)
   g_free (glx_tex_pixmap);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_texture_pixmap_x11_update (CoglTexturePixmapX11 *tex_pixmap,
-                                        gboolean needs_mipmap)
+                                        CoglBool needs_mipmap)
 {
   CoglTexturePixmapGLX *glx_tex_pixmap = tex_pixmap->winsys;
   CoglGLXRenderer *glx_renderer;
@@ -1965,7 +1965,7 @@ static void
 _cogl_winsys_poll_get_info (CoglContext *context,
                             CoglPollFD **poll_fds,
                             int *n_poll_fds,
-                            gint64 *timeout)
+                            int64_t *timeout)
 {
   CoglDisplay *display = context->display;
   CoglGLXDisplay *glx_display = display->winsys;
diff --git a/cogl/winsys/cogl-winsys-private.h b/cogl/winsys/cogl-winsys-private.h
index e924fff..5332723 100644
--- a/cogl/winsys/cogl-winsys-private.h
+++ b/cogl/winsys/cogl-winsys-private.h
@@ -69,25 +69,25 @@ typedef struct _CoglWinsysVtable
   (*renderer_get_proc_address) (CoglRenderer *renderer,
                                 const char *name);
 
-  gboolean
+  CoglBool
   (*renderer_connect) (CoglRenderer *renderer, GError **error);
 
   void
   (*renderer_disconnect) (CoglRenderer *renderer);
 
-  gboolean
+  CoglBool
   (*display_setup) (CoglDisplay *display, GError **error);
 
   void
   (*display_destroy) (CoglDisplay *display);
 
-  gboolean
+  CoglBool
   (*context_init) (CoglContext *context, GError **error);
 
   void
   (*context_deinit) (CoglContext *context);
 
-  gboolean
+  CoglBool
   (*onscreen_init) (CoglOnscreen *onscreen, GError **error);
 
   void
@@ -104,7 +104,7 @@ typedef struct _CoglWinsysVtable
 
   void
   (*onscreen_set_visibility) (CoglOnscreen *onscreen,
-                              gboolean visibility);
+                              CoglBool visibility);
 
   /* Optional functions */
 
@@ -123,7 +123,7 @@ typedef struct _CoglWinsysVtable
   (*xlib_get_visual_info) (void);
 #endif
 
-  guint32
+  uint32_t
   (*onscreen_x11_get_window_xid) (CoglOnscreen *onscreen);
 
 #ifdef COGL_HAS_WIN32_SUPPORT
@@ -135,21 +135,21 @@ typedef struct _CoglWinsysVtable
   (*poll_get_info) (CoglContext *context,
                     CoglPollFD **poll_fds,
                     int *n_poll_fds,
-                    gint64 *timeout);
+                    int64_t *timeout);
   void
   (*poll_dispatch) (CoglContext *context,
                     const CoglPollFD *poll_fds,
                     int n_poll_fds);
 
 #ifdef COGL_HAS_XLIB_SUPPORT
-  gboolean
+  CoglBool
   (*texture_pixmap_x11_create) (CoglTexturePixmapX11 *tex_pixmap);
   void
   (*texture_pixmap_x11_free) (CoglTexturePixmapX11 *tex_pixmap);
 
-  gboolean
+  CoglBool
   (*texture_pixmap_x11_update) (CoglTexturePixmapX11 *tex_pixmap,
-                                gboolean needs_mipmap);
+                                CoglBool needs_mipmap);
 
   void
   (*texture_pixmap_x11_damage_notify) (CoglTexturePixmapX11 *tex_pixmap);
@@ -160,7 +160,7 @@ typedef struct _CoglWinsysVtable
 
 } CoglWinsysVtable;
 
-gboolean
+CoglBool
 _cogl_winsys_has_feature (CoglWinsysFeature feature);
 
 #endif /* __COGL_WINSYS_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-sdl.c b/cogl/winsys/cogl-winsys-sdl.c
index 04fa636..a8c3520 100644
--- a/cogl/winsys/cogl-winsys-sdl.c
+++ b/cogl/winsys/cogl-winsys-sdl.c
@@ -46,7 +46,7 @@ typedef struct _CoglRendererSdl
 typedef struct _CoglDisplaySdl
 {
   SDL_Surface *surface;
-  gboolean has_onscreen;
+  CoglBool has_onscreen;
 } CoglDisplaySdl;
 
 static CoglFuncPtr
@@ -64,7 +64,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   g_slice_free (CoglRendererSdl, renderer->winsys);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -121,7 +121,7 @@ set_gl_attribs_from_framebuffer_config (CoglFramebufferConfig *config)
                        config->swap_chain->has_alpha ? 1 : 0);
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_display_setup (CoglDisplay *display,
                             GError **error)
 {
@@ -156,7 +156,7 @@ error:
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_context_init (CoglContext *context, GError **error)
 {
   CoglRenderer *renderer = context->display->renderer;
@@ -188,7 +188,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
   sdl_display->has_onscreen = FALSE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -248,7 +248,7 @@ _cogl_winsys_onscreen_update_swap_throttled (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
-                                      gboolean visibility)
+                                      CoglBool visibility)
 {
   /* SDL doesn't appear to provide a way to set this */
 }
@@ -256,7 +256,7 @@ _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
 const CoglWinsysVtable *
 _cogl_winsys_sdl_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   /* It would be nice if we could use C99 struct initializers here
diff --git a/cogl/winsys/cogl-winsys-stub.c b/cogl/winsys/cogl-winsys-stub.c
index 1801b66..02ebb8b 100644
--- a/cogl/winsys/cogl-winsys-stub.c
+++ b/cogl/winsys/cogl-winsys-stub.c
@@ -73,7 +73,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
   renderer->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -87,7 +87,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
   display->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_display_setup (CoglDisplay *display,
                             GError **error)
 {
@@ -95,7 +95,7 @@ _cogl_winsys_display_setup (CoglDisplay *display,
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_context_init (CoglContext *context, GError **error)
 {
   context->winsys = &_cogl_winsys_stub_dummy_ptr;
@@ -114,7 +114,7 @@ _cogl_winsys_context_deinit (CoglContext *context)
   context->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -143,14 +143,14 @@ _cogl_winsys_onscreen_update_swap_throttled (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
-                                      gboolean visibility)
+                                      CoglBool visibility)
 {
 }
 
 const CoglWinsysVtable *
 _cogl_winsys_stub_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   /* It would be nice if we could use C99 struct initializers here
diff --git a/cogl/winsys/cogl-winsys-wgl.c b/cogl/winsys/cogl-winsys-wgl.c
index 198b1d8..7851404 100644
--- a/cogl/winsys/cogl-winsys-wgl.c
+++ b/cogl/winsys/cogl-winsys-wgl.c
@@ -76,7 +76,7 @@ typedef struct _CoglDisplayWgl
 typedef struct _CoglOnscreenWin32
 {
   HWND hwnd;
-  gboolean is_foreign_hwnd;
+  CoglBool is_foreign_hwnd;
 } CoglOnscreenWin32;
 
 typedef struct _CoglContextWgl
@@ -222,7 +222,7 @@ win32_event_filter_cb (MSG *msg, void *data)
   return COGL_FILTER_CONTINUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_renderer_connect (CoglRenderer *renderer,
                                GError **error)
 {
@@ -235,7 +235,7 @@ static LRESULT CALLBACK
 window_proc (HWND hwnd, UINT umsg,
              WPARAM wparam, LPARAM lparam)
 {
-  gboolean message_handled = FALSE;
+  CoglBool message_handled = FALSE;
   CoglOnscreen *onscreen;
 
   /* It's not clear what the best thing to do with messages sent to
@@ -294,7 +294,7 @@ window_proc (HWND hwnd, UINT umsg,
     return 0;
 }
 
-static gboolean
+static CoglBool
 pixel_format_is_better (const PIXELFORMATDESCRIPTOR *pfa,
                         const PIXELFORMATDESCRIPTOR *pfb)
 {
@@ -363,7 +363,7 @@ choose_pixel_format (CoglFramebufferConfig *config,
   return best_pf;
 }
 
-static gboolean
+static CoglBool
 create_window_class (CoglDisplay *display, GError **error)
 {
   CoglDisplayWgl *wgl_display = display->winsys;
@@ -416,7 +416,7 @@ create_window_class (CoglDisplay *display, GError **error)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 create_context (CoglDisplay *display, GError **error)
 {
   CoglDisplayWgl *wgl_display = display->winsys;
@@ -519,7 +519,7 @@ _cogl_winsys_display_destroy (CoglDisplay *display)
   display->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_display_setup (CoglDisplay *display,
                             GError **error)
 {
@@ -578,7 +578,7 @@ get_wgl_extensions_string (HDC dc)
   return NULL;
 }
 
-static gboolean
+static CoglBool
 update_winsys_features (CoglContext *context, GError **error)
 {
   CoglDisplayWgl *wgl_display = context->display->winsys;
@@ -624,7 +624,7 @@ update_winsys_features (CoglContext *context, GError **error)
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_context_init (CoglContext *context, GError **error)
 {
   CoglContextWgl *wgl_context;
@@ -723,7 +723,7 @@ _cogl_winsys_onscreen_deinit (CoglOnscreen *onscreen)
   onscreen->winsys = NULL;
 }
 
-static gboolean
+static CoglBool
 _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
                             GError **error)
 {
@@ -850,7 +850,7 @@ _cogl_winsys_onscreen_win32_get_window (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
-                                      gboolean visibility)
+                                      CoglBool visibility)
 {
   CoglOnscreenWin32 *win32_onscreen = onscreen->winsys;
 
@@ -860,7 +860,7 @@ _cogl_winsys_onscreen_set_visibility (CoglOnscreen *onscreen,
 const CoglWinsysVtable *
 _cogl_winsys_wgl_get_vtable (void)
 {
-  static gboolean vtable_inited = FALSE;
+  static CoglBool vtable_inited = FALSE;
   static CoglWinsysVtable vtable;
 
   /* It would be nice if we could use C99 struct initializers here
diff --git a/cogl/winsys/cogl-winsys.c b/cogl/winsys/cogl-winsys.c
index fccf233..c6bcdde 100644
--- a/cogl/winsys/cogl-winsys.c
+++ b/cogl/winsys/cogl-winsys.c
@@ -37,7 +37,7 @@ _cogl_winsys_error_quark (void)
 }
 
 /* FIXME: we should distinguish renderer and context features */
-gboolean
+CoglBool
 _cogl_winsys_has_feature (CoglWinsysFeature feature)
 {
   _COGL_GET_CONTEXT (ctx, FALSE);
diff --git a/doc/CODING_STYLE b/doc/CODING_STYLE
index 748b915..d982adf 100644
--- a/doc/CODING_STYLE
+++ b/doc/CODING_STYLE
@@ -19,28 +19,29 @@ Differences to the Clutter coding style:
 
 Cogl headers are not exempt from the 80 characters limit as they are in
 Clutter. Function prototypes should not be arranged into vertical
-columns but should instead follow the "+ Functions" section of the
-Clutter CODING_STYLE like:
+columns but should instead look somthing like this:
 
 void
-my_function (CoglType     type,
-	     CoglType	 *a_pointer,
-	     CoglType	  another_type);
+my_function (CoglType type,
+	     CoglType *a_pointer,
+	     CoglType another_type);
 
 + Types
 
 Avoid the use of redundant glib typedefs and wherever possible simply
-use ANSI C types.
+use ANSI C/c99 types.
 
 The following types should not be used:
-  gint, guint, gfloat, gdouble, glong, gulong, gchar and guchar
+  gint, guint, gfloat, gdouble, glong, gulong, gchar, guchar,
+  guint{8,16,32} or gint{8,16,32}
 Instead use:
-  int, unsigned int, float, double, long, unsigned long, char, and
-  guint8/unsigned char
+  int, unsigned int, float, double, long, unsigned long, char,
+  unsigned char, uint{8,16,32}_t and int{8,16,32}_t
 
-The glib types that we continue to use for portability are gboolean,
-gint{8,16,32,64}, guint{8,16,32,64} and gsize. When ever you need a
-byte size type for dealing with pixel data then guint8 should be used.
+Use CoglBool for boolean types.
+
+When ever you need a byte size type for dealing with pixel data then
+uint8_t should be used.
 
 The general intention is that Cogl should look palatable to the widest
 range of C programmers including those outside the Gnome community so
diff --git a/examples/cogl-crate.c b/examples/cogl-crate.c
index 61b9cae..9c7c20f 100644
--- a/examples/cogl-crate.c
+++ b/examples/cogl-crate.c
@@ -25,7 +25,7 @@ typedef struct _Data
 
   GTimer *timer;
 
-  gboolean swap_ready;
+  CoglBool swap_ready;
 
 } Data;
 
@@ -149,7 +149,7 @@ main (int argc, char **argv)
   PangoRectangle hello_label_size;
   float fovy, aspect, z_near, z_2d, z_far;
   CoglDepthState depth_state;
-  gboolean has_swap_notify;
+  CoglBool has_swap_notify;
 
   ctx = cogl_context_new (NULL, &error);
   if (!ctx) {
@@ -279,7 +279,7 @@ main (int argc, char **argv)
     {
       CoglPollFD *poll_fds;
       int n_poll_fds;
-      gint64 timeout;
+      int64_t timeout;
 
       if (data.swap_ready)
         {
diff --git a/examples/cogl-hello.c b/examples/cogl-hello.c
index 051f141..a0b002d 100644
--- a/examples/cogl-hello.c
+++ b/examples/cogl-hello.c
@@ -10,7 +10,7 @@ typedef struct _Data
     CoglPipeline *pipeline;
 } Data;
 
-static gboolean
+static CoglBool
 paint_cb (void *user_data)
 {
     Data *data = user_data;
diff --git a/examples/cogl-msaa.c b/examples/cogl-msaa.c
index 446f443..99f9b8d 100644
--- a/examples/cogl-msaa.c
+++ b/examples/cogl-msaa.c
@@ -84,7 +84,7 @@ main (int argc, char **argv)
     for (;;) {
         CoglPollFD *poll_fds;
         int n_poll_fds;
-        gint64 timeout;
+        int64_t timeout;
         CoglPipeline *texture_pipeline;
 
         cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
diff --git a/examples/cogl-sdl-hello.c b/examples/cogl-sdl-hello.c
index 65e4fee..1525deb 100644
--- a/examples/cogl-sdl-hello.c
+++ b/examples/cogl-sdl-hello.c
@@ -12,11 +12,11 @@ typedef struct Data
   CoglPipeline *pipeline;
   float center_x, center_y;
   CoglFramebuffer *fb;
-  gboolean quit;
-  gboolean redraw_queued;
+  CoglBool quit;
+  CoglBool redraw_queued;
 } Data;
 
-static gboolean
+static CoglBool
 redraw (Data *data)
 {
   CoglFramebuffer *fb = data->fb;
diff --git a/examples/cogl-x11-foreign.c b/examples/cogl-x11-foreign.c
index 7329a3f..70049f2 100644
--- a/examples/cogl-x11-foreign.c
+++ b/examples/cogl-x11-foreign.c
@@ -15,12 +15,12 @@
 
 static void
 update_cogl_x11_event_mask (CoglOnscreen *onscreen,
-                            guint32 event_mask,
+                            uint32_t event_mask,
                             void *user_data)
 {
   Display *xdpy = user_data;
   XSetWindowAttributes attrs;
-  guint32 xwin;
+  uint32_t xwin;
 
   attrs.event_mask = event_mask | X11_FOREIGN_EVENT_MASK;
   xwin = cogl_x11_onscreen_get_window_xid (onscreen);
@@ -44,7 +44,7 @@ main (int argc, char **argv)
   CoglFramebuffer *fb;
   CoglPipeline *pipeline;
   GError *error = NULL;
-  guint32 visual;
+  uint32_t visual;
   XVisualInfo template, *xvisinfo;
   int visinfos_count;
   XSetWindowAttributes xattr;
@@ -156,7 +156,7 @@ main (int argc, char **argv)
     {
       CoglPollFD *poll_fds;
       int n_poll_fds;
-      gint64 timeout;
+      int64_t timeout;
 
       while (XPending (xdpy))
         {
diff --git a/examples/cogl-x11-tfp.c b/examples/cogl-x11-tfp.c
index eb1b237..d42bcb1 100644
--- a/examples/cogl-x11-tfp.c
+++ b/examples/cogl-x11-tfp.c
@@ -21,12 +21,12 @@
 
 static void
 update_cogl_x11_event_mask (CoglOnscreen *onscreen,
-                            guint32 event_mask,
+                            uint32_t event_mask,
                             void *user_data)
 {
   Display *xdpy = user_data;
   XSetWindowAttributes attrs;
-  guint32 xwin;
+  uint32_t xwin;
 
   attrs.event_mask = event_mask | X11_FOREIGN_EVENT_MASK;
   xwin = cogl_x11_onscreen_get_window_xid (onscreen);
@@ -50,7 +50,7 @@ main (int argc, char **argv)
   CoglOnscreen *onscreen;
   CoglFramebuffer *fb;
   GError *error = NULL;
-  guint32 visual;
+  uint32_t visual;
   XVisualInfo template, *xvisinfo;
   int visinfos_count;
   XSetWindowAttributes xattr;
diff --git a/examples/cogland.c b/examples/cogland.c
index 6b79160..d6f7bf8 100644
--- a/examples/cogland.c
+++ b/examples/cogland.c
@@ -25,7 +25,7 @@ typedef struct
   int y;
   CoglandBuffer *buffer;
 
-  gboolean has_shell_surface;
+  CoglBool has_shell_surface;
 } CoglandSurface;
 
 typedef struct
@@ -37,7 +37,7 @@ typedef struct
 
 typedef struct
 {
-  guint32 flags;
+  uint32_t flags;
   int width;
   int height;
   int refresh;
@@ -47,10 +47,10 @@ typedef struct
 {
   struct wl_object wayland_output;
 
-  gint32 x;
-  gint32 y;
-  gint32 width_mm;
-  gint32 height_mm;
+  int32_t x;
+  int32_t y;
+  int32_t width_mm;
+  int32_t height_mm;
 
   CoglOnscreen *onscreen;
 
@@ -88,7 +88,7 @@ struct _CoglandCompositor
   GList *surfaces;
 };
 
-static guint32
+static uint32_t
 get_time (void)
 {
   struct timeval tv;
@@ -96,7 +96,7 @@ get_time (void)
   return tv.tv_sec * 1000 + tv.tv_usec / 1000;
 }
 
-static gboolean
+static CoglBool
 wayland_event_source_prepare (GSource *base, int *timeout)
 {
   *timeout = -1;
@@ -104,14 +104,14 @@ wayland_event_source_prepare (GSource *base, int *timeout)
   return FALSE;
 }
 
-static gboolean
+static CoglBool
 wayland_event_source_check (GSource *base)
 {
   WaylandEventSource *source = (WaylandEventSource *)base;
   return source->pfd.revents;
 }
 
-static gboolean
+static CoglBool
 wayland_event_source_dispatch (GSource *base,
                                 GSourceFunc callback,
                                 void *data)
@@ -184,10 +184,10 @@ shm_buffer_created (struct wl_buffer *wayland_buffer)
 
 static void
 shm_buffer_damaged (struct wl_buffer *wayland_buffer,
-                    gint32 x,
-                    gint32 y,
-                    gint32 width,
-                    gint32 height)
+                    int32_t x,
+                    int32_t y,
+                    int32_t width,
+                    int32_t height)
 {
   CoglandBuffer *buffer = wayland_buffer->user_data;
 
@@ -267,7 +267,7 @@ static void
 cogland_surface_attach_buffer (struct wl_client *wayland_client,
                                struct wl_resource *wayland_surface_resource,
                                struct wl_resource *wayland_buffer_resource,
-                               gint32 dx, gint32 dy)
+                               int32_t dx, int32_t dy)
 {
   struct wl_buffer *wayland_buffer = wayland_buffer_resource->data;
   CoglandBuffer *buffer = wayland_buffer->user_data;
@@ -316,10 +316,10 @@ cogland_surface_attach_buffer (struct wl_client *wayland_client,
 static void
 cogland_surface_damage (struct wl_client *client,
                         struct wl_resource *resource,
-                        gint32 x,
-                        gint32 y,
-                        gint32 width,
-                        gint32 height)
+                        int32_t x,
+                        int32_t y,
+                        int32_t width,
+                        int32_t height)
 {
 }
 
@@ -347,7 +347,7 @@ destroy_frame_callback (struct wl_resource *callback_resource)
 static void
 cogland_surface_frame (struct wl_client *client,
                        struct wl_resource *surface_resource,
-                       guint32 callback_id)
+                       uint32_t callback_id)
 {
   CoglandFrameCallback *callback;
   CoglandSurface *surface = surface_resource->data;
@@ -391,7 +391,7 @@ cogland_surface_resource_destroy_cb (struct wl_resource *resource)
 static void
 cogland_compositor_create_surface (struct wl_client *wayland_client,
                                    struct wl_resource *wayland_compositor_resource,
-                                   guint32 id)
+                                   uint32_t id)
 {
   CoglandCompositor *compositor = wayland_compositor_resource->data;
   CoglandSurface *surface = g_slice_new0 (CoglandSurface);
@@ -415,8 +415,8 @@ cogland_compositor_create_surface (struct wl_client *wayland_client,
 static void
 bind_output (struct wl_client *client,
              void *data,
-             guint32 version,
-             guint32 id)
+             uint32_t version,
+             uint32_t id)
 {
   CoglandOutput *output = data;
   struct wl_resource *resource =
@@ -498,7 +498,7 @@ cogland_compositor_create_output (CoglandCompositor *compositor,
   compositor->outputs = g_list_prepend (compositor->outputs, output);
 }
 
-static gboolean
+static CoglBool
 paint_cb (void *user_data)
 {
   CoglandCompositor *compositor = user_data;
@@ -554,8 +554,8 @@ const static struct wl_compositor_interface cogland_compositor_interface =
 static void
 compositor_bind (struct wl_client *client,
                  void *data,
-                 guint32 version,
-                 guint32 id)
+                 uint32_t version,
+                 uint32_t id)
 {
   CoglandCompositor *compositor = data;
 
@@ -682,8 +682,8 @@ static const struct wl_shell_interface cogland_shell_interface =
 static void
 bind_shell (struct wl_client *client,
             void *data,
-            guint32 version,
-            guint32 id)
+            uint32_t version,
+            uint32_t id)
 {
   wl_client_add_object (client, &wl_shell_interface,
                         &cogland_shell_interface, id, data);
diff --git a/tests/conform/test-atlas-migration.c b/tests/conform/test-atlas-migration.c
index 2e18b96..56be060 100644
--- a/tests/conform/test-atlas-migration.c
+++ b/tests/conform/test-atlas-migration.c
@@ -20,7 +20,7 @@ create_texture (int size)
 {
   CoglHandle texture;
   const ClutterColor *color;
-  guint8 *data, *p;
+  uint8_t *data, *p;
   int x, y;
 
   /* Create a red, green or blue texture depending on the size */
@@ -67,7 +67,7 @@ create_texture (int size)
 static void
 verify_texture (CoglHandle texture, int size)
 {
-  guint8 *data, *p;
+  uint8_t *data, *p;
   int x, y;
   const ClutterColor *color;
 
diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
index fe1eda5..1c11904 100644
--- a/tests/conform/test-backface-culling.c
+++ b/tests/conform/test-backface-culling.c
@@ -25,7 +25,7 @@ typedef struct _TestState
 
 static void
 validate_part (CoglFramebuffer *framebuffer,
-               int xnum, int ynum, gboolean shown)
+               int xnum, int ynum, CoglBool shown)
 {
   test_utils_check_region (framebuffer,
                            xnum * TEXTURE_RENDER_SIZE + TEST_INSET,
@@ -162,7 +162,7 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
 
   for (draw_num = 0; draw_num < 16; draw_num++)
     {
-      gboolean cull_front, cull_back;
+      CoglBool cull_front, cull_back;
       CoglPipelineCullFaceMode cull_mode;
 
       if (USE_LEGACY_STATE (draw_num))
@@ -195,7 +195,7 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
 
       if (FRONT_WINDING (draw_num) == COGL_WINDING_CLOCKWISE)
         {
-          gboolean tmp = cull_front;
+          CoglBool tmp = cull_front;
           cull_front = cull_back;
           cull_back = tmp;
         }
diff --git a/tests/conform/test-bitmask.c b/tests/conform/test-bitmask.c
index fdf7566..58decd7 100644
--- a/tests/conform/test-bitmask.c
+++ b/tests/conform/test-bitmask.c
@@ -20,7 +20,7 @@ typedef struct
   int *bits;
 } CheckData;
 
-static gboolean
+static CoglBool
 check_bit (int bit_num, void *user_data)
 {
   CheckData *data = user_data;
diff --git a/tests/conform/test-blend-strings.c b/tests/conform/test-blend-strings.c
index 4fcf85f..967d53a 100644
--- a/tests/conform/test-blend-strings.c
+++ b/tests/conform/test-blend-strings.c
@@ -29,32 +29,32 @@ static void
 test_blend (TestState *state,
             int x,
             int y,
-            guint32 src_color,
-            guint32 dst_color,
+            uint32_t src_color,
+            uint32_t dst_color,
             const char *blend_string,
-            guint32 blend_constant,
-            guint32 expected_result)
+            uint32_t blend_constant,
+            uint32_t expected_result)
 {
   /* src color */
-  guint8 Sr = MASK_RED (src_color);
-  guint8 Sg = MASK_GREEN (src_color);
-  guint8 Sb = MASK_BLUE (src_color);
-  guint8 Sa = MASK_ALPHA (src_color);
+  uint8_t Sr = MASK_RED (src_color);
+  uint8_t Sg = MASK_GREEN (src_color);
+  uint8_t Sb = MASK_BLUE (src_color);
+  uint8_t Sa = MASK_ALPHA (src_color);
   /* dest color */
-  guint8 Dr = MASK_RED (dst_color);
-  guint8 Dg = MASK_GREEN (dst_color);
-  guint8 Db = MASK_BLUE (dst_color);
-  guint8 Da = MASK_ALPHA (dst_color);
+  uint8_t Dr = MASK_RED (dst_color);
+  uint8_t Dg = MASK_GREEN (dst_color);
+  uint8_t Db = MASK_BLUE (dst_color);
+  uint8_t Da = MASK_ALPHA (dst_color);
   /* blend constant - when applicable */
-  guint8 Br = MASK_RED (blend_constant);
-  guint8 Bg = MASK_GREEN (blend_constant);
-  guint8 Bb = MASK_BLUE (blend_constant);
-  guint8 Ba = MASK_ALPHA (blend_constant);
+  uint8_t Br = MASK_RED (blend_constant);
+  uint8_t Bg = MASK_GREEN (blend_constant);
+  uint8_t Bb = MASK_BLUE (blend_constant);
+  uint8_t Ba = MASK_ALPHA (blend_constant);
   CoglColor blend_const_color;
 
   CoglHandle material;
   CoglPipeline *pipeline;
-  gboolean status;
+  CoglBool status;
   GError *error = NULL;
   int y_off;
   int x_off;
@@ -175,13 +175,13 @@ test_blend (TestState *state,
 }
 
 static CoglTexture *
-make_texture (guint32 color)
+make_texture (uint32_t color)
 {
   guchar *tex_data, *p;
-  guint8 r = MASK_RED (color);
-  guint8 g = MASK_GREEN (color);
-  guint8 b = MASK_BLUE (color);
-  guint8 a = MASK_ALPHA (color);
+  uint8_t r = MASK_RED (color);
+  uint8_t g = MASK_GREEN (color);
+  uint8_t b = MASK_BLUE (color);
+  uint8_t a = MASK_ALPHA (color);
   CoglTexture *tex;
 
   tex_data = g_malloc (QUAD_WIDTH * QUAD_WIDTH * 4);
@@ -213,23 +213,23 @@ static void
 test_tex_combine (TestState *state,
                   int x,
                   int y,
-                  guint32 tex0_color,
-                  guint32 tex1_color,
-                  guint32 combine_constant,
+                  uint32_t tex0_color,
+                  uint32_t tex1_color,
+                  uint32_t combine_constant,
                   const char *combine_string,
-                  guint32 expected_result)
+                  uint32_t expected_result)
 {
   CoglTexture *tex0, *tex1;
 
   /* combine constant - when applicable */
-  guint8 Cr = MASK_RED (combine_constant);
-  guint8 Cg = MASK_GREEN (combine_constant);
-  guint8 Cb = MASK_BLUE (combine_constant);
-  guint8 Ca = MASK_ALPHA (combine_constant);
+  uint8_t Cr = MASK_RED (combine_constant);
+  uint8_t Cg = MASK_GREEN (combine_constant);
+  uint8_t Cb = MASK_BLUE (combine_constant);
+  uint8_t Ca = MASK_ALPHA (combine_constant);
   CoglColor combine_const_color;
 
   CoglHandle material;
-  gboolean status;
+  CoglBool status;
   GError *error = NULL;
   int y_off;
   int x_off;
diff --git a/tests/conform/test-color-mask.c b/tests/conform/test-color-mask.c
index 1e22cbc..43199ca 100644
--- a/tests/conform/test-color-mask.c
+++ b/tests/conform/test-color-mask.c
@@ -56,7 +56,7 @@ paint (TestState *state)
   /* Verify all of the fbos drew the right color */
   for (i = 0; i < NUM_FBOS; i++)
     {
-      guint8 expected_colors[NUM_FBOS][4] =
+      uint8_t expected_colors[NUM_FBOS][4] =
         { { 0xff, 0x00, 0x00, 0xff },
           { 0x00, 0xff, 0x00, 0xff },
           { 0x00, 0x00, 0xff, 0xff } };
diff --git a/tests/conform/test-custom-attributes.c b/tests/conform/test-custom-attributes.c
index 6af4fa2..642c81c 100644
--- a/tests/conform/test-custom-attributes.c
+++ b/tests/conform/test-custom-attributes.c
@@ -11,19 +11,19 @@ typedef struct _TestState
 
 typedef struct
 {
-  gint16 x, y;
+  int16_t x, y;
   float r, g, b, a;
 } FloatVert;
 
 typedef struct
 {
-  gint16 x, y;
-  guint8 r, g, b, a;
+  int16_t x, y;
+  uint8_t r, g, b, a;
 } ByteVert;
 
 typedef struct
 {
-  gint16 x, y;
+  int16_t x, y;
 } ShortVert;
 
 static void
diff --git a/tests/conform/test-depth-test.c b/tests/conform/test-depth-test.c
index 76891db..9b1ae55 100644
--- a/tests/conform/test-depth-test.c
+++ b/tests/conform/test-depth-test.c
@@ -23,26 +23,26 @@ typedef struct _TestState
 
 typedef struct
 {
-  guint32               color;
+  uint32_t               color;
   float                 depth;
-  gboolean              test_enable;
+  CoglBool              test_enable;
   CoglDepthTestFunction test_function;
-  gboolean              write_enable;
+  CoglBool              write_enable;
   float                 range_near;
   float                 range_far;
 } TestDepthState;
 
-static gboolean
+static CoglBool
 draw_rectangle (TestState *state,
                 int x,
                 int y,
                 TestDepthState *rect_state,
-                gboolean legacy_mode)
+                CoglBool legacy_mode)
 {
-  guint8 Cr = MASK_RED (rect_state->color);
-  guint8 Cg = MASK_GREEN (rect_state->color);
-  guint8 Cb = MASK_BLUE (rect_state->color);
-  guint8 Ca = MASK_ALPHA (rect_state->color);
+  uint8_t Cr = MASK_RED (rect_state->color);
+  uint8_t Cg = MASK_GREEN (rect_state->color);
+  uint8_t Cb = MASK_BLUE (rect_state->color);
+  uint8_t Ca = MASK_ALPHA (rect_state->color);
   CoglPipeline *pipeline;
   CoglDepthState depth_state;
 
@@ -101,10 +101,10 @@ test_depth (TestState *state,
             TestDepthState *rect0_state,
             TestDepthState *rect1_state,
             TestDepthState *rect2_state,
-            gboolean legacy_mode,
-            guint32 expected_result)
+            CoglBool legacy_mode,
+            uint32_t expected_result)
 {
-  gboolean missing_feature = FALSE;
+  CoglBool missing_feature = FALSE;
 
   if (rect0_state)
     missing_feature |= !draw_rectangle (state, x, y, rect0_state, legacy_mode);
diff --git a/tests/conform/test-just-vertex-shader.c b/tests/conform/test-just-vertex-shader.c
index 2e05480..908fade 100644
--- a/tests/conform/test-just-vertex-shader.c
+++ b/tests/conform/test-just-vertex-shader.c
@@ -14,7 +14,7 @@ create_dummy_texture (void)
 {
   /* Create a dummy 1x1 green texture to replace the color from the
      vertex shader */
-  static const guint8 data[4] = { 0x00, 0xff, 0x00, 0xff };
+  static const uint8_t data[4] = { 0x00, 0xff, 0x00, 0xff };
 
   return cogl_texture_new_from_data (1, 1, /* size */
                                      COGL_TEXTURE_NONE,
diff --git a/tests/conform/test-materials.c b/tests/conform/test-materials.c
index ab483e8..7c1da2f 100644
--- a/tests/conform/test-materials.c
+++ b/tests/conform/test-materials.c
@@ -26,7 +26,7 @@ typedef struct _TestState
 } TestState;
 
 static void
-check_quad (int quad_x, int quad_y, guint32 color)
+check_quad (int quad_x, int quad_y, uint32_t color)
 {
   test_utils_check_pixel (x * QUAD_WIDTH + (QUAD_WIDTH / 2),
                           y * QUAD_WIDTH + (QUAD_WIDTH / 2),
@@ -36,7 +36,7 @@ check_quad (int quad_x, int quad_y, guint32 color)
 static void
 test_material_with_primitives (TestState *state,
                                int x, int y,
-                               guint32 color)
+                               uint32_t color)
 {
   CoglTextureVertex verts[4] = {
     { .x = 0,          .y = 0,          .z = 0 },
@@ -99,8 +99,8 @@ static void
 test_using_all_layers (TestState *state, int x, int y)
 {
   CoglHandle material = cogl_material_new ();
-  guint8 white_pixel[] = { 0xff, 0xff, 0xff, 0xff };
-  guint8 red_pixel[] = { 0xff, 0x00, 0x00, 0xff };
+  uint8_t white_pixel[] = { 0xff, 0xff, 0xff, 0xff };
+  uint8_t red_pixel[] = { 0xff, 0x00, 0x00, 0xff };
   CoglHandle white_texture;
   CoglHandle red_texture;
   GLint n_layers;
@@ -209,8 +209,8 @@ on_paint (ClutterActor *actor, TestState *state)
 #endif
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-multitexture.c b/tests/conform/test-multitexture.c
index c0aa9c2..aeb409c 100644
--- a/tests/conform/test-multitexture.c
+++ b/tests/conform/test-multitexture.c
@@ -23,12 +23,12 @@ assert_region_color (int x,
                      int y,
                      int width,
                      int height,
-                     guint8 red,
-                     guint8 green,
-                     guint8 blue,
-                     guint8 alpha)
+                     uint8_t red,
+                     uint8_t green,
+                     uint8_t blue,
+                     uint8_t alpha)
 {
-  guint8 *data = g_malloc0 (width * height * 4);
+  uint8_t *data = g_malloc0 (width * height * 4);
   cogl_read_pixels (x, y, width, height,
                     COGL_READ_PIXELS_COLOR_BUFFER,
                     COGL_PIXEL_FORMAT_RGBA_8888_PRE,
@@ -36,7 +36,7 @@ assert_region_color (int x,
   for (y = 0; y < height; y++)
     for (x = 0; x < width; x++)
       {
-        guint8 *pixel = &data[y * width * 4 + x * 4];
+        uint8_t *pixel = &data[y * width * 4 + x * 4];
 #if 1
         g_assert (pixel[RED] == red &&
                   pixel[GREEN] == green &&
@@ -103,7 +103,7 @@ on_paint (ClutterActor *actor, TestState *state)
 {
   CoglHandle tex0, tex1;
   CoglHandle material;
-  gboolean status;
+  CoglBool status;
   GError *error = NULL;
   float tex_coords[] = {
     0, 0, 0.5, 0.5, /* tex0 */
@@ -164,8 +164,8 @@ on_paint (ClutterActor *actor, TestState *state)
 #endif
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-npot-texture.c b/tests/conform/test-npot-texture.c
index 8687d63..8aca4df 100644
--- a/tests/conform/test-npot-texture.c
+++ b/tests/conform/test-npot-texture.c
@@ -36,12 +36,12 @@ typedef struct _TestState
   CoglHandle texture;
 } TestState;
 
-static gboolean
+static CoglBool
 validate_part (int xnum, int ynum, const ClutterColor *color)
 {
   guchar *pixels, *p;
   ClutterActor *stage = clutter_stage_get_default ();
-  gboolean ret = TRUE;
+  CoglBool ret = TRUE;
 
   /* Read the appropriate part but skip out a few pixels around the
      edges */
@@ -114,8 +114,8 @@ on_paint (ClutterActor *actor, TestState *state)
     validate_result (state);
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-offscreen.c b/tests/conform/test-offscreen.c
index 0683a8a..e8162fb 100644
--- a/tests/conform/test-offscreen.c
+++ b/tests/conform/test-offscreen.c
@@ -16,7 +16,7 @@ static void
 check_quadrant (TestState *state,
                 int qx,
                 int qy,
-                guint32 expected_rgba)
+                uint32_t expected_rgba)
 {
   /* The quadrants are all stuffed into the top right corner of the
      framebuffer */
@@ -147,7 +147,7 @@ test_flush (TestState *state)
                                  1, 1, 15, 15, 0xff0000ff);
       else if (i == 1)
         {
-          guint8 data[16 * 4 * 16];
+          uint8_t data[16 * 4 * 16];
           int x, y;
 
           /* Second time try reading back the texture contents */
diff --git a/tests/conform/test-path.c b/tests/conform/test-path.c
index a7a6f3c..fbe1fcd 100644
--- a/tests/conform/test-path.c
+++ b/tests/conform/test-path.c
@@ -26,7 +26,7 @@ draw_path_at (int x, int y)
 static void
 check_block (int block_x, int block_y, int block_mask)
 {
-  guint32 data[BLOCK_SIZE * BLOCK_SIZE];
+  uint32_t data[BLOCK_SIZE * BLOCK_SIZE];
   int qx, qy;
 
   /* Block mask represents which quarters of the block should be
@@ -38,7 +38,7 @@ check_block (int block_x, int block_y, int block_mask)
                                 block_y * BLOCK_SIZE,
                                 BLOCK_SIZE, BLOCK_SIZE,
                                 COGL_PIXEL_FORMAT_RGBA_8888_PRE,
-                                (guint8 *)data);
+                                (uint8_t *)data);
 
   for (qy = 0; qy < 2; qy++)
     for (qx = 0; qx < 2; qx++)
@@ -50,7 +50,7 @@ check_block (int block_x, int block_y, int block_mask)
         for (x = 0; x < BLOCK_SIZE / 2 - TEST_INSET * 2; x++)
           for (y = 0; y < BLOCK_SIZE / 2 - TEST_INSET * 2; y++)
             {
-              const guint32 *p = data + (qx * BLOCK_SIZE / 2 +
+              const uint32_t *p = data + (qx * BLOCK_SIZE / 2 +
                                         qy * BLOCK_SIZE * BLOCK_SIZE / 2 +
                                         (x + TEST_INSET) +
                                         (y + TEST_INSET) * BLOCK_SIZE);
diff --git a/tests/conform/test-pipeline-uniforms.c b/tests/conform/test-pipeline-uniforms.c
index da7b86b..68f3ab8 100644
--- a/tests/conform/test-pipeline-uniforms.c
+++ b/tests/conform/test-pipeline-uniforms.c
@@ -349,7 +349,7 @@ paint (TestState *state)
 }
 
 static void
-check_pos (int pos, guint32 color)
+check_pos (int pos, uint32_t color)
 {
   test_utils_check_pixel (fb, pos * 10 + 5, 5, color);
 }
diff --git a/tests/conform/test-pipeline-user-matrix.c b/tests/conform/test-pipeline-user-matrix.c
index 6f1b34a..c9d18f6 100644
--- a/tests/conform/test-pipeline-user-matrix.c
+++ b/tests/conform/test-pipeline-user-matrix.c
@@ -13,7 +13,7 @@ typedef struct _TestState
 static void
 validate_result (TestState *state)
 {
-  guint32 *pixels, *p;
+  uint32_t *pixels, *p;
   char *screen_pixel;
   const char *intended_pixel = "#ffffff";
 
@@ -24,7 +24,7 @@ validate_result (TestState *state)
 
   cogl_framebuffer_read_pixels (fb, 0, 0, state->width, state->height,
                                 COGL_PIXEL_FORMAT_RGBA_8888_PRE,
-                                (guint8 *)pixels);
+                                (uint8_t *)pixels);
 
   for (p = pixels; p < pixels + state->width * state->height; p++)
     {
@@ -38,14 +38,14 @@ static void
 paint (TestState *state)
 {
   /* This texture is painted mirrored around the x-axis */
-  guint8 data0[] = {
+  uint8_t data0[] = {
     0xff, 0x00, 0x00, /* red -> becomes bottom left */
     0x00, 0xff, 0x00, /* green -> becomes bottom right */
     0x00, 0x00, 0xff, /* blue -> becomes top left */
     0xff, 0x00, 0xff  /* magenta -> becomes top right */
   };
   /* This texture is painted mirrored about the y-axis */
-  guint8 data1[] = {
+  uint8_t data1[] = {
     0x00, 0xff, 0x00, /* green -> becomes top right */
     0xff, 0xff, 0x00, /* yellow -> becomes top left */
     0xff, 0x00, 0xff, /* magenta -> becomes bottom right */
diff --git a/tests/conform/test-pixel-buffer.c b/tests/conform/test-pixel-buffer.c
index 393f40a..e32a6f1 100644
--- a/tests/conform/test-pixel-buffer.c
+++ b/tests/conform/test-pixel-buffer.c
@@ -15,7 +15,7 @@ enum
 
 typedef struct test_tile
 {
-  guint8 color[4];
+  uint8_t color[4];
   gfloat x, y;
   CoglBuffer *buffer;
   CoglTexture *texture;
@@ -51,7 +51,7 @@ create_map_tile (CoglContext *context,
   guchar *map;
   unsigned int i;
   unsigned int stride;
-  guint8 *line;
+  uint8_t *line;
 
   bitmap = cogl_bitmap_new_with_size (context,
                                       TILE_SIZE,
@@ -95,7 +95,7 @@ create_set_region_tile (CoglContext *context,
 {
   CoglBitmap *bitmap;
   CoglBuffer *buffer;
-  guint8 bottom_color[4];
+  uint8_t bottom_color[4];
   unsigned int rowstride = 0;
   guchar *data;
   unsigned int i;
@@ -148,7 +148,7 @@ create_set_data_tile (CoglContext *context,
   CoglBitmap *bitmap;
   CoglBuffer *buffer;
   unsigned int rowstride = 0;
-  gboolean res;
+  CoglBool res;
   guchar *data;
   unsigned int i;
 
diff --git a/tests/conform/test-point-size.c b/tests/conform/test-point-size.c
index 6f114d3..899073a 100644
--- a/tests/conform/test-point-size.c
+++ b/tests/conform/test-point-size.c
@@ -34,8 +34,8 @@ verify_point_size (CoglFramebuffer *fb,
   for (y = 0; y < 4; y++)
     for (x = 0; x < 4; x++)
       {
-        gboolean in_point = x >= 1 && x <= 2 && y >= 1 && y <= 2;
-        guint32 expected_pixel = in_point ? 0x00ff00ff : 0xff0000ff;
+        CoglBool in_point = x >= 1 && x <= 2 && y >= 1 && y <= 2;
+        uint32_t expected_pixel = in_point ? 0x00ff00ff : 0xff0000ff;
 
         test_utils_check_pixel (fb,
                                 calc_coord_offset (x_pos, x, point_size),
diff --git a/tests/conform/test-point-sprite.c b/tests/conform/test-point-sprite.c
index d8c450e..e899017 100644
--- a/tests/conform/test-point-sprite.c
+++ b/tests/conform/test-point-sprite.c
@@ -11,7 +11,7 @@ point =
     0.0f, 0.0f
   };
 
-static const guint8
+static const uint8_t
 tex_data[3 * 2 * 2] =
   {
     0x00, 0x00, 0xff, 0x00, 0xff, 0x00,
@@ -27,7 +27,7 @@ test_point_sprite (void)
   GError *error = NULL;
   CoglTexture2D *tex_2d;
   CoglPipeline *pipeline, *solid_pipeline;
-  gboolean res;
+  CoglBool res;
 
   cogl_framebuffer_orthographic (fb,
                                  0, 0, /* x_1, y_1 */
diff --git a/tests/conform/test-premult.c b/tests/conform/test-premult.c
index b8fb6fd..94f0798 100644
--- a/tests/conform/test-premult.c
+++ b/tests/conform/test-premult.c
@@ -17,13 +17,13 @@
 #define MASK_ALPHA(COLOR) (COLOR & 0xff)
 
 static guchar *
-gen_tex_data (guint32 color)
+gen_tex_data (uint32_t color)
 {
   guchar *tex_data, *p;
-  guint8 r = MASK_RED (color);
-  guint8 g = MASK_GREEN (color);
-  guint8 b = MASK_BLUE (color);
-  guint8 a = MASK_ALPHA (color);
+  uint8_t r = MASK_RED (color);
+  uint8_t g = MASK_GREEN (color);
+  uint8_t b = MASK_BLUE (color);
+  uint8_t a = MASK_ALPHA (color);
 
   tex_data = g_malloc (QUAD_WIDTH * QUAD_WIDTH * 4);
 
@@ -39,7 +39,7 @@ gen_tex_data (guint32 color)
 }
 
 static CoglTexture *
-make_texture (guint32 color,
+make_texture (uint32_t color,
 	      CoglPixelFormat src_format,
 	      CoglPixelFormat internal_format)
 {
@@ -62,7 +62,7 @@ make_texture (guint32 color,
 
 static void
 set_region (CoglTexture *tex,
-	    guint32 color,
+	    uint32_t color,
 	    CoglPixelFormat format)
 {
   guchar *tex_data = gen_tex_data (color);
@@ -83,7 +83,7 @@ check_texture (CoglPipeline *pipeline,
 	       int x,
 	       int y,
 	       CoglTexture *tex,
-	       guint32 expected_result)
+	       uint32_t expected_result)
 {
   /* Legacy */
   cogl_push_framebuffer (fb);
diff --git a/tests/conform/test-primitive.c b/tests/conform/test-primitive.c
index 3dc5820..8cb20d9 100644
--- a/tests/conform/test-primitive.c
+++ b/tests/conform/test-primitive.c
@@ -15,10 +15,10 @@ typedef struct _TestState
 
 #define N_ATTRIBS 8
 
-typedef CoglPrimitive * (* TestPrimFunc) (CoglContext *ctx, guint32 *expected_color);
+typedef CoglPrimitive * (* TestPrimFunc) (CoglContext *ctx, uint32_t *expected_color);
 
 static CoglPrimitive *
-test_prim_p2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP2 verts[] =
     { { 0, 0 }, { 0, 10 }, { 10, 0 } };
@@ -30,7 +30,7 @@ test_prim_p2 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p3 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP3 verts[] =
     { { 0, 0, 0 }, { 0, 10, 0 }, { 10, 0, 0 } };
@@ -42,7 +42,7 @@ test_prim_p3 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2c4 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP2C4 verts[] =
     { { 0, 0, 255, 255, 0, 255 },
@@ -58,7 +58,7 @@ test_prim_p2c4 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p3c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3c4 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP3C4 verts[] =
     { { 0, 0, 0, 255, 255, 0, 255 },
@@ -74,7 +74,7 @@ test_prim_p3c4 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p2t2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2t2 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP2T2 verts[] =
     { { 0, 0, 1, 0 },
@@ -90,7 +90,7 @@ test_prim_p2t2 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p3t2 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3t2 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP3T2 verts[] =
     { { 0, 0, 0, 1, 0 },
@@ -106,7 +106,7 @@ test_prim_p3t2 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p2t2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p2t2c4 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP2T2C4 verts[] =
     { { 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff },
@@ -123,7 +123,7 @@ test_prim_p2t2c4 (CoglContext *ctx, guint32 *expected_color)
 }
 
 static CoglPrimitive *
-test_prim_p3t2c4 (CoglContext *ctx, guint32 *expected_color)
+test_prim_p3t2c4 (CoglContext *ctx, uint32_t *expected_color)
 {
   static const CoglVertexP3T2C4 verts[] =
     { { 0, 0, 0, 1, 0, 0xff, 0xff, 0xf0, 0xff },
@@ -157,7 +157,7 @@ test_paint (TestState *state)
 {
   CoglPipeline *pipeline;
   CoglTexture *tex;
-  guint8 tex_data[6];
+  uint8_t tex_data[6];
   int i;
 
   /* Create a two pixel texture. The first pixel is white and the
@@ -188,7 +188,7 @@ test_paint (TestState *state)
   for (i = 0; i < G_N_ELEMENTS (test_prim_funcs); i++)
     {
       CoglPrimitive *prim;
-      guint32 expected_color = PRIM_COLOR;
+      uint32_t expected_color = PRIM_COLOR;
 
       prim = test_prim_funcs[i] (ctx, &expected_color);
 
@@ -205,7 +205,7 @@ test_paint (TestState *state)
   cogl_object_unref (pipeline);
 }
 
-static gboolean
+static CoglBool
 get_attributes_cb (CoglPrimitive *prim,
                    CoglAttribute *attrib,
                    void *user_data)
@@ -232,7 +232,7 @@ compare_pointers (const void *a, const void *b)
 static void
 test_copy (TestState *state)
 {
-  static const guint16 indices_data[2] = { 1, 2 };
+  static const uint16_t indices_data[2] = { 1, 2 };
   CoglAttributeBuffer *buffer =
     cogl_attribute_buffer_new (ctx, 100, NULL);
   CoglAttribute *attributes[N_ATTRIBS];
diff --git a/tests/conform/test-read-texture-formats.c b/tests/conform/test-read-texture-formats.c
index 7161d0f..fa987a4 100644
--- a/tests/conform/test-read-texture-formats.c
+++ b/tests/conform/test-read-texture-formats.c
@@ -8,14 +8,14 @@
  * pixel formats
  */
 
-static const guint8 tex_data[4] = { 0x12, 0x34, 0x56, 0x78 };
+static const uint8_t tex_data[4] = { 0x12, 0x34, 0x56, 0x78 };
 
 static void
 test_read_byte (CoglTexture2D *tex_2d,
                 CoglPixelFormat format,
-                guint8 expected_byte)
+                uint8_t expected_byte)
 {
-  guint8 received_byte;
+  uint8_t received_byte;
 
   cogl_texture_get_data (COGL_TEXTURE (tex_2d),
                          format,
@@ -32,8 +32,8 @@ test_read_short (CoglTexture2D *tex_2d,
 {
   va_list ap;
   int bits;
-  guint16 received_value;
-  guint16 expected_value = 0;
+  uint16_t received_value;
+  uint16_t expected_value = 0;
   char *received_value_str;
   char *expected_value_str;
   int bits_sum = 0;
@@ -41,7 +41,7 @@ test_read_short (CoglTexture2D *tex_2d,
   cogl_texture_get_data (COGL_TEXTURE (tex_2d),
                          format,
                          2, /* rowstride */
-                         (guint8 *) &received_value);
+                         (uint8_t *) &received_value);
 
   va_start (ap, format);
 
@@ -67,9 +67,9 @@ test_read_short (CoglTexture2D *tex_2d,
 static void
 test_read_888 (CoglTexture2D *tex_2d,
                CoglPixelFormat format,
-               guint32 expected_pixel)
+               uint32_t expected_pixel)
 {
-  guint8 pixel[4];
+  uint8_t pixel[4];
 
   cogl_texture_get_data (COGL_TEXTURE (tex_2d),
                          format,
@@ -82,16 +82,16 @@ test_read_888 (CoglTexture2D *tex_2d,
 static void
 test_read_8888 (CoglTexture2D *tex_2d,
                 CoglPixelFormat format,
-                guint32 expected_pixel)
+                uint32_t expected_pixel)
 {
-  guint32 received_pixel;
+  uint32_t received_pixel;
   char *received_value_str;
   char *expected_value_str;
 
   cogl_texture_get_data (COGL_TEXTURE (tex_2d),
                          format,
                          4, /* rowstride */
-                         (guint8 *) &received_pixel);
+                         (uint8_t *) &received_pixel);
 
   received_pixel = GUINT32_FROM_BE (received_pixel);
 
@@ -109,8 +109,8 @@ test_read_int (CoglTexture2D *tex_2d,
 {
   va_list ap;
   int bits;
-  guint32 received_value;
-  guint32 expected_value = 0;
+  uint32_t received_value;
+  uint32_t expected_value = 0;
   char *received_value_str;
   char *expected_value_str;
   int bits_sum = 0;
@@ -118,14 +118,14 @@ test_read_int (CoglTexture2D *tex_2d,
   cogl_texture_get_data (COGL_TEXTURE (tex_2d),
                          format,
                          4, /* rowstride */
-                         (guint8 *) &received_value);
+                         (uint8_t *) &received_value);
 
   va_start (ap, format);
 
   /* Convert the va args into a single 32-bit expected value */
   while ((bits = va_arg (ap, int)) != -1)
     {
-      guint32 value = (va_arg (ap, int) * ((1 << bits) - 1) + 128) / 255;
+      uint32_t value = (va_arg (ap, int) * ((1 << bits) - 1) + 128) / 255;
 
       bits_sum += bits;
 
diff --git a/tests/conform/test-readpixels.c b/tests/conform/test-readpixels.c
index c690a35..83a1712 100644
--- a/tests/conform/test-readpixels.c
+++ b/tests/conform/test-readpixels.c
@@ -24,8 +24,8 @@ on_paint (ClutterActor *actor, void *state)
   guchar *data;
   CoglHandle tex;
   CoglHandle offscreen;
-  guint32 *pixels;
-  guint8 *pixelsc;
+  uint32_t *pixels;
+  uint8_t *pixelsc;
 
   /* Save the Clutter viewport/matrices and load identity matrices */
 
@@ -138,8 +138,8 @@ on_paint (ClutterActor *actor, void *state)
   clutter_main_quit ();
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-snippets.c b/tests/conform/test-snippets.c
index cf6d778..00926cb 100644
--- a/tests/conform/test-snippets.c
+++ b/tests/conform/test-snippets.c
@@ -16,7 +16,7 @@ create_texture_pipeline (TestState *state)
 {
   CoglPipeline *pipeline;
   CoglTexture *tex;
-  static const guint8 tex_data[] =
+  static const uint8_t tex_data[] =
     {
       0xff, 0x00, 0x00, 0xff, /* red */  0x00, 0xff, 0x00, 0xff, /* green */
       0x00, 0x00, 0xff, 0xff, /* blue */ 0xff, 0xff, 0x00, 0xff, /* yellow */
diff --git a/tests/conform/test-sub-texture.c b/tests/conform/test-sub-texture.c
index 261f4d7..dd86438 100644
--- a/tests/conform/test-sub-texture.c
+++ b/tests/conform/test-sub-texture.c
@@ -11,7 +11,7 @@
 
 #define TEST_INSET         1
 
-static const guint32
+static const uint32_t
 corner_colors[SOURCE_DIVISIONS_X * SOURCE_DIVISIONS_Y] =
   {
     0xff0000ff, /* red top left */
@@ -29,7 +29,7 @@ static CoglTexture2D *
 create_source (TestState *state)
 {
   int dx, dy;
-  guint8 *data = g_malloc (SOURCE_SIZE * SOURCE_SIZE * 4);
+  uint8_t *data = g_malloc (SOURCE_SIZE * SOURCE_SIZE * 4);
   CoglTexture2D *tex;
   GError *error = NULL;
 
@@ -38,7 +38,7 @@ create_source (TestState *state)
   for (dy = 0; dy < SOURCE_DIVISIONS_Y; dy++)
     for (dx = 0; dx < SOURCE_DIVISIONS_X; dx++)
       {
-        guint8 *p = (data + dy * DIVISION_HEIGHT * SOURCE_SIZE * 4 +
+        uint8_t *p = (data + dy * DIVISION_HEIGHT * SOURCE_SIZE * 4 +
                      dx * DIVISION_WIDTH * 4);
         int x, y;
 
@@ -46,7 +46,7 @@ create_source (TestState *state)
           {
             for (x = 0; x < DIVISION_WIDTH; x++)
               {
-                guint32 color = GUINT32_FROM_BE (corner_colors[dx + dy * SOURCE_DIVISIONS_X]);
+                uint32_t color = GUINT32_FROM_BE (corner_colors[dx + dy * SOURCE_DIVISIONS_X]);
                 memcpy (p, &color, 4);
                 p += 4;
               }
@@ -70,7 +70,7 @@ static CoglTexture2D *
 create_test_texture (TestState *state)
 {
   CoglTexture2D *tex;
-  guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+  uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
   int x, y;
   GError *error = NULL;
 
@@ -163,7 +163,7 @@ paint (TestState *state)
 static void
 validate_part (int xpos, int ypos,
                int width, int height,
-               guint32 color)
+               uint32_t color)
 {
   test_utils_check_region (fb,
                            xpos + TEST_INSET,
@@ -173,10 +173,10 @@ validate_part (int xpos, int ypos,
                            color);
 }
 
-static guint8 *
+static uint8_t *
 create_update_data (void)
 {
-  guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+  uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
   int x, y;
 
   /* Create some image data that is 256x256 where the blue component
@@ -201,7 +201,7 @@ validate_result (TestState *state)
   int i, division_num, x, y;
   CoglTexture2D *test_tex;
   CoglSubTexture *sub_texture;
-  guint8 *texture_data, *p;
+  uint8_t *texture_data, *p;
   int tex_width, tex_height;
 
   /* Sub texture of the bottom right corner of the texture */
@@ -255,8 +255,8 @@ validate_result (TestState *state)
                      DIVISION_WIDTH);
         int div_y = ((y * SOURCE_SIZE / 2 / tex_height + SOURCE_SIZE / 4) /
                      DIVISION_HEIGHT);
-        guint32 reference = corner_colors[div_x + div_y * SOURCE_DIVISIONS_X] >> 8;
-        guint32 color = GUINT32_FROM_BE (*((guint32 *)p)) >> 8;
+        uint32_t reference = corner_colors[div_x + div_y * SOURCE_DIVISIONS_X] >> 8;
+        uint32_t color = GUINT32_FROM_BE (*((uint32_t *)p)) >> 8;
         g_assert (color == reference);
         p += 4;
       }
diff --git a/tests/conform/test-texture-3d.c b/tests/conform/test-texture-3d.c
index 777d023..547e532 100644
--- a/tests/conform/test-texture-3d.c
+++ b/tests/conform/test-texture-3d.c
@@ -21,8 +21,8 @@ static CoglTexture3D *
 create_texture_3d (CoglContext *context)
 {
   int x, y, z;
-  guint8 *data = g_malloc (TEX_IMAGE_STRIDE * TEX_DEPTH);
-  guint8 *p = data;
+  uint8_t *data = g_malloc (TEX_IMAGE_STRIDE * TEX_DEPTH);
+  uint8_t *p = data;
   CoglTexture3D *tex;
   GError *error = NULL;
 
@@ -199,7 +199,7 @@ test_multi_texture (TestState *state)
   CoglPipeline *pipeline;
   CoglTexture3D *tex_3d;
   CoglTexture2D *tex_2d;
-  guint8 tex_data[4];
+  uint8_t tex_data[4];
 
   cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
 
diff --git a/tests/conform/test-texture-get-set-data.c b/tests/conform/test-texture-get-set-data.c
index 94e53a9..6cb4f99 100644
--- a/tests/conform/test-texture-get-set-data.c
+++ b/tests/conform/test-texture-get-set-data.c
@@ -8,7 +8,7 @@ static void
 check_texture (int width, int height, CoglTextureFlags flags)
 {
   CoglHandle tex;
-  guint8 *data, *p;
+  uint8_t *data, *p;
   int y, x;
 
   p = data = g_malloc (width * height * 4);
diff --git a/tests/conform/test-texture-mipmaps.c b/tests/conform/test-texture-mipmaps.c
index eda31ba..b6cd421 100644
--- a/tests/conform/test-texture-mipmaps.c
+++ b/tests/conform/test-texture-mipmaps.c
@@ -49,7 +49,7 @@ on_paint (ClutterActor *actor, TestState *state)
 {
   CoglHandle tex;
   CoglHandle material;
-  guint8 pixels[8];
+  uint8_t pixels[8];
 
   tex = make_texture ();
   material = cogl_material_new ();
@@ -94,8 +94,8 @@ on_paint (ClutterActor *actor, TestState *state)
 #endif
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-texture-pixmap-x11.c b/tests/conform/test-texture-pixmap-x11.c
index 7f6d81c..4e8d550 100644
--- a/tests/conform/test-texture-pixmap-x11.c
+++ b/tests/conform/test-texture-pixmap-x11.c
@@ -83,10 +83,10 @@ update_pixmap (TestState *state)
   XFreeGC (state->display, black_gc);
 }
 
-static gboolean
+static CoglBool
 check_paint (TestState *state, int x, int y, int scale)
 {
-  guint8 *data, *p, update_value = 0;
+  uint8_t *data, *p, update_value = 0;
 
   p = data = g_malloc (PIXMAP_WIDTH * PIXMAP_HEIGHT * 4);
 
@@ -117,7 +117,7 @@ check_paint (TestState *state, int x, int y, int scale)
           }
         else
           {
-            guint8 value = ((grid_x ^ grid_y) & 1) ? 0x00 : 0xff;
+            uint8_t value = ((grid_x ^ grid_y) & 1) ? 0x00 : 0xff;
             g_assert_cmpint (*(p++), ==, value);
             g_assert_cmpint (*(p++), ==, value);
             g_assert_cmpint (*(p++), ==, value);
@@ -167,7 +167,7 @@ on_paint (ClutterActor *actor, TestState *state)
 
   if (state->frame_count >= 5)
     {
-      gboolean big_updated, small_updated;
+      CoglBool big_updated, small_updated;
 
       big_updated = check_paint (state, 0, 0, 1);
       small_updated = check_paint (state, 0, PIXMAP_HEIGHT, 4);
@@ -187,8 +187,8 @@ on_paint (ClutterActor *actor, TestState *state)
   state->frame_count++;
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-texture-rectangle.c b/tests/conform/test-texture-rectangle.c
index 3aadd04..7766297 100644
--- a/tests/conform/test-texture-rectangle.c
+++ b/tests/conform/test-texture-rectangle.c
@@ -21,7 +21,7 @@ create_source_rect (void)
   GLint prev_unpack_skip_rows;
   GLint prev_unpack_skip_pixles;
   GLint prev_rectangle_binding;
-  guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+  uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
   CoglHandle tex;
   GLuint gl_tex;
 
@@ -87,7 +87,7 @@ static CoglHandle
 create_source_2d (void)
 {
   int x, y;
-  guint8 *data = g_malloc (256 * 256 * 4), *p = data;
+  uint8_t *data = g_malloc (256 * 256 * 4), *p = data;
   CoglHandle tex;
 
   for (y = 0; y < 256; y++)
@@ -160,7 +160,7 @@ draw_frame (TestState *state)
 static void
 validate_result (TestState *state)
 {
-  guint8 *data, *p;
+  uint8_t *data, *p;
   int x, y;
 
   p = data = g_malloc (512 * 384 * 4);
@@ -202,15 +202,15 @@ on_paint (ClutterActor *actor, TestState *state)
   validate_result (state);
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
   return TRUE;
 }
 
-static gboolean
+static CoglBool
 check_rectangle_extension (void)
 {
   static const char rect_extension[] = "GL_ARB_texture_rectangle";
diff --git a/tests/conform/test-utils.c b/tests/conform/test-utils.c
index 0f40f3b..10015ec 100644
--- a/tests/conform/test-utils.c
+++ b/tests/conform/test-utils.c
@@ -7,7 +7,7 @@
 #define FB_WIDTH 512
 #define FB_HEIGHT 512
 
-static gboolean cogl_test_is_verbose;
+static CoglBool cogl_test_is_verbose;
 
 CoglContext *ctx;
 CoglFramebuffer *fb;
@@ -20,7 +20,7 @@ test_utils_init (TestFlags flags)
   CoglOnscreen *onscreen = NULL;
   CoglDisplay *display;
   CoglRenderer *renderer;
-  gboolean missing_requirement = FALSE;
+  CoglBool missing_requirement = FALSE;
 
   if (counter != 0)
     g_critical ("We don't support running more than one test at a time\n"
@@ -126,21 +126,21 @@ test_utils_fini (void)
     cogl_object_unref (ctx);
 }
 
-static gboolean
+static CoglBool
 compare_component (int a, int b)
 {
   return ABS (a - b) <= 1;
 }
 
 void
-test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel)
+test_utils_compare_pixel (const uint8_t *screen_pixel, uint32_t expected_pixel)
 {
   /* Compare each component with a small fuzz factor */
   if (!compare_component (screen_pixel[0], expected_pixel >> 24) ||
       !compare_component (screen_pixel[1], (expected_pixel >> 16) & 0xff) ||
       !compare_component (screen_pixel[2], (expected_pixel >> 8) & 0xff))
     {
-      guint32 screen_pixel_num = GUINT32_FROM_BE (*(guint32 *) screen_pixel);
+      uint32_t screen_pixel_num = GUINT32_FROM_BE (*(uint32_t *) screen_pixel);
       char *screen_pixel_string =
         g_strdup_printf ("#%06x", screen_pixel_num >> 8);
       char *expected_pixel_string =
@@ -155,9 +155,9 @@ test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel)
 
 void
 test_utils_check_pixel (CoglFramebuffer *fb,
-                        int x, int y, guint32 expected_pixel)
+                        int x, int y, uint32_t expected_pixel)
 {
-  guint8 pixel[4];
+  uint8_t pixel[4];
 
   cogl_framebuffer_read_pixels (fb,
                                 x, y, 1, 1,
@@ -178,9 +178,9 @@ void
 test_utils_check_region (CoglFramebuffer *fb,
                          int x, int y,
                          int width, int height,
-                         guint32 expected_rgba)
+                         uint32_t expected_rgba)
 {
-  guint8 *pixels, *p;
+  uint8_t *pixels, *p;
 
   pixels = p = g_malloc (width * height * 4);
   cogl_framebuffer_read_pixels (fb,
@@ -204,7 +204,7 @@ test_utils_check_region (CoglFramebuffer *fb,
 
 CoglTexture *
 test_utils_create_color_texture (CoglContext *context,
-                                 guint32 color)
+                                 uint32_t color)
 {
   CoglTexture2D *tex_2d;
 
@@ -215,13 +215,13 @@ test_utils_create_color_texture (CoglContext *context,
                                           COGL_PIXEL_FORMAT_RGBA_8888_PRE,
                                           COGL_PIXEL_FORMAT_RGBA_8888_PRE,
                                           4, /* rowstride */
-                                          (guint8 *) &color,
+                                          (uint8_t *) &color,
                                           NULL);
 
   return COGL_TEXTURE (tex_2d);
 }
 
-gboolean
+CoglBool
 cogl_test_verbose (void)
 {
   return cogl_test_is_verbose;
diff --git a/tests/conform/test-utils.h b/tests/conform/test-utils.h
index 727aea8..1e15ede 100644
--- a/tests/conform/test-utils.h
+++ b/tests/conform/test-utils.h
@@ -41,7 +41,7 @@ test_utils_fini (void);
  */
 void
 test_utils_check_pixel (CoglFramebuffer *framebuffer,
-                        int x, int y, guint32 expected_pixel);
+                        int x, int y, uint32_t expected_pixel);
 
 /*
  * test_utils_check_pixel:
@@ -79,7 +79,7 @@ void
 test_utils_check_region (CoglFramebuffer *framebuffer,
                          int x, int y,
                          int width, int height,
-                         guint32 expected_rgba);
+                         uint32_t expected_rgba);
 
 /*
  * test_utils_compare_pixel:
@@ -92,7 +92,7 @@ test_utils_check_region (CoglFramebuffer *framebuffer,
  * message.
  */
 void
-test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel);
+test_utils_compare_pixel (const uint8_t *screen_pixel, uint32_t expected_pixel);
 
 /*
  * test_utils_create_color_texture:
@@ -103,13 +103,13 @@ test_utils_compare_pixel (const guint8 *screen_pixel, guint32 expected_pixel);
  */
 CoglTexture *
 test_utils_create_color_texture (CoglContext *context,
-                                 guint32 color);
+                                 uint32_t color);
 
 /* cogl_test_verbose:
  *
  * Queries if the user asked for verbose output or not.
  */
-gboolean
+CoglBool
 cogl_test_verbose (void);
 
 #endif /* _TEST_UTILS_H_ */
diff --git a/tests/conform/test-vertex-buffer-contiguous.c b/tests/conform/test-vertex-buffer-contiguous.c
index 12f4403..1cd7b45 100644
--- a/tests/conform/test-vertex-buffer-contiguous.c
+++ b/tests/conform/test-vertex-buffer-contiguous.c
@@ -141,7 +141,7 @@ on_paint (ClutterActor *actor, TestState *state)
   validate_result (state);
 }
 
-static gboolean
+static CoglBool
 queue_redraw (gpointer stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-vertex-buffer-interleved.c b/tests/conform/test-vertex-buffer-interleved.c
index 0cefb1c..2d31e36 100644
--- a/tests/conform/test-vertex-buffer-interleved.c
+++ b/tests/conform/test-vertex-buffer-interleved.c
@@ -74,7 +74,7 @@ on_paint (ClutterActor *actor, TestState *state)
   validate_result (state);
 }
 
-static gboolean
+static CoglBool
 queue_redraw (gpointer stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-vertex-buffer-mutability.c b/tests/conform/test-vertex-buffer-mutability.c
index d742eb6..9c8d5da 100644
--- a/tests/conform/test-vertex-buffer-mutability.c
+++ b/tests/conform/test-vertex-buffer-mutability.c
@@ -117,7 +117,7 @@ on_paint (ClutterActor *actor, TestState *state)
   validate_result (state);
 }
 
-static gboolean
+static CoglBool
 queue_redraw (gpointer stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
diff --git a/tests/conform/test-viewport.c b/tests/conform/test-viewport.c
index ef22d69..3e610e8 100644
--- a/tests/conform/test-viewport.c
+++ b/tests/conform/test-viewport.c
@@ -19,12 +19,12 @@ assert_region_color (int x,
                      int y,
                      int width,
                      int height,
-                     guint8 red,
-                     guint8 green,
-                     guint8 blue,
-                     guint8 alpha)
+                     uint8_t red,
+                     uint8_t green,
+                     uint8_t blue,
+                     uint8_t alpha)
 {
-  guint8 *data = g_malloc0 (width * height * 4);
+  uint8_t *data = g_malloc0 (width * height * 4);
   cogl_read_pixels (x, y, width, height,
                     COGL_READ_PIXELS_COLOR_BUFFER,
                     COGL_PIXEL_FORMAT_RGBA_8888_PRE,
@@ -32,7 +32,7 @@ assert_region_color (int x,
   for (y = 0; y < height; y++)
     for (x = 0; x < width; x++)
       {
-        guint8 *pixel = &data[y*width*4 + x*4];
+        uint8_t *pixel = &data[y*width*4 + x*4];
 #if 1
         g_assert (pixel[RED] == red &&
                   pixel[GREEN] == green &&
@@ -48,9 +48,9 @@ assert_rectangle_color_and_black_border (int x,
                                          int y,
                                          int width,
                                          int height,
-                                         guint8 red,
-                                         guint8 green,
-                                         guint8 blue)
+                                         uint8_t red,
+                                         uint8_t green,
+                                         uint8_t blue)
 {
   /* check the rectangle itself... */
   assert_region_color (x, y, width, height, red, green, blue, 0xff);
@@ -376,8 +376,8 @@ on_paint (ClutterActor *actor, void *state)
   clutter_main_quit ();
 }
 
-static gboolean
-queue_redraw (gpointer stage)
+static CoglBool
+queue_redraw (void *stage)
 {
   clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
 
diff --git a/tests/conform/test-wrap-modes.c b/tests/conform/test-wrap-modes.c
index cb75705..c01830c 100644
--- a/tests/conform/test-wrap-modes.c
+++ b/tests/conform/test-wrap-modes.c
@@ -15,7 +15,7 @@ typedef struct _TestState
 static CoglTexture *
 create_texture (CoglTextureFlags flags)
 {
-  guint8 *data = g_malloc (TEX_SIZE * TEX_SIZE * 4), *p = data;
+  uint8_t *data = g_malloc (TEX_SIZE * TEX_SIZE * 4), *p = data;
   CoglTexture *tex;
   int x, y;
 
@@ -176,7 +176,7 @@ draw_tests_vbo (TestState *state)
 static void
 validate_set (TestState *state, int offset)
 {
-  guint8 data[TEX_SIZE * 2 * TEX_SIZE * 2 * 4], *p;
+  uint8_t data[TEX_SIZE * 2 * TEX_SIZE * 2 * 4], *p;
   int x, y, i;
 
   for (i = 0; i < G_N_ELEMENTS (wrap_modes); i += 2)
@@ -196,7 +196,7 @@ validate_set (TestState *state, int offset)
       for (y = 0; y < TEX_SIZE * 2; y++)
         for (x = 0; x < TEX_SIZE * 2; x++)
           {
-            guint8 green, blue;
+            uint8_t green, blue;
 
             if (x < TEX_SIZE ||
                 wrap_mode_s == COGL_PIPELINE_WRAP_MODE_REPEAT ||
diff --git a/tests/conform/test-write-texture-formats.c b/tests/conform/test-write-texture-formats.c
index 3081182..d761996 100644
--- a/tests/conform/test-write-texture-formats.c
+++ b/tests/conform/test-write-texture-formats.c
@@ -10,16 +10,16 @@
 
 static void
 test_color (CoglTexture *texture,
-            guint32 expected_pixel)
+            uint32_t expected_pixel)
 {
-  guint32 received_pixel;
+  uint32_t received_pixel;
   char *received_value_str;
   char *expected_value_str;
 
   cogl_texture_get_data (texture,
                          COGL_PIXEL_FORMAT_RGBA_8888_PRE,
                          4, /* rowstride */
-                         (guint8 *) &received_pixel);
+                         (uint8_t *) &received_pixel);
 
   received_pixel = GUINT32_FROM_BE (received_pixel);
 
@@ -33,8 +33,8 @@ test_color (CoglTexture *texture,
 static void
 test_write_byte (CoglContext *context,
                  CoglPixelFormat format,
-                 guint8 byte,
-                 guint32 expected_pixel)
+                 uint8_t byte,
+                 uint32_t expected_pixel)
 {
   CoglTexture *texture = test_utils_create_color_texture (context, 0);
 
@@ -55,8 +55,8 @@ test_write_byte (CoglContext *context,
 static void
 test_write_short (CoglContext *context,
                   CoglPixelFormat format,
-                  guint16 value,
-                  guint32 expected_pixel)
+                  uint16_t value,
+                  uint32_t expected_pixel)
 {
   CoglTexture *texture = test_utils_create_color_texture (context, 0);
 
@@ -67,7 +67,7 @@ test_write_short (CoglContext *context,
                            1, 1, /* width / height */
                            format,
                            2, /* rowstride */
-                           (guint8 *) &value);
+                           (uint8_t *) &value);
 
   test_color (texture, expected_pixel);
 
@@ -77,8 +77,8 @@ test_write_short (CoglContext *context,
 static void
 test_write_bytes (CoglContext *context,
                   CoglPixelFormat format,
-                  guint32 value,
-                  guint32 expected_pixel)
+                  uint32_t value,
+                  uint32_t expected_pixel)
 {
   CoglTexture *texture = test_utils_create_color_texture (context, 0);
 
@@ -91,7 +91,7 @@ test_write_bytes (CoglContext *context,
                            1, 1, /* width / height */
                            format,
                            4, /* rowstride */
-                           (guint8 *) &value);
+                           (uint8_t *) &value);
 
   test_color (texture, expected_pixel);
 
@@ -101,12 +101,12 @@ test_write_bytes (CoglContext *context,
 static void
 test_write_int (CoglContext *context,
                 CoglPixelFormat format,
-                guint32 expected_pixel,
+                uint32_t expected_pixel,
                 ...)
 {
   va_list ap;
   int bits;
-  guint32 tex_data = 0;
+  uint32_t tex_data = 0;
   int bits_sum = 0;
   CoglTexture *texture = test_utils_create_color_texture (context, 0);
 
@@ -115,7 +115,7 @@ test_write_int (CoglContext *context,
   /* Convert the va args into a single 32-bit value */
   while ((bits = va_arg (ap, int)) != -1)
     {
-      guint32 value = (va_arg (ap, int) * ((1 << bits) - 1) + 127) / 255;
+      uint32_t value = (va_arg (ap, int) * ((1 << bits) - 1) + 127) / 255;
 
       bits_sum += bits;
 
@@ -131,7 +131,7 @@ test_write_int (CoglContext *context,
                            1, 1, /* width / height */
                            format,
                            4, /* rowstride */
-                           (guint8 *) &tex_data);
+                           (uint8_t *) &tex_data);
 
   test_color (texture, expected_pixel);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]