? attr.glade
? attributes.patch
? mclasen.patch
? doc/libglade-docs.sgml
Index: glade/glade-xml.c
===================================================================
RCS file: /cvs/gnome/libglade/glade/glade-xml.c,v
retrieving revision 1.104
diff -u -p -r1.104 glade-xml.c
--- glade/glade-xml.c	23 Jul 2003 14:48:48 -0000	1.104
+++ glade/glade-xml.c	16 Jan 2004 00:50:57 -0000
@@ -1498,6 +1498,42 @@ glade_xml_set_value_from_string (GladeXM
 		g_warning ("could not parse colour name `%s'", string);
 		ret = FALSE;
 	    }
+	} else if (G_VALUE_HOLDS(value, PANGO_TYPE_ATTR_LIST)) {
+	    PangoAttrList *attributes;
+	    PangoAttrList *result = NULL;
+	    PangoAttrIterator *iter;
+	    PangoAttribute *attr;
+	    GSList *attrs, *list;
+	    gchar *text;
+	    
+	    result = pango_attr_list_new ();
+	    
+	    pango_parse_markup (string, -1, 0, &attributes, &text, NULL, NULL);
+	    
+	    if (strlen (text) <= 1) {
+		/* handle <b> </b> specially to mean global markup */
+		iter = pango_attr_list_get_iterator (attributes);
+		do
+		    {
+			attrs = pango_attr_iterator_get_attrs (iter);
+			for (list = attrs; list != NULL; list = list->next) {
+			    attr = (PangoAttribute *)list->data;
+			    
+			    attr->start_index = 0;
+			    attr->end_index = G_MAXINT;
+			
+			    pango_attr_list_insert (result, attr);
+			}
+			g_slist_free (attrs);
+		    }
+		while (pango_attr_iterator_next (iter));
+		
+		pango_attr_list_unref (attributes);
+	    }
+	    else 
+		result = attributes;
+	    
+	    g_value_set_boxed(value, result);
 	} else
 	    ret = FALSE;
 	break;
