aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-10 12:46:53 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commita8314643b1aeaa2187dad71dc5748aaac1760c1b (patch)
tree563c3943af0790e419eae99da709b9dd5fd5cefb /st.c
parenta09138afa57adb4b76dba8ca72dc7ee2642a5c8d (diff)
downloadst-a8314643b1aeaa2187dad71dc5748aaac1760c1b.tar.gz
st-a8314643b1aeaa2187dad71dc5748aaac1760c1b.zip
Move window-manipulating functions into x.c
xresize is now internal to x.c Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to 'st.c')
-rw-r--r--st.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/st.c b/st.c
index 540b487..75c191d 100644
--- a/st.c
+++ b/st.c
@@ -165,7 +165,6 @@ static void tnewline(int);
165static void tputtab(int); 165static void tputtab(int);
166static void tputc(Rune); 166static void tputc(Rune);
167static void treset(void); 167static void treset(void);
168static void tresize(int, int);
169static void tscrollup(int, int); 168static void tscrollup(int, int);
170static void tscrolldown(int, int); 169static void tscrolldown(int, int);
171static void tsetattr(int *, int); 170static void tsetattr(int *, int);
@@ -420,24 +419,6 @@ selinit(void)
420} 419}
421 420
422int 421int
423x2col(int x)
424{
425 x -= borderpx;
426 x /= win.cw;
427
428 return LIMIT(x, 0, term.col-1);
429}
430
431int
432y2row(int y)
433{
434 y -= borderpx;
435 y /= win.ch;
436
437 return LIMIT(y, 0, term.row-1);
438}
439
440int
441tlinelen(int y) 422tlinelen(int y)
442{ 423{
443 int i = term.col; 424 int i = term.col;
@@ -2620,20 +2601,3 @@ kmap(KeySym k, uint state)
2620 2601
2621 return NULL; 2602 return NULL;
2622} 2603}
2623
2624void
2625cresize(int width, int height)
2626{
2627 int col, row;
2628
2629 if (width != 0)
2630 win.w = width;
2631 if (height != 0)
2632 win.h = height;
2633
2634 col = (win.w - 2 * borderpx) / win.cw;
2635 row = (win.h - 2 * borderpx) / win.ch;
2636
2637 tresize(col, row);
2638 xresize(col, row);
2639}