diff options
| -rw-r--r-- | st.c | 19 |
1 files changed, 11 insertions, 8 deletions
| @@ -408,6 +408,7 @@ static void ttysend(char *, size_t); | |||
| 408 | static void ttywrite(const char *, size_t); | 408 | static void ttywrite(const char *, size_t); |
| 409 | static void tstrsequence(uchar); | 409 | static void tstrsequence(uchar); |
| 410 | 410 | ||
| 411 | static inline ushort sixd_to_16bit(int); | ||
| 411 | static void xdraws(char *, Glyph, int, int, int, int); | 412 | static void xdraws(char *, Glyph, int, int, int, int); |
| 412 | static void xhints(void); | 413 | static void xhints(void); |
| 413 | static void xclear(int, int, int, int); | 414 | static void xclear(int, int, int, int); |
| @@ -452,6 +453,8 @@ static char *getsel(void); | |||
| 452 | static void selcopy(void); | 453 | static void selcopy(void); |
| 453 | static void selscroll(int, int); | 454 | static void selscroll(int, int); |
| 454 | static void selsnap(int, int *, int *, int); | 455 | static void selsnap(int, int *, int *, int); |
| 456 | static int x2col(int); | ||
| 457 | static int y2row(int); | ||
| 455 | static void getbuttoninfo(XEvent *); | 458 | static void getbuttoninfo(XEvent *); |
| 456 | static void mousereport(XEvent *); | 459 | static void mousereport(XEvent *); |
| 457 | 460 | ||
| @@ -640,7 +643,7 @@ utf8validate(long *u, size_t i) { | |||
| 640 | return i; | 643 | return i; |
| 641 | } | 644 | } |
| 642 | 645 | ||
| 643 | static void | 646 | void |
| 644 | selinit(void) { | 647 | selinit(void) { |
| 645 | memset(&sel.tclick1, 0, sizeof(sel.tclick1)); | 648 | memset(&sel.tclick1, 0, sizeof(sel.tclick1)); |
| 646 | memset(&sel.tclick2, 0, sizeof(sel.tclick2)); | 649 | memset(&sel.tclick2, 0, sizeof(sel.tclick2)); |
| @@ -653,7 +656,7 @@ selinit(void) { | |||
| 653 | sel.xtarget = XA_STRING; | 656 | sel.xtarget = XA_STRING; |
| 654 | } | 657 | } |
| 655 | 658 | ||
| 656 | static int | 659 | int |
| 657 | x2col(int x) { | 660 | x2col(int x) { |
| 658 | x -= borderpx; | 661 | x -= borderpx; |
| 659 | x /= xw.cw; | 662 | x /= xw.cw; |
| @@ -661,7 +664,7 @@ x2col(int x) { | |||
| 661 | return LIMIT(x, 0, term.col-1); | 664 | return LIMIT(x, 0, term.col-1); |
| 662 | } | 665 | } |
| 663 | 666 | ||
| 664 | static int | 667 | int |
| 665 | y2row(int y) { | 668 | y2row(int y) { |
| 666 | y -= borderpx; | 669 | y -= borderpx; |
| 667 | y /= xw.ch; | 670 | y /= xw.ch; |
| @@ -669,7 +672,7 @@ y2row(int y) { | |||
| 669 | return LIMIT(y, 0, term.row-1); | 672 | return LIMIT(y, 0, term.row-1); |
| 670 | } | 673 | } |
| 671 | 674 | ||
| 672 | static int tlinelen(int y) { | 675 | int tlinelen(int y) { |
| 673 | int i = term.col; | 676 | int i = term.col; |
| 674 | 677 | ||
| 675 | if(term.line[y][i - 1].mode & ATTR_WRAP) | 678 | if(term.line[y][i - 1].mode & ATTR_WRAP) |
| @@ -681,7 +684,7 @@ static int tlinelen(int y) { | |||
| 681 | return i; | 684 | return i; |
| 682 | } | 685 | } |
| 683 | 686 | ||
| 684 | static void | 687 | void |
| 685 | selnormalize(void) { | 688 | selnormalize(void) { |
| 686 | int i; | 689 | int i; |
| 687 | 690 | ||
| @@ -708,7 +711,7 @@ selnormalize(void) { | |||
| 708 | sel.ne.x = term.col - 1; | 711 | sel.ne.x = term.col - 1; |
| 709 | } | 712 | } |
| 710 | 713 | ||
| 711 | static inline bool | 714 | bool |
| 712 | selected(int x, int y) { | 715 | selected(int x, int y) { |
| 713 | if(sel.type == SEL_RECTANGULAR) | 716 | if(sel.type == SEL_RECTANGULAR) |
| 714 | return BETWEEN(y, sel.nb.y, sel.ne.y) | 717 | return BETWEEN(y, sel.nb.y, sel.ne.y) |
| @@ -2857,7 +2860,7 @@ xresize(int col, int row) { | |||
| 2857 | xclear(0, 0, xw.w, xw.h); | 2860 | xclear(0, 0, xw.w, xw.h); |
| 2858 | } | 2861 | } |
| 2859 | 2862 | ||
| 2860 | static inline ushort | 2863 | ushort |
| 2861 | sixd_to_16bit(int x) { | 2864 | sixd_to_16bit(int x) { |
| 2862 | return x == 0 ? 0 : 0x3737 + 0x2828 * x; | 2865 | return x == 0 ? 0 : 0x3737 + 0x2828 * x; |
| 2863 | } | 2866 | } |
| @@ -3772,7 +3775,7 @@ focus(XEvent *ev) { | |||
| 3772 | } | 3775 | } |
| 3773 | } | 3776 | } |
| 3774 | 3777 | ||
| 3775 | static inline bool | 3778 | bool |
| 3776 | match(uint mask, uint state) { | 3779 | match(uint mask, uint state) { |
| 3777 | return mask == XK_ANY_MOD || mask == (state & ~ignoremod); | 3780 | return mask == XK_ANY_MOD || mask == (state & ~ignoremod); |
| 3778 | } | 3781 | } |
