X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fstyle.c;h=ece22a738061ad9681569bf24154a08290f9cc5c;hb=5fb29158df45248e3a4734e00bc1a9e7a9871044;hp=0e7d7639ba0d29f53f8d56d879da9c5211f515b3;hpb=69f5d79e00333f8986ee27beb053a34b1dab04ba;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/style.c b/libchimara/style.c index 0e7d763..ece22a7 100644 --- a/libchimara/style.c +++ b/libchimara/style.c @@ -242,8 +242,6 @@ style_init(ChimaraGlk *glk) GHashTable *default_text_grid_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); GHashTable *default_text_buffer_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); - GHashTable *glk_text_grid_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); - GHashTable *glk_text_buffer_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); GtkTextTag *tag; /* Initialise the default styles for a text grid */ @@ -351,6 +349,20 @@ style_init(ChimaraGlk *glk) priv->styles->text_grid = default_text_grid_styles; priv->styles->text_buffer = default_text_buffer_styles; + style_reset_glk(glk); +} + +/* Reset the style hints set from the Glk program to be blank. Call this when +starting a new game so that style hints from the previous game don't carry +over. */ +void +style_reset_glk(ChimaraGlk *glk) +{ + CHIMARA_GLK_USE_PRIVATE(glk, priv); + + GHashTable *glk_text_grid_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); + GHashTable *glk_text_buffer_styles = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_object_unref); + GtkTextTag *tag; /* Initialize the GLK styles to empty tags */ int i;