Hopefully solved the problem of waiting for windows to draw themselves once and for...
[rodin/chimara.git] / libchimara / chimara-glk-private.h
1 #ifndef __CHIMARA_GLK_PRIVATE_H__
2 #define __CHIMARA_GLK_PRIVATE_H__
3
4 #include <glib.h>
5 #include <gmodule.h>
6 #include <pango/pango.h>
7 #include "glk.h"
8 #include "gi_blorb.h"
9 #include "chimara-glk.h"
10
11 G_BEGIN_DECLS
12
13 typedef struct _ChimaraGlkPrivate ChimaraGlkPrivate;
14
15 struct _ChimaraGlkPrivate {
16     /* Pointer back to the widget itself for use in thread */
17     ChimaraGlk *self;
18     /* Whether user input is expected */
19     gboolean interactive;
20     /* Whether file operations are allowed */
21     gboolean protect;
22         /* Font description of proportional font */
23         PangoFontDescription *default_font_desc;
24         /* Font description of monospace font */
25         PangoFontDescription *monospace_font_desc;
26         /* Spacing between Glk windows */
27         guint spacing;
28     /* Glk program loaded in widget */
29     GModule *program;
30     /* Thread in which Glk program is run */
31     GThread *thread;
32     /* Event queue and threading stuff */
33     GQueue *event_queue;
34     GMutex *event_lock;
35     GCond *event_queue_not_empty;
36     GCond *event_queue_not_full;
37     /* Abort mechanism */
38     GMutex *abort_lock;
39     gboolean abort_signalled;
40         /* Window arrangement locks */
41         GMutex *arrange_lock;
42         GCond *rearranged;
43         gboolean needs_rearrange;
44         gboolean ignore_next_arrange_event;
45     /* User-defined interrupt handler */
46     void (*interrupt_handler)(void);
47     /* Global tree of all windows */
48     GNode *root_window;
49     /* List of filerefs currently in existence */
50     GList *fileref_list;
51     /* Current stream */
52     strid_t current_stream;
53     /* List of streams currently in existence */
54     GList *stream_list;
55         /* Current timer */
56         guint timer_id;
57         /* Current resource blorb map */
58         giblorb_map_t *resource_map;
59         /* File stream pointing to the blorb used as current resource map */
60         strid_t resource_file;
61 };
62
63 #define CHIMARA_GLK_PRIVATE(obj) \
64         (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
65         
66 G_END_DECLS
67
68 #endif /* __CHIMARA_GLK_PRIVATE_H__ */