#include <stddef.h> /* Surprisingly, the only symbol needed is NULL */
+#include <config.h>
#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:
return gestalt_CharOutput_CannotPrint;
/* 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;
+ /* 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_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;
- /* Hyperlink capabilities present */
+ /* 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:
return 1;
- /* Hyperlinks supported on textbuffers only at the moment */
- case gestalt_HyperlinkInput:
- return val == wintype_TextBuffer;
-
- /* Unsupported capabilities */
- case gestalt_MouseInput:
- case gestalt_Graphics:
- case gestalt_DrawImage:
+ /* Capabilities supported if compiled with GStreamer */
case gestalt_Sound:
case gestalt_SoundVolume:
case gestalt_SoundNotify:
case gestalt_SoundMusic:
- case gestalt_GraphicsTransparency:
+ case gestalt_Sound2:
+#ifdef GSTREAMER_SOUND
+ return 1;
+#else
+ return 0;
+#endif
+
+ /* Unsupported capabilities */
+ case gestalt_ResourceStream:
+ return 0;
+
/* Selector not supported */
default:
return 0;