[pangomm] Font, FontFace, FontFamily, FontMetrics: Add new methods



commit b5d717fa09009bde4a02f74f648b999f8a6096b7
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Jul 22 10:32:11 2020 +0200

    Font, FontFace, FontFamily, FontMetrics: Add new methods

 pango/src/font.ccg        |  7 +------
 pango/src/font.hg         | 14 ++++++++++----
 pango/src/fontface.ccg    |  9 ++-------
 pango/src/fontface.hg     | 14 +++++---------
 pango/src/fontfamily.hg   | 13 +++++++++----
 pango/src/fontmetrics.hg  |  3 +--
 tools/m4/convert_pango.m4 |  7 +++++--
 7 files changed, 33 insertions(+), 34 deletions(-)
---
diff --git a/pango/src/font.ccg b/pango/src/font.ccg
index fb8199d..256569d 100644
--- a/pango/src/font.ccg
+++ b/pango/src/font.ccg
@@ -1,8 +1,4 @@
-// -*- c++ -*-
-/* $Id: font.ccg,v 1.2 2006/06/08 20:39:39 murrayc Exp $ */
-
 /* 
- *
  * Copyright 1998-1999 The Gtk-- Development Team
  * Copyright 2001      Free Software Foundation
  *
@@ -21,6 +17,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <pangomm/fontface.h>
 #include <pangomm/fontmap.h>
 
 namespace Pango
@@ -46,5 +43,3 @@ Rectangle Font::get_glyph_logical_extents(Glyph glyph) const
 }
 
 } /* namespace Pango */
-
-
diff --git a/pango/src/font.hg b/pango/src/font.hg
index 5b1b72c..652a6d5 100644
--- a/pango/src/font.hg
+++ b/pango/src/font.hg
@@ -1,5 +1,3 @@
-/* $Id: font.hg,v 1.2 2006/06/08 20:39:39 murrayc Exp $ */
-
 /* font.h
  * 
  * Copyright (C) 1998-1999 The gtkmm Development Team 
@@ -45,6 +43,7 @@ const double SCALE_X_LARGE  = 1.4399999999999;
 const double SCALE_XX_LARGE = 1.728;
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
+class PANGOMM_API FontFace;
 class PANGOMM_API FontMap;
 #endif //DOXYGEN_SHOULD_SKIP_THIS
 
@@ -53,7 +52,7 @@ class PANGOMM_API FontMap;
 class PANGOMM_API Font : public Glib::Object
 {
   _CLASS_GOBJECT(Font, PangoFont, PANGO_FONT, Glib::Object, GObject, , , PANGOMM_API)
-  _IGNORE(pango_font_find_shaper) //This would return a PangoEngineShape* but the definition of the struct 
is surrounded by #define PANGO_ENABLE_BACKEND [...] #endif. So don't wrap it.
+  _IGNORE(pango_font_find_shaper) // Deprecated
 
 public:
   _WRAP_METHOD(FontDescription describe() const, pango_font_describe)
@@ -72,6 +71,11 @@ public:
   _WRAP_METHOD(Glib::RefPtr<FontMap> get_font_map(), pango_font_get_font_map)
   _WRAP_METHOD(Glib::RefPtr<const FontMap> get_font_map() const, pango_font_get_font_map, constversion)
 
+  _WRAP_METHOD(Glib::RefPtr<FontFace> get_face(), pango_font_get_face, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const FontFace> get_face() const, pango_font_get_face, refreturn, constversion)
+
+  _WRAP_METHOD(bool has_char(gunichar wc) const, pango_font_has_char)
+
   /** Get the ink extents of a glyph within the font.
    * @param glyph The glyph index.
    * @return The extents of the glyph as drawn.
@@ -83,7 +87,9 @@ public:
    * @return The logical extents of the glyph.
    */
   Rectangle get_glyph_logical_extents(Glyph glyph) const;
