[pango/fc-font-struct] Make PangoFcFont struct available again



commit 24e2fcbe69bd8e862e872b0e93b72c3e21d07294
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 12 08:02:04 2019 -0400

    Make PangoFcFont struct available again
    
    Unfortunately, some applications are poking
    directly at PangoFcFont struct fields. Put the
    structs back in the public headers for now,
    but deprecated.

 pango/pango-font-private.h   | 21 ---------------------
 pango/pango-font.h           | 25 +++++++++++++++++++++++++
 pango/pangofc-font-private.h | 27 ---------------------------
 pango/pangofc-font.h         | 30 ++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 48 deletions(-)
---
diff --git a/pango/pango-font-private.h b/pango/pango-font-private.h
index fb496a96..d43440b4 100644
--- a/pango/pango-font-private.h
+++ b/pango/pango-font-private.h
@@ -134,27 +134,6 @@ struct _PangoFontFaceClass
 
 typedef struct _PangoFontClass       PangoFontClass;
 
-/**
- * PangoFont:
- *
- * The #PangoFont structure is used to represent
- * a font in a rendering-system-independent matter.
- * To create an implementation of a #PangoFont,
- * the rendering-system specific code should allocate
- * a larger structure that contains a nested
- * #PangoFont, fill in the <structfield>klass</structfield> member of
- * the nested #PangoFont with a pointer to
- * a appropriate #PangoFontClass, then call
- * pango_font_init() on the structure.
- *
- * The #PangoFont structure contains one member
- * which the implementation fills in.
- */
-struct _PangoFont
-{
-  GObject parent_instance;
-};
-
 struct _PangoFontClass
 {
   GObjectClass parent_class;
diff --git a/pango/pango-font.h b/pango/pango-font.h
index 13730fa5..18d16b37 100644
--- a/pango/pango-font.h
+++ b/pango/pango-font.h
@@ -460,6 +460,31 @@ gboolean              pango_font_face_is_synthesized (PangoFontFace  *face) G_GN
 #define PANGO_FONT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont))
 #define PANGO_IS_FONT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT))
 
+#ifndef PANGO_DISABLE_DEPRECATED
+
+/**
+ * PangoFont:
+ *
+ * The #PangoFont structure is used to represent
+ * a font in a rendering-system-independent matter.
+ * To create an implementation of a #PangoFont,
+ * the rendering-system specific code should allocate
+ * a larger structure that contains a nested
+ * #PangoFont, fill in the <structfield>klass</structfield> member of
+ * the nested #PangoFont with a pointer to
+ * a appropriate #PangoFontClass, then call
+ * pango_font_init() on the structure.
+ *
+ * The #PangoFont structure contains one member
+ * which the implementation fills in.
+ */
+struct _PangoFont
+{
+  GObject parent_instance;
+};
+
+#endif /* PANGO_DISABLE_DEPRECATED */
+
 PANGO_AVAILABLE_IN_ALL
 GType                 pango_font_get_type          (void) G_GNUC_CONST;
 
diff --git a/pango/pangofc-font-private.h b/pango/pangofc-font-private.h
index 30a2e7fd..588bd512 100644
--- a/pango/pangofc-font-private.h
+++ b/pango/pangofc-font-private.h
@@ -27,7 +27,6 @@
 
 G_BEGIN_DECLS
 
-
 /**
  * PANGO_RENDER_TYPE_FC:
  *
@@ -41,32 +40,6 @@ G_BEGIN_DECLS
 #define PANGO_IS_FC_FONT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FC_FONT))
 #define PANGO_FC_FONT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FC_FONT, 
PangoFcFontClass))
 
-/**
- * PangoFcFont:
- *
- * #PangoFcFont is a base class for font implementations
- * using the Fontconfig and FreeType libraries and is used in
- * conjunction with #PangoFcFontMap. When deriving from this
- * class, you need to implement all of its virtual functions
- * other than shutdown() along with the get_glyph_extents()
- * virtual function from #PangoFont.
- **/
-struct _PangoFcFont
-{
-  PangoFont parent_instance;
-
-  FcPattern *font_pattern;         /* fully resolved pattern */
-  PangoFontMap *fontmap;           /* associated map */
-  gpointer priv;                   /* used internally */
-  PangoMatrix matrix;              /* used internally */
-  PangoFontDescription *description;
-
-  GSList *metrics_by_lang;
-
-  guint is_hinted : 1;
-  guint is_transformed : 1;
-};
-
 /**
  * PangoFcFontClass:
  * @lock_face: Returns the FT_Face of the font and increases
diff --git a/pango/pangofc-font.h b/pango/pangofc-font.h
index 0cd4f174..641f5947 100644
--- a/pango/pangofc-font.h
+++ b/pango/pangofc-font.h
@@ -49,6 +49,36 @@ G_BEGIN_DECLS
 typedef struct _PangoFcFont      PangoFcFont;
 typedef struct _PangoFcFontClass PangoFcFontClass;
 
+#ifndef PANGO_DISABLE_DEPRECATED
+
+/**
+ * PangoFcFont:
+ *
+ * #PangoFcFont is a base class for font implementations
+ * using the Fontconfig and FreeType libraries and is used in
+ * conjunction with #PangoFcFontMap. When deriving from this
+ * class, you need to implement all of its virtual functions
+ * other than shutdown() along with the get_glyph_extents()
+ * virtual function from #PangoFont.
+ **/
+struct _PangoFcFont
+{
+  PangoFont parent_instance;
+
+  FcPattern *font_pattern;          /* fully resolved pattern */
+  PangoFontMap *fontmap;            /* associated map */
+  gpointer priv;                    /* used internally */
+  PangoMatrix matrix;               /* used internally */
+  PangoFontDescription *description;
+
+  GSList *metrics_by_lang;
+
+  guint is_hinted : 1;
+  guint is_transformed : 1;
+};
+
+#endif /* PANGO_DISABLE_DEPRECATED */
+
 PANGO_AVAILABLE_IN_ALL
 GType      pango_fc_font_get_type (void) G_GNUC_CONST;
 


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