Some style cleanup work in glk_window_clear()
authorMarijn van Vliet <w.m.vanvliet@gmail.com>
Sun, 16 Sep 2012 16:00:53 +0000 (18:00 +0200)
committerMarijn van Vliet <w.m.vanvliet@gmail.com>
Sun, 16 Sep 2012 16:00:53 +0000 (18:00 +0200)
libchimara/window.c

index 9ebde933fe10e9e21d47e3a0d0225aab508cecdb..c9132939237d5548f9632ff85a903f0e70148088 100644 (file)
@@ -979,24 +979,7 @@ glk_window_clear(winid_t win)
             GtkTextIter start, end;
             gtk_text_buffer_get_start_iter(textbuffer, &start);
             gtk_text_buffer_get_end_iter(textbuffer, &end);
-
-                       /* Determine default style */
-                       GtkTextTagTable *tags = gtk_text_buffer_get_tag_table(textbuffer);
-                       GtkTextTag *default_tag = gtk_text_tag_table_lookup(tags, "default");
-                       GtkTextTag *style_tag = gtk_text_tag_table_lookup(tags, "normal");
-                       GtkTextTag *glk_style_tag = gtk_text_tag_table_lookup(tags, "normal");
-
-                       // Default style
-                       gtk_text_buffer_apply_tag(textbuffer, default_tag, &start, &end);
-
-                       // Player's style overrides
-                       gtk_text_buffer_apply_tag(textbuffer, style_tag, &start, &end);
-
-                       // GLK Program's style overrides
-                       gtk_text_buffer_apply_tag(textbuffer, glk_style_tag, &start, &end);
-
-                       if(win->zcolor != NULL)
-                               gtk_text_buffer_apply_tag(textbuffer, win->zcolor, &start, &end);
+                       style_apply(win, &start, &end);
 
             gtk_text_buffer_move_mark_by_name(textbuffer, "cursor_position", &start);