[mutter/zbrown/assorted-g-i-things: 7/7] cogl: Hide a couple things that confuse g-i




commit 0945c6673ceb32313d7fa7387817814fd1e70cca
Author: Zander Brown <zbrown gnome org>
Date:   Tue Jul 6 17:14:20 2021 +0100

    cogl: Hide a couple things that confuse g-i
    
    cogl_clutter_winsys_has_feature (and its macro nature) results in an
    uncallable function, it's deprecated for cogl_has_feature anyway so
    just hide it
    
    EGLImageKHR is unusable via g-i so cogl_egl_texture_2d_new_from_image's
    image parameter is unresolvable
    
    g-i tried to parse the asserts as structs which is clearly nonsense,
    avoid this by making COGL_STRUCT_SIZE_ASSERT impotent when scanning

 cogl/cogl/cogl-texture-2d.h         | 3 +++
 cogl/cogl/cogl-types.h              | 4 ++++
 cogl/cogl/deprecated/cogl-clutter.h | 4 ++++
 3 files changed, 11 insertions(+)
---
diff --git a/cogl/cogl/cogl-texture-2d.h b/cogl/cogl/cogl-texture-2d.h
index 9bee646920..0e8f23b983 100644
--- a/cogl/cogl/cogl-texture-2d.h
+++ b/cogl/cogl/cogl-texture-2d.h
@@ -217,6 +217,8 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bitmap);
  * cogl_egl_texture_2d_new_from_image: (skip)
  */
 #if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
+
+#ifndef __GI_SCANNER__
 /* NB: The reason we require the width, height and format to be passed
  * even though they may seem redundant is because GLES 1/2 don't
  * provide a way to query these properties. */
@@ -228,6 +230,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
                                     EGLImageKHR image,
                                     CoglEglImageFlags flags,
                                     GError **error);
+#endif
 
 typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,
                                                         gpointer user_data,
diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h
index cd92b2ecd3..800ca47e30 100644
--- a/cogl/cogl/cogl-types.h
+++ b/cogl/cogl/cogl-types.h
@@ -64,6 +64,7 @@ G_BEGIN_DECLS
 #define COGL_PRIVATE(x) private_member_ ## x
 #endif
 
+#ifndef __GI_SCANNER__
 /* To help catch accidental changes to public structs that should
  * be stack allocated we use this macro to compile time assert that
  * a struct size is as expected.
@@ -73,6 +74,9 @@ typedef struct { \
           char compile_time_assert_ ## TYPE ## _size[ \
               (sizeof (TYPE) == (SIZE)) ? 1 : -1]; \
         } _ ## TYPE ## SizeCheck
+#else
+#define COGL_STRUCT_SIZE_ASSERT(TYPE, SIZE)
+#endif
 
 /**
  * CoglHandle:
diff --git a/cogl/cogl/deprecated/cogl-clutter.h b/cogl/cogl/deprecated/cogl-clutter.h
index 3cf624d206..65c5b1b3b8 100644
--- a/cogl/cogl/deprecated/cogl-clutter.h
+++ b/cogl/cogl/deprecated/cogl-clutter.h
@@ -35,11 +35,15 @@
 
 G_BEGIN_DECLS
 
+#ifndef __GI_SCANNER__
+
 #define cogl_clutter_winsys_has_feature cogl_clutter_winsys_has_feature_CLUTTER
 COGL_DEPRECATED_FOR (cogl_has_feature)
 COGL_EXPORT gboolean
 cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
 
+#endif
+
 G_END_DECLS
 
 #endif /* __COGL_CLUTTER_H__ */


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