#include "event.h"
#include "magic.h"
#include "glk.h"
+#include "window.h"
#include <string.h>
#include "chimara-glk.h"
/* Check for interrupt */
glk_tick();
+
+ /* If the event was a line input event, the library must release the buffer */
+ if(event->type == evtype_LineInput && glk_data->unregister_arr)
+ {
+ if(event->win->input_request_type == INPUT_REQUEST_LINE_UNICODE)
+ (*glk_data->unregister_arr)(event->win->line_input_buffer_unicode, event->win->line_input_buffer_max_len, "&+#!Iu", event->win->buffer_rock);
+ else
+ (*glk_data->unregister_arr)(event->win->line_input_buffer, event->win->line_input_buffer_max_len, "&+#!Cn", event->win->buffer_rock);
+ }
/* If an abort event was generated, the thread should have exited by now */
g_assert(event->type != evtype_Abort);
int chars_written = flush_text_buffer(win);
event_throw(CHIMARA_GLK(gtk_widget_get_ancestor(win->widget, CHIMARA_TYPE_GLK)), evtype_LineInput, win, chars_written, 0);
-
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
- if(glk_data->unregister_arr)
- {
- if(win->input_request_type == INPUT_REQUEST_LINE_UNICODE)
- (*glk_data->unregister_arr)(win->line_input_buffer_unicode, win->line_input_buffer_max_len, "&+#!Iu", win->buffer_rock);
- else
- (*glk_data->unregister_arr)(win->line_input_buffer, win->line_input_buffer_max_len, "&+#!Cn", win->buffer_rock);
- }
}
}
int chars_written = flush_text_grid(win);
event_throw(CHIMARA_GLK(gtk_widget_get_ancestor(win->widget, CHIMARA_TYPE_GLK)), evtype_LineInput, win, chars_written, 0);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
- if(glk_data->unregister_arr)
- {
- if(win->input_request_type == INPUT_REQUEST_LINE_UNICODE)
- (*glk_data->unregister_arr)(win->line_input_buffer_unicode, win->line_input_buffer_max_len, "&+#!Iu", win->buffer_rock);
- else
- (*glk_data->unregister_arr)(win->line_input_buffer, win->line_input_buffer_max_len, "&+#!Cn", win->buffer_rock);
- }
}