Updated interpreters
[projects/chimara/chimara.git] / libchimara / garglk.h
1 #ifndef __GARGLK_H__
2 #define __GARGLK_H__
3
4 /**
5  * GARGLK:
6  *
7  * To test at compile time whether the Gargoyle extensions are available, you
8  * can perform a preprocessor test for the existence of %GARGLK. If this
9  * macro is defined, then so are all the Gargoyle extensions. If not, not.
10  *
11  * <note><title>Chimara</title><para>
12  *   Currently, in Chimara, the functions are defined, but most of them are
13  *   not implemented. That is, you can call them, but they do nothing.
14  * </para></note>
15  */
16 #define GARGLK 1
17
18 extern char* garglk_fileref_get_name(frefid_t fref);
19
20 extern void garglk_set_program_name(const char *name);
21 extern void garglk_set_program_info(const char *info);
22 extern void garglk_set_story_name(const char *name);
23
24 /*
25  This function is not implemented even in Gargoyle. Looks like it was planned, 
26  but never added.
27 extern void garglk_set_config(const char *name);
28 */
29
30 /* JM: functions added to support Z-machine features that aren't in the Glk standard */
31
32 extern void garglk_set_line_terminators(winid_t win, const glui32 *keycodes, glui32 numkeycodes);
33
34 /* garglk_unput_string - removes the specified string from the end of the output buffer, if
35  * indeed it is there. */
36 extern void garglk_unput_string(char *str);
37 extern void garglk_unput_string_uni(glui32 *str);
38
39 /* TODO document */
40 #define zcolor_Transparent   (-4)
41 /* TODO document */
42 #define zcolor_Cursor        (-3)
43 /**
44  * zcolor_Current:
45  *
46  * Z-machine color constant representing the current color.
47  */
48 #define zcolor_Current       (-2)
49 /**
50  * zcolor_Default:
51  *
52  * Z-machine color constant representing the default color.
53  */
54 #define zcolor_Default       (-1)
55
56 extern void garglk_set_zcolors(glui32 fg, glui32 bg);
57 extern void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg);
58 extern void garglk_set_reversevideo(glui32 reverse);
59 extern void garglk_set_reversevideo_stream(strid_t str, glui32 reverse);
60
61 /* non standard keycodes */
62 /**
63  * keycode_Erase:
64  *
65  * Since %keycode_Delete represents either the <keycap>Delete</keycap> or 
66  * <keycap>Backspace</keycap> key, Gargoyle defines a separate constant
67  * %keycode_Erase to represent <emphasis>only</emphasis> the 
68  * <keycap>Delete</keycap> key. In character input, <keycap>Delete</keycap> is
69  * still reported as %keycode_Delete, but the two are distinguished in 
70  * garglk_set_line_terminators().
71  */
72 #define keycode_Erase    (0xffffef7f)
73 /* TODO document */
74 #define keycode_MouseWheelUp        (0xffffeffe)
75 /* TODO document */
76 #define keycode_MouseWheelDown      (0xffffefff)
77
78 #endif /* __GARGLK_H__ */