+
+// PangoFontClass is hidden when PANGO_DISABLE_DEPRECATED is defined.
+// Don't wrap vfuncs.
 };
 
 } /* namespace Pango */
-
diff --git a/pango/src/fontface.ccg b/pango/src/fontface.ccg
index 5e70276..60327da 100644
--- a/pango/src/fontface.ccg
+++ b/pango/src/fontface.ccg
@@ -1,8 +1,4 @@
-// -*- c++ -*-
-/* $Id: fontface.ccg,v 1.2 2004/03/03 01:07:40 murrayc Exp $ */
-
 /* 
- *
  * Copyright 1998-2002 The gtkmm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -20,6 +16,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <pangomm/fontfamily.h>
+
 namespace Pango
 {
 
@@ -33,6 +31,3 @@ std::vector<int> FontFace::list_sizes() const
 }
 
 } //namespace Pango
-
-
-                            
\ No newline at end of file
diff --git a/pango/src/fontface.hg b/pango/src/fontface.hg
index b8cc01e..65bf71c 100644
--- a/pango/src/fontface.hg
+++ b/pango/src/fontface.hg
@@ -1,5 +1,3 @@
-/* $Id: fontface.hg,v 1.3 2004/03/03 01:07:40 murrayc Exp $ */
-
 /* fontface.h
  * 
  * Copyright 2001      The gtkmm Development Team
@@ -19,7 +17,6 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-
 #include <pangomm/fontdescription.h>
 #include <glibmm/object.h>
 #include <pango/pango-font.h>
@@ -29,6 +26,7 @@ _PINCLUDE(glibmm/private/object_p.h)
 
 namespace Pango
 {
+class PANGOMM_API FontFamily;
 
 /** A Pango::FontFace is used to represent a group of fonts with the same family, slant, weight, width, but 
varying sizes.
  */
@@ -48,13 +46,11 @@ public:
   _IGNORE(pango_font_face_list_sizes)
 
   _WRAP_METHOD(bool is_synthesized() const, pango_font_face_is_synthesized)
+  _WRAP_METHOD(Glib::RefPtr<FontFamily> get_family(), pango_font_face_get_family, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const FontFamily> get_family() const, pango_font_face_get_family, refreturn, 
constversion)
   
-protected:
-  //We can't wrap the virtual functions because PangoFontFace has a hidden class.
-  //We probably don't need to subclass this anyway.
-  //_WRAP_VFUNC(const char* get_name() const, "get_face_name")
-  //_WRAP_VFUNC(PangoFontDescription* describe(), "describe")
+// PangoFontFaceClass is hidden when PANGO_DISABLE_DEPRECATED is defined.
+// Don't wrap vfuncs.
 };
 
 } /* namespace Pango */
-
diff --git a/pango/src/fontfamily.hg b/pango/src/fontfamily.hg
index 382ba4d..d6ab740 100644
--- a/pango/src/fontfamily.hg
+++ b/pango/src/fontfamily.hg
@@ -1,5 +1,3 @@
-/* $Id: fontfamily.hg,v 1.2 2004/03/03 01:07:40 murrayc Exp $ */
-
 /* fontfamily.h
  * 
  * Copyright 2001      The gtkmm Development Team
@@ -19,7 +17,6 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-
 #include <glibmm/object.h>
 #include <giomm/listmodel.h>
 #include <pangomm/fontface.h>
@@ -49,6 +46,15 @@ public:
 
   _WRAP_METHOD(Glib::ustring get_name() const, pango_font_family_get_name)
   _WRAP_METHOD(bool is_monospace() const, pango_font_family_is_monospace)
+  _WRAP_METHOD(bool is_variable() const, pango_font_family_is_variable)
+
+  _WRAP_METHOD(Glib::RefPtr<FontFace> get_face(const Glib::ustring& name{NULL} = {}),
+    pango_font_family_get_face, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const FontFace> get_face(const Glib::ustring& name{NULL} = {}) const,
+    pango_font_family_get_face, refreturn, constversion)
+
+// PangoFontFamilyClass is hidden when PANGO_DISABLE_DEPRECATED is defined.
+// Don't wrap vfuncs.
 };
 
 /*
@@ -66,4 +72,3 @@ struct FontFamilyRefPtrTraits
 */
 
 } // namespace Pango
