Move terminal-related selection logic into st.c

The front-end determines information about mouse clicks and motion, and
the terminal handles the actual selection start/extend/dirty logic by
row and column.

While we're in the neighborhood, we'll also rename getbuttoninfo() to
mousesel() which is, at least, less wrong.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
This commit is contained in:
Devin J. Pohly 2018-02-21 23:29:41 -06:00
parent 5683b1f80c
commit bcb5d3adbe
3 changed files with 54 additions and 41 deletions

3
st.h
View file

@ -172,7 +172,6 @@ void toggleprinter(const Arg *);
int tattrset(int);
void tnew(int, int);
void tresize(int, int);
void tsetdirt(int, int);
void tsetdirtattr(int);
void ttynew(char *, char *, char **);
size_t ttyread(void);
@ -184,6 +183,8 @@ void resettitle(void);
void selclear(void);
void selinit(void);
void selstart(int, int, int);
void selextend(int, int, int);
void selnormalize(void);
int selected(int, int);
char *getsel(void);