aboutsummaryrefslogtreecommitdiffstats
path: root/win.h
AgeCommit message (Collapse)Author
2022-04-19code-golfing: cleanup osc color related codeNRK
* adds missing function prototype * move xgetcolor() prototype to win.h (that's where all the other x.c func prototype seems to be declared at) * check for snprintf error/truncation * reduces code duplication for osc 10/11/12 * unify osc_color_response() and osc4_color_response() into a single function the latter two was suggested by Quentin Rameau in his patch review on the hackers list.
2020-10-18ST: Add WM_ICON_NAME property supportJohn Collis
Also added _NET_WM_ICON_NAME.
2019-02-12better Input Method Editor (IME) supportIvan Tham
Features: - Allow input methods swap with hotkey (E.g. left ctrl + left shift). - Over-the-spot pre-editing style, pre-edit data placed over insertion point. - Restart IME without segmentation fault. TODO: - Automatically pickup IME if st started before IME
2018-02-26Reduce visibility wherever possibleDevin J. Pohly
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>
2018-02-26Pull term references out of xdrawcursorDevin J. Pohly
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>
2018-02-26Move win-agnostic parts of draw/drawregion to st.cDevin J. Pohly
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>
2018-02-26Split mode bits between Term and TermWindowDevin J. Pohly
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>
2018-02-26Remove X and fontconfig from st.cDevin J. Pohly
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>
2018-02-26Remove Time argument from xsetselDevin J. Pohly
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>
2018-02-26Make win variable internal to x.cDevin J. Pohly
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>
2018-02-26Inline clipboard functionsDevin J. Pohly
No need to keep a function that only calls another function in the same file. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Move config.h include from st.c to x.cDevin J. Pohly
config.h includes references to KeySyms and other X stuff. Until we come up with a cleaner way to separate configuration, it is simpler (leads to more code removal) to have this here. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Move window-manipulating functions into x.cDevin J. Pohly
xresize is now internal to x.c Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Move window urgency handling entirely into x.cDevin J. Pohly
This allows us to make xseturgency internal. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Move zoom functions into x.cDevin J. Pohly
This makes x(un)loadfonts internal to x.c. Needed to reorder includes and move a typedef to keep the compiler happy. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Move usage() to be with run() in x.cDevin J. Pohly
run/usage/xinit are now all internal to x.c Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2018-02-26Call xsetenv() in main process instead of childDevin J. Pohly
This makes xsetenv internal to x.c, and allows iso14755's external command to use $WINDOWID instead of having to snprintf it again. (The same benefit will apply to the externalpipe patch.) The xwinid function is no longer needed. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
2017-03-19Support xterm Ms feature to set clipboardosandov@osandov.com
This is used by, e.g., tmux.
2017-01-21Split X-specific code into x.cMichael Forney