From 8da07c310d9743a1b98db5fd3b2e7c79d787f195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Wed, 7 Jan 2015 13:26:56 +0200 Subject: Revert "Add UXD shadows and borders" This reverts commit 881d5baf3edafe9594c9f1b932c508461dc4652c. This is unused in metacity. Also compiz (only app that use libmetacity-private) does not use this. --- src/ui/theme-parser.c | 138 -------------------------------------------------- 1 file changed, 138 deletions(-) (limited to 'src/ui/theme-parser.c') diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c index e916debf..0ac6983b 100644 --- a/src/ui/theme-parser.c +++ b/src/ui/theme-parser.c @@ -81,8 +81,6 @@ typedef enum STATE_FRAME_STYLE, STATE_PIECE, STATE_BUTTON, - STATE_SHADOW, - STATE_PADDING, /* style set */ STATE_FRAME_STYLE_SET, STATE_FRAME, @@ -207,20 +205,6 @@ static void parse_button_element (GMarkupParseContext *context, ParseInfo *info, GError **error); -static void parse_shadow_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - ParseInfo *info, - GError **error); - -static void parse_padding_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - ParseInfo *info, - GError **error); - static void parse_menu_icon_element (GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, @@ -3045,72 +3029,6 @@ parse_style_element (GMarkupParseContext *context, push_state (info, STATE_BUTTON); } - else if (ELEMENT_IS ("shadow")) - { - const char *shadow_radius = NULL; - const char *shadow_opacity = NULL; - const char *shadow_color = NULL; - const char *shadow_x_offset = NULL; - const char *shadow_y_offset = NULL; - double shadow_radius_v, shadow_opacity_v; - int shadow_x_offset_v, shadow_y_offset_v; - MetaColorSpec *shadow_color_v; - - if (!locate_attributes (context, element_name, attribute_names, attribute_values, - error, - "radius", &shadow_radius, - "opacity", &shadow_opacity, - "color", &shadow_color, - "x_offset", &shadow_x_offset, - "y_offset", &shadow_y_offset, - NULL)) - return; - - parse_double (shadow_radius, &shadow_radius_v, context, error); - parse_double (shadow_opacity, &shadow_opacity_v, context, error); - parse_positive_integer (shadow_x_offset, &shadow_x_offset_v, context, info->theme, error); - parse_positive_integer (shadow_y_offset, &shadow_y_offset_v, context, info->theme, error); - shadow_color_v = parse_color (info->theme, shadow_color, error); - - if (!info->style->shadow_properties) - info->style->shadow_properties = meta_shadow_properties_new (); - - info->style->shadow_properties->shadow_radius = shadow_radius_v; - info->style->shadow_properties->shadow_opacity = shadow_opacity_v; - info->style->shadow_properties->shadow_x_offset = shadow_x_offset_v; - info->style->shadow_properties->shadow_y_offset = shadow_y_offset_v; - info->style->shadow_properties->shadow_color = shadow_color_v; - - push_state (info, STATE_SHADOW); - } - else if (ELEMENT_IS ("padding")) - { - const char *left = NULL; - const char *bottom = NULL; - const char *right = NULL; - int left_v, right_v, bottom_v; - - if (!locate_attributes (context, element_name, attribute_names, attribute_values, - error, - "left", &left, - "right", &right, - "bottom", &bottom, - NULL)) - return; - - parse_positive_integer (left, &left_v, context, info->theme, error); - parse_positive_integer (right, &right_v, context, info->theme, error); - parse_positive_integer (bottom, &bottom_v, context, info->theme, error); - - if (!info->style->invisible_grab_area_properties) - info->style->invisible_grab_area_properties = meta_invisible_grab_area_properties_new (); - - info->style->invisible_grab_area_properties->left = left_v; - info->style->invisible_grab_area_properties->right = right_v; - info->style->invisible_grab_area_properties->bottom = bottom_v; - - push_state (info, STATE_PADDING); - } else { set_error (error, context, @@ -3432,38 +3350,6 @@ parse_button_element (GMarkupParseContext *context, } } -static void -parse_shadow_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - ParseInfo *info, - GError **error) -{ - g_return_if_fail (peek_state (info) == STATE_SHADOW); - - set_error (error, context, - G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, - _("Element <%s> is not allowed below <%s>"), - element_name, "shadow"); -} - -static void -parse_padding_element (GMarkupParseContext *context, - const gchar *element_name, - const gchar **attribute_names, - const gchar **attribute_values, - ParseInfo *info, - GError **error) -{ - g_return_if_fail (peek_state (info) == STATE_PADDING); - - set_error (error, context, - G_MARKUP_ERROR, G_MARKUP_ERROR_PARSE, - _("Element <%s> is not allowed below <%s>"), - element_name, "padding"); -} - static void parse_menu_icon_element (GMarkupParseContext *context, const gchar *element_name, @@ -3757,16 +3643,6 @@ start_element_handler (GMarkupParseContext *context, attribute_names, attribute_values, info, error); break; - case STATE_SHADOW: - parse_shadow_element (context, element_name, - attribute_names, attribute_values, - info, error); - break; - case STATE_PADDING: - parse_padding_element (context, element_name, - attribute_names, attribute_values, - info, error); - break; case STATE_MENU_ICON: parse_menu_icon_element (context, element_name, attribute_names, attribute_values, @@ -4042,14 +3918,6 @@ end_element_handler (GMarkupParseContext *context, } pop_state (info); break; - case STATE_SHADOW: - g_assert (info->style); - pop_state (info); - break; - case STATE_PADDING: - g_assert (info->style); - pop_state (info); - break; case STATE_MENU_ICON: g_assert (info->theme); if (info->op_list != NULL) @@ -4279,12 +4147,6 @@ text_handler (GMarkupParseContext *context, case STATE_BUTTON: NO_TEXT ("button"); break; - case STATE_SHADOW: - NO_TEXT ("shadow"); - break; - case STATE_PADDING: - NO_TEXT ("padding"); - break; case STATE_MENU_ICON: NO_TEXT ("menu_icon"); break; -- cgit v1.2.1