diff --git a/docs/reference/gdk/gdk-docs.sgml b/docs/reference/gdk/gdk-docs.sgml
index 765223fd98..dff298ce3f 100644
--- a/docs/reference/gdk/gdk-docs.sgml
+++ b/docs/reference/gdk/gdk-docs.sgml
@@ -24,7 +24,6 @@
-
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index a283a9f336..ccec2bca9b 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -71,18 +71,12 @@ gdk_drag_protocol_get_type
gdk_event_mask_get_type
gdk_event_type_get_type
gdk_extension_mode_get_type
-gdk_fill_get_type
-gdk_fill_rule_get_type
gdk_filter_return_get_type
-gdk_function_get_type
-gdk_gc_values_mask_get_type
gdk_grab_ownership_get_type
gdk_grab_status_get_type
gdk_gravity_get_type
gdk_input_mode_get_type
gdk_input_source_get_type
-gdk_join_style_get_type
-gdk_line_style_get_type
gdk_modifier_type_get_type
gdk_notify_type_get_type
gdk_overlap_type_get_type
@@ -345,69 +339,6 @@ GDK_IS_DRAWABLE_CLASS
GdkDrawableClass
-
-Graphics Contexts
-gcs
-GdkGC
-GdkGCValues
-GdkGCValuesMask
-
-GdkFunction
-
-gdk_gc_new
-gdk_gc_new_with_values
-gdk_gc_get_screen
-gdk_gc_set_values
-gdk_gc_get_values
-gdk_gc_set_foreground
-gdk_gc_set_background
-gdk_gc_set_rgb_fg_color
-gdk_gc_set_rgb_bg_color
-gdk_gc_set_function
-gdk_gc_set_fill
-GdkFill
-gdk_gc_set_tile
-gdk_gc_set_stipple
-gdk_gc_set_ts_origin
-gdk_gc_set_clip_origin
-gdk_gc_set_clip_mask
-gdk_gc_set_clip_rectangle
-gdk_gc_set_clip_region
-gdk_gc_set_subwindow
-GdkSubwindowMode
-gdk_gc_set_exposures
-gdk_gc_set_line_attributes
-GdkLineStyle
-GdkCapStyle
-GdkJoinStyle
-gdk_gc_set_dashes
-gdk_gc_copy
-gdk_gc_set_colormap
-gdk_gc_get_colormap
-
-gdk_gc_offset
-
-
-GDK_GC
-GDK_TYPE_GC
-GDK_IS_GC
-GDK_GC_CLASS
-GDK_GC_GET_CLASS
-GDK_IS_GC_CLASS
-GDK_TYPE_CAP_STYLE
-GDK_TYPE_FILL
-GDK_TYPE_FILL_RULE
-GDK_TYPE_FUNCTION
-GDK_TYPE_GC_VALUES_MASK
-GDK_TYPE_JOIN_STYLE
-GDK_TYPE_LINE_STYLE
-GDK_TYPE_SUBWINDOW_MODE
-
-
-GdkGCClass
-gdk_gc_get_type
-
-
Visuals
visuals
@@ -1137,8 +1068,6 @@ gdk_x11_display_set_cursor_theme
gdk_x11_register_standard_event_type
gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid
-gdk_x11_gc_get_xdisplay
-gdk_x11_gc_get_xgc
gdk_x11_get_default_root_xwindow
gdk_x11_get_default_screen
gdk_x11_get_default_xdisplay
diff --git a/docs/reference/gdk/gdk3.types b/docs/reference/gdk/gdk3.types
index 1e129763ab..90678f9d04 100644
--- a/docs/reference/gdk/gdk3.types
+++ b/docs/reference/gdk/gdk3.types
@@ -6,7 +6,6 @@ gdk_screen_get_type
gdk_drawable_get_type
gdk_window_object_get_type
gdk_pixmap_get_type
-gdk_gc_get_type
gdk_keymap_get_type
gdk_device_get_type
gdk_device_manager_get_type
diff --git a/docs/reference/gdk/tmpl/gcs.sgml b/docs/reference/gdk/tmpl/gcs.sgml
deleted file mode 100644
index e4ffb9dcf0..0000000000
--- a/docs/reference/gdk/tmpl/gcs.sgml
+++ /dev/null
@@ -1,426 +0,0 @@
-
-Graphics Contexts
-
-
-Objects to encapsulate drawing properties
-
-
-
-All drawing operations in GDK take a
-graphics context (GC) argument.
-A graphics context encapsulates information about
-the way things are drawn, such as the foreground
-color or line width. By using graphics contexts,
-the number of arguments to each drawing call is
-greatly reduced, and communication overhead is
-minimized, since identical arguments do not need
-to be passed repeatedly.
-
-
-Most values of a graphics context can be set at
-creation time by using gdk_gc_new_with_values(),
-or can be set one-by-one using functions such
-as gdk_gc_set_foreground(). A few of the values
-in the GC, such as the dash pattern, can only
-be set by the latter method.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-The #GdkGC structure represents a graphics context.
-It is an opaque structure with no user-visible
-elements.
-
-
-
-
-
-The #GdkGCValues structure holds a set of values used
-to create or modify a graphics context.
-
-
-@foreground: the foreground color. Note that gdk_gc_get_values()
- only sets the pixel value.
-@background: the background color. Note that gdk_gc_get_values()
- only sets the pixel value.
-@function: the bitwise operation used when drawing.
-@fill: the fill style.
-@tile: the tile pixmap.
-@stipple: the stipple bitmap.
-@clip_mask: the clip mask bitmap.
-@subwindow_mode: the subwindow mode.
-@ts_x_origin: the x origin of the tile or stipple.
-@ts_y_origin: the y origin of the tile or stipple.
-@clip_x_origin: the x origin of the clip mask.
-@clip_y_origin: the y origin of the clip mask.
-@graphics_exposures: whether graphics exposures are enabled.
-@line_width: the line width.
-@line_style: the way dashed lines are drawn.
-@cap_style: the way the ends of lines are drawn.
-@join_style: the way joins between lines are drawn.
-
-
-
-A set of bit flags used to indicate which fields
-#GdkGCValues structure are set.
-
-
-@GDK_GC_FOREGROUND: the @foreground is set.
-@GDK_GC_BACKGROUND: the @background is set.
-@GDK_GC_FUNCTION: the @function is set.
-@GDK_GC_FILL: the @fill is set.
-@GDK_GC_TILE: the @tile is set.
-@GDK_GC_STIPPLE: the @stipple is set.
-@GDK_GC_CLIP_MASK: the @clip_mask is set.
-@GDK_GC_SUBWINDOW: the @subwindow_mode is set.
-@GDK_GC_TS_X_ORIGIN: the @ts_x_origin is set.
-@GDK_GC_TS_Y_ORIGIN: the @ts_y_origin is set.
-@GDK_GC_CLIP_X_ORIGIN: the @clip_x_origin is set.
-@GDK_GC_CLIP_Y_ORIGIN: the @clip_y_origin is set.
-@GDK_GC_EXPOSURES: the @graphics_exposures is set.
-@GDK_GC_LINE_WIDTH: the @line_width is set.
-@GDK_GC_LINE_STYLE: the @line_style is set.
-@GDK_GC_CAP_STYLE: the @cap_style is set.
-@GDK_GC_JOIN_STYLE: the @join_style is set.
-
-
-
-Determines how the bit values for the source pixels are combined with
-the bit values for destination pixels to produce the final result. The
-sixteen values here correspond to the 16 different possible 2x2 truth
-tables. Only a couple of these values are usually useful; for colored
-images, only %GDK_COPY, %GDK_XOR and %GDK_INVERT are generally
-useful. For bitmaps, %GDK_AND and %GDK_OR are also useful.
-
-
-@GDK_COPY: dst = src
-@GDK_INVERT: dst = NOT dst
-@GDK_XOR: dst = src XOR dst
-@GDK_CLEAR: dst = 0
-@GDK_AND: dst = dst AND src
-@GDK_AND_REVERSE: dst = src AND (NOT dst)
-@GDK_AND_INVERT: dst = (NOT src) AND dst
-@GDK_NOOP: dst = dst
-@GDK_OR: dst = src OR dst
-@GDK_EQUIV: dst = (NOT src) XOR dst
-@GDK_OR_REVERSE: dst = src OR (NOT dst)
-@GDK_COPY_INVERT: dst = NOT src
-@GDK_OR_INVERT: dst = (NOT src) OR dst
-@GDK_NAND: dst = (NOT src) OR (NOT dst)
-@GDK_NOR: dst = (NOT src) AND (NOT dst)
-@GDK_SET: dst = 1
-
-
-
-
-
-@drawable:
-@Returns:
-
-
-
-
-
-
-
-@drawable:
-@values:
-@values_mask:
-@Returns:
-
-
-
-
-
-
-
-@gc:
-@Returns:
-
-
-
-
-
-
-
-@gc:
-@values:
-@values_mask:
-
-
-
-
-
-
-
-@gc:
-@values:
-
-
-
-
-
-
-
-@gc:
-@color:
-
-
-
-
-
-
-
-@gc:
-@color:
-
-
-
-
-
-
-
-@gc:
-@color:
-
-
-
-
-
-
-
-@gc:
-@color:
-
-
-
-
-
-
-
-@gc:
-@function:
-
-
-
-
-
-
-
-@gc:
-@fill:
-
-
-
-
-Determines how primitives are drawn.
-
-
-@GDK_SOLID: draw with the foreground color.
-@GDK_TILED: draw with a tiled pixmap.
-@GDK_STIPPLED: draw using the stipple bitmap. Pixels corresponding
- to bits in the stipple bitmap that are set will be drawn in the
- foreground color; pixels corresponding to bits that are
- not set will be left untouched.
-@GDK_OPAQUE_STIPPLED: draw using the stipple bitmap. Pixels corresponding
- to bits in the stipple bitmap that are set will be drawn in the
- foreground color; pixels corresponding to bits that are
- not set will be drawn with the background color.
-
-
-
-
-
-
-@gc:
-@tile:
-
-
-
-
-
-
-
-@gc:
-@stipple:
-
-
-
-
-
-
-
-@gc:
-@x:
-@y:
-
-
-
-
-
-
-
-@gc:
-@x:
-@y:
-
-
-
-
-
-
-
-@gc:
-@mask:
-
-
-
-
-
-
-@gc:
-@rectangle:
-
-
-
-
-
-
-
-@gc:
-@region:
-
-
-
-
-
-
-
-@gc:
-@mode:
-
-
-
-
-Determines how drawing onto a window will affect child
-windows of that window.
-
-
-@GDK_CLIP_BY_CHILDREN: only draw onto the window itself.
-@GDK_INCLUDE_INFERIORS: draw onto the window and child windows.
-
-
-
-
-
-
-@gc:
-@exposures:
-
-
-
-
-
-
-
-@gc:
-@line_width:
-@line_style:
-@cap_style:
-@join_style:
-
-
-
-
-Determines how lines are drawn.
-
-
-@GDK_LINE_SOLID: lines are drawn solid.
-@GDK_LINE_ON_OFF_DASH: even segments are drawn; odd segments are not drawn.
-@GDK_LINE_DOUBLE_DASH: even segments are normally. Odd segments are drawn
- in the background color if the fill style is %GDK_SOLID, or in the background
- color masked by the stipple if the fill style is %GDK_STIPPLED.
-
-
-
-Determines how the end of lines are drawn.
-
-
-@GDK_CAP_NOT_LAST: the same as %GDK_CAP_BUTT for lines of non-zero width.
- for zero width lines, the final point on the line will not be drawn.
-@GDK_CAP_BUTT: the ends of the lines are drawn squared off and extending
- to the coordinates of the end point.
-@GDK_CAP_ROUND: the ends of the lines are drawn as semicircles with the
- diameter equal to the line width and centered at the end point.
-@GDK_CAP_PROJECTING: the ends of the lines are drawn squared off and extending
- half the width of the line beyond the end point.
-
-
-
-Determines how the joins between segments of a polygon are drawn.
-
-
-@GDK_JOIN_MITER: the sides of each line are extended to meet at an angle.
-@GDK_JOIN_ROUND: the sides of the two lines are joined by a circular arc.
-@GDK_JOIN_BEVEL: the sides of the two lines are joined by a straight line which
- makes an equal angle with each line.
-
-
-
-
-
-
-@gc:
-@dash_offset:
-@dash_list:
-@n:
-
-
-
-
-
-
-
-@dst_gc:
-@src_gc:
-
-
-
-
-
-
-
-@gc:
-@colormap:
-
-
-
-
-
-
-
-@gc:
-@Returns:
-
-
-
-
-
-
-
-@gc:
-@x_offset:
-@y_offset:
-
-
diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml
index 28aae1f167..43fcc5a8b7 100644
--- a/docs/reference/gdk/tmpl/x_interaction.sgml
+++ b/docs/reference/gdk/tmpl/x_interaction.sgml
@@ -97,15 +97,6 @@ Returns the X resource (window or pixmap) belonging to a #GdkDrawable.
@Returns: the ID of @win's X resource.
-
-
-Returns the display of a #GdkGC.
-
-
-@gc: a #GdkGC.
-@Returns: an Xlib Display*.
-
-
Returns the display of a #GdkColormap.
@@ -179,24 +170,6 @@ Returns the display of a #GdkCursor.
@Returns: an Xlib Display*.
-
-
-Returns the X GC of a #GdkGC.
-
-
-@gc: a #GdkGC.
-@Returns: an Xlib GC.
-
-
-
-
-Returns the X GC of a #GdkGC.
-
-
-@gc: a #GdkGC.
-@Returns: an Xlib GC.
-
-
Another name for GDK_DRAWABLE_XID().
@@ -539,24 +512,6 @@ Another name for GDK_DRAWABLE_XID().
@Returns:
-
-
-
-
-
-@gc:
-@Returns:
-
-
-
-
-
-
-
-@gc:
-@Returns:
-
-
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index b63f502bd9..020f99f312 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -81,7 +81,6 @@ gdk_public_h_sources = \
gdkdnd.h \
gdkdrawable.h \
gdkevents.h \
- gdkgc.h \
gdkinput.h \
gdkkeys.h \
gdkkeysyms.h \
@@ -121,7 +120,6 @@ gdk_c_sources = \
gdkdnd.c \
gdkdraw.c \
gdkevents.c \
- gdkgc.c \
gdkglobals.c \
gdkkeys.c \
gdkkeyuni.c \
@@ -209,7 +207,6 @@ x11_introspection_files = \
x11/gdkdrawable-x11.c \
x11/gdkeventsource.c \
x11/gdkeventtranslator.c \
- x11/gdkgc-x11.c \
x11/gdkgeometry-x11.c \
x11/gdkglobals-x11.c \
x11/gdkim-x11.c \
diff --git a/gdk/directfb/Makefile.am b/gdk/directfb/Makefile.am
index a11f9debac..bfc477109b 100644
--- a/gdk/directfb/Makefile.am
+++ b/gdk/directfb/Makefile.am
@@ -27,7 +27,6 @@ libgdk_directfb_la_SOURCES = \
gdkdisplay-directfb.h \
gdkdrawable-directfb.c \
gdkevents-directfb.c \
- gdkgc-directfb.c \
gdkgeometry-directfb.c \
gdkglobals-directfb.c \
gdkim-directfb.c \
diff --git a/gdk/directfb/gdkgc-directfb.c b/gdk/directfb/gdkgc-directfb.c
deleted file mode 100644
index a69652369e..0000000000
--- a/gdk/directfb/gdkgc-directfb.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team.
- */
-
-/*
- * GTK+ DirectFB backend
- * Copyright (C) 2001-2002 convergence integrated media GmbH
- * Copyright (C) 2002-2004 convergence GmbH
- * Written by Denis Oliver Kropp and
- * Sven Neumann
- */
-
-#undef GDK_DISABLE_DEPRECATED
-
-#include "config.h"
-#include "gdk.h"
-
-#include
-
-#include "gdkdirectfb.h"
-#include "gdkprivate-directfb.h"
-
-#include "gdkgc.h"
-#include "gdkpixmap.h"
-
-static void gdk_directfb_gc_get_values (GdkGC *gc,
- GdkGCValues *values);
-static void gdk_directfb_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-static void gdk_directfb_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n);
-
-
-static void gdk_gc_directfb_finalize (GObject *object);
-
-G_DEFINE_TYPE (GdkGCDirectFB, _gdk_gc_directfb, GDK_TYPE_GC)
-
-static void
-_gdk_gc_directfb_init (GdkGCDirectFB *directfb_gc)
-{
-}
-
-static void
-_gdk_gc_directfb_class_init (GdkGCDirectFBClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkGCClass *gc_class = GDK_GC_CLASS (klass);
-
- object_class->finalize = gdk_gc_directfb_finalize;
-
- gc_class->get_values = gdk_directfb_gc_get_values;
- gc_class->set_values = gdk_directfb_gc_set_values;
- gc_class->set_dashes = gdk_directfb_gc_set_dashes;
-}
-
-static void
-gdk_gc_directfb_finalize (GObject *object)
-{
- GdkGCDirectFB *directfb_gc = GDK_GC_DIRECTFB (object);
-
- if (directfb_gc->clip_region.numRects)
- temp_region_deinit (&directfb_gc->clip_region);
- if (directfb_gc->values.clip_mask)
- g_object_unref (directfb_gc->values.clip_mask);
- if (directfb_gc->values.stipple)
- g_object_unref (directfb_gc->values.stipple);
- if (directfb_gc->values.tile)
- g_object_unref (directfb_gc->values.tile);
-
- G_OBJECT_CLASS (_gdk_gc_directfb_parent_class)->finalize (object);
-}
-
-
-GdkGC *
-_gdk_directfb_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGC *gc;
- GdkGCDirectFB *private;
-
- /* NOTICE that the drawable here has to be the impl drawable, not the
- publicly visible drawable. */
- g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_DIRECTFB (drawable), NULL);
-
- gc = GDK_GC (g_object_new (_gdk_gc_directfb_get_type (), NULL));
-
- _gdk_gc_init (gc, drawable, values, values_mask);
-
- private = GDK_GC_DIRECTFB (gc);
-#if 0
- private->values.background.pixel = 0;
- private->values.background.red =
- private->values.background.green =
- private->values.background.blue = 0;
-
- private->values.foreground.pixel = 0;
- private->values.foreground.red =
- private->values.foreground.green =
- private->values.foreground.blue = 0;
-#endif
-
- private->values.cap_style = GDK_CAP_BUTT;
-
- gdk_directfb_gc_set_values (gc, values, values_mask);
-
- return gc;
-}
-
-static void
-gdk_directfb_gc_get_values (GdkGC *gc,
- GdkGCValues *values)
-{
- *values = GDK_GC_DIRECTFB (gc)->values;
-}
-
-#if 0
-void
-_gdk_windowing_gc_get_foreground (GdkGC *gc,
- GdkColor *color)
-{
- GdkGCDirectFB *private;
- private = GDK_GC_DIRECTFB (gc);
- *color =private->values.foreground;
-
-
-}
-#endif
-
-static void
-gdk_directfb_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGCDirectFB *private = GDK_GC_DIRECTFB (gc);
-
- if (values_mask & GDK_GC_FOREGROUND)
- {
- private->values.foreground = values->foreground;
- private->values_mask |= GDK_GC_FOREGROUND;
- }
-
- if (values_mask & GDK_GC_BACKGROUND)
- {
- private->values.background = values->background;
- private->values_mask |= GDK_GC_BACKGROUND;
- }
-
- if (values_mask & GDK_GC_FUNCTION)
- {
- private->values.function = values->function;
- private->values_mask |= GDK_GC_FUNCTION;
- }
-
- if (values_mask & GDK_GC_FILL)
- {
- private->values.fill = values->fill;
- private->values_mask |= GDK_GC_FILL;
- }
-
- if (values_mask & GDK_GC_TILE)
- {
- GdkPixmap *oldpm = private->values.tile;
-
- if (values->tile)
- g_assert (GDK_PIXMAP_OBJECT (values->tile)->depth > 1);
-
- private->values.tile = values->tile ? g_object_ref (values->tile) : NULL;
- private->values_mask |= GDK_GC_TILE;
-
- if (oldpm)
- g_object_unref (oldpm);
- }
-
- if (values_mask & GDK_GC_STIPPLE)
- {
- GdkPixmap *oldpm = private->values.stipple;
-
- if (values->stipple)
- g_assert (GDK_PIXMAP_OBJECT (values->stipple)->depth == 1);
-
- private->values.stipple = (values->stipple ?
- g_object_ref (values->stipple) : NULL);
- private->values_mask |= GDK_GC_STIPPLE;
-
- if (oldpm)
- g_object_unref (oldpm);
- }
-
- if (values_mask & GDK_GC_CLIP_MASK)
- {
- GdkPixmap *oldpm = private->values.clip_mask;
-
- private->values.clip_mask = (values->clip_mask ?
- g_object_ref (values->clip_mask) : NULL);
- private->values_mask |= GDK_GC_CLIP_MASK;
-
- if (oldpm)
- g_object_unref (oldpm);
-
- temp_region_reset (&private->clip_region);
- }
-
- if (values_mask & GDK_GC_SUBWINDOW)
- {
- private->values.subwindow_mode = values->subwindow_mode;
- private->values_mask |= GDK_GC_SUBWINDOW;
- }
-
- if (values_mask & GDK_GC_TS_X_ORIGIN)
- {
- private->values.ts_x_origin = values->ts_x_origin;
- private->values_mask |= GDK_GC_TS_X_ORIGIN;
- }
-
- if (values_mask & GDK_GC_TS_Y_ORIGIN)
- {
- private->values.ts_y_origin = values->ts_y_origin;
- private->values_mask |= GDK_GC_TS_Y_ORIGIN;
- }
-
- if (values_mask & GDK_GC_CLIP_X_ORIGIN)
- {
- private->values.clip_x_origin = GDK_GC (gc)->clip_x_origin = values->clip_x_origin;
- private->values_mask |= GDK_GC_CLIP_X_ORIGIN;
- }
-
- if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
- {
- private->values.clip_y_origin = GDK_GC (gc)->clip_y_origin = values->clip_y_origin;
- private->values_mask |= GDK_GC_CLIP_Y_ORIGIN;
- }
-
- if (values_mask & GDK_GC_EXPOSURES)
- {
- private->values.graphics_exposures = values->graphics_exposures;
- private->values_mask |= GDK_GC_EXPOSURES;
- }
-
- if (values_mask & GDK_GC_LINE_WIDTH)
- {
- private->values.line_width = values->line_width;
- private->values_mask |= GDK_GC_LINE_WIDTH;
- }
-
- if (values_mask & GDK_GC_LINE_STYLE)
- {
- private->values.line_style = values->line_style;
- private->values_mask |= GDK_GC_LINE_STYLE;
- }
-
- if (values_mask & GDK_GC_CAP_STYLE)
- {
- private->values.cap_style = values->cap_style;
- private->values_mask |= GDK_GC_CAP_STYLE;
- }
-
- if (values_mask & GDK_GC_JOIN_STYLE)
- {
- private->values.join_style = values->join_style;
- private->values_mask |= GDK_GC_JOIN_STYLE;
- }
-}
-
-static void
-gdk_directfb_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n)
-{
- g_warning ("gdk_directfb_gc_set_dashes not implemented");
-}
-
-static void
-gc_unset_clip_mask (GdkGC *gc)
-{
- GdkGCDirectFB *data = GDK_GC_DIRECTFB (gc);
-
- if (data->values.clip_mask)
- {
- g_object_unref (data->values.clip_mask);
- data->values.clip_mask = NULL;
- data->values_mask &= ~ GDK_GC_CLIP_MASK;
- }
-}
-
-
-void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region,
- gboolean reset_origin)
-{
- GdkGCDirectFB *data;
-
- g_return_if_fail (gc != NULL);
-
- data = GDK_GC_DIRECTFB (gc);
-
- if (region == &data->clip_region)
- return;
-
- if (region)
- temp_region_init_copy (&data->clip_region, region);
- else
- temp_region_reset (&data->clip_region);
-
- if (reset_origin)
- {
- gc->clip_x_origin = 0;
- gc->clip_y_origin = 0;
- data->values.clip_x_origin = 0;
- data->values.clip_y_origin = 0;
- }
-
- gc_unset_clip_mask (gc);
-}
-
-void
-_gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc)
-{
- GdkGCDirectFB *dst_private;
-
- g_return_if_fail (dst_gc != NULL);
- g_return_if_fail (src_gc != NULL);
-
- dst_private = GDK_GC_DIRECTFB (dst_gc);
-
- temp_region_reset(&dst_private->clip_region);
-
- if (dst_private->values_mask & GDK_GC_TILE)
- g_object_unref (dst_private->values.tile);
- if (dst_private->values_mask & GDK_GC_STIPPLE)
- g_object_unref (dst_private->values.stipple);
- if (dst_private->values_mask & GDK_GC_CLIP_MASK)
- g_object_unref (dst_private->values.clip_mask);
-
- *dst_gc = *src_gc;
- if (dst_private->values_mask & GDK_GC_TILE)
- g_object_ref (dst_private->values.tile);
- if (dst_private->values_mask & GDK_GC_STIPPLE)
- g_object_ref (dst_private->values.stipple);
- if (dst_private->values_mask & GDK_GC_CLIP_MASK)
- g_object_ref (dst_private->values.clip_mask);
-}
-
-/**
- * gdk_gc_get_screen:
- * @gc: a #GdkGC.
- *
- * Gets the #GdkScreen for which @gc was created
- *
- * Returns: the #GdkScreen for @gc.
- *
- * Since: 2.2
- */
-GdkScreen *
-gdk_gc_get_screen (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC_DIRECTFB (gc), NULL);
-
- return _gdk_screen;
-}
diff --git a/gdk/directfb/gdkprivate-directfb.h b/gdk/directfb/gdkprivate-directfb.h
index 9929998f40..bc351253fd 100644
--- a/gdk/directfb/gdkprivate-directfb.h
+++ b/gdk/directfb/gdkprivate-directfb.h
@@ -198,31 +198,6 @@ typedef struct
DFBSurfacePixelFormat format;
} GdkVisualDirectFB;
-#define GDK_TYPE_GC_DIRECTFB (_gdk_gc_directfb_get_type ())
-#define GDK_GC_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_DIRECTFB, GdkGCDirectFB))
-#define GDK_IS_GC_DIRECTFB(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_DIRECTFB))
-
-typedef struct
-{
- GdkGC parent_instance;
-
- cairo_region_t clip_region;
-
- GdkGCValuesMask values_mask;
- GdkGCValues values;
-} GdkGCDirectFB;
-
-typedef struct
-{
- GdkGCClass parent_class;
-} GdkGCDirectFBClass;
-
-GType _gdk_gc_directfb_get_type (void);
-
-GdkGC * _gdk_directfb_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-
void gdk_directfb_event_windows_add (GdkWindow *window);
void gdk_directfb_event_windows_remove (GdkWindow *window);
diff --git a/gdk/gdk.h b/gdk/gdk.h
index 4ff1e15bc9..d3a0ea8181 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -41,7 +41,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index def0a44d77..b52bfd3ae1 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -250,20 +250,16 @@ gdk_input_source_get_type G_GNUC_CONST
gdk_input_mode_get_type G_GNUC_CONST
gdk_axis_use_get_type G_GNUC_CONST
gdk_byte_order_get_type G_GNUC_CONST
-gdk_cap_style_get_type G_GNUC_CONST
gdk_crossing_mode_get_type G_GNUC_CONST
gdk_device_type_get_type G_GNUC_CONST
gdk_extension_mode_get_type G_GNUC_CONST
gdk_event_mask_get_type G_GNUC_CONST
gdk_event_type_get_type G_GNUC_CONST
-gdk_fill_get_type G_GNUC_CONST
gdk_filter_return_get_type G_GNUC_CONST
gdk_function_get_type G_GNUC_CONST
gdk_grab_ownership_get_type G_GNUC_CONST
gdk_grab_status_get_type G_GNUC_CONST
gdk_gravity_get_type G_GNUC_CONST
-gdk_join_style_get_type G_GNUC_CONST
-gdk_line_style_get_type G_GNUC_CONST
gdk_modifier_type_get_type G_GNUC_CONST
gdk_notify_type_get_type G_GNUC_CONST
gdk_owner_change_get_type G_GNUC_CONST
@@ -278,7 +274,6 @@ gdk_wm_decoration_get_type G_GNUC_CONST
gdk_wm_function_get_type G_GNUC_CONST
gdk_cursor_type_get_type G_GNUC_CONST
gdk_drag_action_get_type G_GNUC_CONST
-gdk_gc_values_mask_get_type G_GNUC_CONST
gdk_window_attributes_type_get_type G_GNUC_CONST
gdk_window_class_get_type G_GNUC_CONST
gdk_window_edge_get_type G_GNUC_CONST
@@ -552,43 +547,6 @@ gdk_drawable_set_colormap
#endif
#endif
-#if IN_HEADER(__GDK_GC_H__)
-#if IN_FILE(__GDK_GC_C__)
-gdk_gc_new
-gdk_gc_get_type G_GNUC_CONST
-gdk_gc_new_with_values
-gdk_gc_get_values
-gdk_gc_set_values
-gdk_gc_set_foreground
-gdk_gc_set_background
-gdk_gc_set_function
-gdk_gc_set_fill
-gdk_gc_set_tile
-gdk_gc_set_stipple
-gdk_gc_set_ts_origin
-gdk_gc_set_clip_origin
-gdk_gc_set_clip_mask
-gdk_gc_set_clip_rectangle
-gdk_gc_set_clip_region
-gdk_gc_set_subwindow
-gdk_gc_set_exposures
-gdk_gc_set_line_attributes
-gdk_gc_set_dashes
-gdk_gc_offset
-gdk_gc_copy
-gdk_gc_get_colormap
-gdk_gc_set_colormap
-gdk_gc_set_rgb_bg_color
-gdk_gc_set_rgb_fg_color
-#endif
-#endif
-
-#if IN_HEADER(__GDK_GC_H__)
-#if IN_FILE(__GDK_GC_X11_C__)
-gdk_gc_get_screen
-#endif
-#endif
-
#if IN_HEADER(__GDK_PIXMAP_X11_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
#ifdef GDK_WINDOWING_X11
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index b7d5bee631..1d88cc2240 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -160,10 +160,7 @@ gdk_drawable_get_display (GdkDrawable *drawable)
* use this function if the drawable-creating function did not have a
* way to determine the colormap, and you then use drawable operations
* that require a colormap. The colormap for all drawables and
- * graphics contexts you intend to use together should match. i.e.
- * when using a #GdkGC to draw to a drawable, or copying one drawable
- * to another, the colormaps should match.
- *
+ * graphics contexts you intend to use together should match.
**/
void
gdk_drawable_set_colormap (GdkDrawable *drawable,
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 266eaf8039..1e0c357cee 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -32,7 +32,6 @@
#define __GDK_DRAWABLE_H__
#include
-#include
#include
#include
@@ -57,10 +56,6 @@ struct _GdkDrawableClass
{
GObjectClass parent_class;
- GdkGC *(*create_gc) (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask mask);
-
gint (*get_depth) (GdkDrawable *drawable);
void (*get_size) (GdkDrawable *drawable,
gint *width,
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
deleted file mode 100644
index 13003b9f95..0000000000
--- a/gdk/gdkgc.c
+++ /dev/null
@@ -1,1244 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-#include
-
-#include "gdkcairo.h"
-#include "gdkgc.h"
-#include "gdkinternals.h"
-#include "gdkpixmap.h"
-#include "gdkprivate.h"
-
-
-static void gdk_gc_finalize (GObject *object);
-
-typedef struct _GdkGCPrivate GdkGCPrivate;
-
-struct _GdkGCPrivate
-{
- cairo_region_t *clip_region;
-
- guint32 region_tag_applied;
- int region_tag_offset_x;
- int region_tag_offset_y;
-
- cairo_region_t *old_clip_region;
- GdkPixmap *old_clip_mask;
-
- GdkBitmap *stipple;
- GdkPixmap *tile;
-
- GdkPixmap *clip_mask;
-
- guint32 fg_pixel;
- guint32 bg_pixel;
-
- guint subwindow_mode : 1;
- guint fill : 2;
- guint exposures : 2;
-};
-
-#define GDK_GC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_GC, GdkGCPrivate))
-
-G_DEFINE_TYPE (GdkGC, gdk_gc, G_TYPE_OBJECT)
-
-static void
-gdk_gc_class_init (GdkGCClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
-
- object_class->finalize = gdk_gc_finalize;
-
- g_type_class_add_private (object_class, sizeof (GdkGCPrivate));
-}
-
-static void
-gdk_gc_init (GdkGC *gc)
-{
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- priv->fill = GDK_SOLID;
-
- /* These are the default X11 value, which we match. They are clearly
- * wrong for TrueColor displays, so apps have to change them.
- */
- priv->fg_pixel = 0;
- priv->bg_pixel = 1;
-}
-
-/**
- * gdk_gc_new:
- * @drawable: a #GdkDrawable. The created GC must always be used
- * with drawables of the same depth as this one.
- *
- * Create a new graphics context with default values.
- *
- * Returns: the new graphics context.
- **/
-GdkGC*
-gdk_gc_new (GdkDrawable *drawable)
-{
- g_return_val_if_fail (drawable != NULL, NULL);
-
- return gdk_gc_new_with_values (drawable, NULL, 0);
-}
-
-/**
- * gdk_gc_new_with_values:
- * @drawable: a #GdkDrawable. The created GC must always be used
- * with drawables of the same depth as this one.
- * @values: a structure containing initial values for the GC.
- * @values_mask: a bit mask indicating which fields in @values
- * are set.
- *
- * Create a new GC with the given initial values.
- *
- * Return value: the new graphics context.
- **/
-GdkGC*
-gdk_gc_new_with_values (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- g_return_val_if_fail (drawable != NULL, NULL);
-
- return GDK_DRAWABLE_GET_CLASS (drawable)->create_gc (drawable,
- values,
- values_mask);
-}
-
-/**
- * _gdk_gc_init:
- * @gc: a #GdkGC
- * @drawable: a #GdkDrawable.
- * @values: a structure containing initial values for the GC.
- * @values_mask: a bit mask indicating which fields in @values
- * are set.
- *
- * Does initialization of the generic portions of a #GdkGC
- * created with the specified values and values_mask. This
- * should be called out of the implementation of
- * GdkDrawable.create_gc() immediately after creating the
- * #GdkGC object.
- **/
-void
-_gdk_gc_init (GdkGC *gc,
- GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGCPrivate *priv;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- priv = GDK_GC_GET_PRIVATE (gc);
-
- if (values_mask & GDK_GC_CLIP_X_ORIGIN)
- gc->clip_x_origin = values->clip_x_origin;
- if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
- gc->clip_y_origin = values->clip_y_origin;
- if ((values_mask & GDK_GC_CLIP_MASK) && values->clip_mask)
- priv->clip_mask = g_object_ref (values->clip_mask);
- if (values_mask & GDK_GC_TS_X_ORIGIN)
- gc->ts_x_origin = values->ts_x_origin;
- if (values_mask & GDK_GC_TS_Y_ORIGIN)
- gc->ts_y_origin = values->ts_y_origin;
- if (values_mask & GDK_GC_FILL)
- priv->fill = values->fill;
- if (values_mask & GDK_GC_STIPPLE)
- {
- priv->stipple = values->stipple;
- if (priv->stipple)
- g_object_ref (priv->stipple);
- }
- if (values_mask & GDK_GC_TILE)
- {
- priv->tile = values->tile;
- if (priv->tile)
- g_object_ref (priv->tile);
- }
- if (values_mask & GDK_GC_FOREGROUND)
- priv->fg_pixel = values->foreground.pixel;
- if (values_mask & GDK_GC_BACKGROUND)
- priv->bg_pixel = values->background.pixel;
- if (values_mask & GDK_GC_SUBWINDOW)
- priv->subwindow_mode = values->subwindow_mode;
- if (values_mask & GDK_GC_EXPOSURES)
- priv->exposures = values->graphics_exposures;
- else
- priv->exposures = TRUE;
-
- gc->colormap = gdk_drawable_get_colormap (drawable);
- if (gc->colormap)
- g_object_ref (gc->colormap);
-}
-
-static void
-gdk_gc_finalize (GObject *object)
-{
- GdkGC *gc = GDK_GC (object);
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- if (priv->clip_region)
- cairo_region_destroy (priv->clip_region);
- if (priv->old_clip_region)
- cairo_region_destroy (priv->old_clip_region);
- if (priv->clip_mask)
- g_object_unref (priv->clip_mask);
- if (priv->old_clip_mask)
- g_object_unref (priv->old_clip_mask);
- if (gc->colormap)
- g_object_unref (gc->colormap);
- if (priv->tile)
- g_object_unref (priv->tile);
- if (priv->stipple)
- g_object_unref (priv->stipple);
-
- G_OBJECT_CLASS (gdk_gc_parent_class)->finalize (object);
-}
-
-/**
- * gdk_gc_get_values:
- * @gc: a #GdkGC.
- * @values: the #GdkGCValues structure in which to store the results.
- *
- * Retrieves the current values from a graphics context. Note that
- * only the pixel values of the @values->foreground and @values->background
- * are filled, use gdk_colormap_query_color() to obtain the rgb values
- * if you need them.
- **/
-void
-gdk_gc_get_values (GdkGC *gc,
- GdkGCValues *values)
-{
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (values != NULL);
-
- GDK_GC_GET_CLASS (gc)->get_values (gc, values);
-}
-
-/**
- * gdk_gc_set_values:
- * @gc: a #GdkGC
- * @values: struct containing the new values
- * @values_mask: mask indicating which struct fields are to be used
- *
- * Sets attributes of a graphics context in bulk. For each flag set in
- * @values_mask, the corresponding field will be read from @values and
- * set as the new value for @gc. If you're only setting a few values
- * on @gc, calling individual "setter" functions is likely more
- * convenient.
- *
- **/
-void
-gdk_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGCPrivate *priv;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (values != NULL);
-
- priv = GDK_GC_GET_PRIVATE (gc);
-
- if ((values_mask & GDK_GC_CLIP_X_ORIGIN) ||
- (values_mask & GDK_GC_CLIP_Y_ORIGIN) ||
- (values_mask & GDK_GC_CLIP_MASK) ||
- (values_mask & GDK_GC_SUBWINDOW))
- _gdk_gc_remove_drawable_clip (gc);
-
- if (values_mask & GDK_GC_CLIP_X_ORIGIN)
- gc->clip_x_origin = values->clip_x_origin;
- if (values_mask & GDK_GC_CLIP_Y_ORIGIN)
- gc->clip_y_origin = values->clip_y_origin;
- if (values_mask & GDK_GC_TS_X_ORIGIN)
- gc->ts_x_origin = values->ts_x_origin;
- if (values_mask & GDK_GC_TS_Y_ORIGIN)
- gc->ts_y_origin = values->ts_y_origin;
- if (values_mask & GDK_GC_CLIP_MASK)
- {
- if (priv->clip_mask)
- {
- g_object_unref (priv->clip_mask);
- priv->clip_mask = NULL;
- }
- if (values->clip_mask)
- priv->clip_mask = g_object_ref (values->clip_mask);
-
- if (priv->clip_region)
- {
- cairo_region_destroy (priv->clip_region);
- priv->clip_region = NULL;
- }
- }
- if (values_mask & GDK_GC_FILL)
- priv->fill = values->fill;
- if (values_mask & GDK_GC_STIPPLE)
- {
- if (priv->stipple != values->stipple)
- {
- if (priv->stipple)
- g_object_unref (priv->stipple);
- priv->stipple = values->stipple;
- if (priv->stipple)
- g_object_ref (priv->stipple);
- }
- }
- if (values_mask & GDK_GC_TILE)
- {
- if (priv->tile != values->tile)
- {
- if (priv->tile)
- g_object_unref (priv->tile);
- priv->tile = values->tile;
- if (priv->tile)
- g_object_ref (priv->tile);
- }
- }
- if (values_mask & GDK_GC_FOREGROUND)
- priv->fg_pixel = values->foreground.pixel;
- if (values_mask & GDK_GC_BACKGROUND)
- priv->bg_pixel = values->background.pixel;
- if (values_mask & GDK_GC_SUBWINDOW)
- priv->subwindow_mode = values->subwindow_mode;
- if (values_mask & GDK_GC_EXPOSURES)
- priv->exposures = values->graphics_exposures;
-
- GDK_GC_GET_CLASS (gc)->set_values (gc, values, values_mask);
-}
-
-/**
- * gdk_gc_set_foreground:
- * @gc: a #GdkGC.
- * @color: the new foreground color.
- *
- * Sets the foreground color for a graphics context.
- * Note that this function uses @color->pixel, use
- * gdk_gc_set_rgb_fg_color() to specify the foreground
- * color as red, green, blue components.
- **/
-void
-gdk_gc_set_foreground (GdkGC *gc,
- const GdkColor *color)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (color != NULL);
-
- values.foreground = *color;
- gdk_gc_set_values (gc, &values, GDK_GC_FOREGROUND);
-}
-
-/**
- * gdk_gc_set_background:
- * @gc: a #GdkGC.
- * @color: the new background color.
- *
- * Sets the background color for a graphics context.
- * Note that this function uses @color->pixel, use
- * gdk_gc_set_rgb_bg_color() to specify the background
- * color as red, green, blue components.
- **/
-void
-gdk_gc_set_background (GdkGC *gc,
- const GdkColor *color)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (color != NULL);
-
- values.background = *color;
- gdk_gc_set_values (gc, &values, GDK_GC_BACKGROUND);
-}
-
-/**
- * gdk_gc_set_function:
- * @gc: a #GdkGC.
- * @function: the #GdkFunction to use
- *
- * Determines how the current pixel values and the
- * pixel values being drawn are combined to produce
- * the final pixel values.
- **/
-void
-gdk_gc_set_function (GdkGC *gc,
- GdkFunction function)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.function = function;
- gdk_gc_set_values (gc, &values, GDK_GC_FUNCTION);
-}
-
-/**
- * gdk_gc_set_fill:
- * @gc: a #GdkGC.
- * @fill: the new fill mode.
- *
- * Set the fill mode for a graphics context.
- **/
-void
-gdk_gc_set_fill (GdkGC *gc,
- GdkFill fill)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.fill = fill;
- gdk_gc_set_values (gc, &values, GDK_GC_FILL);
-}
-
-/**
- * gdk_gc_set_tile:
- * @gc: a #GdkGC.
- * @tile: the new tile pixmap.
- *
- * Set a tile pixmap for a graphics context.
- * This will only be used if the fill mode
- * is %GDK_TILED.
- **/
-void
-gdk_gc_set_tile (GdkGC *gc,
- GdkPixmap *tile)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.tile = tile;
- gdk_gc_set_values (gc, &values, GDK_GC_TILE);
-}
-
-/**
- * gdk_gc_set_stipple:
- * @gc: a #GdkGC.
- * @stipple: the new stipple bitmap.
- *
- * Set the stipple bitmap for a graphics context. The
- * stipple will only be used if the fill mode is
- * %GDK_STIPPLED or %GDK_OPAQUE_STIPPLED.
- **/
-void
-gdk_gc_set_stipple (GdkGC *gc,
- GdkPixmap *stipple)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.stipple = stipple;
- gdk_gc_set_values (gc, &values, GDK_GC_STIPPLE);
-}
-
-/**
- * gdk_gc_set_ts_origin:
- * @gc: a #GdkGC.
- * @x: the x-coordinate of the origin.
- * @y: the y-coordinate of the origin.
- *
- * Set the origin when using tiles or stipples with
- * the GC. The tile or stipple will be aligned such
- * that the upper left corner of the tile or stipple
- * will coincide with this point.
- **/
-void
-gdk_gc_set_ts_origin (GdkGC *gc,
- gint x,
- gint y)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.ts_x_origin = x;
- values.ts_y_origin = y;
-
- gdk_gc_set_values (gc, &values,
- GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
-}
-
-/**
- * gdk_gc_set_clip_origin:
- * @gc: a #GdkGC.
- * @x: the x-coordinate of the origin.
- * @y: the y-coordinate of the origin.
- *
- * Sets the origin of the clip mask. The coordinates are
- * interpreted relative to the upper-left corner of
- * the destination drawable of the current operation.
- **/
-void
-gdk_gc_set_clip_origin (GdkGC *gc,
- gint x,
- gint y)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.clip_x_origin = x;
- values.clip_y_origin = y;
-
- gdk_gc_set_values (gc, &values,
- GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
-}
-
-/**
- * gdk_gc_set_clip_mask:
- * @gc: the #GdkGC.
- * @mask: a bitmap.
- *
- * Sets the clip mask for a graphics context from a bitmap.
- * The clip mask is interpreted relative to the clip
- * origin. (See gdk_gc_set_clip_origin()).
- **/
-void
-gdk_gc_set_clip_mask (GdkGC *gc,
- GdkBitmap *mask)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.clip_mask = mask;
- gdk_gc_set_values (gc, &values, GDK_GC_CLIP_MASK);
-}
-
-/* Takes ownership of passed in region */
-static void
-_gdk_gc_set_clip_region_real (GdkGC *gc,
- cairo_region_t *region,
- gboolean reset_origin)
-{
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- if (priv->clip_mask)
- {
- g_object_unref (priv->clip_mask);
- priv->clip_mask = NULL;
- }
-
- if (priv->clip_region)
- cairo_region_destroy (priv->clip_region);
-
- priv->clip_region = region;
-
- _gdk_windowing_gc_set_clip_region (gc, region, reset_origin);
-}
-
-/* Doesn't copy region, allows not to reset origin */
-void
-_gdk_gc_set_clip_region_internal (GdkGC *gc,
- cairo_region_t *region,
- gboolean reset_origin)
-{
- _gdk_gc_remove_drawable_clip (gc);
- _gdk_gc_set_clip_region_real (gc, region, reset_origin);
-}
-
-
-void
-_gdk_gc_add_drawable_clip (GdkGC *gc,
- guint32 region_tag,
- cairo_region_t *region,
- int offset_x,
- int offset_y)
-{
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- if (priv->region_tag_applied == region_tag &&
- offset_x == priv->region_tag_offset_x &&
- offset_y == priv->region_tag_offset_y)
- return; /* Already appied this drawable region */
-
- if (priv->region_tag_applied)
- _gdk_gc_remove_drawable_clip (gc);
-
- region = cairo_region_copy (region);
- if (offset_x != 0 || offset_y != 0)
- cairo_region_translate (region, offset_x, offset_y);
-
- if (priv->clip_mask)
- {
- int w, h;
- GdkPixmap *new_mask;
- GdkGC *tmp_gc;
- GdkColor black = {0, 0, 0, 0};
- GdkRectangle r;
- cairo_region_overlap_t overlap;
-
- gdk_drawable_get_size (priv->clip_mask, &w, &h);
-
- r.x = 0;
- r.y = 0;
- r.width = w;
- r.height = h;
-
- /* Its quite common to expose areas that are completely in or outside
- * the region, so we try to avoid allocating bitmaps that are just fully
- * set or completely unset.
- */
- overlap = cairo_region_contains_rectangle (region, &r);
- if (overlap == CAIRO_REGION_OVERLAP_PART)
- {
- cairo_t *cr;
-
- /* The region and the mask intersect, create a new clip mask that
- includes both areas */
- priv->old_clip_mask = g_object_ref (priv->clip_mask);
- new_mask = gdk_pixmap_new (priv->old_clip_mask, w, h, -1);
-
- cr = gdk_cairo_create (new_mask);
-
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- cairo_paint (cr);
-
- gdk_cairo_set_source_pixmap (cr, priv->old_clip_mask, 0, 0);
- gdk_cairo_region (cr, region);
- cairo_fill (cr);
-
- cairo_destroy (cr);
-
- cairo_region_destroy (region);
-
- gdk_gc_set_clip_mask (gc, new_mask);
-
- g_object_unref (new_mask);
- }
- else if (overlap == CAIRO_REGION_OVERLAP_OUT)
- {
- /* No intersection, set empty clip region */
- cairo_region_t *empty = cairo_region_create ();
-
- cairo_region_destroy (region);
- priv->old_clip_mask = g_object_ref (priv->clip_mask);
- priv->clip_region = empty;
- _gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
- }
- else
- {
- /* Completely inside region, don't set unnecessary clip */
- cairo_region_destroy (region);
- return;
- }
- }
- else
- {
- priv->old_clip_region = priv->clip_region;
- priv->clip_region = region;
- if (priv->old_clip_region)
- cairo_region_intersect (region, priv->old_clip_region);
-
- _gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
- }
-
- priv->region_tag_applied = region_tag;
- priv->region_tag_offset_x = offset_x;
- priv->region_tag_offset_y = offset_y;
-}
-
-void
-_gdk_gc_remove_drawable_clip (GdkGC *gc)
-{
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- if (priv->region_tag_applied)
- {
- priv->region_tag_applied = 0;
- if (priv->old_clip_mask)
- {
- gdk_gc_set_clip_mask (gc, priv->old_clip_mask);
- g_object_unref (priv->old_clip_mask);
- priv->old_clip_mask = NULL;
-
- if (priv->clip_region)
- {
- g_object_unref (priv->clip_region);
- priv->clip_region = NULL;
- }
- }
- else
- {
- _gdk_gc_set_clip_region_real (gc, priv->old_clip_region, FALSE);
- priv->old_clip_region = NULL;
- }
- }
-}
-
-/**
- * gdk_gc_set_clip_rectangle:
- * @gc: a #GdkGC.
- * @rectangle: the rectangle to clip to.
- *
- * Sets the clip mask for a graphics context from a
- * rectangle. The clip mask is interpreted relative to the clip
- * origin. (See gdk_gc_set_clip_origin()).
- **/
-void
-gdk_gc_set_clip_rectangle (GdkGC *gc,
- const GdkRectangle *rectangle)
-{
- cairo_region_t *region;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- _gdk_gc_remove_drawable_clip (gc);
-
- if (rectangle)
- region = cairo_region_create_rectangle (rectangle);
- else
- region = NULL;
-
- _gdk_gc_set_clip_region_real (gc, region, TRUE);
-}
-
-/**
- * gdk_gc_set_clip_region:
- * @gc: a #GdkGC.
- * @region: the #cairo_region_t.
- *
- * Sets the clip mask for a graphics context from a region structure.
- * The clip mask is interpreted relative to the clip origin. (See
- * gdk_gc_set_clip_origin()).
- **/
-void
-gdk_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region)
-{
- cairo_region_t *copy;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- _gdk_gc_remove_drawable_clip (gc);
-
- if (region)
- copy = cairo_region_copy (region);
- else
- copy = NULL;
-
- _gdk_gc_set_clip_region_real (gc, copy, TRUE);
-}
-
-/**
- * _gdk_gc_get_clip_region:
- * @gc: a #GdkGC
- *
- * Gets the current clip region for @gc, if any.
- *
- * Return value: the clip region for the GC, or %NULL.
- * (if a clip mask is set, the return will be %NULL)
- * This value is owned by the GC and must not be freed.
- **/
-cairo_region_t *
-_gdk_gc_get_clip_region (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), NULL);
-
- return GDK_GC_GET_PRIVATE (gc)->clip_region;
-}
-
-/**
- * _gdk_gc_get_clip_mask:
- * @gc: a #GdkGC
- *
- * Gets the current clip mask for @gc, if any.
- *
- * Return value: the clip mask for the GC, or %NULL.
- * (if a clip region is set, the return will be %NULL)
- * This value is owned by the GC and must not be freed.
- **/
-GdkBitmap *
-_gdk_gc_get_clip_mask (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), NULL);
-
- return GDK_GC_GET_PRIVATE (gc)->clip_mask;
-}
-
-/**
- * _gdk_gc_get_fill:
- * @gc: a #GdkGC
- *
- * Gets the current file style for the GC
- *
- * Return value: the file style for the GC
- **/
-GdkFill
-_gdk_gc_get_fill (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), GDK_SOLID);
-
- return GDK_GC_GET_PRIVATE (gc)->fill;
-}
-
-gboolean
-_gdk_gc_get_exposures (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), FALSE);
-
- return GDK_GC_GET_PRIVATE (gc)->exposures;
-}
-
-/**
- * _gdk_gc_get_tile:
- * @gc: a #GdkGC
- *
- * Gets the tile pixmap for @gc, if any
- *
- * Return value: the tile set on the GC, or %NULL. The
- * value is owned by the GC and must not be freed.
- **/
-GdkPixmap *
-_gdk_gc_get_tile (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), NULL);
-
- return GDK_GC_GET_PRIVATE (gc)->tile;
-}
-
-/**
- * _gdk_gc_get_stipple:
- * @gc: a #GdkGC
- *
- * Gets the stipple pixmap for @gc, if any
- *
- * Return value: the stipple set on the GC, or %NULL. The
- * value is owned by the GC and must not be freed.
- **/
-GdkBitmap *
-_gdk_gc_get_stipple (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), NULL);
-
- return GDK_GC_GET_PRIVATE (gc)->stipple;
-}
-
-/**
- * _gdk_gc_get_fg_pixel:
- * @gc: a #GdkGC
- *
- * Gets the foreground pixel value for @gc. If the
- * foreground pixel has never been set, returns the
- * default value 0.
- *
- * Return value: the foreground pixel value of the GC
- **/
-guint32
-_gdk_gc_get_fg_pixel (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), 0);
-
- return GDK_GC_GET_PRIVATE (gc)->fg_pixel;
-}
-
-/**
- * _gdk_gc_get_bg_pixel:
- * @gc: a #GdkGC
- *
- * Gets the background pixel value for @gc.If the
- * foreground pixel has never been set, returns the
- * default value 1.
- *
- * Return value: the foreground pixel value of the GC
- **/
-guint32
-_gdk_gc_get_bg_pixel (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), 0);
-
- return GDK_GC_GET_PRIVATE (gc)->bg_pixel;
-}
-
-/**
- * gdk_gc_set_subwindow:
- * @gc: a #GdkGC.
- * @mode: the subwindow mode.
- *
- * Sets how drawing with this GC on a window will affect child
- * windows of that window.
- **/
-void
-gdk_gc_set_subwindow (GdkGC *gc,
- GdkSubwindowMode mode)
-{
- GdkGCValues values;
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- /* This could get called a lot to reset the subwindow mode in
- the client side clipping, so bail out early */
- if (priv->subwindow_mode == mode)
- return;
-
- values.subwindow_mode = mode;
- gdk_gc_set_values (gc, &values, GDK_GC_SUBWINDOW);
-}
-
-GdkSubwindowMode
-_gdk_gc_get_subwindow (GdkGC *gc)
-{
- GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
-
- return priv->subwindow_mode;
-}
-
-/**
- * gdk_gc_set_exposures:
- * @gc: a #GdkGC.
- * @exposures: if %TRUE, exposure events will be generated.
- *
- * Sets whether copying non-visible portions of a drawable
- * using this graphics context generate exposure events
- * for the corresponding regions of the destination
- * drawable.
- **/
-void
-gdk_gc_set_exposures (GdkGC *gc,
- gboolean exposures)
-{
- GdkGCValues values;
-
- g_return_if_fail (GDK_IS_GC (gc));
-
- values.graphics_exposures = exposures;
- gdk_gc_set_values (gc, &values, GDK_GC_EXPOSURES);
-}
-
-/**
- * gdk_gc_set_line_attributes:
- * @gc: a #GdkGC.
- * @line_width: the width of lines.
- * @line_style: the dash-style for lines.
- * @cap_style: the manner in which the ends of lines are drawn.
- * @join_style: the in which lines are joined together.
- *
- * Sets various attributes of how lines are drawn. See
- * the corresponding members of #GdkGCValues for full
- * explanations of the arguments.
- **/
-void
-gdk_gc_set_line_attributes (GdkGC *gc,
- gint line_width,
- GdkLineStyle line_style,
- GdkCapStyle cap_style,
- GdkJoinStyle join_style)
-{
- GdkGCValues values;
-
- values.line_width = line_width;
- values.line_style = line_style;
- values.cap_style = cap_style;
- values.join_style = join_style;
-
- gdk_gc_set_values (gc, &values,
- GDK_GC_LINE_WIDTH |
- GDK_GC_LINE_STYLE |
- GDK_GC_CAP_STYLE |
- GDK_GC_JOIN_STYLE);
-}
-
-/**
- * gdk_gc_set_dashes:
- * @gc: a #GdkGC.
- * @dash_offset: the phase of the dash pattern.
- * @dash_list: an array of dash lengths.
- * @n: the number of elements in @dash_list.
- *
- * Sets the way dashed-lines are drawn. Lines will be
- * drawn with alternating on and off segments of the
- * lengths specified in @dash_list. The manner in
- * which the on and off segments are drawn is determined
- * by the @line_style value of the GC. (This can
- * be changed with gdk_gc_set_line_attributes().)
- *
- * The @dash_offset defines the phase of the pattern,
- * specifying how many pixels into the dash-list the pattern
- * should actually begin.
- **/
-void
-gdk_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n)
-{
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (dash_list != NULL);
-
- GDK_GC_GET_CLASS (gc)->set_dashes (gc, dash_offset, dash_list, n);
-}
-
-/**
- * gdk_gc_offset:
- * @gc: a #GdkGC
- * @x_offset: amount by which to offset the GC in the X direction
- * @y_offset: amount by which to offset the GC in the Y direction
- *
- * Offset attributes such as the clip and tile-stipple origins
- * of the GC so that drawing at x - x_offset, y - y_offset with
- * the offset GC has the same effect as drawing at x, y with the original
- * GC.
- **/
-void
-gdk_gc_offset (GdkGC *gc,
- gint x_offset,
- gint y_offset)
-{
- if (x_offset != 0 || y_offset != 0)
- {
- GdkGCValues values;
-
- values.clip_x_origin = gc->clip_x_origin - x_offset;
- values.clip_y_origin = gc->clip_y_origin - y_offset;
- values.ts_x_origin = gc->ts_x_origin - x_offset;
- values.ts_y_origin = gc->ts_y_origin - y_offset;
-
- gdk_gc_set_values (gc, &values,
- GDK_GC_CLIP_X_ORIGIN |
- GDK_GC_CLIP_Y_ORIGIN |
- GDK_GC_TS_X_ORIGIN |
- GDK_GC_TS_Y_ORIGIN);
- }
-}
-
-/**
- * gdk_gc_copy:
- * @dst_gc: the destination graphics context.
- * @src_gc: the source graphics context.
- *
- * Copy the set of values from one graphics context
- * onto another graphics context.
- **/
-void
-gdk_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc)
-{
- GdkGCPrivate *dst_priv, *src_priv;
-
- g_return_if_fail (GDK_IS_GC (dst_gc));
- g_return_if_fail (GDK_IS_GC (src_gc));
-
- dst_priv = GDK_GC_GET_PRIVATE (dst_gc);
- src_priv = GDK_GC_GET_PRIVATE (src_gc);
-
- _gdk_windowing_gc_copy (dst_gc, src_gc);
-
- dst_gc->clip_x_origin = src_gc->clip_x_origin;
- dst_gc->clip_y_origin = src_gc->clip_y_origin;
- dst_gc->ts_x_origin = src_gc->ts_x_origin;
- dst_gc->ts_y_origin = src_gc->ts_y_origin;
-
- if (src_gc->colormap)
- g_object_ref (src_gc->colormap);
-
- if (dst_gc->colormap)
- g_object_unref (dst_gc->colormap);
-
- dst_gc->colormap = src_gc->colormap;
-
- if (dst_priv->clip_region)
- cairo_region_destroy (dst_priv->clip_region);
-
- if (src_priv->clip_region)
- dst_priv->clip_region = cairo_region_copy (src_priv->clip_region);
- else
- dst_priv->clip_region = NULL;
-
- dst_priv->region_tag_applied = src_priv->region_tag_applied;
-
- if (dst_priv->old_clip_region)
- cairo_region_destroy (dst_priv->old_clip_region);
-
- if (src_priv->old_clip_region)
- dst_priv->old_clip_region = cairo_region_copy (src_priv->old_clip_region);
- else
- dst_priv->old_clip_region = NULL;
-
- if (src_priv->clip_mask)
- dst_priv->clip_mask = g_object_ref (src_priv->clip_mask);
- else
- dst_priv->clip_mask = NULL;
-
- if (src_priv->old_clip_mask)
- dst_priv->old_clip_mask = g_object_ref (src_priv->old_clip_mask);
- else
- dst_priv->old_clip_mask = NULL;
-
- dst_priv->fill = src_priv->fill;
-
- if (dst_priv->stipple)
- g_object_unref (dst_priv->stipple);
- dst_priv->stipple = src_priv->stipple;
- if (dst_priv->stipple)
- g_object_ref (dst_priv->stipple);
-
- if (dst_priv->tile)
- g_object_unref (dst_priv->tile);
- dst_priv->tile = src_priv->tile;
- if (dst_priv->tile)
- g_object_ref (dst_priv->tile);
-
- dst_priv->fg_pixel = src_priv->fg_pixel;
- dst_priv->bg_pixel = src_priv->bg_pixel;
- dst_priv->subwindow_mode = src_priv->subwindow_mode;
- dst_priv->exposures = src_priv->exposures;
-}
-
-/**
- * gdk_gc_set_colormap:
- * @gc: a #GdkGC
- * @colormap: a #GdkColormap
- *
- * Sets the colormap for the GC to the given colormap. The depth
- * of the colormap's visual must match the depth of the drawable
- * for which the GC was created.
- **/
-void
-gdk_gc_set_colormap (GdkGC *gc,
- GdkColormap *colormap)
-{
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (GDK_IS_COLORMAP (colormap));
-
- if (gc->colormap != colormap)
- {
- if (gc->colormap)
- g_object_unref (gc->colormap);
-
- gc->colormap = colormap;
- g_object_ref (gc->colormap);
- }
-
-}
-
-/**
- * gdk_gc_get_colormap:
- * @gc: a #GdkGC
- *
- * Retrieves the colormap for a given GC, if it exists.
- * A GC will have a colormap if the drawable for which it was created
- * has a colormap, or if a colormap was set explicitely with
- * gdk_gc_set_colormap.
- *
- * Return value: the colormap of @gc, or %NULL if @gc doesn't have one.
- **/
-GdkColormap *
-gdk_gc_get_colormap (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC (gc), NULL);
-
- return gc->colormap;
-}
-
-static GdkColormap *
-gdk_gc_get_colormap_warn (GdkGC *gc)
-{
- GdkColormap *colormap = gdk_gc_get_colormap (gc);
- if (!colormap)
- {
- g_warning ("gdk_gc_set_rgb_fg_color() and gdk_gc_set_rgb_bg_color() can\n"
- "only be used on GC's with a colormap. A GC will have a colormap\n"
- "if it is created for a drawable with a colormap, or if a\n"
- "colormap has been set explicitly with gdk_gc_set_colormap.\n");
- return NULL;
- }
-
- return colormap;
-}
-
-/**
- * gdk_gc_set_rgb_fg_color:
- * @gc: a #GdkGC
- * @color: an unallocated #GdkColor.
- *
- * Set the foreground color of a GC using an unallocated color. The
- * pixel value for the color will be determined using GdkRGB. If the
- * colormap for the GC has not previously been initialized for GdkRGB,
- * then for pseudo-color colormaps (colormaps with a small modifiable
- * number of colors), a colorcube will be allocated in the colormap.
- *
- * Calling this function for a GC without a colormap is an error.
- **/
-void
-gdk_gc_set_rgb_fg_color (GdkGC *gc,
- const GdkColor *color)
-{
- GdkColormap *cmap;
- GdkColor tmp_color;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (color != NULL);
-
- cmap = gdk_gc_get_colormap_warn (gc);
- if (!cmap)
- return;
-
- tmp_color = *color;
- if (!gdk_colormap_alloc_color (cmap, &tmp_color, FALSE, TRUE))
- return;
- gdk_gc_set_foreground (gc, &tmp_color);
-}
-
-/**
- * gdk_gc_set_rgb_bg_color:
- * @gc: a #GdkGC
- * @color: an unallocated #GdkColor.
- *
- * Set the background color of a GC using an unallocated color. The
- * pixel value for the color will be determined using GdkRGB. If the
- * colormap for the GC has not previously been initialized for GdkRGB,
- * then for pseudo-color colormaps (colormaps with a small modifiable
- * number of colors), a colorcube will be allocated in the colormap.
- *
- * Calling this function for a GC without a colormap is an error.
- **/
-void
-gdk_gc_set_rgb_bg_color (GdkGC *gc,
- const GdkColor *color)
-{
- GdkColormap *cmap;
- GdkColor tmp_color;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (color != NULL);
-
- cmap = gdk_gc_get_colormap_warn (gc);
- if (!cmap)
- return;
-
- tmp_color = *color;
- if (!gdk_colormap_alloc_color (cmap, &tmp_color, FALSE, TRUE))
- return;
- gdk_gc_set_background (gc, &tmp_color);
-}
-
diff --git a/gdk/gdkgc.h b/gdk/gdkgc.h
deleted file mode 100644
index 93fae220ed..0000000000
--- a/gdk/gdkgc.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
-#error "Only can be included directly."
-#endif
-
-#ifndef __GDK_GC_H__
-#define __GDK_GC_H__
-
-#include
-#include
-
-G_BEGIN_DECLS
-
-typedef struct _GdkGCValues GdkGCValues;
-typedef struct _GdkGCClass GdkGCClass;
-
-/* GC cap styles
- * CapNotLast:
- * CapButt:
- * CapRound:
- * CapProjecting:
- */
-typedef enum
-{
- GDK_CAP_NOT_LAST,
- GDK_CAP_BUTT,
- GDK_CAP_ROUND,
- GDK_CAP_PROJECTING
-} GdkCapStyle;
-
-/* GC fill types.
- * Solid:
- * Tiled:
- * Stippled:
- * OpaqueStippled:
- */
-typedef enum
-{
- GDK_SOLID,
- GDK_TILED,
- GDK_STIPPLED,
- GDK_OPAQUE_STIPPLED
-} GdkFill;
-
-/* GC function types.
- * Copy: Overwrites destination pixels with the source pixels.
- * Invert: Inverts the destination pixels.
- * Xor: Xor's the destination pixels with the source pixels.
- * Clear: set pixels to 0
- * And: source AND destination
- * And Reverse: source AND (NOT destination)
- * And Invert: (NOT source) AND destination
- * Noop: destination
- * Or: source OR destination
- * Nor: (NOT source) AND (NOT destination)
- * Equiv: (NOT source) XOR destination
- * Xor Reverse: source OR (NOT destination)
- * Copy Inverted: NOT source
- * Xor Inverted: (NOT source) OR destination
- * Nand: (NOT source) OR (NOT destination)
- * Set: set pixels to 1
- */
-typedef enum
-{
- GDK_COPY,
- GDK_INVERT,
- GDK_XOR,
- GDK_CLEAR,
- GDK_AND,
- GDK_AND_REVERSE,
- GDK_AND_INVERT,
- GDK_NOOP,
- GDK_OR,
- GDK_EQUIV,
- GDK_OR_REVERSE,
- GDK_COPY_INVERT,
- GDK_OR_INVERT,
- GDK_NAND,
- GDK_NOR,
- GDK_SET
-} GdkFunction;
-
-/* GC join styles
- * JoinMiter:
- * JoinRound:
- * JoinBevel:
- */
-typedef enum
-{
- GDK_JOIN_MITER,
- GDK_JOIN_ROUND,
- GDK_JOIN_BEVEL
-} GdkJoinStyle;
-
-/* GC line styles
- * Solid:
- * OnOffDash:
- * DoubleDash:
- */
-typedef enum
-{
- GDK_LINE_SOLID,
- GDK_LINE_ON_OFF_DASH,
- GDK_LINE_DOUBLE_DASH
-} GdkLineStyle;
-
-typedef enum
-{
- GDK_CLIP_BY_CHILDREN = 0,
- GDK_INCLUDE_INFERIORS = 1
-} GdkSubwindowMode;
-
-typedef enum
-{
- GDK_GC_FOREGROUND = 1 << 0,
- GDK_GC_BACKGROUND = 1 << 1,
- GDK_GC_FUNCTION = 1 << 2,
- GDK_GC_FILL = 1 << 3,
- GDK_GC_TILE = 1 << 4,
- GDK_GC_STIPPLE = 1 << 5,
- GDK_GC_CLIP_MASK = 1 << 6,
- GDK_GC_SUBWINDOW = 1 << 7,
- GDK_GC_TS_X_ORIGIN = 1 << 8,
- GDK_GC_TS_Y_ORIGIN = 1 << 9,
- GDK_GC_CLIP_X_ORIGIN = 1 << 10,
- GDK_GC_CLIP_Y_ORIGIN = 1 << 11,
- GDK_GC_EXPOSURES = 1 << 12,
- GDK_GC_LINE_WIDTH = 1 << 13,
- GDK_GC_LINE_STYLE = 1 << 14,
- GDK_GC_CAP_STYLE = 1 << 15,
- GDK_GC_JOIN_STYLE = 1 << 16
-} GdkGCValuesMask;
-
-struct _GdkGCValues
-{
- GdkColor foreground;
- GdkColor background;
- GdkFunction function;
- GdkFill fill;
- GdkPixmap *tile;
- GdkPixmap *stipple;
- GdkPixmap *clip_mask;
- GdkSubwindowMode subwindow_mode;
- gint ts_x_origin;
- gint ts_y_origin;
- gint clip_x_origin;
- gint clip_y_origin;
- gint graphics_exposures;
- gint line_width;
- GdkLineStyle line_style;
- GdkCapStyle cap_style;
- GdkJoinStyle join_style;
-};
-
-#define GDK_TYPE_GC (gdk_gc_get_type ())
-#define GDK_GC(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC, GdkGC))
-#define GDK_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC, GdkGCClass))
-#define GDK_IS_GC(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC))
-#define GDK_IS_GC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC))
-#define GDK_GC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC, GdkGCClass))
-
-struct _GdkGC
-{
- GObject parent_instance;
-
- gint GSEAL (clip_x_origin);
- gint GSEAL (clip_y_origin);
- gint GSEAL (ts_x_origin);
- gint GSEAL (ts_y_origin);
-
- GdkColormap *GSEAL (colormap);
-};
-
-struct _GdkGCClass
-{
- GObjectClass parent_class;
-
- void (*get_values) (GdkGC *gc,
- GdkGCValues *values);
- void (*set_values) (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask mask);
- void (*set_dashes) (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n);
-
- /* Padding for future expansion */
- void (*_gdk_reserved1) (void);
- void (*_gdk_reserved2) (void);
- void (*_gdk_reserved3) (void);
- void (*_gdk_reserved4) (void);
-};
-
-
-GType gdk_gc_get_type (void) G_GNUC_CONST;
-GdkGC *gdk_gc_new (GdkDrawable *drawable);
-GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-
-void gdk_gc_get_values (GdkGC *gc,
- GdkGCValues *values);
-void gdk_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-void gdk_gc_set_foreground (GdkGC *gc,
- const GdkColor *color);
-void gdk_gc_set_background (GdkGC *gc,
- const GdkColor *color);
-void gdk_gc_set_function (GdkGC *gc,
- GdkFunction function);
-void gdk_gc_set_fill (GdkGC *gc,
- GdkFill fill);
-void gdk_gc_set_tile (GdkGC *gc,
- GdkPixmap *tile);
-void gdk_gc_set_stipple (GdkGC *gc,
- GdkPixmap *stipple);
-void gdk_gc_set_ts_origin (GdkGC *gc,
- gint x,
- gint y);
-void gdk_gc_set_clip_origin (GdkGC *gc,
- gint x,
- gint y);
-void gdk_gc_set_clip_mask (GdkGC *gc,
- GdkBitmap *mask);
-void gdk_gc_set_clip_rectangle (GdkGC *gc,
- const GdkRectangle *rectangle);
-void gdk_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region);
-void gdk_gc_set_subwindow (GdkGC *gc,
- GdkSubwindowMode mode);
-void gdk_gc_set_exposures (GdkGC *gc,
- gboolean exposures);
-void gdk_gc_set_line_attributes (GdkGC *gc,
- gint line_width,
- GdkLineStyle line_style,
- GdkCapStyle cap_style,
- GdkJoinStyle join_style);
-void gdk_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n);
-void gdk_gc_offset (GdkGC *gc,
- gint x_offset,
- gint y_offset);
-void gdk_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc);
-
-
-void gdk_gc_set_colormap (GdkGC *gc,
- GdkColormap *colormap);
-GdkColormap *gdk_gc_get_colormap (GdkGC *gc);
-void gdk_gc_set_rgb_fg_color (GdkGC *gc,
- const GdkColor *color);
-void gdk_gc_set_rgb_bg_color (GdkGC *gc,
- const GdkColor *color);
-GdkScreen * gdk_gc_get_screen (GdkGC *gc);
-
-
-G_END_DECLS
-
-#endif /* __GDK_DRAWABLE_H__ */
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index cfe0fb244a..cc4b66f8c6 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -364,31 +364,6 @@ void _gdk_screen_close (GdkScreen *screen);
const char *_gdk_get_sm_client_id (void);
-void _gdk_gc_init (GdkGC *gc,
- GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-
-cairo_region_t *_gdk_gc_get_clip_region (GdkGC *gc);
-GdkBitmap *_gdk_gc_get_clip_mask (GdkGC *gc);
-gboolean _gdk_gc_get_exposures (GdkGC *gc);
-GdkFill _gdk_gc_get_fill (GdkGC *gc);
-GdkPixmap *_gdk_gc_get_tile (GdkGC *gc);
-GdkBitmap *_gdk_gc_get_stipple (GdkGC *gc);
-guint32 _gdk_gc_get_fg_pixel (GdkGC *gc);
-guint32 _gdk_gc_get_bg_pixel (GdkGC *gc);
-void _gdk_gc_add_drawable_clip (GdkGC *gc,
- guint32 region_tag,
- cairo_region_t *region,
- int offset_x,
- int offset_y);
-void _gdk_gc_remove_drawable_clip (GdkGC *gc);
-void _gdk_gc_set_clip_region_internal (GdkGC *gc,
- cairo_region_t *region,
- gboolean reset_origin);
-GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
-
-
/*****************************************
* Interfaces provided by windowing code *
*****************************************/
@@ -492,45 +467,6 @@ GType _gdk_paintable_get_type (void) G_GNUC_CONST;
GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
-
-/**
- * _gdk_windowing_gc_set_clip_region:
- * @gc: a #GdkGC
- * @region: the new clip region
- * @reset_origin: if TRUE, reset the clip_x/y_origin values to 0
- *
- * Do any window-system specific processing necessary
- * for a change in clip region. Since the clip origin
- * will likely change before the GC is used with the
- * new clip, frequently this function will only set a flag and
- * do the real processing later.
- *
- * When this function is called, _gdk_gc_get_clip_region
- * will already return the new region.
- **/
-void _gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region,
- gboolean reset_origin);
-
-/**
- * _gdk_windowing_gc_copy:
- * @dst_gc: a #GdkGC from the GDK backend
- * @src_gc: a #GdkGC from the GDK backend
- *
- * Copies backend specific state from @src_gc to @dst_gc.
- * This is called before the generic state is copied, so
- * the old generic state is still available from @dst_gc
- **/
-void _gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc);
-
-/* Queries the current foreground color of a GdkGC */
-void _gdk_windowing_gc_get_foreground (GdkGC *gc,
- GdkColor *color);
-/* Queries the current background color of a GdkGC */
-void _gdk_windowing_gc_get_background (GdkGC *gc,
- GdkColor *color);
-
struct GdkAppLaunchContextPrivate
{
GdkDisplay *display;
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index b6148e55b0..257abea4d4 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -34,7 +34,6 @@
#include "gdkdrawable.h"
#include "gdktypes.h"
#include "gdkscreen.h"
-#include "gdkgc.h"
#include "gdkcolor.h"
#include "gdkcursor.h"
@@ -141,16 +140,6 @@ is_parent_of (GdkWindow *parent,
return FALSE;
}
-static GdkGC *
-gdk_offscreen_window_create_gc (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-
- return gdk_gc_new_with_values (offscreen->pixmap, values, values_mask);
-}
-
static cairo_surface_t *
gdk_offscreen_window_ref_cairo_surface (GdkDrawable *drawable)
{
@@ -542,7 +531,6 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
GdkWindowObject *private = (GdkWindowObject *)window;
GdkOffscreenWindow *offscreen;
gint dx, dy, dw, dh;
- GdkGC *gc;
GdkPixmap *old_pixmap;
offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
@@ -899,7 +887,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
object_class->finalize = gdk_offscreen_window_finalize;
- drawable_class->create_gc = gdk_offscreen_window_create_gc;
drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
drawable_class->set_colormap = gdk_offscreen_window_set_colormap;
drawable_class->get_colormap = gdk_offscreen_window_get_colormap;
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index c5e71c4245..67035ad322 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -31,10 +31,6 @@
#include "gdkscreen.h"
-static GdkGC *gdk_pixmap_create_gc (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask mask);
-
static void gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
gint *height);
@@ -91,7 +87,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
object_class->finalize = gdk_pixmap_finalize;
- drawable_class->create_gc = gdk_pixmap_create_gc;
drawable_class->get_depth = gdk_pixmap_real_get_depth;
drawable_class->get_screen = gdk_pixmap_real_get_screen;
drawable_class->get_size = gdk_pixmap_real_get_size;
@@ -160,16 +155,6 @@ gdk_pixmap_create_from_data (GdkDrawable *drawable,
depth, fg,bg);
}
-
-static GdkGC *
-gdk_pixmap_create_gc (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask mask)
-{
- return gdk_gc_new_with_values (((GdkPixmapObject *) drawable)->impl,
- values, mask);
-}
-
static void
gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index b86cecc8ce..8630d7d364 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -102,7 +102,6 @@ typedef guint32 GdkNativeWindow;
typedef struct _GdkColor GdkColor;
typedef struct _GdkColormap GdkColormap;
typedef struct _GdkCursor GdkCursor;
-typedef struct _GdkGC GdkGC;
typedef struct _GdkVisual GdkVisual;
typedef struct _GdkDrawable GdkDrawable;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 73feaa50e9..387ab8cb00 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -175,13 +175,6 @@
* we reuse the pixmap from the implicit paint. During repaint we create and at the
* end flush an implicit paint, which means we can collect all the paints on
* multiple client side windows in the same backing store pixmap.
- *
- * All drawing to windows are wrapped with macros that set up the GC such that
- * the offsets and clip region is right for drawing to the paint object or
- * directly to the emulated window. It also automatically handles any flushing
- * needed when drawing directly to a window. Adding window/paint clipping is
- * done using _gdk_gc_add_drawable_clip which lets us efficiently add and then
- * remove a custom clip region.
*/
#define USE_BACKING_STORE /* Appears to work on Win32, too, now. */
@@ -226,10 +219,6 @@ typedef struct {
/* Global info */
-static GdkGC *gdk_window_create_gc (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask mask);
-
static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable);
static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable,
int width,
@@ -406,7 +395,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
object_class->set_property = gdk_window_set_property;
object_class->get_property = gdk_window_get_property;
- drawable_class->create_gc = gdk_window_create_gc;
drawable_class->get_depth = gdk_window_real_get_depth;
drawable_class->get_screen = gdk_window_real_get_screen;
drawable_class->get_size = gdk_window_real_get_size;
@@ -3608,110 +3596,6 @@ gdk_window_get_internal_paint_info (GdkWindow *window,
*y_offset = y_off;
}
-static GdkDrawable *
-start_draw_helper (GdkDrawable *drawable,
- GdkGC *gc,
- gint *x_offset_out,
- gint *y_offset_out)
-{
- GdkWindowObject *private = (GdkWindowObject *)drawable;
- gint x_offset, y_offset;
- GdkDrawable *impl;
- gint old_clip_x = gc->clip_x_origin;
- gint old_clip_y = gc->clip_y_origin;
- cairo_region_t *clip;
- guint32 clip_region_tag;
- GdkWindowPaint *paint;
-
- paint = NULL;
- if (private->paint_stack)
- paint = private->paint_stack->data;
-
- if (paint)
- {
- x_offset = paint->x_offset;
- y_offset = paint->y_offset;
- }
- else
- {
- x_offset = -private->abs_x;
- y_offset = -private->abs_y;
- }
-
- if (x_offset != 0 || y_offset != 0)
- {
- gdk_gc_set_clip_origin (gc,
- old_clip_x - x_offset,
- old_clip_y - y_offset);
- gdk_gc_set_ts_origin (gc,
- gc->ts_x_origin - x_offset,
- gc->ts_y_origin - y_offset);
- }
-
- *x_offset_out = x_offset;
- *y_offset_out = y_offset;
-
- /* Add client side window clip region to gc */
- clip = NULL;
- if (paint)
- {
- /* Only need clipping if using implicit paint, otherwise
- the pixmap is clipped when copying to the window in end_paint */
- if (paint->uses_implicit)
- {
- /* This includes the window clip */
- clip = paint->region;
- }
- clip_region_tag = paint->region_tag;
-
- /* After having set up the drawable clip rect on a GC we need to make sure
- * that we draw to th the impl, otherwise the pixmap code will reset the
- * drawable clip. */
- impl = ((GdkPixmapObject *)(paint->pixmap))->impl;
- }
- else
- {
- /* Drawing directly to the window, flush anything outstanding to
- guarantee ordering. */
- gdk_window_flush ((GdkWindow *)drawable);
-
- /* Don't clip when drawing to root or all native */
- if (!_gdk_native_windows && private->window_type != GDK_WINDOW_ROOT)
- {
- if (_gdk_gc_get_subwindow (gc) == GDK_CLIP_BY_CHILDREN)
- clip = private->clip_region_with_children;
- else
- clip = private->clip_region;
- }
- clip_region_tag = private->clip_tag;
- impl = private->impl;
- }
-
- if (clip)
- _gdk_gc_add_drawable_clip (gc,
- clip_region_tag, clip,
- /* If there was a clip origin set appart from the
- * window offset, need to take that into
- * consideration */
- -old_clip_x, -old_clip_y);
-
- return impl;
-}
-
-static GdkGC *
-gdk_window_create_gc (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask mask)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (drawable), NULL);
-
- if (GDK_WINDOW_DESTROYED (drawable))
- return NULL;
-
- return gdk_gc_new_with_values (((GdkWindowObject *) drawable)->impl,
- values, mask);
-}
-
static GdkDrawable *
gdk_window_get_source_drawable (GdkDrawable *drawable)
{
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index 2681f6d835..683ea3e9ae 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -32,7 +32,6 @@ libgdk_quartz_la_SOURCES = \
gdkdrawable-quartz.h \
gdkevents-quartz.c \
gdkeventloop-quartz.c \
- gdkgc-quartz.c \
gdkgeometry-quartz.c \
gdkglobals-quartz.c \
gdkim-quartz.c \
diff --git a/gdk/quartz/gdkgc-quartz.c b/gdk/quartz/gdkgc-quartz.c
deleted file mode 100644
index b104d9e2f6..0000000000
--- a/gdk/quartz/gdkgc-quartz.c
+++ /dev/null
@@ -1,686 +0,0 @@
-/* gdkgc-quartz.c
- *
- * Copyright (C) 2005 Imendio AB
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include "gdkgc.h"
-#include "gdkprivate-quartz.h"
-
-static gpointer parent_class = NULL;
-
-static void
-gdk_quartz_gc_get_values (GdkGC *gc,
- GdkGCValues *values)
-{
- GdkGCQuartz *private;
-
- private = GDK_GC_QUARTZ (gc);
-
- values->foreground.pixel = _gdk_gc_get_fg_pixel (gc);
- values->background.pixel = _gdk_gc_get_bg_pixel (gc);
-
- values->function = private->function;
-
- values->fill = _gdk_gc_get_fill (gc);
- values->tile = _gdk_gc_get_tile (gc);
- values->stipple = _gdk_gc_get_stipple (gc);
-
- /* The X11 backend always returns a NULL clip_mask. */
- values->clip_mask = NULL;
-
- values->ts_x_origin = gc->ts_x_origin;
- values->ts_y_origin = gc->ts_y_origin;
- values->clip_x_origin = gc->clip_x_origin;
- values->clip_y_origin = gc->clip_y_origin;
-
- values->graphics_exposures = private->graphics_exposures;
-
- values->line_width = private->line_width;
- values->line_style = private->line_style;
- values->cap_style = private->cap_style;
- values->join_style = private->join_style;
-}
-
-
-static void
-data_provider_release (void *info, const void *data, size_t size)
-{
- g_free (info);
-}
-
-static CGImageRef
-create_clip_mask (GdkPixmap *source_pixmap)
-{
- int width, height, bytes_per_row, bits_per_pixel;
- void *data;
- CGImageRef source;
- CGImageRef clip_mask;
- CGContextRef cg_context;
- CGDataProviderRef data_provider;
-
- /* We need to flip the clip mask here, because this cannot be done during
- * the drawing process when this mask will be used to do clipping. We
- * quickly create a new CGImage, set up a CGContext, draw the source
- * image while flipping, and done. If this appears too slow in the
- * future, we would look into doing this by hand on the actual raw
- * data.
- */
- source = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (source_pixmap)->impl)->image;
-
- width = CGImageGetWidth (source);
- height = CGImageGetHeight (source);
- bytes_per_row = CGImageGetBytesPerRow (source);
- bits_per_pixel = CGImageGetBitsPerPixel (source);
-
- data = g_malloc (height * bytes_per_row);
- data_provider = CGDataProviderCreateWithData (data, data,
- height * bytes_per_row,
- data_provider_release);
-
- clip_mask = CGImageCreate (width, height, 8,
- bits_per_pixel,
- bytes_per_row,
- CGImageGetColorSpace (source),
- CGImageGetAlphaInfo (source),
- data_provider, NULL, FALSE,
- kCGRenderingIntentDefault);
- CGDataProviderRelease (data_provider);
-
- cg_context = CGBitmapContextCreate (data,
- width, height,
- CGImageGetBitsPerComponent (source),
- bytes_per_row,
- CGImageGetColorSpace (source),
- CGImageGetBitmapInfo (source));
-
- CGContextTranslateCTM (cg_context, 0, height);
- CGContextScaleCTM (cg_context, 1.0, -1.0);
-
- CGContextDrawImage (cg_context,
- CGRectMake (0, 0, width, height), source);
-
- CGContextRelease (cg_context);
-
- return clip_mask;
-}
-
-static void
-gdk_quartz_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask mask)
-{
- GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
-
- if (mask & GDK_GC_FUNCTION)
- private->function = values->function;
-
- if (mask & GDK_GC_SUBWINDOW)
- private->subwindow_mode = values->subwindow_mode;
-
- if (mask & GDK_GC_EXPOSURES)
- private->graphics_exposures = values->graphics_exposures;
-
- if (mask & GDK_GC_CLIP_MASK)
- {
- private->have_clip_region = FALSE;
- private->have_clip_mask = values->clip_mask != NULL;
- if (private->clip_mask)
- CGImageRelease (private->clip_mask);
-
- if (values->clip_mask)
- private->clip_mask = create_clip_mask (values->clip_mask);
- else
- private->clip_mask = NULL;
- }
-
- if (mask & GDK_GC_LINE_WIDTH)
- private->line_width = values->line_width;
-
- if (mask & GDK_GC_LINE_STYLE)
- private->line_style = values->line_style;
-
- if (mask & GDK_GC_CAP_STYLE)
- private->cap_style = values->cap_style;
-
- if (mask & GDK_GC_JOIN_STYLE)
- private->join_style = values->join_style;
-}
-
-static void
-gdk_quartz_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n)
-{
- GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
- gint i;
-
- private->dash_count = n;
- g_free (private->dash_lengths);
- private->dash_lengths = g_new (CGFloat, n);
- for (i = 0; i < n; i++)
- private->dash_lengths[i] = (CGFloat) dash_list[i];
- private->dash_phase = (CGFloat) dash_offset;
-}
-
-static void
-gdk_gc_quartz_finalize (GObject *object)
-{
- GdkGCQuartz *private = GDK_GC_QUARTZ (object);
-
- if (private->clip_mask)
- CGImageRelease (private->clip_mask);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gdk_gc_quartz_class_init (GdkGCQuartzClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkGCClass *gc_class = GDK_GC_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = gdk_gc_quartz_finalize;
-
- gc_class->get_values = gdk_quartz_gc_get_values;
- gc_class->set_values = gdk_quartz_gc_set_values;
- gc_class->set_dashes = gdk_quartz_gc_set_dashes;
-}
-
-static void
-gdk_gc_quartz_init (GdkGCQuartz *gc_quartz)
-{
- gc_quartz->function = GDK_COPY;
- gc_quartz->subwindow_mode = GDK_CLIP_BY_CHILDREN;
- gc_quartz->graphics_exposures = TRUE;
- gc_quartz->line_width = 0;
- gc_quartz->line_style = GDK_LINE_SOLID;
- gc_quartz->cap_style = GDK_CAP_BUTT;
- gc_quartz->join_style = GDK_JOIN_MITER;
-}
-
-GType
-_gdk_gc_quartz_get_type (void)
-{
- static GType object_type = 0;
-
- if (!object_type)
- {
- const GTypeInfo object_info =
- {
- sizeof (GdkGCQuartzClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_gc_quartz_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GdkGCQuartz),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gdk_gc_quartz_init,
- };
-
- object_type = g_type_register_static (GDK_TYPE_GC,
- "GdkGCQuartz",
- &object_info, 0);
- }
-
- return object_type;
-}
-
-GdkGC *
-_gdk_quartz_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGC *gc;
-
- gc = g_object_new (GDK_TYPE_GC_QUARTZ, NULL);
-
- _gdk_gc_init (gc, drawable, values, values_mask);
-
- gdk_quartz_gc_set_values (gc, values, values_mask);
-
- return gc;
-}
-
-void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region,
- gboolean reset_origin)
-{
- GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
-
- if ((private->have_clip_region && ! region) || private->have_clip_mask)
- {
- if (private->clip_mask)
- {
- CGImageRelease (private->clip_mask);
- private->clip_mask = NULL;
- }
- private->have_clip_mask = FALSE;
- }
-
- private->have_clip_region = region != NULL;
-
- if (reset_origin)
- {
- gc->clip_x_origin = 0;
- gc->clip_y_origin = 0;
- }
-}
-
-void
-_gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc)
-{
- GdkGCQuartz *dst_quartz_gc = GDK_GC_QUARTZ (dst_gc);
- GdkGCQuartz *src_quartz_gc = GDK_GC_QUARTZ (src_gc);
-
- dst_quartz_gc->function = src_quartz_gc->function;
- dst_quartz_gc->subwindow_mode = src_quartz_gc->subwindow_mode;
- dst_quartz_gc->graphics_exposures = src_quartz_gc->graphics_exposures;
-
- dst_quartz_gc->have_clip_region = src_quartz_gc->have_clip_region;
- dst_quartz_gc->have_clip_mask = src_quartz_gc->have_clip_mask;
-
- if (dst_quartz_gc->clip_mask)
- {
- CGImageRelease (dst_quartz_gc->clip_mask);
- dst_quartz_gc->clip_mask = NULL;
- }
-
- if (src_quartz_gc->clip_mask)
- dst_quartz_gc->clip_mask =
- CGImageCreateCopy (GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (src_quartz_gc->clip_mask)->impl)->image);
-
- dst_quartz_gc->line_width = src_quartz_gc->line_width;
- dst_quartz_gc->line_style = src_quartz_gc->line_style;
- dst_quartz_gc->cap_style = src_quartz_gc->cap_style;
- dst_quartz_gc->join_style = src_quartz_gc->join_style;
-
- g_free (dst_quartz_gc->dash_lengths);
- dst_quartz_gc->dash_lengths = g_memdup (src_quartz_gc->dash_lengths,
- sizeof (CGFloat) * src_quartz_gc->dash_count);
- dst_quartz_gc->dash_count = src_quartz_gc->dash_count;
- dst_quartz_gc->dash_phase = src_quartz_gc->dash_phase;
-}
-
-GdkScreen *
-gdk_gc_get_screen (GdkGC *gc)
-{
- return _gdk_screen;
-}
-
-struct PatternCallbackInfo
-{
- GdkGCQuartz *private_gc;
- GdkDrawable *drawable;
-};
-
-static void
-pattern_callback_info_release (void *info)
-{
- g_free (info);
-}
-
-static void
-gdk_quartz_draw_tiled_pattern (void *info,
- CGContextRef context)
-{
- struct PatternCallbackInfo *pinfo = info;
- GdkGC *gc = GDK_GC (pinfo->private_gc);
- CGImageRef pattern_image;
- size_t width, height;
-
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_tile (gc))->impl)->image;
-
- width = CGImageGetWidth (pattern_image);
- height = CGImageGetHeight (pattern_image);
-
- CGContextDrawImage (context,
- CGRectMake (0, 0, width, height),
- pattern_image);
-}
-
-static void
-gdk_quartz_draw_stippled_pattern (void *info,
- CGContextRef context)
-{
- struct PatternCallbackInfo *pinfo = info;
- GdkGC *gc = GDK_GC (pinfo->private_gc);
- CGImageRef pattern_image;
- CGRect rect;
- CGColorRef color;
-
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
- rect = CGRectMake (0, 0,
- CGImageGetWidth (pattern_image),
- CGImageGetHeight (pattern_image));
-
- CGContextClipToMask (context, rect, pattern_image);
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (pinfo->drawable,
- _gdk_gc_get_fg_pixel (gc));
- CGContextSetFillColorWithColor (context, color);
- CGColorRelease (color);
-
- CGContextFillRect (context, rect);
-}
-
-static void
-gdk_quartz_draw_opaque_stippled_pattern (void *info,
- CGContextRef context)
-{
- struct PatternCallbackInfo *pinfo = info;
- GdkGC *gc = GDK_GC (pinfo->private_gc);
- CGImageRef pattern_image;
- CGRect rect;
- CGColorRef color;
-
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
- rect = CGRectMake (0, 0,
- CGImageGetWidth (pattern_image),
- CGImageGetHeight (pattern_image));
-
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (pinfo->drawable,
- _gdk_gc_get_bg_pixel (gc));
- CGContextSetFillColorWithColor (context, color);
- CGColorRelease (color);
-
- CGContextFillRect (context, rect);
-
- CGContextClipToMask (context, rect, pattern_image);
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (info,
- _gdk_gc_get_fg_pixel (gc));
- CGContextSetFillColorWithColor (context, color);
- CGColorRelease (color);
-
- CGContextFillRect (context, rect);
-}
-
-void
-_gdk_quartz_gc_update_cg_context (GdkGC *gc,
- GdkDrawable *drawable,
- CGContextRef context,
- GdkQuartzContextValuesMask mask)
-{
- GdkGCQuartz *private;
- guint32 fg_pixel;
- guint32 bg_pixel;
-
- g_return_if_fail (gc == NULL || GDK_IS_GC (gc));
-
- if (!gc)
- return;
-
- private = GDK_GC_QUARTZ (gc);
-
- if (private->have_clip_region)
- {
- CGRect rect;
- CGRect *cg_rects;
- cairo_region_t *region;
- gint n_rects, i;
-
- region = _gdk_gc_get_clip_region (gc);
- n_rects = cairo_region_num_rectangles (region);
-
- if (n_rects == 1)
- cg_rects = ▭
- else
- cg_rects = g_new (CGRect, n_rects);
-
- for (i = 0; i < n_rects; i++)
- {
- cairo_rectangle_int_t cairo_rect;
- cairo_region_get_rectangle (region, i, &cairo_rect);
- cg_rects[i].origin.x = cairo_rect.x + gc->clip_x_origin;
- cg_rects[i].origin.y = cairo_rect.y + gc->clip_y_origin;
- cg_rects[i].size.width = cairo_rect.width;
- cg_rects[i].size.height = cairo_rect.height;
- }
-
- CGContextClipToRects (context, cg_rects, n_rects);
-
- if (cg_rects != &rect)
- g_free (cg_rects);
- }
- else if (private->have_clip_mask && private->clip_mask)
- {
- /* Note: This is 10.4 only. For lower versions, we need to transform the
- * mask into a region.
- */
- CGContextClipToMask (context,
- CGRectMake (gc->clip_x_origin, gc->clip_y_origin,
- CGImageGetWidth (private->clip_mask),
- CGImageGetHeight (private->clip_mask)),
- private->clip_mask);
- }
-
- fg_pixel = _gdk_gc_get_fg_pixel (gc);
- bg_pixel = _gdk_gc_get_bg_pixel (gc);
-
- {
- CGBlendMode blend_mode = kCGBlendModeNormal;
-
- switch (private->function)
- {
- case GDK_COPY:
- blend_mode = kCGBlendModeNormal;
- break;
-
- case GDK_INVERT:
- case GDK_XOR:
- blend_mode = kCGBlendModeExclusion;
- fg_pixel = 0xffffffff;
- bg_pixel = 0xffffffff;
- break;
-
- case GDK_CLEAR:
- case GDK_AND:
- case GDK_AND_REVERSE:
- case GDK_AND_INVERT:
- case GDK_NOOP:
- case GDK_OR:
- case GDK_EQUIV:
- case GDK_OR_REVERSE:
- case GDK_COPY_INVERT:
- case GDK_OR_INVERT:
- case GDK_NAND:
- case GDK_NOR:
- case GDK_SET:
- blend_mode = kCGBlendModeNormal; /* FIXME */
- break;
- }
-
- CGContextSetBlendMode (context, blend_mode);
- }
-
- /* FIXME: implement subwindow mode */
-
- /* FIXME: implement graphics exposures */
-
- if (mask & GDK_QUARTZ_CONTEXT_STROKE)
- {
- CGLineCap line_cap = kCGLineCapButt;
- CGLineJoin line_join = kCGLineJoinMiter;
- CGColorRef color;
-
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (drawable,
- fg_pixel);
- CGContextSetStrokeColorWithColor (context, color);
- CGColorRelease (color);
-
- CGContextSetLineWidth (context, MAX (G_MINFLOAT, private->line_width));
-
- switch (private->line_style)
- {
- case GDK_LINE_SOLID:
- CGContextSetLineDash (context, 0.0, NULL, 0);
- break;
-
- case GDK_LINE_DOUBLE_DASH:
- /* FIXME: Implement; for now, fall back to GDK_LINE_ON_OFF_DASH */
-
- case GDK_LINE_ON_OFF_DASH:
- CGContextSetLineDash (context, private->dash_phase,
- private->dash_lengths, private->dash_count);
- break;
- }
-
- switch (private->cap_style)
- {
- case GDK_CAP_NOT_LAST:
- /* FIXME: Implement; for now, fall back to GDK_CAP_BUTT */
- case GDK_CAP_BUTT:
- line_cap = kCGLineCapButt;
- break;
- case GDK_CAP_ROUND:
- line_cap = kCGLineCapRound;
- break;
- case GDK_CAP_PROJECTING:
- line_cap = kCGLineCapSquare;
- break;
- }
-
- CGContextSetLineCap (context, line_cap);
-
- switch (private->join_style)
- {
- case GDK_JOIN_MITER:
- line_join = kCGLineJoinMiter;
- break;
- case GDK_JOIN_ROUND:
- line_join = kCGLineJoinRound;
- break;
- case GDK_JOIN_BEVEL:
- line_join = kCGLineJoinBevel;
- break;
- }
-
- CGContextSetLineJoin (context, line_join);
- }
-
- if (mask & GDK_QUARTZ_CONTEXT_FILL)
- {
- GdkFill fill = _gdk_gc_get_fill (gc);
- CGColorSpaceRef baseSpace;
- CGColorSpaceRef patternSpace;
- CGFloat alpha = 1.0;
-
- if (fill == GDK_SOLID)
- {
- CGColorRef color;
-
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (drawable,
- fg_pixel);
- CGContextSetFillColorWithColor (context, color);
- CGColorRelease (color);
- }
- else
- {
- if (!private->ts_pattern)
- {
- CGImageRef pattern_image = NULL;
- gfloat width, height;
- gboolean is_colored = FALSE;
- CGPatternCallbacks callbacks = { 0, NULL, NULL };
- struct PatternCallbackInfo *info;
- CGPoint phase;
-
- info = g_new (struct PatternCallbackInfo, 1);
- /* Won't ref to avoid circular dependencies */
- info->drawable = drawable;
- info->private_gc = private;
-
- callbacks.releaseInfo = pattern_callback_info_release;
-
- switch (fill)
- {
- case GDK_TILED:
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_tile (gc))->impl)->image;
- is_colored = TRUE;
- callbacks.drawPattern = gdk_quartz_draw_tiled_pattern;
- break;
- case GDK_STIPPLED:
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
- is_colored = FALSE;
- callbacks.drawPattern = gdk_quartz_draw_stippled_pattern;
- break;
- case GDK_OPAQUE_STIPPLED:
- pattern_image = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (_gdk_gc_get_stipple (gc))->impl)->image;
- is_colored = TRUE;
- callbacks.drawPattern = gdk_quartz_draw_opaque_stippled_pattern;
- break;
- default:
- break;
- }
-
- width = CGImageGetWidth (pattern_image);
- height = CGImageGetHeight (pattern_image);
-
- phase = CGPointApplyAffineTransform (CGPointMake (gc->ts_x_origin, gc->ts_y_origin), CGContextGetCTM (context));
- CGContextSetPatternPhase (context, CGSizeMake (phase.x, phase.y));
-
- private->ts_pattern = CGPatternCreate (info,
- CGRectMake (0, 0, width, height),
- CGAffineTransformIdentity,
- width, height,
- kCGPatternTilingConstantSpacing,
- is_colored,
- &callbacks);
- }
-
- baseSpace = (fill == GDK_STIPPLED) ? CGColorSpaceCreateWithName (kCGColorSpaceGenericRGB) : NULL;
- patternSpace = CGColorSpaceCreatePattern (baseSpace);
-
- CGContextSetFillColorSpace (context, patternSpace);
- CGColorSpaceRelease (patternSpace);
- CGColorSpaceRelease (baseSpace);
-
- if (fill == GDK_STIPPLED)
- {
- CGColorRef color;
- const CGFloat *components;
-
- color = _gdk_quartz_colormap_get_cgcolor_from_pixel (drawable,
- fg_pixel);
- components = CGColorGetComponents (color);
-
- CGContextSetFillPattern (context, private->ts_pattern,
- components);
- CGColorRelease (color);
- }
- else
- CGContextSetFillPattern (context, private->ts_pattern, &alpha);
- }
- }
-
- if (mask & GDK_QUARTZ_CONTEXT_TEXT)
- {
- /* FIXME: implement text */
- }
-
- if (GDK_IS_WINDOW_IMPL_QUARTZ (drawable))
- private->is_window = TRUE;
- else
- private->is_window = FALSE;
-}
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 89e2e0c872..fbf75c2435 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -35,51 +35,11 @@
#include "config.h"
-#define GDK_TYPE_GC_QUARTZ (_gdk_gc_quartz_get_type ())
-#define GDK_GC_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_QUARTZ, GdkGCQuartz))
-#define GDK_GC_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_QUARTZ, GdkGCQuartzClass))
-#define GDK_IS_GC_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_QUARTZ))
-#define GDK_IS_GC_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_QUARTZ))
-#define GDK_GC_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_QUARTZ, GdkGCQuartzClass))
-
#define GDK_DRAG_CONTEXT_PRIVATE(context) ((GdkDragContextPrivate *) GDK_DRAG_CONTEXT (context)->windowing_data)
typedef struct _GdkCursorPrivate GdkCursorPrivate;
-typedef struct _GdkGCQuartz GdkGCQuartz;
-typedef struct _GdkGCQuartzClass GdkGCQuartzClass;
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
-struct _GdkGCQuartz
-{
- GdkGC parent_instance;
-
- GdkFunction function;
- GdkSubwindowMode subwindow_mode;
- gboolean graphics_exposures;
-
- gboolean have_clip_region;
- gboolean have_clip_mask;
- CGImageRef clip_mask;
-
- gint line_width;
- GdkLineStyle line_style;
- GdkCapStyle cap_style;
- GdkJoinStyle join_style;
-
- CGFloat *dash_lengths;
- gint dash_count;
- CGFloat dash_phase;
-
- CGPatternRef ts_pattern;
-
- guint is_window : 1;
-};
-
-struct _GdkGCQuartzClass
-{
- GdkGCClass parent_class;
-};
-
struct _GdkVisualClass
{
GObjectClass parent_class;
@@ -120,15 +80,6 @@ typedef enum {
GDK_QUARTZ_CONTEXT_TEXT = 1 << 2
} GdkQuartzContextValuesMask;
-GType _gdk_gc_quartz_get_type (void);
-GdkGC *_gdk_quartz_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-void _gdk_quartz_gc_update_cg_context (GdkGC *gc,
- GdkDrawable *drawable,
- CGContextRef context,
- GdkQuartzContextValuesMask mask);
-
/* Colormap */
CGColorRef _gdk_quartz_colormap_get_cgcolor_from_pixel (GdkDrawable *drawable,
guint32 pixel);
diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am
index c6b0f9a08c..889791a725 100644
--- a/gdk/win32/Makefile.am
+++ b/gdk/win32/Makefile.am
@@ -40,7 +40,6 @@ libgdk_win32_la_SOURCES = \
gdkdrawable-win32.c \
gdkdrawable-win32.h \
gdkevents-win32.c \
- gdkgc-win32.c \
gdkgeometry-win32.c \
gdkglobals-win32.c \
gdkim-win32.c \
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index eb126bbb8d..17ccd615a6 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -317,93 +317,6 @@ render_line_vertical (GdkGCWin32 *gcwin32,
return TRUE;
}
-static void
-draw_tiles_lowlevel (HDC dest,
- HDC tile,
- int rop3,
- gint dest_x,
- gint dest_y,
- gint tile_x_origin,
- gint tile_y_origin,
- gint width,
- gint height,
- gint tile_width,
- gint tile_height)
-{
- gint x, y;
-
- GDK_NOTE (DRAW, g_print ("draw_tiles_lowlevel: %p %+d%+d tile=%p:%dx%d@%+d%+d %dx%d\n",
- dest,
- dest_x, dest_y,
- tile, tile_width, tile_height,
- tile_x_origin, tile_y_origin,
- width, height));
-
- y = tile_y_origin % tile_height;
- if (y > 0)
- y -= tile_height;
- while (y < dest_y + height)
- {
- if (y + tile_height >= dest_y)
- {
- x = tile_x_origin % tile_width;
- if (x > 0)
- x -= tile_width;
- while (x < dest_x + width)
- {
- if (x + tile_width >= dest_x)
- {
- gint src_x = MAX (0, dest_x - x);
- gint src_y = MAX (0, dest_y - y);
-
- if (!GDI_CALL (BitBlt, (dest, x + src_x, y + src_y,
- MIN (tile_width, dest_x + width - (x + src_x)),
- MIN (tile_height, dest_y + height - (y + src_y)),
- tile,
- src_x, src_y,
- rop3)))
- return;
- }
- x += tile_width;
- }
- }
- y += tile_height;
- }
-}
-
-static void
-draw_tiles (GdkDrawable *drawable,
- GdkGC *gc,
- int rop3,
- GdkPixmap *tile,
- gint dest_x,
- gint dest_y,
- gint tile_x_origin,
- gint tile_y_origin,
- gint width,
- gint height)
-{
- const GdkGCValuesMask mask = GDK_GC_FOREGROUND;
- gint tile_width, tile_height;
- GdkGC *gc_copy;
- HDC dest_hdc, tile_hdc;
-
- gc_copy = gdk_gc_new (tile);
- gdk_gc_copy (gc_copy, gc);
- dest_hdc = gdk_win32_hdc_get (drawable, gc, mask);
- tile_hdc = gdk_win32_hdc_get (tile, gc_copy, mask);
-
- gdk_drawable_get_size (tile, &tile_width, &tile_height);
-
- draw_tiles_lowlevel (dest_hdc, tile_hdc, rop3,
- dest_x, dest_y, tile_x_origin, tile_y_origin,
- width, height, tile_width, tile_height);
-
- gdk_win32_hdc_release (drawable, gc, mask);
- gdk_win32_hdc_release (tile, gc_copy, mask);
- g_object_unref (gc_copy);
-}
-
static cairo_region_t *
widen_bounds (GdkRectangle *bounds,
gint pen_width)
diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c
deleted file mode 100644
index 578cd5d274..0000000000
--- a/gdk/win32/gdkgc-win32.c
+++ /dev/null
@@ -1,1102 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * Copyright (C) 1998-2004 Tor Lillqvist
- * Copyright (C) 2000-2004 Hans Breuer
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#define LINE_ATTRIBUTES (GDK_GC_LINE_WIDTH|GDK_GC_LINE_STYLE| \
- GDK_GC_CAP_STYLE|GDK_GC_JOIN_STYLE)
-
-#include "config.h"
-#include
-
-#include "gdkgc.h"
-#include "gdkpixmap.h"
-#include "gdkprivate-win32.h"
-
-static void gdk_win32_gc_get_values (GdkGC *gc,
- GdkGCValues *values);
-static void gdk_win32_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-static void gdk_win32_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n);
-
-static void gdk_gc_win32_class_init (GdkGCWin32Class *klass);
-static void gdk_gc_win32_finalize (GObject *object);
-
-static gpointer parent_class = NULL;
-
-GType
-_gdk_gc_win32_get_type (void)
-{
- static GType object_type = 0;
-
- if (!object_type)
- {
- const GTypeInfo object_info =
- {
- sizeof (GdkGCWin32Class),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) gdk_gc_win32_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GdkGCWin32),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL,
- };
-
- object_type = g_type_register_static (GDK_TYPE_GC,
- "GdkGCWin32",
- &object_info, 0);
- }
-
- return object_type;
-}
-
-static void
-gdk_gc_win32_class_init (GdkGCWin32Class *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkGCClass *gc_class = GDK_GC_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = gdk_gc_win32_finalize;
-
- gc_class->get_values = gdk_win32_gc_get_values;
- gc_class->set_values = gdk_win32_gc_set_values;
- gc_class->set_dashes = gdk_win32_gc_set_dashes;
-}
-
-static void
-gdk_gc_win32_finalize (GObject *object)
-{
- GdkGCWin32 *win32_gc = GDK_GC_WIN32 (object);
-
- if (win32_gc->hcliprgn != NULL)
- DeleteObject (win32_gc->hcliprgn);
-
- g_free (win32_gc->pen_dashes);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-fixup_pen (GdkGCWin32 *win32_gc)
-{
- win32_gc->pen_style = 0;
-
- /* First look at GDK width and end cap style, set GDI pen type and
- * end cap.
- */
- if (win32_gc->pen_width == 0 &&
- win32_gc->cap_style == GDK_CAP_NOT_LAST)
- {
- /* Use a cosmetic pen, always width 1 */
- win32_gc->pen_style |= PS_COSMETIC;
- }
- else if (win32_gc->pen_width <= 1 &&
- win32_gc->cap_style == GDK_CAP_BUTT)
- {
- /* For 1 pixel wide lines PS_ENDCAP_ROUND means draw both ends,
- * even for one pixel length lines. But if we are drawing dashed
- * lines we can't use PS_ENDCAP_ROUND.
- */
- if (win32_gc->line_style == GDK_LINE_SOLID)
- win32_gc->pen_style |= PS_GEOMETRIC | PS_ENDCAP_ROUND;
- else
- win32_gc->pen_style |= PS_GEOMETRIC | PS_ENDCAP_FLAT;
- }
- else
- {
- win32_gc->pen_style |= PS_GEOMETRIC;
- switch (win32_gc->cap_style)
- {
- /* For non-zero-width lines X11's CapNotLast works like CapButt */
- case GDK_CAP_NOT_LAST:
- case GDK_CAP_BUTT:
- win32_gc->pen_style |= PS_ENDCAP_FLAT;
- break;
- case GDK_CAP_ROUND:
- win32_gc->pen_style |= PS_ENDCAP_ROUND;
- break;
- case GDK_CAP_PROJECTING:
- win32_gc->pen_style |= PS_ENDCAP_SQUARE;
- break;
- }
- }
-
- /* Next look at GDK line style, set GDI pen style attribute */
- switch (win32_gc->line_style)
- {
- case GDK_LINE_SOLID:
- win32_gc->pen_style |= PS_SOLID;
- break;
- case GDK_LINE_ON_OFF_DASH:
- case GDK_LINE_DOUBLE_DASH:
- if (win32_gc->pen_dashes == NULL)
- {
- win32_gc->pen_dashes = g_new (DWORD, 1);
- win32_gc->pen_dashes[0] = 4;
- win32_gc->pen_num_dashes = 1;
- }
-
- if (!(win32_gc->pen_style & PS_TYPE_MASK) == PS_GEOMETRIC &&
- win32_gc->pen_dashes[0] == 1 &&
- (win32_gc->pen_num_dashes == 1 ||
- (win32_gc->pen_num_dashes == 2 && win32_gc->pen_dashes[0] == 1)))
- win32_gc->pen_style |= PS_ALTERNATE;
- else
- win32_gc->pen_style |= PS_USERSTYLE;
- break;
- }
-
- /* Last, for if the GDI pen is geometric, set the join attribute */
- if ((win32_gc->pen_style & PS_TYPE_MASK) == PS_GEOMETRIC)
- {
- switch (win32_gc->join_style)
- {
- case GDK_JOIN_MITER:
- win32_gc->pen_style |= PS_JOIN_MITER;
- break;
- case GDK_JOIN_ROUND:
- win32_gc->pen_style |= PS_JOIN_ROUND;
- break;
- case GDK_JOIN_BEVEL:
- win32_gc->pen_style |= PS_JOIN_BEVEL;
- break;
- }
- }
-}
-
-static void
-gdk_win32_gc_values_to_win32values (GdkGCValues *values,
- GdkGCValuesMask mask,
- GdkGCWin32 *win32_gc)
-{
- char *s = "";
-
- GDK_NOTE (GC, g_print ("{"));
-
- if (mask & GDK_GC_FOREGROUND)
- {
- win32_gc->values_mask |= GDK_GC_FOREGROUND;
- GDK_NOTE (GC, (g_print ("fg=%.06x",
- _gdk_gc_get_fg_pixel (&win32_gc->parent_instance)),
- s = ","));
- }
-
- if (mask & GDK_GC_BACKGROUND)
- {
- win32_gc->values_mask |= GDK_GC_BACKGROUND;
- GDK_NOTE (GC, (g_print ("%sbg=%.06x", s,
- _gdk_gc_get_bg_pixel (&win32_gc->parent_instance)),
- s = ","));
- }
-
- if (mask & GDK_GC_FUNCTION)
- {
- GDK_NOTE (GC, (g_print ("%srop2=", s),
- s = ","));
- switch (values->function)
- {
-#define CASE(x,y) case GDK_##x: win32_gc->rop2 = R2_##y; GDK_NOTE (GC, g_print (#y)); break
- CASE (COPY, COPYPEN);
- CASE (INVERT, NOT);
- CASE (XOR, XORPEN);
- CASE (CLEAR, BLACK);
- CASE (AND, MASKPEN);
- CASE (AND_REVERSE, MASKPENNOT);
- CASE (AND_INVERT, MASKNOTPEN);
- CASE (NOOP, NOP);
- CASE (OR, MERGEPEN);
- CASE (EQUIV, NOTXORPEN);
- CASE (OR_REVERSE, MERGEPENNOT);
- CASE (COPY_INVERT, NOTCOPYPEN);
- CASE (OR_INVERT, MERGENOTPEN);
- CASE (NAND, NOTMASKPEN);
- CASE (NOR, NOTMERGEPEN);
- CASE (SET, WHITE);
-#undef CASE
- }
- win32_gc->values_mask |= GDK_GC_FUNCTION;
- }
-
- if (mask & GDK_GC_FILL)
- {
- win32_gc->values_mask |= GDK_GC_FILL;
- GDK_NOTE (GC, (g_print ("%sfill=%s", s,
- _gdk_win32_fill_style_to_string (values->fill)),
- s = ","));
- }
-
- if (mask & GDK_GC_TILE)
- {
- if (values->tile != NULL)
- {
- win32_gc->values_mask |= GDK_GC_TILE;
- GDK_NOTE (GC,
- (g_print ("%stile=%p", s,
- GDK_PIXMAP_HBITMAP (values->tile)),
- s = ","));
- }
- else
- {
- win32_gc->values_mask &= ~GDK_GC_TILE;
- GDK_NOTE (GC, (g_print ("%stile=NULL", s),
- s = ","));
- }
- }
-
- if (mask & GDK_GC_STIPPLE)
- {
- if (values->stipple != NULL)
- {
- win32_gc->values_mask |= GDK_GC_STIPPLE;
- GDK_NOTE (GC,
- (g_print ("%sstipple=%p", s,
- GDK_PIXMAP_HBITMAP (values->stipple)),
- s = ","));
- }
- else
- {
- win32_gc->values_mask &= ~GDK_GC_STIPPLE;
- GDK_NOTE (GC, (g_print ("%sstipple=NULL", s),
- s = ","));
- }
- }
-
- if (mask & GDK_GC_CLIP_MASK)
- {
- if (win32_gc->hcliprgn != NULL)
- DeleteObject (win32_gc->hcliprgn);
-
- if (values->clip_mask != NULL)
- {
- win32_gc->hcliprgn = _gdk_win32_bitmap_to_hrgn (values->clip_mask);
- win32_gc->values_mask |= GDK_GC_CLIP_MASK;
- }
- else
- {
- win32_gc->hcliprgn = NULL;
- win32_gc->values_mask &= ~GDK_GC_CLIP_MASK;
- }
- GDK_NOTE (GC, (g_print ("%sclip=%p", s, win32_gc->hcliprgn),
- s = ","));
- }
-
- if (mask & GDK_GC_SUBWINDOW)
- {
- win32_gc->subwindow_mode = values->subwindow_mode;
- win32_gc->values_mask |= GDK_GC_SUBWINDOW;
- GDK_NOTE (GC, (g_print ("%ssubw=%d", s, win32_gc->subwindow_mode),
- s = ","));
- }
-
- if (mask & GDK_GC_TS_X_ORIGIN)
- {
- win32_gc->values_mask |= GDK_GC_TS_X_ORIGIN;
- GDK_NOTE (GC, (g_print ("%sts_x=%d", s, values->ts_x_origin),
- s = ","));
- }
-
- if (mask & GDK_GC_TS_Y_ORIGIN)
- {
- win32_gc->values_mask |= GDK_GC_TS_Y_ORIGIN;
- GDK_NOTE (GC, (g_print ("%sts_y=%d", s, values->ts_y_origin),
- s = ","));
- }
-
- if (mask & GDK_GC_CLIP_X_ORIGIN)
- {
- win32_gc->values_mask |= GDK_GC_CLIP_X_ORIGIN;
- GDK_NOTE (GC, (g_print ("%sclip_x=%d", s, values->clip_x_origin),
- s = ","));
- }
-
- if (mask & GDK_GC_CLIP_Y_ORIGIN)
- {
- win32_gc->values_mask |= GDK_GC_CLIP_Y_ORIGIN;
- GDK_NOTE (GC, (g_print ("%sclip_y=%d", s, values->clip_y_origin),
- s = ","));
- }
-
- if (mask & GDK_GC_EXPOSURES)
- {
- win32_gc->graphics_exposures = values->graphics_exposures;
- win32_gc->values_mask |= GDK_GC_EXPOSURES;
- GDK_NOTE (GC, (g_print ("%sexp=%d", s, win32_gc->graphics_exposures),
- s = ","));
- }
-
- if (mask & GDK_GC_LINE_WIDTH)
- {
- win32_gc->pen_width = values->line_width;
- win32_gc->values_mask |= GDK_GC_LINE_WIDTH;
- GDK_NOTE (GC, (g_print ("%spw=%d", s, win32_gc->pen_width),
- s = ","));
- }
-
- if (mask & GDK_GC_LINE_STYLE)
- {
- win32_gc->line_style = values->line_style;
- win32_gc->values_mask |= GDK_GC_LINE_STYLE;
- }
-
- if (mask & GDK_GC_CAP_STYLE)
- {
- win32_gc->cap_style = values->cap_style;
- win32_gc->values_mask |= GDK_GC_CAP_STYLE;
- }
-
- if (mask & GDK_GC_JOIN_STYLE)
- {
- win32_gc->join_style = values->join_style;
- win32_gc->values_mask |= GDK_GC_JOIN_STYLE;
- }
-
- if (mask & (GDK_GC_LINE_WIDTH|GDK_GC_LINE_STYLE|GDK_GC_CAP_STYLE|GDK_GC_JOIN_STYLE))
- {
- fixup_pen (win32_gc);
- GDK_NOTE (GC, (g_print ("%sps|=PS_STYLE_%s|PS_ENDCAP_%s|PS_JOIN_%s", s,
- _gdk_win32_psstyle_to_string (win32_gc->pen_style),
- _gdk_win32_psendcap_to_string (win32_gc->pen_style),
- _gdk_win32_psjoin_to_string (win32_gc->pen_style)),
- s = ","));
- }
-
- GDK_NOTE (GC, g_print ("} mask=(%s)", _gdk_win32_gcvalues_mask_to_string (win32_gc->values_mask)));
-}
-
-GdkGC*
-_gdk_win32_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGC *gc;
- GdkGCWin32 *win32_gc;
-
- /* NOTICE that the drawable here has to be the impl drawable,
- * not the publically-visible drawables.
- */
- g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable), NULL);
-
- gc = g_object_new (_gdk_gc_win32_get_type (), NULL);
- win32_gc = GDK_GC_WIN32 (gc);
-
- _gdk_gc_init (gc, drawable, values, values_mask);
-
- win32_gc->hcliprgn = NULL;
-
- win32_gc->rop2 = R2_COPYPEN;
- win32_gc->subwindow_mode = GDK_CLIP_BY_CHILDREN;
- win32_gc->graphics_exposures = TRUE;
- win32_gc->pen_width = 0;
- /* Don't get confused by the PS_ENDCAP_ROUND. For narrow GDI pens
- * (width == 1), PS_GEOMETRIC|PS_ENDCAP_ROUND works like X11's
- * CapButt.
- */
- win32_gc->pen_style = PS_GEOMETRIC|PS_ENDCAP_ROUND|PS_JOIN_MITER;
- win32_gc->line_style = GDK_LINE_SOLID;
- win32_gc->cap_style = GDK_CAP_BUTT;
- win32_gc->join_style = GDK_JOIN_MITER;
- win32_gc->pen_dashes = NULL;
- win32_gc->pen_num_dashes = 0;
- win32_gc->pen_dash_offset = 0;
- win32_gc->pen_hbrbg = NULL;
-
- win32_gc->values_mask = GDK_GC_FUNCTION | GDK_GC_FILL;
-
- GDK_NOTE (GC, g_print ("_gdk_win32_gc_new: %p: ", win32_gc));
- gdk_win32_gc_values_to_win32values (values, values_mask, win32_gc);
- GDK_NOTE (GC, g_print ("\n"));
-
- win32_gc->hdc = NULL;
-
- return gc;
-}
-
-static void
-gdk_win32_gc_get_values (GdkGC *gc,
- GdkGCValues *values)
-{
- GdkGCWin32 *win32_gc = GDK_GC_WIN32 (gc);
-
- values->foreground.pixel = _gdk_gc_get_fg_pixel (gc);
- values->background.pixel = _gdk_gc_get_bg_pixel (gc);
-
- switch (win32_gc->rop2)
- {
- case R2_COPYPEN:
- values->function = GDK_COPY; break;
- case R2_NOT:
- values->function = GDK_INVERT; break;
- case R2_XORPEN:
- values->function = GDK_XOR; break;
- case R2_BLACK:
- values->function = GDK_CLEAR; break;
- case R2_MASKPEN:
- values->function = GDK_AND; break;
- case R2_MASKPENNOT:
- values->function = GDK_AND_REVERSE; break;
- case R2_MASKNOTPEN:
- values->function = GDK_AND_INVERT; break;
- case R2_NOP:
- values->function = GDK_NOOP; break;
- case R2_MERGEPEN:
- values->function = GDK_OR; break;
- case R2_NOTXORPEN:
- values->function = GDK_EQUIV; break;
- case R2_MERGEPENNOT:
- values->function = GDK_OR_REVERSE; break;
- case R2_NOTCOPYPEN:
- values->function = GDK_COPY_INVERT; break;
- case R2_MERGENOTPEN:
- values->function = GDK_OR_INVERT; break;
- case R2_NOTMASKPEN:
- values->function = GDK_NAND; break;
- case R2_NOTMERGEPEN:
- values->function = GDK_NOR; break;
- case R2_WHITE:
- values->function = GDK_SET; break;
- }
-
- values->fill = _gdk_gc_get_fill (gc);
- values->tile = _gdk_gc_get_tile (gc);
- values->stipple = _gdk_gc_get_stipple (gc);
-
- /* Also the X11 backend always returns a NULL clip_mask */
- values->clip_mask = NULL;
-
- values->subwindow_mode = win32_gc->subwindow_mode;
- values->ts_x_origin = win32_gc->parent_instance.ts_x_origin;
- values->ts_y_origin = win32_gc->parent_instance.ts_y_origin;
- values->clip_x_origin = win32_gc->parent_instance.clip_x_origin;
- values->clip_y_origin = win32_gc->parent_instance.clip_y_origin;
- values->graphics_exposures = win32_gc->graphics_exposures;
- values->line_width = win32_gc->pen_width;
-
- values->line_style = win32_gc->line_style;
- values->cap_style = win32_gc->cap_style;
- values->join_style = win32_gc->join_style;
-}
-
-static void
-gdk_win32_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask mask)
-{
- g_return_if_fail (GDK_IS_GC (gc));
-
- GDK_NOTE (GC, g_print ("gdk_win32_gc_set_values: %p: ", GDK_GC_WIN32 (gc)));
- gdk_win32_gc_values_to_win32values (values, mask, GDK_GC_WIN32 (gc));
- GDK_NOTE (GC, g_print ("\n"));
-}
-
-static void
-gdk_win32_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n)
-{
- GdkGCWin32 *win32_gc;
- int i;
-
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (dash_list != NULL);
-
- win32_gc = GDK_GC_WIN32 (gc);
-
- win32_gc->pen_num_dashes = n;
- g_free (win32_gc->pen_dashes);
- win32_gc->pen_dashes = g_new (DWORD, n);
- for (i = 0; i < n; i++)
- win32_gc->pen_dashes[i] = dash_list[i];
- win32_gc->pen_dash_offset = dash_offset;
- fixup_pen (win32_gc);
-}
-
-void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region,
- gboolean reset_origin)
-{
- GdkGCWin32 *win32_gc = GDK_GC_WIN32 (gc);
-
- if (win32_gc->hcliprgn)
- DeleteObject (win32_gc->hcliprgn);
-
- if (region)
- {
- GDK_NOTE (GC, g_print ("gdk_gc_set_clip_region: %p: %s\n",
- win32_gc,
- _gdk_win32_cairo_region_to_string (region)));
-
- win32_gc->hcliprgn = _gdk_win32_cairo_region_to_hrgn (region, 0, 0);
- win32_gc->values_mask |= GDK_GC_CLIP_MASK;
- }
- else
- {
- GDK_NOTE (GC, g_print ("gdk_gc_set_clip_region: NULL\n"));
-
- win32_gc->hcliprgn = NULL;
- win32_gc->values_mask &= ~GDK_GC_CLIP_MASK;
- }
-
- if (reset_origin)
- {
- gc->clip_x_origin = 0;
- gc->clip_y_origin = 0;
- win32_gc->values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
- }
-}
-
-void
-_gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc)
-{
- GdkGCWin32 *dst_win32_gc = GDK_GC_WIN32 (dst_gc);
- GdkGCWin32 *src_win32_gc = GDK_GC_WIN32 (src_gc);
-
- GDK_NOTE (GC, g_print ("gdk_gc_copy: %p := %p\n", dst_win32_gc, src_win32_gc));
-
- if (dst_win32_gc->hcliprgn != NULL)
- DeleteObject (dst_win32_gc->hcliprgn);
-
- g_free (dst_win32_gc->pen_dashes);
-
- dst_win32_gc->hcliprgn = src_win32_gc->hcliprgn;
- if (dst_win32_gc->hcliprgn)
- {
- /* create a new region, to copy to */
- dst_win32_gc->hcliprgn = CreateRectRgn (0,0,1,1);
- /* overwrite from source */
- CombineRgn (dst_win32_gc->hcliprgn, src_win32_gc->hcliprgn,
- NULL, RGN_COPY);
- }
-
- dst_win32_gc->values_mask = src_win32_gc->values_mask;
-
- dst_win32_gc->rop2 = src_win32_gc->rop2;
-
- dst_win32_gc->subwindow_mode = src_win32_gc->subwindow_mode;
- dst_win32_gc->graphics_exposures = src_win32_gc->graphics_exposures;
- dst_win32_gc->pen_width = src_win32_gc->pen_width;
- dst_win32_gc->pen_style = src_win32_gc->pen_style;
- dst_win32_gc->line_style = src_win32_gc->line_style;
- dst_win32_gc->cap_style = src_win32_gc->cap_style;
- dst_win32_gc->join_style = src_win32_gc->join_style;
- if (src_win32_gc->pen_dashes)
- dst_win32_gc->pen_dashes = g_memdup (src_win32_gc->pen_dashes,
- sizeof (DWORD) * src_win32_gc->pen_num_dashes);
- else
- dst_win32_gc->pen_dashes = NULL;
- dst_win32_gc->pen_num_dashes = src_win32_gc->pen_num_dashes;
- dst_win32_gc->pen_dash_offset = src_win32_gc->pen_dash_offset;
-
-
- dst_win32_gc->hdc = NULL;
- dst_win32_gc->saved_dc = FALSE;
- dst_win32_gc->holdpal = NULL;
- dst_win32_gc->pen_hbrbg = NULL;
-}
-
-GdkScreen *
-gdk_gc_get_screen (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC_WIN32 (gc), NULL);
-
- return _gdk_screen;
-}
-
-static guint bitmask[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
-
-COLORREF
-_gdk_win32_colormap_color (GdkColormap *colormap,
- gulong pixel)
-{
- const GdkVisual *visual;
- GdkColormapPrivateWin32 *colormap_private;
- guchar r, g, b;
-
- if (colormap == NULL)
- return DIBINDEX (pixel & 1);
-
- colormap_private = GDK_WIN32_COLORMAP_DATA (colormap);
-
- g_assert (colormap_private != NULL);
-
- visual = colormap->visual;
- switch (visual->type)
- {
- case GDK_VISUAL_GRAYSCALE:
- case GDK_VISUAL_PSEUDO_COLOR:
- case GDK_VISUAL_STATIC_COLOR:
- return PALETTEINDEX (pixel);
-
- case GDK_VISUAL_TRUE_COLOR:
- r = (pixel & visual->red_mask) >> visual->red_shift;
- r = (r * 255) / bitmask[visual->red_prec];
- g = (pixel & visual->green_mask) >> visual->green_shift;
- g = (g * 255) / bitmask[visual->green_prec];
- b = (pixel & visual->blue_mask) >> visual->blue_shift;
- b = (b * 255) / bitmask[visual->blue_prec];
- return RGB (r, g, b);
-
- default:
- g_assert_not_reached ();
- return 0;
- }
-}
-
-gboolean
-predraw (GdkGC *gc,
- GdkColormap *colormap)
-{
- GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
- GdkColormapPrivateWin32 *colormap_private;
- gint k;
- gboolean ok = TRUE;
-
- if (colormap &&
- (colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR ||
- colormap->visual->type == GDK_VISUAL_STATIC_COLOR))
- {
- colormap_private = GDK_WIN32_COLORMAP_DATA (colormap);
-
- g_assert (colormap_private != NULL);
-
- if (!(win32_gc->holdpal = SelectPalette (win32_gc->hdc, colormap_private->hpal, FALSE)))
- WIN32_GDI_FAILED ("SelectPalette"), ok = FALSE;
- else if ((k = RealizePalette (win32_gc->hdc)) == GDI_ERROR)
- WIN32_GDI_FAILED ("RealizePalette"), ok = FALSE;
- else if (k > 0)
- GDK_NOTE (COLORMAP, g_print ("predraw: realized %p: %d colors\n",
- colormap_private->hpal, k));
- }
-
- return ok;
-}
-
-static GdkDrawableImplWin32 *
-get_impl_drawable (GdkDrawable *drawable)
-{
- if (GDK_IS_DRAWABLE_IMPL_WIN32 (drawable))
- return GDK_DRAWABLE_IMPL_WIN32(drawable);
- else if (GDK_IS_WINDOW (drawable))
- return GDK_DRAWABLE_IMPL_WIN32 ((GDK_WINDOW_OBJECT (drawable))->impl);
- else if (GDK_IS_PIXMAP (drawable))
- return GDK_DRAWABLE_IMPL_WIN32 ((GDK_PIXMAP_OBJECT (drawable))->impl);
- else
- g_assert_not_reached ();
-
- return NULL;
-}
-
-/**
- * gdk_win32_hdc_get:
- * @drawable: destination #GdkDrawable
- * @gc: #GdkGC to use for drawing on @drawable
- * @usage: mask indicating what properties needs to be set up
- *
- * Allocates a Windows device context handle (HDC) for drawing into
- * @drawable, and sets it up appropriately according to @usage.
- *
- * Each #GdkGC can at one time have only one HDC associated with it.
- *
- * The following flags in @mask are handled:
- *
- * If %GDK_GC_FOREGROUND is set in @mask, a solid brush of the
- * foreground color in @gc is selected into the HDC. The text color of
- * the HDC is also set. If the @drawable has a palette (256-color
- * mode), the palette is selected and realized.
- *
- * If any of the line attribute flags (%GDK_GC_LINE_WIDTH,
- * %GDK_GC_LINE_STYLE, %GDK_GC_CAP_STYLE and %GDK_GC_JOIN_STYLE) is
- * set in @mask, a solid pen of the foreground color and appropriate
- * width and stule is created and selected into the HDC. Note that the
- * dash properties are not completely implemented.
- *
- * Some things are done regardless of @mask: If the function in @gc is
- * any other than %GDK_COPY, the raster operation of the HDC is
- * set. If @gc has a clip mask, the clip region of the HDC is set.
- *
- * Note that the fill style, tile, stipple, and tile and stipple
- * origins in the @gc are ignored by this function. (In general, tiles
- * and stipples can't be implemented directly on Win32; you need to do
- * multiple pass drawing and blitting to implement tiles or
- * stipples. GDK does just that when you call the GDK drawing
- * functions with a GC that asks for tiles or stipples.)
- *
- * When the HDC is no longer used, it should be released by calling
- * gdk_win32_hdc_release() with the same
- * parameters.
- *
- * If you modify the HDC by calling SelectObject
- * you should undo those modifications before calling
- * gdk_win32_hdc_release().
- *
- * Return value: The HDC.
- **/
-HDC
-gdk_win32_hdc_get (GdkDrawable *drawable,
- GdkGC *gc,
- GdkGCValuesMask usage)
-{
- GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
- GdkDrawableImplWin32 *impl = NULL;
- gboolean ok = TRUE;
- COLORREF fg = RGB (0, 0, 0), bg = RGB (255, 255, 255);
- HPEN hpen;
- HBRUSH hbr;
-
- g_assert (win32_gc->hdc == NULL);
-
- impl = get_impl_drawable (drawable);
-
- win32_gc->hdc = _gdk_win32_drawable_acquire_dc (GDK_DRAWABLE (impl));
- ok = win32_gc->hdc != NULL;
-
- if (ok && (win32_gc->saved_dc = SaveDC (win32_gc->hdc)) == 0)
- WIN32_GDI_FAILED ("SaveDC"), ok = FALSE;
-
- if (ok && (usage & (GDK_GC_FOREGROUND | GDK_GC_BACKGROUND)))
- ok = predraw (gc, impl->colormap);
-
- if (ok && (usage & GDK_GC_FOREGROUND))
- {
- fg = _gdk_win32_colormap_color (impl->colormap, _gdk_gc_get_fg_pixel (gc));
- if ((hbr = CreateSolidBrush (fg)) == NULL)
- WIN32_GDI_FAILED ("CreateSolidBrush"), ok = FALSE;
-
- if (ok && SelectObject (win32_gc->hdc, hbr) == NULL)
- WIN32_GDI_FAILED ("SelectObject"), ok = FALSE;
-
- if (ok && SetTextColor (win32_gc->hdc, fg) == CLR_INVALID)
- WIN32_GDI_FAILED ("SetTextColor"), ok = FALSE;
- }
-
- if (ok && (usage & LINE_ATTRIBUTES))
- {
- /* For drawing GDK_LINE_DOUBLE_DASH */
- if ((usage & GDK_GC_BACKGROUND) && win32_gc->line_style == GDK_LINE_DOUBLE_DASH)
- {
- bg = _gdk_win32_colormap_color (impl->colormap, _gdk_gc_get_bg_pixel (gc));
- if ((win32_gc->pen_hbrbg = CreateSolidBrush (bg)) == NULL)
- WIN32_GDI_FAILED ("CreateSolidBrush"), ok = FALSE;
- }
-
- if (ok)
- {
- LOGBRUSH logbrush;
- DWORD style_count = 0;
- const DWORD *style = NULL;
-
- /* Create and select pen */
- logbrush.lbStyle = BS_SOLID;
- logbrush.lbColor = fg;
- logbrush.lbHatch = 0;
-
- if ((win32_gc->pen_style & PS_STYLE_MASK) == PS_USERSTYLE)
- {
- style_count = win32_gc->pen_num_dashes;
- style = win32_gc->pen_dashes;
- }
-
- if ((hpen = ExtCreatePen (win32_gc->pen_style,
- MAX (win32_gc->pen_width, 1),
- &logbrush,
- style_count, style)) == NULL)
- WIN32_GDI_FAILED ("ExtCreatePen"), ok = FALSE;
-
- if (ok && SelectObject (win32_gc->hdc, hpen) == NULL)
- WIN32_GDI_FAILED ("SelectObject"), ok = FALSE;
- }
- }
-
- if (ok && win32_gc->rop2 != R2_COPYPEN)
- if (SetROP2 (win32_gc->hdc, win32_gc->rop2) == 0)
- WIN32_GDI_FAILED ("SetROP2"), ok = FALSE;
-
- if (ok &&
- (win32_gc->values_mask & GDK_GC_CLIP_MASK) &&
- win32_gc->hcliprgn != NULL)
- {
- if (SelectClipRgn (win32_gc->hdc, win32_gc->hcliprgn) == ERROR)
- WIN32_API_FAILED ("SelectClipRgn"), ok = FALSE;
-
- if (ok && win32_gc->values_mask & (GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN) &&
- OffsetClipRgn (win32_gc->hdc,
- win32_gc->values_mask & GDK_GC_CLIP_X_ORIGIN ? gc->clip_x_origin : 0,
- win32_gc->values_mask & GDK_GC_CLIP_Y_ORIGIN ? gc->clip_y_origin : 0) == ERROR)
- WIN32_API_FAILED ("OffsetClipRgn"), ok = FALSE;
- }
- else if (ok)
- SelectClipRgn (win32_gc->hdc, NULL);
-
- GDK_NOTE (GC, (g_print ("gdk_win32_hdc_get: %p (%s): ",
- win32_gc, _gdk_win32_gcvalues_mask_to_string (usage)),
- _gdk_win32_print_dc (win32_gc->hdc)));
-
- return win32_gc->hdc;
-}
-
-/**
- * gdk_win32_hdc_release:
- * @drawable: destination #GdkDrawable
- * @gc: #GdkGC to use for drawing on @drawable
- * @usage: mask indicating what properties were set up
- *
- * This function deallocates the Windows device context allocated by
- * gdk_win32_hdc_get(). It should be called with
- * the same parameters.
- **/
-void
-gdk_win32_hdc_release (GdkDrawable *drawable,
- GdkGC *gc,
- GdkGCValuesMask usage)
-{
- GdkGCWin32 *win32_gc = (GdkGCWin32 *) gc;
- GdkDrawableImplWin32 *impl = NULL;
- HGDIOBJ hpen = NULL;
- HGDIOBJ hbr = NULL;
-
- GDK_NOTE (GC, g_print ("gdk_win32_hdc_release: %p: %p (%s)\n",
- win32_gc, win32_gc->hdc,
- _gdk_win32_gcvalues_mask_to_string (usage)));
-
- impl = get_impl_drawable (drawable);
-
- if (win32_gc->holdpal != NULL)
- {
- gint k;
-
- if (!SelectPalette (win32_gc->hdc, win32_gc->holdpal, FALSE))
- WIN32_GDI_FAILED ("SelectPalette");
- else if ((k = RealizePalette (win32_gc->hdc)) == GDI_ERROR)
- WIN32_GDI_FAILED ("RealizePalette");
- else if (k > 0)
- GDK_NOTE (COLORMAP, g_print ("gdk_win32_hdc_release: realized %p: %d colors\n",
- win32_gc->holdpal, k));
- win32_gc->holdpal = NULL;
- }
-
- if (usage & LINE_ATTRIBUTES)
- if ((hpen = GetCurrentObject (win32_gc->hdc, OBJ_PEN)) == NULL)
- WIN32_GDI_FAILED ("GetCurrentObject");
-
- if (usage & GDK_GC_FOREGROUND)
- if ((hbr = GetCurrentObject (win32_gc->hdc, OBJ_BRUSH)) == NULL)
- WIN32_GDI_FAILED ("GetCurrentObject");
-
- GDI_CALL (RestoreDC, (win32_gc->hdc, win32_gc->saved_dc));
-
- _gdk_win32_drawable_release_dc (GDK_DRAWABLE (impl));
-
- if (hpen != NULL)
- GDI_CALL (DeleteObject, (hpen));
-
- if (hbr != NULL)
- GDI_CALL (DeleteObject, (hbr));
-
- if (win32_gc->pen_hbrbg != NULL)
- GDI_CALL (DeleteObject, (win32_gc->pen_hbrbg));
-
- win32_gc->hdc = NULL;
-}
-
-/* This function originally from Jean-Edouard Lachand-Robert, and
- * available at www.codeguru.com. Simplified for our needs, not sure
- * how much of the original code left any longer. Now handles just
- * one-bit deep bitmaps (in Window parlance, ie those that GDK calls
- * bitmaps (and not pixmaps), with zero pixels being transparent.
- */
-
-/* _gdk_win32_bitmap_to_hrgn : Create a region from the
- * "non-transparent" pixels of a bitmap.
- */
-
-HRGN
-_gdk_win32_bitmap_to_hrgn (GdkPixmap *pixmap)
-{
- HRGN hRgn = NULL;
- HRGN h;
- DWORD maxRects;
- RGNDATA *pData;
- guchar *bits;
- gint width, height, bpl;
- guchar *p;
- gint x, y;
-
- g_assert (GDK_PIXMAP_OBJECT(pixmap)->depth == 1);
-
- bits = GDK_PIXMAP_IMPL_WIN32 (GDK_PIXMAP_OBJECT (pixmap)->impl)->bits;
- width = GDK_PIXMAP_IMPL_WIN32 (GDK_PIXMAP_OBJECT (pixmap)->impl)->width;
- height = GDK_PIXMAP_IMPL_WIN32 (GDK_PIXMAP_OBJECT (pixmap)->impl)->height;
- bpl = ((width - 1)/32 + 1)*4;
-
- /* For better performances, we will use the ExtCreateRegion()
- * function to create the region. This function take a RGNDATA
- * structure on entry. We will add rectangles by amount of
- * ALLOC_UNIT number in this structure.
- */
- #define ALLOC_UNIT 100
- maxRects = ALLOC_UNIT;
-
- pData = g_malloc (sizeof (RGNDATAHEADER) + (sizeof (RECT) * maxRects));
- pData->rdh.dwSize = sizeof (RGNDATAHEADER);
- pData->rdh.iType = RDH_RECTANGLES;
- pData->rdh.nCount = pData->rdh.nRgnSize = 0;
- SetRect (&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0);
-
- for (y = 0; y < height; y++)
- {
- /* Scan each bitmap row from left to right*/
- p = (guchar *) bits + y * bpl;
- for (x = 0; x < width; x++)
- {
- /* Search for a continuous range of "non transparent pixels"*/
- gint x0 = x;
- while (x < width)
- {
- if ((((p[x/8])>>(7-(x%8)))&1) == 0)
- /* This pixel is "transparent"*/
- break;
- x++;
- }
-
- if (x > x0)
- {
- RECT *pr;
- /* Add the pixels (x0, y) to (x, y+1) as a new rectangle
- * in the region
- */
- if (pData->rdh.nCount >= maxRects)
- {
- maxRects += ALLOC_UNIT;
- pData = g_realloc (pData, sizeof(RGNDATAHEADER)
- + (sizeof(RECT) * maxRects));
- }
- pr = (RECT *) &pData->Buffer;
- SetRect (&pr[pData->rdh.nCount], x0, y, x, y+1);
- if (x0 < pData->rdh.rcBound.left)
- pData->rdh.rcBound.left = x0;
- if (y < pData->rdh.rcBound.top)
- pData->rdh.rcBound.top = y;
- if (x > pData->rdh.rcBound.right)
- pData->rdh.rcBound.right = x;
- if (y+1 > pData->rdh.rcBound.bottom)
- pData->rdh.rcBound.bottom = y+1;
- pData->rdh.nCount++;
-
- /* On Windows98, ExtCreateRegion() may fail if the
- * number of rectangles is too large (ie: >
- * 4000). Therefore, we have to create the region by
- * multiple steps.
- */
- if (pData->rdh.nCount == 2000)
- {
- HRGN h = ExtCreateRegion (NULL, sizeof(RGNDATAHEADER) + (sizeof(RECT) * maxRects), pData);
- if (hRgn)
- {
- CombineRgn(hRgn, hRgn, h, RGN_OR);
- DeleteObject(h);
- }
- else
- hRgn = h;
- pData->rdh.nCount = 0;
- SetRect (&pData->rdh.rcBound, MAXLONG, MAXLONG, 0, 0);
- }
- }
- }
- }
-
- /* Create or extend the region with the remaining rectangles*/
- h = ExtCreateRegion (NULL, sizeof (RGNDATAHEADER)
- + (sizeof (RECT) * maxRects), pData);
- if (hRgn)
- {
- CombineRgn (hRgn, hRgn, h, RGN_OR);
- DeleteObject (h);
- }
- else
- hRgn = h;
-
- /* Clean up*/
- g_free (pData);
-
- return hRgn;
-}
-
-HRGN
-_gdk_win32_cairo_region_to_hrgn (const cairo_region_t *region,
- gint x_origin,
- gint y_origin)
-{
- HRGN hrgn;
- RGNDATA *rgndata;
- RECT *rect;
- cairo_rectangle_int_t cairo_rect;
- guint nbytes = sizeof (RGNDATAHEADER)
- + (sizeof (RECT) * cairo_region_num_rectangles (region));
- int i;
-
- rgndata = g_malloc (nbytes);
- rgndata->rdh.dwSize = sizeof (RGNDATAHEADER);
- rgndata->rdh.iType = RDH_RECTANGLES;
- rgndata->rdh.nCount = rgndata->rdh.nRgnSize = 0;
- SetRect (&rgndata->rdh.rcBound,
- G_MAXLONG, G_MAXLONG, G_MINLONG, G_MINLONG);
-
- for (i = 0; i < cairo_region_num_rectangles (region); i++)
- {
- rect = ((RECT *) rgndata->Buffer) + rgndata->rdh.nCount++;
- cairo_region_get_rectangle (region, i, &cairo_rect);
-
- rect->left = cairo_rect.x + x_origin;
- rect->right = cairo_rect.x + cairo_rect.width + x_origin;
- rect->top = cairo_rect.y + y_origin;
- rect->bottom = cairo_rect.y + cairo_rect.height + y_origin;
-
- if (rect->left < rgndata->rdh.rcBound.left)
- rgndata->rdh.rcBound.left = rect->left;
- if (rect->right > rgndata->rdh.rcBound.right)
- rgndata->rdh.rcBound.right = rect->right;
- if (rect->top < rgndata->rdh.rcBound.top)
- rgndata->rdh.rcBound.top = rect->top;
- if (rect->bottom > rgndata->rdh.rcBound.bottom)
- rgndata->rdh.rcBound.bottom = rect->bottom;
- }
- if ((hrgn = ExtCreateRegion (NULL, nbytes, rgndata)) == NULL)
- WIN32_API_FAILED ("ExtCreateRegion");
-
- g_free (rgndata);
-
- return (hrgn);
-}
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index d026d8902e..6e97ac50a5 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -105,13 +105,6 @@
#define GDK_DEBUG_MISC_OR_COLORMAP (GDK_DEBUG_MISC|GDK_DEBUG_COLORMAP)
#define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS)
-#define GDK_TYPE_GC_WIN32 (_gdk_gc_win32_get_type ())
-#define GDK_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_WIN32, GdkGCWin32))
-#define GDK_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
-#define GDK_IS_GC_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_WIN32))
-#define GDK_IS_GC_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_WIN32))
-#define GDK_GC_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_WIN32, GdkGCWin32Class))
-
//#define GDK_WINDOW_SCREEN(win) (_gdk_screen)
GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
@@ -120,8 +113,6 @@ GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
typedef struct _GdkColormapPrivateWin32 GdkColormapPrivateWin32;
typedef struct _GdkCursorPrivate GdkCursorPrivate;
typedef struct _GdkWin32SingleFont GdkWin32SingleFont;
-typedef struct _GdkGCWin32 GdkGCWin32;
-typedef struct _GdkGCWin32Class GdkGCWin32Class;
struct _GdkCursorPrivate
{
@@ -159,48 +150,6 @@ struct _GdkColormapPrivateWin32
GdkColorInfo *info;
};
-struct _GdkGCWin32
-{
- GdkGC parent_instance;
-
- /* A Windows Device Context (DC) is not equivalent to an X11
- * GC. We can use a DC only in the window for which it was
- * allocated, or (in the case of a memory DC) with the bitmap that
- * has been selected into it. Thus, we have to release and
- * reallocate a DC each time the GdkGC is used to paint into a new
- * window or pixmap. We thus keep all the necessary values in the
- * GdkGCWin32 object.
- */
-
- HRGN hcliprgn;
-
- GdkGCValuesMask values_mask;
-
- gint rop2;
- GdkSubwindowMode subwindow_mode;
- gint graphics_exposures;
- gint pen_width;
- DWORD pen_style;
- GdkLineStyle line_style;
- GdkCapStyle cap_style;
- GdkJoinStyle join_style;
- DWORD *pen_dashes; /* use for PS_USERSTYLE or step-by-step rendering */
- gint pen_num_dashes;
- gint pen_dash_offset;
- HBRUSH pen_hbrbg;
-
- /* Following fields are valid while the GC exists as a Windows DC */
- HDC hdc;
- int saved_dc;
-
- HPALETTE holdpal;
-};
-
-struct _GdkGCWin32Class
-{
- GdkGCClass parent_class;
-};
-
GType _gdk_gc_win32_get_type (void);
gulong _gdk_win32_get_next_tick (gulong suggested_tick);
@@ -232,10 +181,6 @@ void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
-GdkGC *_gdk_win32_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-
void _gdk_win32_blit (gboolean use_fg_bg,
GdkDrawableImplWin32 *drawable,
GdkGC *gc,
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index 080ccd101c..c83b7cd49d 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -37,7 +37,6 @@ libgdk_x11_la_SOURCES = \
gdkeventsource.h \
gdkeventtranslator.c \
gdkeventtranslator.h \
- gdkgc-x11.c \
gdkgeometry-x11.c \
gdkglobals-x11.c \
gdkim-x11.c \
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index e80152ed47..8fba6eb23c 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -72,8 +72,6 @@ _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
object_class->finalize = gdk_drawable_impl_x11_finalize;
- drawable_class->create_gc = _gdk_x11_gc_new;
-
drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
drawable_class->set_colormap = gdk_x11_set_colormap;
diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c
deleted file mode 100644
index 9d0bb8d1bb..0000000000
--- a/gdk/x11/gdkgc-x11.c
+++ /dev/null
@@ -1,697 +0,0 @@
-/* GDK - The GIMP Drawing Kit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
- * file for a list of people on the GTK+ Team. See the ChangeLog
- * files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-#include "config.h"
-
-#include "gdkgc.h"
-#include "gdkprivate-x11.h"
-#include "gdkx.h"
-
-#include
-
-typedef enum {
- GDK_GC_DIRTY_CLIP = 1 << 0,
- GDK_GC_DIRTY_TS = 1 << 1
-} GdkGCDirtyValues;
-
-static void gdk_x11_gc_values_to_xvalues (GdkGCValues *values,
- GdkGCValuesMask mask,
- XGCValues *xvalues,
- unsigned long *xvalues_mask);
-
-static void gdk_x11_gc_get_values (GdkGC *gc,
- GdkGCValues *values);
-static void gdk_x11_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-static void gdk_x11_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n);
-
-static void gdk_gc_x11_finalize (GObject *object);
-
-G_DEFINE_TYPE (GdkGCX11, _gdk_gc_x11, GDK_TYPE_GC)
-
-static void
-_gdk_gc_x11_class_init (GdkGCX11Class *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GdkGCClass *gc_class = GDK_GC_CLASS (klass);
-
- object_class->finalize = gdk_gc_x11_finalize;
-
- gc_class->get_values = gdk_x11_gc_get_values;
- gc_class->set_values = gdk_x11_gc_set_values;
- gc_class->set_dashes = gdk_x11_gc_set_dashes;
-}
-
-static void
-_gdk_gc_x11_init (GdkGCX11 *gc)
-{
-}
-
-static void
-gdk_gc_x11_finalize (GObject *object)
-{
- GdkGCX11 *x11_gc = GDK_GC_X11 (object);
-
- XFreeGC (GDK_GC_XDISPLAY (x11_gc), GDK_GC_XGC (x11_gc));
-
- G_OBJECT_CLASS (_gdk_gc_x11_parent_class)->finalize (object);
-}
-
-
-GdkGC *
-_gdk_x11_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGC *gc;
- GdkGCX11 *private;
-
- XGCValues xvalues;
- unsigned long xvalues_mask;
-
- /* NOTICE that the drawable here has to be the impl drawable,
- * not the publically-visible drawables.
- */
- g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_X11 (drawable), NULL);
-
- gc = g_object_new (_gdk_gc_x11_get_type (), NULL);
- private = GDK_GC_X11 (gc);
-
- _gdk_gc_init (gc, drawable, values, values_mask);
-
- private->dirty_mask = 0;
- private->have_clip_mask = FALSE;
-
- private->screen = GDK_DRAWABLE_IMPL_X11 (drawable)->screen;
-
- private->depth = gdk_drawable_get_depth (drawable);
-
- if (values_mask & (GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN))
- {
- values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
- private->dirty_mask |= GDK_GC_DIRTY_CLIP;
- }
-
- if (values_mask & (GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN))
- {
- values_mask &= ~(GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
- private->dirty_mask |= GDK_GC_DIRTY_TS;
- }
-
- if ((values_mask & GDK_GC_CLIP_MASK) && values->clip_mask)
- private->have_clip_mask = TRUE;
-
- xvalues.function = GXcopy;
- xvalues.fill_style = FillSolid;
- xvalues.arc_mode = ArcPieSlice;
- xvalues.subwindow_mode = ClipByChildren;
- xvalues.graphics_exposures = False;
- xvalues_mask = GCFunction | GCFillStyle | GCArcMode | GCSubwindowMode | GCGraphicsExposures;
-
- gdk_x11_gc_values_to_xvalues (values, values_mask, &xvalues, &xvalues_mask);
-
- private->xgc = XCreateGC (GDK_GC_XDISPLAY (gc),
- GDK_DRAWABLE_IMPL_X11 (drawable)->xid,
- xvalues_mask, &xvalues);
-
- return gc;
-}
-
-GC
-_gdk_x11_gc_flush (GdkGC *gc)
-{
- Display *xdisplay = GDK_GC_XDISPLAY (gc);
- GdkGCX11 *private = GDK_GC_X11 (gc);
- GC xgc = private->xgc;
-
- if (private->dirty_mask & GDK_GC_DIRTY_CLIP)
- {
- cairo_region_t *clip_region = _gdk_gc_get_clip_region (gc);
-
- if (!clip_region)
- XSetClipOrigin (xdisplay, xgc,
- gc->clip_x_origin, gc->clip_y_origin);
- else
- {
- XRectangle *rectangles;
- gint n_rects;
-
- _gdk_region_get_xrectangles (clip_region,
- gc->clip_x_origin,
- gc->clip_y_origin,
- &rectangles,
- &n_rects);
-
- XSetClipRectangles (xdisplay, xgc, 0, 0,
- rectangles,
- n_rects, YXBanded);
-
- g_free (rectangles);
- }
- }
-
- if (private->dirty_mask & GDK_GC_DIRTY_TS)
- {
- XSetTSOrigin (xdisplay, xgc,
- gc->ts_x_origin, gc->ts_y_origin);
- }
-
- private->dirty_mask = 0;
- return xgc;
-}
-
-static void
-gdk_x11_gc_get_values (GdkGC *gc,
- GdkGCValues *values)
-{
- XGCValues xvalues;
-
- if (XGetGCValues (GDK_GC_XDISPLAY (gc), GDK_GC_XGC (gc),
- GCForeground | GCBackground | GCFont |
- GCFunction | GCTile | GCStipple | /* GCClipMask | */
- GCSubwindowMode | GCGraphicsExposures |
- GCTileStipXOrigin | GCTileStipYOrigin |
- GCClipXOrigin | GCClipYOrigin |
- GCLineWidth | GCLineStyle | GCCapStyle |
- GCFillStyle | GCJoinStyle, &xvalues))
- {
- values->foreground.pixel = xvalues.foreground;
- values->background.pixel = xvalues.background;
-
- switch (xvalues.function)
- {
- case GXcopy:
- values->function = GDK_COPY;
- break;
- case GXinvert:
- values->function = GDK_INVERT;
- break;
- case GXxor:
- values->function = GDK_XOR;
- break;
- case GXclear:
- values->function = GDK_CLEAR;
- break;
- case GXand:
- values->function = GDK_AND;
- break;
- case GXandReverse:
- values->function = GDK_AND_REVERSE;
- break;
- case GXandInverted:
- values->function = GDK_AND_INVERT;
- break;
- case GXnoop:
- values->function = GDK_NOOP;
- break;
- case GXor:
- values->function = GDK_OR;
- break;
- case GXequiv:
- values->function = GDK_EQUIV;
- break;
- case GXorReverse:
- values->function = GDK_OR_REVERSE;
- break;
- case GXcopyInverted:
- values->function =GDK_COPY_INVERT;
- break;
- case GXorInverted:
- values->function = GDK_OR_INVERT;
- break;
- case GXnand:
- values->function = GDK_NAND;
- break;
- case GXset:
- values->function = GDK_SET;
- break;
- case GXnor:
- values->function = GDK_NOR;
- break;
- }
-
- switch (xvalues.fill_style)
- {
- case FillSolid:
- values->fill = GDK_SOLID;
- break;
- case FillTiled:
- values->fill = GDK_TILED;
- break;
- case FillStippled:
- values->fill = GDK_STIPPLED;
- break;
- case FillOpaqueStippled:
- values->fill = GDK_OPAQUE_STIPPLED;
- break;
- }
-
- values->tile = gdk_pixmap_lookup_for_display (GDK_GC_DISPLAY (gc),
- xvalues.tile);
- values->stipple = gdk_pixmap_lookup_for_display (GDK_GC_DISPLAY (gc),
- xvalues.stipple);
- values->clip_mask = NULL;
- values->subwindow_mode = xvalues.subwindow_mode;
- values->ts_x_origin = xvalues.ts_x_origin;
- values->ts_y_origin = xvalues.ts_y_origin;
- values->clip_x_origin = xvalues.clip_x_origin;
- values->clip_y_origin = xvalues.clip_y_origin;
- values->graphics_exposures = xvalues.graphics_exposures;
- values->line_width = xvalues.line_width;
-
- switch (xvalues.line_style)
- {
- case LineSolid:
- values->line_style = GDK_LINE_SOLID;
- break;
- case LineOnOffDash:
- values->line_style = GDK_LINE_ON_OFF_DASH;
- break;
- case LineDoubleDash:
- values->line_style = GDK_LINE_DOUBLE_DASH;
- break;
- }
-
- switch (xvalues.cap_style)
- {
- case CapNotLast:
- values->cap_style = GDK_CAP_NOT_LAST;
- break;
- case CapButt:
- values->cap_style = GDK_CAP_BUTT;
- break;
- case CapRound:
- values->cap_style = GDK_CAP_ROUND;
- break;
- case CapProjecting:
- values->cap_style = GDK_CAP_PROJECTING;
- break;
- }
-
- switch (xvalues.join_style)
- {
- case JoinMiter:
- values->join_style = GDK_JOIN_MITER;
- break;
- case JoinRound:
- values->join_style = GDK_JOIN_ROUND;
- break;
- case JoinBevel:
- values->join_style = GDK_JOIN_BEVEL;
- break;
- }
- }
- else
- {
- memset (values, 0, sizeof (GdkGCValues));
- }
-}
-
-static void
-gdk_x11_gc_set_values (GdkGC *gc,
- GdkGCValues *values,
- GdkGCValuesMask values_mask)
-{
- GdkGCX11 *x11_gc;
- XGCValues xvalues;
- unsigned long xvalues_mask = 0;
-
- x11_gc = GDK_GC_X11 (gc);
-
- if (values_mask & (GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN))
- {
- values_mask &= ~(GDK_GC_CLIP_X_ORIGIN | GDK_GC_CLIP_Y_ORIGIN);
- x11_gc->dirty_mask |= GDK_GC_DIRTY_CLIP;
- }
-
- if (values_mask & (GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN))
- {
- values_mask &= ~(GDK_GC_TS_X_ORIGIN | GDK_GC_TS_Y_ORIGIN);
- x11_gc->dirty_mask |= GDK_GC_DIRTY_TS;
- }
-
- if (values_mask & GDK_GC_CLIP_MASK)
- {
- x11_gc->have_clip_region = FALSE;
- x11_gc->have_clip_mask = values->clip_mask != NULL;
- }
-
- gdk_x11_gc_values_to_xvalues (values, values_mask, &xvalues, &xvalues_mask);
-
- XChangeGC (GDK_GC_XDISPLAY (gc),
- GDK_GC_XGC (gc),
- xvalues_mask,
- &xvalues);
-}
-
-static void
-gdk_x11_gc_set_dashes (GdkGC *gc,
- gint dash_offset,
- gint8 dash_list[],
- gint n)
-{
- g_return_if_fail (GDK_IS_GC (gc));
- g_return_if_fail (dash_list != NULL);
-
- XSetDashes (GDK_GC_XDISPLAY (gc), GDK_GC_XGC (gc),
- dash_offset, (char *)dash_list, n);
-}
-
-static void
-gdk_x11_gc_values_to_xvalues (GdkGCValues *values,
- GdkGCValuesMask mask,
- XGCValues *xvalues,
- unsigned long *xvalues_mask)
-{
- /* Optimization for the common case (gdk_gc_new()) */
- if (values == NULL || mask == 0)
- return;
-
- if (mask & GDK_GC_FOREGROUND)
- {
- xvalues->foreground = values->foreground.pixel;
- *xvalues_mask |= GCForeground;
- }
- if (mask & GDK_GC_BACKGROUND)
- {
- xvalues->background = values->background.pixel;
- *xvalues_mask |= GCBackground;
- }
- if (mask & GDK_GC_FUNCTION)
- {
- switch (values->function)
- {
- case GDK_COPY:
- xvalues->function = GXcopy;
- break;
- case GDK_INVERT:
- xvalues->function = GXinvert;
- break;
- case GDK_XOR:
- xvalues->function = GXxor;
- break;
- case GDK_CLEAR:
- xvalues->function = GXclear;
- break;
- case GDK_AND:
- xvalues->function = GXand;
- break;
- case GDK_AND_REVERSE:
- xvalues->function = GXandReverse;
- break;
- case GDK_AND_INVERT:
- xvalues->function = GXandInverted;
- break;
- case GDK_NOOP:
- xvalues->function = GXnoop;
- break;
- case GDK_OR:
- xvalues->function = GXor;
- break;
- case GDK_EQUIV:
- xvalues->function = GXequiv;
- break;
- case GDK_OR_REVERSE:
- xvalues->function = GXorReverse;
- break;
- case GDK_COPY_INVERT:
- xvalues->function = GXcopyInverted;
- break;
- case GDK_OR_INVERT:
- xvalues->function = GXorInverted;
- break;
- case GDK_NAND:
- xvalues->function = GXnand;
- break;
- case GDK_SET:
- xvalues->function = GXset;
- break;
- case GDK_NOR:
- xvalues->function = GXnor;
- break;
- }
- *xvalues_mask |= GCFunction;
- }
- if (mask & GDK_GC_FILL)
- {
- switch (values->fill)
- {
- case GDK_SOLID:
- xvalues->fill_style = FillSolid;
- break;
- case GDK_TILED:
- xvalues->fill_style = FillTiled;
- break;
- case GDK_STIPPLED:
- xvalues->fill_style = FillStippled;
- break;
- case GDK_OPAQUE_STIPPLED:
- xvalues->fill_style = FillOpaqueStippled;
- break;
- }
- *xvalues_mask |= GCFillStyle;
- }
- if (mask & GDK_GC_TILE)
- {
- if (values->tile)
- xvalues->tile = GDK_DRAWABLE_XID (values->tile);
- else
- xvalues->tile = None;
-
- *xvalues_mask |= GCTile;
- }
- if (mask & GDK_GC_STIPPLE)
- {
- if (values->stipple)
- xvalues->stipple = GDK_DRAWABLE_XID (values->stipple);
- else
- xvalues->stipple = None;
-
- *xvalues_mask |= GCStipple;
- }
- if (mask & GDK_GC_CLIP_MASK)
- {
- if (values->clip_mask)
- xvalues->clip_mask = GDK_DRAWABLE_XID (values->clip_mask);
- else
- xvalues->clip_mask = None;
-
- *xvalues_mask |= GCClipMask;
-
- }
- if (mask & GDK_GC_SUBWINDOW)
- {
- xvalues->subwindow_mode = values->subwindow_mode;
- *xvalues_mask |= GCSubwindowMode;
- }
- if (mask & GDK_GC_TS_X_ORIGIN)
- {
- xvalues->ts_x_origin = values->ts_x_origin;
- *xvalues_mask |= GCTileStipXOrigin;
- }
- if (mask & GDK_GC_TS_Y_ORIGIN)
- {
- xvalues->ts_y_origin = values->ts_y_origin;
- *xvalues_mask |= GCTileStipYOrigin;
- }
- if (mask & GDK_GC_CLIP_X_ORIGIN)
- {
- xvalues->clip_x_origin = values->clip_x_origin;
- *xvalues_mask |= GCClipXOrigin;
- }
- if (mask & GDK_GC_CLIP_Y_ORIGIN)
- {
- xvalues->clip_y_origin = values->clip_y_origin;
- *xvalues_mask |= GCClipYOrigin;
- }
-
- if (mask & GDK_GC_EXPOSURES)
- {
- xvalues->graphics_exposures = values->graphics_exposures;
- *xvalues_mask |= GCGraphicsExposures;
- }
-
- if (mask & GDK_GC_LINE_WIDTH)
- {
- xvalues->line_width = values->line_width;
- *xvalues_mask |= GCLineWidth;
- }
- if (mask & GDK_GC_LINE_STYLE)
- {
- switch (values->line_style)
- {
- case GDK_LINE_SOLID:
- xvalues->line_style = LineSolid;
- break;
- case GDK_LINE_ON_OFF_DASH:
- xvalues->line_style = LineOnOffDash;
- break;
- case GDK_LINE_DOUBLE_DASH:
- xvalues->line_style = LineDoubleDash;
- break;
- }
- *xvalues_mask |= GCLineStyle;
- }
- if (mask & GDK_GC_CAP_STYLE)
- {
- switch (values->cap_style)
- {
- case GDK_CAP_NOT_LAST:
- xvalues->cap_style = CapNotLast;
- break;
- case GDK_CAP_BUTT:
- xvalues->cap_style = CapButt;
- break;
- case GDK_CAP_ROUND:
- xvalues->cap_style = CapRound;
- break;
- case GDK_CAP_PROJECTING:
- xvalues->cap_style = CapProjecting;
- break;
- }
- *xvalues_mask |= GCCapStyle;
- }
- if (mask & GDK_GC_JOIN_STYLE)
- {
- switch (values->join_style)
- {
- case GDK_JOIN_MITER:
- xvalues->join_style = JoinMiter;
- break;
- case GDK_JOIN_ROUND:
- xvalues->join_style = JoinRound;
- break;
- case GDK_JOIN_BEVEL:
- xvalues->join_style = JoinBevel;
- break;
- }
- *xvalues_mask |= GCJoinStyle;
- }
-
-}
-
-void
-_gdk_windowing_gc_set_clip_region (GdkGC *gc,
- const cairo_region_t *region,
- gboolean reset_origin)
-{
- GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
-
- /* Unset immediately, to make sure Xlib doesn't keep the
- * XID of an old clip mask cached
- */
- if ((x11_gc->have_clip_region && !region) || x11_gc->have_clip_mask)
- {
- XSetClipMask (GDK_GC_XDISPLAY (gc), GDK_GC_XGC (gc), None);
- x11_gc->have_clip_mask = FALSE;
- }
-
- x11_gc->have_clip_region = region != NULL;
-
- if (reset_origin)
- {
- gc->clip_x_origin = 0;
- gc->clip_y_origin = 0;
- }
-
- x11_gc->dirty_mask |= GDK_GC_DIRTY_CLIP;
-}
-
-void
-_gdk_windowing_gc_copy (GdkGC *dst_gc,
- GdkGC *src_gc)
-{
- GdkGCX11 *x11_src_gc = GDK_GC_X11 (src_gc);
- GdkGCX11 *x11_dst_gc = GDK_GC_X11 (dst_gc);
-
- XCopyGC (GDK_GC_XDISPLAY (src_gc), GDK_GC_XGC (src_gc), ~((~1) << GCLastBit),
- GDK_GC_XGC (dst_gc));
-
- x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask;
- x11_dst_gc->have_clip_region = x11_src_gc->have_clip_region;
- x11_dst_gc->have_clip_mask = x11_src_gc->have_clip_mask;
-}
-
-/**
- * gdk_gc_get_screen:
- * @gc: a #GdkGC.
- *
- * Gets the #GdkScreen for which @gc was created
- *
- * Returns: the #GdkScreen for @gc.
- *
- * Since: 2.2
- */
-GdkScreen *
-gdk_gc_get_screen (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC_X11 (gc), NULL);
-
- return GDK_GC_X11 (gc)->screen;
-}
-
-/**
- * gdk_x11_gc_get_xdisplay:
- * @gc: a #GdkGC.
- *
- * Returns the display of a #GdkGC.
- *
- * Return value: an Xlib Display*.
- **/
-Display *
-gdk_x11_gc_get_xdisplay (GdkGC *gc)
-{
- g_return_val_if_fail (GDK_IS_GC_X11 (gc), NULL);
-
- return GDK_SCREEN_XDISPLAY (gdk_gc_get_screen (gc));
-}
-
-/**
- * gdk_x11_gc_get_xgc:
- * @gc: a #GdkGC.
- *
- * Returns the X GC of a #GdkGC.
- *
- * Return value: an Xlib GC.
- **/
-GC
-gdk_x11_gc_get_xgc (GdkGC *gc)
-{
- GdkGCX11 *gc_x11;
-
- g_return_val_if_fail (GDK_IS_GC_X11 (gc), NULL);
-
- gc_x11 = GDK_GC_X11 (gc);
-
- if (gc_x11->dirty_mask)
- _gdk_x11_gc_flush (gc);
-
- return gc_x11->xgc;
-}
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index f9c205bf82..3ea4b4d58a 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -41,34 +41,8 @@
#include "config.h"
-#define GDK_TYPE_GC_X11 (_gdk_gc_x11_get_type ())
-#define GDK_GC_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_GC_X11, GdkGCX11))
-#define GDK_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_GC_X11, GdkGCX11Class))
-#define GDK_IS_GC_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_GC_X11))
-#define GDK_IS_GC_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GC_X11))
-#define GDK_GC_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GC_X11, GdkGCX11Class))
-
typedef struct _GdkCursorPrivate GdkCursorPrivate;
typedef struct _GdkVisualPrivate GdkVisualPrivate;
-typedef struct _GdkGCX11 GdkGCX11;
-typedef struct _GdkGCX11Class GdkGCX11Class;
-
-struct _GdkGCX11
-{
- GdkGC parent_instance;
-
- GC xgc;
- GdkScreen *screen;
- guint16 dirty_mask;
- guint have_clip_region : 1;
- guint have_clip_mask : 1;
- guint depth : 8;
-};
-
-struct _GdkGCX11Class
-{
- GdkGCClass parent_class;
-};
struct _GdkCursorPrivate
{
@@ -98,14 +72,8 @@ gint _gdk_send_xevent (GdkDisplay *display,
glong event_mask,
XEvent *event_send);
-GType _gdk_gc_x11_get_type (void);
-
gboolean _gdk_x11_have_render (GdkDisplay *display);
-GdkGC *_gdk_x11_gc_new (GdkDrawable *drawable,
- GdkGCValues *values,
- GdkGCValuesMask values_mask);
-
/* Routines from gdkgeometry-x11.c */
void _gdk_window_move_resize_child (GdkWindow *window,
gint x,
@@ -150,8 +118,6 @@ void _gdk_keymap_add_virtual_modifiers_compat (GdkKeymap *keymap,
gboolean _gdk_keymap_key_is_modifier (GdkKeymap *keymap,
guint keycode);
-GC _gdk_x11_gc_flush (GdkGC *gc);
-
void _gdk_x11_initialize_locale (void);
void _gdk_xgrab_check_unmap (GdkWindow *window,
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 44b0ea668d..0053dae1de 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -48,8 +48,6 @@ Display *gdk_x11_cursor_get_xdisplay (GdkCursor *cursor);
Cursor gdk_x11_cursor_get_xcursor (GdkCursor *cursor);
Display *gdk_x11_display_get_xdisplay (GdkDisplay *display);
Visual * gdk_x11_visual_get_xvisual (GdkVisual *visual);
-Display *gdk_x11_gc_get_xdisplay (GdkGC *gc);
-GC gdk_x11_gc_get_xgc (GdkGC *gc);
Screen * gdk_x11_screen_get_xscreen (GdkScreen *screen);
int gdk_x11_screen_get_screen_number (GdkScreen *screen);
void gdk_x11_window_set_user_time (GdkWindow *window,
@@ -86,13 +84,10 @@ gint gdk_x11_get_default_screen (void);
#define GDK_PIXMAP_XID(pix) (GDK_DRAWABLE_IMPL_X11(((GdkPixmapObject *)pix)->impl)->xid)
#define GDK_DRAWABLE_XDISPLAY(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XDISPLAY (win) : GDK_PIXMAP_XDISPLAY (win))
#define GDK_DRAWABLE_XID(win) (GDK_IS_WINDOW (win) ? GDK_WINDOW_XID (win) : GDK_PIXMAP_XID (win))
-#define GDK_GC_XDISPLAY(gc) (GDK_SCREEN_XDISPLAY(GDK_GC_X11(gc)->screen))
-#define GDK_GC_XGC(gc) (GDK_GC_X11(gc)->xgc)
#define GDK_SCREEN_XDISPLAY(screen) (GDK_SCREEN_X11 (screen)->xdisplay)
#define GDK_SCREEN_XSCREEN(screen) (GDK_SCREEN_X11 (screen)->xscreen)
#define GDK_SCREEN_XNUMBER(screen) (GDK_SCREEN_X11 (screen)->screen_num)
#define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate *) vis)->xvisual)
-#define GDK_GC_GET_XGC(gc) (GDK_GC_X11(gc)->dirty_mask ? _gdk_x11_gc_flush (gc) : ((GdkGCX11 *)(gc))->xgc)
#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID
#else /* GDK_COMPILATION */
@@ -110,8 +105,6 @@ gint gdk_x11_get_default_screen (void);
#define GDK_PIXMAP_XID(win) (gdk_x11_drawable_get_xid (win))
#define GDK_DRAWABLE_XDISPLAY(win) (gdk_x11_drawable_get_xdisplay (win))
#define GDK_DRAWABLE_XID(win) (gdk_x11_drawable_get_xid (win))
-#define GDK_GC_XDISPLAY(gc) (gdk_x11_gc_get_xdisplay (gc))
-#define GDK_GC_XGC(gc) (gdk_x11_gc_get_xgc (gc))
#define GDK_SCREEN_XDISPLAY(screen) (gdk_x11_display_get_xdisplay (gdk_screen_get_display (screen)))
#define GDK_SCREEN_XSCREEN(screen) (gdk_x11_screen_get_xscreen (screen))
#define GDK_SCREEN_XNUMBER(screen) (gdk_x11_screen_get_screen_number (screen))