-
diff --git a/pango/src/fontmetrics.hg b/pango/src/fontmetrics.hg
index 73f4801..0eb8954 100644
--- a/pango/src/fontmetrics.hg
+++ b/pango/src/fontmetrics.hg
@@ -1,5 +1,3 @@
-/* $Id: fontmetrics.hg,v 1.2 2004/12/01 11:46:29 murrayc Exp $ */
-
 /* fontmetrics.h
  *
  * Copyright (C) 1998-1999 The gtkmm Development Team
@@ -38,6 +36,7 @@ class PANGOMM_API FontMetrics
 public:
   _WRAP_METHOD(int get_ascent() const, pango_font_metrics_get_ascent)
   _WRAP_METHOD(int get_descent() const, pango_font_metrics_get_descent)
+  _WRAP_METHOD(int get_height() const, pango_font_metrics_get_height)
   _WRAP_METHOD(int get_approximate_char_width() const, pango_font_metrics_get_approximate_char_width)
   _WRAP_METHOD(int get_approximate_digit_width() const, pango_font_metrics_get_approximate_digit_width)
 
diff --git a/tools/m4/convert_pango.m4 b/tools/m4/convert_pango.m4
index ddefc2f..912cb32 100644
--- a/tools/m4/convert_pango.m4
+++ b/tools/m4/convert_pango.m4
@@ -102,11 +102,16 @@ _CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPT
 #_CONVERSION(`const Glib::RefPtr<const Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const 
Pango::Font>&',`PangoFont*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pango::Font))
 
+_CONVERSION(`PangoFontFace*',`Glib::RefPtr<FontFace>',Glib::wrap($3))
+_CONVERSION(`PangoFontFace*',`Glib::RefPtr<const FontFace>',Glib::wrap($3))
 _CONVERSION(`PangoFontFace*',`Glib::RefPtr<Pango::FontFace>',Glib::wrap($3))
 _CONVERSION(`PangoFontFace*',`Glib::RefPtr<const Pango::FontFace>',Glib::wrap($3))
+_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<FontFamily>',Glib::wrap($3))
+_CONVERSION(`PangoFontFamily*',`Glib::RefPtr<const FontFamily>',Glib::wrap($3))
 _CONVERSION(`PangoFontFamily*',`Glib::RefPtr<Pango::FontFamily>',Glib::wrap($3))
 _CONVERSION(`PangoFontFamily*',`Glib::RefPtr<const Pango::FontFamily>',Glib::wrap($3))
 
+_CONVERSION(`PangoFontMap*',`Glib::RefPtr<Pango::FontMap>',`Glib::wrap($3)')
 _CONVERSION(`PangoFontMap*',`Glib::RefPtr<FontMap>',Glib::wrap($3))
 _CONVERSION(`PangoFontMap*',`Glib::RefPtr<const FontMap>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<FontMap>&',`PangoFontMap*',__CONVERT_REFPTR_TO_P)
@@ -163,8 +168,6 @@ _CONVERSION(`const Matrix&',`const PangoMatrix*',`&($3)')
 #_CONVERSION(`const PangoMatrix*',`Matrix',`($3) ? *($3) : PANGO_MATRIX_INIT')
 #_CONVERSION(`const Matrix&',`PangoMatrix*',`const_cast<PangoMatrix*>(&($3))')
 
-_CONVERSION(`PangoFontMap*',`Glib::RefPtr<Pango::FontMap>',`Glib::wrap($3)')
-
 _CONVERSION(`const Cairo::FontOptions&',`const cairo_font_options_t*',`($3).cobj()')
 
 _CONVERSION(`const LogAttr&',`PangoLogAttr*',&(const_cast<LogAttr&>($3)))


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