[pango/visible-things: 1/11] Add attributes for visible spaces, ignorables and LS
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/visible-things: 1/11] Add attributes for visible spaces, ignorables and LS
- Date: Sat, 13 Jul 2019 23:49:06 +0000 (UTC)
commit 9f2fddac0cadca544ac0098659da3bf74b21f744
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 13 15:49:25 2019 -0400
Add attributes for visible spaces, ignorables and LS
pango/pango-attributes.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++
pango/pango-attributes.h | 13 +++++++-
2 files changed, 91 insertions(+), 1 deletion(-)
---
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 85e5a240..f58f5eb9 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1179,6 +1179,85 @@ pango_attr_background_alpha_new (guint16 alpha)
return pango_attr_int_new (&klass, (int)alpha);
}
+/**
+ * pango_attr_show_ignorables_new:
+ * @show: %TRUE to render ignorable characters
+ *
+ * Create a new show ignorables attribute.
+ *
+ * If @show is %TRUE, ignorable characters will be rendered
+ * visibly.
+ *
+ * Return value: (transfer full): the newly allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.44
+ **/
+PangoAttribute *
+pango_attr_show_ignorables_new (gboolean show)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_SHOW_IGNORABLES,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal,
+ };
+
+ return pango_attr_int_new (&klass, (int)show);
+}
+
+/**
+ * pango_attr_show_space_new:
+ * @show: %TRUE if we should render spaces
+ *
+ * Create a new show space attribute.
+ *
+ * If @show is %TRUE, spaces will be rendered visibly.
+ *
+ * Return value: (transfer full): the newly allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.44
+ **/
+PangoAttribute *
+pango_attr_show_space_new (gboolean show)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_SHOW_SPACE,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal,
+ };
+
+ return pango_attr_int_new (&klass, (int)show);
+}
+
+/**
+ * pango_attr_show_line_separators_new:
+ * @show: %TRUE if we should render line separators
+ *
+ * Create a new show line separators attribute.
+ *
+ * If @show is %TRUE, line separtors will be rendered visibly.
+ *
+ * Return value: (transfer full): the newly allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.44
+ **/
+PangoAttribute *
+pango_attr_show_line_separators_new (gboolean show)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_SHOW_LINE_SEPARATORS,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal,
+ };
+
+ return pango_attr_int_new (&klass, (int)show);
+}
+
/*
* Attribute List
*/
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index cff495b2..722f257d 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -147,6 +147,8 @@ typedef struct _PangoAttrIterator PangoAttrIterator;
* @PANGO_ATTR_FONT_FEATURES: OpenType font features (#PangoAttrString). Since 1.38
* @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha (#PangoAttrInt). Since 1.38
* @PANGO_ATTR_BACKGROUND_ALPHA: background alpha (#PangoAttrInt). Since 1.38
+ * @PANGO_ATTR_SHOW_IGNORABLES: whether to render ignorable charactrs visibly (#PangoAttrInt). Since 1.44
+ * @PANGO_ATTR_SHOW_SPACE: whether to render space visibly (#PangoAttrInt). Since 1.44
*
* The #PangoAttrType
* distinguishes between different types of attributes. Along with the
@@ -182,7 +184,10 @@ typedef enum
PANGO_ATTR_GRAVITY_HINT, /* PangoAttrInt */
PANGO_ATTR_FONT_FEATURES, /* PangoAttrString */
PANGO_ATTR_FOREGROUND_ALPHA, /* PangoAttrInt */
- PANGO_ATTR_BACKGROUND_ALPHA /* PangoAttrInt */
+ PANGO_ATTR_BACKGROUND_ALPHA, /* PangoAttrInt */
+ PANGO_ATTR_SHOW_IGNORABLES, /* PangoAttrInt */
+ PANGO_ATTR_SHOW_SPACE, /* PangoAttrInt */
+ PANGO_ATTR_SHOW_LINE_SEPARATORS, /* PangoAttrInt */
} PangoAttrType;
/**
@@ -522,6 +527,12 @@ PANGO_AVAILABLE_IN_1_38
PangoAttribute *pango_attr_foreground_alpha_new (guint16 alpha);
PANGO_AVAILABLE_IN_1_38
PangoAttribute *pango_attr_background_alpha_new (guint16 alpha);
+PANGO_AVAILABLE_IN_1_44
+PangoAttribute *pango_attr_show_ignorables_new (gboolean show);
+PANGO_AVAILABLE_IN_1_44
+PangoAttribute *pango_attr_show_space_new (gboolean show);
+PANGO_AVAILABLE_IN_1_44
+PangoAttribute *pango_attr_show_line_separators_new (gboolean show);
PANGO_AVAILABLE_IN_ALL
GType pango_attr_list_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]