X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.c;h=e0b60592b2e842ff988e35f53c5cb4fd8c70e184;hb=deed9ccb2dacd8c2b4e58c2fdd947850299902bc;hp=f7887a94a7485a5e434e2a3e8345f0d0d3539c22;hpb=d5610e149e0384a24d00727a5815df12e85de026;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index f7887a9..e0b6059 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -2,7 +2,8 @@ #include #include -#include +#include +#include #include #include #include "chimara-glk.h" @@ -12,6 +13,7 @@ #include "window.h" #include "glkstart.h" #include "glkunix.h" +#include "init.h" #define CHIMARA_GLK_MIN_WIDTH 0 #define CHIMARA_GLK_MIN_HEIGHT 0 @@ -76,6 +78,8 @@ chimara_glk_init(ChimaraGlk *self) priv->protect = FALSE; priv->default_font_desc = pango_font_description_from_string("Sans"); priv->monospace_font_desc = pango_font_description_from_string("Monospace"); + priv->css_file = "style.css"; + priv->default_styles = g_hash_table_new(g_str_hash, g_str_equal); priv->program = NULL; priv->thread = NULL; priv->event_queue = NULL; @@ -186,6 +190,7 @@ chimara_glk_finalize(GObject *object) pango_font_description_free(priv->default_font_desc); pango_font_description_free(priv->monospace_font_desc); g_free(priv->current_dir); + g_hash_table_destroy(priv->default_styles); G_OBJECT_CLASS(chimara_glk_parent_class)->finalize(object); } @@ -673,6 +678,9 @@ chimara_glk_class_init(ChimaraGlkClass *klass) GtkWidget * chimara_glk_new(void) { + /* This is a library entry point; initialize the library */ + chimara_init(); + ChimaraGlk *self = CHIMARA_GLK(g_object_new(CHIMARA_TYPE_GLK, NULL)); ChimaraGlkPrivate *priv = CHIMARA_GLK_PRIVATE(self); @@ -683,7 +691,7 @@ chimara_glk_new(void) priv->abort_lock = g_mutex_new(); priv->arrange_lock = g_mutex_new(); priv->rearranged = g_cond_new(); - + return GTK_WIDGET(self); } @@ -1021,10 +1029,6 @@ chimara_glk_run(ChimaraGlk *glk, gchar *plugin, int argc, char *argv[], GError * /* Set the program name */ startup->args.argv[0] = g_strdup(plugin); } - - /* Initialize thread-private data */ - extern GPrivate *glk_data_key; - glk_data_key = g_private_new(NULL); startup->glk_data = priv; /* Run in a separate thread */