aboutsummaryrefslogtreecommitdiff
path: root/screen-write.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2017-07-01 00:01:21 +0100
committerThomas Adam <thomas@xteddy.org>2017-07-01 00:01:21 +0100
commit6fba9a39b7c747dcbd83ef0e50c84b7cd3b547c9 (patch)
tree4c182162898eac503627b16d2d7c07a1ebbbf10e /screen-write.c
parentf059fe3ef205be767ab1d18eff9437f8470ea105 (diff)
parentfa677fc0e15e32094d3e6b6816acd88e6bfbb429 (diff)
downloadrtmux-6fba9a39b7c747dcbd83ef0e50c84b7cd3b547c9.tar.gz
rtmux-6fba9a39b7c747dcbd83ef0e50c84b7cd3b547c9.tar.bz2
rtmux-6fba9a39b7c747dcbd83ef0e50c84b7cd3b547c9.zip
Merge branch 'obsd-master'
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/screen-write.c b/screen-write.c
index 6f0f6a22..88f03a31 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -387,9 +387,9 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
}
}
-/* Draw a line on screen. */
+/* Draw a horizontal line on screen. */
void
-screen_write_line(struct screen_write_ctx *ctx, u_int nx, int left, int right)
+screen_write_hline(struct screen_write_ctx *ctx, u_int nx, int left, int right)
{
struct screen *s = ctx->s;
struct grid_cell gc;
@@ -409,6 +409,31 @@ screen_write_line(struct screen_write_ctx *ctx, u_int nx, int left, int right)
screen_write_cursormove(ctx, cx, cy);
}
+/* Draw a horizontal line on screen. */
+void
+screen_write_vline(struct screen_write_ctx *ctx, u_int ny, int top, int bottom)
+{
+ struct screen *s = ctx->s;
+ struct grid_cell gc;
+ u_int cx, cy, i;
+
+ cx = s->cx;
+ cy = s->cy;
+
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.attr |= GRID_ATTR_CHARSET;
+
+ screen_write_putc(ctx, &gc, top ? 'w' : 'x');
+ for (i = 1; i < ny - 1; i++) {
+ screen_write_cursormove(ctx, cx, cy + i);
+ screen_write_putc(ctx, &gc, 'x');
+ }
+ screen_write_cursormove(ctx, cx, cy + ny);
+ screen_write_putc(ctx, &gc, bottom ? 'v' : 'x');
+
+ screen_write_cursormove(ctx, cx, cy);
+}
+
/* Draw a box on screen. */
void
screen_write_box(struct screen_write_ctx *ctx, u_int nx, u_int ny)