diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2017-10-10 12:46:53 -0500 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
commit | a8314643b1aeaa2187dad71dc5748aaac1760c1b (patch) | |
tree | 563c3943af0790e419eae99da709b9dd5fd5cefb /st.c | |
parent | a09138afa57adb4b76dba8ca72dc7ee2642a5c8d (diff) | |
download | st-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.c | 36 |
1 files changed, 0 insertions, 36 deletions
@@ -165,7 +165,6 @@ static void tnewline(int); | |||
165 | static void tputtab(int); | 165 | static void tputtab(int); |
166 | static void tputc(Rune); | 166 | static void tputc(Rune); |
167 | static void treset(void); | 167 | static void treset(void); |
168 | static void tresize(int, int); | ||
169 | static void tscrollup(int, int); | 168 | static void tscrollup(int, int); |
170 | static void tscrolldown(int, int); | 169 | static void tscrolldown(int, int); |
171 | static void tsetattr(int *, int); | 170 | static void tsetattr(int *, int); |
@@ -420,24 +419,6 @@ selinit(void) | |||
420 | } | 419 | } |
421 | 420 | ||
422 | int | 421 | int |
423 | x2col(int x) | ||
424 | { | ||
425 | x -= borderpx; | ||
426 | x /= win.cw; | ||
427 | |||
428 | return LIMIT(x, 0, term.col-1); | ||
429 | } | ||
430 | |||
431 | int | ||
432 | y2row(int y) | ||
433 | { | ||
434 | y -= borderpx; | ||
435 | y /= win.ch; | ||
436 | |||
437 | return LIMIT(y, 0, term.row-1); | ||
438 | } | ||
439 | |||
440 | int | ||
441 | tlinelen(int y) | 422 | tlinelen(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 | |||
2624 | void | ||
2625 | cresize(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 | } | ||