aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-10 11:30:36 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commitd5275012b45149a2a6e94679609aacca478221ad (patch)
tree881a9c32d0d617fc472e23836779a7379c97e875 /x.c
parent3518dba2a5fb57f601b74528ddeb67f173e4024b (diff)
downloadst-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.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/x.c b/x.c
index f660ca3..426ca28 100644
--- a/x.c
+++ b/x.c
@@ -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);
90static int xgeommasktogravity(int); 90static int xgeommasktogravity(int);
91static void xinit(void); 91static void xinit(void);
92static int xloadfont(Font *, FcPattern *); 92static int xloadfont(Font *, FcPattern *);
93static void xloadfonts(char *, double);
93static void xunloadfont(Font *); 94static void xunloadfont(Font *);
95static void xunloadfonts(void);
94static void xsetenv(void); 96static void xsetenv(void);
95 97
96static void expose(XEvent *); 98static void expose(XEvent *);
@@ -165,6 +167,37 @@ static Fontcache frc[16];
165static int frclen = 0; 167static int frclen = 0;
166 168
167void 169void
170zoom(const Arg *arg)
171{
172 Arg larg;
173
174 larg.f = usedfontsize + arg->f;
175 zoomabs(&larg);
176}
177
178void
179zoomabs(const Arg *arg)
180{
181 xunloadfonts();
182 xloadfonts(usedfont, arg->f);
183 cresize(0, 0);
184 ttyresize();
185 redraw();
186 xhints();
187}
188
189void
190zoomreset(const Arg *arg)
191{
192 Arg larg;
193
194 if (defaultfontsize > 0) {
195 larg.f = defaultfontsize;
196 zoomabs(&larg);
197 }
198}
199
200void
168getbuttoninfo(XEvent *e) 201getbuttoninfo(XEvent *e)
169{ 202{
170 int type; 203 int type;