X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-glk.h;h=089bccb50e7caaf7145ad8c9768913f7e9c7afdd;hb=b026b1ac697815f2bd67e11a8718478dc1d3aed6;hp=f4d9eddc0784f4dc27272e76ec48f17458af6d8b;hpb=b57624149a9c9d937f91f4c7838d9d68f11f7e10;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/chimara-glk.h b/libchimara/chimara-glk.h index f4d9edd..089bccb 100644 --- a/libchimara/chimara-glk.h +++ b/libchimara/chimara-glk.h @@ -66,6 +66,31 @@ 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: + * + * 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: * @@ -97,6 +122,7 @@ GtkTextTag *chimara_glk_get_tag(ChimaraGlk *glk, ChimaraGlkWindowType window, co const gchar **chimara_glk_get_tag_names(ChimaraGlk *glk); gint chimara_glk_get_num_tag_names(ChimaraGlk *glk); void chimara_glk_update_style(ChimaraGlk *glk); +void chimara_glk_set_resource_load_callback(ChimaraGlk *glk, ChimaraResourceLoadFunc func, gpointer user_data); G_END_DECLS