#include "chimara-glk-private.h"
#include "window.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* glk_set_interrupt_handler:
void
glk_set_interrupt_handler(void (*func)(void))
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
glk_data->interrupt_handler = func;
}
static void
abort_glk(void)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->interrupt_handler)
(*(glk_data->interrupt_handler))();
shutdown_glk_pre();
void
check_for_abort(void)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_mutex_lock(&glk_data->abort_lock);
if(glk_data->abort_signalled)
{
void
shutdown_glk_pre(void)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
/* Stop any timers */
glk_request_timer_events(0);
void
shutdown_glk_post(void)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
/* Free all opaque objects; can't iterate normally, because the objects are
being removed from the global iteration lists */
if(glk_data->root_window)
static gpointer
glk_enter(struct StartupData *startup)
{
- extern GPrivate *glk_data_key;
- g_private_set(glk_data_key, startup->glk_data);
+ extern GPrivate glk_data_key;
+ g_private_set(&glk_data_key, startup->glk_data);
/* Acquire the Glk thread's references to the input queues */
g_async_queue_ref(startup->glk_data->char_input_queue);
#include "fileref.h"
#include "schannel.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* gidispatch_set_object_registry:
void
gidispatch_set_object_registry(gidispatch_rock_t (*regi)(void *obj, glui32 objclass), void (*unregi)(void *obj, glui32 objclass, gidispatch_rock_t objrock))
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
winid_t win;
strid_t str;
frefid_t fref;
void
gidispatch_set_retained_registry(gidispatch_rock_t (*regi)(void *array, glui32 len, char *typecode), void (*unregi)(void *array, glui32 len, char *typecode, gidispatch_rock_t objrock))
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
glk_data->register_arr = regi;
glk_data->unregister_arr = unregi;
}
#include "chimara-glk.h"
#include "chimara-glk-private.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
#define EVENT_TIMEOUT_MICROSECONDS (3000000)
static void
get_appropriate_event(event_t *event)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_mutex_lock(&glk_data->event_lock);
flush_window_buffer(win);
}
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
get_appropriate_event(event);
{
g_return_if_fail(event != NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
event->type = evtype_None;
event->win = NULL;
event->val1 = 0;
#include "chimara-glk-private.h"
#include "gi_dispa.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/* Internal function: create a fileref using the given parameters. If @basename
is NULL, compute a basename from @filename. */
{
g_return_val_if_fail(filename != NULL, NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
frefid_t f = g_new0(struct glk_fileref_struct, 1);
f->magic = MAGIC_FILEREF;
f->rock = rock;
static void
fileref_close_common(frefid_t fref)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
glk_data->fileref_list = g_list_delete_link(glk_data->fileref_list, fref->fileref_list);
if(glk_data->unregister_obj)
{
VALID_FILEREF_OR_NULL(fref, return NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GList *retnode;
if(fref == NULL)
for each usage */
GtkWidget *chooser;
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
gdk_threads_enter();
switch(fmode)
{
g_return_val_if_fail(name != NULL && strlen(name) > 0, NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
/* Do any string-munging here to remove illegal Latin-1 characters from
filename. On ext3, the only illegal characters are '/' and '\0', but the Glk
spec calls for removing any other tricky characters. */
#include "style.h"
#include "garglk.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* garglk_fileref_get_name:
void
garglk_set_program_name(const char *name)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
glk_data->program_name = g_strdup(name);
g_object_notify(G_OBJECT(glk_data->self), "program-name");
}
void
garglk_set_program_info(const char *info)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
glk_data->program_info = g_strdup(info);
g_object_notify(G_OBJECT(glk_data->self), "program-info");
}
void
garglk_set_story_name(const char *name)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
glk_data->story_name = g_strdup(name);
g_object_notify(G_OBJECT(glk_data->self), "story-name");
}
void
garglk_unput_string(char *str)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
WARNING(_("Not implemented"));
void
garglk_unput_string_uni(glui32 *str)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
WARNING(_("Not implemented"));
void
garglk_set_zcolors(glui32 fg, glui32 bg)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
garglk_set_zcolors_stream(glk_data->current_stream, fg, bg);
void
garglk_set_reversevideo(glui32 reverse)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
g_return_if_fail(glk_data->current_stream->window != NULL);
#include "gi_blorb.h"
#include "window.h"
-G_GNUC_INTERNAL GPrivate *glk_data_key = NULL;
+G_GNUC_INTERNAL GPrivate glk_data_key = G_PRIVATE_INIT(NULL);
/**
* glk_exit:
void
glk_exit(void)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
shutdown_glk_pre();
#include "fileref.h"
#include "stream.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* glkunix_stream_open_pathname_gen:
strid_t
glkunix_stream_open_pathname_gen(char *pathname, glui32 writemode, glui32 textmode, glui32 rock)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(!glk_data->in_startup)
ILLEGAL("glkunix_stream_open_pathname_gen() may only be called from "
strid_t
glkunix_stream_open_pathname(char *pathname, glui32 textmode, glui32 rock)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(!glk_data->in_startup)
ILLEGAL("glkunix_stream_open_pathname() may only be called from "
g_return_if_fail(filename);
g_return_if_fail(strlen(filename) > 0);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
gchar *dirname = g_path_get_dirname(filename);
if(!g_file_test(dirname, G_FILE_TEST_IS_DIR))
{
#define BUFFER_SIZE (1024)
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
void on_size_prepared(GdkPixbufLoader *loader, gint width, gint height, struct image_info *info);
void on_pixbuf_closed(GdkPixbufLoader *loader, gpointer data);
glui32 draw_image_common(winid_t win, GdkPixbuf *pixbuf, glsi32 val1, glsi32 val2);
static struct image_info*
load_image_from_blorb(giblorb_result_t resource, glui32 image, gint width, gint height)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GError *pixbuf_error = NULL;
guchar *buffer;
static struct image_info*
load_image_in_cache(glui32 image, gint width, gint height)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
struct image_info *info = NULL;
/* Lookup the proper resource */
void
on_size_prepared(GdkPixbufLoader *loader, gint width, gint height, struct image_info *info)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_mutex_lock(&glk_data->resource_lock);
info->width = width;
{
gdk_threads_enter();
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_mutex_lock(&glk_data->resource_lock);
image_loaded = TRUE;
static struct image_info*
image_cache_find(struct image_info* to_find)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GSList *link = glk_data->image_cache;
gdk_threads_enter();
VALID_WINDOW(win, return FALSE);
g_return_val_if_fail(win->type == wintype_Graphics || win->type == wintype_TextBuffer, FALSE);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
struct image_info *to_find = g_new0(struct image_info, 1);
struct image_info *info;
struct image_info *scaled_info;
#include "chimara-glk-private.h"
#include "magic.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* glk_set_hyperlink:
void
glk_set_hyperlink(glui32 linkval)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
glk_set_hyperlink_stream(glk_data->current_stream, linkval);
}
/*if( !gst_is_initialized() )*/
gst_init(NULL, NULL);
#endif
-
- /* Initialize thread-private data */
- extern GPrivate *glk_data_key;
- glk_data_key = g_private_new(NULL);
}
}
#include "chimara-glk-private.h"
#include "garglk.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/* Forward declarations */
static int finish_text_buffer_line_input(winid_t win, gboolean emit_signal);
gdk_threads_leave();
/* Emit the "waiting" signal to let listeners know we are ready for input */
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_signal_emit_by_name(glk_data->self, "waiting");
}
cancel_old_input_request(win);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
/* Register the buffer */
if(glk_data->register_arr)
g_return_if_fail(initlen <= maxlen);
cancel_old_input_request(win);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
/* Register the buffer */
if(glk_data->register_arr)
}
gdk_threads_leave();
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->unregister_arr)
{
if(win->input_request_type == INPUT_REQUEST_LINE_UNICODE)
void
force_char_input_from_queue(winid_t win, event_t *event)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
guint keyval = GPOINTER_TO_UINT(g_async_queue_pop(glk_data->char_input_queue));
glk_cancel_char_event(win);
void
force_line_input_from_queue(winid_t win, event_t *event)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
const gchar *text = g_async_queue_pop(glk_data->line_input_queue);
glui32 chars_written = 0;
#include "resource.h"
#include "stream.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* giblorb_set_resource_map:
giblorb_err_t
giblorb_set_resource_map(strid_t file)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
giblorb_map_t *newmap; /* create map allocates memory */
giblorb_err_t error = giblorb_create_map(file, &newmap);
giblorb_map_t*
giblorb_get_resource_map()
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
if(glk_data->resource_map == NULL) {
WARNING("Resource map not set yet.\n");
}
#define VOLUME_TIMER_RESOLUTION 1.0 /* In milliseconds */
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
#ifdef GSTREAMER_SOUND
/* Stop any currently playing sound on this channel, and remove any
glk_schannel_create_ext(glui32 rock, glui32 volume)
{
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
schanid_t s = g_new0(struct glk_schannel_struct, 1);
s->magic = MAGIC_SCHANNEL;
VALID_SCHANNEL(chan, return);
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(!gst_element_set_state(chan->pipeline, GST_STATE_NULL))
WARNING_S(_("Could not set GstElement state to"), "NULL");
VALID_SCHANNEL_OR_NULL(chan, return NULL);
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GList *retnode;
if(chan == NULL)
{
VALID_SCHANNEL(chan, return 0);
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GInputStream *stream;
/* Stop the previous sound */
VALID_SCHANNEL(chanarray[count], return 0);
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GInputStream *stream;
if(!glk_data->resource_map && !glk_data->resource_load_callback) {
glk_sound_load_hint(glui32 snd, glui32 flag)
{
#ifdef GSTREAMER_SOUND
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
giblorb_result_t resource;
giblorb_err_t result;
#include <glib/gi18n-lib.h>
#include "chimara-glk-private.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/* Internal function: create a stream with a specified rock value */
strid_t
stream_new_common(glui32 rock)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
strid_t str = g_new0(struct glk_stream_struct, 1);
str->magic = MAGIC_STREAM;
str->rock = rock;
void
stream_close_common(strid_t str, stream_result_t *result)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->unregister_obj)
{
{
VALID_STREAM_OR_NULL(str, return NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GList *retnode;
if(str == NULL)
{
VALID_STREAM_OR_NULL(str, return);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
if(str != NULL && str->file_mode == filemode_Read)
{
ILLEGAL("Cannot set current stream to non output stream");
strid_t
glk_stream_get_current()
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
return glk_data->current_stream;
}
void
glk_put_char(unsigned char ch)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_char_stream(glk_data->current_stream, ch);
}
void
glk_put_char_uni(glui32 ch)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_char_stream_uni(glk_data->current_stream, ch);
}
void
glk_put_string(char *s)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_string_stream(glk_data->current_stream, s);
}
void
glk_put_string_uni(glui32 *s)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_string_stream_uni(glk_data->current_stream, s);
}
void
glk_put_buffer(char *buf, glui32 len)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_buffer_stream(glk_data->current_stream, buf, len);
}
void
glk_put_buffer_uni(glui32 *buf, glui32 len)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
VALID_STREAM(glk_data->current_stream, return);
glk_put_buffer_stream_uni(glk_data->current_stream, buf, len);
}
if(buf && buflen)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
str->buffer = buf;
str->buflen = buflen;
if(glk_data->register_arr)
if(buf && buflen)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
str->ubuffer = buf;
str->buflen = buflen;
if(glk_data->register_arr)
case STREAM_TYPE_MEMORY:
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->unregister_arr)
{
if(str->unicode)
#include "stream.h"
#include "strio.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
static gboolean style_accept(GScanner *scanner, GTokenType token);
static gboolean style_accept_style_selector(GScanner *scanner, ChimaraGlk *glk);
void
glk_set_style(glui32 styl)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
g_return_if_fail(glk_data->current_stream != NULL);
glk_set_style_stream(glk_data->current_stream, styl);
}
{
g_return_if_fail(buffer != NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
/* Place the default text tags in the textbuffer's tag table */
g_hash_table_foreach(glk_data->styles->text_buffer, style_copy_tag_to_textbuffer, gtk_text_buffer_get_tag_table(buffer));
style_init_textgrid(GtkTextBuffer *buffer)
{
g_return_if_fail(buffer != NULL);
-
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
/* Place the default text tags in the textbuffer's tag table */
g_hash_table_foreach(glk_data->styles->text_grid, style_copy_tag_to_textbuffer, gtk_text_buffer_get_tag_table(buffer));
{
g_return_if_fail(tag != NULL);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GObject *tag_object = G_OBJECT(tag);
gint reverse_color = GPOINTER_TO_INT( g_object_get_data(tag_object, "reverse-color") );
g_return_val_if_fail(tag != NULL, 0);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
switch(hint) {
case stylehint_Indentation:
g_printf("glk_stylehint_set(wintype=%d, styl=%d, hint=%d, val=%d)\n", wintype, styl, hint, val);
#endif
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GtkTextTag *to_change;
if(wintype == wintype_TextBuffer || wintype == wintype_AllTypes) {
g_printf("glk_stylehint_clear(wintype=%d, styl=%d, hint=%d)\n", wintype, styl, hint);
#endif
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GtkTextTag *tag;
switch(wintype) {
g_printf("glk_style_measure(win->rock=%d, styl=%d, hint=%d, result=...)\n", win->rock, styl, hint);
#endif
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GtkTextTag *tag;
switch(win->type) {
PangoFontDescription *
get_current_font(guint32 wintype)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GHashTable *styles, *glk_styles;
PangoFontDescription *font;
#include "timer.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
/**
* glk_request_timer_events:
void
glk_request_timer_events(glui32 millisecs)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
// Stop any existing timer
if(glk_data->timer_id != 0) {
g_source_remove(glk_data->timer_id);
#include "gi_dispa.h"
#include "pager.h"
-extern GPrivate *glk_data_key;
+extern GPrivate glk_data_key;
static winid_t
window_new_common(glui32 rock)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
winid_t win = g_new0(struct glk_window_struct, 1);
win->magic = MAGIC_WINDOW;
static void
window_close_common(winid_t win, gboolean destroy_node)
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->unregister_obj)
{
glk_window_iterate(winid_t win, glui32 *rockptr)
{
VALID_WINDOW_OR_NULL(win, return NULL);
-
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
GNode *retnode;
if(win == NULL)
winid_t
glk_window_get_root()
{
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
if(glk_data->root_window == NULL)
return NULL;
return (winid_t)glk_data->root_window->data;
if(method != (method & (winmethod_DirMask | winmethod_DivisionMask | winmethod_BorderMask)))
WARNING("Unrecognized bits in method constant");
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
if(split == NULL && glk_data->root_window != NULL)
{
ILLEGAL("Tried to open a new root window, but there is already a root window");
{
VALID_WINDOW(win, return);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
gdk_threads_enter(); /* Prevent redraw while we're trashing the window */
/* If any pair windows have this window or its children as a key window,
VALID_WINDOW(win, return);
g_return_if_fail(win->input_request_type != INPUT_REQUEST_LINE && win->input_request_type != INPUT_REQUEST_LINE_UNICODE);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
switch(win->type)
{
case wintype_Blank:
VALID_WINDOW(win, return);
GtkAllocation allocation;
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
switch(win->type)
{
case wintype_Blank:
g_return_if_fail(method == (method & (winmethod_DirMask | winmethod_DivisionMask)));
g_return_if_fail(!(((method & winmethod_DivisionMask) == winmethod_Proportional) && size > 100));
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
win->split_method = method;
win->constraint_size = size;
if(keywin)
flush_window_buffer(win);
- ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
-
+ ChimaraGlkPrivate *glk_data = g_private_get(&glk_data_key);
+
/* Wait until the window's size is current */
g_mutex_lock(&glk_data->arrange_lock);
if(glk_data->needs_rearrange)