diff options
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; |
