X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fgestalt.c;h=ebeb765f20a9f59d00697fa5758d345f1f6f33c1;hb=8dc72fc5acf19793c8edb5d69ac2d55f7c5a7510;hp=398aede093e5839e12fbeb1d6001dde22bddb706;hpb=78652af29a2f39e626febd5f4213da57d3a13901;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/gestalt.c b/libchimara/gestalt.c index 398aede..ebeb765 100644 --- a/libchimara/gestalt.c +++ b/libchimara/gestalt.c @@ -1,4 +1,5 @@ #include /* Surprisingly, the only symbol needed is NULL */ +#include #include "glk.h" /* Version of the Glk specification implemented by this library */ @@ -90,10 +91,10 @@ 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 */ @@ -103,18 +104,40 @@ glk_gestalt_ext(glui32 sel, glui32 val, glui32 *arr, glui32 arrlen) /* Timer capabilities present */ case gestalt_Timer: return 1; - - /* Unsupported capabilities */ + + /* Hyperlink capabilities present */ + case gestalt_Hyperlinks: + return 1; + + /* Hyperlinks supported on textbuffers and textgrids */ + case gestalt_HyperlinkInput: + return val == wintype_TextBuffer || val == wintype_TextGrid; + + /* Mouse support present in textgrids */ case gestalt_MouseInput: + return val == wintype_TextGrid; + case gestalt_Graphics: + return 1; + case gestalt_DrawImage: + return val == wintype_Graphics || val == wintype_TextBuffer; + + case gestalt_GraphicsTransparency: + return 1; + + /* Capabilities supported if compiled with GStreamer */ case gestalt_Sound: case gestalt_SoundVolume: case gestalt_SoundNotify: - case gestalt_Hyperlinks: - case gestalt_HyperlinkInput: +#ifdef GSTREAMER_SOUND + return 1; +#else + return 0; +#endif + + /* Unsupported capabilities */ case gestalt_SoundMusic: - case gestalt_GraphicsTransparency: /* Selector not supported */ default: return 0;