diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-02-07 17:30:13 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-02-07 17:30:13 +0100 |
commit | af7f17d4b497a1cb9920112079e7170195cca5e3 (patch) | |
tree | 3781ef81d5bf551fd826795d986e9051236a16d9 /apps/win_main.c | |
parent | dbc1902a656104c3a76b5a1ff7b064a999e04af1 (diff) | |
download | mupdf-af7f17d4b497a1cb9920112079e7170195cca5e3.tar.xz |
Update windows viewer to latest changes.
Diffstat (limited to 'apps/win_main.c')
-rw-r--r-- | apps/win_main.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/apps/win_main.c b/apps/win_main.c index fcfd5020..c421fac7 100644 --- a/apps/win_main.c +++ b/apps/win_main.c @@ -20,7 +20,6 @@ #endif #define ID_ABOUT 0x1000 -#define ID_DOCINFO 0x1001 static HWND hwndframe = NULL; static HWND hwndview = NULL; @@ -166,100 +165,6 @@ char *winpassword(pdfapp_t *app, char *filename) } INT CALLBACK -dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - char buf[256]; - pdf_document *doc = gapp.pdf; - fz_obj *info, *obj; - - switch(message) - { - case WM_INITDIALOG: - - SetDlgItemTextW(hwnd, 0x10, wbuf); - - if (!doc) - { - SetDlgItemTextA(hwnd, 0x11, "XPS"); - SetDlgItemTextA(hwnd, 0x12, "None"); - SetDlgItemTextA(hwnd, 0x13, "n/a"); - return TRUE; - } - - sprintf(buf, "PDF %d.%d", doc->version / 10, doc->version % 10); - SetDlgItemTextA(hwnd, 0x11, buf); - - if (doc->crypt) - { - sprintf(buf, "Standard V%d %d-bit %s", pdf_get_crypt_revision(doc), - pdf_get_crypt_length(doc), pdf_get_crypt_method(doc)); - SetDlgItemTextA(hwnd, 0x12, buf); - strcpy(buf, ""); - if (pdf_has_permission(doc, PDF_PERM_PRINT)) - strcat(buf, "print, "); - if (pdf_has_permission(doc, PDF_PERM_CHANGE)) - strcat(buf, "modify, "); - if (pdf_has_permission(doc, PDF_PERM_COPY)) - strcat(buf, "copy, "); - if (pdf_has_permission(doc, PDF_PERM_NOTES)) - strcat(buf, "annotate, "); - if (strlen(buf) > 2) - buf[strlen(buf)-2] = 0; - else - strcpy(buf, "none"); - SetDlgItemTextA(hwnd, 0x13, buf); - } - else - { - SetDlgItemTextA(hwnd, 0x12, "None"); - SetDlgItemTextA(hwnd, 0x13, "n/a"); - } - - info = fz_dict_gets(doc->trailer, "Info"); - if (!info) - return TRUE; - -#define SETUCS(ID) \ - { \ - unsigned short *ucs; \ - ucs = pdf_to_ucs2(doc->ctx, obj); \ - SetDlgItemTextW(hwnd, ID, ucs); \ - fz_free(context, ucs); \ - } - - if ((obj = fz_dict_gets(info, "Title"))) - SETUCS(0x20); - if ((obj = fz_dict_gets(info, "Author"))) - SETUCS(0x21); - if ((obj = fz_dict_gets(info, "Subject"))) - SETUCS(0x22); - if ((obj = fz_dict_gets(info, "Keywords"))) - SETUCS(0x23); - if ((obj = fz_dict_gets(info, "Creator"))) - SETUCS(0x24); - if ((obj = fz_dict_gets(info, "Producer"))) - SETUCS(0x25); - if ((obj = fz_dict_gets(info, "CreationDate"))) - SETUCS(0x26); - if ((obj = fz_dict_gets(info, "ModDate"))) - SETUCS(0x27); - return TRUE; - - case WM_COMMAND: - EndDialog(hwnd, 1); - return TRUE; - } - return FALSE; -} - -void info() -{ - int code = DialogBoxW(NULL, L"IDD_DLOGINFO", hwndframe, dloginfoproc); - if (code <= 0) - winerror(&gapp, "cannot create info dialog"); -} - -INT CALLBACK dlogaboutproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) @@ -382,7 +287,6 @@ void winopen() menu = GetSystemMenu(hwndframe, 0); AppendMenuW(menu, MF_SEPARATOR, 0, NULL); AppendMenuW(menu, MF_STRING, ID_ABOUT, L"About MuPDF..."); - AppendMenuW(menu, MF_STRING, ID_DOCINFO, L"Document Properties..."); SetCursor(arrowcurs); } @@ -692,11 +596,6 @@ frameproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) winhelp(&gapp); return 0; } - if (wParam == ID_DOCINFO) - { - info(); - return 0; - } if (wParam == SC_MAXIMIZE) gapp.shrinkwrap = 0; break; |