diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-06-10 16:59:41 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-06-10 17:17:51 +0100 |
commit | 94f44a08d3c177c12de8ce84c647a08b0a12a411 (patch) | |
tree | bc0de4d9cc743ce093c99b0a1c52155e914af304 /pango/pango-ot.h | |
parent | 4b5e25a22cc0bb10c60cd43bef394e16f4a11846 (diff) | |
download | pango-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/pango-ot.h')
-rw-r--r-- | pango/pango-ot.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/pango/pango-ot.h b/pango/pango-ot.h index 2c9f42d5..b8c6acc8 100644 --- a/pango/pango-ot.h +++ b/pango/pango-ot.h @@ -247,16 +247,29 @@ struct _PangoOTRulesetDescription { guint n_other_features; }; - +#ifdef __GI_SCANNER__ +#define PANGO_OT_TYPE_INFO (pango_ot_info_get_type ()) +#define PANGO_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_OT_TYPE_INFO, PangoOTInfo)) +#define PANGO_OT_IS_INFO(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_OT_TYPE_INFO)) +#else #define PANGO_TYPE_OT_INFO (pango_ot_info_get_type ()) #define PANGO_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_INFO, PangoOTInfo)) #define PANGO_IS_OT_INFO(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_INFO)) +#endif + PANGO_DEPRECATED GType pango_ot_info_get_type (void) G_GNUC_CONST; +#ifdef __GI_SCANNER__ +#define PANGO_OT_TYPE_RULESET (pango_ot_ruleset_get_type ()) +#define PANGO_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_OT_TYPE_RULESET, PangoOTRuleset)) +#define PANGO_OT_IS_RULESET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_OT_TYPE_RULESET)) +#else #define PANGO_TYPE_OT_RULESET (pango_ot_ruleset_get_type ()) #define PANGO_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_OT_RULESET, PangoOTRuleset)) #define PANGO_IS_OT_RULESET(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_OT_RULESET)) +#endif + PANGO_DEPRECATED GType pango_ot_ruleset_get_type (void) G_GNUC_CONST; @@ -300,7 +313,11 @@ PangoOTTag *pango_ot_info_list_features (PangoOTInfo *info, guint script_index, guint language_index); +#ifdef __GI_SCANNER__ +#define PANGO_OT_TYPE_BUFFER (pango_ot_buffer_get_type()) +#else #define PANGO_TYPE_OT_BUFFER (pango_ot_buffer_get_type()) +#endif PANGO_DEPRECATED GType pango_ot_buffer_get_type (void) G_GNUC_CONST; @@ -383,7 +400,11 @@ PangoLanguage *pango_ot_tag_to_language (PangoOTTag language_tag) G_GNUC_ PANGO_DEPRECATED PangoOTTag pango_ot_tag_from_language (PangoLanguage *language) G_GNUC_CONST; +#ifdef __GI_SCANNER__ +#define PANGO_OT_TYPE_RULESET_DESCRIPTION (pango_ot_ruleset_description_get_type()) +#else #define PANGO_TYPE_OT_RULESET_DESCRIPTION (pango_ot_ruleset_description_get_type()) +#endif PANGO_DEPRECATED GType pango_ot_ruleset_description_get_type (void) G_GNUC_CONST; |