diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-05-22 17:08:13 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-05-22 17:08:13 +0000 |
commit | fb3eeb868689df25cc8fa56ed8471f1b880bb1c1 (patch) | |
tree | 6a85aa08bda28a76234bfe58642fda07768f2c75 /gdk/gdkscreen.c | |
parent | 4636fa7efe134441db9b48a5ba029a99cb82fcf8 (diff) | |
download | gtk+-fb3eeb868689df25cc8fa56ed8471f1b880bb1c1.tar.gz |
Rollback the following changes, to fix it the proper way in Pango:
2006-05-22 Behdad Esfahbod <behdad@gnome.org>
Rollback the following changes, to fix it the proper way in Pango:
* gdk/gdkinternals.h:
* gdk/gdkscreen.c (gdk_screen_class_init), (gdk_screen_finalize),
(update_fontmap_resolution), (gdk_screen_set_resolution): Add new
function _gdk_screen_get_font_map() and have one fontmap per screen,
with the correct resolution set on it.
* gdk/gdkpango.c (gdk_pango_context_get_for_screen): Use
_gdk_screen_get_font_map() instead of setting resolution on the
PangoCairoContext. (#342529)
Diffstat (limited to 'gdk/gdkscreen.c')
-rw-r--r-- | gdk/gdkscreen.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c index 000ca5e85b..986f9f5525 100644 --- a/gdk/gdkscreen.c +++ b/gdk/gdkscreen.c @@ -25,23 +25,10 @@ #include "gdk.h" /* For gdk_rectangle_intersect() */ #include "gdkcolor.h" #include "gdkwindow.h" -#include "gdkinternals.h" #include "gdkscreen.h" #include "gdkintl.h" #include "gdkalias.h" - -#define GDK_SCREEN_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDK_TYPE_SCREEN, GdkScreenPrivate)) - -typedef struct _GdkScreenPrivate GdkScreenPrivate; - -struct _GdkScreenPrivate -{ - PangoFontMap *fontmap; -}; - - static void gdk_screen_dispose (GObject *object); static void gdk_screen_finalize (GObject *object); static void gdk_screen_set_property (GObject *object, @@ -137,8 +124,6 @@ gdk_screen_class_init (GdkScreenClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - - g_type_class_add_private (klass, sizeof (GdkScreenPrivate)); } static void @@ -175,14 +160,10 @@ static void gdk_screen_finalize (GObject *object) { GdkScreen *screen = GDK_SCREEN (object); - GdkScreenPrivate *priv = GDK_SCREEN_GET_PRIVATE (screen); if (screen->font_options) cairo_font_options_destroy (screen->font_options); - if (priv->fontmap) - g_object_unref (priv->fontmap); - G_OBJECT_CLASS (gdk_screen_parent_class)->finalize (object); } @@ -388,48 +369,6 @@ gdk_screen_height_mm (void) return gdk_screen_get_height_mm (gdk_screen_get_default ()); } -static void -update_fontmap_resolution (GdkScreen *screen) -{ - GdkScreenPrivate *priv = GDK_SCREEN_GET_PRIVATE (screen); - double dpi = screen->resolution; - - if (dpi < 0) - dpi = 96.; - - if (priv->fontmap) - pango_cairo_font_map_set_resolution (priv->fontmap, dpi); -} - -/** - * _gdk_screen_get_font_map: - * @screen: a #GdkScreen - * - * Gets the Pango fontmap for this screen that is used to create - * #PangoContext, with the right resolution set on it. - * - * Return value: the fontmap. - * - * Since: 2.10 - **/ -PangoFontMap * -_gdk_screen_get_font_map (GdkScreen *screen) -{ - GdkScreenPrivate *priv; - - g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL); - - priv = GDK_SCREEN_GET_PRIVATE (screen); - - if (G_UNLIKELY (!priv->fontmap)) - { - priv->fontmap = pango_cairo_font_map_new (); - update_fontmap_resolution (screen); - } - - return priv->fontmap; -} - /** * gdk_screen_set_font_options: * @screen: a #GdkScreen @@ -509,8 +448,6 @@ gdk_screen_set_resolution (GdkScreen *screen, { screen->resolution = dpi; - update_fontmap_resolution (screen); - g_object_notify (G_OBJECT (screen), "resolution"); } } |