bspwm/types.c

43 lines
954 B
C
Raw Normal View History

2012-08-20 22:38:29 +02:00
#include <stdlib.h>
#include <string.h>
2012-08-20 22:38:29 +02:00
#include <xcb/xcb.h>
#include <xcb/xcb_event.h>
2012-08-18 11:18:19 +02:00
#include "types.h"
2012-08-29 18:37:31 +02:00
node_t *make_node(void)
2012-08-18 11:18:19 +02:00
{
2012-08-29 18:37:31 +02:00
node_t *n = malloc(sizeof(node_t));
2012-09-04 11:14:01 +02:00
n->parent = n->first_child = n->second_child = NULL;
n->split_ratio = SPLIT_RATIO;
n->split_type = TYPE_VERTICAL;
2012-09-04 11:14:01 +02:00
n->client = NULL;
n->vacant = false;
2012-08-18 11:18:19 +02:00
return n;
}
desktop_t *make_desktop(const char *name)
2012-08-18 11:18:19 +02:00
{
2012-08-29 18:37:31 +02:00
desktop_t *d = malloc(sizeof(desktop_t));
strcpy(d->name, name);
2012-08-25 15:24:35 +02:00
d->layout = LAYOUT_TILED;
2012-08-23 15:32:20 +02:00
d->prev = d->next = NULL;
2012-09-04 11:14:01 +02:00
d->root = d->focus = d->last_focus = NULL;
2012-08-18 11:18:19 +02:00
return d;
}
2012-08-25 15:24:35 +02:00
2012-09-05 14:07:06 +02:00
client_t *make_client(xcb_window_t win)
2012-08-25 15:24:35 +02:00
{
2012-08-29 18:37:31 +02:00
client_t *c = malloc(sizeof(client_t));
2012-09-05 14:07:06 +02:00
c->window = win;
2012-09-21 12:15:25 +02:00
c->floating = c->transient = c->fullscreen = c->locked = c->urgent = c->visible = false;
2012-08-25 15:24:35 +02:00
return c;
}
2012-09-10 13:47:51 +02:00
rule_t *make_rule(void)
{
rule_t *r = malloc(sizeof(rule_t));
2012-09-18 17:21:04 +02:00
r->effect.floating = false;
r->next = NULL;
2012-09-10 13:47:51 +02:00
return r;
}