Separated library source code from testing code, fixing #6
[projects/chimara/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 "error.h"
9 #include "input.h"
10 #include "style.h"
11
12
13 enum InputRequestType
14 {
15         INPUT_REQUEST_NONE,
16         INPUT_REQUEST_CHARACTER,
17         INPUT_REQUEST_CHARACTER_UNICODE,
18         INPUT_REQUEST_LINE,
19         INPUT_REQUEST_LINE_UNICODE
20 };
21
22 /**
23  * glk_window_struct:
24  *
25  * This is an opaque structure (see <link linkend="chimara-Opaque-Structures">
26  * Opaque Structures</link> and should not be accessed directly.
27  */
28 struct glk_window_struct
29 {
30         /*< private >*/
31         glui32 magic, rock;
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         gboolean mouse_input_requested;
60         /* Line input field (text grids only) */
61         glui32 input_length;
62         GtkTextChildAnchor *input_anchor;
63         GtkWidget *input_entry;
64         /* Signal handlers */
65         gulong keypress_handler;
66         gulong insert_text_handler;
67 };
68
69 #endif