From 037fc862b0dd4535accf7b69a8c0112355bd04b1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 3 Mar 2007 02:53:41 +0000 Subject: pango is now mandatory.. lots of cleanups to the pango code, which was a very nice base to start from. thanks to whomever wrote that for us.. put some of the pango variables into the various render structs so that they don't need to be created all the time. put the pango context inside our RrInstance so that it can be properly freed at shutdown. removed xft dependencies all through the code and the build system also. who knows if this will break compiling for some poor souls. i guess we'll find out, won't we! --- render/instance.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'render/instance.c') diff --git a/render/instance.c b/render/instance.c index 386c87a3..02e68040 100644 --- a/render/instance.c +++ b/render/instance.c @@ -57,6 +57,8 @@ void print_refs(gint id) RrInstance* RrInstanceNew (Display *display, gint screen) { + g_type_init(); /* supposedly needed for pango but seems to work without */ + definst = g_new (RrInstance, 1); definst->display = display; definst->screen = screen; @@ -64,6 +66,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen) definst->depth = DefaultDepth(display, screen); definst->visual = DefaultVisual(display, screen); definst->colormap = DefaultColormap(display, screen); + definst->pango = pango_xft_get_context(display, screen); definst->pseudo_colors = NULL; @@ -210,6 +213,7 @@ void RrInstanceFree (RrInstance *inst) if (inst == definst) definst = NULL; g_free(inst->pseudo_colors); g_hash_table_destroy(inst->color_hash); + g_object_unref(inst->pango); } } -- cgit v1.2.3