aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-17 01:08:04 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-17 01:40:26 +0800
commitd88a9e736052357389f77a1e8e25221a1517ca72 (patch)
treecc62ca5424dd4b09b4859173029b1943cb7a11fa /e-util
parent58d7fa132943d72d17d26f8130c6a0e48011f8b6 (diff)
downloadgsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar.gz
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar.bz2
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar.lz
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar.xz
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.tar.zst
gsoc2013-evolution-d88a9e736052357389f77a1e8e25221a1517ca72.zip
Bug 649990 - Remove get_font_options() from e-util.c.
Not only is get_font_options() no longer needed, it's actually doing the wrong thing by reading settings through GConfClient instead of GSettings. But it turns out, thanks to the tighter Cairo integration in GTK3, the widgets that call get_font_options() can be made to work correctly by simply removing this hack. Love it when that happens.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-util.c123
-rw-r--r--e-util/e-util.h3
2 files changed, 0 insertions, 126 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 427f479e01..b7dd93aa15 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1204,129 +1204,6 @@ e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d)
return buffer;
}
-/* font options cache */
-static gchar *fo_antialiasing = NULL;
-static gchar *fo_hinting = NULL;
-static gchar *fo_subpixel_order = NULL;
-static GStaticMutex fo_lock = G_STATIC_MUTEX_INIT;
-
-static void
-fo_option_changed (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- const gchar *key;
-
- g_static_mutex_lock (&fo_lock);
-
- g_free (fo_antialiasing);
- key = "/desktop/gnome/font_rendering/antialiasing";
- fo_antialiasing = gconf_client_get_string (client, key, NULL);
-
- g_free (fo_hinting);
- key = "/desktop/gnome/font_rendering/hinting";
- fo_hinting = gconf_client_get_string (client, key, NULL);
-
- g_free (fo_subpixel_order);
- key = "/desktop/gnome/font_rendering/rgba_order";
- fo_subpixel_order = gconf_client_get_string (client, key, NULL);
-
- g_static_mutex_unlock (&fo_lock);
-}
-
-cairo_font_options_t *
-get_font_options (void)
-{
- static GConfClient *fo_gconf = NULL;
- cairo_font_options_t *font_options = cairo_font_options_create ();
-
- if (fo_gconf == NULL) {
- const gchar *key;
-
- fo_gconf = gconf_client_get_default ();
-
- key = "/desktop/gnome/font_rendering";
- gconf_client_add_dir (
- fo_gconf, key, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
-
- key = "/desktop/gnome/font_rendering/antialiasing";
- gconf_client_notify_add (
- fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
-
- key = "/desktop/gnome/font_rendering/hinting";
- gconf_client_notify_add (
- fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
-
- key = "/desktop/gnome/font_rendering/rgba_order";
- gconf_client_notify_add (
- fo_gconf, key, fo_option_changed, NULL, NULL, NULL);
-
- fo_option_changed (fo_gconf, 0, NULL, NULL);
- }
-
- g_static_mutex_lock (&fo_lock);
-
- /* Antialiasing */
- if (fo_antialiasing == NULL)
- cairo_font_options_set_antialias (
- font_options, CAIRO_ANTIALIAS_DEFAULT);
- else if (strcmp (fo_antialiasing, "grayscale") == 0)
- cairo_font_options_set_antialias (
- font_options, CAIRO_ANTIALIAS_GRAY);
- else if (strcmp (fo_antialiasing, "rgba") == 0)
- cairo_font_options_set_antialias (
- font_options, CAIRO_ANTIALIAS_SUBPIXEL);
- else if (strcmp (fo_antialiasing, "none") == 0)
- cairo_font_options_set_antialias (
- font_options, CAIRO_ANTIALIAS_NONE);
- else
- cairo_font_options_set_antialias (
- font_options, CAIRO_ANTIALIAS_DEFAULT);
-
- if (fo_hinting == NULL)
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_DEFAULT);
- else if (strcmp (fo_hinting, "full") == 0)
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_FULL);
- else if (strcmp (fo_hinting, "medium") == 0)
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_MEDIUM);
- else if (strcmp (fo_hinting, "slight") == 0)
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_SLIGHT);
- else if (strcmp (fo_hinting, "none") == 0)
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_NONE);
- else
- cairo_font_options_set_hint_style (
- font_options, CAIRO_HINT_STYLE_DEFAULT);
-
- if (fo_subpixel_order == NULL)
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
- else if (strcmp (fo_subpixel_order, "rgb") == 0)
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_RGB);
- else if (strcmp (fo_subpixel_order, "bgr") == 0)
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_BGR);
- else if (strcmp (fo_subpixel_order, "vrgb") == 0)
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_VRGB);
- else if (strcmp (fo_subpixel_order, "vbgr") == 0)
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_VBGR);
- else
- cairo_font_options_set_subpixel_order (
- font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
-
- g_static_mutex_unlock (&fo_lock);
-
- return font_options;
-}
-
/* Evolution Locks for crash recovery */
static const gchar *
diff --git a/e-util/e-util.h b/e-util/e-util.h
index e1f6c792e4..8463fd4a7b 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -127,9 +127,6 @@ gchar * e_ascii_dtostr (gchar *buffer,
const gchar *format,
gdouble d);
-cairo_font_options_t *
- get_font_options (void);
-
gboolean e_file_lock_create (void);
void e_file_lock_destroy (void);
gboolean e_file_lock_exists (void);