Remove code for styling the pager
[projects/chimara/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 "style.h"
9 #include "gi_blorb.h"
10 #include "gi_dispa.h"
11 #include "chimara-glk.h"
12
13 G_BEGIN_DECLS
14
15 typedef struct _ChimaraGlkPrivate ChimaraGlkPrivate;
16
17 struct _ChimaraGlkPrivate {
18     /* Pointer back to the widget itself for use in thread */
19     ChimaraGlk *self;
20
21         /* *** Widget properties *** */
22     /* Whether user input is expected */
23     gboolean interactive;
24     /* Whether file operations are allowed */
25     gboolean protect;
26         /* Spacing between Glk windows */
27         guint spacing;
28         /* The CSS file to read style defaults from */
29         gchar *css_file;
30         /* Hashtable containing the current styles set by CSS and GLK */
31         struct StyleSet *styles;
32         struct StyleSet *glk_styles;
33         /* Final message displayed when game exits */
34         gchar *final_message;
35         /* Image cache */
36         GSList *image_cache;
37
38         /* *** Threading data *** */
39         /* Whether program is running */
40         gboolean running;
41     /* Glk program loaded in widget */
42     GModule *program;
43     /* Thread in which Glk program is run */
44     GThread *thread;
45     /* Event queue and threading stuff */
46     GQueue *event_queue;
47     GMutex *event_lock;
48     GCond *event_queue_not_empty;
49     GCond *event_queue_not_full;
50     /* Abort mechanism */
51     GMutex *abort_lock;
52     gboolean abort_signalled;
53         /* Key press after shutdown mechanism */
54         GMutex *shutdown_lock;
55         GCond *shutdown_key_pressed;
56         /* Window arrangement locks */
57         GMutex *arrange_lock;
58         GCond *rearranged;
59         gboolean needs_rearrange;
60         gboolean ignore_next_arrange_event;
61         /* Input queues */
62         GAsyncQueue *char_input_queue;
63         GAsyncQueue *line_input_queue;
64         /* Resource loading locks */
65         GMutex *resource_lock;
66         GCond *resource_loaded;
67         GCond *resource_info_available;
68         guint32 resource_available;
69
70         /* *** Glk library data *** */
71         /* Info about current plugin */
72         gchar *program_name;
73         gchar *program_info;
74         gchar *story_name;
75     /* User-defined interrupt handler */
76     void (*interrupt_handler)(void);
77     /* Global tree of all windows */
78     GNode *root_window;
79     /* List of filerefs currently in existence */
80     GList *fileref_list;
81     /* Current stream */
82     strid_t current_stream;
83     /* List of streams currently in existence */
84     GList *stream_list;
85         /* List of sound channels currently in existence */
86         GList *schannel_list;
87         /* Current timer */
88         guint timer_id;
89         /* Current resource blorb map */
90         giblorb_map_t *resource_map;
91         /* File stream pointing to the blorb used as current resource map */
92         strid_t resource_file;
93         /* Optional callback for loading resource data */
94         ChimaraResourceLoadFunc resource_load_callback;
95         gpointer resource_load_callback_data;
96         GDestroyNotify resource_load_callback_destroy_data;
97         /* Callbacks for registering and unregistering dispatch objects */
98         gidispatch_rock_t (*register_obj)(void *, glui32);
99         void (*unregister_obj)(void *, glui32, gidispatch_rock_t);
100         gidispatch_rock_t (*register_arr)(void *, glui32, char *);
101         void (*unregister_arr)(void *, glui32, char *, gidispatch_rock_t);
102
103         /* *** Platform-dependent Glk library data *** */
104         /* Flag for functions to find out if they are being called from startup code */
105         gboolean in_startup;
106         /* "Current directory" for creating filerefs */
107         gchar *current_dir;
108 };
109
110 #define CHIMARA_GLK_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
111 #define CHIMARA_GLK_USE_PRIVATE(o, n) ChimaraGlkPrivate *n = CHIMARA_GLK_PRIVATE(o)
112
113 G_END_DECLS
114
115 #endif /* __CHIMARA_GLK_PRIVATE_H__ */