Home | History | Annotate | Download | only in dist

Lines Matching refs:wp

55 screen_redraw_border_set(struct window *w, struct window_pane *wp,
73 if (wp != NULL && window_pane_index(wp, &idx) == 0)
105 struct window_pane *wp;
107 wp = TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry);
108 if (wp == NULL)
110 if (TAILQ_NEXT(wp, entry) != NULL)
112 if (direction == 0 && wp->xoff == 0)
114 if (direction == 1 && wp->yoff == 0)
121 screen_redraw_pane_border(struct screen_redraw_ctx *ctx, struct window_pane *wp,
124 struct options *oo = wp->window->options;
125 u_int ex = wp->xoff + wp->sx, ey = wp->yoff + wp->sy;
136 if (px >= wp->xoff && px < ex && py >= wp->yoff && py < ey)
143 hsplit = screen_redraw_two_panes(wp->window, 0);
144 vsplit = screen_redraw_two_panes(wp->window, 1);
149 if (window_pane_show_scrollbar(wp, pane_scrollbars))
150 sb_w = wp->scrollbar_style.width + wp->scrollbar_style.pad;
153 * Left/right borders. The wp->sy / 2 test is to colour only half the
156 if ((wp->yoff == 0 || py >= wp->yoff - 1) && py <= ey) {
158 if (wp->xoff - sb_w == 0 && px == wp->sx + sb_w)
159 if (!hsplit || (hsplit && py <= wp->sy / 2))
161 if (wp->xoff - sb_w != 0) {
162 if (px == wp->xoff - sb_w - 1 &&
163 (!hsplit || (hsplit && py > wp->sy / 2)))
165 if (px == wp->xoff + wp->sx + sb_w - 1)
169 if (wp->xoff == 0 && px == wp->sx + sb_w)
170 if (!hsplit || (hsplit && py <= wp->sy / 2))
172 if (wp->xoff != 0) {
173 if (px == wp->xoff - 1 &&
174 (!hsplit || (hsplit && py > wp->sy / 2)))
176 if (px == wp->xoff + wp->sx + sb_w)
184 if (wp->yoff == 0 && py == wp->sy && px <= wp->sx / 2)
186 if (wp->yoff != 0 && py == wp->yoff - 1 && px > wp->sx / 2)
190 if ((wp->xoff - sb_w == 0 || px >= wp->xoff - sb_w) &&
192 if (wp->yoff != 0 && py == wp->yoff - 1)
198 if ((wp->xoff == 0 || px >= wp->xoff) &&
200 if (wp->yoff != 0 && py == wp->yoff - 1)
218 struct window_pane *wp;
233 TAILQ_FOREACH(wp, &w->panes, entry) {
234 if (!window_pane_visible(wp))
236 switch (screen_redraw_pane_border(ctx, wp, px, py)) {
338 struct window_pane *wp, *active;
354 active = wp = server_client_get_pane(c);
356 if (!window_pane_visible(wp))
360 line = wp->yoff - 1;
362 line = wp->yoff + sy;
363 right = wp->xoff + 2 + wp->status_size - 1;
365 if (py == line && px >= wp->xoff + 2 && px <= right)
369 wp = TAILQ_NEXT(wp, entry);
370 if (wp == NULL)
371 wp = TAILQ_FIRST(&w->panes);
372 } while (wp != active);
375 active = wp = server_client_get_pane(c);
377 if (!window_pane_visible(wp))
379 *wpp = wp;
382 if (window_pane_show_scrollbar(wp, pane_scrollbars)) {
385 line = wp->yoff - 1;
387 line = wp->yoff + wp->sy;
394 sb_w = wp->scrollbar_style.width +
395 wp->scrollbar_style.pad;
397 (wp->yoff == 0 && py < wp->sy) ||
398 (py >= wp->yoff && py < wp->yoff + wp->sy)) {
401 (px >= wp->xoff + wp->sx &&
402 px < wp->xoff + wp->sx + sb_w)) ||
404 (px >= wp->xoff - sb_w &&
405 px < wp->xoff)))
414 border = screen_redraw_pane_border(ctx, wp, px, py);
422 wp = TAILQ_NEXT(wp, entry);
423 if (wp == NULL)
424 wp = TAILQ_FIRST(&w->panes);
425 } while (wp != active);
433 struct window_pane *wp)
437 border = screen_redraw_pane_border(ctx, wp, px, py);
445 screen_redraw_make_pane_status(struct client *c, struct window_pane *wp,
448 struct window *w = wp->window;
459 if (window_pane_show_scrollbar(wp, pane_scrollbars))
460 sb_w = wp->scrollbar_style.width + wp->scrollbar_style.pad;
462 ft = format_create(c, NULL, FORMAT_PANE|wp->id, FORMAT_STATUS);
463 format_defaults(ft, c, c->session, c->session->curw, wp);
465 if (wp == server_client_get_pane(c))
469 fmt = options_get_string(wp->options, "pane-border-format");
472 if (wp->sx < 4)
473 wp->status_size = width = 0;
475 wp->status_size = width = wp->sx + sb_w - 2;
477 memcpy(&old, &wp->status_screen, sizeof old);
478 screen_init(&wp->status_screen, width, 1, 0);
479 wp->status_screen.mode = 0;
481 screen_write_start(&ctx, &wp->status_screen);
484 px = wp->xoff + 2 + i;
486 py = wp->yoff - 1;
488 py = wp->yoff + wp->sy;
490 screen_redraw_border_set(w, wp, pane_lines, cell_type, &gc);
502 if (grid_compare(wp->status_screen.grid, old.grid) == 0) {
517 struct window_pane *wp;
523 TAILQ_FOREACH(wp, &w->panes, entry) {
524 if (!window_pane_visible(wp))
526 s = &wp->status_screen;
528 size = wp->status_size;
530 yoff = wp->yoff - 1;
532 yoff = wp->yoff + wp->sy;
533 xoff = wp->xoff + 2;
577 struct window_pane *wp;
596 TAILQ_FOREACH(wp, &w->panes, entry) {
597 if (screen_redraw_make_pane_status(c, wp, ctx, lines))
687 screen_redraw_pane(struct client *c, struct window_pane *wp,
692 if (!window_pane_visible(wp))
700 screen_redraw_draw_pane(&ctx, wp);
702 if (window_pane_show_scrollbar(wp, ctx.pane_scrollbars))
703 screen_redraw_draw_pane_scrollbar(&ctx, wp);
711 u_int y, struct window_pane *wp)
720 if (wp->border_gc_set)
721 return (&wp->border_gc);
722 wp->border_gc_set = 1;
724 ft = format_create_defaults(NULL, c, s, s->curw, wp);
726 style_apply(&wp->border_gc, oo, "pane-active-border-style", ft);
728 style_apply(&wp->border_gc, oo, "pane-border-style", ft);
731 return (&wp->border_gc);
744 struct window_pane *wp, *active = server_client_get_pane(c);
757 cell_type = screen_redraw_check_cell(ctx, x, y, &wp);
761 if (wp == NULL) {
772 tmp = screen_redraw_draw_borders_style(ctx, x, y, wp);
777 if (server_is_marked(s, s->curw, marked_pane.wp) &&
778 screen_redraw_check_is(ctx, x, y, marked_pane.wp))
781 screen_redraw_border_set(w, wp, ctx->pane_lines, cell_type, &gc);
804 if (wp != NULL && arrows) {
806 if (((i == wp->xoff + 1 &&
812 (j == wp->yoff + 1 &&
836 struct window_pane *wp;
841 TAILQ_FOREACH(wp, &w->panes, entry)
842 wp->border_gc_set = 0;
856 struct window_pane *wp;
860 TAILQ_FOREACH(wp, &w->panes, entry) {
861 if (window_pane_visible(wp))
862 screen_redraw_draw_pane(ctx, wp);
890 screen_redraw_draw_pane(struct screen_redraw_ctx *ctx, struct window_pane *wp)
895 struct screen *s = wp->screen;
896 struct colour_palette *palette = &wp->palette;
900 log_debug("%s: %s @%u %%%u", __func__, c->name, w->id, wp->id);
902 if (wp->xoff + wp->sx <= ctx->ox || wp->xoff >= ctx->ox + ctx->sx)
908 for (j = 0; j < wp->sy; j++) {
909 if (wp->yoff + j < ctx->oy || wp->yoff + j >= ctx->oy + ctx->sy)
911 y = top + wp->yoff + j - ctx->oy;
913 if (wp->xoff >= ctx->ox &&
914 wp->xoff + wp->sx <= ctx->ox + ctx->sx) {
917 x = wp->xoff - ctx->ox;
918 width = wp->sx;
919 } else if (wp->xoff < ctx->ox &&
920 wp->xoff + wp->sx > ctx->ox + ctx->sx) {
925 } else if (wp->xoff < ctx->ox) {
927 i = ctx->ox - wp->xoff;
929 width = wp->sx - i;
933 x = wp->xoff - ctx->ox;
937 __func__, c->name, wp->id, i, j, x, y, width);
939 tty_default_colours(&defaults, wp);
944 tty_draw_images(c, wp, s);
954 struct window_pane *wp;
958 TAILQ_FOREACH(wp, &w->panes, entry) {
959 if (window_pane_show_scrollbar(wp, ctx->pane_scrollbars) &&
960 window_pane_visible(wp))
961 screen_redraw_draw_pane_scrollbar(ctx, wp);
968 struct window_pane *wp)
970 struct screen *s = wp->screen;
972 u_int sb = ctx->pane_scrollbars, total_height, sb_h = wp->sy;
974 int sb_w = wp->scrollbar_style.width;
975 int sb_pad = wp->scrollbar_style.pad;
977 int xoff = wp->xoff, ox = ctx->ox;
978 int sb_x, sb_y = (int)(wp->yoff - ctx->oy); /* sb top */
980 if (window_pane_mode(wp) == WINDOW_PANE_NO_MODE) {
989 if (TAILQ_FIRST(&wp->modes) == NULL)
991 if (window_copy_get_current_offset(wp, &cm_y, &cm_size) == 0)
1002 sb_x = xoff + wp->sx - ox;
1009 screen_redraw_draw_scrollbar(ctx, wp, sb_pos, sb_x, sb_y, sb_h,
1013 wp->sb_slider_y = slider_y; /* top of slider y pos in scrollbar */
1014 wp->sb_slider_h = slider_h; /* height of slider */
1019 struct window_pane *wp, int sb_pos, int sb_x, int sb_y, u_int sb_h,
1025 struct style *sb_style = &wp->scrollbar_style;
1029 int sx = ctx->sx, sy = ctx->sy, xoff = wp->xoff;
1030 int yoff = wp->yoff;