]> git.sur5r.net Git - i3/i3/blob - data.h
Use containers
[i3/i3] / data.h
1 /*
2  * This file defines all data structures used by i3
3  *
4  */
5 #include "queue.h"
6
7 /*
8  * Defines a position in the table
9  *
10  */
11 typedef struct Cell {
12         int row;
13         int column;
14 } Cell;
15
16 /*
17  * We need to save the height of a font because it is required for each drawing of
18  * text but relatively hard to get. As soon as a new font needs to be loaded, a
19  * Font-entry will be filled for later use.
20  *
21  */
22 typedef struct Font {
23         char *name;
24         int height;
25 } Font;
26
27 /*
28  * A client is X11-speak for a window.
29  *
30  */
31 typedef struct Client {
32         /* TODO: this is NOT final */
33         Cell old_position; /* if you set a client to floating and set it back to managed,
34                               it does remember its old position and *tries* to get back there */
35
36
37         /* XCB contexts */
38         xcb_gcontext_t titlegc;
39         xcb_window_t window;
40         xcb_window_t child;
41
42         /* The following entry provides the necessary list pointers to use Client with LIST_* macros */
43         LIST_ENTRY(Client) clients;
44 } Client;
45
46 /*
47  * A container is either in default or stacking mode. It sits inside the table.
48  *
49  */
50 typedef struct Container {
51         /* Ensure MODE_DEFAULT maps to 0 because we use calloc for initialization later */
52         int row;
53         int col;
54         enum { MODE_DEFAULT = 0, MODE_STACK = 1 } mode;
55         LIST_HEAD(client_head, Client) clients;
56 } Container;