]> git.sur5r.net Git - i3/i3/blob - include/workspace.h
f65f1494b1062a8f412d0dfbeddb1b03c8296090
[i3/i3] / include / workspace.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * © 2009-2010 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 #include "tree.h"
15 #include "randr.h"
16
17 #ifndef _WORKSPACE_H
18 #define _WORKSPACE_H
19
20 /**
21  * Returns a pointer to the workspace with the given number (starting at 0),
22  * creating the workspace if necessary (by allocating the necessary amount of
23  * memory and initializing the data structures correctly).
24  *
25  */
26 Con *workspace_get(const char *num);
27
28 #if 0
29 /**
30  * Sets the name (or just its number) for the given workspace. This has to
31  * be called for every workspace as the rendering function
32  * (render_internal_bar) relies on workspace->name and workspace->name_len
33  * being ready-to-use.
34  *
35  */
36 void workspace_set_name(Workspace *ws, const char *name);
37 #endif
38
39 /**
40  * Returns true if the workspace is currently visible. Especially important for
41  * multi-monitor environments, as they can have multiple currenlty active
42  * workspaces.
43  *
44  */
45 bool workspace_is_visible(Con *ws);
46
47 /** Switches to the given workspace */
48 void workspace_show(const char *num);
49
50 #if 0
51 /**
52  * Assigns the given workspace to the given screen by correctly updating its
53  * state and reconfiguring all the clients on this workspace.
54  *
55  * This is called when initializing a screen and when re-assigning it to a
56  * different screen which just got available (if you configured it to be on
57  * screen 1 and you just plugged in screen 1).
58  *
59  */
60 void workspace_assign_to(Workspace *ws, Output *screen, bool hide_it);
61
62 /**
63  * Initializes the given workspace if it is not already initialized. The given
64  * screen is to be understood as a fallback, if the workspace itself either
65  * was not assigned to a particular screen or cannot be placed there because
66  * the screen is not attached at the moment.
67  *
68  */
69 void workspace_initialize(Workspace *ws, Output *screen, bool recheck);
70
71 /**
72  * Gets the first unused workspace for the given screen, taking into account
73  * the preferred_screen setting of every workspace (workspace assignments).
74  *
75  */
76 Workspace *get_first_workspace_for_output(Output *screen);
77
78 /**
79  * Unmaps all clients (and stack windows) of the given workspace.
80  *
81  * This needs to be called separately when temporarily rendering a workspace
82  * which is not the active workspace to force reconfiguration of all clients,
83  * like in src/xinerama.c when re-assigning a workspace to another screen.
84  *
85  */
86 void workspace_unmap_clients(xcb_connection_t *conn, Workspace *u_ws);
87
88 /**
89  * Maps all clients (and stack windows) of the given workspace.
90  *
91  */
92 void workspace_map_clients(xcb_connection_t *conn, Workspace *ws);
93 #endif
94
95 /**
96  * Goes through all clients on the given workspace and updates the workspace’s
97  * urgent flag accordingly.
98  *
99  */
100 void workspace_update_urgent_flag(Con *ws);
101
102 #endif