Commit Briefs

8ab629031b Hiltjo Posthuma

LICENSE: fix a few years (tags/0.8)


a712c2dd18 Hiltjo Posthuma

update LICENSE: major contributors


0f245dfeb9 Hiltjo Posthuma

Makefile: add all files to make dist


49a4f91fc5 Hiltjo Posthuma

bump version to 0.8


c5ba9c025b Hiltjo Posthuma

use math.h for ceilf


b81888ee7d Hiltjo Posthuma

xhints: no need to initialize sizeh


8b8255ac0e Hiltjo Posthuma

regression: include termios.h for tcsendbreak etc


20e0da7f14 Devin J. Pohly

General cleanup

Simplifies logic in a couple places and removes a redundant function call. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


403c57ebb5 Devin J. Pohly

Clean up #includes

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


e0215d5377 Devin J. Pohly

Reduce visibility wherever possible

When possible, declare functions/variables static and move struct definitions out of headers. In order to allow utf8decode to become internal, use codepoint for DECSCUSR extension directly. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


30683c70ab Devin J. Pohly

Limit usage of extern to config.h globals

Prefer passing arguments to declaring external global variables. The only remaining usage of extern is for config.h variables which are needed in st.c instead of x.c (where it is now included). Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


a3beb626d2 Devin J. Pohly

Remove x.c dependency on term

The xinit function only needs to the rows/cols, so pass those in rather than accessing term directly. With a bit of arithmetic, we are able to avoid the need for term.row and term.col in x2col, y2row, and xdrawglyphfontspecs as well, completing the removal. Term is now fully internal to st.c. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


a5dc1b4697 Devin J. Pohly

Pull term references out of xdrawcursor

Gradually reducing x.c dependency on Term object. Old and new cursor glyph/position are passed to xdrawcursor. (There may be an opportunity to refactor further if we can unify "clear old cursor" and "draw new cursor" functionality.) Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


88d8293fb4 Devin J. Pohly

Move win-agnostic parts of draw/drawregion to st.c

Introduces three functions to encapsulate X-specific behavior: * xdrawline: draws a portion of a single line (used by drawregion) * xbegindraw: called to prepare for drawing (will be useful for e.g. Wayland) and returns true if drawing should happen * xfinishdraw: called to finish drawing (used by draw) Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


05c66cb37d Devin J. Pohly

Split mode bits between Term and TermWindow

Moves the mode bits used by x.c from Term to TermWindow, absorbing UI/input-related mode bits (visible/focused/numlock) along the way. This is gradually reducing external references to Term. Since TermWindow is already internal to x.c, we add xsetmode() to allow st to modify window bits in accordance with escape sequences. IS_SET() is redefined accordingly (term.mode in st.c, win.mode in x.c). Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


33201ac65f Devin J. Pohly

Move CRLF input processing into ttywrite

This also allows us to remove the crlf field from the Key struct, since the only difference it made was converting "\r" to "\r\n" (which is now done automatically in ttywrite). In addition, MODE_CRLF is no longer referenced from x.c. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


52d6fb1ab1 Devin J. Pohly

Move terminal echo logic into st.c

The only thing differentiating ttywrite and ttysend was the potential for echo; make this a parameter and remove ttysend. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


cfc7acdfd9 Devin J. Pohly

Move remaining selection mode logic into selextend

The "done" parameter indicates a change which finalizes the selection (e.g. a mouse button release as opposed to motion). Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


bcb5d3adbe Devin J. Pohly

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>


5683b1f80c Devin J. Pohly

Move X-specific selection info into XSelection

Data about PRIMARY/CLIPBOARD and clicks are part of the front-end, not the terminal. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


138caf294e Devin J. Pohly

Have selected() check whether selection exists

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


d84f3f4bd1 Devin J. Pohly

Rely on ttyresize to set tty size

This removes ttynew's dependency on cresize being called first, and then allows us to absorb the ttyresize call into cresize (which always precedes it). Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


8b564c1a3f Devin J. Pohly

Remove X and fontconfig from st.c

None of the X-related includes are needed any longer. In addition, move the X modifier defines into x.c, as they are not used outside. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


3bb900cd6c Devin J. Pohly

Remove Time argument from xsetsel

This is an X type and should be internal to x.c. The selcopy() function was a single line and only used in one place, so it was inlined to reduce LOC. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>


323d38da20 Devin J. Pohly

Make win variable internal to x.c

There was only a single reference to the `win` variable in st.c, so exporting that to x.c allows us to rid ourselves of another extern. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>