summaryrefslogtreecommitdiff
path: root/pango/pangoft2.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-06-10 16:59:41 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2020-06-10 17:17:51 +0100
commit94f44a08d3c177c12de8ce84c647a08b0a12a411 (patch)
treebc0de4d9cc743ce093c99b0a1c52155e914af304 /pango/pangoft2.h
parent4b5e25a22cc0bb10c60cd43bef394e16f4a11846 (diff)
downloadpango-94f44a08d3c177c12de8ce84c647a08b0a12a411.tar.gz
Use the appropriate namespace for Pango sub-libraries
The Pango sub-libraries have symbols in the pango_<something> namespace, but the identifiers are in the Pango one, which makes consumers of the introspection data either get something like: PangoCairo.show_layout() with a bunch of warnings caused by the type macros not following the appropriate pattern, or: PangoCairo.cairo_show_layout() which breaks introspection ABI. We can use the __GI_SCANNER__ pre-processor symbol to trick the scanner into generating the appropriate representation of the API, while keeping the C consumers happy with the existing—albeit wildly inconsistent with best practices for GObject-based libraries—symbols.
Diffstat (limited to 'pango/pangoft2.h')
-rw-r--r--pango/pangoft2.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/pango/pangoft2.h b/pango/pangoft2.h
index 87d0ae2d..483bc366 100644
--- a/pango/pangoft2.h
+++ b/pango/pangoft2.h
@@ -33,9 +33,11 @@
G_BEGIN_DECLS
+#ifndef __GI_SCANNER__
+
#ifndef PANGO_DISABLE_DEPRECATED
/**
- * PANGO_RENDER_TYPE_FT2:
+ * PANGO_RENDER_TYPE_FT2: (skip)
*
* A string constant that was used to identify shape engines that work
* with the FreeType backend. See %PANGO_RENDER_TYPE_FC for the replacement.
@@ -43,9 +45,17 @@ G_BEGIN_DECLS
#define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2"
#endif
+#endif /* __GI_SCANNER__ */
+
+#ifdef __GI_SCANNER__
+#define PANGO_FT2_TYPE_FONT_MAP (pango_ft2_font_map_get_type ())
+#define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_FT2_TYPE_FONT_MAP, PangoFT2FontMap))
+#define PANGO_FT2_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_FT2_TYPE_FONT_MAP))
+#else
#define PANGO_TYPE_FT2_FONT_MAP (pango_ft2_font_map_get_type ())
#define PANGO_FT2_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FT2_FONT_MAP, PangoFT2FontMap))
#define PANGO_FT2_IS_FONT_MAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FT2_FONT_MAP))
+#endif
typedef struct _PangoFT2FontMap PangoFT2FontMap;