From 574a3a456d48b1645c24564f25b32001952ab397 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 29 Oct 2020 13:06:08 -0400 Subject: [PATCH] gdk: Drop GdkPoint from the api This typedef was not used in any public APIs, and is only used in the MacOS backend. It is not worth preserving as public API, move it to the only user. --- docs/reference/gdk/gdk4-sections.txt | 5 +---- gdk/gdkrectangle.c | 18 ++++++++++-------- gdk/gdktypes.h | 14 -------------- gdk/macos/GdkMacosWindow.c | 1 + gdk/macos/edgesnapping.h | 1 + gdk/macos/gdkmacosutils-private.h | 8 ++++++++ 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index ac187474cf..efbc18fc5b 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -303,11 +303,8 @@ gdk_cairo_draw_from_gl
-Points, Rectangles and Regions +Rectangles and Regions regions -GdkPoint - - GdkRectangle gdk_rectangle_intersect gdk_rectangle_union diff --git a/gdk/gdkrectangle.c b/gdk/gdkrectangle.c index edae510625..8043716044 100644 --- a/gdk/gdkrectangle.c +++ b/gdk/gdkrectangle.c @@ -30,21 +30,23 @@ /** * SECTION:regions - * @Short_description: Simple graphical data types - * @Title: Points and Rectangles + * @Short_description: Simple graphical data type + * @Title: GdkRectangle * - * GDK provides the #GdkPoint and #GdkRectangle data types for representing pixels - * and sets of pixels on the screen. Together with Cairo’s #cairo_region_t data - * type, they make up the central types for representing graphical data. - * - * A #GdkPoint represents an x and y coordinate of a point. + * GDK provides a #GdkRectangle data type for representing rectangles. + * Together with Cairo’s #cairo_region_t data type, these are the central + * types for representing sets of pixels. * * A #GdkRectangle represents the position and size of a rectangle. * The intersection of two rectangles can be computed with * gdk_rectangle_intersect(). To find the union of two rectangles use * gdk_rectangle_union(). * - * #cairo_region_t is usually used for managing clipping of graphical operations. + * #cairo_region_t is usually used for managing clipping of graphical + * operations. + * + * The graphene library has a number of other data types for regions and + * volumes in 2D and 3D. */ diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 0a0068e181..da12f125bc 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -53,20 +53,6 @@ G_BEGIN_DECLS */ #define GDK_CURRENT_TIME 0L -/** - * GdkPoint: - * @x: the x coordinate of the point - * @y: the y coordinate of the point - * - * Defines the x and y coordinates of a point. - */ -struct _GdkPoint -{ - int x; - int y; -}; -typedef struct _GdkPoint GdkPoint; - /** * GdkRectangle: * @x: the x coordinate of the top left corner diff --git a/gdk/macos/GdkMacosWindow.c b/gdk/macos/GdkMacosWindow.c index c4a133afcc..fd2ca53b26 100644 --- a/gdk/macos/GdkMacosWindow.c +++ b/gdk/macos/GdkMacosWindow.c @@ -32,6 +32,7 @@ #include "gdkmacossurface-private.h" #include "gdkmacospopupsurface-private.h" #include "gdkmacostoplevelsurface-private.h" +#include "gdkmacosutils-private.h" #include "gdkmonitorprivate.h" #include "gdksurfaceprivate.h" diff --git a/gdk/macos/edgesnapping.h b/gdk/macos/edgesnapping.h index 8769ea7e47..b7ffd8a176 100644 --- a/gdk/macos/edgesnapping.h +++ b/gdk/macos/edgesnapping.h @@ -22,6 +22,7 @@ #define __EDGE_SNAPPING_H__ #include "gdktypes.h" +#include "gdkmacosutils-private.h" G_BEGIN_DECLS diff --git a/gdk/macos/gdkmacosutils-private.h b/gdk/macos/gdkmacosutils-private.h index 678982ba97..6b81fd28ac 100644 --- a/gdk/macos/gdkmacosutils-private.h +++ b/gdk/macos/gdkmacosutils-private.h @@ -33,4 +33,12 @@ queue_contains (GQueue *queue, return queue->head == link_ || link_->prev || link_->next; } +struct _GdkPoint +{ + int x; + int y; +}; +typedef struct _GdkPoint GdkPoint; + + #endif /* __GDK_MACOS_UTILS_PRIVATE_H__ */