35fac923f73086a5d83923676b75480a1950c00c
[rodin/chimara.git] / src / 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 "chimara-glk.h"
9
10 G_BEGIN_DECLS
11
12 typedef struct _ChimaraGlkPrivate ChimaraGlkPrivate;
13
14 struct _ChimaraGlkPrivate {
15     /* Pointer back to the widget itself for use in thread */
16     ChimaraGlk *self;
17     /* Whether user input is expected */
18     gboolean interactive;
19     /* Whether file operations are allowed */
20     gboolean protect;
21         /* Font description of proportional font */
22         PangoFontDescription *default_font_desc;
23         /* Font description of monospace font */
24         PangoFontDescription *monospace_font_desc;
25         /* Spacing between Glk windows */
26         guint spacing;
27     /* Glk program loaded in widget */
28     GModule *program;
29     /* Thread in which Glk program is run */
30     GThread *thread;
31     /* Event queue and threading stuff */
32     GQueue *event_queue;
33     GMutex *event_lock;
34     GCond *event_queue_not_empty;
35     GCond *event_queue_not_full;
36     /* Abort mechanism */
37     GMutex *abort_lock;
38     gboolean abort_signalled;
39     /* User-defined interrupt handler */
40     void (*interrupt_handler)(void);
41     /* Global tree of all windows */
42     GNode *root_window;
43     /* List of filerefs currently in existence */
44     GList *fileref_list;
45     /* Current stream */
46     strid_t current_stream;
47     /* List of streams currently in existence */
48     GList *stream_list;
49         /* Current timer */
50         guint timer_id;
51 };
52
53 #define CHIMARA_GLK_PRIVATE(obj) \
54         (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
55         
56 G_END_DECLS
57
58 #endif /* __CHIMARA_GLK_PRIVATE_H__ */