diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-08-02 19:18:31 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-08-02 19:18:31 +0000 |
commit | 6e571c1baebd7f14dda32081eb8f49af92f80c90 (patch) | |
tree | 82f9883a74458651f7ed3228b0602ec04b329708 | |
parent | e01c889e0b92b93afc1ec81e0cf13928bb1b9d6c (diff) | |
download | pango-6e571c1baebd7f14dda32081eb8f49af92f80c90.tar.gz |
New function allowing us to shut down a display.
Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com>
* pango/pangoxft.h pango/pangoxft-fontmap.c
(pango_xft_shutdown_display): New function allowing us to shut
down a display.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 6 | ||||
-rw-r--r-- | pango/pangoxft-fontmap.c | 65 | ||||
-rw-r--r-- | pango/pangoxft.h | 7 |
8 files changed, 92 insertions, 16 deletions
@@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 04dd452f..1282718f 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 04dd452f..1282718f 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 04dd452f..1282718f 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 04dd452f..1282718f 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 04dd452f..1282718f 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,9 @@ +Fri Aug 2 12:12:34 2002 Owen Taylor <otaylor@redhat.com> + + * pango/pangoxft.h pango/pangoxft-fontmap.c + (pango_xft_shutdown_display): New function allowing us to shut + down a display. + Thu Aug 1 10:41:26 2002 Owen Taylor <otaylor@redhat.com> * configure.in: Fix check for having any backend diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c index 5fd75b3d..abbe2791 100644 --- a/pango/pangoxft-fontmap.c +++ b/pango/pangoxft-fontmap.c @@ -217,12 +217,33 @@ pango_xft_init_fontset_hash (PangoXftFontMap *xfontmap) } static PangoFontMap * +pango_xft_find_font_map (Display *display, + int screen) +{ + GSList *tmp_list; + + tmp_list = fontmaps; + while (tmp_list) + { + PangoXftFontMap *xfontmap = tmp_list->data; + + if (xfontmap->display == display && + xfontmap->screen == screen) + return PANGO_FONT_MAP (xfontmap); + + tmp_list = tmp_list->next; + } + + return NULL; +} + +static PangoFontMap * pango_xft_get_font_map (Display *display, int screen) { static gboolean registered_modules = FALSE; + PangoFontMap *fontmap; PangoXftFontMap *xfontmap; - GSList *tmp_list; g_return_val_if_fail (display != NULL, NULL); @@ -239,18 +260,10 @@ pango_xft_get_font_map (Display *display, pango_module_register (&_pango_included_xft_modules[i]); } - tmp_list = fontmaps; - while (tmp_list) - { - xfontmap = tmp_list->data; - - if (xfontmap->display == display && - xfontmap->screen == screen) - return PANGO_FONT_MAP (xfontmap); - - tmp_list = tmp_list->next; - } - + fontmap = pango_xft_find_font_map (display, screen); + if (fontmap) + return fontmap; + xfontmap = (PangoXftFontMap *)g_object_new (PANGO_TYPE_XFT_FONT_MAP, NULL); xfontmap->display = display; @@ -270,8 +283,31 @@ pango_xft_get_font_map (Display *display, } /** + * pango_xft_shutdown_display: + * @display: an X display + * @screen: the screen number of a screen within @display + * + * Release any resources that have been cached for the + * combination of @display and @screen. + **/ +void +pango_xft_shutdown_display (Display *display, + int screen) +{ + PangoFontMap *fontmap; + + fontmap = pango_xft_find_font_map (display, screen); + if (fontmap) + { + fontmaps = g_slist_remove (fontmaps, fontmap); + g_object_unref (G_OBJECT (fontmap)); + } +} + +/** * pango_xft_font_map_set_default_substitute: - * @fontmap: a #PangoXFTFontmap + * @display: an X Display + * @screen: the screen number of a screen within @display * @func: function to call to to do final config tweaking * on #FcPattern objects. * @data: data to pass to @func @@ -354,6 +390,7 @@ pango_xft_font_map_finalize (GObject *object) if (xfontmap->substitute_destroy) xfontmap->substitute_destroy (xfontmap->substitute_data); + pango_xft_font_map_cache_clear (xfontmap); g_queue_free (xfontmap->freed_fonts); g_hash_table_destroy (xfontmap->fontset_hash); g_hash_table_destroy (xfontmap->coverage_hash); diff --git a/pango/pangoxft.h b/pango/pangoxft.h index 2fa381f8..d6b08f2a 100644 --- a/pango/pangoxft.h +++ b/pango/pangoxft.h @@ -44,8 +44,11 @@ typedef void (*PangoXftSubstituteFunc) (FcPattern *pattern, /* Calls for applications */ -PangoContext *pango_xft_get_context (Display *display, - int screen); +PangoContext *pango_xft_get_context (Display *display, + int screen); +void pango_xft_shutdown_display (Display *display, + int screen); + void pango_xft_render (XftDraw *draw, XftColor *color, PangoFont *font, |