Add two virtualized functions gdk_drawable_get_clip_region - to get the
Thu Dec 14 20:22:31 2000 Owen Taylor <otaylor@redhat.com> * gdk/{gdkdrawable.[ch],gdkpixmap.c,gdkwindow.c,x11/gdkwindow.c}: Add two virtualized functions gdk_drawable_get_clip_region - to get the clip region when drawing. * gdk/gdkwindow.c (gdk_window_invalidate_rect): Rewrite to simple use invalidate_region. * gdk/gdkwindow.c (gdk_window_invalidate_region): Clip to visible region. * acconfig.h configure.in: Check for Xft. For now, assume that if Xft is found, Pango was compiled with Xft support as well. * gdk/gdkcolor.h gdk/x11/gdkcolor-x11.c: Add gdk_colormap_query_color(). * gdk/x11/gdkdrawable-x11.c (gdk_x11_draw_glyphs): Draw with Xft if appropriate. * gdk/x11/gdkpango-x11.c (gdk_pango_context_get): Create a pangoxft context if we have XFT and the environment variable GD_USE_XFT is set. * gdk/x11/gdkx.h (struct _GdkGCX11): Cache the fg_pixel and also possibly an XftDraw structure. * gtk/gtkfontsel.c: Handle the case where the font from the style doesn't match any of the fonts a bit better. * gtk/testgtk.c: Add tabs between directional segments for hebrew/arabic test. (Not really necessary, just a little prettier.)
This commit is contained in:
@ -24,8 +24,14 @@
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_XFT
|
||||
#include <pango/pangoxft.h>
|
||||
#endif
|
||||
|
||||
#include "gdkgc.h"
|
||||
#include "gdkx.h"
|
||||
#include "gdkprivate-x11.h"
|
||||
#include "gdkregion-generic.h"
|
||||
|
||||
#include <string.h>
|
||||
@ -107,6 +113,11 @@ gdk_gc_x11_finalize (GObject *object)
|
||||
gdk_region_destroy (x11_gc->clip_region);
|
||||
|
||||
XFreeGC (GDK_GC_XDISPLAY (x11_gc), GDK_GC_XGC (x11_gc));
|
||||
|
||||
#if HAVE_XFT
|
||||
if (x11_gc->xft_draw)
|
||||
XftDrawDestroy (x11_gc->xft_draw);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@ -148,6 +159,9 @@ _gdk_x11_gc_new (GdkDrawable *drawable,
|
||||
private->dirty_mask |= GDK_GC_DIRTY_TS;
|
||||
}
|
||||
|
||||
if (values_mask & GDK_GC_FOREGROUND)
|
||||
private->fg_pixel = values->foreground.pixel;
|
||||
|
||||
xvalues.function = GXcopy;
|
||||
xvalues.fill_style = FillSolid;
|
||||
xvalues.arc_mode = ArcPieSlice;
|
||||
@ -386,6 +400,9 @@ gdk_x11_gc_set_values (GdkGC *gc,
|
||||
}
|
||||
}
|
||||
|
||||
if (values_mask & GDK_GC_FOREGROUND)
|
||||
x11_gc->fg_pixel = values->foreground.pixel;
|
||||
|
||||
gdk_x11_gc_values_to_xvalues (values, values_mask, &xvalues, &xvalues_mask);
|
||||
|
||||
XChangeGC (GDK_GC_XDISPLAY (gc),
|
||||
@ -717,4 +734,5 @@ gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
|
||||
x11_dst_gc->clip_region = NULL;
|
||||
|
||||
x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask;
|
||||
x11_dst_gc->fg_pixel = x11_src_gc->fg_pixel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user