[pangomm: 1/2] Let FontMap and FontFamily implement ListModel
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pangomm: 1/2] Let FontMap and FontFamily implement ListModel
- Date: Mon, 20 Jul 2020 08:56:32 +0000 (UTC)
commit 1702109264b0690ba77e67166d48fc80e4ecadb4
Author: Andreas Persson <andreasp56 outlook com>
Date: Sun Jul 19 18:26:04 2020 +0200
Let FontMap and FontFamily implement ListModel
Let the FontMap and FontFamily classes implement the Gio::ListModel
interface, just as the C level pango classes do. For this, a dependency
to giomm was added. Wrap CairoFontMap::get_default().
configure.ac | 2 +-
meson.build | 5 +++--
pango/src/cairofontmap.hg | 3 ++-
pango/src/fontfamily.hg | 4 +++-
pango/src/fontmap.hg | 4 +++-
5 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index fd93a84..33645eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ MM_AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
AC_DISABLE_STATIC
LT_INIT([win32-dll])
-AC_SUBST([PANGOMM_MODULES], ['glibmm-2.66 >= 2.65.1 cairomm-1.16 >= 1.15.1 pangocairo >= 1.41.0'])
+AC_SUBST([PANGOMM_MODULES], ['giomm-2.66 >= 2.65.1 cairomm-1.16 >= 1.15.1 pangocairo >= 1.41.0'])
AC_SUBST([MSVC_TOOLSET_VER], [''])
PKG_CHECK_MODULES([PANGOMM], [$PANGOMM_MODULES])
diff --git a/meson.build b/meson.build
index 4c7e2b4..71ad3b6 100644
--- a/meson.build
+++ b/meson.build
@@ -103,10 +103,11 @@ cairomm_req_minor_ver = '16'
cairomm_dep = dependency('cairomm-1.@0@'.format(cairomm_req_minor_ver), version: cairomm_req)
glibmm_dep = dependency('glibmm-2.@0@'.format(glibmm_req_minor_ver), version: glibmm_req)
+giomm_dep = dependency('giomm-2.@0@'.format(glibmm_req_minor_ver), version: glibmm_req)
-pangomm_build_dep = [glibmm_dep, cairomm_dep, pangocairo_dep]
+pangomm_build_dep = [giomm_dep, cairomm_dep, pangocairo_dep]
pangomm_requires = ' '.join([
- 'glibmm-2.@0@'.format(glibmm_req_minor_ver), glibmm_req,
+ 'giomm-2.@0@'.format(glibmm_req_minor_ver), glibmm_req,
'cairomm-1.@0@'.format(cairomm_req_minor_ver), cairomm_req,
'pangocairo', pangocairo_req,
])
diff --git a/pango/src/cairofontmap.hg b/pango/src/cairofontmap.hg
index 7f58278..a500c0b 100644
--- a/pango/src/cairofontmap.hg
+++ b/pango/src/cairofontmap.hg
@@ -20,6 +20,7 @@
_CONFIGINCLUDE(pangommconfig.h)
#include <glibmm/interface.h>
+#include <pangomm/fontmap.h>
#include <cairomm/enums.h>
#include <pango/pangocairo.h>
@@ -40,7 +41,7 @@ class PANGOMM_API CairoFontMap : public Glib::Interface
_CLASS_INTERFACE(CairoFontMap, PangoCairoFontMap, PANGO_CAIRO_FONT_MAP, PangoCairoFontMapIface, , ,
PANGOMM_API)
public:
- //_WRAP_METHOD(static Glib::RefPtr<PangoFontMap> get_default(), pango_cairo_font_map_get_default) //TODO:
ref this?
+ _WRAP_METHOD(static Glib::RefPtr<FontMap> get_default(), pango_cairo_font_map_get_default, refreturn)
_WRAP_METHOD(void set_default(), pango_cairo_font_map_set_default)
#m4 _CONVERSION(`cairo_font_type_t',`Cairo::FontType',`static_cast<Cairo::FontType>($3)')
diff --git a/pango/src/fontfamily.hg b/pango/src/fontfamily.hg
index a437179..382ba4d 100644
--- a/pango/src/fontfamily.hg
+++ b/pango/src/fontfamily.hg
@@ -21,6 +21,7 @@
#include <glibmm/object.h>
+#include <giomm/listmodel.h>
#include <pangomm/fontface.h>
#include <pango/pango-font.h>
@@ -33,9 +34,10 @@ namespace Pango
/** A Pango::FontFamily is used to represent a family of related font faces.
* The faces in a family share a common design, but differ in slant, weight, width and other aspects.
*/
-class PANGOMM_API FontFamily : public Glib::Object
+class PANGOMM_API FontFamily : public Glib::Object, public Gio::ListModel
{
_CLASS_GOBJECT(FontFamily, PangoFontFamily, PANGO_FONT_FAMILY, Glib::Object, GObject, , , PANGOMM_API)
+ _IMPLEMENTS_INTERFACE(Gio::ListModel)
_IGNORE(pango_font_family_list_faces)
public:
diff --git a/pango/src/fontmap.hg b/pango/src/fontmap.hg
index 4065f5d..a87be51 100644
--- a/pango/src/fontmap.hg
+++ b/pango/src/fontmap.hg
@@ -18,6 +18,7 @@
*/
#include <glibmm/object.h>
+#include <giomm/listmodel.h>
#include <pangomm/font.h>
#include <pangomm/fontset.h>
#include <pangomm/fontfamily.h>
@@ -33,9 +34,10 @@ class PANGOMM_API Context;
/** A Pango::FontMap represents the set of fonts available for a particular rendering system.
*/
-class PANGOMM_API FontMap : public Glib::Object
+class PANGOMM_API FontMap : public Glib::Object, public Gio::ListModel
{
_CLASS_GOBJECT(FontMap, PangoFontMap, PANGO_FONT_MAP, Glib::Object, GObject, , , PANGOMM_API)
+ _IMPLEMENTS_INTERFACE(Gio::ListModel)
_IGNORE(pango_font_map_list_families)
public:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]