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 /* Glk program loaded in widget */
43 /* Thread in which Glk program is run */
45 /* Event queue and threading stuff */
48 GCond *event_queue_not_empty;
49 GCond *event_queue_not_full;
52 gboolean abort_signalled;
53 /* Key press after shutdown mechanism */
54 GMutex *shutdown_lock;
55 GCond *shutdown_key_pressed;
56 /* Window arrangement locks */
59 gboolean needs_rearrange;
60 gboolean ignore_next_arrange_event;
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;
70 /* *** Glk library data *** */
71 /* Info about current plugin */
75 /* User-defined interrupt handler */
76 void (*interrupt_handler)(void);
77 /* Global tree of all windows */
79 /* List of filerefs currently in existence */
82 strid_t current_stream;
83 /* List of streams currently in existence */
85 /* List of sound channels 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 /* 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);
103 /* *** Platform-dependent Glk library data *** */
104 /* Flag for functions to find out if they are being called from startup code */
106 /* "Current directory" for creating filerefs */
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)
115 #endif /* __CHIMARA_GLK_PRIVATE_H__ */