summaryrefslogtreecommitdiff
path: root/pango/pango-attributes.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-08-11 15:48:25 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-08-11 20:39:14 -0400
commit5dd3585270746fd88b267d06ce20eb9c19cab5e5 (patch)
tree0c290d402e6fafe3ad2e86da131666ab58a07ef5 /pango/pango-attributes.c
parent6489105c20bdebc720c223894d947fd5e3cebe49 (diff)
downloadpango-5dd3585270746fd88b267d06ce20eb9c19cab5e5.tar.gz
Add attribute types for fg and bg alpha
Add attributes types for foreground and background alpha.
Diffstat (limited to 'pango/pango-attributes.c')
-rw-r--r--pango/pango-attributes.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index da9fefeb..b8544316 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1127,6 +1127,54 @@ pango_attr_font_features_new (const gchar *features)
return pango_attr_string_new (&klass, features);
}
+/**
+ * pango_attr_foreground_alpha_new:
+ * @alpha: the alpha value, between 1 and 65536
+ *
+ * Create a new foreground alpha attribute.
+ *
+ * Return value: (transfer full): the new allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.38
+ */
+PangoAttribute *
+pango_attr_foreground_alpha_new (guint16 alpha)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_FOREGROUND_ALPHA,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal
+ };
+
+ return pango_attr_int_new (&klass, (int)alpha);
+}
+
+/**
+ * pango_attr_background_alpha_new:
+ * @alpha: the alpha value, between 1 and 65536
+ *
+ * Create a new background alpha attribute.
+ *
+ * Return value: (transfer full): the new allocated #PangoAttribute,
+ * which should be freed with pango_attribute_destroy().
+ *
+ * Since: 1.38
+ */
+PangoAttribute *
+pango_attr_background_alpha_new (guint16 alpha)
+{
+ static const PangoAttrClass klass = {
+ PANGO_ATTR_BACKGROUND_ALPHA,
+ pango_attr_int_copy,
+ pango_attr_int_destroy,
+ pango_attr_int_equal
+ };
+
+ return pango_attr_int_new (&klass, (int)alpha);
+}
+
/*
* Attribute List
*/