Added underscore to prevent marshaller functions from being exported in library
[rodin/chimara.git] / libchimara / chimara-if.c
index 7b91830acdce059d12ab64193a28355cbf6c75df..ee91bf9e57e275b61ac1632d83bdadde310911bd 100644 (file)
@@ -6,6 +6,7 @@
 #include <glib/gi18n-lib.h>
 #include "chimara-if.h"
 #include "chimara-glk.h"
+#include "chimara-glk-private.h"
 #include "chimara-marshallers.h"
 #include "init.h"
 
  * SECTION:chimara-if
  * @short_description: Widget which plays an interactive fiction game
  * @stability: Unstable
- * @include: chimara/chimara-if.h
+ * @include: libchimara/chimara-if.h
  *
  * The #ChimaraIF widget, given an interactive fiction game file to run, selects
  * an appropriate interpreter plugin and runs it. Interpreter options are set by
  * setting properties on the widget.
+ *
+ * Using it in a GTK program is similar to using #ChimaraGlk (which see). 
+ * Threads must be initialized before using #ChimaraIF and the call to 
+ * gtk_main() must be bracketed between gdk_threads_enter() and 
+ * gdk_threads_leave(). Use chimara_if_run_game() to start playing an
+ * interactive fiction game.
  */
 
 static gboolean supported_formats[CHIMARA_IF_NUM_FORMATS][CHIMARA_IF_NUM_INTERPRETERS] = {
@@ -284,7 +291,7 @@ chimara_if_class_init(ChimaraIFClass *klass)
        chimara_if_signals[COMMAND] = g_signal_new("command",
                G_OBJECT_CLASS_TYPE(klass), 0,
                G_STRUCT_OFFSET(ChimaraIFClass, command), NULL, NULL,
-               chimara_marshal_VOID__STRING_STRING,
+               _chimara_marshal_VOID__STRING_STRING,
                G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
 
        /* Properties */
@@ -636,7 +643,14 @@ chimara_if_run_game(ChimaraIF *self, gchar *gamefile, GError **error)
        GSList *ptr;
        for(count = 0, ptr = args; ptr; count++, ptr = g_slist_next(ptr))
                argv[count] = ptr->data;
-
+               
+       /* Set the story name */
+       /* We peek into ChimaraGlk's private data here, because GObject has no
+       equivalent to "protected" */
+       CHIMARA_GLK_USE_PRIVATE(self, glk_priv);
+       glk_priv->story_name = g_path_get_basename(gamefile);
+       g_object_notify(G_OBJECT(self), "story-name");
+       
        gboolean retval = chimara_glk_run(CHIMARA_GLK(self), pluginpath, argc, argv, error);
        g_free(argv);
        if(terpnumstr)