From 45cacd25ceaf75236a82f89617e790b934929681 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 21 Aug 2023 21:17:44 -0400 Subject: [PATCH] Make gsk_path_get_n_contours public It is useful to know how many contours a path consists of, for the API added in the next commit. --- gsk/gskpath.c | 6 ++++-- gsk/gskpath.h | 3 +++ gsk/gskpathprivate.h | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gsk/gskpath.c b/gsk/gskpath.c index 5173b7b6a6..9b2766806e 100644 --- a/gsk/gskpath.c +++ b/gsk/gskpath.c @@ -302,7 +302,7 @@ gsk_path_to_cairo (GskPath *self, cr); } -/*< private > +/** * gsk_path_get_n_contours: * @path: a `GskPath` * @@ -311,8 +311,10 @@ gsk_path_to_cairo (GskPath *self, * Returns: the number of contours in @path */ gsize -gsk_path_get_n_contours (const GskPath *self) +gsk_path_get_n_contours (GskPath *self) { + g_return_val_if_fail (self != NULL, 0); + return self->n_contours; } diff --git a/gsk/gskpath.h b/gsk/gskpath.h index aa3742bbff..24c596f8f3 100644 --- a/gsk/gskpath.h +++ b/gsk/gskpath.h @@ -92,6 +92,9 @@ GDK_AVAILABLE_IN_4_14 void gsk_path_to_cairo (GskPath *self, cairo_t *cr); +GDK_AVAILABLE_IN_4_14 +gsize gsk_path_get_n_contours (GskPath *self); + GDK_AVAILABLE_IN_4_14 gboolean gsk_path_is_empty (GskPath *self); diff --git a/gsk/gskpathprivate.h b/gsk/gskpathprivate.h index 9a889ba0a1..ed14663bfb 100644 --- a/gsk/gskpathprivate.h +++ b/gsk/gskpathprivate.h @@ -40,7 +40,6 @@ typedef struct _GskRealPathPoint GskRealPathPoint; GskPath * gsk_path_new_from_contours (const GSList *contours); -gsize gsk_path_get_n_contours (const GskPath *self); const GskContour * gsk_path_get_contour (const GskPath *self, gsize i);