1e55f5b0d6b0f6d7c3892e4371382ae1c3c45e2f
[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 a few of them
13  *   (garglk_set_line_terminators(),
14  *   garglk_unput_string(), and garglk_unput_string_uni()) are not implemented.
15  *   You can call them, but they will have no effect except to print a warning
16  *   to the console.
17  * </para></note>
18  */
19 #define GARGLK 1
20
21 extern char* garglk_fileref_get_name(frefid_t fref);
22
23 extern void garglk_set_program_name(const char *name);
24 extern void garglk_set_program_info(const char *info);
25 extern void garglk_set_story_name(const char *name);
26
27 /*
28  This function is not implemented even in Gargoyle. Looks like it was planned, 
29  but never added.
30 extern void garglk_set_config(const char *name);
31 */
32
33 /* JM: functions added to support Z-machine features that aren't in the Glk standard */
34
35 extern void garglk_set_line_terminators(winid_t win, const glui32 *keycodes, glui32 numkeycodes);
36
37 /* garglk_unput_string - removes the specified string from the end of the output buffer, if
38  * indeed it is there. */
39 extern void garglk_unput_string(char *str);
40 extern void garglk_unput_string_uni(glui32 *str);
41
42 /* TODO document */
43 #define zcolor_Transparent   (-4)
44 /* TODO document */
45 #define zcolor_Cursor        (-3)
46 /**
47  * zcolor_Current:
48  *
49  * Z-machine color constant representing the current color.
50  */
51 #define zcolor_Current       (-2)
52 /**
53  * zcolor_Default:
54  *
55  * Z-machine color constant representing the default color.
56  */
57 #define zcolor_Default       (-1)
58
59 extern void garglk_set_zcolors(glui32 fg, glui32 bg);
60 extern void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg);
61 extern void garglk_set_reversevideo(glui32 reverse);
62 extern void garglk_set_reversevideo_stream(strid_t str, glui32 reverse);
63
64 /* non standard keycodes */
65 /**
66  * keycode_Erase:
67  *
68  * Since %keycode_Delete represents either the <keycap>Delete</keycap> or 
69  * <keycap>Backspace</keycap> key, Gargoyle defines a separate constant
70  * %keycode_Erase to represent <emphasis>only</emphasis> the 
71  * <keycap>Delete</keycap> key. In character input, <keycap>Delete</keycap> is
72  * still reported as %keycode_Delete, but the two are distinguished in 
73  * garglk_set_line_terminators().
74  */
75 #define keycode_Erase    (0xffffef7f)
76 /* TODO document */
77 #define keycode_MouseWheelUp        (0xffffeffe)
78 /* TODO document */
79 #define keycode_MouseWheelDown      (0xffffefff)
80
81 #endif /* __GARGLK_H__ */