Separated library source code from testing code, fixing #6
[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     /* User-defined interrupt handler */
41     void (*interrupt_handler)(void);
42     /* Global tree of all windows */
43     GNode *root_window;
44     /* List of filerefs currently in existence */
45     GList *fileref_list;
46     /* Current stream */
47     strid_t current_stream;
48     /* List of streams currently in existence */
49     GList *stream_list;
50         /* Current timer */
51         guint timer_id;
52         /* Current resource blorb map */
53         giblorb_map_t *resource_map;
54         /* File stream pointing to the blorb used as current resource map */
55         strid_t resource_file;
56 };
57
58 #define CHIMARA_GLK_PRIVATE(obj) \
59         (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
60         
61 G_END_DECLS
62
63 #endif /* __CHIMARA_GLK_PRIVATE_H__ */