fd61ca310cf64131726861fcdc173eede3bfbe56
[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 #include "gi_dispa.h"
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         gidispatch_rock_t disprock;
32         /* Pointer to the node in the global tree that contains this window */
33         GNode *window_node;
34         /* Window parameters */
35         glui32 type;
36         /* "widget" is the actual widget with the window's functionality */
37         GtkWidget *widget;
38         /* "frame" is the widget that is the child of the ChimaraGlk container, such 
39         as a scroll window. It may be the same as "widget". */
40         GtkWidget *frame;
41         /* Width and height of the window's size units, in pixels */
42         int unit_width;
43         int unit_height;
44         /* Streams associated with the window */
45         strid_t window_stream;
46         strid_t echo_stream;
47         /* Width and height of the window, in characters (text grids only) */
48         glui32 width;
49         glui32 height;
50         /* Window split data (pair windows only) */
51         winid_t key_window;
52         glui32 split_method;
53         glui32 constraint_size;
54         /* Input request stuff */
55         enum InputRequestType input_request_type;
56         gchar *line_input_buffer;
57         glui32 *line_input_buffer_unicode;
58         glui32 line_input_buffer_max_len;
59         gidispatch_rock_t buffer_rock;
60         gboolean mouse_input_requested;
61         /* Line input field (text grids only) */
62         glui32 input_length;
63         GtkTextChildAnchor *input_anchor;
64         GtkWidget *input_entry;
65         /* Signal handlers */
66         gulong keypress_handler;
67         gulong insert_text_handler;
68 };
69
70 #endif