2009-02-13 20:33:31 -05:00
|
|
|
|
/*
|
|
|
|
|
* vim:ts=8:expandtab
|
|
|
|
|
*
|
|
|
|
|
* i3 - an improved dynamic tiling window manager
|
|
|
|
|
*
|
|
|
|
|
* (c) 2009 Michael Stapelberg and contributors
|
|
|
|
|
*
|
|
|
|
|
* See file LICENSE for license information.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-02-07 22:04:35 -05:00
|
|
|
|
#include <stdbool.h>
|
2009-02-14 19:58:09 -05:00
|
|
|
|
|
2009-02-27 19:12:05 -05:00
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
|
|
2009-02-07 22:04:35 -05:00
|
|
|
|
#include "data.h"
|
|
|
|
|
|
|
|
|
|
#ifndef _TABLE_H
|
|
|
|
|
#define _TABLE_H
|
|
|
|
|
|
2009-02-12 23:16:47 -05:00
|
|
|
|
#define CUR_TABLE (c_ws->table)
|
|
|
|
|
#define CUR_CELL (CUR_TABLE[current_col][current_row])
|
2009-02-07 22:04:35 -05:00
|
|
|
|
|
2009-02-12 23:16:47 -05:00
|
|
|
|
extern Workspace *c_ws;
|
2009-09-29 13:45:41 -04:00
|
|
|
|
extern TAILQ_HEAD(workspaces_head, Workspace) *workspaces;
|
|
|
|
|
//extern int num_workspaces;
|
2009-02-13 13:04:45 -05:00
|
|
|
|
extern int current_col;
|
|
|
|
|
extern int current_row;
|
2009-02-07 22:04:35 -05:00
|
|
|
|
|
2009-04-07 13:02:07 -04:00
|
|
|
|
/** Initialize table */
|
2009-02-07 22:04:35 -05:00
|
|
|
|
void init_table();
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
|
|
|
|
/** Add one row to the table */
|
2009-02-12 23:16:47 -05:00
|
|
|
|
void expand_table_rows(Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
|
|
|
|
/** Adds one row at the head of the table */
|
2009-03-11 13:56:31 -04:00
|
|
|
|
void expand_table_rows_at_head(Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
|
|
|
|
/** Add one column to the table */
|
2009-02-12 23:16:47 -05:00
|
|
|
|
void expand_table_cols(Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
2009-06-29 15:54:51 -04:00
|
|
|
|
/**
|
|
|
|
|
* Inserts one column at the table’s head
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-03-10 20:55:10 -04:00
|
|
|
|
void expand_table_cols_at_head(Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
2009-06-29 15:54:51 -04:00
|
|
|
|
/**
|
|
|
|
|
* Performs simple bounds checking for the given column/row
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-02-07 22:04:35 -05:00
|
|
|
|
bool cell_exists(int col, int row);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
2009-06-29 15:54:51 -04:00
|
|
|
|
/**
|
|
|
|
|
* Shrinks the table by "compacting" it, that is, removing completely empty
|
|
|
|
|
* rows/columns
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-02-27 19:12:05 -05:00
|
|
|
|
void cleanup_table(xcb_connection_t *conn, Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
2009-06-29 15:54:51 -04:00
|
|
|
|
/**
|
|
|
|
|
* Fixes col/rowspan (makes sure there are no overlapping windows)
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-03-05 11:17:37 -05:00
|
|
|
|
void fix_colrowspan(xcb_connection_t *conn, Workspace *workspace);
|
2009-04-07 13:02:07 -04:00
|
|
|
|
|
2009-06-29 15:54:51 -04:00
|
|
|
|
/**
|
|
|
|
|
* Prints the table’s contents in human-readable form for debugging
|
|
|
|
|
*
|
|
|
|
|
*/
|
2009-03-05 11:17:37 -05:00
|
|
|
|
void dump_table(xcb_connection_t *conn, Workspace *workspace);
|
|
|
|
|
|
2009-02-07 22:04:35 -05:00
|
|
|
|
#endif
|