From: P. F. Chimento Date: Sat, 29 Jan 2011 14:33:39 +0000 (+0100) Subject: Merge branch 'master' of github.com:wmvanvliet/Chimara X-Git-Tag: v0.9~157 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=7aabd2ee56aa3de0eafd57e149f632617c8c8ee1;p=projects%2Fchimara%2Fchimara.git Merge branch 'master' of github.com:wmvanvliet/Chimara --- 7aabd2ee56aa3de0eafd57e149f632617c8c8ee1 diff --cc libchimara/garglk.c index e7333a6,df5c6b3..19be504 --- a/libchimara/garglk.c +++ b/libchimara/garglk.c @@@ -192,20 -184,13 +192,24 @@@ garglk_set_zcolors(glui32 fg, glui32 bg static void apply_reverse_color(GtkTextTag *tag, gpointer data) { - g_object_set_data( G_OBJECT(tag), "reverse_color", data ); + const gchar *tag_name; + g_object_get(tag, "name", &tag_name, NULL); + + if( g_str_has_prefix(tag_name, "glk-") ) + g_object_set_data( G_OBJECT(tag), "reverse_color", data ); } +/* TODO document */ +void +garglk_set_reversevideo_stream(strid_t str, glui32 reverse) +{ + VALID_STREAM(str, return); + + GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(str->window->widget) ); + GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(buffer); + gtk_text_tag_table_foreach( tags, apply_reverse_color, GINT_TO_POINTER(reverse) ); +} + /** * garglk_set_reversevideo: * @reverse: nonzero for reverse colors, zero for normal colors.