swim.git

tile.h

espurr
/* swim - window manager
 * Copyright (C) 2022-2023 ArcNyxx
 * see LICENCE file for licensing information */

#ifndef TILE_H
#define TILE_H

#define GCWM1 XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
#define GCWM2 GCWM1 | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | \
		XCB_CONFIG_WINDOW_BORDER_WIDTH
#define GCWM3 XCB_CONFIG_WINDOW_STACK_MODE

#define MOVE(win, x, y) xcb_configure_window(c, win, GCWM1,                   \
		(uint32_t []){ x, y })
#define SIZE(win, x, y, w, h, bw) xcb_configure_window(c, win, GCWM2,         \
		(uint32_t []){ x, y, w, h, bw })
#define CSIZE(cli) xcb_configure_window(c, cli->win, GCWM2, (uint32_t [])     \
		{ cli->x, cli->y, cli->w, cli->h, BW * !cli->fsc })
#define RAISE(cli) xcb_configure_window(c, cli->win, GCWM3,                   \
		(uint32_t []){ XCB_STACK_MODE_ABOVE })
#define LOWER(cli) xcb_configure_window(c, cli->win, GCWM3,                   \
		(uint32_t []){ XCB_STACK_MODE_BELOW })

#include <xcb/xcb.h>

extern xcb_connection_t *c;

#include "swim.h"

void attach(cli_t *cli);
void detach(cli_t *cli);

cli_t *next(cli_t *cli);
void tile(mon_t *mon);

#endif /* TILE_H */