]> git.sur5r.net Git - i3/i3/blob - include/client.h
bugfix: really return focus list in IPC tree dump (instead of nodes list)
[i3/i3] / include / client.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * © 2009 Michael Stapelberg and contributors
7  *
8  * See file LICENSE for license information.
9  *
10  */
11 #include <xcb/xcb.h>
12
13 #include "data.h"
14
15 #ifndef _CLIENT_H
16 #define _CLIENT_H
17
18 /**
19  * Removes the given client from the container, either because it will be
20  * inserted into another one or because it was unmapped
21  *
22  */
23 void client_remove_from_container(xcb_connection_t *conn, Client *client,
24                                   Container *container,
25                                   bool remove_from_focusstack);
26
27 /**
28  * Warps the pointer into the given client (in the middle of it, to be
29  * specific), therefore selecting it
30  *
31  */
32 void client_warp_pointer_into(xcb_connection_t *conn, Client *client);
33
34 /**
35  * Kills the given window using WM_DELETE_WINDOW or xcb_kill_window
36  *
37  */
38 void client_kill(xcb_connection_t *conn, Client *window);
39
40 /**
41  * Checks if the given window class and title match the given client Window
42  * title is passed as "normal" string and as UCS-2 converted string for
43  * matching _NET_WM_NAME capable clients as well as those using legacy hints.
44  *
45  */
46 bool client_matches_class_name(Client *client, char *to_class, char *to_title,
47                                char *to_title_ucs, int to_title_ucs_len);
48
49 /**
50  * Sets the position of the given client in the X stack to the highest (tiling
51  * layer is always on the same position, so this doesn’t matter) below the
52  * first floating client, so that floating windows are always on top.
53  *
54  */
55 void client_set_below_floating(xcb_connection_t *conn, Client *client);
56
57 /**
58  * Returns true if the client is floating. Makes the code more beatiful, as
59  * floating is not simply a boolean, but also saves whether the user selected
60  * the current state or whether it was automatically set.
61  *
62  */
63 bool client_is_floating(Client *client);
64
65 /**
66  * Change the border type for the given client to normal (n), 1px border (p) or
67  * completely borderless (b).
68  *
69  */
70 void client_change_border(xcb_connection_t *conn, Client *client, char border_type);
71
72 /**
73  * Change the border type for the given client to normal (n), 1px border (p) or
74  * completely borderless (b) without actually re-rendering the layout. Useful
75  * for calling it when initializing a new client.
76  *
77  */
78 bool client_init_border(xcb_connection_t *conn, Client *client, char border_type);
79
80 /**
81  * Unmap the client, correctly setting any state which is needed.
82  *
83  */
84 void client_unmap(xcb_connection_t *conn, Client *client);
85
86 /**
87  * Map the client, correctly restoring any state needed.
88  *
89  */
90 void client_map(xcb_connection_t *conn, Client *client);
91
92 /**
93  * Set the given mark for this client. Used for jumping to the client
94  * afterwards (like m<mark> and '<mark> in vim).
95  *
96  */
97 void client_mark(xcb_connection_t *conn, Client *client, const char *mark);
98
99 /**
100  * Returns the minimum height of a specific window. The height is calculated
101  * by using 2 pixels (for the client window itself), possibly padding this to
102  * comply with the client’s base_height and then adding the decoration height.
103  *
104  */
105 uint32_t client_min_height(Client *client);
106
107 /**
108  * See client_min_height.
109  *
110  */
111 uint32_t client_min_width(Client *client);
112
113 /**
114  * Pretty-prints the client’s information into the logfile.
115  *
116  */
117 #define CLIENT_LOG(client) do { \
118                 DLOG("Window: frame 0x%08x, child 0x%08x\n", client->frame, client->child); \
119         } while (0)
120
121 #endif