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.