1 /* Copyright / licensing information here. */
3 #ifndef __CHIMARA_GLK_H__
4 #define __CHIMARA_GLK_H__
8 #include <pango/pango.h>
12 #define CHIMARA_TYPE_GLK (chimara_glk_get_type())
13 #define CHIMARA_GLK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CHIMARA_TYPE_GLK, ChimaraGlk))
14 #define CHIMARA_GLK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CHIMARA_TYPE_GLK, ChimaraGlkClass))
15 #define CHIMARA_IS_GLK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHIMARA_TYPE_GLK))
16 #define CHIMARA_IS_GLK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CHIMARA_TYPE_GLK))
17 #define CHIMARA_GLK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), CHIMARA_TYPE_GLK, ChimaraGlkClass))
22 * This structure contains no public members.
24 typedef struct _ChimaraGlk {
25 GtkContainer parent_instance;
30 typedef struct _ChimaraGlkClass {
31 GtkContainerClass parent_class;
33 void(* stopped) (ChimaraGlk *self);
34 void(* started) (ChimaraGlk *self);
35 void(* waiting) (ChimaraGlk *self);
36 void(* char_input) (ChimaraGlk *self, guint32 window_rock, guint keysym);
37 void(* line_input) (ChimaraGlk *self, guint32 window_rock, gchar *text);
38 void(* text_buffer_output) (ChimaraGlk *self, guint32 window_rock, gchar *text);
44 * Error codes returned by #ChimaraGlk widgets and subclasses.
47 * <term>CHIMARA_LOAD_MODULE_ERROR</term>
48 * <listitem><para>There was an error opening the plugin containing the Glk
49 * program. The error message from <link
50 * linkend="g-module-error">g_module_error()</link> is appended to the <link
51 * linkend="GError">GError</link> message.</para></listitem>
54 * <term>CHIMARA_NO_GLK_MAIN</term>
55 * <listitem><para>The plugin containing the Glk program did not export a
56 * glk_main() function.</para></listitem>
59 * <term>CHIMARA_PLUGIN_NOT_FOUND</term>
60 * <listitem><para>An appropriate interpreter plugin for the autodetected
61 * game file type could not be found.</para></listitem>
65 typedef enum _ChimaraError {
66 CHIMARA_LOAD_MODULE_ERROR,
68 CHIMARA_PLUGIN_NOT_FOUND
74 * The domain of errors raised by Chimara widgets.
76 #define CHIMARA_ERROR chimara_error_quark()
78 GQuark chimara_error_quark(void);
79 GType chimara_glk_get_type(void) G_GNUC_CONST;
80 GtkWidget *chimara_glk_new(void);
81 void chimara_glk_set_interactive(ChimaraGlk *glk, gboolean interactive);
82 gboolean chimara_glk_get_interactive(ChimaraGlk *glk);
83 void chimara_glk_set_protect(ChimaraGlk *glk, gboolean protect);
84 gboolean chimara_glk_get_protect(ChimaraGlk *glk);
85 void chimara_glk_set_default_font_description(ChimaraGlk *glk, PangoFontDescription *font);
86 void chimara_glk_set_default_font_string(ChimaraGlk *glk, const gchar *font);
87 PangoFontDescription *chimara_glk_get_default_font_description(ChimaraGlk *glk);
88 void chimara_glk_set_monospace_font_description(ChimaraGlk *glk, PangoFontDescription *font);
89 void chimara_glk_set_monospace_font_string(ChimaraGlk *glk, const gchar *font);
90 PangoFontDescription *chimara_glk_get_monospace_font_description(ChimaraGlk *glk);
91 void chimara_glk_set_spacing(ChimaraGlk *glk, guint spacing);
92 guint chimara_glk_get_spacing(ChimaraGlk *glk);
93 gboolean chimara_glk_run(ChimaraGlk *glk, const gchar *plugin, int argc, char *argv[], GError **error);
94 void chimara_glk_stop(ChimaraGlk *glk);
95 void chimara_glk_wait(ChimaraGlk *glk);
96 gboolean chimara_glk_get_running(ChimaraGlk *glk);
97 void chimara_glk_feed_char_input(ChimaraGlk *glk, guint32 keycode);
98 void chimara_glk_feed_line_input(ChimaraGlk *glk, const gchar *text);
102 #endif /* __CHIMARA_GLK_H__ */