Refactor out some individual functions in render_con() to make the code more readable.

This commit is contained in:
Ingo Bürk
2015-09-09 18:27:34 +02:00
parent c9b6ec71aa
commit dd989fa87b
2 changed files with 154 additions and 119 deletions

View File

@ -10,6 +10,23 @@
*/
#pragma once
/* This is used to keep a state to pass around when rendering a con in render_con(). */
typedef struct render_params {
/* A copy of the coordinates of the container which is being rendered. */
int x;
int y;
/* The computed height for decorations. */
int deco_height;
/* Container rect, subtract container border. This is the actually usable space
* inside this container for clients. */
Rect rect;
/* The number of children of the container which is being rendered. */
int children;
/* A precalculated list of sizes of each child. */
int *sizes;
} render_params;
/**
* "Renders" the given container (and its children), meaning that all rects are
* updated correctly. Note that this function does not call any xcb_*