recognize dock windows (and support matching them)

This commit is contained in:
Michael Stapelberg
2010-08-15 12:18:27 +02:00
parent 0411299e4c
commit 160c12ed9a
6 changed files with 49 additions and 5 deletions

View File

@ -1,3 +1,7 @@
/*
* vim:ts=4:sw=4:expandtab
*
*/
#include <yajl/yajl_common.h>
#include <yajl/yajl_gen.h>
#include <yajl/yajl_parse.h>
@ -16,7 +20,8 @@ static int json_start_map(void *ctx) {
LOG("start of map\n");
if (parsing_swallows) {
LOG("TODO: create new swallow\n");
current_swallow = scalloc(sizeof(Match));
current_swallow = smalloc(sizeof(Match));
match_init(current_swallow);
TAILQ_INSERT_TAIL(&(json_node->swallow_head), current_swallow, matches);
} else {
if (!parsing_rect)
@ -104,6 +109,9 @@ static int json_int(void *ctx, long val) {
if (strcasecmp(last_key, "id") == 0) {
current_swallow->id = val;
}
if (strcasecmp(last_key, "dock") == 0) {
current_swallow->dock = true;
}
}
return 1;