Lines Matching defs:w
74 layout_set_select(struct window *w, u_int layout)
80 layout_sets[layout].arrange(w);
82 w->lastlayout = layout;
87 layout_set_next(struct window *w)
91 if (w->lastlayout == -1)
94 layout = w->lastlayout + 1;
100 layout_sets[layout].arrange(w);
101 w->lastlayout = layout;
106 layout_set_previous(struct window *w)
110 if (w->lastlayout == -1)
113 layout = w->lastlayout;
121 layout_sets[layout].arrange(w);
122 w->lastlayout = layout;
127 layout_set_even(struct window *w, enum layout_type type)
133 layout_print_cell(w->layout_root, __func__, 1);
136 n = window_count_panes(w);
141 layout_free(w);
142 lc = w->layout_root = layout_create_cell(NULL);
145 if (sx < w->sx)
146 sx = w->sx;
147 sy = w->sy;
150 if (sy < w->sy)
151 sy = w->sy;
152 sx = w->sx;
158 TAILQ_FOREACH(wp, &w->panes, entry) {
161 lcnew->sx = w->sx;
162 lcnew->sy = w->sy;
167 layout_spread_cell(w, lc);
170 layout_fix_offsets(w);
171 layout_fix_panes(w, NULL);
173 layout_print_cell(w->layout_root, __func__, 1);
175 window_resize(w, lc->sx, lc->sy, -1, -1);
176 notify_window("window-layout-changed", w);
177 server_redraw_window(w);
181 layout_set_even_h(struct window *w)
183 layout_set_even(w, LAYOUT_LEFTRIGHT);
187 layout_set_even_v(struct window *w)
189 layout_set_even(w, LAYOUT_TOPBOTTOM);
193 layout_set_main_h(struct window *w)
201 layout_print_cell(w->layout_root, __func__, 1);
204 n = window_count_panes(w);
210 sy = w->sy - 1;
213 s = options_get_string(w->options, "main-pane-height");
228 s = options_get_string(w->options, "other-pane-height");
241 if (sx < w->sx)
242 sx = w->sx;
245 layout_free(w);
246 lc = w->layout_root = layout_create_cell(NULL);
253 layout_make_leaf(lcmain, TAILQ_FIRST(&w->panes));
260 wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry);
268 TAILQ_FOREACH(wp, &w->panes, entry) {
269 if (wp == TAILQ_FIRST(&w->panes))
276 layout_spread_cell(w, lcother);
280 layout_fix_offsets(w);
281 layout_fix_panes(w, NULL);
283 layout_print_cell(w->layout_root, __func__, 1);
285 window_resize(w, lc->sx, lc->sy, -1, -1);
286 notify_window("window-layout-changed", w);
287 server_redraw_window(w);
291 layout_set_main_h_mirrored(struct window *w)
299 layout_print_cell(w->layout_root, __func__, 1);
302 n = window_count_panes(w);
308 sy = w->sy - 1;
311 s = options_get_string(w->options, "main-pane-height");
326 s = options_get_string(w->options, "other-pane-height");
339 if (sx < w->sx)
340 sx = w->sx;
343 layout_free(w);
344 lc = w->layout_root = layout_create_cell(NULL);
352 wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry);
360 TAILQ_FOREACH(wp, &w->panes, entry) {
361 if (wp == TAILQ_FIRST(&w->panes))
368 layout_spread_cell(w, lcother);
374 layout_make_leaf(lcmain, TAILQ_FIRST(&w->panes));
378 layout_fix_offsets(w);
379 layout_fix_panes(w, NULL);
381 layout_print_cell(w->layout_root, __func__, 1);
383 window_resize(w, lc->sx, lc->sy, -1, -1);
384 notify_window("window-layout-changed", w);
385 server_redraw_window(w);
389 layout_set_main_v(struct window *w)
397 layout_print_cell(w->layout_root, __func__, 1);
400 n = window_count_panes(w);
406 sx = w->sx - 1;
409 s = options_get_string(w->options, "main-pane-width");
424 s = options_get_string(w->options, "other-pane-width");
437 if (sy < w->sy)
438 sy = w->sy;
441 layout_free(w);
442 lc = w->layout_root = layout_create_cell(NULL);
449 layout_make_leaf(lcmain, TAILQ_FIRST(&w->panes));
456 wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry);
464 TAILQ_FOREACH(wp, &w->panes, entry) {
465 if (wp == TAILQ_FIRST(&w->panes))
472 layout_spread_cell(w, lcother);
476 layout_fix_offsets(w);
477 layout_fix_panes(w, NULL);
479 layout_print_cell(w->layout_root, __func__, 1);
481 window_resize(w, lc->sx, lc->sy, -1, -1);
482 notify_window("window-layout-changed", w);
483 server_redraw_window(w);
487 layout_set_main_v_mirrored(struct window *w)
495 layout_print_cell(w->layout_root, __func__, 1);
498 n = window_count_panes(w);
504 sx = w->sx - 1;
507 s = options_get_string(w->options, "main-pane-width");
522 s = options_get_string(w->options, "other-pane-width");
535 if (sy < w->sy)
536 sy = w->sy;
539 layout_free(w);
540 lc = w->layout_root = layout_create_cell(NULL);
548 wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry);
556 TAILQ_FOREACH(wp, &w->panes, entry) {
557 if (wp == TAILQ_FIRST(&w->panes))
564 layout_spread_cell(w, lcother);
570 layout_make_leaf(lcmain, TAILQ_FIRST(&w->panes));
574 layout_fix_offsets(w);
575 layout_fix_panes(w, NULL);
577 layout_print_cell(w->layout_root, __func__, 1);
579 window_resize(w, lc->sx, lc->sy, -1, -1);
580 notify_window("window-layout-changed", w);
581 server_redraw_window(w);
585 layout_set_tiled(struct window *w)
592 layout_print_cell(w->layout_root, __func__, 1);
595 n = window_count_panes(w);
608 width = (w->sx - (columns - 1)) / columns;
611 height = (w->sy - (rows - 1)) / rows;
616 layout_free(w);
617 lc = w->layout_root = layout_create_cell(NULL);
619 if (sx < w->sx)
620 sx = w->sx;
622 if (sy < w->sy)
623 sy = w->sy;
628 wp = TAILQ_FIRST(&w->panes);
636 layout_set_size(lcrow, w->sx, height, 0, 0);
667 if (w->sx <= used)
670 layout_resize_adjust(w, lcchild, LAYOUT_LEFTRIGHT,
671 w->sx - used);
676 if (w->sy > used) {
678 layout_resize_adjust(w, lcrow, LAYOUT_TOPBOTTOM,
679 w->sy - used);
683 layout_fix_offsets(w);
684 layout_fix_panes(w, NULL);
686 layout_print_cell(w->layout_root, __func__, 1);
688 window_resize(w, lc->sx, lc->sy, -1, -1);
689 notify_window("window-layout-changed", w);
690 server_redraw_window(w);