[gnome-color-manager/gnome-3-2] Don't use the deprecated pango_cairo_font_map_create_context()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager/gnome-3-2] Don't use the deprecated pango_cairo_font_map_create_context()
- Date: Mon, 17 Oct 2011 10:14:58 +0000 (UTC)
commit d0396e5c8cb97cda860c0081686aedf08164fe48
Author: Richard Hughes <richard hughsie com>
Date: Fri Oct 14 14:45:33 2011 +0100
Don't use the deprecated pango_cairo_font_map_create_context()
src/gcm-cie-widget.c | 7 +------
src/gcm-gamma-widget.c | 4 +---
src/gcm-trc-widget.c | 7 +------
3 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/src/gcm-cie-widget.c b/src/gcm-cie-widget.c
index 4bdeb4c..8fc4b85 100644
--- a/src/gcm-cie-widget.c
+++ b/src/gcm-cie-widget.c
@@ -556,7 +556,6 @@ gcm_cie_widget_set_from_profile (GtkWidget *widget, GcmProfile *profile)
static void
gcm_cie_widget_init (GcmCieWidget *cie)
{
- PangoFontMap *fontmap;
PangoContext *context;
PangoFontDescription *desc;
@@ -581,8 +580,7 @@ gcm_cie_widget_init (GcmCieWidget *cie)
cie->priv->gamma = 0.0;
/* do pango stuff */
- fontmap = pango_cairo_font_map_get_default ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = gtk_widget_get_pango_context (GTK_WIDGET (cie));
pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO);
cie->priv->layout = pango_layout_new (context);
@@ -597,16 +595,13 @@ gcm_cie_widget_init (GcmCieWidget *cie)
static void
gcm_cie_widget_finalize (GObject *object)
{
- PangoContext *context;
GcmCieWidget *cie = (GcmCieWidget*) object;
- context = pango_layout_get_context (cie->priv->layout);
g_object_unref (cie->priv->layout);
cd_color_yxy_free (cie->priv->white);
cd_color_yxy_free (cie->priv->red);
cd_color_yxy_free (cie->priv->green);
cd_color_yxy_free (cie->priv->blue);
- g_object_unref (context);
g_ptr_array_unref (cie->priv->tongue_buffer);
G_OBJECT_CLASS (gcm_cie_widget_parent_class)->finalize (object);
}
diff --git a/src/gcm-gamma-widget.c b/src/gcm-gamma-widget.c
index c175fdb..1d25e00 100644
--- a/src/gcm-gamma-widget.c
+++ b/src/gcm-gamma-widget.c
@@ -168,7 +168,6 @@ gcm_gamma_widget_class_init (GcmGammaWidgetClass *class)
static void
gcm_gamma_widget_init (GcmGammaWidget *gama)
{
- PangoFontMap *fontmap;
PangoContext *context;
gama->priv = GCM_GAMMA_WIDGET_GET_PRIVATE (gama);
@@ -179,8 +178,7 @@ gcm_gamma_widget_init (GcmGammaWidget *gama)
gama->priv->color_blue = 0.5f;
/* do pango stuff */
- fontmap = pango_cairo_font_map_get_default ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = gtk_widget_get_pango_context (GTK_WIDGET (gama));
pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO);
}
diff --git a/src/gcm-trc-widget.c b/src/gcm-trc-widget.c
index 88baa89..ac7800e 100644
--- a/src/gcm-trc-widget.c
+++ b/src/gcm-trc-widget.c
@@ -134,7 +134,6 @@ gcm_trc_widget_class_init (GcmTrcWidgetClass *class)
static void
gcm_trc_widget_init (GcmTrcWidget *trc)
{
- PangoFontMap *fontmap;
PangoContext *context;
PangoFontDescription *desc;
@@ -143,8 +142,7 @@ gcm_trc_widget_init (GcmTrcWidget *trc)
trc->priv->clut = NULL;
/* do pango stuff */
- fontmap = pango_cairo_font_map_get_default ();
- context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP (fontmap));
+ context = gtk_widget_get_pango_context (GTK_WIDGET (trc));
pango_context_set_base_gravity (context, PANGO_GRAVITY_AUTO);
trc->priv->layout = pango_layout_new (context);
@@ -159,12 +157,9 @@ gcm_trc_widget_init (GcmTrcWidget *trc)
static void
gcm_trc_widget_finalize (GObject *object)
{
- PangoContext *context;
GcmTrcWidget *trc = (GcmTrcWidget*) object;
- context = pango_layout_get_context (trc->priv->layout);
g_object_unref (trc->priv->layout);
- g_object_unref (context);
if (trc->priv->clut != NULL)
g_object_unref (trc->priv->clut);
G_OBJECT_CLASS (gcm_trc_widget_parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]