728a381079c6f0f8cd302d048abcaad19b958b15
[rodin/chimara.git] / src / window.h
1 #ifndef WINDOW_H
2 #define WINDOW_H
3
4 #include <gtk/gtk.h>
5 #include "glk.h"
6
7 #include "stream.h"
8 #include "error.h"
9 #include "callbacks.h"
10 #include "input.h"
11
12 enum InputRequestType
13 {
14         INPUT_REQUEST_NONE,
15         INPUT_REQUEST_CHARACTER,
16         INPUT_REQUEST_CHARACTER_UNICODE,
17         INPUT_REQUEST_LINE,
18         INPUT_REQUEST_LINE_UNICODE
19 };
20
21 struct glk_window_struct
22 {
23         glui32 rock;
24         /* Pointer to the node in the global tree that contains this window */
25         GNode *window_node;
26         /* Window parameters */
27         glui32 type;
28         GtkWidget *widget; /* actual widget that does stuff */
29         GtkWidget *frame; /* container child */
30         strid_t window_stream;
31         strid_t echo_stream;
32         /* Input request stuff */
33         enum InputRequestType input_request_type;
34         gchar *line_input_buffer;
35         glui32 *line_input_buffer_unicode;
36         glui32 line_input_buffer_max_len;
37         gboolean mouse_input_requested;
38         gulong keypress_handler;
39         gulong insert_text_handler;
40 };
41
42 #endif