Implement variable border widths for pixel/normal

fixes #325
This commit is contained in:
Yaroslav Molochko
2012-09-24 02:14:00 +03:00
committed by Michael Stapelberg
parent b235c469c1
commit 04c58c7325
20 changed files with 144 additions and 73 deletions

View File

@ -183,8 +183,11 @@ static int json_string(void *ctx, const unsigned char *val, unsigned int len) {
sasprintf(&buf, "%.*s", (int)len, val);
if (strcasecmp(buf, "none") == 0)
json_node->border_style = BS_NONE;
else if (strcasecmp(buf, "1pixel") == 0)
json_node->border_style = BS_1PIXEL;
else if (strcasecmp(buf, "1pixel") == 0) {
json_node->border_style = BS_PIXEL;
json_node->current_border_width = 1;
} else if (strcasecmp(buf, "pixel") == 0)
json_node->border_style = BS_PIXEL;
else if (strcasecmp(buf, "normal") == 0)
json_node->border_style = BS_NORMAL;
else LOG("Unhandled \"border\": %s\n", buf);
@ -278,6 +281,9 @@ static int json_int(void *ctx, long val) {
if (strcasecmp(last_key, "num") == 0)
json_node->num = val;
if (strcasecmp(last_key, "current_border_width") == 0)
json_node->current_border_width = val;
if (!parsing_swallows && strcasecmp(last_key, "id") == 0)
json_node->old_id = val;