static void scope_unrealize(GtkWidget *widget) { Scope *scope; g_return_if_fail(widget != NULL); g_return_if_fail(IS_SCOPE(widget)); scope = SCOPE(widget); if (scope->idlefunc) g_source_remove(scope->idlefunc); if (scope->trace_gc) gtk_gc_release(scope->trace_gc); if (scope->grid_gc) gtk_gc_release(scope->grid_gc); scope->trace_gc = scope->grid_gc = NULL; if (scope->pixmap) g_object_unref(scope->pixmap); scope->pixmap = NULL; if (GTK_WIDGET_CLASS(parent_class)->unrealize) (*GTK_WIDGET_CLASS(parent_class)->unrealize)(widget); }
static void _mt_gc_set_foreground(MT_GC *gc, MT_COLOR *col) { GdkGCValues gc_values; GdkGCValuesMask gc_values_mask; GdkColor color; GdkGC *gdkgc; MT_GTK_GC *mtgc = (MT_GTK_GC *)gc; color.red = col->r * 256; color.green = col->g * 256; color.blue = col->b * 256; if (!gdk_colormap_alloc_color(GTK_STYLE(mt_style)->colormap, &color, FALSE, TRUE)) return; gc_values_mask = GDK_GC_FOREGROUND; gc_values.foreground = color; gdkgc = gtk_gc_get(GTK_STYLE(mt_style)->depth, GTK_STYLE(mt_style)->colormap, &gc_values, gc_values_mask); gtk_gc_release(mtgc->gc); mtgc->gc = gdkgc; }
static void _mt_gc_destroy(MT_GC *gc) { gtk_gc_release((GdkGC *)((MT_GTK_GC *)gc)->gc); free(gc); }