42 return (value > 0) ? value : 0;
61 if (!(*wp)->state.visible)
69 const int avail =
MIN(space, req);
70 (*wp)->state.cols = avail;
77 const int avail = (space > 0) ? 1 : 0;
78 (*wp)->state.cols = avail;
100 if ((max_count > 0) && (space > 0))
102 int alloc = (space + max_count - 1) / max_count;
107 if (!(*wp)->state.visible)
112 const int share =
MIN(space, alloc);
113 (*wp)->state.cols += share;
122 if (!(*wp)->state.visible)
125 (*wp)->state.col_offset = col;
127 col += (*wp)->state.cols;
152 if (!(*wp)->state.visible)
160 const int avail =
MIN(space, req);
161 (*wp)->state.rows = avail;
168 const int avail = (space > 0) ? 1 : 0;
169 (*wp)->state.rows = avail;
191 if ((max_count > 0) && (space > 0))
193 int alloc = (space + max_count - 1) / max_count;
198 if (!(*wp)->state.visible)
203 const int share =
MIN(space, alloc);
204 (*wp)->state.rows += share;
213 if (!(*wp)->state.visible)
216 (*wp)->state.row_offset = row;
218 row += (*wp)->state.rows;
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define MIN(a, b)
Return the minimum of two values.
Convenience wrapper for the library headers.
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
@ MUTT_WIN_SIZE_MINIMISE
Window size depends on its children.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
static void window_reflow_vert(struct MuttWindow *win)
Reflow Windows using all the available vertical space.
static void window_reflow_horiz(struct MuttWindow *win)
Reflow Windows using all the available horizontal space.
void window_reflow(struct MuttWindow *win)
Reflow Windows.
static int non_negative(int value)
Clamp an integer to a non-negative value.
struct MuttWindowArray children
Children Windows.
struct WindowState state
Current state of the Window.
enum MuttWindowOrientation orient
Which direction the Window will expand.
enum MuttWindowSize size
Type of Window, e.g. MUTT_WIN_SIZE_FIXED.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
short row_offset
Absolute on-screen row.
short col_offset
Absolute on-screen column.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.