diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-04 00:24:08 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-02-04 00:24:08 +0200 |
commit | 725a5438e72c95ce9b784c8a60a3c1a6e7bb192a (patch) | |
tree | 3cfbfd294b79278e183386361b6fd59b91d5a19c /src/ui | |
parent | 99f79563ae5e2c777544ec59cfdbfb8e4f38c162 (diff) | |
download | metacity-725a5438e72c95ce9b784c8a60a3c1a6e7bb192a.tar.gz |
theme: move get_current and set_current to libmetacity
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/theme.c | 62 | ||||
-rw-r--r-- | src/ui/theme.h | 6 |
2 files changed, 0 insertions, 68 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c index 918f8d41..f59a263b 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -60,65 +60,3 @@ #define __USE_XOPEN #include <stdarg.h> #include <math.h> - -/** - * The current theme. (Themes are singleton.) - */ -static MetaTheme *meta_current_theme = NULL; - -MetaTheme* -meta_theme_get_current (void) -{ - return meta_current_theme; -} - -void -meta_theme_set_current (const gchar *name, - gboolean force_reload, - gboolean composited, - const PangoFontDescription *titlebar_font) -{ - MetaTheme *new_theme; - GError *error; - - g_debug ("Setting current theme to '%s'", name); - - if (!force_reload && meta_current_theme) - { - gchar *theme_name; - - theme_name = meta_theme_get_name (meta_current_theme); - if (g_strcmp0 (name, theme_name) == 0) - { - g_free (theme_name); - return; - } - - g_free (theme_name); - } - - if (name != NULL && strcmp (name, "") != 0) - new_theme = meta_theme_new (META_THEME_TYPE_METACITY); - else - new_theme = meta_theme_new (META_THEME_TYPE_GTK); - - meta_theme_set_composited (new_theme, composited); - meta_theme_set_titlebar_font (new_theme, titlebar_font); - - error = NULL; - if (!meta_theme_load (new_theme, name, &error)) - { - g_warning (_("Failed to load theme '%s': %s"), name, error->message); - g_error_free (error); - - g_object_unref (new_theme); - } - else - { - if (meta_current_theme) - g_object_unref (meta_current_theme); - meta_current_theme = new_theme; - - g_debug ("New theme is '%s'", name); - } -} diff --git a/src/ui/theme.h b/src/ui/theme.h index e9ae007c..97c97af3 100644 --- a/src/ui/theme.h +++ b/src/ui/theme.h @@ -25,10 +25,4 @@ #include <gtk/gtk.h> #include <libmetacity/meta-theme.h> -MetaTheme* meta_theme_get_current (void); -void meta_theme_set_current (const char *name, - gboolean force_reload, - gboolean composited, - const PangoFontDescription *titlebar_font); - #endif |