-/**
- * A client is X11-speak for a window.
- *
- */
-struct Client {
- /** initialized will be set to true if the client was fully
- * initialized by manage_window() and all functions can be used
- * normally */
- bool initialized;
-
- /** if you set a client to floating and set it back to managed, it
- * does remember its old position and *tries* to get back there */
- Cell old_position;
-
- /** Backpointer. A client is inside a container */
- Container *container;
- /** Because dock clients don’t have a container, we have this
- * workspace-backpointer */
- Workspace *workspace;
-
- /** x, y, width, height of the frame */
- Rect rect;
- /** Position in floating mode and in tiling mode are saved
- * separately */
- Rect floating_rect;
- /** x, y, width, height of the child (relative to its frame) */
- Rect child_rect;
-
- /** contains the size calculated from the hints set by the window or 0
- * if the client did not send any hints */
- int proportional_height;
- int proportional_width;
-
- int base_height;
- int base_width;
-
- /** The amount of pixels which X will draw around the client. */
- int border_width;
-
- /** contains the minimum increment size as specified for the window
- * (in pixels). */
- int width_increment;
- int height_increment;
-
- /** Height which was determined by reading the _NET_WM_STRUT_PARTIAL
- * top/bottom of the screen reservation */
- int desired_height;
-
- /** Name (= window title) */
- char *name;
- /** name_len stores the real string length (glyphs) of the window
- * title if the client uses _NET_WM_NAME. Otherwise, it is set to -1
- * to indicate that name should be just passed to X as 8-bit string
- * and therefore will not be rendered correctly. This behaviour is to
- * support legacy applications which do not set _NET_WM_NAME */
- int name_len;
- /** This will be set to true as soon as the first _NET_WM_NAME comes
- * in. If set to true, legacy window names are ignored. */
- bool uses_net_wm_name;
-
- /** Holds the WM_CLASS (which consists of two strings, the instance
- * and the class), useful for matching the client in commands */
- char *window_class_instance;
- char *window_class_class;
-
- /** Holds the client’s mark, for vim-like jumping */
- char *mark;
-
- /** Holds the xcb_window_t (just an ID) for the leader window (logical
- * parent for toolwindows and similar floating windows) */
- xcb_window_t leader;
-
- /** fullscreen is pretty obvious */
- bool fullscreen;
-
- /** floating? (= not in tiling layout) This cannot be simply a bool
- * because we want to keep track of whether the status was set by the
- * application (by setting WM_CLASS to tools for example) or by the
- * user. The user’s choice overwrites automatic mode, of course. The
- * order of the values is important because we check with >=
- * FLOATING_AUTO_ON if a client is floating. */
- enum { FLOATING_AUTO_OFF = 0, FLOATING_USER_OFF = 1, FLOATING_AUTO_ON = 2, FLOATING_USER_ON = 3 } floating;
-
- /** Ensure TITLEBAR_TOP maps to 0 because we use calloc for
- * initialization later */
- enum { TITLEBAR_TOP = 0, TITLEBAR_LEFT, TITLEBAR_RIGHT, TITLEBAR_BOTTOM, TITLEBAR_OFF } titlebar_position;
-
- /** Contains a bool specifying whether this window should not be drawn
- * with the usual decorations */
- bool borderless;
-
- /** If a client is set as a dock, it is placed at the very bottom of
- * the screen and its requested size is used */
- bool dock;
-
- /** True if the client set the urgency flag in its WM_HINTS property */
- bool urgent;
-
- /* After leaving fullscreen mode, a client needs to be reconfigured
- * (configuration = setting X, Y, width and height). By setting the
- * force_reconfigure flag, render_layout() will reconfigure the
- * client. */
- bool force_reconfigure;
-
- /* When reparenting a window, an unmap-notify is sent. As we delete
- * windows when they’re unmapped, we need to ignore that
- * one. Therefore, this flag is set when reparenting. */
- bool awaiting_useless_unmap;
-
- /* XCB contexts */
- xcb_window_t frame; /**< Our window: The frame around the
- * client */
- xcb_gcontext_t titlegc; /**< The titlebar’s graphic context
- * inside the frame */
- xcb_window_t child; /**< The client’s window */
-
- /** The following entry provides the necessary list pointers to use
- * Client with LIST_* macros */
- CIRCLEQ_ENTRY(Client) clients;
- SLIST_ENTRY(Client) dock_clients;
- SLIST_ENTRY(Client) focus_clients;
- TAILQ_ENTRY(Client) floating_clients;
-};
-
-/**
- * A container is either in default, stacking or tabbed mode. There is one for
- * each cell of the table.
- *
- */
-struct Container {
- /* Those are speaking for themselves: */
- Client *currently_focused;
- int colspan;
- int rowspan;
-
- /* Position of the container inside our table */
- int row;
- int col;
- /* Xinerama: X/Y of the container */
- int x;
- int y;
- /* Width/Height of the container. Changeable by the user */
- int width;
- int height;
-
- /* When in stacking mode, we draw the titlebars of each client onto a
- * separate window */
- struct Stack_Window stack_win;
-
- /* Backpointer to the workspace this container is in */
- Workspace *workspace;
-
- /* Ensure MODE_DEFAULT maps to 0 because we use calloc for
- * initialization later */
- enum { MODE_DEFAULT = 0, MODE_STACK, MODE_TABBED } mode;
-
- /* When in stacking, one can either have unlimited windows inside the
- * container or set a limit for the rows or columns the stack window
- * should display to use the screen more efficiently. */
- enum { STACK_LIMIT_NONE = 0, STACK_LIMIT_COLS, STACK_LIMIT_ROWS } stack_limit;
-
- /* The number of columns or rows to limit to, see stack_limit */
- int stack_limit_value;
-
- CIRCLEQ_HEAD(client_head, Client) clients;
-};