4 #include <xcb/xcb_event.h>
9 node_t *make_node(void)
11 node_t *n = malloc(sizeof(node_t));
12 n->parent = n->first_child = n->second_child = NULL;
13 n->split_ratio = SPLIT_RATIO;
14 n->split_type = TYPE_VERTICAL;
20 monitor_t *make_monitor(xcb_rectangle_t *rect)
22 monitor_t *m = malloc(sizeof(monitor_t));
23 snprintf(m->name, sizeof(m->name), "%s%02d", DEFAULT_MON_NAME, ++monitor_uid);
24 m->prev = m->next = NULL;
25 m->desk = m->last_desk = NULL;
29 warn("no rectangle was given for monitor '%s'\n", m->name);
33 desktop_t *make_desktop(const char *name)
35 desktop_t *d = malloc(sizeof(desktop_t));
37 snprintf(d->name, sizeof(d->name), "%s%02d", DEFAULT_DESK_NAME, ++desktop_uid);
39 strncpy(d->name, name, sizeof(d->name));
40 d->layout = LAYOUT_TILED;
41 d->prev = d->next = NULL;
42 d->root = d->focus = d->last_focus = NULL;
46 client_t *make_client(xcb_window_t win)
48 client_t *c = malloc(sizeof(client_t));
49 strncpy(c->class_name, MISSING_VALUE, sizeof(c->class_name));
50 c->uid = ++client_uid;
51 c->border_width = border_width;
53 c->floating = c->transient = c->fullscreen = c->locked = c->urgent = false;
57 rule_t *make_rule(void)
59 rule_t *r = malloc(sizeof(rule_t));
60 r->effect.floating = false;
61 r->effect.monitor = NULL;
62 r->effect.desktop = NULL;
67 pointer_state_t *make_pointer_state(void)
69 pointer_state_t *p = malloc(sizeof(pointer_state_t));