summaryrefslogtreecommitdiff
path: root/pango/pangocairo-win32fontmap.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/pangocairo-win32fontmap.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/pangocairo-win32fontmap.c')
-rw-r--r--pango/pangocairo-win32fontmap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pango/pangocairo-win32fontmap.c b/pango/pangocairo-win32fontmap.c
index c5ec6cd2..cd4e12ee 100644
--- a/pango/pangocairo-win32fontmap.c
+++ b/pango/pangocairo-win32fontmap.c
@@ -33,12 +33,23 @@ struct _PangoCairoWin32FontMapClass
PangoWin32FontMapClass parent_class;
};
+static guint
+pango_cairo_win32_font_map_get_serial (PangoFontMap *fontmap)
+{
+ PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (fontmap);
+
+ return cwfontmap->serial;
+}
+
static void
pango_cairo_win32_font_map_set_resolution (PangoCairoFontMap *cfontmap,
double dpi)
{
PangoCairoWin32FontMap *cwfontmap = PANGO_CAIRO_WIN32_FONT_MAP (cfontmap);
+ cwfontmap->serial++;
+ if (cwfontmap->serial == 0)
+ cwfontmap->serial++;
cwfontmap->dpi = dpi;
}
@@ -89,14 +100,17 @@ static void
pango_cairo_win32_font_map_class_init (PangoCairoWin32FontMapClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
+ PangoFontMapClass *fontmap_class = PANGO_FONT_MAP_CLASS (class);
PangoWin32FontMapClass *win32fontmap_class = PANGO_WIN32_FONT_MAP_CLASS (class);
gobject_class->finalize = pango_cairo_win32_font_map_finalize;
+ fontmap_class->get_serial = pango_cairo_win32_font_map_get_serial;
win32fontmap_class->find_font = pango_cairo_win32_font_map_find_font;
}
static void
pango_cairo_win32_font_map_init (PangoCairoWin32FontMap *cwfontmap)
{
+ cwfontmap->serial = 1;
cwfontmap->dpi = GetDeviceCaps (pango_win32_get_dc (), LOGPIXELSY);
}