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 /* Final message displayed when game exits */
38 /* *** Threading data *** */
39 /* Whether program is running */
41 /* Whether widget has been finalized */
42 gboolean after_finalize;
43 /* Glk program loaded in widget */
45 /* Thread in which Glk program is run */
47 /* Event queue and threading stuff */
50 GCond event_queue_not_empty;
51 GCond event_queue_not_full;
54 gboolean abort_signalled;
55 /* Key press after shutdown mechanism */
57 GCond shutdown_key_pressed;
58 /* Window arrangement locks */
61 gboolean needs_rearrange;
62 gboolean ignore_next_arrange_event;
64 GAsyncQueue *char_input_queue;
65 GAsyncQueue *line_input_queue;
66 /* Resource loading locks */
68 GCond resource_loaded;
69 GCond resource_info_available;
70 guint32 resource_available;
72 /* *** Glk library data *** */
73 /* Info about current plugin */
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 */
87 /* List of sound channels currently in existence */
91 /* Current resource blorb map */
92 giblorb_map_t *resource_map;
93 /* File stream pointing to the blorb used as current resource map */
94 strid_t resource_file;
95 /* Optional callback for loading resource data */
96 ChimaraResourceLoadFunc resource_load_callback;
97 gpointer resource_load_callback_data;
98 GDestroyNotify resource_load_callback_destroy_data;
99 /* Callbacks for registering and unregistering dispatch objects */
100 gidispatch_rock_t (*register_obj)(void *, glui32);
101 void (*unregister_obj)(void *, glui32, gidispatch_rock_t);
102 gidispatch_rock_t (*register_arr)(void *, glui32, char *);
103 void (*unregister_arr)(void *, glui32, char *, gidispatch_rock_t);
105 /* *** Platform-dependent Glk library data *** */
106 /* Flag for functions to find out if they are being called from startup code */
108 /* "Current directory" for creating filerefs */
112 #define CHIMARA_GLK_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHIMARA_TYPE_GLK, ChimaraGlkPrivate))
113 #define CHIMARA_GLK_USE_PRIVATE(o, n) ChimaraGlkPrivate *n = CHIMARA_GLK_PRIVATE(o)
117 #endif /* __CHIMARA_GLK_PRIVATE_H__ */