]> Dogcows Code - chaz/openbox/blobdiff - render/instance.c
Show name/class when mapping in debug mode.
[chaz/openbox] / render / instance.c
index 386c87a3e5d7477356607c0b1524d659960cacd6..b867815c31c5096b44b9b7a6b2470fef8a6402f6 100644 (file)
@@ -2,7 +2,7 @@
 
    instance.c for the Openbox window manager
    Copyright (c) 2006        Mikael Magnusson
-   Copyright (c) 2003        Ben Jansens
+   Copyright (c) 2003-2007   Dana Jansens
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -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;
 
@@ -88,7 +91,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen)
     return definst;
 }
 
-void RrTrueColorSetup (RrInstance *inst)
+static void RrTrueColorSetup (RrInstance *inst)
 {
   gulong red_mask, green_mask, blue_mask;
   XImage *timage = NULL;
@@ -118,7 +121,7 @@ void RrTrueColorSetup (RrInstance *inst)
 
 #define RrPseudoNcolors(inst) (1 << (inst->pseudo_bpc * 3))
 
-void RrPseudoColorSetup (RrInstance *inst)
+static void RrPseudoColorSetup (RrInstance *inst)
 {
     XColor icolors[256];
     gint tr, tg, tb, n, r, g, b, i, incolors, ii;
@@ -131,7 +134,7 @@ void RrPseudoColorSetup (RrInstance *inst)
     _ncolors = RrPseudoNcolors(inst);
 
     if (_ncolors > 1 << inst->depth) {
-        g_warning("PseudoRenderControl: Invalid colormap size. Resizing.\n");
+        g_message("Invalid colormap size. Resizing.");
         inst->pseudo_bpc = 1 << (inst->depth/3) >> 3;
         _ncolors = 1 << (inst->pseudo_bpc * 3);
     }
@@ -210,6 +213,8 @@ 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);
+        g_free(inst);
     }
 }
 
This page took 0.023336 seconds and 4 git commands to generate.