* Added the game anchorhead to test
[rodin/chimara.git] / libchimara / 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 "input.h"
9 #include "style.h"
10
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 /**
22  * glk_window_struct:
23  *
24  * This is an opaque structure (see <link linkend="chimara-Opaque-Structures">
25  * Opaque Structures</link> and should not be accessed directly.
26  */
27 struct glk_window_struct
28 {
29         /*< private >*/
30         glui32 magic, rock;
31         /* Pointer to the node in the global tree that contains this window */
32         GNode *window_node;
33         /* Window parameters */
34         glui32 type;
35         /* "widget" is the actual widget with the window's functionality */
36         GtkWidget *widget;
37         /* "frame" is the widget that is the child of the ChimaraGlk container, such 
38         as a scroll window. It may be the same as "widget". */
39         GtkWidget *frame;
40         /* Width and height of the window's size units, in pixels */
41         int unit_width;
42         int unit_height;
43         /* Streams associated with the window */
44         strid_t window_stream;
45         strid_t echo_stream;
46         /* Width and height of the window, in characters (text grids only) */
47         glui32 width;
48         glui32 height;
49         /* Window split data (pair windows only) */
50         winid_t key_window;
51         glui32 split_method;
52         glui32 constraint_size;
53         /* Input request stuff */
54         enum InputRequestType input_request_type;
55         gchar *line_input_buffer;
56         glui32 *line_input_buffer_unicode;
57         glui32 line_input_buffer_max_len;
58         gboolean mouse_input_requested;
59         /* Line input field (text grids only) */
60         glui32 input_length;
61         GtkTextChildAnchor *input_anchor;
62         GtkWidget *input_entry;
63         /* Signal handlers */
64         gulong keypress_handler;
65         gulong insert_text_handler;
66 };
67
68 #endif