diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2017-10-10 11:30:36 -0500 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
commit | d5275012b45149a2a6e94679609aacca478221ad (patch) | |
tree | 881a9c32d0d617fc472e23836779a7379c97e875 /x.c | |
parent | 3518dba2a5fb57f601b74528ddeb67f173e4024b (diff) | |
download | st-d5275012b45149a2a6e94679609aacca478221ad.tar.gz st-d5275012b45149a2a6e94679609aacca478221ad.zip |
Move zoom functions into x.c
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>
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -21,8 +21,8 @@ static char *argv0; | |||
21 | #define Glyph Glyph_ | 21 | #define Glyph Glyph_ |
22 | #define Font Font_ | 22 | #define Font Font_ |
23 | 23 | ||
24 | #include "win.h" | ||
25 | #include "st.h" | 24 | #include "st.h" |
25 | #include "win.h" | ||
26 | 26 | ||
27 | /* XEMBED messages */ | 27 | /* XEMBED messages */ |
28 | #define XEMBED_FOCUS_IN 4 | 28 | #define XEMBED_FOCUS_IN 4 |
@@ -90,7 +90,9 @@ static void xdrawcursor(void); | |||
90 | static int xgeommasktogravity(int); | 90 | static int xgeommasktogravity(int); |
91 | static void xinit(void); | 91 | static void xinit(void); |
92 | static int xloadfont(Font *, FcPattern *); | 92 | static int xloadfont(Font *, FcPattern *); |
93 | static void xloadfonts(char *, double); | ||
93 | static void xunloadfont(Font *); | 94 | static void xunloadfont(Font *); |
95 | static void xunloadfonts(void); | ||
94 | static void xsetenv(void); | 96 | static void xsetenv(void); |
95 | 97 | ||
96 | static void expose(XEvent *); | 98 | static void expose(XEvent *); |
@@ -165,6 +167,37 @@ static Fontcache frc[16]; | |||
165 | static int frclen = 0; | 167 | static int frclen = 0; |
166 | 168 | ||
167 | void | 169 | void |
170 | zoom(const Arg *arg) | ||
171 | { | ||
172 | Arg larg; | ||
173 | |||
174 | larg.f = usedfontsize + arg->f; | ||
175 | zoomabs(&larg); | ||
176 | } | ||
177 | |||
178 | void | ||
179 | zoomabs(const Arg *arg) | ||
180 | { | ||
181 | xunloadfonts(); | ||
182 | xloadfonts(usedfont, arg->f); | ||
183 | cresize(0, 0); | ||
184 | ttyresize(); | ||
185 | redraw(); | ||
186 | xhints(); | ||
187 | } | ||
188 | |||
189 | void | ||
190 | zoomreset(const Arg *arg) | ||
191 | { | ||
192 | Arg larg; | ||
193 | |||
194 | if (defaultfontsize > 0) { | ||
195 | larg.f = defaultfontsize; | ||
196 | zoomabs(&larg); | ||
197 | } | ||
198 | } | ||
199 | |||
200 | void | ||
168 | getbuttoninfo(XEvent *e) | 201 | getbuttoninfo(XEvent *e) |
169 | { | 202 | { |
170 | int type; | 203 | int type; |