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 /* Spacing between Glk windows */
28 /* The CSS file to read style defaults from */
30 /* Hashtable containing the current styles set by CSS and GLK */
31 struct StyleSet *styles;
32 struct StyleSet *glk_styles;
33 PangoAttrList *pager_attr_list;
34 /* Final message displayed when game exits */
39 /* *** Threading data *** */
40 /* Whether program is running */
42 /* Glk program loaded in widget */
44 /* Thread in which Glk program is run */
46 /* Event queue and threading stuff */
49 GCond *event_queue_not_empty;
50 GCond *event_queue_not_full;
53 gboolean abort_signalled;
54 /* Key press after shutdown mechanism */
55 GMutex *shutdown_lock;
56 GCond *shutdown_key_pressed;
57 /* Window arrangement locks */
60 gboolean needs_rearrange;
61 gboolean ignore_next_arrange_event;
63 GAsyncQueue *char_input_queue;
64 GAsyncQueue *line_input_queue;
65 /* Resource loading locks */
66 GMutex *resource_lock;
67 GCond *resource_loaded;
68 GCond *resource_info_available;
69 guint32 resource_available;
71 /* *** Glk library data *** */
72 /* Info about current plugin */
76 /* User-defined interrupt handler */
77 void (*interrupt_handler)(void);
78 /* Global tree of all windows */
80 /* List of filerefs currently in existence */
83 strid_t current_stream;
84 /* List of streams currently in existence */
86 /* List of sound channels currently in existence */
90 /* Current resource blorb map */
91 giblorb_map_t *resource_map;
92 /* File stream pointing to the blorb used as current resource map */
93 strid_t resource_file;
94 /* Optional callback for loading resource data */
95 ChimaraResourceLoadFunc resource_load_callback;
96 gpointer resource_load_callback_data;
97 GDestroyNotify resource_load_callback_destroy_data;
98 /* Callbacks for registering and unregistering dispatch objects */
99 gidispatch_rock_t (*register_obj)(void *, glui32);
100 void (*unregister_obj)(void *, glui32, gidispatch_rock_t);
101 gidispatch_rock_t (*register_arr)(void *, glui32, char *);
102 void (*unregister_arr)(void *, glui32, char *, gidispatch_rock_t);
104 /* *** Platform-dependent Glk library data *** */
105 /* Flag for functions to find out if they are being called from startup code */
107 /* "Current directory" for creating filerefs */
111 #define CHIMARA_GLK_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
112 #define CHIMARA_GLK_USE_PRIVATE(o, n) ChimaraGlkPrivate *n = CHIMARA_GLK_PRIVATE(o)
116 #endif /* __CHIMARA_GLK_PRIVATE_H__ */