summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-01-29 14:15:02 +0200
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-01-31 03:08:58 +0200
commit20d710475fadd2312429f93f49f4cf6eede2be15 (patch)
treea7ea193b6dfef7dcbea9182ca44321cdf9a96145 /src
parent01fc4a4c55aa95d41db5797a329d63daf9974168 (diff)
downloadmetacity-20d710475fadd2312429f93f49f4cf6eede2be15.tar.gz
theme: move draw_op_lists to MetaThemeMetacity
Diffstat (limited to 'src')
-rw-r--r--src/ui/theme-parser.c24
-rw-r--r--src/ui/theme-private.h6
-rw-r--r--src/ui/theme.c23
3 files changed, 14 insertions, 39 deletions
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index b460a641..0a8a94f9 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -786,8 +786,12 @@ parse_toplevel_element (GMarkupParseContext *context,
ParseInfo *info,
GError **error)
{
+ MetaThemeMetacity *metacity;
+
g_return_if_fail (peek_state (info) == STATE_THEME);
+ metacity = META_THEME_METACITY (info->theme->impl);
+
if (ELEMENT_IS ("info"))
{
if (!check_no_attributes (context, element_name,
@@ -978,7 +982,7 @@ parse_toplevel_element (GMarkupParseContext *context,
NULL))
return;
- if (meta_theme_lookup_draw_op_list (info->theme, name))
+ if (meta_theme_metacity_lookup_draw_op_list (metacity, name))
{
set_error (error, context, G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE,
_("<%s> name \"%s\" used a second time"),
@@ -989,7 +993,7 @@ parse_toplevel_element (GMarkupParseContext *context,
g_assert (info->op_list == NULL);
info->op_list = meta_draw_op_list_new (2);
- meta_theme_insert_draw_op_list (info->theme, name, info->op_list);
+ meta_theme_metacity_insert_draw_op_list (metacity, name, info->op_list);
push_state (info, STATE_DRAW_OPS);
}
@@ -2478,8 +2482,7 @@ parse_draw_op_element (GMarkupParseContext *context,
/* x/y/width/height default to 0,0,width,height - should
* probably do this for all the draw ops
*/
- op_list = meta_theme_lookup_draw_op_list (info->theme,
- name);
+ op_list = meta_theme_metacity_lookup_draw_op_list (metacity, name);
if (op_list == NULL)
{
set_error (error, context, G_MARKUP_ERROR,
@@ -2546,8 +2549,7 @@ parse_draw_op_element (GMarkupParseContext *context,
return;
/* These default to 0 */
- op_list = meta_theme_lookup_draw_op_list (info->theme,
- name);
+ op_list = meta_theme_metacity_lookup_draw_op_list (metacity, name);
if (op_list == NULL)
{
set_error (error, context, G_MARKUP_ERROR,
@@ -2752,10 +2754,14 @@ parse_style_element (GMarkupParseContext *context,
ParseInfo *info,
GError **error)
{
+ MetaThemeMetacity *metacity;
+
g_return_if_fail (peek_state (info) == STATE_FRAME_STYLE);
g_assert (info->style);
+ metacity = META_THEME_METACITY (info->theme->impl);
+
if (ELEMENT_IS ("piece"))
{
const char *position = NULL;
@@ -2791,8 +2797,7 @@ parse_style_element (GMarkupParseContext *context,
{
MetaDrawOpList *op_list;
- op_list = meta_theme_lookup_draw_op_list (info->theme,
- draw_ops);
+ op_list = meta_theme_metacity_lookup_draw_op_list (metacity, draw_ops);
if (op_list == NULL)
{
@@ -2868,8 +2873,7 @@ parse_style_element (GMarkupParseContext *context,
{
MetaDrawOpList *op_list;
- op_list = meta_theme_lookup_draw_op_list (info->theme,
- draw_ops);
+ op_list = meta_theme_metacity_lookup_draw_op_list (metacity, draw_ops);
if (op_list == NULL)
{
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index 7bc06e2e..3667d9c7 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -323,7 +323,6 @@ struct _MetaTheme
GHashTable *images_by_filename;
GHashTable *layouts_by_name;
- GHashTable *draw_op_lists_by_name;
GHashTable *styles_by_name;
GHashTable *style_sets_by_name;
@@ -370,11 +369,6 @@ MetaFrameLayout *meta_theme_lookup_layout (MetaTheme
void meta_theme_insert_layout (MetaTheme *theme,
const char *name,
MetaFrameLayout *layout);
-MetaDrawOpList *meta_theme_lookup_draw_op_list (MetaTheme *theme,
- const char *name);
-void meta_theme_insert_draw_op_list (MetaTheme *theme,
- const char *name,
- MetaDrawOpList *op_list);
MetaFrameStyle *meta_theme_lookup_style (MetaTheme *theme,
const char *name);
void meta_theme_insert_style (MetaTheme *theme,
diff --git a/src/ui/theme.c b/src/ui/theme.c
index ea0d0996..6fac26ad 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -2358,12 +2358,6 @@ meta_theme_new (MetaThemeType type)
g_free,
(GDestroyNotify) meta_frame_layout_unref);
- theme->draw_op_lists_by_name =
- g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- (GDestroyNotify) meta_draw_op_list_unref);
-
theme->styles_by_name =
g_hash_table_new_full (g_str_hash,
g_str_equal,
@@ -2407,7 +2401,6 @@ meta_theme_free (MetaTheme *theme)
g_hash_table_destroy (theme->images_by_filename);
g_hash_table_destroy (theme->layouts_by_name);
- g_hash_table_destroy (theme->draw_op_lists_by_name);
g_hash_table_destroy (theme->styles_by_name);
g_hash_table_destroy (theme->style_sets_by_name);
@@ -2713,22 +2706,6 @@ meta_theme_insert_layout (MetaTheme *theme,
g_hash_table_replace (theme->layouts_by_name, g_strdup (name), layout);
}
-MetaDrawOpList*
-meta_theme_lookup_draw_op_list (MetaTheme *theme,
- const char *name)
-{
- return g_hash_table_lookup (theme->draw_op_lists_by_name, name);
-}
-
-void
-meta_theme_insert_draw_op_list (MetaTheme *theme,
- const char *name,
- MetaDrawOpList *op_list)
-{
- meta_draw_op_list_ref (op_list);
- g_hash_table_replace (theme->draw_op_lists_by_name, g_strdup (name), op_list);
-}
-
MetaFrameStyle*
meta_theme_lookup_style (MetaTheme *theme,
const char *name)