diff options
Diffstat (limited to 'src/ui/theme-parser.c')
-rw-r--r-- | src/ui/theme-parser.c | 115 |
1 files changed, 58 insertions, 57 deletions
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c index 98dc1662..c3f9ba22 100644 --- a/src/ui/theme-parser.c +++ b/src/ui/theme-parser.c @@ -24,6 +24,7 @@ #include <config.h> #include "theme-parser.h" #include "util.h" +#include "rpn.h" #include <string.h> #include <stdlib.h> @@ -1656,10 +1657,10 @@ parse_draw_op_element (GMarkupParseContext *context, op->data.line.color_spec = color_spec; - op->data.line.x1 = meta_draw_spec_new (info->theme, x1, NULL); - op->data.line.y1 = meta_draw_spec_new (info->theme, y1, NULL); - op->data.line.x2 = meta_draw_spec_new (info->theme, x2, NULL); - op->data.line.y2 = meta_draw_spec_new (info->theme, y2, NULL); + op->data.line.x1 = meta_rpn_parse (info->theme, x1, NULL); + op->data.line.y1 = meta_rpn_parse (info->theme, y1, NULL); + op->data.line.x2 = meta_rpn_parse (info->theme, x2, NULL); + op->data.line.y2 = meta_rpn_parse (info->theme, y2, NULL); op->data.line.width = width_val; op->data.line.dash_on_length = dash_on_val; @@ -1723,10 +1724,10 @@ parse_draw_op_element (GMarkupParseContext *context, op = meta_draw_op_new (META_DRAW_RECTANGLE); op->data.rectangle.color_spec = color_spec; - op->data.rectangle.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.rectangle.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.rectangle.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.rectangle.height = meta_draw_spec_new (info->theme, + op->data.rectangle.x = meta_rpn_parse (info->theme, x, NULL); + op->data.rectangle.y = meta_rpn_parse (info->theme, y, NULL); + op->data.rectangle.width = meta_rpn_parse (info->theme, width, NULL); + op->data.rectangle.height = meta_rpn_parse (info->theme, height, NULL); op->data.rectangle.filled = filled_val; @@ -1859,10 +1860,10 @@ parse_draw_op_element (GMarkupParseContext *context, op->data.arc.color_spec = color_spec; - op->data.arc.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.arc.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.arc.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.arc.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.arc.x = meta_rpn_parse (info->theme, x, NULL); + op->data.arc.y = meta_rpn_parse (info->theme, y, NULL); + op->data.arc.width = meta_rpn_parse (info->theme, width, NULL); + op->data.arc.height = meta_rpn_parse (info->theme, height, NULL); op->data.arc.filled = filled_val; op->data.arc.start_angle = start_angle_val; @@ -1904,10 +1905,10 @@ parse_draw_op_element (GMarkupParseContext *context, #endif op = meta_draw_op_new (META_DRAW_CLIP); - op->data.clip.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.clip.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.clip.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.clip.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.clip.x = meta_rpn_parse (info->theme, x, NULL); + op->data.clip.y = meta_rpn_parse (info->theme, y, NULL); + op->data.clip.width = meta_rpn_parse (info->theme, width, NULL); + op->data.clip.height = meta_rpn_parse (info->theme, height, NULL); g_assert (info->op_list); @@ -1971,10 +1972,10 @@ parse_draw_op_element (GMarkupParseContext *context, op->data.tint.color_spec = color_spec; op->data.tint.alpha_spec = alpha_spec; - op->data.tint.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.tint.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.tint.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.tint.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.tint.x = meta_rpn_parse (info->theme, x, NULL); + op->data.tint.y = meta_rpn_parse (info->theme, y, NULL); + op->data.tint.width = meta_rpn_parse (info->theme, width, NULL); + op->data.tint.height = meta_rpn_parse (info->theme, height, NULL); g_assert (info->op_list); @@ -2032,11 +2033,11 @@ parse_draw_op_element (GMarkupParseContext *context, g_assert (info->op == NULL); info->op = meta_draw_op_new (META_DRAW_GRADIENT); - info->op->data.gradient.x = meta_draw_spec_new (info->theme, x, NULL); - info->op->data.gradient.y = meta_draw_spec_new (info->theme, y, NULL); - info->op->data.gradient.width = meta_draw_spec_new (info->theme, + info->op->data.gradient.x = meta_rpn_parse (info->theme, x, NULL); + info->op->data.gradient.y = meta_rpn_parse (info->theme, y, NULL); + info->op->data.gradient.width = meta_rpn_parse (info->theme, width, NULL); - info->op->data.gradient.height = meta_draw_spec_new (info->theme, + info->op->data.gradient.height = meta_rpn_parse (info->theme, height, NULL); info->op->data.gradient.gradient_spec = meta_gradient_spec_new (type_val); @@ -2141,10 +2142,10 @@ parse_draw_op_element (GMarkupParseContext *context, op->data.image.pixbuf = pixbuf; op->data.image.colorize_spec = colorize_spec; - op->data.image.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.image.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.image.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.image.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.image.x = meta_rpn_parse (info->theme, x, NULL); + op->data.image.y = meta_rpn_parse (info->theme, y, NULL); + op->data.image.width = meta_rpn_parse (info->theme, width, NULL); + op->data.image.height = meta_rpn_parse (info->theme, height, NULL); op->data.image.alpha_spec = alpha_spec; op->data.image.fill_type = fill_type_val; @@ -2292,10 +2293,10 @@ parse_draw_op_element (GMarkupParseContext *context, op = meta_draw_op_new (META_DRAW_GTK_ARROW); - op->data.gtk_arrow.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.gtk_arrow.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.gtk_arrow.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.gtk_arrow.height = meta_draw_spec_new (info->theme, + op->data.gtk_arrow.x = meta_rpn_parse (info->theme, x, NULL); + op->data.gtk_arrow.y = meta_rpn_parse (info->theme, y, NULL); + op->data.gtk_arrow.width = meta_rpn_parse (info->theme, width, NULL); + op->data.gtk_arrow.height = meta_rpn_parse (info->theme, height, NULL); op->data.gtk_arrow.filled = filled_val; @@ -2365,10 +2366,10 @@ parse_draw_op_element (GMarkupParseContext *context, op = meta_draw_op_new (META_DRAW_GTK_BOX); - op->data.gtk_box.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.gtk_box.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.gtk_box.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.gtk_box.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.gtk_box.x = meta_rpn_parse (info->theme, x, NULL); + op->data.gtk_box.y = meta_rpn_parse (info->theme, y, NULL); + op->data.gtk_box.width = meta_rpn_parse (info->theme, width, NULL); + op->data.gtk_box.height = meta_rpn_parse (info->theme, height, NULL); op->data.gtk_box.state = state_val; op->data.gtk_box.shadow = shadow_val; @@ -2418,9 +2419,9 @@ parse_draw_op_element (GMarkupParseContext *context, op = meta_draw_op_new (META_DRAW_GTK_VLINE); - op->data.gtk_vline.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.gtk_vline.y1 = meta_draw_spec_new (info->theme, y1, NULL); - op->data.gtk_vline.y2 = meta_draw_spec_new (info->theme, y2, NULL); + op->data.gtk_vline.x = meta_rpn_parse (info->theme, x, NULL); + op->data.gtk_vline.y1 = meta_rpn_parse (info->theme, y1, NULL); + op->data.gtk_vline.y2 = meta_rpn_parse (info->theme, y2, NULL); op->data.gtk_vline.state = state_val; @@ -2484,10 +2485,10 @@ parse_draw_op_element (GMarkupParseContext *context, op = meta_draw_op_new (META_DRAW_ICON); - op->data.icon.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.icon.y = meta_draw_spec_new (info->theme, y, NULL); - op->data.icon.width = meta_draw_spec_new (info->theme, width, NULL); - op->data.icon.height = meta_draw_spec_new (info->theme, height, NULL); + op->data.icon.x = meta_rpn_parse (info->theme, x, NULL); + op->data.icon.y = meta_rpn_parse (info->theme, y, NULL); + op->data.icon.width = meta_rpn_parse (info->theme, width, NULL); + op->data.icon.height = meta_rpn_parse (info->theme, height, NULL); op->data.icon.alpha_spec = alpha_spec; op->data.icon.fill_type = fill_type_val; @@ -2535,8 +2536,8 @@ parse_draw_op_element (GMarkupParseContext *context, op->data.title.color_spec = color_spec; - op->data.title.x = meta_draw_spec_new (info->theme, x, NULL); - op->data.title.y = meta_draw_spec_new (info->theme, y, NULL); + op->data.title.x = meta_rpn_parse (info->theme, x, NULL); + op->data.title.y = meta_rpn_parse (info->theme, y, NULL); g_assert (info->op_list); @@ -2607,12 +2608,12 @@ parse_draw_op_element (GMarkupParseContext *context, meta_draw_op_list_ref (op_list); op->data.op_list.op_list = op_list; - op->data.op_list.x = meta_draw_spec_new (info->theme, x ? x : "0", NULL); - op->data.op_list.y = meta_draw_spec_new (info->theme, y ? y : "0", NULL); - op->data.op_list.width = meta_draw_spec_new (info->theme, + op->data.op_list.x = meta_rpn_parse (info->theme, x ? x : "0", NULL); + op->data.op_list.y = meta_rpn_parse (info->theme, y ? y : "0", NULL); + op->data.op_list.width = meta_rpn_parse (info->theme, width ? width : "width", NULL); - op->data.op_list.height = meta_draw_spec_new (info->theme, + op->data.op_list.height = meta_rpn_parse (info->theme, height ? height : "height", NULL); @@ -2702,22 +2703,22 @@ parse_draw_op_element (GMarkupParseContext *context, meta_draw_op_list_ref (op_list); - op->data.tile.x = meta_draw_spec_new (info->theme, x ? x : "0", NULL); - op->data.tile.y = meta_draw_spec_new (info->theme, y ? y : "0", NULL); - op->data.tile.width = meta_draw_spec_new (info->theme, + op->data.tile.x = meta_rpn_parse (info->theme, x ? x : "0", NULL); + op->data.tile.y = meta_rpn_parse (info->theme, y ? y : "0", NULL); + op->data.tile.width = meta_rpn_parse (info->theme, width ? width : "width", NULL); - op->data.tile.height = meta_draw_spec_new (info->theme, + op->data.tile.height = meta_rpn_parse (info->theme, height ? height : "height", NULL); - op->data.tile.tile_xoffset = meta_draw_spec_new (info->theme, + op->data.tile.tile_xoffset = meta_rpn_parse (info->theme, tile_xoffset ? tile_xoffset : "0", NULL); - op->data.tile.tile_yoffset = meta_draw_spec_new (info->theme, + op->data.tile.tile_yoffset = meta_rpn_parse (info->theme, tile_yoffset ? tile_yoffset : "0", NULL); - op->data.tile.tile_width = meta_draw_spec_new (info->theme, tile_width, NULL); - op->data.tile.tile_height = meta_draw_spec_new (info->theme, tile_height, NULL); + op->data.tile.tile_width = meta_rpn_parse (info->theme, tile_width, NULL); + op->data.tile.tile_height = meta_rpn_parse (info->theme, tile_height, NULL); op->data.tile.op_list = op_list; |