X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.h;h=644de4d4419432b7c0d418af31a801c0a46d06c6;hb=5cbd4d79bb8699746b85353d6ab25ee5c48174ff;hp=75c774075772080c9601b7c394b526bd5d5e0b0a;hpb=43b334356e9e0003589d506ae74a8c85e5b9349d;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/chimara-glk.h b/libchimara/chimara-glk.h index 75c7740..644de4d 100644 --- a/libchimara/chimara-glk.h +++ b/libchimara/chimara-glk.h @@ -36,8 +36,22 @@ typedef struct _ChimaraGlkClass { void(* char_input) (ChimaraGlk *self, guint32 window_rock, guint keysym); void(* line_input) (ChimaraGlk *self, guint32 window_rock, gchar *text); void(* text_buffer_output) (ChimaraGlk *self, guint32 window_rock, gchar *text); + void(* iliad_screen_update) (ChimaraGlk *self, gboolean typing); } ChimaraGlkClass; +/** + * ChimaraGlkWindowType: + * @CHIMARA_GLK_TEXT_BUFFER: The styles for text buffer windows. + * @CHIMARA_GLK_TEXT_GRID: The styles for text grid windows. + * + * Specifies the type of windows for which to retrieve the style tag with + * chimara_glk_get_tag(). + */ +typedef enum { + CHIMARA_GLK_TEXT_BUFFER, + CHIMARA_GLK_TEXT_GRID +} ChimaraGlkWindowType; + /** * ChimaraError: * @CHIMARA_LOAD_MODULE_ERROR: There was an error opening the plugin containing @@ -60,6 +74,34 @@ typedef enum _ChimaraError { CHIMARA_PLUGIN_ALREADY_RUNNING } ChimaraError; +/** + * ChimaraResourceType: + * @CHIMARA_RESOURCE_SOUND: A sound file. + * @CHIMARA_RESOURCE_IMAGE: An image file. + * + * The type of resource that the Glk program is requesting, passed to a + * #ChimaraResourceLoadFunc. + */ +typedef enum _ChimaraResourceType { + CHIMARA_RESOURCE_SOUND, + CHIMARA_RESOURCE_IMAGE +} ChimaraResourceType; + +/** + * ChimaraResourceLoadFunc: + * @usage: A #ChimaraResourceType constant. + * @resnum: The resource number to look for. + * @user_data: A pointer to provide to the callback. + * + * The type of function passed to chimara_glk_set_resource_load_callback(). It + * takes a #ChimaraResourceType constant, @usage, to indicate what sort of + * resource to look for; @resnum is the resource number to look for, and + * @user_data is the user data provided along with the callback. The function + * must return an allocated string containing the filename where the resource + * can be found. + */ +typedef gchar * (*ChimaraResourceLoadFunc)(ChimaraResourceType usage, guint32 resnum, gpointer user_data); + /** * CHIMARA_ERROR: * @@ -82,9 +124,16 @@ guint chimara_glk_get_spacing(ChimaraGlk *glk); gboolean chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GError **error); void chimara_glk_stop(ChimaraGlk *glk); void chimara_glk_wait(ChimaraGlk *glk); +void chimara_glk_unload_plugin(ChimaraGlk *glk); gboolean chimara_glk_get_running(ChimaraGlk *glk); void chimara_glk_feed_char_input(ChimaraGlk *glk, guint32 keyval); void chimara_glk_feed_line_input(ChimaraGlk *glk, const gchar *text); +gboolean chimara_glk_is_char_input_pending(ChimaraGlk *glk); +gboolean chimara_glk_is_line_input_pending(ChimaraGlk *glk); +GtkTextTag *chimara_glk_get_tag(ChimaraGlk *glk, ChimaraGlkWindowType window, const gchar *name); +const gchar **chimara_glk_get_tag_names(ChimaraGlk *glk, unsigned int *num_tags); +void chimara_glk_update_style(ChimaraGlk *glk); +void chimara_glk_set_resource_load_callback(ChimaraGlk *glk, ChimaraResourceLoadFunc func, gpointer user_data, GDestroyNotify destroy_user_data); G_END_DECLS