diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-01-18 13:30:28 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-01-18 13:30:28 +0100 |
commit | b2c87fcd70b3f069388755baf7baa6b3c2590123 (patch) | |
tree | ce06e8c79926a4a7b2b9af7cd2b4761f24a42e24 /apps/win_main.c | |
parent | 4edaee4fafa76a5ac5daf873167ba0cda8af4bc4 (diff) | |
download | mupdf-b2c87fcd70b3f069388755baf7baa6b3c2590123.tar.xz |
Add fullscreen mode to mupdf viewer.
Toggle with 'f'. Fullscreen turns off shrinkwrap, and shrinkwrap turns
off fullscreen.
Diffstat (limited to 'apps/win_main.c')
-rw-r--r-- | apps/win_main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/win_main.c b/apps/win_main.c index 8ccdee65..4818c58b 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -553,6 +553,27 @@ void winrepaintsearch(pdfapp_t *app) InvalidateRect(hwndview, NULL, 0); } +void winfullscreen(pdfapp_t *app, int state) +{ + static WINDOWPLACEMENT savedplace; + static int isfullscreen = 0; + if (state && !isfullscreen) + { + GetWindowPlacement(hwndframe, &savedplace); + SetWindowLong(hwndframe, GWL_STYLE, WS_POPUP | WS_VISIBLE); + SetWindowPos(hwndframe, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED); + ShowWindow(hwndframe, SW_SHOWMAXIMIZED); + isfullscreen = 1; + } + if (!state && isfullscreen) + { + SetWindowLong(hwndframe, GWL_STYLE, WS_OVERLAPPEDWINDOW); + SetWindowPos(hwndframe, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED); + SetWindowPlacement(hwndframe, &savedplace); + isfullscreen = 0; + } +} + /* * Event handling */ |