Fixed ordering of the application of the styles
[rodin/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  These functions are not implemented even in Gargoyle. Looks like they were
26  planned, but never added.
27 extern void garglk_set_config(const char *name);
28
29 #define garglk_font_Roman           (0)
30 #define garglk_font_Italic          (1)
31 #define garglk_font_Bold            (2)
32 #define garglk_font_BoldItalic      (3)
33 #define garglk_font_MonoRoman       (4)
34 #define garglk_font_MonoItalic      (5)
35 #define garglk_font_MonoBold        (6)
36 #define garglk_font_MonoBoldItalic  (7)
37
38 #define garglk_color_White          (0)
39 #define garglk_color_Red            (1)
40 #define garglk_color_Green          (2)
41 #define garglk_color_Blue           (3)
42 #define garglk_color_Cyan           (4)
43 #define garglk_color_Magenta        (5)
44 #define garglk_color_Yellow         (6)
45 #define garglk_color_Black          (7)
46
47 extern void garglk_set_style_font(glui32 font);
48 extern void garglk_set_style_stream_font(strid_t str, glui32 font);
49 extern void garglk_set_style_color(glui32 bg, glui32 fg);
50 extern void garglk_set_style_stream_color(strid_t str, glui32 bg, glui32 fg);
51 */
52
53 /* JM: functions added to support Z-machine features that aren't in the Glk standard */
54
55 extern void garglk_set_line_terminators(winid_t win, const glui32 *keycodes, glui32 numkeycodes);
56
57 extern void garglk_unput_string(char *str);
58 extern void garglk_unput_string_uni(glui32 *str);
59
60 /**
61  * zcolor_Current:
62  *
63  * Z-machine color constant representing the current color.
64  */
65 #define zcolor_Current      (0)
66 /**
67  * zcolor_Default:
68  *
69  * Z-machine color constant representing the default color.
70  */
71 #define zcolor_Default      (1)
72 /**
73  * zcolor_Black:
74  *
75  * Z-machine color constant representing black (0x000000).
76  */
77 #define zcolor_Black        (2)
78 /**
79  * zcolor_Red:
80  *
81  * Z-machine color constant representing red (0x0000E8).
82  */
83 #define zcolor_Red          (3)
84 /**
85  * zcolor_Green:
86  *
87  * Z-machine color constant representing green (0x00D000).
88  */
89 #define zcolor_Green        (4)
90 /**
91  * zcolor_Yellow:
92  *
93  * Z-machine color constant representing yellow (0x00E8E8).
94  */
95 #define zcolor_Yellow       (5)
96 /**
97  * zcolor_Blue:
98  *
99  * Z-machine color constant representing blue (0xB06800).
100  */
101 #define zcolor_Blue         (6)
102 /**
103  * zcolor_Magenta:
104  *
105  * Z-machine color constant representing magenta (0xFF00FF).
106  */
107 #define zcolor_Magenta      (7)
108 /**
109  * zcolor_Cyan:
110  *
111  * Z-machine color constant representing cyan (0xE8E800).
112  */
113 #define zcolor_Cyan         (8)
114 /**
115  * zcolor_White:
116  *
117  * Z-machine color constant representing white (0xFFFFFF).
118  */
119 #define zcolor_White        (9)
120 /**
121  * zcolor_LightGrey:
122  *
123  * Z-machine color constant representing light grey (0xB0B0B0).
124  */
125 #define zcolor_LightGrey    (10)
126 /**
127  * zcolor_MediumGrey:
128  *
129  * Z-machine color constant representing grey (0x888888).
130  */
131 #define zcolor_MediumGrey   (11)
132 /**
133  * zcolor_DarkGrey:
134  *
135  * Z-machine color constant representing dark grey (0x585858).
136  */
137 #define zcolor_DarkGrey     (12)
138 #define zcolor_NUMCOLORS    (13)
139
140 extern void garglk_set_zcolors(glui32 fg, glui32 bg);
141 extern void garglk_set_reversevideo(glui32 reverse);
142
143 /* non standard keycodes */
144 /**
145  * keycode_Erase:
146  *
147  * Since %keycode_Delete represents either the <keycap>Delete</keycap> or 
148  * <keycap>Backspace</keycap> key, Gargoyle defines a separate constant
149  * %keycode_Erase to represent <emphasis>only</emphasis> the 
150  * <keycap>Delete</keycap> key. In character input, <keycap>Delete</keycap> is
151  * still reported as %keycode_Delete, but the two are distinguished in 
152  * garglk_set_line_terminators().
153  */
154 #define keycode_Erase    (0xffffef7f)
155
156 #endif /* __GARGLK_H__ */