summaryrefslogtreecommitdiff
path: root/pango/pangoxft-render.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/pangoxft-render.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/pangoxft-render.h')
-rw-r--r--pango/pangoxft-render.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/pango/pangoxft-render.h b/pango/pangoxft-render.h
index 5893574b..77684728 100644
--- a/pango/pangoxft-render.h
+++ b/pango/pangoxft-render.h
@@ -38,12 +38,21 @@ typedef struct _PangoXftRenderer PangoXftRenderer;
typedef struct _PangoXftRendererClass PangoXftRendererClass;
typedef struct _PangoXftRendererPrivate PangoXftRendererPrivate;
+#ifdef __GI_SCANNER__
+#define PANGO_XFT_TYPE_RENDERER (pango_xft_renderer_get_type())
+#define PANGO_XFT_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_XFT_TYPE_RENDERER, PangoXftRenderer))
+#define PANGO_XFT_IS_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_XFT_TYPE_RENDERER))
+#define PANGO_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_XFT_TYPE_RENDERER, PangoXftRendererClass))
+#define PANGO_XFT_IS_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_XFT_TYPE_RENDERER))
+#define PANGO_XFT_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_XFT_TYPE_RENDERER, PangoXftRendererClass))
+#else
#define PANGO_TYPE_XFT_RENDERER (pango_xft_renderer_get_type())
#define PANGO_XFT_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_RENDERER, PangoXftRenderer))
#define PANGO_IS_XFT_RENDERER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_RENDERER))
#define PANGO_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
#define PANGO_IS_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_XFT_RENDERER))
#define PANGO_XFT_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
+#endif
/**
* PangoXftRenderer: