Merge branch 'master' of github.com:wmvanvliet/Chimara
authorP. F. Chimento <philip.chimento@gmail.com>
Sat, 29 Jan 2011 14:33:39 +0000 (15:33 +0100)
committerP. F. Chimento <philip.chimento@gmail.com>
Sat, 29 Jan 2011 14:33:39 +0000 (15:33 +0100)
1  2 
libchimara/garglk.c

index e7333a6d2bc1cfaa575b04c9665659bf978f47e3,df5c6b35e4f0240289fa1c2bd983b3418ce51b0f..19be50411658ffa8be46a17878c18238d1907f66
@@@ -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.