X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fgarglk.h;h=91c436434f7203d7885b6e6d78adea0545241fda;hb=cdb84c7c776f214f41ba1a509efb2494e7ed1baf;hp=1ca8fbe2e1a549903594706085c018ed91238685;hpb=beda346223d81061b1c6f8aa444988650c105333;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/garglk.h b/libchimara/garglk.h index 1ca8fbe..91c4364 100644 --- a/libchimara/garglk.h +++ b/libchimara/garglk.h @@ -9,8 +9,10 @@ * macro is defined, then so are all the Gargoyle extensions. If not, not. * * Chimara - * Currently, in Chimara, the functions are defined, but most of them are - * not implemented. That is, you can call them, but they do nothing. + * Currently, in Chimara, the functions are defined, but a few of them + * (garglk_unput_string() and garglk_unput_string_uni()) are not implemented. + * You can call them, but they will have no effect except to print a warning + * to the console. * */ #define GARGLK 1 @@ -20,125 +22,54 @@ extern char* garglk_fileref_get_name(frefid_t fref); extern void garglk_set_program_name(const char *name); extern void garglk_set_program_info(const char *info); extern void garglk_set_story_name(const char *name); - +extern void garglk_set_story_title(const char *title); /* - These functions are not implemented even in Gargoyle. Looks like they were - planned, but never added. + This function is not implemented even in Gargoyle. Looks like it was planned, + but never added. extern void garglk_set_config(const char *name); - -#define garglk_font_Roman (0) -#define garglk_font_Italic (1) -#define garglk_font_Bold (2) -#define garglk_font_BoldItalic (3) -#define garglk_font_MonoRoman (4) -#define garglk_font_MonoItalic (5) -#define garglk_font_MonoBold (6) -#define garglk_font_MonoBoldItalic (7) - -#define garglk_color_White (0) -#define garglk_color_Red (1) -#define garglk_color_Green (2) -#define garglk_color_Blue (3) -#define garglk_color_Cyan (4) -#define garglk_color_Magenta (5) -#define garglk_color_Yellow (6) -#define garglk_color_Black (7) - -extern void garglk_set_style_font(glui32 font); -extern void garglk_set_style_stream_font(strid_t str, glui32 font); -extern void garglk_set_style_color(glui32 bg, glui32 fg); -extern void garglk_set_style_stream_color(strid_t str, glui32 bg, glui32 fg); */ -/* JM: functions added to support Z-machine features that aren't in the Glk standard */ - -extern void garglk_set_line_terminators(winid_t win, const glui32 *keycodes, glui32 numkeycodes); - +/* garglk_unput_string - removes the specified string from the end of the output buffer, if + * indeed it is there. */ extern void garglk_unput_string(char *str); extern void garglk_unput_string_uni(glui32 *str); /** - * zcolor_Current: + * zcolor_Transparent: * - * Z-machine color constant representing the current color. - */ -#define zcolor_Current (0) -/** - * zcolor_Default: + * Z-machine color constant representing no color, i.e. transparency. * - * Z-machine color constant representing the default color. + * Passing this constant to garglk_set_zcolors() or + * garglk_set_zcolors_stream() is not currently implemented. */ -#define zcolor_Default (1) +#define zcolor_Transparent (-4) /** - * zcolor_Black: + * zcolor_Cursor: * - * Z-machine color constant representing black (0x000000). - */ -#define zcolor_Black (2) -/** - * zcolor_Red: - * - * Z-machine color constant representing red (0x0000E8). - */ -#define zcolor_Red (3) -/** - * zcolor_Green: - * - * Z-machine color constant representing green (0x00D000). - */ -#define zcolor_Green (4) -/** - * zcolor_Yellow: - * - * Z-machine color constant representing yellow (0x00E8E8). - */ -#define zcolor_Yellow (5) -/** - * zcolor_Blue: + * Z-machine color constant representing the color at the current position of + * the cursor. * - * Z-machine color constant representing blue (0xB06800). + * Passing this constant to garglk_set_zcolors() or + * garglk_set_zcolors_stream() is not currently implemented. */ -#define zcolor_Blue (6) +#define zcolor_Cursor (-3) /** - * zcolor_Magenta: - * - * Z-machine color constant representing magenta (0xFF00FF). - */ -#define zcolor_Magenta (7) -/** - * zcolor_Cyan: - * - * Z-machine color constant representing cyan (0xE8E800). - */ -#define zcolor_Cyan (8) -/** - * zcolor_White: - * - * Z-machine color constant representing white (0xFFFFFF). - */ -#define zcolor_White (9) -/** - * zcolor_LightGrey: - * - * Z-machine color constant representing light grey (0xB0B0B0). - */ -#define zcolor_LightGrey (10) -/** - * zcolor_MediumGrey: + * zcolor_Current: * - * Z-machine color constant representing grey (0x888888). + * Z-machine color constant representing the current color. */ -#define zcolor_MediumGrey (11) +#define zcolor_Current (-2) /** - * zcolor_DarkGrey: + * zcolor_Default: * - * Z-machine color constant representing dark grey (0x585858). + * Z-machine color constant representing the default color. */ -#define zcolor_DarkGrey (12) -#define zcolor_NUMCOLORS (13) +#define zcolor_Default (-1) extern void garglk_set_zcolors(glui32 fg, glui32 bg); +extern void garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg); extern void garglk_set_reversevideo(glui32 reverse); +extern void garglk_set_reversevideo_stream(strid_t str, glui32 reverse); /* non standard keycodes */ /** @@ -149,8 +80,22 @@ extern void garglk_set_reversevideo(glui32 reverse); * %keycode_Erase to represent only the * Delete key. In character input, Delete is * still reported as %keycode_Delete, but the two are distinguished in - * garglk_set_line_terminators(). + * glk_set_terminators_line_event(). */ #define keycode_Erase (0xffffef7f) +/** + * keycode_MouseWheelUp: + * + * This key code represents the mouse wheel scrolling up in a window. It is + * never used in Chimara. + */ +#define keycode_MouseWheelUp (0xffffeffe) +/** + * keycode_MouseWheelDown: + * + * This key code represents the mouse wheel scrolling down in a window. It is + * never used in Chimara. + */ +#define keycode_MouseWheelDown (0xffffefff) #endif /* __GARGLK_H__ */