[pango/pango2: 168/168] Make PangoFontMetrics struct private




commit 065d80d0e435a8f96c94b8f765c92d76b2eb9c0a
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 7 22:07:18 2022 -0400

    Make PangoFontMetrics struct private

 pango/pango-font-metrics-private.h | 16 ++++++++++++++++
 pango/pango-font-metrics.h         | 18 ------------------
 pango/pango-line.c                 |  1 +
 pango/pango-run.c                  |  1 +
 tests/test-font.c                  |  4 ++--
 5 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/pango/pango-font-metrics-private.h b/pango/pango-font-metrics-private.h
index 6401a969..70ddfa52 100644
--- a/pango/pango-font-metrics-private.h
+++ b/pango/pango-font-metrics-private.h
@@ -21,4 +21,20 @@
 
 #include <pango/pango-font-metrics.h>
 
+struct _PangoFontMetrics
+{
+  /* <private> */
+  guint ref_count;
+
+  int ascent;
+  int descent;
+  int height;
+  int approximate_char_width;
+  int approximate_digit_width;
+  int underline_position;
+  int underline_thickness;
+  int strikethrough_position;
+  int strikethrough_thickness;
+};
+
 PangoFontMetrics *pango_font_metrics_new (void);
diff --git a/pango/pango-font-metrics.h b/pango/pango-font-metrics.h
index e7b1b8b2..7f5a518c 100644
--- a/pango/pango-font-metrics.h
+++ b/pango/pango-font-metrics.h
@@ -20,10 +20,8 @@
 #pragma once
 
 #include <pango/pango-types.h>
-#include <pango/pango-font-description.h>
 
 #include <glib-object.h>
-#include <hb.h>
 
 G_BEGIN_DECLS
 
@@ -50,22 +48,6 @@ typedef struct _PangoFontMetrics PangoFontMetrics;
 
 #define PANGO_TYPE_FONT_METRICS  (pango_font_metrics_get_type ())
 
-struct _PangoFontMetrics
-{
-  /* <private> */
-  guint ref_count;
-
-  int ascent;
-  int descent;
-  int height;
-  int approximate_char_width;
-  int approximate_digit_width;
-  int underline_position;
-  int underline_thickness;
-  int strikethrough_position;
-  int strikethrough_thickness;
-};
-
 PANGO_AVAILABLE_IN_ALL
 GType             pango_font_metrics_get_type                    (void) G_GNUC_CONST;
 PANGO_AVAILABLE_IN_ALL
diff --git a/pango/pango-line.c b/pango/pango-line.c
index 38c3f35d..a12aebde 100644
--- a/pango/pango-line.c
+++ b/pango/pango-line.c
@@ -9,6 +9,7 @@
 #include "pango-attr-iterator-private.h"
 #include "pango-item-private.h"
 #include "pango-run-private.h"
+#include "pango-font-metrics-private.h"
 
 #include <math.h>
 #include <hb-ot.h>
diff --git a/pango/pango-run.c b/pango/pango-run.c
index a1ba537a..88c1a6de 100644
--- a/pango/pango-run.c
+++ b/pango/pango-run.c
@@ -3,6 +3,7 @@
 #include "pango-run-private.h"
 #include "pango-item-private.h"
 #include "pango-impl-utils.h"
+#include "pango-font-metrics-private.h"
 
 #include <math.h>
 
diff --git a/tests/test-font.c b/tests/test-font.c
index 4981154c..207b2818 100644
--- a/tests/test-font.c
+++ b/tests/test-font.c
@@ -484,8 +484,8 @@ test_font_metrics (void)
 
   metrics = pango_font_get_metrics (NULL, NULL);
 
-  g_assert_cmpint (metrics->approximate_char_width, ==, PANGO_SCALE * PANGO_UNKNOWN_GLYPH_WIDTH);
-  g_assert_cmpint (metrics->approximate_digit_width, ==, PANGO_SCALE * PANGO_UNKNOWN_GLYPH_WIDTH);
+  g_assert_cmpint (pango_font_metrics_get_approximate_char_width (metrics), ==, PANGO_SCALE * 
PANGO_UNKNOWN_GLYPH_WIDTH);
+  g_assert_cmpint (pango_font_metrics_get_approximate_digit_width (metrics), ==, PANGO_SCALE * 
PANGO_UNKNOWN_GLYPH_WIDTH);
 
   pango_font_metrics_unref (metrics);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]