1 static void fibonacci(int s
)
3 unsigned int nx
, ny
, nw
, nnw
, nh
, nnh
, i
, n
, mod
;
6 for (n
= 0, c
= nextvisible(clients
); c
; c
= nextvisible(c
->next
))
10 /* initial position and dimensions */
13 nw
= (n
== 1) ? waw
: screen
.mfact
* waw
;
14 /* don't waste space dviding by 2 doesn't work for odd numbers
15 * plus we need space for the border too. therefore set up these
16 * variables for the next new width/height
21 /* set the mod factor, 2 for dwindle, 4 for spiral */
24 for (i
= 0, c
= nextvisible(clients
); c
; c
= nextvisible(c
->next
)) {
27 /* dwindle: even case, spiral: case 0 */
37 /* don't adjust the width for the last client */
42 mvaddch(ny
, nx
- 1, ACS_LTEE
);
44 } else if (i
% mod
== 1) { /* dwindle: odd case, spiral: case 1 */
46 mvvline(ny
, nx
, ACS_VLINE
, nh
);
47 mvaddch(ny
, nx
, ACS_TTEE
);
50 /* don't adjust the height for the last client */
55 } else if (i
% mod
== 2 && s
) { /* spiral: case 2 */
58 /* don't adjust the width for the last client */
63 mvvline(ny
, nx
, ACS_VLINE
, nh
);
64 mvaddch(ny
, nx
, ACS_TTEE
);
67 mvaddch(ny
, nx
- 1, ACS_LTEE
);
69 } else if (s
) { /* spiral: case 3 */
71 nx
-= nw
+ 1; /* border */
72 /* don't adjust the height for the last client */
78 mvaddch(ny
, nx
- 1, ACS_LTEE
);
81 resize(c
, nx
, ny
, nw
, nh
);
86 static void spiral(void)
91 static void dwindle(void)