Added first support for CSS files.
[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
19         /* *** Widget properties *** */
20     /* Whether user input is expected */
21     gboolean interactive;
22     /* Whether file operations are allowed */
23     gboolean protect;
24         /* Font description of proportional font */
25         PangoFontDescription *default_font_desc;
26         /* Font description of monospace font */
27         PangoFontDescription *monospace_font_desc;
28         /* Spacing between Glk windows */
29         guint spacing;
30         /* The CSS file to read style defaults from */
31         gchar *css_file;
32         /* Hashtable containing the default styles */
33         GHashTable *default_styles;
34
35         /* *** Threading data *** */
36     /* Glk program loaded in widget */
37     GModule *program;
38     /* Thread in which Glk program is run */
39     GThread *thread;
40     /* Event queue and threading stuff */
41     GQueue *event_queue;
42     GMutex *event_lock;
43     GCond *event_queue_not_empty;
44     GCond *event_queue_not_full;
45     /* Abort mechanism */
46     GMutex *abort_lock;
47     gboolean abort_signalled;
48         /* Window arrangement locks */
49         GMutex *arrange_lock;
50         GCond *rearranged;
51         gboolean needs_rearrange;
52         gboolean ignore_next_arrange_event;
53
54         /* *** Glk library data *** */
55     /* User-defined interrupt handler */
56     void (*interrupt_handler)(void);
57     /* Global tree of all windows */
58     GNode *root_window;
59     /* List of filerefs currently in existence */
60     GList *fileref_list;
61     /* Current stream */
62     strid_t current_stream;
63     /* List of streams currently in existence */
64     GList *stream_list;
65         /* Current timer */
66         guint timer_id;
67         /* Current resource blorb map */
68         giblorb_map_t *resource_map;
69         /* File stream pointing to the blorb used as current resource map */
70         strid_t resource_file;
71
72         /* *** Platform-dependent Glk library data *** */
73         /* Flag for functions to find out if they are being called from startup code */
74         gboolean in_startup;
75         /* "Current directory" for creating filerefs */
76         gchar *current_dir;
77 };
78
79 #define CHIMARA_GLK_PRIVATE(obj) \
80         (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
81         
82 G_END_DECLS
83
84 #endif /* __CHIMARA_GLK_PRIVATE_H__ */