summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-12-04 23:33:24 -0500
committerMatthias Clasen <mclasen@redhat.com>2019-12-04 23:33:24 -0500
commitca25302c53ae0c54c51d79bee5986b7a0bbb25d1 (patch)
treede25138a2a38048e963122e2e7ef3fd2c383a250 /pango/pangofc-fontmap.c
parentd82d4093c083e087ccd6823bfad836f25249eeb9 (diff)
downloadpango-ca25302c53ae0c54c51d79bee5986b7a0bbb25d1.tar.gz
fcfontmap: Emit GListModel::changed
We can implement this a bit better in the fontconfig backend.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 626fd1eb..49040b24 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -233,6 +233,8 @@ static PangoFont *pango_fc_font_map_new_font (PangoFcFontMap *fontmap,
static PangoFontFace *pango_fc_font_map_get_face (PangoFontMap *fontmap,
PangoFont *font);
+static void pango_fc_font_map_changed (PangoFontMap *fontmap);
+
static guint pango_fc_font_face_data_hash (PangoFcFontFaceData *key);
static gboolean pango_fc_font_face_data_equal (PangoFcFontFaceData *key1,
PangoFcFontFaceData *key2);
@@ -1241,6 +1243,7 @@ pango_fc_font_map_class_init (PangoFcFontMapClass *class)
fontmap_class->get_family = pango_fc_font_map_get_family;
fontmap_class->get_face = pango_fc_font_map_get_face;
fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_FC;
+ fontmap_class->changed = pango_fc_font_map_changed;
}
@@ -1975,15 +1978,31 @@ pango_fc_font_map_load_fontset (PangoFontMap *fontmap,
void
pango_fc_font_map_cache_clear (PangoFcFontMap *fcfontmap)
{
+ guint removed, added;
+
if (G_UNLIKELY (fcfontmap->priv->closed))
return;
+ removed = fcfontmap->priv->n_families;
+
pango_fc_font_map_fini (fcfontmap);
pango_fc_font_map_init (fcfontmap);
+
+ ensure_families (fcfontmap);
+
+ added = fcfontmap->priv->n_families;
+
+ g_list_model_items_changed (G_LIST_MODEL (fcfontmap), 0, removed, added);
pango_font_map_changed (PANGO_FONT_MAP (fcfontmap));
}
+static void
+pango_fc_font_map_changed (PangoFontMap *fontmap)
+{
+ /* we emit GListModel::changed in pango_fc_font_map_cache_clear() */
+}
+
/**
* pango_fc_font_map_config_changed:
* @fcfontmap: a #PangoFcFontMap