[gtk/css-text-transform] Handle new pango attribute type
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/css-text-transform] Handle new pango attribute type
- Date: Sat, 21 Aug 2021 00:22:01 +0000 (UTC)
commit e0bcc607818d97f0aa7b9e5c6e73c91e8ff49b8c
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 20 20:12:04 2021 -0400
Handle new pango attribute type
Update all the places where we switch over
PangoAttrType to handle PANGO_ATTR_TEXT_TRANSFORM.
demos/gtk-demo/fontify.c | 6 ++++++
gtk/gtkpango.c | 4 ++++
gtk/gtktextbuffer.c | 6 ++++++
testsuite/gtk/label.c | 1 +
4 files changed, 17 insertions(+)
---
diff --git a/demos/gtk-demo/fontify.c b/demos/gtk-demo/fontify.c
index a0a7e95428..f89a2525f1 100644
--- a/demos/gtk-demo/fontify.c
+++ b/demos/gtk-demo/fontify.c
@@ -269,6 +269,12 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
case PANGO_ATTR_BACKGROUND_ALPHA:
break;
+#if PANGO_VERSION_CHECK(1,49,0)
+ case PANGO_ATTR_TEXT_TRANSFORM:
+ INT_ATTR (text_transform);
+ break;
+#endif
+
case PANGO_ATTR_INVALID:
default:
g_assert_not_reached ();
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 3c458417dd..beb4a73ef0 100644
--- a/gtk/gtkpango.c
+++ b/gtk/gtkpango.c
@@ -258,6 +258,10 @@ attribute_from_text (GtkBuilder *builder,
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
attribute = pango_attr_line_height_new_absolute (g_value_get_int (&val) * PANGO_SCALE);
break;
+ case PANGO_ATTR_TEXT_TRANSFORM:
+ if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_TEXT_TRANSFORM, value, &val, error))
+ attribute = pango_attr_text_transform_new (g_value_get_enum (&val));
+ break;
#endif
case PANGO_ATTR_INVALID:
default:
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 556ac385f8..d2e3b66a5e 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4707,9 +4707,15 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
INT_ATTR (show_spaces);
break;
+#if PANGO_VERSION_CHECK(1, 49, 0)
case PANGO_ATTR_INSERT_HYPHENS:
INT_ATTR (insert_hyphens);
break;
+#endif
+
+ case PANGO_ATTR_TEXT_TRANSFORM:
+ INT_ATTR (text_transform);
+ break;
case PANGO_ATTR_SHAPE:
case PANGO_ATTR_ABSOLUTE_SIZE:
diff --git a/testsuite/gtk/label.c b/testsuite/gtk/label.c
index a08481c83f..e06623e00c 100644
--- a/testsuite/gtk/label.c
+++ b/testsuite/gtk/label.c
@@ -43,6 +43,7 @@ print_attribute (PangoAttribute *attr, GString *string)
case PANGO_ATTR_SHOW:
#if PANGO_VERSION_CHECK(1, 49, 0)
case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
+ case PANGO_ATTR_TEXT_TRANSFORM:
#endif
g_string_append_printf (string, "%d", ((PangoAttrInt *)attr)->value);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]