1 #ifndef __CHIMARA_GLK_PRIVATE_H__
2 #define __CHIMARA_GLK_PRIVATE_H__
6 #include <pango/pango.h>
11 #include "chimara-glk.h"
15 typedef struct _ChimaraGlkPrivate ChimaraGlkPrivate;
17 struct _ChimaraGlkPrivate {
18 /* Pointer back to the widget itself for use in thread */
21 /* *** Widget properties *** */
22 /* Whether user input is expected */
24 /* Whether file operations are allowed */
26 /* Font description of proportional font */
27 PangoFontDescription *default_font_desc;
28 /* Font description of monospace font */
29 PangoFontDescription *monospace_font_desc;
30 /* Spacing between Glk windows */
32 /* The CSS file to read style defaults from */
34 /* Hashtable containing the default and current style */
35 struct StyleSet *default_styles;
36 struct StyleSet *current_styles;
37 PangoAttrList *pager_attr_list;
38 gboolean style_initialized; /* Have styles been initialized */
39 /* Final message displayed when game exits */
44 /* *** Threading data *** */
45 /* Whether program is running */
47 /* Glk program loaded in widget */
49 /* Thread in which Glk program is run */
51 /* Event queue and threading stuff */
54 GCond *event_queue_not_empty;
55 GCond *event_queue_not_full;
58 gboolean abort_signalled;
59 /* Key press after shutdown mechanism */
60 GMutex *shutdown_lock;
61 GCond *shutdown_key_pressed;
62 /* Window arrangement locks */
65 gboolean needs_rearrange;
66 gboolean ignore_next_arrange_event;
68 GAsyncQueue *char_input_queue;
69 GAsyncQueue *line_input_queue;
70 /* Resource loading locks */
71 GMutex *resource_lock;
72 GCond *resource_loaded;
73 GCond *resource_info_available;
74 guint32 resource_available;
76 /* *** Glk library data *** */
77 /* User-defined interrupt handler */
78 void (*interrupt_handler)(void);
79 /* Global tree of all windows */
81 /* List of filerefs currently in existence */
84 strid_t current_stream;
85 /* List of streams currently in existence */
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 /* Callbacks for registering and unregistering dispatch objects */
94 gidispatch_rock_t (*register_obj)(void *, glui32);
95 void (*unregister_obj)(void *, glui32, gidispatch_rock_t);
96 gidispatch_rock_t (*register_arr)(void *, glui32, char *);
97 void (*unregister_arr)(void *, glui32, char *, gidispatch_rock_t);
99 /* *** Platform-dependent Glk library data *** */
100 /* Flag for functions to find out if they are being called from startup code */
102 /* "Current directory" for creating filerefs */
106 #define CHIMARA_GLK_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
107 #define CHIMARA_GLK_USE_PRIVATE(o, n) ChimaraGlkPrivate *n = CHIMARA_GLK_PRIVATE(o)
111 #endif /* __CHIMARA_GLK_PRIVATE_H__ */