summaryrefslogtreecommitdiff
path: root/pango/pangocoretext-fontmap.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-12-05 13:29:48 +0100
committerAlexander Larsson <alexl@redhat.com>2012-12-06 16:36:19 +0100
commit3f3a095a1809375ef600dc3a947b3ff2df08f22c (patch)
tree5d7d2cb3ada7f3fe92fb4525eea7907f185165e1 /pango/pangocoretext-fontmap.c
parentb359bb484bc7d27a835cfd6d9ffcaed582ebf2ae (diff)
downloadpango-3f3a095a1809375ef600dc3a947b3ff2df08f22c.tar.gz
Track changes in FontMaps using a serial
This adds the pango_font_map_get_serial method that lets you see if a fontmap has changes since the last check. It adds implementations to all current fontmaps. https://bugzilla.gnome.org/show_bug.cgi?id=340066
Diffstat (limited to 'pango/pangocoretext-fontmap.c')
-rw-r--r--pango/pangocoretext-fontmap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pango/pangocoretext-fontmap.c b/pango/pangocoretext-fontmap.c
index a8a9b518..7993d59e 100644
--- a/pango/pangocoretext-fontmap.c
+++ b/pango/pangocoretext-fontmap.c
@@ -1191,6 +1191,14 @@ get_first_font (PangoFontset *fontset G_GNUC_UNUSED,
return TRUE;
}
+static guint
+pango_core_text_font_map_get_serial (PangoFontMap *fontmap)
+{
+ PangoCoreTextFontMap *ctfontmap = PANGO_CORE_TEXT_FONT_MAP (fontmap);
+
+ return ctfontmap->serial;
+}
+
static PangoFont *
pango_core_text_font_map_load_font (PangoFontMap *fontmap,
PangoContext *context,
@@ -1370,6 +1378,7 @@ pango_core_text_font_map_init (PangoCoreTextFontMap *ctfontmap)
CFArrayRef ctfaces;
CFIndex i, count;
+ ctfontmap->serial = 1;
ctfontmap->families = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
@@ -1461,6 +1470,7 @@ pango_core_text_font_map_class_init (PangoCoreTextFontMapClass *class)
fontmap_class->list_families = pango_core_text_font_map_list_families;
fontmap_class->load_fontset = pango_core_text_font_map_load_fontset;
fontmap_class->shape_engine_type = PANGO_RENDER_TYPE_CORE_TEXT;
+ fontmap_class->get_serial = pango_core_text_font_map_get_serial;
}
/*