X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fgestalt.c;h=1dad9d94bf8c173b62f6ff906691f159e565ee70;hb=fabc4f9b35b4d4e1bb3c3f67971e8e134889c453;hp=398aede093e5839e12fbeb1d6001dde22bddb706;hpb=78652af29a2f39e626febd5f4213da57d3a13901;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/gestalt.c b/libchimara/gestalt.c index 398aede..1dad9d9 100644 --- a/libchimara/gestalt.c +++ b/libchimara/gestalt.c @@ -1,10 +1,12 @@ #include /* Surprisingly, the only symbol needed is NULL */ +#include #include "glk.h" +#include "input.h" /* Version of the Glk specification implemented by this library */ #define MAJOR_VERSION 0 #define MINOR_VERSION 7 -#define SUB_VERSION 0 +#define SUB_VERSION 4 /** * glk_gestalt: @@ -90,31 +92,55 @@ glk_gestalt_ext(glui32 sel, glui32 val, glui32 *arr, glui32 arrlen) /* All characters are printed as one character, in any case */ if(arr && arrlen > 0) *arr = 1; - /* Cannot print control chars except \n, or chars > 255 */ - if( (val < 32 && val != 10) || (val >= 127 && val <= 159) || (val > 255) ) + /* Cannot print control chars except \n */ + if( (val < 32 && val != 10) || (val >= 127 && val <= 159) ) return gestalt_CharOutput_CannotPrint; - /* Can print all other Latin-1 characters */ + /* Can print all other characters */ return gestalt_CharOutput_ExactPrint; - - /* Unicode capabilities present */ - case gestalt_Unicode: - return 1; - /* Timer capabilities present */ - case gestalt_Timer: - return 1; - - /* Unsupported capabilities */ + /* Hyperlinks supported on textbuffers and textgrids */ + case gestalt_HyperlinkInput: + return val == wintype_TextBuffer || val == wintype_TextGrid; + + /* Mouse support present in textgrids */ case gestalt_MouseInput: - case gestalt_Graphics: + return val == wintype_TextGrid; + case gestalt_DrawImage: + return val == wintype_Graphics || val == wintype_TextBuffer; + + /* Which keycodes can be used as line terminators */ + case gestalt_LineTerminatorKey: + return is_valid_line_terminator(val)? 1 : 0; + + /* Capabilities that are simply supported */ + case gestalt_Unicode: + case gestalt_Timer: + case gestalt_Hyperlinks: + case gestalt_Graphics: + case gestalt_GraphicsTransparency: + case gestalt_DateTime: + case gestalt_UnicodeNorm: + case gestalt_LineInputEcho: + case gestalt_LineTerminators: + case gestalt_ResourceStream: + return 1; + + /* Capabilities supported if compiled with GStreamer */ case gestalt_Sound: case gestalt_SoundVolume: case gestalt_SoundNotify: - case gestalt_Hyperlinks: - case gestalt_HyperlinkInput: case gestalt_SoundMusic: - case gestalt_GraphicsTransparency: + case gestalt_Sound2: +#ifdef GSTREAMER_SOUND + return 1; +#else + return 0; +#endif + + /* Unsupported capabilities */ + /* None! */ + /* Selector not supported */ default: return 0;