X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.c;h=b7c0a7d6f3df2f9290ed5e459ea02d9c481b9e26;hb=28c6b69cb8e971a9959066fe896edcc4ae412935;hp=949f951d084669a9664115964d9225d67ac8b65c;hpb=b936c01ca2fa27e7e632643fa36bd963c7ac36b6;p=projects%2Fchimara%2Fchimara.git
diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c
index 949f951..b7c0a7d 100644
--- a/libchimara/chimara-glk.c
+++ b/libchimara/chimara-glk.c
@@ -1299,6 +1299,35 @@ chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GE
return !(priv->thread == NULL);
}
+/**
+ * chimara_glk_run_file:
+ * @self: a #ChimaraGlk widget
+ * @plugin_file: a #GFile pointing to a plugin module compiled with
+ * @argc: Number of command line arguments in @argv
+ * @argv: Array of command line arguments to pass to the plugin
+ * @error: location to store a GError, or %NULL
+ *
+ * Opens a Glk program compiled as a plugin, from a #GFile. See
+ * chimara_glk_run() for details.
+ *
+ * Return value: %TRUE if the Glk program was started successfully.
+ */
+gboolean
+chimara_glk_run_file(ChimaraGlk *self, GFile *plugin_file, int argc, char *argv[], GError **error)
+{
+ g_return_val_if_fail(self || CHIMARA_IS_GLK(self), FALSE);
+ g_return_val_if_fail(plugin_file || G_IS_FILE(plugin_file), FALSE);
+ g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
+
+ char *path = g_file_get_path(plugin_file);
+ gboolean retval = chimara_glk_run(self, path, argc, argv, error);
+ g_free(path);
+
+ return retval;
+}
+
/**
* chimara_glk_stop:
* @glk: a #ChimaraGlk widget