From 42eb247ea0c69ba8cc249b1bb44fafcdcbdd2621 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 17 Jul 2013 17:32:12 +0100 Subject: Add mupdf-curl app Windows and X11. Allows files to be fetched and displayed as they are downloaded both with and without linearization, using hints if available. --- platform/x11/win_main.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'platform/x11/win_main.c') diff --git a/platform/x11/win_main.c b/platform/x11/win_main.c index 51dada02..6ddd171a 100644 --- a/platform/x11/win_main.c +++ b/platform/x11/win_main.c @@ -25,7 +25,7 @@ static HWND hwndview = NULL; static HDC hdc; static HBRUSH bgbrush; static HBRUSH shbrush; -static BITMAPINFO *dibinf; +static BITMAPINFO *dibinf = NULL; static HCURSOR arrowcurs, handcurs, waitcurs, caretcurs; static LRESULT CALLBACK frameproc(HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK viewproc(HWND, UINT, WPARAM, LPARAM); @@ -644,11 +644,18 @@ void winopen() SetCursor(arrowcurs); } +static void +do_close(pdfapp_t *app) +{ + pdfapp_close(app); + free(dibinf); +} + void winclose(pdfapp_t *app) { if (pdfapp_preclose(app)) { - pdfapp_close(app); + do_close(app); exit(0); } } @@ -877,6 +884,11 @@ void winreloadfile(pdfapp_t *app) pdfapp_open(app, filename, 1); } +void winreloadpage(pdfapp_t *app) +{ + SendMessage(hwndview, WM_APP, 0, 0); +} + void winopenuri(pdfapp_t *app, char *buf) { ShellExecuteA(hwndframe, "open", buf, 0, 0, SW_SHOWNORMAL); @@ -1126,6 +1138,12 @@ viewproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) handlemouse(oldx, oldy, 0, 0); /* update cursor */ } return 0; + + /* We use WM_APP to trigger a reload and repaint of a page */ + case WM_APP: + pdfapp_reloadpage(&gapp); + break; + } fflush(stdout); @@ -1199,7 +1217,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow DispatchMessage(&msg); } - pdfapp_close(&gapp); + do_close(&gapp); fz_free_context(ctx); return 0; -- cgit v1.2.3