diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-13 15:49:25 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-25 00:40:33 -0400 |
commit | 3c1a325fca4867cdc7fabfab3a804c0798ce8cb2 (patch) | |
tree | f1e888f03cbad4c450cf8b006888fadbf1939c23 /pango/pango-attributes.h | |
parent | fd009f03a1263aa30cdf574664e6180dacbf31d7 (diff) | |
download | pango-3c1a325fca4867cdc7fabfab3a804c0798ce8cb2.tar.gz |
Add an attribute for showing invisible chars
Allow to opt-in to showing spaces, line breaks,
and default-ignorable chars, separately.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r-- | pango/pango-attributes.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index f7a0c1cb..d46ce6f0 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -148,6 +148,7 @@ typedef struct _PangoAttrIterator PangoAttrIterator; * @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha (#PangoAttrInt). Since 1.38 * @PANGO_ATTR_BACKGROUND_ALPHA: background alpha (#PangoAttrInt). Since 1.38 * @PANGO_ATTR_ALLOW_BREAKS: whether breaks are allowed (#PangoAttrInt). Since 1.44 + * @PANGO_ATTR_SHOW: how to render invisible characters (#PangoAttrInt). Since 1.44 * * The #PangoAttrType * distinguishes between different types of attributes. Along with the @@ -184,7 +185,8 @@ typedef enum PANGO_ATTR_FONT_FEATURES, /* PangoAttrString */ PANGO_ATTR_FOREGROUND_ALPHA, /* PangoAttrInt */ PANGO_ATTR_BACKGROUND_ALPHA, /* PangoAttrInt */ - PANGO_ATTR_ALLOW_BREAKS /* PangoAttrInt */ + PANGO_ATTR_ALLOW_BREAKS, /* PangoAttrInt */ + PANGO_ATTR_SHOW, /* PangoAttrInt */ } PangoAttrType; /** @@ -527,6 +529,27 @@ PangoAttribute *pango_attr_background_alpha_new (guint16 alpha); PANGO_AVAILABLE_IN_1_44 PangoAttribute *pango_attr_allow_breaks_new (gboolean allow_breaks); +/** + * PangoShowFlags: + * @PANGO_SHOW_NONE: No special treatment for invisible characters + * @PANGO_SHOW_SPACES: Render spaces, tabs and newlines visibly + * @PANGO_SHOW_LINE_BREAKS: Render line breaks visibly + * @PANGO_SHOW_IGNORABLES: Render default-ignorable Unicode + * characters visibly + * + * These flags affect how Pango treats characters that are normally + * not visible in the output. + */ +typedef enum { + PANGO_SHOW_NONE = 0, + PANGO_SHOW_SPACES = 1 << 0, + PANGO_SHOW_LINE_BREAKS = 1 << 1, + PANGO_SHOW_IGNORABLES = 1 << 2 +} PangoShowFlags; + +PANGO_AVAILABLE_IN_1_44 +PangoAttribute *pango_attr_show_new (PangoShowFlags flags); + PANGO_AVAILABLE_IN_ALL GType pango_attr_list_get_type (void) G_GNUC_CONST; PANGO_AVAILABLE_IN_ALL |