From 807c14741fb1ae2179afed5f7763f5d872b8d199 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 30 Jun 2010 16:25:03 +0200 Subject: [PATCH] Deprecate GdkRegion symbols that have no Cairo equivalent https://bugzilla.gnome.org/show_bug.cgi?id=613284 --- gdk/gdk.symbols | 10 ++++++++++ gdk/gdkpolyreg-generic.c | 3 +++ gdk/gdkregion-generic.c | 11 +++++++++++ gdk/gdkregion.h | 12 ++++++++++++ 4 files changed, 36 insertions(+) diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index fe0a1567db..d97ef35505 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -220,7 +220,9 @@ 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 +#ifndef GDK_DISABLE_DEPRECATED gdk_fill_rule_get_type G_GNUC_CONST +#endif gdk_filter_return_get_type G_GNUC_CONST gdk_function_get_type G_GNUC_CONST gdk_grab_status_get_type G_GNUC_CONST @@ -1015,7 +1017,9 @@ gdk_region_copy gdk_region_destroy gdk_region_empty gdk_region_equal +#ifndef GDK_DISABLE_DEPRECATED gdk_region_rect_equal +#endif gdk_region_get_clipbox gdk_region_get_rectangles gdk_region_intersect @@ -1024,20 +1028,26 @@ gdk_region_offset gdk_region_point_in gdk_region_rectangle gdk_region_rect_in +#ifndef GDK_DISABLE_DEPRECATED gdk_region_shrink gdk_region_spans_intersect_foreach +#endif gdk_region_subtract gdk_region_union gdk_region_union_with_rect +#ifndef GDK_DISABLE_DEPRECATED gdk_region_xor #endif #endif +#endif #if IN_HEADER(__GDK_REGION_H__) #if IN_FILE(__GDK_POLYREG_GENERIC_C__) +#ifndef GDK_DISABLE_DEPRECATED gdk_region_polygon #endif #endif +#endif #if IN_HEADER(__GDK_RGB_H__) #if IN_FILE(__GDK_RGB_C__) diff --git a/gdk/gdkpolyreg-generic.c b/gdk/gdkpolyreg-generic.c index 95433383a2..dd2ff89522 100644 --- a/gdk/gdkpolyreg-generic.c +++ b/gdk/gdkpolyreg-generic.c @@ -458,6 +458,9 @@ PtsToRegion (int numFullPtBlocks, * number of points. * * Returns: a new #GdkRegion based on the given polygon + * + * Deprecated: 2.22: There is no replacement. For working with paths, please + * use Cairo. */ GdkRegion * gdk_region_polygon (const GdkPoint *points, diff --git a/gdk/gdkregion-generic.c b/gdk/gdkregion-generic.c index 0801b1ebfd..10ad0ccf44 100644 --- a/gdk/gdkregion-generic.c +++ b/gdk/gdkregion-generic.c @@ -469,6 +469,8 @@ Compress(GdkRegion *r, * * Resizes a region by the specified amount. * Positive values shrink the region. Negative values expand it. + * + * Deprecated: 2.22: There is no replacement for this function. */ void gdk_region_shrink (GdkRegion *region, @@ -1507,6 +1509,10 @@ gdk_region_subtract (GdkRegion *source1, * Sets the area of @source1 to the exclusive-OR of the areas of @source1 * and @source2. The resulting area is the set of pixels contained in one * or the other of the two sources but not in both. + * + * Deprecated: 2.22: There is no replacement, but the function can be + * reimplemented using gdk_region_intersect() and + * gdk_region_subract() easily. **/ void gdk_region_xor (GdkRegion *source1, @@ -1591,6 +1597,9 @@ gdk_region_equal (const GdkRegion *region1, * Returns: %TRUE if @region and @rectangle are equal. * * Since: 2.18 + * + * Deprecated: 2.22: Use gdk_region_new_rect() and gdk_region_equal() to + * achieve the same effect. */ gboolean gdk_region_rect_equal (const GdkRegion *region, @@ -1804,6 +1813,8 @@ gdk_region_unsorted_spans_intersect_foreach (GdkRegion *region, * @data: data to pass to @function * * Calls a function on each span in the intersection of @region and @spans. + * + * Deprecated: 2.22: There is no replacement. */ void gdk_region_spans_intersect_foreach (GdkRegion *region, diff --git a/gdk/gdkregion.h b/gdk/gdkregion.h index 0adffa1a08..454194f78c 100644 --- a/gdk/gdkregion.h +++ b/gdk/gdkregion.h @@ -35,6 +35,7 @@ G_BEGIN_DECLS +#ifndef GDK_DISABLE_DEPRECATED /* GC fill rule for polygons * EvenOddRule * WindingRule @@ -44,6 +45,7 @@ typedef enum GDK_EVEN_ODD_RULE, GDK_WINDING_RULE } GdkFillRule; +#endif /* Types of overlapping between a rectangle and a region * GDK_OVERLAP_RECTANGLE_IN: rectangle is in region @@ -57,13 +59,17 @@ typedef enum GDK_OVERLAP_RECTANGLE_PART } GdkOverlapType; +#ifndef GDK_DISABLE_DEPRECATED typedef void (* GdkSpanFunc) (GdkSpan *span, gpointer data); +#endif GdkRegion * gdk_region_new (void); +#ifndef GDK_DISABLE_DEPRECATED GdkRegion * gdk_region_polygon (const GdkPoint *points, gint n_points, GdkFillRule fill_rule); +#endif GdkRegion * gdk_region_copy (const GdkRegion *region); GdkRegion * gdk_region_rectangle (const GdkRectangle *rectangle); void gdk_region_destroy (GdkRegion *region); @@ -77,8 +83,10 @@ void gdk_region_get_rectangles (const GdkRegion *region, gboolean gdk_region_empty (const GdkRegion *region); gboolean gdk_region_equal (const GdkRegion *region1, const GdkRegion *region2); +#ifndef GDK_DISABLE_DEPRECATED gboolean gdk_region_rect_equal (const GdkRegion *region, const GdkRectangle *rectangle); +#endif gboolean gdk_region_point_in (const GdkRegion *region, int x, int y); @@ -88,9 +96,11 @@ GdkOverlapType gdk_region_rect_in (const GdkRegion *region, void gdk_region_offset (GdkRegion *region, gint dx, gint dy); +#ifndef GDK_DISABLE_DEPRECATED void gdk_region_shrink (GdkRegion *region, gint dx, gint dy); +#endif void gdk_region_union_with_rect (GdkRegion *region, const GdkRectangle *rect); void gdk_region_intersect (GdkRegion *source1, @@ -99,6 +109,7 @@ void gdk_region_union (GdkRegion *source1, const GdkRegion *source2); void gdk_region_subtract (GdkRegion *source1, const GdkRegion *source2); +#ifndef GDK_DISABLE_DEPRECATED void gdk_region_xor (GdkRegion *source1, const GdkRegion *source2); @@ -108,6 +119,7 @@ void gdk_region_spans_intersect_foreach (GdkRegion *region, gboolean sorted, GdkSpanFunc function, gpointer data); +#endif G_END_DECLS